Configuring a Linux system for real-time audio is a huge topic which is probably much better discussed elsewhere. There are hardly universal answers which apply to every system because it very much depends on your needs and your Linux flavor. Additionally it’s a moving target and advice becomes quickly outdated. When finding advice online, always question if it’s up-to-date.
Nevertheless we’d like to share and document some of our system tweaks and experiences. We currently use (K)ubuntu based systems, for which these suggestions apply. Please comment with your corrections or amendments.
Audio Performance Optimizations
- Setting the system for performance CPU scaling will improve performance. You can do this conveniently from the panel using the
indicator-cpufreq
applet. - Recomended packages/repositories/PPAs: rncbc, KXStudio
- Run Pd with realtime priority.
- Use a lowlatency Kernel (see details at bottom of this post).
- Install the
rtirq-init
package. source code and readme - Load the Kernel with the threadirqs option. To do so, edit
/etc/default/grub
and changeGRUB_CMDLINE_LINUX=""
toGRUB_CMDLINE_LINUX="threadirqs"
and then runsudo update-grub
- Use rtcqs (formerly known as realtimeconfigquickscan) script to scan for more recommended tweaks.
I like to compile Pd myself. For that I either download tha latest release or clone the git repository and configure it with these options:
./configure --enable-jack --disable-portaudio --disable-mmio --disable-oss --enable-fftw
This way there will be no legacy OSS-MIDI to distract and no portaudio support.
Community
Further issues may be solved with help from fellow Linux Audio users. They can be found on the Linux Audio User Mailinglist, the Linuxmusicians Forum, the linuxaudio subreddit or in the Linux Audio Facebook Group.
Ressources
- https://www.linuxaudio.org
- https://wiki.linuxaudio.org (careful, largely historic information from ~ 2012)
- adjusting_audio_latency · mixxxdj/mixxx Wiki · GitHub
Linux Distributions for Audio Production
- KX Studio Repositories (for Debian or Ubuntu based Linux distributions)
- Ubuntu Studio
- AV Linux
Linux Distributions for Embedded Audio
- Patchbox OS for the Raspberry Pi (+ optional Pisound Hat)
- Elk for the Raspberry Pi with Elk Pi Hat
-
Bela for the BeagleBone with a Bela cape
Disclosure: CHAIR is now working with the Bela Team.
Manual kernel install howto
- Go the kernel archive for a lowlatency kernel (5.15.21 seems to be the newest with a lowlatency variant)
- Navigate to the newest kernel version (If you use the proprietary NVIDIA driver you can usually only upgrade until the next minor version without breaking the graphics driver)
- Download the following four files to your disk:
linux-headers-{version}-lowlatency_{version}_amd64.deb
linux-headers-{version}_{version}_all.deb
linux-image-unsigned-{version}-lowlatency_{version}_amd64.deb
linux-modules-{version}-lowlatency_{version}_amd64.deb
- install with
sudo dpkg -i linux-*.deb
- reboot