Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:system_build [2023/10/16 14:57] – [Boot settings] autostaticwiki:system_build [2024/01/12 09:43] (current) – [System settings] autostatic
Line 1: Line 1:
 ====== Build a Linux audio system ====== ====== Build a Linux audio system ======
  
-A minimal, basic and KISS manual on how to build a Linux audio system. This manual comprises installation and configuration of a Linux audio system based on Debian 12 with a XFCE desktop environment and a Liquorix kernel.+A minimal, basic and KISS manual on how to build a Linux audio system. This manual comprises installation and configuration of a Linux audio system based on Debian 12 with a XFCE desktop environment.
 ===== Hardware ===== ===== Hardware =====
 This manual assumes you're on a X86_64 platform. Any notebook or desktop computer using this platform should work but bear in mind that the more powerful your computer, the better it will run a Linux audio system. Linux audio applications and plugins can be very resource intensive so the more CPU and memory, the better. Using an Solid State Drive (SSD) as the main hard drive is also recommended. This manual assumes you're on a X86_64 platform. Any notebook or desktop computer using this platform should work but bear in mind that the more powerful your computer, the better it will run a Linux audio system. Linux audio applications and plugins can be very resource intensive so the more CPU and memory, the better. Using an Solid State Drive (SSD) as the main hard drive is also recommended.
  
-When using an USB audio interface make sure you're using a quality USB cable in working order and that the USB interface is attached to a USB port with as little other peripherals or other devices connected to it as possible. This can be checked with the ''lsusb'' command. ''lsusb'' indicates bus numbers and devices so it's a matter of figuring out which physical USB port is attached to which bus and then picking the port connected to a bus that has as little other devices attached to it.+When using an USB audio interface make sure you're using a quality USB cable in working order and that the USB interface is attached to a USB port with as little other peripherals or other devices connected to it as possible. This can be checked with the ''lsusb'' command. ''lsusb'' indicates bus numbers and devices so it's a matter of figuring out which physical USB port is attached to which bus and then picking the port connected to a bus that has as little other devices attached to it. ''lsubutils'' is part of the usbutils packae.
  
 An example of a quality USB cable: https://shop.klotz-ais.com/usb-ab.html An example of a quality USB cable: https://shop.klotz-ais.com/usb-ab.html
  
 ===== Operating system ===== ===== Operating system =====
