Realtime configuration has mostly been automated. There is no longer any need to edit files like /etc/security/limits.conf for realtime access. However, if you must change the settings, see /etc/security/limits.d/99-realtime-privileges.conf and /usr/lib/udev/rules.d/40-realtime-privileges.rules (these files are provided by realtime-privileges). Additionaly, you may want to increase the highest requested RTC interrupt frequency (default is 64 Hz) by running the following at boot:

By default, swap frequency defined by "swappiness" is set to 60. By reducing this number to 10, the system will wait much longer before trying to write to disk.
Then, there is inotify which watches for changes to files and reports them to applications requesting this information. When working with lots of audio data, a lot of watches will need to be kept track of, so they will need to be increased.
These two settings can be adjusted in /etc/sysctl.d/99-sysctl.conf.

vm.swappiness = 10
fs.inotify.max_user_watches = 524288

You may also want to maximize the PCI latency timer of the PCI sound card and raise the latency timer of all other PCI peripherals (default is 64).

JACK

The aim here is to find the best possible combination of buffer size and periods, given the hardware you have. Frames/Period = 256 is a sane starter. For onboard and USB devices, try Periods/Buffer = 3. Commonly used values are: 256/3, 256/2, 128/3.

Also, the sample rate must match the hardware sample rate. To check what sample and bit rates your device supports:

$ cat /proc/asound/card0/codec#0

Replace card0 and codec#0 depending on what you have. You will be looking for rates or VRA in Extended ID. A common sample rate across many of today's devices is 48000 Hz. Others common rates include 44100 Hz and 96000 Hz.

Almost always, when recording or sequencing with external gear is concerned, realtime is a must. Also, you may like to set maximum priority (at least 10 lower than system limits defined in /etc/security/limits.d/99-realtime-privileges.conf); the highest is for the device itself).

Start jack with the options you just found out:

$ /usr/bin/jackd -R -P89 -dalsa -dhw:0 -r48000 -p256 -n3

qjackctl, cadence and patchage can all be used to as GUIs to monitor JACK's status and simplify its configuration .

Note: Once you set up JACK, try different audio applications to test your configuration results. I spent days trying to troubleshoot JACK xrun issues with LMMS which in the end turned out to be the problem with the latter.

FireWire

Note: Nothing much is needed to be done as most things have been automated, especially with the introduction of the new FireWire stack, deprecation of HAL and more focus on udev. You should not need to edit device permissions, but if you suspect that your device may not be working due to such issues, see /lib/udev/rules.d/60-ffado.rules and if needed, create and put your changes into /etc/udev/rules.d/60-ffado.rules.

JACK(2) is built against FFADO, you only need to install it with the libffado package.

To test whether you have any chances of getting FireWire devices to work:

We cannot say for sure, particularly for those based on Ricoh (cross-platform issue). Most of the time, your device will run fine, but on occasion you will be faced with funny quirks. For unlucky ones, you will be facing hell.

Note: As stated by Takashi Sakamoto on the alsa-devel mailing list, if you use the FireWire backend with jackd, the DICE module is incompatible. If you see a line like this :

The output should tell you where your system is lacking and will point you to places to find more information.

Desktop Effects vs JACK

In addition to the factors listed under the System Configuration section above as well as the settings checked by realTimeConfigQuickScan.pl, it is also worth noting that desktop environments can cause xruns and hence JACK audio glitches, especially memory/process intensive ones and those desktops that utilize composited desktop effects. It is recommended you disable desktop effects when using JACK. You are likely to get the least xruns and best performance by running a lightweight desktop or just a window manager instead.

A general example

Realtime kernel

Since a while ago, the stock Linux kernel has proven to be adequate for realtime uses. The stock kernel (with CONFIG_PREEMPT=y, default in Arch) can operate with a worst case latency of upto 10ms (time between the moment an interrupt occurs in hardware, and the moment the corresponding interrupt-thread gets running), although some device drivers can introduce latency much worse than that. So depending on your hardware and driver (and requirement), you might want a kernel with hard realtime capabilities.

The RT_PREEPMT patch by Ingo Molnar and Thomas Gleixner is an interesting option for hard and firm realtime applications, reaching from professional audio to industrial control.
Most audio-specific distro Linux ships with this patch applied. A realtime-preemptible kernel will also make it possible to tweak priorities of IRQ handling threads and help ensure smooth audio almost regardless of the load.

If you are going to compile your own kernel, remember that removing modules/options does not equate to a "leaner and meaner" kernel. It is true that the size of the kernel image is reduced, but in today's systems it is not as much of an issue as it was back in 1995.

In any way, you should also ensure that:

Timer Frequency is set to 1000Hz (CONFIG_HZ_1000=y; if you do not do MIDI you can ignore this)

APM is DISABLED (CONFIG_APM=n; Troublesome with some hardware - default in x86_64)

If you truly want a slim system, we suggest you go your own way and deploy one with static /devs. You should, however, set your CPU architecture. Selecting "Core 2 Duo" for appropriate hardware will allow for a good deal of optimisation, but not so much as you go down the scale.

General issue(s) with (realtime) kernels:

Hyperthreading (if you suspect, disable in BIOS)

There are ready-to-run/compile patched kernels available in the ABS and AUR.

Binaries

MIDI

To decrease MIDI jitter when using external MIDI equipment jack2's -Xalsarawmidi option should be used. When doing this you need to use a2jmidid, too.

With alsa-midi-latency-test you could test how much jitter you get. PCI and PCIe cards are usually much better than USB MIDI devices.

To work with MIDI, it is highly recommended that you install a2j (a2jmidid), a bridge between alsa midi and jack midi. It allows you to connect applications that only communicate with alsa midi to applications that only use jack midi. Laditray can also start/stop a2j.

Environment variables

If you install things to non-standard directories, it is often necessary to set environment path variables so that applications know where to look (for plug-ins and other libraries). This usually affects only VST since users might have a Wine or external Windows location.

We would usually not have Linux plug-ins (LADSPA, LV2, DSSI, LXVST) beyond standard paths, so it is not necessary to export them. But if you do, be sure to include those standard paths as well since Arch does not do anything for dssi or ladspa, and some applications like dssi-vst will not look anywhere else if it finds predefined paths.

Tips and tricks

Disable WiFi and close any programs that don't need to be open when recording such as browsers. Many have reported disabling WiFi has led to more reliable JACK performance.

Some USB audio hardware is known not to work properly when plugged into USB 3 ports so try USB 2/1 ports instead.

IRQ issues can occur and cause problems. An example is video hardware reserving the bus, causing needless interrupts in the system I/O path. See discussion at FFADO IRQ Priorities How-To. If you have a realtime or a recent kernel, you can use rtirq to adjust priorities of IRQ handling threads.

If you are facing a lot of xruns especially with nvidia, disable your GPU throttling. This can be done via the card's control applet and for nvidia it is "prefer maximum performance" (thanks to a mail in LAU by Frank Kober).

Hardware

The majority of sound cards and audio devices will work with no extra configuration or packages, simply set the sound card jack is using to them and restart.

This is not true for all devices, and so special cases are also listed.

M-Audio Delta 1010

The M-Audio Delta series cards are based on the VIA Ice1712 audio chipset.
Cards using this chip require that you install the alsa-tools package, because
it contains the envy24control program. Envy24control is a hardware level
mixer/controller. You can use alsa-mixer but you will save yourself some
hassle not to try it. Note that this section has no information on MIDI setup or
usage.

Open the mixer application:

$ envy24control

This application can be more than a bit confusing; see envy24control for guidance
on its use. That said, here is a very simple working setup for multitracking with Ardour.

On the "Monitor Inputs" and "Monitor PCMs" tabs, set all monitor inputs and monitor PCM's to around 20.

On the "Patchbay / Router" tab, set all to PCM out.

On the "Hardware Settings" tab, verify that the Master Clock setting matches what is set in Qjackctl. If these do not match you will have xruns out of control!

M-Audio Fast Track Pro

The M-Audio Fast Track Pro is an USB 4x4 audio interface, working at 24bit/96kHz. Due to limitation of USB 1, this device requires additional setup to get access to all its features. Device works in one of two configuration:

where vid and pid are vendor and product id for M-Audio Fast Track Pro, index is desired device number and device_setup is desired device setup. Possible values for device_setup are:

