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

This is quite straightforward, as long as the filter from Focus Fidelity is in a usable format (or can be converted to one).


Yes, the easiest way is to use virtual sound card such as Blackhole and set that as the default playback device.
You will need to switch the camilladsp configuration to switch between the turntable and other apps modes. But it might be possible to use an aggregate device to get around that. Worth trying!

Yes this is a standard feature.

Great - thank you.
James
 
When I looked into using my RME sound card with digital RIAA I learned impedance matching with the vinyl pick-up would not give optimal load for the PU.
I think because I use an MC cartridge this hasn’t been a problem for me. The cartridge maker states a minimum input impedance of 100ohms and the mic pre inputs are far higher than this. I thought I might need to solder resistors across the xlr pins, but I’ve not heard anything unusual, so didn’t bother in the end.
 
I have a problem on my raspberry Pi 3B+ pop and crackle on the playback device.

I've found it occurs with 6 channels and IIR filters. Does not happen with only 4 channels and filters. All filters are IIR.

Top shows 32% user CPU for camilla running 6 channels and around only 11% for 4 channels. The last 2 channels don't have anything too complex.

I am running the pre-compiled Camilla DSP v1.0.3 on Archlinux

I've tried to:
increase chunk size
reduce queue length
enable rate adjust
reduce the adjust period.

All to no avail - the crackle / pop is immediately available. there no signs of buffer depletion.

Is the Pi just not grunty enough? I'd appreciate any help / advice please or please let me know if this should be a new thread. thank you

Edit: I'm just testing by playing WAV files via aplay. Whether I go direct (to loopback aka hw:1 in my system) or via an ALSA plugin to resample. no difference (still crackles)
 

Attachments

  • sup_wmt.txt
    3.6 KB · Views: 48
Last edited:
Is the Pi just not grunty enough?
USB bus throughput might be the culprit? Not sure about the 3+ revision but the former RPi3 is not actually capable of true 480Mbps USB2 speed whith onboard network card connectet to the onboard USB bus. Not sure how the later 3+ revision with updated ethernet adapter make use of the USB bus?

Possible starting point to research this https://elinux.org/RPi_HardwareHistory
 
  • Like
Reactions: 1 user
Fixed the crackle issue. using alsa plug rather than direct hw playback device. I presume the plug handles rate conversion mismatches?. here's the revised devices section:

CPU with 44.1/16 throughout is ~ 16% so hopefully not risk of underruns. Can't hear any. This is 6 channels and IIR filters

Code:
devices:
 samplerate: 44100
 chunksize: 4096
 queuelimit: 1
 enable_rate_adjust: true
 capture:
   type: Alsa
   channels: 2
   device: "hw:Loopback,1,0"
   format: S16LE
 playback:
   type: Alsa
   channels: 6
   #device: "hw:0,1"
   # no crackle going via plug!
   device: "plughw:0"
   format: S16LE
 
  • Like
Reactions: 1 user
But plughw:0 is using a different alsa device than hw:0,1
You are correct. My ALSA knowledge is dismal sadly.

I had assumed the plug will be handling the rate/sample conversion which fixes my "crackle" problem before routing to hw:0,1 (the HDMI output on the raspberry pi)

However plughw:0 is a 2 channel device and I need 6 channels.

What I want is "whatever" the plughw:0 does to resample/rate AND setup 6 channel output. I'd really appreciate a couple of pointers to try in my asound.conf if you have the time please! thank you.
 
Can you record a little sample of the crackle?
Does it sound ok if you send audio directly to hw:0,1 with aplay?
Thanks for your help Henrik,

I've uploaded the file that plays clean here:
https://drive.google.com/file/d/1pujm-CMVjAILjSCdz3GrIAjo7UCrargD/view?usp=share_link

it is an REW 10-20000Hz 44.1/16 stereo sweep.

I can play it without crackle via:
aplay -D hw:0,1 256k_ntr2.wav

I've uploaded both crackle and no crackle Camilla DSP configs. As you can see, all I am doing is switching mixers for 4 (no crackle) and 6 (crackle) channels.

I can't work out how to record the crackle itself. Any pointers on how I configure CamillaDSP please? (or maybe I create some sort of ALSA device to route the output somehow). My alsa knowledge is very low..

I will try and figure out how to record the crackled output.

What I do know is if I replace the direct HDMI hw output device with the plug version (which must do resampling?) then I have no issues... the problem is , the plug is 2 channel. I am trying to work out how I create a multi-channel plug
#device: "hw:0,1" # no crackle going via plug! device: "plughw:0"
 

Attachments

  • sup_crackle.txt
    1.4 KB · Views: 44
  • sup_no_crackle.txt
    1.4 KB · Views: 47
The problem seems to be setting 6 channels of output on this 7.1 device. ALSA is remapping the channels as well as causing the crackling.

Taking Camilla DSP out of the loop I can reproduce the error using this ALSA config:
Code:
pcm.hdmi_hw {
  type hw
  card 0 
  device 1
}

pcm.simple {
    type plug
    slave sosimple
}

pcm_slave.sosimple {
    pcm hdmi_hw
    format S16_LE
    channels 6
    rate 48000
}

If I change channels to 2,4,8 = no crackle
Only 6 causes a problem.

Not an issue as I will just set to 8 channels for now (even though I don't need 2). I was just wanting to keep CPU usage as low as possible (may not increase anyway).
 
it is an REW 10-20000Hz 44.1/16 stereo sweep.

I can play it without crackle via:
aplay -D hw:0,1 256k_ntr2.wav
If it's a stereo file, then it's not testing the device hw:0,1 in the same setting, i.e. in 6 channels. You can try e.g. sox which will generate any number of channels for you and play that directly to alsa.

What I do know is if I replace the direct HDMI hw output device with the plug version (which must do resampling?) then I have no issues... the problem is , the plug is 2 channel. I am trying to work out how I create a multi-channel plug
#device: "hw:0,1" # no crackle going via plug! device: "plughw:0"

You would need plughw:0,1 to test the same device.

I have not seen people complaining about broken 5.1 and working 7.1 HDMI PCM. IMO the problem with your setup is somewhere else.
 
  • Like
Reactions: 1 user
If it's a stereo file, then it's not testing the device hw:0,1 in the same setting, i.e. in 6 channels. You can try e.g. sox which will generate any number of channels for you and play that directly to alsa.



You would need plughw:0,1 to test the same device.

I have not seen people complaining about broken 5.1 and working 7.1 HDMI PCM. IMO the problem with your setup is somewhere else.
Totally agree. I went straight to using Camilla to apply the crossover, just after doing a speaker-test to ensure each channel was working. I realised I skipped some important checking / configuration. Camilla DSP was never the issue (never meant to imply it was either sorry).
 
If it refuses to work properly with 6 channels, then it's an ok workaround to use 8 channels. It won't really affect CPU usage.

Don't spend s lot of time on recording. Recording a short sample of the sound from a speaker with the mic of a mobile phone will do fine. It's just to get an idea of what kind of glitches you are getting.
 
Hello, is there planned support for VST Plugins? (for example to use CanOpener)
I am not planning to add VST plugin support.
Or did anyone find a good crossfeed implemenation?
It's possible to implement crossfeed just with the built-in filters and mixers. I know several people have done it and published the configs. Maybe someone remembers where to find them?