CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.

@kerux: What Henrik means is that your need to make sure your USB host is playing before you start capture in CDSP. Since it's a major condition, there are several wrappers for the usb audio gadget which monitor the gadget device status and start CDSP after playback starts on the host - the easiest to configure is specialized gadget -> CDSP tool https://www.diyaudio.com/community/threads/sample-rate-switcher-for-camilladsp.403054/

As a side note - IMO using plughw for the gadget device may result in expensive resampling in alsa if CDSP opens the device with non-native rate - something better to avoid. Just using hw:Gadget... should do.
 

TNT

Member
Joined 2003
Paid Member
A BW first order (6dB/oct) LP at 5k... -3dB at Fo.... +1oct (10k) = -9ish? + 2oct (20k) -15ish... or?

Is -24dB @ 20k really OK?

1st5k24dBdownAt20k.jpg


//
 
Yes the new way is to use the statefile, -s. The old way with symlinks was clunky and didn't work on windows. With a statefile you can start camilladsp with just the statefile, and then it will use the config file given in the statefile. If you give a config on the command line, that will override what you have in the statefile, so not recommended when you use the gui.
Bear with me while I'm confusing myself. Current service file with v1 reads
ExecStart=/usr/bin/camilladsp -p 1234 /home/pi/camilladsp/active_config.yml

Would this be leading to success with v2?
ExecStart=/usr/bin/camilladsp -p 1234 -s /home/pi/camilladsp/state.yml

How is this file formatet? Is it the complete config or simply a pointer? If pointer can it use relative path to the statefile itself?
 

TNT

Member
Joined 2003
Paid Member
Trying to run on my MacOS laptop / conda:


(camillagui) MBPr-2:gui MBPr$ python main.py


Traceback (most recent call last):

File "/Users/MBPr/Camilladsp/gui/main.py", line 4, in <module>

from camilladsp import CamillaClient

ModuleNotFoundError: No module named 'camilladsp'


//
 
The statefile is a small yml file that holds the path to the config and the mute+volume settings. Just run the camilladsp command in a terminal, it will create the statefile if it doesn't exist.
Thanks Henrik. Sorry but something might have changed or I'm still confusing myself. Here I'm expecting the statefile to be created in the same directory as camilladsp is running from.

Below are output from running alpha5 from home directory:
Bash:
$ ./camilladsp
CamillaDSP 2.0.0-alpha5 and then the helpfile

$ ./camilladsp -s
error: The argument '--statefile <statefile>' requires a value but none was supplied

$ ./camilladsp -s statefile.yml
2023-10-31 10:51:29.495805 INFO [src/bin.rs:683] CamillaDSP version 2.0.0-alpha5
2023-10-31 10:51:29.495886 INFO [src/bin.rs:684] Running on linux, aarch64
2023-10-31 10:51:29.495981 WARN [src/statefile.rs:29] Could not read statefile 'statefile.yml'. Error: No such file or directory (os error 2)
 
Last edited:
That can't be done with biquads so it would require generating an impulse response for a fir filter. This is a decently sized project in itself, not something I have in my plans at the moment
Actually, that is what I also thought, until a forum user demonstrated that with lots of IIR all-pass blocks you can perform phase/group-delay EQ. There is an algorithm for computing the set of AP filters to perform the phase or group delay EQ called "Frequency Domain Least Squares" (FDLS) and a paper by M.Lang on it:
https://www.semanticscholar.org/pap...c059c5ace6d6ca74a19ffa25fbdac10fd9332500?p2df

It might take tens of stages, but it CAN be done (surprisingly). For an example see:
https://www.diyaudio.com/community/threads/how-to-correct-phase-for-iir-filters.353377/post-6178132
Of course you will need to to know group delay of the system you wish to equalize, but this can be obtained via measurement.

Also, I should add that you can design an FIR group delay EQ filter just from the group delay response itself, and some intuition on how you want to equalize it. I have done this in the past. Once you obtain the group delay you need to add to the system in order for its group delay response to be flat above some frequency, you are able to compute the phase response, and therefore you know the response you want to construct because the amplitudes will all be 1 (e.g. no amplitude change). Given the phase and amplitude vs frequency you can then construct the FIR filter using the usual techniques. Then do a quick check by computing the response of the FIR filter to make sure that any ringing is minimal or absent, which will depend on how many taps are used, etc. just like with any other filter.
 
Last edited: