After a lot more investigation into this, I have gained a much better understanding of what causes this bug. The good news is that itās quite easy to work around, now that I know what causes it.
Technical explanation of the issue
The complicating factor, which I realized only after uncovering the cause, is that there are actually two completely independent Renoise bugs that both have the same effect. And both were triggering on my system. They are:
-
The thread priorities are hardcoded to 99, which is not allowed on many systems (Jackd packages on Debian and derivatives ship with 95 as the maximum). Hence the system call fails altogether and the thread stays at low priority. This can be seen in the console log as:
Renoise LOG> System: Changing a threads priority to '99' FAILED (error: 1)!
-
Thread priorities of the audio threads are not set correctly when Renoise starts, only when you actively switch the number of threads using the āOptions ā Multi Coreā submenu.
Note that when using only one core, no helper threads are created, and Jackās main thread is used instead, which is already correctly prioritized. So the problem does not occur in that scenario, only when 2 or more cores are used.
Workarounds
Let me present the easy workarounds first:
-
The easiest way is to simply increase the limit. On Debian and derivates, this can be done by opening the file /etc/security/limits.d/audio.conf, and increasing the number on the rtprio line to 99. Then reboot.
-
This is easy, just switch from the number of cores that you want to use, to a different number, and then back. Unfortunately this needs to be done every time Renoise is started.
Advanced workaround
Luckily, the Renoise developers have named their threads, so theyāre actually identifiable from the outside. A slightly more advanced workaround is therefore to set the priority yourself, using a script. This has the advantage that it can be automated, and you donāt need to do the āOptions ā Multi Coreā trick every time you start Renoise. It also means that you can set the priority to something else than 99, if you are uncomfortable raising the limit (which does have some very minor security implications). Priority 99 is not actually needed for smooth playback, using whatever Jackd is using is more than good enough.
To set the thread priorities, add a script which contains the following:
#!/bin/bash
renoise &
pid=$!
sleep 10
ps -eL -o tid,comm | grep "Audio Slave" | awk '{print $1}' | xargs -n1 -r chrt -f --pid 95
wait $pid
Then use that to start Renoise instead of the binary itself.
The sleep 10 can be increased if your Renoise instance takes a long time to start, for example because of many plugins. 95 can also be changed if you want a different priority.
Resolution
You can check that the threads are correctly prioritized with this command:
ps -eL -o priority,comm | grep "Audio Slave"
That will list each thread. If the number in the first column is negative or ārtā, they are correctly prioritized.
Once the workarounds are in place, Renoise 3.5 in fact performs better than 3.4, so kudos to the developers for that!
Getting the bugs fixed in Renoise
Iām going to create new threads for each of these bugs, since my new description of the problem should be much easier to grasp for the developers, and what I originally posted is not that relevant anymore. Plus, this thread is getting pretty long by now.