• 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!

RPi + CamillaDSP Tutorial

Virtual crossover with CDSP

Though not Raspberry Pi specific. I thought enough people in this thread are interested in CDSP to share. CDSP is teaching me a lot about sound, it's almost like a small science project by now.

I made a major cleaning of my living space (irregular with open Kitchen and open to another room - not idea listening space, but this is where I spend the majority of my time, so it just has to work!). Among other things I cleared the adjacent room of a lot of stash boxes and large empty packaging (like boxes for speakers, subwoofers, PC monitors etc). Unfortunately it had quite detrimental acoustic effect, so I decided I wanted to recalibrate my speakers. I never had a really good stereo image as I only did a combined L+R correction anyway.

During measurements, I noticed the left speaker was consistently arriving 0.7ms late in my listening position. Moving the speaker is not an option, as it's already far out in the room, and I would risk knocking it over walking past it.

My speakers in this room are KEF LSX II with a subwoofer connected. Unfortunately, that means I have no control over the subwoofer from within CDSP, but that the bass high/lowpass is handled in the KEF speakers and the sub itself. CDSP just outputs full left and right channel via USB directly into the LSX speakers.

Delaying the right channel by 0.7ms (to match the delay of the left channal) was a noticeable improvement in the phantom image. It's now dead center and much more strongly defined. From playing around with the delay, I can even move the phantom center left and right (for example a 1.7ms delay moves the center close to the left speaker).

But with 0.7ms delay on the right channel, it also means the subwoofer get a down-mixed mono signal with a delay of 0.7ms in the right channel. Not ideal.

Enter virtual crossover:
Screenshot 2024-10-09 at 16.26.56.jpg

The high and lowpass are 8th order Linkwitz–Riley filters at the same frequency that I have the sub crossed over.

Whether it's worth it is another matter. The way I think of it, an 85Hz wavelength is 4 meters, and a 0.7ms delay is 24 cm. Or the delay of the right channel is 6%. If this is audible in the down-mixing to mono is probably questionable. With lower frequencies it's, of course, even more negligible.

To test it out, I applied a 200Hz lowpass filter at the end of the chain to only play bass. And increased the delay to 30ms to get a more pronounced effect. Which produces a noticeable echo. A quick test was measuring the SPL which yielded 2.3dB more with the highpass filter than without.

I hope that by getting the left speaker in phase I can get rid of some dips in the frequency response, and need to do a lot more measurements and perhaps play around with the steepness of the filter to negate any weirdness the the delay may cause in the crossover region.

Maybe someone else is interested in the method (probably a lot of you know this is possible already), but I was excited to share...
 
Edit: Problem solved. It was the USB cable. It's a 5 meter cable from the same brand I use for my other speakers/RPi. Except this cable is USB-C to C where the working cable is USB-C to A.

I usually used the RPi as a streaming interface. But today I connected it with USB to a MacBook because I wanted to do a measurement. I got all these weird sample rate changes even if I only allowed 44.1 when I enabled the USB gadget (c_srate=44100 as per the guide).

Some weeks ago I installed setrate for other reasons (wanted to test out the "Automatic reloading of a valid configuration" but gave up). As I thought setrate was the culprit, I used the command "sudo rm /etc/systemd/system/camilladsp-setrate.service" to remove setrate.

Setrate is not found running when checking with "sudo systemctl status camilladsp-setrate", but the problem persists.

I don't know what to do besides reinstalling completely which is quite a few hours of work with all I have set up so far. Before doing that, does anyone have an idea what is going on?

Screenshot 2024-10-16 at 23.31.42.jpg
 
Last edited:
Hey all, trying to do this on a Raspberry Pi 3a+ and having issues. I have 32-bit Pi OS Lite running on the device and follow the instructions, except I change camilladsp-linux-aarch64.tar.gz to camilladsp-linux-armv7.tar.gz. Other than that, I change nothing else. Everything appears to work correctly however I cannot access the UI via web browser when I go to http://dac:5005. "dac" is the hostname I set in Pi Imager. Also, I set my username to "pi", which is my username as set in Pi Imager, in the two steps that mention it. I do not do steps 7 and 8. Does anyone have any idea what I am doing wrong?
 
Last edited:
Hey all, trying to do this on a Raspberry Pi 3a+ and having issues. I have 32-bit Pi OS Lite running on the device and follow the instructions, except I change camilladsp-linux-aarch64.tar.gz to camilladsp-linux-armv7.tar.gz. Other than that, I change nothing else. Everything appears to work correctly however I cannot access the UI via web browser when I go to http://dac:5005. "dac" is the hostname I set in Pi Imager. Also, I set my username to "pi", which is my username as set in Pi Imager, in the two steps that mention it. I do not do steps 7 and 8. Does anyone have any idea what I am doing wrong?
Try with the machine IP instead of its hostname, something like http://192.168.xxx.xxx:5005
 
