Skip to content

chmaha/DebianProAudio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 

Repository files navigation

A Pro Audio Tuning Guide for Debian (and other Debian-based distros)

Following this guide will allow you to get the best possible performance on Linux for professional audio needs. Even though these steps are well-tested, it is wise to research what each step accomplishes and why (the search engine is your friend :P ). See also https://wiki.linuxaudio.org/wiki/system_configuration and https://wiki.archlinux.org/title/Professional_audio.

For the Arch-based guide see https://github.com/chmaha/ArchProAudio.

Fundamentals

To get started after installing Debian, you could try just steps 3 & 4 below. If you need to use windows plugins on Linux also follow step 12 (easy: wine-staging, more advanced but potentially more performance: wine-tkg). Based on your individual pro audio needs, workflows, hardware specifications and more, your mileage may vary. If you are still having audio performance issues, try following the full guide...

Pipewire?

December 2024 update: In general, I feel more confident about recommending pipewire using backports (up to v.1.2.5) or building from git (official build instructions). I personally avoid backports as I've found them to be a bit of a pain to use. You have to select each package, manually force the backport version and deal with various potential "broken" packages. For ease of setting up, I still think Debian 13 will be a better time to jump on the pipewire train but if you can stomach backports or have the confidence to build from git, go ahead!

Advice for less experienced Linux users of Debian 12 and earlier: In short, no, don't do it if you are a pro audio user. I don't believe those regular repository package versions are ready for primetime. The following commands should be safe to run on Debian 12 with any desktop environment (or any debian-based distro that ships with pipewire audio as the default) to revert to ALSA + Pulseaudio + JACK:

sudo apt remove pipewire-alsa pipewire-pulse pipewire-jack
sudo apt install pulseaudio pulseaudio-module-jack jackd2 pavucontrol
sudo apt install pipewire-media-session wireplumber-
sudo reboot

You should end up with something like the following if you run inxi -Aa:
image

Full In-depth Guide

1. Install Debian 12 (or other favorite Ubuntu-based or Debian-based distro)

To make your life easier, install either Ubuntu Studio or AVLinux. Almost all of the following tweaks are taken care of. Otherwise, pick a regular distro such as Debian, Ubuntu, MXLinux, etc.

2. rtcqs (formerly known as realtimeconfigquickscan)

git clone https://codeberg.org/rtcqs/rtcqs.git
cd rtcqs
./src/rtcqs/rtcqs.py

3. Add user to audio group and configure realtime privileges

I believe that installing jackd2 takes care of the following these days.

sudo nano /etc/security/limits.d/audio.conf

Add the following lines:

@audio   -  rtprio     95
@audio   -  memlock    unlimited

Then create an audio group (if it doesn't exist already) and add your user to it:

sudo groupadd audio 
sudo usermod -a -G audio $USER

Reboot to see the effects.

4. Kernel tweaks

First, check via uname -a to see if you have PREEMPT_DYNAMIC (this is true for Debian 12). If so, add "preempt=full", "threadirqs" and "cpufreq.default_governor=performance" as kernel parameters:

sudo nano /etc/default/grub

change GRUB_CMDLINE_LINUX="" to GRUB_CMDLINE_LINUX="preempt=full threadirqs cpufreq.default_governor=performance"

sudo update-grub

Remember to reboot to see the effects.

If you don't have PREEMPT_DYNAMIC due to an older kernel version, for better performance consider installing linux-lowlatency package if on Ubuntu or Liquorix if on Debian via instructions at https://liquorix.net/ and then just add the "threadirqs" and "cpufreq.default_governor=performance" kernel parameters as shown above.

5. Swappiness

sudo nano /etc/sysctl.d/99-sysctl.conf

add "vm.swappiness=10"

6. Spectre/Meltdown Mitigations

If you run rtcqs.py and it gives you a warning about Spectre/Meltdown Mitigations, you could add mitigations=off to GRUB_CMDLINE_LINUX. Warning: disabling these mitigations will make your machine less secure! https://wiki.linuxaudio.org/wiki/system_configuration#disabling_spectre_and_meltdown_mitigations

7. Install udev-rtirq (ignore if using pipewire and "pro audio" profile?)

git clone https://github.com/jhernberg/udev-rtirq.git
cd udev-rtirq
sudo make install
reboot

8. Jack2 + Jack D-Bus (ignore if using pipewire)

sudo apt install qjackctl jackd2 pulseaudio-module-jack

Enable Jack D-Bus interface:
image

Select your audio interface:
image

To record system audio (say from a browser), 1) make sure JACK is started, 2) start the browser playback, 3) open pavucontrol and select "JACK Sink" as the output under the "playback" tab 4) Connect the relevant cables in qjackctl's graph window being careful to ensure that you are not hearing output twice i.e. delete the cables from the sink direct to the playback and only route to your DAW inputs:

image

9. DAW & Plugins

REAPER: http://reaper.fm/download.php

change RT priority to 40 on audio device page?

Also be sure to check out Bitwig Studio, Tracktion Waveform, Qtractor, LMMS, Rosegarden, Zrythm etc... https://en.wikipedia.org/wiki/List_of_Linux_audio_software#Digital_audio_workstations_(DAWs)

Native plugins

A brilliant resource for Debian- and Ubuntu-based distros is https://kx.studio/. Add the repo by downloading and installing the repo.

10. Wine-staging or Wine-tkg

Perhaps start with vanilla wine-staging and see how you fare in terms of performance. If your workflows rely heavily on VSTi like Kontakt, you may find better performance with wine-tkg (fsync enabled).

Wine-staging

sudo apt install wine-staging

Or, install a particular version that you know is compatible (in this case v6.14):

version=6.14
variant=staging
codename=$(shopt -s nullglob; awk '/^deb https:\/\/dl\.winehq\.org/ { print $3; exit }' /etc/apt/sources.list /etc/apt/sources.list.d/*.list)
suffix=$(dpkg --compare-versions "$version" ge 6.1 && ((dpkg --compare-versions "$version" ge 6.17 && echo "-2") || echo "-1"))
sudo apt install --install-recommends {"winehq-$variant","wine-$variant","wine-$variant-amd64","wine-$variant-i386"}="$version~$codename$suffix"

To prevent the package being updated:

sudo apt-mark hold winehq-staging

and in case you want to ever re-enable updating:

sudo apt-mark unhold winehq-staging

Check https://github.com/robbert-vdh/yabridge#tested-with for up-to-date info.

OR...for the more adventurous:

Wine-tkg

Either download a wine-tkg build from https://github.com/Frogging-Family/wine-tkg-git/actions/workflows/wine-arch.yml or follow the instructions to git clone and install latest version: https://github.com/Frogging-Family/wine-tkg-git/tree/master/wine-tkg-git#quick-how-to-

If using wine-tkg, set the WINEFSYNC environment variable to 1 according to https://github.com/robbert-vdh/yabridge#environment-configuration (depends on your display manager and login shell)

11. Install yabridge

i. Please follow the instructions at https://github.com/robbert-vdh/yabridge#usage

To begin, download the latest release from https://github.com/robbert-vdh/yabridge/releases and run:

tar -C ~/.local/share -xavf yabridge-x.y.z.tar.gz

where x.y.z is the version number such as 4.0.1. Don't forget to add yabridgectl to your shell's search path by adding export PATH="$PATH:$HOME/.local/share/yabridge to the end of ~/.bashrc. Close then re-open the terminal.

ii. Configure yabridge according to https://github.com/robbert-vdh/yabridge#readme

iii. Install Windows VST2, VST3 and CLAP plugins

12. Check volume levels!

Once everything is set up, don't forget to check that volume levels are set correctly. Run

alsamixer

to check that output is set to 100 (vertical bars) or gain of 0dB (top left of alsamixer). Use F6 to select the correct soundcard. You can also use your desktop environment's volume controls if you have your interface enabled there but note that numbers don't seem to match alsamixer.

alsamixer

13. Other useful tools (all available via the package manager)

Music Player: strawberry (can produce bit-perfect playback)
image
Tagger: kid3, picard
DDP creation/verification/etc: ddptools
Audio Converter: fre:ac or soundconverter
CD Ripper: asunder or cdrdao
CD Burner: cdrdao, k3b or nerolinux4

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published