HEnquist / camilladsp

A flexible cross-platform IIR and FIR engine for crossovers, room correction etc.
https://henquist.github.io/
GNU General Public License v3.0
563 stars 49 forks source link

Large amounts of underrun without recovery when using more than one mixer #275

Closed Michal-Szczepaniak closed 1 year ago

Michal-Szczepaniak commented 1 year ago

Hello, I would like to ask for some help. I'm trying to configure camilladsp to get 6 channel input, duplicate 5 channels (LRCSLSR), highpass one half, lowpass second half, then pass 5 channels to their speakers and mix other 5 channles + lfe channel to lfe. Basically make separate crossover for every speaker. Previously i had just one mixer that takes 6 channels and maps them to 8 channels but since I made mentioned change, i can't play anything. Once i start playing something, i hear second or two then underruns start, never end, camilladsp fails to recover and crashes. Maybe i've something wrong with my config (i realise it's huge)? Any suggestions?

here's config https://gist.github.com/Michal-Szczepaniak/0237a067a71a290fd7dc1d2b219a388f

PS: Loading of standard EQ files would be very, very useful

HEnquist commented 1 year ago

That is a very large config yes. My first guess would be that the it's too heavy for the cpu. What machine are running this on? Can you check the CPU usage with for example top?

What do you mean by standard eq file?

Michal-Szczepaniak commented 1 year ago

Normally PEQ equalizers use standard files like these https://gist.github.com/Michal-Szczepaniak/e28ac23df5e684aa6e3487f9f51192a0. you can see how easily they could be loaded.

i'm running it on FX-8320. It was fine with 6 channels, one mixer and all the EQ's it's the two mixers that cause issue. Hmm now that i checked it it does use 90% of a single core when idle and when playing audio it reaches 100% and dies. Is it possible to use multithreading?

HEnquist commented 1 year ago

Ok then it was likely close to what the cpu could do with the old config, and adding the extra mixer pushed it over the limit. The FX-8320 is ok when all cores are used, but has weak single core performance. This means it's not the ideal choice for camilladsp. The filtering is done in a single thread, mostly because the pipeline can be built so freely. It's tricky to figure out what steps could be done in parallel with others. I have not come up with any solution for this that doesn't have some major disadvantage. Can you simplify the filters slightly? Removing just a few should be enough. You could also consider using FIR instead. A single FIR filter per channel would likely be much faster than the many biquads you have now. I think REW can export the impulse response of the filters.

It looks like those filters were exported by REW. There is actually no need to convert anything then. The latest version or REW can export biquad filters directly in camilladsp yml format.

Michal-Szczepaniak commented 1 year ago

Wait IT CAN?! How? I don't see option for that

still loading one file instead of defining 20 Peak biquads would significantly shorten the config :P

And yeah about cpu i'll just upgrade to something with better single core then

HEnquist commented 1 year ago

It's mentioned in the readme for the upcoming v2.0: https://github.com/HEnquist/camilladsp/tree/next20#export-filters-from-rew

CamillaDSP only reads its own config format and that's the way I prefer to keep it. But I will probably add an import function in the gui at some point.

Michal-Szczepaniak commented 1 year ago

hmm okay then, gotta stick to 1.2k long configs :P Well thanks for help!