February 2, 2020

435 words 3 mins read

Build Audio Production Environment in Manjaro Linux

Build Audio Production Environment in Manjaro Linux

I have built an audio production environment in Manjaro Linux, which is a distribution of Arch Linux. We can just follow the procedure in the official wiki for Arch Linux. https://wiki.archlinux.org/index.php/Professional_audio

Getting Started

Install a DAW

Any DAW should be fine. I have installed Ardour.

$ sudo pacman -S ardour

Add the user to realtime Group

Although JACK is installed by default, it is not able to be run unless the user is added to realtime group.

$ sudo pacman -S realtime-privileges
$ sudo gpasswd -a USERNAME realtime

This makes Ardour work anyway.

Setting for GUI-based JACK

Minimum Configuration

https://wiki.archlinux.org/index.php/JACK_Audio_Connection_Kit#A_GUI-based_example_setup

$ sudo pacman -S jack2 python-dbus qjackctl

Exchange jack with jack2 according to the wiki. jack2 has a small advantage against jack in terms of coordination with qjackctl, which is a GUI-based JACK control tool. Open qjackctl and then check Enable JACK D-Bus interface in Setup > Misc

qjackctl-setting-etc

In case you want to integrate PulseAudio with JACK

Sounds from PulseAudio are not normally enabled whilst JACK is running. This is quite unuseful as sounds from applications not compatible with JACK are disable. The procedure in the following wiki makes sounds from PulseAudio enable via JACK.

https://wiki.archlinux.org/index.php/PulseAudio/Examples#PulseAudio_through_JACK

$ sudo pacman -S jack2 cadence pulseaudio-jack

As the following figure, set ALSA Audio to ALSA -> PulseAudio -> JACK (Plugin).

manjaro-kernel-install

System Optimisation

Although the above procedure has already made JACK and DAW work, the following additional settings are recommended to minimise the latency.

Apply realtime Kernel

In Manjaro Linux, Kernels can be downloaded from Settings > Manjaro Settings Manager. Kernels having rt should be installed.

manjaro-kernel-install

Hit Shift key continuously during booting the PC to enter GRUB to select the Kernel.

Ser Governor

Set Kernel Governer to performance.
https://wiki.archlinux.org/index.php/CPU_frequency_scaling#Scaling_governors

$ sudo cpupower frequency-set -g performance

Make the Governor setting permanent

Make the following change to set the Governor enabled at boot:
https://wiki.archlinux.org/index.php/CPU_frequency_scaling#cpupower
https://wiki.archlinux.org/index.php/Systemd#Enabling

$ sudo vim /etc/default/cpupower

# Define CPUs governor
# valid governors: ondemand, performance, powersave, conservative, userspace.
governor='performance'

Check whether the unit is enabled at or not:

$ systemctl is-enabled cpupower

If disabled, enable the unit to start automatically at boot:

$ sudo systemctl enable cpupower

Set Interrupt Frequency

Increase in the number of interruptable processes will contribute to further low latency.

$ sudo vi /etc/systemd/system/RTC_interrupt_frequency.service
echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq

Mend Swappiness

Decrease in swappiness from 60 to 10 allows the waiting time before swap longer.

$ sudo vi /etc/sysctl.d/90-swappiness.conf
vm.swappiness = 10

Mend Maximum Watches

Increase in the maximum watches seems to make a good result as DAWs have to handle a lot of files.

$ sudo vi /etc/sysctl.d/90-max_user_watches.conf
fs.inotify.max_user_watches = 600000