What do you think of adding Process::setPriority(Process::RealtimePriority); at the beginning of AlsaThread::run() ? That way it sets the thread to realtime SCHED_RR policy , which helps a lot to prevent cracklings. Of course it works only when the user account is allowed to set realtime scheduling in /etc/security/limits.conf
Well, changing the process priority like that is really something I’d rather leave for the app itself to choose to do. If you were writing a sequencer, it’s probably something you’d do, but you may not want your app to have such a high priority…
I agree indeed, but it is not easy to do here, because I want to set realtime priority only on the alsa thread, not on the whole process (on linux juce::Process:setPriority changes the priority of the current thread, not the whole process). So the only way to do that right now is to hack into AlsaThread code , which is not excessively clean. But I understand your point.