-{{https://www.debian.org/Pics/debian-logo-1024x576.png?200 }} This manual starts from a standard Debian 12 "Bookworm" installation with XFCE installed from a live CD.+{{https://www.debian.org/Pics/debian-logo-1024x576.png?200 }} This manual starts from a standard Debian 12 "Bookworm" installation with XFCE installed from a live install image.
  
 ==== Download the operating system ==== ==== Download the operating system ====
Line 36: Line 36:
 Install the following packages from the default Debian repositories: Install the following packages from the default Debian repositories:
   * rtirq-init   * rtirq-init
-  * vlc 
   * a2jmidid   * a2jmidid
-  * htop 
-  * usbutils (when using an USB audio interface) 
  
 They can be installed in one go: They can be installed in one go:
-  sudo apt install rtirq-init vlc a2jmidid htop usbutils+  sudo apt install rtirq-init a2jmidid 
 + 
 +Select "Yes" during the installation of jackd2 when asked to enable real time process priority.  
  
-Select "Yes" during the installation of jackd2 when asked to enable real time process priority. 
  
 ==== Boot settings ==== ==== Boot settings ====
Line 54: Line 53:
   mitigations=off usbcore.autosuspend=-1 threadirqs   mitigations=off usbcore.autosuspend=-1 threadirqs
  
-You can do this with an editor as root, so with ''sudo vi''''sudo nano'' in a terminal session. Make sure the line looks like this now:+You can do this with an editor as root, so with ''sudo vi'' or ''sudo nano'' in a terminal session. Make sure the line looks like this now:
   GRUB_CMDLINE_LINUX="mitigations=off usbcore.autosuspend=-1 threadirqs"   GRUB_CMDLINE_LINUX="mitigations=off usbcore.autosuspend=-1 threadirqs"
  
-And update the Grub configuration with ''sudo update-grub''. For an explanation of the above options, see [[wiki:system_configuration|]]. ''usbcore.autosuspend=-1'' only applies if you're working with an USB audio interface. This option makes sure your USB device will never be put in a sleep state.+And update the Grub configuration with ''sudo update-grub''. To activate these Grub settings you will have to reboot your machine. For an explanation of the above options, see [[wiki:system_configuration|]]. ''usbcore.autosuspend=-1'' only applies if you're working with an USB audio interface. This option makes sure your USB device will never be put in a sleep state. 
 + 
  
 For ''/etc/modprobe.d/'' it's a matter of personal preferences i.e. whether you'd want to load USB devices in a certain order or if you'd like to block certain drivers from loading. An example configuration file could look as follows: For ''/etc/modprobe.d/'' it's a matter of personal preferences i.e. whether you'd want to load USB devices in a certain order or if you'd like to block certain drivers from loading. An example configuration file could look as follows:
Line 91: Line 92:
 ==== User settings ==== ==== User settings ====
 Add your user to the audio group. Add your user to the audio group.
-  sudo usermod -a -G youruser audio+  sudo usermod -a -G audio youruser
   newgrp audio   newgrp audio
  
Line 105: Line 106:
  
 ==== System settings ==== ==== System settings ====
-The easiest option to finish up setting your system when starting it up is with a script in ''/usr/local/bin'' that you call as a service through systemd. Name the script something like ''rt-audio-setup'' and make sure it contains at least the following lines:+The easiest option to finish up setting your system when starting it up is with a script in ''/usr/local/sbin'' that you call as a service through systemd. Name the script something like ''rt-audio-setup'' and make sure it contains at least the following lines:
   # Disable CPU frequency scaling   # Disable CPU frequency scaling
   systemctl mask ondemand   systemctl mask ondemand
Line 117: Line 118:
   [Service]   [Service]
   Type=oneshot   Type=oneshot
-  ExecStart=/usr/local/bin/rt-audio-setup+  ExecStart=/usr/local/sbin/rt-audio-setup
      
   [Install]   [Install]
   WantedBy=multi-user.target   WantedBy=multi-user.target
  
-And enable and start it with ''sudo systemctl enable --now rt-audio-setup''.+And enable and start it
 +  sudo systemctl enable --now rt-audio-setup
  
 The script could be extended to configure other settings like disabling hyper threading or unloading unneeded kernel modules when desired. The script could be extended to configure other settings like disabling hyper threading or unloading unneeded kernel modules when desired.
Line 147: Line 149:
  
 After having adjusted these settings restart ''rtirq'' with ''sudo systemctl restart rtirq''. You can check the current IRQ priorities with ''sudo /etc/init.d/rtirq-init status''. After having adjusted these settings restart ''rtirq'' with ''sudo systemctl restart rtirq''. You can check the current IRQ priorities with ''sudo /etc/init.d/rtirq-init status''.
-==== Liquorix kernel ====+==== Optional parts ==== 
 +=== Liquorix kernel ===
 {{https://upload.wikimedia.org/wikipedia/commons/8/85/Liquorice_wheels.jpg?200 |Photo by Pikaluk from UK - Flickr, CC BY 2.0}}The Liquorix project provides a kernel flavor that works well for low latency audio. Download the installer: {{https://upload.wikimedia.org/wikipedia/commons/8/85/Liquorice_wheels.jpg?200 |Photo by Pikaluk from UK - Flickr, CC BY 2.0}}The Liquorix project provides a kernel flavor that works well for low latency audio. Download the installer:
   curl -s -O "https://liquorix.net/install-liquorix.sh"   curl -s -O "https://liquorix.net/install-liquorix.sh"
Line 156: Line 159:
 This will install the latest Liquorix kernel available. Reboot to start your system with the Liquorix kernel. This will install the latest Liquorix kernel available. Reboot to start your system with the Liquorix kernel.
  
-==== KX Studio packages ====+=== KX Studio packages ===
 {{:wiki:kxstudio.jpg?200 }}The KX Studio repositories contain a lot of audio applications and plugins not available in the default repositories. Instructions can be found here: https://kx.studio/Repositories {{:wiki:kxstudio.jpg?200 }}The KX Studio repositories contain a lot of audio applications and plugins not available in the default repositories. Instructions can be found here: https://kx.studio/Repositories
  
 Installing the kxstudio-default-settings package is not necessary, in fact, given the age and content of this package it might be better to not install it at all. Installing the kxstudio-default-settings package is not necessary, in fact, given the age and content of this package it might be better to not install it at all.
 +
 +Bear in mind the KX Studio repositories are showing their age and that the versioning of the packages uses a higher [[https://www.debian.org/doc/debian-policy/ch-controlfields.html#version|epoch]] than their Debian or Ubuntu counterparts (if those exist). This prevents newer versions in the default repositories to not get installed or update over packages already installed from KX Studio.
  
 ===== Wrapping it up ===== ===== Wrapping it up =====
Line 165: Line 170:
  
 To check if the most important conditions for a well working Linux audio system are met you could run the rtcqs script, see [[wiki:system_configuration#rtcqs]]. To check if the most important conditions for a well working Linux audio system are met you could run the rtcqs script, see [[wiki:system_configuration#rtcqs]].
 +
 +===== Support =====
 +Got questions? You can always ask at https://linuxmusicians.com/
wiki/system_build.1697461074.txt.gz · Last modified: 2023/10/16 14:57 by autostatic