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

Success :)

pi@SuperLMS:~/camilladsp $ rustc --version
rustc 1.41.1 (f3e1a954d 2020-02-24)

pi@SuperLMS:~/camilladsp $ cargo build --release
Compiling pkg-config v0.3.17
Compiling libc v0.2.67
Compiling autocfg v1.0.0
Compiling proc-macro2 v1.0.9
Compiling unicode-xid v0.2.0
Compiling syn v1.0.16
Compiling bitflags v1.2.1
Compiling nix v0.15.0
Compiling serde v1.0.104
Compiling linked-hash-map v0.5.2
Compiling cfg-if v0.1.10
Compiling arc-swap v0.4.4
Compiling void v1.0.2
Compiling dtoa v0.4.5
Compiling strength_reduce v0.2.3
Compiling transpose v0.1.0
Compiling num-traits v0.2.11
Compiling num-complex v0.2.4
Compiling num-integer v0.1.42
Compiling yaml-rust v0.4.3
Compiling libpulse-sys v1.12.1
Compiling alsa-sys v0.2.0
Compiling libpulse-simple-sys v1.12.1
Compiling quote v1.0.3
Compiling signal-hook-registry v1.2.0
Compiling signal-hook v0.1.13
Compiling libpulse-binding v2.15.0
Compiling rustfft v3.0.1
Compiling alsa v0.4.1
Compiling libpulse-simple-binding v2.15.0
Compiling serde_derive v1.0.104
Compiling serde_yaml v0.8.11
Compiling camilladsp v0.0.5 (/home/pi/camilladsp)
Finished release [optimized] target(s) in 4m 15s

So we need newest rust for it to compile Henrik.
I removed the installed rust version with :
sudo apt-get --purge remove rustc
Then i installed latest rust(c) with :
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Then logout of shell, and logon again (for updating path etc...)

And when done i compiled the camilladsp "pi" branch with :
cargo build --release

Not trying anything yet... Just to see if it would install on the RPI4 for now, thanks a lot man !!!

Jesper.
 
NP... Henrik :) As soon i got everything setup i will test cpu usage's

Well you wrote earlier this :
I think a RPi 4 should handle this fine, but I haven't actually tried that. Where in your chain do you want to place the new Pi? Instead of the 3+?

So now it becomes tricky as i donno howto handle this.

The player i use is squeezelite (on the Picoreplayer image/OS) - Resides on an RPI 3B+. The squeezelite takes the stream from my Logitech media player (LMS) and send it to the USB DAC.
I can ofcause install squeezelite on the RPI4 also if i would/need.
For now, for testing i have installed LMS on the RPI4, where i also installed this camilladsp.
On the LMS i also installed BrutefirDRC plugin, which takes the stream and convert/filter it in realtime with room correction filters etc...
But as i wrote earlier i havent got anything working good by now, and i simply don't understand howto do it proberly yet :)

So where i should put camilla in audio chain i don't know yet, but as i see it it should be something like this ::

RPI4 : LMS ---> camilladsp ---> squeezelite ---> USB DAC

Also if possible like this :
RPI4 : LMS ---> camilladsp
RPI 3B+ : ---> Squeezelite ---> USB DAC

I'am open for all possibilities as long as i can use LMS for streaming server i would be happy :p

Jesper.
 
NP... Henrik :) As soon i got everything setup i will test cpu usage's

Well you wrote earlier this :


So now it becomes tricky as i donno howto handle this.

The player i use is squeezelite (on the Picoreplayer image/OS) - Resides on an RPI 3B+. The squeezelite takes the stream from my Logitech media player (LMS) and send it to the USB DAC.
I can ofcause install squeezelite on the RPI4 also if i would/need.
For now, for testing i have installed LMS on the RPI4, where i also installed this camilladsp.
On the LMS i also installed BrutefirDRC plugin, which takes the stream and convert/filter it in realtime with room correction filters etc...
But as i wrote earlier i havent got anything working good by now, and i simply don't understand howto do it proberly yet :)

So where i should put camilla in audio chain i don't know yet, but as i see it it should be something like this ::

RPI4 : LMS ---> camilladsp ---> squeezelite ---> USB DAC

Also if possible like this :
RPI4 : LMS ---> camilladsp
RPI 3B+ : ---> Squeezelite ---> USB DAC

I'am open for all possibilities as long as i can use LMS for streaming server i would be happy :p

Jesper.
I'm not familiar with how squeezelite works so it's difficult to give advice on how to set that up. Hopefully someone else will be able to help out with that :)


Anyway, what camilladsp needs is a capture device to get sound from, and a playback device to send the processed sound to. It should probably be last in the chain before the dac. Is squeezelite using alsa?



With alsa in/out it should look something like this:
Music player app (squeezelite?) -> Alsa Loopback device -> CamillaDSP -> USB dac



