• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

RPi4 + CamillaDSP Tutorial

OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,360
Location
Detroit, MI
OK, so camillagui service is definitely not running. Can you post the output of cat ~/camilladsp/camillagui/config/camillagui.yml? And also post the terminal output when you start the GUI directly the terminal?

Michael
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,360
Location
Detroit, MI
OK, I think I was able to replicate your issue, it is a bit difficult to tell because your service camillagui status is truncated but I believe it is failing because you have something else that is using port 5000.

What else have you installed? If you have installed shairport-sync but have not updated the port to 6000 it will conflict with the GUI.

Michael
 

Elfsberg

Member
Joined
Feb 14, 2022
Messages
50
Likes
26
Location
Sweden, Falun
I must exit the GUI before I run any other commands.

Sorry for being a total n00b. :(

OK, I think I was able to replicate your issue, it is a bit difficult to tell because your service camillagui status is truncated but I believe it is failing because you have something else that is using port 5000.

What else have you installed? If you have installed shairport-sync but have not updated the port to 6000 it will conflict with the GUI.

Michael
Its a clean install per the guides instructions.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,360
Location
Detroit, MI
Try running sudo lsof -i -P -n and reporting the results. This should tell us if anything else is using port 5000. For reference mine looks like this:
Code:
michael6@raspberrypi6:~$ sudo lsof -i -P -n
COMMAND      PID            USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
systemd-n    702 systemd-network   17u  IPv4 1619863      0t0  UDP 192.168.86.37:68 
systemd-n    702 systemd-network   22u  IPv6  135968      0t0  UDP [fe80::9a48:27ff:fee1:c2c6]:546 
systemd-r    708 systemd-resolve   13u  IPv4   22665      0t0  UDP 127.0.0.53:53 
systemd-r    708 systemd-resolve   14u  IPv4   22666      0t0  TCP 127.0.0.53:53 (LISTEN)
avahi-dae    742           avahi   12u  IPv4   21236      0t0  UDP *:5353 
avahi-dae    742           avahi   13u  IPv6   21237      0t0  UDP *:5353 
avahi-dae    742           avahi   14u  IPv4   21238      0t0  UDP *:40756 
avahi-dae    742           avahi   15u  IPv6   21239      0t0  UDP *:44486 
shairport    817  shairport-sync    5u  IPv4   21353      0t0  TCP *:6000 (LISTEN)
shairport    817  shairport-sync    6u  IPv6   21354      0t0  TCP *:6000 (LISTEN)
sshd         859            root    3u  IPv4   21972      0t0  TCP *:22 (LISTEN)
sshd         859            root    4u  IPv6   21983      0t0  TCP *:22 (LISTEN)
python3     1220        michael6    6u  IPv4   25043      0t0  TCP *:5000 (LISTEN)
python3     1220        michael6    7u  IPv6   25044      0t0  TCP *:5000 (LISTEN)
squeezeli  47190            root    4u  IPv4  166934      0t0  UDP *:44841 
camillads 536216            root    3u  IPv4 2539649      0t0  TCP 127.0.0.1:1234 (LISTEN)
camillads 536216            root    5u  IPv4 2539650      0t0  TCP 127.0.0.1:1234->127.0.0.1:47358 (ESTABLISHED)
camillads 536216            root    9u  IPv4 2539686      0t0  TCP 127.0.0.1:1234->127.0.0.1:47362 (ESTABLISHED)
python3   536237            root    3u  IPv4 2539685      0t0  TCP 127.0.0.1:47358->127.0.0.1:1234 (ESTABLISHED)
python3   536240            root    5u  IPv4 2540628      0t0  TCP 127.0.0.1:47362->127.0.0.1:1234 (ESTABLISHED)
sshd      536245            root    4u  IPv4 2538411      0t0  TCP 192.168.86.37:22->192.168.86.31:57637 (ESTABLISHED)
sshd      536325        michael6    4u  IPv4 2538411      0t0  TCP 192.168.86.37:22->192.168.86.31:57637 (ESTABLISHED)

Michael
 

Elfsberg

Member
Joined
Feb 14, 2022
Messages
50
Likes
26
Location
Sweden, Falun
camilla@camilla:~$ sudo lsof -i -P -n
[sudo] password for camilla:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd-n 669 systemd-network 19u IPv4 19178 0t0 UDP 192.168.0.232:68
systemd-n 669 systemd-network 22u IPv4 19368 0t0 UDP 192.168.0.233:68
systemd-r 671 systemd-resolve 13u IPv4 2770 0t0 UDP 127.0.0.53:53
systemd-r 671 systemd-resolve 14u IPv4 2771 0t0 TCP 127.0.0.53:53 (LISTEN)
avahi-dae 704 avahi 12u IPv4 22173 0t0 UDP *:5353
avahi-dae 704 avahi 13u IPv6 22174 0t0 UDP *:5353
avahi-dae 704 avahi 14u IPv4 22175 0t0 UDP *:47852
avahi-dae 704 avahi 15u IPv6 22176 0t0 UDP *:50749
camillads 705 root 3u IPv4 22142 0t0 TCP 127.0.0.1:1234 (LISTEN)
sshd 822 root 3u IPv4 22585 0t0 TCP *:22 (LISTEN)
sshd 822 root 4u IPv6 22587 0t0 TCP *:22 (LISTEN)
sshd 921 root 4u IPv4 22709 0t0 TCP 192.168.0.233:22->192.168.0.215:50612 (ESTABLISHED)
sshd 1033 camilla 4u IPv4 22709 0t0 TCP 192.168.0.233:22->192.168.0.215:50612 (ESTABLISHED)

Nothing it seems. It's so weird.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,360
Location
Detroit, MI
OK, let's go back to running camillagui directly from the terminal and reporting the output.

It should look something like:

Code:
michael6@raspberrypi6:~$ python3 /home/michael6/camilladsp/camillagui/main.py 
Backend configuration:
active_config: /home/michael6/camilladsp/configs/camilladsp.yml
camilla_host: 0.0.0.0
camilla_port: 1234
coeff_dir: /home/michael6/camilladsp/coeffs
config_dir: /home/michael6/camilladsp/configs
default_config: /home/michael6/camilladsp/configs/camilladsp.yml
on_get_active_config: null
on_set_active_config: null
port: 5000
supported_capture_types: null
supported_playback_types: null
update_symlink: true
======== Running on http://0.0.0.0:5000 ========
(Press CTRL+C to quit)

Once you have done that exit the GUI (ctrl+c). Then run cat ~/camilladsp/camillagui/config/camillagui.yml and post the output.

Michael
 

threni

Major Contributor
Joined
Oct 18, 2019
Messages
1,280
Likes
1,529
Location
/dev/null
Yes, there are a lot of options here. Could definitely do what you suggest with a single button changing between multiple configurations or have an individual button for each configuration.

You cannot trigger off the configuration name because all that CamillaDSP sees is a a configuration called "camilladsp.yml" but it would be simple enough to create a variable to store the current configuration name and use that.

Michael
MoOde has a symlink from camilladsp.yml to the actual file; presumably you could interrogate/change the target then restart CamillaDSP?
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,360
Location
Detroit, MI
MoOde has a symlink from camilladsp.yml to the actual file; presumably you could interrogate/change the target then restart CamillaDSP?

I had tried messing with that a while back and never got it to work but may try again. Honestly not high on my list personally as I mostly change my configurations manually by copying the config I want to camilladsp.yml. :)

