I’m working on a realtime audio application running on linux. I’m using JUCE with ALSA directly. No JACK.
I have 4 cores and would like to spread the DSP I need to do across the cores. What would be the recommended way to do this? Right now I have 4 threads running at priority 10 (ALSA thread seems to have priority 9), and I signal the threads from the audio callback so start calculating audio samples, and I wait for the threads to finish, after which I do some minimal additional processing and then I pass the samples to the callback buffer. In the DSP threads I have a sleep(1) call to avoid that the threads consume too much CPU.
This works pretty well but I do have occasional dropouts that sound like the threads were not ready in time. Is the above approach OK or should I be doing this differently?
I’m using a plain mainline kernel 4.10 with IO scheduler set to noop and preemtive set to low latency desktop. I have the scaling governor set to performance.
Thanks for helping!