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
Next revisionBoth sides next revision
wiki:system_configuration [2020/03/17 20:47] – [The kernel] autostaticwiki:system_configuration [2020/06/08 11:51] – [How do I build a real-time audio workstation on Linux?] grammo
Line 6: Line 6:
  
 ===== How do I build a real-time audio workstation on Linux? ===== ===== How do I build a real-time audio workstation on Linux? =====
 +
 +The [[https://manual.ardour.org/setting-up-your-system/the-right-computer-system-for-digital-audio/|Ardour manual]] has a interesting introduction about getting the right computer system for digital audio. Below that article there is also a (somewhat Windows oriented) [[https://www.youtube.com/watch?v=GUsLLEkswzE| video]] by Richard Ames, which could be helpful to get a idea which things are involved for this topic. Summary: lots of things are involved for a well performing real-time audio workstation. It's not simply a matter of buying a computer with massive CPU and memory power, as the coming sections on this page shows.
 +
 +A good starting point for optimizing your system for real-time audio on GNU/Linux, is the QuickScan script below (as a newbie you might want to ignore the hardware timers settings first).
 +
 +After adjusting your system using the recommendations of the QuickScan and with JACK (QjackCtl) and a2jmidid installed, the basics should be there for a good performing real-time audio system (depending on your hardware too of course). 
 ==== Preliminary ==== ==== Preliminary ====
  
Line 62: Line 68:
 This is only needed for so-called generic kernels, ie. standard kernels that are not tweaked for lowlatency performance. You can check if your kernel already includes this option with the following command: This is only needed for so-called generic kernels, ie. standard kernels that are not tweaked for lowlatency performance. You can check if your kernel already includes this option with the following command:
  
-  $ grep -e "CONFIG_IRQ_FORCED_THREADING=y" -e "CONFIG_PREEMPT=y" /boot/config-`uname -r`+  $ grep -e "CONFIG_IRQ_FORCED_THREADING=y" -e "CONFIG_PREEMPT_RT=y" /boot/config-`uname -r`
    
-If it returns ''CONFIG_IRQ_FORCED_THREADING=y'' and ''CONFIG_PREEMPT=y'' then your kernel is using IRQ threading and you don't have to proceed with the following steps. If it only returns ''CONFIG_IRQ_FORCED_THREADING=y'' you can add the ''threadirqs'' boot option as described below. If the command returns nothing you have a kernel that cannot use threaded IRQs.+If it returns ''CONFIG_IRQ_FORCED_THREADING=y'' and ''CONFIG_PREEMPT_RT=y'' then your kernel is using IRQ threading and you don't have to proceed with the following steps. If it only returns ''CONFIG_IRQ_FORCED_THREADING=y'' you can add the ''threadirqs'' boot option as described below. If the command returns nothing you have a kernel that cannot use threaded IRQs.
  
 Open ''/etc/default/grub'' with your favorite editor as root. Open ''/etc/default/grub'' with your favorite editor as root.
Line 85: Line 91:
 == Debian == == Debian ==
  
-Since Debian Wheezy an RT variant is also available in the [[https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=linux-image-rt|stock repositories]]; unfortunately its system timer is set to 250 Hz instead of 1000 Hz, so you'll probably want to recompile your own kernel anyway, especially if you use ALSA MIDI. These kernels incorporate [[http://pengutronix.de/software/linux-rt/debian_en.html|Pengutronix]] patches (see [[https://wiki.debian.org/DebianMultimedia#Realtime_kernel|DebianMultimedia Wiki]]). The [[http://www.64studio.com/|64 Studio]] real-time kernels are in the backports apt repository, so for Debian Squeeze you will have to add the following line to your apt sources list: +Since Debian Wheezy an RT variant is also available in the [[https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=linux-image-rt|stock repositories]]; unfortunately its system timer is set to 250 Hz instead of 1000 Hz, so you'll probably want to recompile your own kernel anyway, especially if you use ALSA MIDI. These kernels incorporate [[http://pengutronix.de/software/linux-rt/debian_en.html|Pengutronix]] patches (see [[https://wiki.debian.org/DebianMultimedia#Realtime_kernel|DebianMultimedia Wiki]]).
- +
-  deb http://apt.64studio.com/backports squeeze-backports main+
  
 == Arch == == Arch ==
Line 95: Line 99:
 == Gentoo == == Gentoo ==
  
-RT kernels are vailable in the pro-audio overlay (http://proaudio.tuxfamily.org/wiki/index.php?title=Main_Page).+An audio overlay can be found here [[https://github.com/gentoo-audio/audio-overlay]].
  
 === Build your own real-time kernel === === Build your own real-time kernel ===
  
-If your distribution isn't any help, you can compile and install a real-time kernel manually. The examples assume building a RT kernel based on the 3.kernel version but they should generally apply fo other kernel versions too provided that there is a RT patchset available for the used kernel. +If your distribution isn't any help, you can compile and install a real-time kernel manually. The examples assume building a RT kernel based on the 4.kernel version but they should generally apply for other kernel versions too provided that there is a RT patchset available for the used kernel. 
  
 Install the necessary packages, on Debian and Ubuntu this is: Install the necessary packages, on Debian and Ubuntu this is:
   sudo apt-get install kernel-package fakeroot build-essential   sudo apt-get install kernel-package fakeroot build-essential
  
-Download the kernel sources and the RT patchset (this example uses the 3.18 branch, you're free to use another kernel branch for which there is a RT patch set available):+Download the kernel sources and the RT patchset (this example uses the 4.branch, you're free to use another kernel branch for which there is a RT patch set available):
   mkdir -p ~/tmp/linux-rt   mkdir -p ~/tmp/linux-rt
   cd ~/tmp/linux-rt   cd ~/tmp/linux-rt
Line 200: Line 204:
  
  
-Then you can compile...+Then you can compile.
   make clean   make clean
   make deb-pkg   make deb-pkg
wiki/system_configuration.txt · Last modified: 2024/01/13 15:00 by autostatic