MIchael
 

Elfsberg

Member
Joined
Feb 14, 2022
Messages
50
Likes
26
Location
Sweden, Falun
By some kind of a miracle and a well executed guide and a huge lack of patience (mine) I think it's working now. :D

I'm now looking at the config.
I wanna stream PCM from my TV to me 2 chan Topping E30 DAC. Any pointers?

Nevermind, just found the documentation..

@mdsimon2 Big thanks for your help and patience. :)
 
Last edited:
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,360
Location
Detroit, MI
By some kind of a miracle and a well executed guide and a huge lack of patience (mine) I think it's working now. :D

I'm now looking at the config.
I wanna stream PCM from my TV to me 2 chan Topping E30 DAC. Any pointers?

Nevermind, just found the documentation..

@mdsimon2 Big thanks for your help and patience. :)

Great to hear!

Do you mind sharing what the issue was with the GUI? I am always interested in seeing what the stumbling blocks are.

I've attached a simple config that should work with the Hifiberry Digi+ I/O and the E30 to get you started. A few notes..

-I am currently assuming that your TV is outputting at a constant 48 kHz. If this doesn't work we may need to revisit that.
-I've set the chunk size lower than in my tutorial to help with lip sync issues. If you have drop outs we may need to increase that. If the audio seems delayed we may be able to decrease the chunk size further to help that.
-Rate adjust and async resampling are enabled to bridge the Hifiberry and E30 clock domains.
-Silence threshold is currently commented out so CamillaDSP will be running at all times.

Michael
 

Attachments

  • hifiberry.txt
    872 bytes · Views: 65

Elfsberg

Member
Joined
Feb 14, 2022
Messages
50
Likes
26
Location
Sweden, Falun
Great to hear!

Do you mind sharing what the issue was with the GUI? I am always interested in seeing what the stumbling blocks are.

I've attached a simple config that should work with the Hifiberry Digi+ I/O and the E30 to get you started. A few notes..

