Arch-Linux: Best settings for realtime and low latency

I had a lot of xruns in renoise, which I did not have on the exact same computer when I was using Windows. So I knew that renoise was not the problem here, but the OS itself. Nowadays I can work with a latency as low as 2.6 ms. So I decided to give you all my knowledge:

First of all, install realtime priorities and cpupower.

yay -Syu realtime-privileges cpupower

This creates a group for realtimeusers and enables you to set the cpu-energy-settings

add your user to realtime-users

sudo usermod -aG realtime $USER

REBOOT, to make the usergroup-stuff LIVE.

now remove the power-profiles-daemon service. KDE and gnome use it to control the cpusettings but we are nerds, we want cpupower

sudo systemctl mask power-profiles-daemon

Now we edit a file and set the cpupower to performance. Open the settings-file and uncomment “governor” if needed and set governor to performance

sudo nano /etc/default/cpupower

It is in the third row of the file, at least in my arch-version. take that line and write

governor=’performance’

Enable the cpupower-service:

sudo systemctl enable --now cpupower.service

After that you can check, if your cpus run in performance-mode now:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

You can set environment-variables in your desktop-launcher files. For example:

PIPEWIRE_LATENCY=128/48000 renoise

Starts renoise with a 128 byte sample buffer in 48 kHz.

You can play around with the env-variables and go even lower, if you want.

Last but now least: If you wish, you can go full ALSA mode. In that case while running renoise you don’t have any sound from any other app, because it goes deep into the kernel audio. Select ALSA in the preferences and your HARDWARE-Audio (default is not enough). Renoise might say, that it can’t initialize it, but rescan and it will work. In that case you can set the buffers in renoise as low as you want (until it gives cracking sounds)

But: I’m happy with pipewire/jack and the 2 ms :slight_smile:

4 Likes

Yes, there are a few points to note, but basically, as long as you pass the rtcqs test to a certain extent, it should be fine.

If you prefer, you can switch between Performance Mode and Power Save Mode and adjust accordingly—setting different quantum values, stopping/starting Wi-Fi, network connections, backup services, and their schedules, etc.
When I need to improve real-time responsiveness, I use a key binding to toggle performance mode and its associated settings on or off.

1 Like

That’s useful.

Maybe you can try these kernel parameters :slight_smile:

threadirqs
mitigations=off
pci=assign-busses
nohz=on
hpet=disable
usbcore.autosuspend=-1
split_lock_detect=off

and realtime kernel of course :slight_smile:

My personal experience with “true” realtime kernels is, that they are slow in other stuff I do, escpecially when it comes to Docker. Don’t know why.
What do those kernel-params do?

for better info check here
it’s described there better than I could explain it here.
More in detail