device modes

device_setup value

bit depth

frequency

analog output

digital output

analog input

digital input

IO mode

0x0

16 bit

48kHz

+

+

+

+

4x4

0x9

24 bit

48kHz

+

+

+

-

2x4

0x13

24 bit

48kHz

+

+

-

+

2x4

0x5

24 bit

96kHz

*

*

*

*

2x0 or 0x2

The 24 bit/96kHz mode is special: it provides all input/output, but you can open only one of 4 interfaces at a time. If you for example open output interface and then try to open second output or input interface, you will see error in kernel log:

cannot submit datapipe for urb 0, error -28: not enough bandwidth

which is perfectly normal, because this is USB 1 device and cannot provide enough bandwidth to support more than single (2 channel) destination/source of that quality at a time.

Depending on the value of index it will setup two devices: hwYYY:0 and hwYYY:1, which will contain available inputs and outputs. First device is most likely to contain analog output and digital input, while second one will contain analog input and digital output. To find out which devices are linked where and if they are setup correctly, you can check /proc/asound/cardYYY/stream{0,1} . Below is list of important endpoints that will help in correctly identifying card connections (it easy to mistake analog and digital input or output connections before you get used to the device):

This .asoundrc file enables 24-bit IO on the fast-track pro (and I'm sure it could be modified to work with other 3-byte usb devices) within the context of jack's 32-bit interface while routing default alsa traffic to jack outputs on the audio interface. Alsa will be in S24_3BE mode but jack can plug S32_LE data in and out of the interface and other alsa programs will be able to plug almost anything into jack.

Volume levels are hardware and routing can be done through QjackCtl, even with more cards linked together, this is not a problem.
The ffadomixer does not work with this card yet, hopefully in the future we can control more aspects of the card through a software interface like that.

PreSonus AudioBox USB

Startup: It is called "USB" by ALSA.

Specs: Two mono TRS+XLR in, two mono TRS out, MIDI in and out, plus separate stereo headphone jack. Knob controls for both inputs, for main out, and for headphone, four in all.

Hardware: Works very well, audio and MIDI too. No software mixer controls at all.

Plug in the unit
The device should now be working, there are no software mixer controls

RME Babyface

It works very well at low latencies (~5ms) with alsa-utils, jack2 and linux-rtAUR. Running on ALSA only with the standard kernel may cause crackling at lower latencies.

To be recognized and work, the firmware version of the Babyface needs to be >= 200, which introduces the Class Compliant Mode. To enter Class Compliant Mode hold the "Select" and "Recall" buttons while connecting the Babyface to the computer via USB. It should now be recognized.

To check if it is recognized:

grep -i baby /proc/asound/cards

For more info about the Class Compliant Mode visit RME's website, they have PDF which covers all the functionality.

The Babyface does not need any special Jack Settings. But if you want to use the built in MIDI In/Out then you need to set the "MIDI Driver" to "seq" and optionally disable "Enable Alsa Sequencer Support" to use it in combination with other MIDI Devices (a USB Midi Keyboard for example).

Restricted software

Steinberg's SDKs

It is very clear - we can distribute neither the VST nor the ASIO headers in binary package form. However, whenever you are building a program which would host Windows .dll VST plug-ins, check for the following hints (that do not require use of any SDK):

dssi-vst

fst

vestige

With that said, if you are building a program which would host native .so VST plug-ins, then there is no escape. For such cases, Arch yet again allows us to maintain a uniform local software database. We can "install" the SDK system-wide - you simply have to download it yourself and place it in the packaging directory.

Note: Steinberg does not forbid redistribution of resulting products, nor dictate what license they can be under. There are many GPL-licensed VST plug-ins. As such, distributing binary packages of software built with these restricted headers is not a problem, because the headers are simply buildtime dependencies.

Arch Linux Pro Audio Project

Yes, we have one. Think of "Planet CCRMA" or "Pro Audio Overlay", less the academic connotations of the former: ArchAudio.

What this means is that the repositories are add-ons, i.e you need to have a running, sane Arch Linux installation.

It is a relatively new effort although the initiative has been around since
2006/2007.