-I am currently assuming that your TV is outputting at a constant 48 kHz. If this doesn't work we may need to revisit that.
-I've set the chunk size lower than in my tutorial to help with lip sync issues. If you have drop outs we may need to increase that. If the audio seems delayed we may be able to decrease the chunk size further to help that.
-Rate adjust and async resampling are enabled to bridge the Hifiberry and E30 clock domains.
-Silence threshold is currently commented out so CamillaDSP will be running at all times.

Michael

Wow, now it's running! I just uploaded my convolution filters. :)

It's been years since I last used Linux (just had to replace Windows 8) so it's not completely new, but my knowledge is probably close to zero as of today.
100% I would not been able to make this work without your help. aplay and arecord -l was hard to decipher, I was getting alot more information than the examples posted on CamillaDSP github and just couldn't make use of it properly.

GUI issue might been just patience. I pulled the USB to reboot and maybe I was just too fast to try to log in to the GUI after establishing contact through ssh. Maybe, probably.

I might just be ordering one more RPI4 for usage in my bedroom. This stuff is just way too cool.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,360
Location
Detroit, MI
Added instructions to implement bluetooth input using bluez-alsa in Part 3. I don't believe my iPhone supports advanced codecs like LDAC or apt-X so I am using SBC which is definitely measurably worse than AirPlay. If you have the option use AirPlay over bluetooth. If your source supports those more advanced codecs you should be able to modify your bluealsa service to use those.

See below for some quick FFTs of my MOTU Ultralite Mk5 DAC output from a 1 kHz test tone played from Amazon Music HD from my iPhone.

AirPlay - THD+N = -94.5 dB
Airplay amazon 1 kHz THD+N.png


Bluetooth - THD+N = -70.3 dB
BT default amazon 1 kHz THD+N.png


I also ran in to some interesting things trying to find a suitable test tone on Amazon Music. Although advertised as CD quality some test tones are clearly not and appear to be using some sort of lossy compression. The above tests are using the test tone in the image below. Interestingly enough the 0 dB test tone from the same album is using lossy compression!

IMG_7564.PNG


The other interesting thing I noticed is that AirPlay from my MacBook Pro is slightly better from iPhone, I got around -97 dB THD+N when using the MacBook. I think this difference maybe due different resampling algorithms between the iPhone and MacBook.

Michael
 

jdubs

Member
Forum Donor
Joined
Mar 12, 2018
Messages
97
Likes
19
All, I just wanted to chime in with my experience with this setup. Its really been game changing. As a point of reference, my speakers are JBL 708Ps (powered with a couple of inputs including AES digital) and my music collection is on both digital files (locally on my network plus streaming via Spotify) as well as analog (turntable). I have a really nice balanced phono preamp and I just bought a Cosmos ADC.

Using Michael's guide, plus a couple of questions to him, I have it setup so that my steaming and local digital file playback is one configuration and my turntable is another configuration. For digital, everything get's upsampled via SOX to 192khz / 24bit before output via the Pi (digi+ AES hat). For analog, the turntable outputs to my phono preamp which then hits the Cosmos (converts to digital at 192khz) and on to the Raspberry Pi before its also output to the speakers.

I also have a remote so that I can source switch and change the volume.

Everything is soooo seemless (a huge thing for my girlfriend when she plays Spotify) and just easy. You can have a record playing and then hit a button to switch to streaming....its that easy.

Plus, everything is soooo small!

Anyway, huge kudos to Michael for this guide. Without him, I don't think I would have attempted something like this. Moode get's close but they don't have the USB input sorted out.

-Jim
 
Last edited:

hpix

New Member
Joined
Apr 17, 2022
Messages
2
Likes
0
This looks very interesting and I really would like practice this camillaDSP before I get my DAC. Is it possible to setup this so that it outputs to raspberry pi own headphone output and if so can somebody help to make the yaml file for it.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,360
Location
Detroit, MI
I have not done it but you should be able to use CamillaDSP with the headphone output. I’m out of town for the next week so can’t give you a specific yml but you should be able to modify an existing configuration. Here are a few pointers.

Run aplay -l to determine the device name for the headphone output (could probably also google this). Use this device name as your playback device.

You will need to specify 2 playback channels in devices and mixer. You will also need to eliminate unnecessary channels from mixer and filters.

I think a playback format of S32LE should work but am not sure.

As usual try to get CamillaDSP running directly from terminal first, if you have issues starting it the log should give you an indication of where things are going wrong.

Good luck!

Michael
 

hpix

New Member
Joined
Apr 17, 2022
Messages
2
Likes
0
I got it working with raspberry pi headphone output, but I used moOde to make it. I think it is easier for beginner. Also, I learned that moOde can output to Bluetooth audio, which sounds very interesting for rear speaker setup.

Now waiting for my DAC to arrive, it is Behringer UMC204HD. For price and availability it is better than Motu, let see how to get it running with this thing.

The camilladsp.yaml file I used is attached. It inputs from stdin and outputs to raspberry pi headphone. I also added filter to delay left channel 100 ms just for fun, and also some gain to both channels.
 

Attachments

  • camilladsp.yaml.txt
    1 KB · Views: 42

jdubs

Member
Forum Donor
Joined
Mar 12, 2018
Messages
97
Likes
19
I got it working with raspberry pi headphone output, but I used moOde to make it. I think it is easier for beginner. Also, I learned that moOde can output to Bluetooth audio, which sounds very interesting for rear speaker setup.

Now waiting for my DAC to arrive, it is Behringer UMC204HD. For price and availability it is better than Motu, let see how to get it running with this thing.

The camilladsp.yaml file I used is attached. It inputs from stdin and outputs to raspberry pi headphone. I also added filter to delay left channel 100 ms just for fun, and also some gain to both channels.

Moode is easier, for sure...but not as flexible as the solution offered here.

-Jim
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,644
Likes
2,253
Hi team,
I am looking into setting up the oled display for camilladsp as well, but I find the display Michael uses too big for my needs. I would be happy with just the volumen displayed, anything extra doesn't really matter to me.

I have searched here and in diyaudio but I am struggling to find anyone else that has built and published such a thing. Can anyone give any directions?
Thanks!
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,360
Location
Detroit, MI
Hi team,
I am looking into setting up the oled display for camilladsp as well, but I find the display Michael uses too big for my needs. I would be happy with just the volumen displayed, anything extra doesn't really matter to me.

I have searched here and in diyaudio but I am struggling to find anyone else that has built and published such a thing. Can anyone give any directions?
Thanks!

There are a lot of different options and I tried a few before landing where I did.

I started off using a basic 4X20 LCD -> #51. These displays are really simple to implement as they have built in font tables and you can send strings directly to the display. The issue with these displays is that the text size is small, they don't look that great and the overall size of the display is rather large. Some quick example code (using minidsp-rs instead of camilladsp but similar concept) can be found here -> #39.

I then moved to an OLED display with a SSD1322 controller as shown here -> #571. This display was too tall to fit in a 1RU enclosure which is why I didn't end up using it. The particular display was this one -> https://newhavendisplay.com/2-7-inch-white-graphic-oled-module/. New Haven Display have a bunch of example code so this one was pretty easy to get working. These graphical OLED displays are a bit harder to use as you need to provide a font table but I've gotten pretty adept at generating font tables using The Dot Factory and can definitely walk you through the process (I tried out a bunch of different fonts before I landed on the one I did).

The display I ended up using -> https://www.buydisplay.com/white-3-2-inch-arduino-raspberry-pi-oled-display-module-256x64-spi also uses a SSD1322 controller but for some reason was not quite a drop in replacement for the New Haven Display. Using the same code as the New Haven Display I was getting inverted text but was able to fix this by playing around with the registers. Like New Haven Display, buydisplay.com have a bunch of different displays that may work as well as example code.

Anything with a SSD1322 controller and the ability to use 6800 8 bit would be a relatively drop in replacement. Unfortunately a lot of these displays are on the large side so if you are looking for something smaller there may not be great options. I am sure you could get other displays working but it would require some exploration of the particular data sheet to understand the differences in implementation.

Michael
 
  • Like
Reactions: MCH

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,644
Likes
2,253
Thanks Michael, impressive summary, as usual.

As a bit of background, while waiting for the minidsp flex to be in stock again i decided instead to go all in with a Motu M4 + camilladsp using your instructions including the flirc remone and the display :D

I also decided that i dont want to have a black box anymore on sight and this is something that the Motu allows me to do: I can put everything in a cabinet and hide a little display with the volume and the flirc receptor behind a little panel of dark glass. The only "problem" is that i find the display you use a little bit too big and the glass pannel solution would not be that small anymore and i am afraid it ends up looking like a DIY Frankenstein.

btw, to my surprise, i found someone here in ASR that did exactly the same i want to do (+ the flirc receptor). I would like mine to be even smaller.


index.php


My problem is that i cannot program anything, and the moment i need to change anything to troubleshoot or modify something, it becomes a no go for me, so i guess i will go for your solution as i dont think i will find what i wanted. I have searched a lot and i could find some other displays with the same specs and a bit smaller, but just a bit (2.8" instead of 3.2")

I have also found that Audiophonics sells one that seems to match the requirements, ships from France and is cheaper, so this will be what i will probably order:


When i set it up and see in real how it looks like, i might ask you how to "erase" some of the info your code makes it show (i.e. sample rate).

Lets see how it ends up :D
 
Top Bottom