• 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,515
Likes
3,369
Location
Detroit, MI
@mdsimon2 - Hi, I will give a try CamillaDSP on linux (I tried to make it run on Win with absolutely no success)
From this point:
1/. Will the tutorial from beginning of the tread work for installation on Ubuntu desktop 20.04? I am using Ubuntu since ver 12 (almost 20 years now :):) ) and very comfortable with workflow - don't want to open another fight front except CamillaDSP by learning UB Server at the same time :)
2/. Does Camilla DSP resample? I have TOSLINK-USB adapter with up to 192kHz capability and USB-DAC with 386kHz capability, so they will take virtually everything without need of resampling. Will CamillaDSP push it to resample or can it just keep original sample rate (sometimes 44,1, sometimes 48 96 or 192 - all depends what source I play in WIIM Pro I have). In other words 44,1kHz in =>44,1kHz out or 192kHz in => 192kHz out etc, etc?
Thank you for answering :)

It will be helpful if you describe your desired signal routing as that will change the answer to your questions.

1. You can use 20.04 but it uses an older kernel which may not work well with some DACs. It sounds like you are using the desktop version which I believe by default uses Pulse Audio which might cause some issues. Overall 20.04 can work but it might require some troubleshooting on your end and there is no guarantee it will be plug and play like the process described in the tutorial.

2. CamillaDSP can resample but doesn't need to. The biggest issue is detecting rate changes. If you are using your linux computer (I take it you aren't using a RPi4?) as a source you can implement the alsa_cdsp plugin to change rates based on the file being played, see here -> https://github.com/scripple/alsa_cdsp and here -> #869 for more info.

If you are using a RPi4 in USB gadget mode you can use gaudio_ctl to switch rates, see here -> https://github.com/pavhofman/gaudio_ctl and here -> #41 for more info but you will need to use a newer kernel for this to work.

Again need more info on signal routing as if you plan on using a capture device with a different clock than your playback device like in the case of a TOSLINK to USB capture card and a USB DAC you will need to resample to bridge the clock domains. In general if you use a SPDIF input you will need some way of keeping the input sample rate constant by implementing resampling upstream of CamillaDSP. This is describe in a bit more detail in the tutorial.

Michael
 

WohnW

Member
Joined
Aug 31, 2022
Messages
7
Likes
1
It will be helpful if you describe your desired signal routing as that will change the answer to your questions.

1. You can use 20.04 but it uses an older kernel which may not work well with some DACs. It sounds like you are using the desktop version which I believe by default uses Pulse Audio which might cause some issues. Overall 20.04 can work but it might require some troubleshooting on your end and there is no guarantee it will be plug and play like the process described in the tutorial.

2. CamillaDSP can resample but doesn't need to. The biggest issue is detecting rate changes. If you are using your linux computer (I take it you aren't using a RPi4?) as a source you can implement the alsa_cdsp plugin to change rates based on the file being played, see here -> https://github.com/scripple/alsa_cdsp and here -> #869 for more info.

If you are using a RPi4 in USB gadget mode you can use gaudio_ctl to switch rates, see here -> https://github.com/pavhofman/gaudio_ctl and here -> #41 for more info but you will need to use a newer kernel for this to work.

Again need more info on signal routing as if you plan on using a capture device with a different clock than your playback device like in the case of a TOSLINK to USB capture card and a USB DAC you will need to resample to bridge the clock domains. In general if you use a SPDIF input you will need some way of keeping the input sample rate constant by implementing resampling upstream of CamillaDSP. This is describe in a bit more detail in the tutorial.

Michael
Hi Michael,
This is the setup I want to run. I don't insist on desktop system if you say it's better to use server. Is Ubuntu Server 22.04.2 LTS (current stabile version) OK for such purpose?
1688086682200.png
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,369
Location
Detroit, MI
Thanks for the detailed diagram, that helps.

I've run Ubuntu 20.04 with a DIYINHK 8 channel I2S board in the past so I don't think you will have any issues with that. I haven't used the S2 digi with 20.04 but imagine it will work fine.

I don't know much about the Wiim Pro but you'll need to have it resample to a constant sample rate or you'll need an ASRC between the Wiim Pro and the S2 digi. You will also need to use resampling and rate adjust in CamillaDSP as the S2 digi and the DIYINHK I2S board as they have different clocks.

Michael
 

HenrikEnquist

Member
Joined
Jul 1, 2021
Messages
82
Likes
110
I don't know about the S2 digi, but in general soundcards and interfaces with spdif input are very poor at handling changes in the spdif input sample rate. You select the rate when opening the device from the application, and this needs to match the incoming rate. A mismatch often leads to garbage or no data being recorded.
 

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,759
Likes
3,067
I don't know about the S2 digi, but in general soundcards and interfaces with spdif input are very poor at handling changes in the spdif input sample rate. You select the rate when opening the device from the application, and this needs to match the incoming rate. A mismatch often leads to garbage or no data being recorded.
Any idea why? I assume the receivers are capable of detecting the change, so is it just a problem signaling the change to the host computer?
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,369
Location
Detroit, MI

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,655
Likes
2,262
On a complete noob level, what can be easily done is to measure the incoming sample rate when using a spdif to i2s interface. I do it just to show it on the display and to reprogram the receiver if necessary, but I wonder if that information could be passed to camilladsp in a timely manner to apply the necessary changes (?)
 

grizaudio

Member
Joined
Jan 3, 2021
Messages
30
Likes
7
Although obvious, I just wanted to chime in and confirm the tutorial provides a working solution using Roon bridge (running on RPi4) also.
This is helpful if you don't want Roon hosting EQ/filters.

