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

I do have a Mac mini M2, 3 DACs combined in a main audio unit. Sampling rate can be 768khz 32bit.
I do have blackhole 16ch, which should also be capable of 768khz 32bit.

However when I set CamillaDSP to 768khz, Chunksize: 8192, resampling enabled AsyncSync, Accurate, Target Level 16383, I get pops and stutters. Using 384khz is working just fine.
So what channels and rates are configured? Your CDSP config is quite important 🙂
 
Did some testing with dummy FIR, 262k, 8 channels, added in async resampling from 48 to 192khz.
I increased the chunk size form 128 to 1024 and the problem disappeared.
Chunksize has to be 342 or above, if 341 or below, program stalls and dsp load goes to 400%, cores do nothing.

Attached is a config with 128 chunk size. I do async resampling from 48khz to 48khz with target level 128, this and silence at -70db is the only thing that helped combat stalling and not starting on silence.

Thanks!
 

Attachments

Chunksize has to be 342 or above, if 341 or below, program stalls and dsp load goes to 400%, cores do nothing.
IME at low chunksizes it's good to check the actual alsa period and buffer sizes vs. the chunksize. I have seen buffer size equal to chunksize which cannot work without permanent xruns. The issue is chunksize is fixed, but period/buffer sizes are determined by the HW driver, the values requested by CDSP are just hints (xxx_near alsa methods). The easiest solution is then using chunksize for which CDSP generates usable period and buffer values.
 
  • Thank You
Reactions: Ardacer
I increased the chunk size form 128 to 1024 and the problem disappeared.
128 is very small for convolution. When the chunk size is smaller than the fir filter length it does segmented convolution. The more segments it needs, the less efficient it gets.
The FFT used in the convolution is also more efficient at easy chunk sizes such as powers of two. 341 is a particularly bad value since it's the product of the two primes 11 and 31.
 
  • Thank You
Reactions: Ardacer
"When the chunk size is smaller than the fir filter length it does segmented convolution."

I've read this in your readme at github, just didn't expect it to be such a strong effect.

"The easiest solution is then using chunksize for which CDSP generates usable period and buffer values."

I'm at that point now, just help me understand one other thing 🙂

Since camilladsp requires static inpuit samplerate, I'll add a hardware ASRC before it's toslink input at a fixed 96khz, soon when parts arrive.
Do I calculate latency from chunksize from the input samplerate or the internal operating samplerate of camilladsp?
Thank you both!
 
Most FFT algorithms work by dividing a long transform into shorter ones, for example length 512 is 16x32, and can be calculated with length 16 and 32 FFTs (plus some really clever math tricks). Those 16 and 32 long FFT can be further split, until each transform is trivial.
341 can be split to 11 and 31, but then we can't split those any further and we have to calculate those transforms without any fancy tricks. But that is still better than for example 347 that is a prime itself, so can't be split at all.
 
  • Thank You
Reactions: Ardacer
The Sinc resampler is quite heavy on the Accurate preset, it's very likely too heavy at 768 kHz. Either lower the sample rate, or use the Balanced preset.
Hi @HenrikEnquist and @phofman,

I think I got it working based on your feedback.
I thought resampling is needed in to order to calculate the chunk size properly.. I was wrong 🙂

I recently changed the chunk size to 4096, disabled rate adjust and resampling.
It is way better now. My CPU Load (Mac mini m2) is quite relaxed. about 2 percent for the CamillaDSP terminal 🙂

Thank you both 🙂