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

There is a new branch called "dither". It's really not well tested but seems to work ok(?).

It's fun to play with dither at very low bit depths like 4 or 5 bits. Try something with just a voice (I have been playing with Suzanne Vega - Tom's diner) and try the different dither types. Good fun :)
 
Hi...
So i will try to make it work...
I hooked up the RPI4 to my DAC (Dac shows samplerate btw.. just to tell)

After loading snd-aloop (with the aloop.conf) i got this with aplay -l :
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Amanero [Combo384 Amanero], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 2: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 2: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

Starting squeezelite on the RPI4 :
pi@SuperLMS:~/camilladsp/target/release $ ps aux | grep squeezelite
pi 825 1.0 0.8 140332 35824 ? Ssl 08:11 0:23 squeezelite -n CamillaDAC -o front:CARD=Amanero,DEV=0 -a 160 4 1 -b 10000 20000 -C 15 -z

I also copied the asound.conf to /etc/asound.conf

So now i have to figure out howto chain it together, and put in the right parameters in the config files.

Jesper.
 
I stopped squeezelite and started it with the loopback :
pi 1074 1.0 0.8 140276 35952 ? Ssl 09:18 0:22 squeezelite -n CamillaDAC -o front:CARD=Loopback,DEV=0 -a 160 4 1 -b 10000 20000 -C 15 -z

But i'am having trouble figuring out howto start camilladsp with the right parameters and plugins configured right and filters (filter.txt)...

Hope you can help me further Henrik :eek:

Jesper.
 

Attachments

  • IMG_6356.jpg
    IMG_6356.jpg
    576.8 KB · Views: 484
  • Screenshot from 2020-03-07 09-59-10.png
    Screenshot from 2020-03-07 09-59-10.png
    151.2 KB · Views: 507
Last edited:
Thanks... phofman.

So i created .asoundrc
pi@SuperLMS:~ $ cat .asoundrc
pcm.squeezelite_loop {
type hw
card "Loopback"
device 0
format S32_LE
channels 2
}

pcm.camilla_loop {
type hw
card "Loopback"
device 1
format S32_LE
channels 2
}

After unloading snd-aloop and modprobed it again, aplay don't show up the names, just the usual :
pi@SuperLMS:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Amanero [Combo384 Amanero], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 2: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

So i don't know if it's working.
I can start squeezelite with the "card" through :)
pi 1501 3.5 0.8 138096 35724 ? Ssl 11:37 0:00 squeezelite -n CamillaDAC -o pcm.squeezelite_loop -a 160 4 1 -b 10000 20000 -C 15 -z

Also i must say, that i am really stuck now. I cannot move further until i understand howto setup all configurations files.

I need some really simple setup to try i guess, but right now i cannot do it by myself!

Jesper.
 
Let's see, you are running stereo in and out. Unless you want to do some mixing between left and right you can then skip the mixers section, and only define filters and the pipeline. Try this config file, should add a highpass filter at 300 Hz for both channels so you can easily tell if it's doing something or not:

Code:
--- 
devices: 
  samplerate: 44100 
  buffersize: 1024 
  capture: 
    type: Alsa 
    channels: 2 
    device: "camilla_loop" 
    format: S32LE 
  playback: 
    type: Alsa 
    channels: 2 
    device: "hw:Amanero" 
    format: S32LE 
 
filters: 
  highpass_test: 
    type: Biquad 
    parameters: 
      type: Highpass 
      freq: 300 
      q: 0.5 
 
pipeline: 
  - type: Filter 
    channel: 0 
    names: 
      - highpass_test 
  - type: Filter 
    channel: 1 
    names: 
      - highpass_test
 
Bingo :)

pi@SuperLMS:~/camilladsp/exampleconfigs $ camilladsp /home/pi/camilladsp/exampleconfigs/pass.yml
build filters, waiting to start processing loop
starting playback loop
starting captureloop
Prepare playback
Clipping detected, 3 samples clipped, peak 103.86676186263371%
Clipping detected, 2 samples clipped, peak 102.95980172478671%
Prepare playback
Clipping detected, 2 samples clipped, peak 102.55394574280537%
Clipping detected, 4 samples clipped, peak 105.66208187552265%
Clipping detected, 5 samples clipped, peak 107.8239750487489%
Clipping detected, 1 samples clipped, peak 102.2849489172843%
Clipping detected, 1 samples clipped, peak 100.76439887101873%
Clipping detected, 2 samples clipped, peak 105.04384587895098%