ATM, I have CamillaDSP capturing @ 96khz and outputting at 96khz. Roon, automatically noted the sampling rate requirement to 96khz, and resamples content as needed.

This enables me to feed new sources via the Motu's optical input if/when needed.
 

grizaudio

Member
Joined
Jan 3, 2021
Messages
30
Likes
7
@mdsimon2, thanks for your guide, and motu configuration files.
Without these, I would have absolutely struggled.

Can I ask, do you know the input numbers for spdif on the Motu mk5 UL? I wanted to create a config file from the toslink version I created.
I don't currently have a Spdif source.

Many thanks
 

grizaudio

Member
Joined
Jan 3, 2021
Messages
30
Likes
7
I have been hearing some intermittent discrete 'beeps' and small glitches during playback, which the Roon convolver doesn't do... Trying to diagnose atm.
I wasn't experiencing this with LMS/CamillaDSP.

I have so far I have updated all packages, rebooted the pi4, Re-enabled resampling check box, even though Roon was doing upsampling.
Just monitoring now. Config file attached.

1688725077461.png
 

Attachments

  • ULM5_USBStream_96_96.zip
    838 bytes · Views: 34
Last edited:

forcedfx

Member
Joined
Jun 9, 2023
Messages
7
Likes
4
Just have to say I am loving being able to run a DSP on my Libre Le Potato AML-S905X-CC and have a fully digital 48kHz signal going from my Chromecast to my amplifier all for pretty dang cheap. My setup is Chromecast -> MS2109 HDMI USB Video Capture -> CamillaDSP (Ubuntu 22.04 base) -> CM6206 USB Sound Card ->TosLink Amplifier. Getting it all setup took some time but it works so well other than the cheapo MS2109 being a PITA if the CamillaDSP service is restarted/reboots but that doesn't happen very often. I originally wanted to us an HDMI audio extractor to get the audio from the Chromecast to the CM6206 but they wouldn't talk to each other over TosLink. This setup gives me two channels of digital audio in and 8 channels of digital audio out.

The Raspberry Pi's are so stupid expensive right now and I already had the Le Potato so I gave it a shot. Right now I only have 5 filters applied to each of the 8 channels but the DSP process is only using around 10% of the board's CPU. The GUI interface outs more of a load on the device than anything else.
 
Last edited:

grizaudio

Member
Joined
Jan 3, 2021
Messages
30
Likes
7
Just confirming for others that might be considering running Ubuntu 23.04 server.
(GNU/Linux 6.2.0-1007-raspi aarch64)
The tutorial works perfectly.

In my case, just seeing if the latest 6.2.0 kernel helps support the motu better in my setup.
Seems like things are stable now...
 
Last edited:

McFly

Addicted to Fun and Learning
Joined
Mar 12, 2019
Messages
905
Likes
1,877
Location
NZ
Hi mdisimon, thanks for this tutorial. I'd like to give this a try, what extra equipment do you recommend I get to make below work?

Currently using a bluesound node > usb to DAC > power amplifier. Only 2.0 in this system. Already have a spare rpi4. What would I need to get either: the USB or the Coax SPDIF from the node into the Rpi4, and I assume something that would have an ASRC as you mentioned CamillaDSP needs a fixed sample rate? I think the node switches output sample rate based on the source (spotify 44.1, HDMI arc in 48khz etc)

Would love to tinker with a budget DSP into this setup, room modes mainly.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,369
Location
Detroit, MI
Hi mdisimon, thanks for this tutorial. I'd like to give this a try, what extra equipment do you recommend I get to make below work?

Currently using a bluesound node > usb to DAC > power amplifier. Only 2.0 in this system. Already have a spare rpi4. What would I need to get either: the USB or the Coax SPDIF from the node into the Rpi4, and I assume something that would have an ASRC as you mentioned CamillaDSP needs a fixed sample rate? I think the node switches output sample rate based on the source (spotify 44.1, HDMI arc in 48khz etc)

Would love to tinker with a budget DSP into this setup, room modes mainly.

If the Bluesound Node does not have the option to output a constant sample rate but has a USB output a good approach is to use the RPi4 in USB gadget mode and use @phofman's gaudio_ctl to have CamillaDSP switch sample rates. There are some instructions on how to do this here -> Using a Raspberry Pi as equaliser in between an USB Source and USB DAC, although these days if you are using a recent Linux distro you won't need to compile a new kernel.

Michael
 

McFly

Addicted to Fun and Learning
Joined
Mar 12, 2019
Messages
905
Likes
1,877
Location
NZ
Thanks for that - interesting, looks like I've got some more linux learning to do. Could be touch and go as I'm not sure how the node will respond to being connected to the Rpi 4 but this should keep me busy for a while..
 

OfficialChill

Member
Joined
Dec 6, 2021
Messages
38
Likes
87
Hello I am having an issue with my rPi running PiOS lite + Shairport, using ALSA loopback and a type C Apple dongle as my DAC

When I use:
/home/username/camilladsp/camilladsp -p 1234 /home/username/camilladsp/configs/appledongle.yml -v
I am able to connect to Shairport, and have now successfully configured it so that music plays with no issue - I did have to enable resampling since the Apple dongle only works with 48kHz I believe

However, despite setting the ExecStart service and enabling it, I can connect to Shairport but no music plays, and CamillaGUI shows "State: Offline"

The Appledongle.yml config file shows up in CamillaGUI, I have pressed the Active button and pressed the rotating arrow to load into GUI.

Does this seem like something wrong with the service that autostarts camilladsp, given that the service works as expected when starting camilladsp manually
 
Last edited:
Top Bottom