To get a loopback device you have to load the loopback kernel module: "sudo modprobe snd-aloop". Then tell your music player to send sound to the loopback device instead of the real dac.
 

TNT

Member
Joined 2003
Paid Member
RPI4 : LMS ---> camilladsp ---> squeezelite ---> USB DAC

Also if possible like this :
RPI4 : LMS ---> camilladsp
RPI 3B+ : ---> Squeezelite ---> USB DAC

I have these components (PI, squeezlite, LMS, SB Touch) also and would like to incorporate Camllia... If you get this to work, please do a write up for how to accomplish it. Newwbii style pretty please :)

//
 
TNT / Henrik...

Squeezelite is using alsa ...
Squeezelite supports gapless playback, a wide range of sample rates (44.1 kHz / 48 kHz / 88.2 kHz / 96 kHz / 176.4 kHz / 192 kHz / 352.8 kHz / 384 kHz) and direct streaming for Logitech Media Server plugins that require it such as Spotify. It is capable of utilizing Logitech Media Server's client synchronization feature which allows grouping clients for simultaneous, synchronized music playback. Squeezelite uses ALSA for audio output on Linux and PortAudio for other platforms

When i'am offduty :) this afternoon i will install the player and stuff on the RPI4, trying to connect the loopback interface into camilladsp.
I will if i'am capable of, write a howto when everything is up and running and tested.

Henrik is it possible that you have a filter which boost the bassarea or something like so that i can hear clearly if things are working when i will test it?!

With alsa in/out it should look something like this:
Music player app (squeezelite?) -> Alsa Loopback device -> CamillaDSP -> USB dac

So if i connect squeezelite through loopback into camilladsp, the output from camilladsp should connect to the USB DAC (makes real good sense, even for me :p)... As i wrote i haven't tried stuff like before, so are there anything i should know ?

Rgds; and good day; Jesper.
 
One thing to keep in mind: the loopback device can't convert sample formats and sample rate, so the output of squeezelite has to match the input settings of CamillaDSP. If that causes trouble you can insert an alsa "plug" to do conversions. I'll post my config files for this tonight. You can also check the alsa docs here: ALSA project - the C library reference: PCM (digital audio) plugins

I would recommend adding a highpass Biquad filter at 100Hz or so for testing, that makes it very obvious if the filtering is running and doing what it should.
 

TNT

Member
Joined 2003
Paid Member
If one would like to avoid sample rate conversion, can a set of filters, out of several, be chosen depending on Fs?

//


TNT / Henrik...

Squeezelite is using alsa ...


When i'am offduty :) this afternoon i will install the player and stuff on the RPI4, trying to connect the loopback interface into camilladsp.
I will if i'am capable of, write a howto when everything is up and running and tested.

Henrik is it possible that you have a filter which boost the bassarea or something like so that i can hear clearly if things are working when i will test it?!



So if i connect squeezelite through loopback into camilladsp, the output from camilladsp should connect to the USB DAC (makes real good sense, even for me :p)... As i wrote i haven't tried stuff like before, so are there anything i should know ?

Rgds; and good day; Jesper.
 
When two soundcards are used, what method for synchronizing their clocks do you plan to use? It is a typical issue, quite difficult to solve nicely.

Please note, the rate plugin (used by the plug plugin) resamples in 16bit only.

Hi phofman...

(When two soundcards)
Is it the lms --> squeezelite --> loopback"out" --> loopback"in" camilladsp --> USB-DAC setup you mean ?
If it is, i have no plan nor acknowledge for this

Rgds; Jesper.
 
If one would like to avoid sample rate conversion, can a set of filters, out of several, be chosen depending on Fs?

//
There is no way to switch filters automatically. You would have to have completely separate config files for each sample rate you want to use, and switch manually. The way CamillaDSP works, getting the sound from an alsa/pulse capture device, automatic switching becomes quite difficult to implement.
 
When two soundcards are used, what method for synchronizing their clocks do you plan to use? It is a typical issue, quite difficult to solve nicely.

Please note, the rate plugin (used by the plug plugin) resamples in 16bit only.
I'm guessing this question was for me.

When input and output are from different soundcards, I "solve" it by assuming they are pretty close in samplerate. If they drift apart slowly enough, there is no problem in practice. Every time the processing pauses any accumulated difference is reset. The worst case is if the playback device runs faster than the capture device. This means the playback device will run out of data after some time. When that happens it simply restarts the playback after a short delay. This becomes a slight glitch in the sound.


I don't plan on supporting output to several soundcards at the same time, so that case isn't handled at all.


Thanks for the warning about the rate plugin. My thinking is that it's best to keep the processing running at the rate one cares most about (in my case 44.1kHz) and let other stuff be resampled. Or switch config to process at another rate.