Hey all, trying to do this on a Raspberry Pi 3a+ and having issues. I have 32-bit Pi OS Lite running on the device and follow the instructions, except I change camilladsp-linux-aarch64.tar.gz to camilladsp-linux-armv7.tar.gz. Other than that, I change nothing else. Everything appears to work correctly however I cannot access the UI via web browser when I go to http://dac:5005. "dac" is the hostname I set in Pi Imager. Also, I set my username to "pi", which is my username as set in Pi Imager, in the two steps that mention it. I do not do steps 7 and 8. Does anyone have any idea what I am doing wrong?

When you say everything appears to work correctly does that mean you have sound?

When working with different operating systems / hardware from those specified in the tutorial, it is best to get everything running manually first. Can you please share the output of "service status camilladsp" and "service status camillagui"? I assume at a minimum your camillagui service will report an error.

Michael
 
When you say everything appears to work correctly does that mean you have sound?

When working with different operating systems / hardware from those specified in the tutorial, it is best to get everything running manually first. Can you please share the output of "service status camilladsp" and "service status camillagui"? I assume at a minimum your camillagui service will report an error.

Michael
Hi, sorry for the confusion. I meant to say "everything in the tutorial appeared to install on the pi with no clear indicators of errors/failure". I have not attempted to get sound yet; still need to do quite a bit to get to that point and I am only starting with the installation of Camilla and your GUI. Also tried using "static ip":5005 instead of "hostname":5005. Thanks for the tip on the service statuses. DSP was good, GUI gave this error:

× camillagui.service - CamillaDSP Backend and GUI
Loaded: loaded (/lib/systemd/system/camillagui.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Mon 2024-11-04 10:08:24 EST; 5min ago
Duration: 1.754s
Process: 791 ExecStart=python3 camilladsp/camillagui/main.py (code=exited, status=1/FAILURE)
Main PID: 791 (code=exited, status=1/FAILURE)
CPU: 1.748s

Nov 04 10:08:24 dac python3[791]: app.router.add_static("/config/", path=app["config_dir"])
Nov 04 10:08:24 dac python3[791]: File "/usr/lib/python3/dist-packages/aiohttp/web_urldispatcher.py", line 1124, in a>
Nov 04 10:08:24 dac python3[791]: resource = StaticResource(
Nov 04 10:08:24 dac python3[791]: ^^^^^^^^^^^^^^^
Nov 04 10:08:24 dac python3[791]: File "/usr/lib/python3/dist-packages/aiohttp/web_urldispatcher.py", line 559, in __>
Nov 04 10:08:24 dac python3[791]: raise ValueError(f"No directory exists at '{directory}'") from error
Nov 04 10:08:24 dac python3[791]: ValueError: No directory exists at '/home/pi/camilladsp/configs'
Nov 04 10:08:24 dac systemd[1]: camillagui.service: Main process exited, code=exited, status=1/FAILURE
Nov 04 10:08:24 dac systemd[1]: camillagui.service: Failed with result 'exit-code'.
Nov 04 10:08:24 dac systemd[1]: camillagui.service: Consumed 1.748s CPU time.
 
It looks like you are missing the directory /home/pi/camilladsp/configs. This is typically created in step 3, this also happens to be the step where the camilladsp binary is downloaded and unpacked. As you were using a different binary from the tutorial I bet this was missed.

Can you confirm by running "ls" from /home/pi? I assume you will not see coeffs and configs directories. If that is the case try running "mkdir ~/camilladsp ~/camilladsp/coeffs ~/camilladsp/configs" and then "sudo service camillagui restart".

Michael
 
It looks like you are missing the directory /home/pi/camilladsp/configs. This is typically created in step 3, this also happens to be the step where the camilladsp binary is downloaded and unpacked. As you were using a different binary from the tutorial I bet this was missed.

Can you confirm by running "ls" from /home/pi? I assume you will not see coeffs and configs directories. If that is the case try running "mkdir ~/camilladsp ~/camilladsp/coeffs ~/camilladsp/configs" and then "sudo service camillagui restart".

Michael
Really, weird... You are correct, the coeffs and config directories failed to generate. The only thing I changed was a few pieces of the whole code block, so I don't know what happened and why it occured multiple times. The only way I could get mkdir to work was by executing it in its own line, without the rest of the code block. All fixed. Thanks!
 
The problem with the UR23 has been solved, it is recognized correctly again.

Can you share details of what hardware revision and operating system you were using? I just tried this again on my RPi 5 rev 1.0 running Raspberry Pi OS 64 bit lite and it was not recognized correctly. pinout and uname -a results shown below for reference.

Code:
Description        : Raspberry Pi 5B rev 1.0
Revision           : c04170
SoC                : BCM2712
RAM                : 4GB
Storage            : MicroSD
USB ports          : 4 (of which 2 USB3)
Ethernet ports     : 1 (1000Mbps max. speed)
Wi-fi              : True
Bluetooth          : True
Camera ports (CSI) : 2
Display ports (DSI): 2

Code:
Linux raspberrypi2 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux

Michael
 
@mdsimon2

you're right, new update old bugs f**k

aplay -l
Code:
card 4: Audio [Bravo-X USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: Audio [Bravo-X USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

:mad:
 
REW using RPi Gadget as Output Device.
Having set up Gadget Mode as Input Device on CamillaDSP using a Motu M4 on a RPi 4, I tried powering it using a USB A to USB C cable from my Win 11 laptop and after trying several different cables, succeeded in being able to config REW Output device to "Speakers ( Source/Sink)".
Waiting impatiently for the recommended USB-C power/data splitter to try on a RPi 5.
The screengrab shows the REW Prefs that works with a UMIC-1 microphone and Gadget input.
 

Attachments

  • REW to Gadget ModeRPi.jpg
    REW to Gadget ModeRPi.jpg
    239.2 KB · Views: 47
Hi, I'm new to moode with RPI4, I've migrated from volumio because I want to be able to output 3 audio channels via HDMI to my AVR (to apply room correction to a 2.1) after reading in several places that it was possible with moode and camilladsp.

I can use the "HDMI-1" output normally and even play CD-DTS (the AVR receives it as a "multichannel input"), which is much more than what volumio is capable of.

But I can't configure camilladsp to route the 8 HDMI channels via Serapado (or at least the 3 I need), in the end I always get this error "pipeline outputs 2 channels, playback device has 8"

Captura de pantalla (6).png




Captura de pantalla (7).png
Captura de pantalla (8).png
Captura de pantalla (9).png
Captura de pantalla (10).png
 
and how do I do it right?

Isn't that how the mixer is configured?

Captura de pantalla (9).png



I'm supposed to be able to click "apply to DSP" after configuring the image, but it won't let me.
 
In your pipeline screenshot, see where it says "Filter"? You can add a new pipeline step and change that to "Mixer" and add your 2x8 mixer.

The GUI section of the tutorial talks you through each section and how to use them -> https://github.com/mdsimon2/RPi-CamillaDSP#gui.

Michael
 
ahhh, ok I'm going to read it carefully and try again.

Thanks for shedding light on the problem.
 
Sorry to come back with more problems.

I'm trying out several filters to learn how to use Camilla properly. I've successfully implemented wav impulse filters made in REW and Rephase without too many problems, but I'm unable to do something as easy as implementing a "YAML" parametric equalization filter.

In the REW part, I select "eq camilladsp filters", generate the equalization and export it as "save filter settings to YAML file", the first question comes up in the dialog box that opens when I do this. The first one I think is to add a label, if you want... and the second one is to put the number of the pipeline channel in which it will be used... is that correct?

I play in camilladsp, in filters when trying to implement the yaml file this happens:

Captura de pantalla (11).png


If I make this selection of options, it doesn't give me an error, but when I play it, the channel sounds really bad and distorted.

Captura de pantalla (12).png


I would appreciate a brief explanation of how to successfully load YAML filters in Camilladsp. I have spent hours reading and searching for how to do it and I have not found anything beyond quick references.
 
I have never used the REW export functionality, but reading the Export Filters from REW section of the CamillaDSP GitHub indicates it generates a partial CamillaDSP YML configuration file that is intended to be pasted into your CamillaDSP configuration file.

REW can automatically generate a set of filters for correcting the frequency response of a system. REW V5.20.14 and later is able to export the filters in the CamillaDSP YAML format.

  • Go to the "EQ Filters" screen. Expand the "Equalizer" section in the list on the right side.
  • Select "CamillaDSP" as Manufacturer and "Filters" as Model.
  • Expand the "Filter Task" section and click "Save filter settings to YAML file".
    • This opens a popup with the the text "Enter the label to use for each filter, the filter number will be appended to the label". This allows identification of the filter set.
Note that the generated YAML file is not a complete CamillaDSP configuration. It contains only filter definitions and pipeline steps, that can be pasted into a CamillaDSP config file.

Can you please share the YAML file generated by REW (you may need to rename the file with a .txt extension)? How I expect it to work is that it will be only the "filters" section of the configuration which you can then paste into your existing CamillaDSP configuration file. Once pasted into the configuration file the filters will appear in the GUI and can be assigned in the pipeline.

Michael
 
Back
Top Bottom