If you are running into troubles with JACK xruns or have glitchy audio you may try following things:
(Written assuming Ubuntu, commands and paths may vary on other distributions)
Check what is sharing IRQ with your soundcard
cat /proc/interrupts
Should display you the list of IRQ’s on your system and devices using them. For example WiFi or other network drivers can cause lots of interrupts and thus taking time away from audio driver which should be priortized. Some other devices hardly cause any interrupts so they won’t cause much problems when they share IRQ with your sound card. Still, best option would be to make sure your audio device is alone on the IRQ.
To fix:
Some BIOS setting allow you to organize IRQ’s, but newer, specially laptop ones won’t. Some device cards and motherboards also used to have jumpers on them for configuring IRQ’s. Nowadays even this is rarely the case, but it may be worth to check.
Other option is to disable all integrated devices from your BIOS which you don’t use. Sometimes this will reorganize your IRQ tables and with some luck you may get more stable audio perfomance.
If you don’t need the annoying device, you may unload it’s module with “modprobe -r drivername” and/or blacklist it in “/etc/modprobe.d/blacklist”.
Prioritize your audio IRQ
First check which IRQ your sound card is on with the command in previous chapter and then (assuming it’s on IRQ 11) issue a command:
sudo chrt -f -p 60 `pidof IRQ-11`
Where the 60 is the priority of the process from 0 to 100.
Word of warning: Prioritizing the thread too much may make your system unresponsive or entirely freeze everything except audio and program playing the audio. So be careful not to give too much priority to the thread.
Also, if something interrupt hungry is running on the same IRQ (like wifi card). This may lead to opposite results making the audio actually skip more.
Remove rogue drivers
Some buggy drivers get pretty crazy with some hardware configurations. Example of those drivers is b43 driver for Broadcom 43xx series WiFi cards. On some cards, it may cause very short, temporary system freezes which have high impact on audio.
Fortunately you can replace this driver for now with ndiswrapper driver which is much more friendly to the kernel for now. Don’t forget to blacklist the old driver.
Some other drivers have also alternatives available, but not all of them. Sometimes you have no other option than unloading the driver while working with audio and filing an angry bugreport.
CPU scaling
On laptops CPU speed scaling is usually on setting “ondemand” which means it will change the CPU speed accordingly to the requirements of CPU power at the moment. When running Renoise you are likely to need lots of CPU, so it will most likely switch itself on performance when playing tracks and back to slower speed when being idle.
This is not a good behavior as the frequency switching may cause timing issues and will lead to xruns. To fix it you may use following command:
sudo sh -c 'echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
And later, after messing with your audio, to make the fans calm down again:
sudo sh -c 'echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
Broken APIC implementation
Some HP laptops (and apparently some others) have broken APIC implementation in their bios. This causes the system driver instability which will lead to xruns. In some cases passing “noapic”, “nolapic” to kernel arguments may save the issues. But be careful, as disabling APIC will also disable multiprocessor support.
I will add more tips later, if I remember any.