Camilla consumes 2-3% for this filter
787 pi 20 0 23108 4536 2664 S 3.0 0.1 0:01.94 camilladsp
762 pi 20 0 140200 35704 2916 S 1.3 0.9 0:06.35 squeezelite
818 pi 20 0 10288 3112 2616 R 0.7 0.1 0:00.23 top

Playing 44.1KhZ is working
Trying 192KhZ is also playing but slooooooW (sounds funny), DAC is not changing samplerate when playing other than 44.1KhZ as expected ofcause

Thanks both :)
 
Great! Good job :)

What filter(s) are you running?


I have updated the "dither" branch and added some tests. It seems to be working just fine and it's quite fun to play with. 10 bits with noise shaped dither is actually quite good. 8 bits isn't bad either but the noise can be a little annoying.



Next up, segmented convolution...
 
Great! Good job :)

What filter(s) are you running?


I have updated the "dither" branch and added some tests. It seems to be working just fine and it's quite fun to play with. 10 bits with noise shaped dither is actually quite good. 8 bits isn't bad either but the noise can be a little annoying.



Next up, segmented convolution...

Hi again here guy's :)

I only did try the simple filter you pasted here (highpass), and it is working for sure.
Right now i'am compiling an realtime kernel to see if it gives even better performance & to avoid possible glitches and other nasty stuff.

I will use this camilladsp for room correction with the UMIK-1 microphone i will recieve very soon. I plan to use REW and maybe RePhase for creating the fir filters for each corrosponding samplerate (44.1, 88, 96, 192 etc...)

I donno if i can resample everything to 96Khz before it enters camilladsp without loss of quality (I'am audiophile for sure :p)... If that's possible i will make a room correction filter for 96Khz and let camilladsp handle only this until Henrik eventually will code so camilladsp is capable of switching ?

Rgds; Jesper.
 
Trying 192KhZ is also playing but slooooooW (sounds funny), DAC is not changing samplerate when playing other than 44.1KhZ as expected ofcause

This detail is very interesting! I never tried doing that, thanks for reporting :) It might open up an easy way to catch sample rate changes (at least for the Alsa backend), meaning that automatic switching might be a lot easier than I thought... Need to experiment a bit...
 
Ur on a wave :) Do you still play your ribbons/planar?

//
Nowadays I actually work with software development on full time (since about two years), and since the switch I've become much faster at writing working code.. :)

I'm using the same hardware I've had for about five years, with a pair of Heil AMT tweeters together with 8-inch woofers in vented boxes. And still with FIR crossovers :)
 
Got it running this morning with a simple filter running on pi 2 with hifiberry soundcard.

Very nice software, much easier to configure then Brutefir.
I use Squeezelite output via loopback into Camilla DSP using same .asoundrc as Jesper.

What I am still getting is a ''crackle'' sort of dropout every few minutes...sort of vinyl play experience.

Is there a way to solve this?

Regards and thank you for such a nice program.

Ronnie
 
Hi,
It is simple filter from the Camilla dsp library. It just mixes to mono.
Had the same problem with Brutefir. Also without loopback, direct fileplay.
I think it is configuration. Some people with Volumio and brutefir plugin had dropouts.
Switching to Camilla might solve it I hoped.
Thanks for the help you offered :)
 
The problem is most likely that the loopback runs a little slower than the dac, so the playback thread runs out of data one in a while. Does CamillaDSP print "prepare playback" in the terminal every time you get the noise?

You can probably get rid of some of it by pausing the processing between songs. This resets the timing, just set a short silence_timeout, half a second maybe.

I have a few ideas on how to improve this:
- Let the buffer underrun happen (as it's done now) but add a longer delay before restarting playback. This would mean it takes much longer until the next one.
- Watch the buffer and when it's getting dangerously low insert some interpolated samples to make the glitch less audible.
- Same as the previous one but try insert silence when the music is quiet.

Opinions?