• Welcome to ASR. 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!

RPi + CamillaDSP Tutorial

Worth adding to the tutorial: fix CamillaDSP's processing rate to a multiple of the source and enable rate switching, otherwise everything gets resampled and the bit-perfect path is gone. For sub integration keep the FIR taps modest - latency matters more than filter sharpness at 80 Hz - and measure the result instead of trusting the predicted response.
Thank you for the suggestions, however, I am not sure you understand the purpose / scope of the tutorial.

My motivation was to make a plug and play tutorial that anyone can use, regardless of experience level. As such, the primary focus is setting up a system with a working GUI that functions with physical input, ALSA loopback and USB gadget capture devices. The only "new" things I bring in the tutorial are OLED display and FLIRC integration, again focused on seamless integration with the GUI and ability to switch configurations as means of changing inputs.

To your suggestion of "enable rate switching". This is not a trivial exercise and requires something additional to a normal CamillaDSP installation such as camilladsp-controller and does NOT work with physical input capture devices. Because the controller manages how configurations are applied, it does not integrate well with the GUI and is best suited for the case where someone has a fully fleshed out configuration and only uses a single capture device that is an ALSA loopback or USB gadget.

To your suggestion regarding FIR filter design, this is completely outside the scope of the tutorial. FIR filter design is complicated, as illustrated by your statement regarding the relationship between FIR taps and latency. What matters for FIR latency is impulse peak location, NOT overall FIR tap count, you can make 100K+ tap FIR filters with negligible latency if the impulse peak occurs near t = 0 (0.1% centering in rePhase). The trade off is you obviously cannot have a linear phase filter doing this.

Michael
 
On a Pi 4 or 5 you can expose the USB-C port as a UAC2 gadget (dtoverlay=dwc2 plus g_audio), and Windows 10/11 enumerate UAC2 natively, so no driver is needed. The catch is that the Pi becomes the USB device, so you lose that port for power - power it from the GPIO header or a Y-cable. Worth testing with a loopback measurement to confirm the gadget rate follows the host.
 
I so far care not a whit about overall latency. I don't do live mixing, karaoke and for video everything runs through software that adjusts for lip sync.

What am I missing?

latency matters more than filter sharpness at 80 Hz
 
I use FIR 96dB Filter at 96kHz on my 2 Way Speaker around 1800Hz also i set it for my Subs at 100Hz, for test purpose, i watched an Blueray on stereo Setup and didn't noticed a lot off Latency without using Lipsync, but that was only an short Test and my Project is still not Ready for full 7.1 Tests, let see how much Latnecy i will realy get and how much Libsync i realy need at the End ;)

Build the FIR Filter with Rephase and 16xxx Taps.

At the End the good thing is, with CamillaDSP you are Free to try all you wan't and Listening by youre Self to make your own conclusions and Expiriences.

For my 2 Way Speaker i will never go back to less Steep Filters, If you move youre Head up and down whil listening with Steep Filters it sounded much better and less efected while moving the Head or standing up than on a let say 24dB Filter or Passive ;).
Also you could go deeper with Cutoff Frequency on Tweeter, it is more Protected, less Destortion also!!!

And the overall Sound get more precise and Cleaner but thats my Expiriences so every one need to get his own conclusions and Expirences ;)
 
On a Pi 4 or 5 you can expose the USB-C port as a UAC2 gadget (dtoverlay=dwc2 plus g_audio), and Windows 10/11 enumerate UAC2 natively, so no driver is needed. The catch is that the Pi becomes the USB device, so you lose that port for power - power it from the GPIO header or a Y-cable. Worth testing with a loopback measurement to confirm the gadget rate follows the host.

Based on this I don't think you've read the tutorial or have any practical experience using the USB gadget with CamillaDSP. All of this is covered in the section below.


To re-iterate, CamillaDSP will NOT follow the sample rate set by the host unless a separate controller is used to restart CamillaDSP at the appropriate sample rate. See below for examples of such controllers.


Michael
 
And now we got V5.2b ;)

Haha, that was a big motivation. I started testing V5 and I realized I never got around to updating the tutorial for V4! Figured it would be easier to update to V5 if I had everything updated to V4. To be honest the most time consuming part is just converting all the default configurations to the new version.

Michael
 
Based on this I don't think you've read the tutorial or have any practical experience using the USB gadget with CamillaDSP. All of this is covered in the section below.


To re-iterate, CamillaDSP will NOT follow the sample rate set by the host unless a separate controller is used to restart CamillaDSP at the appropriate sample rate. See below for examples of such controllers.


Michael
Thank you!

I knew about camilladsp-setrate, and used it, but I did not know about the other two projects. After upgrading to CamillaDSP version 4.1 a while back, I found out that camilladsp-setrate did not work with it. I ended up downgrading back to CamillaDSP version 3.0.1 to get camilladsp-setrate working again.

But, seeing the other two projects in your post, I decided to try camilladsp-controller with CamillaDSP version 4.1.3. It is working. The only issue for me is that camilladsp-controller is setup to use a single configuration file. I cannot change the configuration file on the fly in CamillaGUI like I could with camilladsp-setrate. When I change the configuration file CamillaDSP enters an inactive state.

Do you know whether gaudio_ctl works more like camilladsp-setrate, meaning that it will automatically change the samplerate when the streaming samplerate changes, and work with any configuration file I select in CamillaGUI?

Your insight is greatly appreciated.

Again, thank you!
 
Thank you!

I knew about camilladsp-setrate, and used it, but I did not know about the other two projects. After upgrading to CamillaDSP version 4.1 a while back, I found out that camilladsp-setrate did not work with it. I ended up downgrading back to CamillaDSP version 3.0.1 to get camilladsp-setrate working again.

But, seeing the other two projects in your post, I decided to try camilladsp-controller with CamillaDSP version 4.1.3. It is working. The only issue for me is that camilladsp-controller is setup to use a single configuration file. I cannot change the configuration file on the fly in CamillaGUI like I could with camilladsp-setrate. When I change the configuration file CamillaDSP enters an inactive state.

Do you know whether gaudio_ctl works more like camilladsp-setrate, meaning that it will automatically change the samplerate when the streaming samplerate changes, and work with any configuration file I select in CamillaGUI?

Your insight is greatly appreciated.

Again, thank you!

In general I don't think the rate change controllers work well with a GUI / state file setup and are designed to work with a single configuration file. I had some discussion with Henrik about camilladsp-controller and GUI interaction here -> https://www.diyaudio.com/community/...overs-room-correction-etc.349818/post-7919708. I don't think there have been any new developments since them but I may be wrong.

Michael
 
Last edited:
In general I don't think the rate change controllers work well with a GUI / state file setup and are designed to work with a single configuration file. I had some discussion with Henrik about camilladsp-controller and GUI interaction here -> https://www.diyaudio.com/community/...overs-room-correction-etc.349818/post-7919708. I don't think there have been any new developments since them but I may be wrong.

Michael

Michael

Thank you, Michael, for responding so quickly.

I just got gaudio_ctl working. With the help of ChatGPT I created a helper file, running in a python environment, to work with it to make CamillaDSP use the USB stream’s sample rate. It works; regardless of whether the streaming sample rate changes or I choose a different configuration file, CamillaDSP keeps playing. The functionality, at least from the user perspective, mimics what camilladsp-setrate does, but works with CamillaDSP version 4.1.3.

Terry
 
Thank you, Michael, for responding so quickly.

I just got gaudio_ctl working. With the help of ChatGPT I created a helper file, running in a python environment, to work with it to make CamillaDSP use the USB stream’s sample rate. It works; regardless of whether the streaming sample rate changes or I choose a different configuration file, CamillaDSP keeps playing. The functionality, at least from the user perspective, mimics what camilladsp-setrate does, but works with CamillaDSP version 4.1.3.

Terry

Very cool! Would you mind sharing?

Michael
 
Very cool! Would you mind sharing?

Michael
Absolutely. I put it in Google Docs. Here is the link:


Let me know whether you are able to access it.
 
From the v5.0.0-beta.1 release notes:

Does this mean we no longer need camilladsp-setrate or camilladsp-controller?
Per the developer, it still still needs more work and won't be ready until v6.

 
Hi. I was thinking of Camilla GUI port 5005. It can be justified for generic CamillaDSP installation, but @mdsimon2 guide for installing it on a Raspberry Pi should be different. You should default to http port 80, because there should not be any server farms running on the same Pi with an audio dsp processor. It should make reaching it easier when you can omit the port in a browser.
 
Back
Top Bottom