Pro Audio

From ArchWiki

(Redirected from ProAudio)
Jump to: navigation, search


Contents

Introduction to Professional Audio (Pro Audio) in Linux

Modern Linux/GNU systems are more than capable of supporting your professional audio needs. Latencies of 5ms and down as low as 1ms can be achieved on a properly configured machine. There also are a wide variety of applications available to suit whatever task you may need to perform.

  • Jack is a sound server that handles the communication between applications and sound cards,and has the ability to run in realtime. It is available in the jack-audio-connection-kit package. There are lots of other applications that work in conjunction with Jack, such as Jack-rack and Jack-eq. A fork of the Jack project optimized for SMP machines called Jackmp is available as well.
  • LADSPA and LV2 are plugin systems that provides professional reverbs and effects.
  • Ardour is ideal for multitrack recording. Traverso and Qtractor are nice applications as well, and deserve support.
  • Other applications that may be of interest include Rosegarden (audio and MIDI sequencer, score editor, and general-purpose music composition and editing application) and Hydrogen (an advanced drum machine/pattern editor with midi support).

Some resources:

The Madfire repo is no longer maintained.

Tuning and Configuration

The following are guides to get your system running properly. Keep in mind that all machines are different, and that the Linux world is a rapidly changing environment.


Configuring /etc/fstab

Verify that this line exists:

none                   /dev/shm      tmpfs     defaults            0      0

Adding the "noatime" option on ext3 filesystems in /etc/fstab has been shown to improve disk performance.

Anyone care to tackle ext4 here?

Setting up Jack

Qjackctl is a nice frontend for Jack and is recommended. The most important settings are realtime,sample rate,frames/period and periods/buffer. Realtime should be enabled for any real work to be done. It is recommended to set periods/buffer to 2 for internal soundcards and 3 for usb-soundcards and intel-hda. Sample rate is dependent on you hardware, and the setting in jack MUST match the setting on your hardware. For example if I set jack to 48khz and my delta1010 is set to 96khz I will get xruns out of control. The key here is to find the lowest latency possible with no xruns, so experiment with frames/period and sample rate until you get in the zone. The other settings can be potentially useful as well, and are described excellently here: http://w3.linux-magazine.com/issue/67/JACK_Audio_Server.pdf

The jack project has a fork called jackmp that is designed for SMP machines. This is strongly recommended and will eventually become Jack2! Please use and report bugs!


Routing and Patchbays

This can be handled fairly easily directly from Qjackctl, or by the really nice Patchage front end.

Realtime Kernel ( kernel26rt )

There are some possible ways to get a Realtime Kernel, the first one is probably the fastest:

by AUR

There are patched kernels available in the AUR. Kernel 2.6.29 patched with patch-2.6.29-rt1 is reporting good results.

by ABS

The latest stock packages for kernel26 have been modified to handle building kernels in parallel and work quite nicely. Use ABS and modify the PKGBUILD per the #comments.

A few notes on rt kernel configuration:

  • Don't go crazy trying to get zero latency! Get set up reasonably and do some audio work!
  • Rule of thumb: If you don't need it...shut it off!
  • ACPI and apm should be disabled (or at best minimalized), either in the config or by adding acpi=off to your bootloader
  • Group scheduling options should be disabled.
  • Disabling kernel debugging seems to reduce some overhead.
  • If your system supports hyperthreading test the rt kernel with it disabled in the BIOS. Results seem to vary on different hardware.
  • also verify that irq_balancing is disabled in the kernel as well.

The irqbalance package in [extra] is much better than the support in the kernel on multi cpu systems, and can really make a huge difference.

IRQBalance

The latest kernel versions (2.6.29 and possibly earlier) are incompatible with the irqbalance daemon!!

More information:

Realtime priority for users

You must be in the audio group for user realtime. The file /etc/security/limits.conf should look similar to this:

@audio          -       rtprio          99
@audio          -       nice           -10
@audio          -       memlock         unlimited

This example is pushing it hard, but if you are getting good performance and not choking out other processes it's ok. Experiment.

If I'm not mistaken rtprio is the maximum priority rt processes can get. The nice value shouldn't matter. memlock unlimited means that your whole memory can be hogged by audio processes, you might not want that. I use about 76% of my memory because ardour doesn't complain then.

Environment Variables

It's often necessary to set environment variables to make plugins found. This affects, LADSPA, DSSI as well as LV2 plugins.

One way to do this is to add the following lines to your users bashrc (~/.bashrc)

export LADSPA_PATH=/usr/lib/ladspa:~/.ladspa:/usr/local/lib/ladspa
export LV2_PATH=/usr/lib/lv2:~/.lv2:/usr/local/lib/lv2
export DSSI_PATH=/usr/lib/dssi:~/.dssi:/usr/local/lib/dssi

I don't use VST but logic dictates that this is the right path:

export VST_PATH=/usr/lib/vst:~/.vst:/usr/local/lib/vst

Misc Information And Tips

  • Some daemons can start unexpectedly and cause a xrun! ls /var/run/daemons to see whats running and if you don't need it - kill it!
  • Sometimes IRQ issues can occur and cause problems. An example being the video card hogging the bus causing xruns. These issues can be fixed using the rtirq script.
  • Know your cronjobs! By default a lot of cronjobs are set to run daily, which usually means at midnight.

Known Arch Issues (please help to resolve these)

Midi-thru ports don't show up anywhere

Cause and fix unknown.

Hardware Specific Information

This section is for details on using and configuring audio devices.


The M-Audio Delta 1010

This hardware requires that you install the alsa-tools package from the AUR, 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 then a bit confusing, and I am yet to find a reasonable tutorial for its use. That said, here is a working setup for multitracking with Ardour.

  1. Set all monitor inputs and monitor PCM's to around 20.
  2. Patchbay/router tab: Set all to PCM out.
  3. Hardware Settings: Verify that the Master Clock setting matches what is set in Qjackctl. If these do not match you will have xruns out of control!


The PreSonus Firepod

This hardware requires that you install the libffado beta or svn package from the AUR. You will also need these packages for FW control:

  • libraw1394
  • libiec61883
  • libavc1394
  1. Startup: Either from commandline or QjackCtl, the driver is called firewire.
  2. Specs: The card contains 8/8 preamp'ed XLR plus a stereo pair, in total 10 channels.
  3. Linking: Cards can be linked together without any problems.
  4. Hardware Settings: Nothing particular, tweak the settings in QjackCtl to your likings.

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.


The Presonus Firebox

This hardware requires the installation of libfreebob and jack-audio-connection-kit from svn, AUR, or using ABS.

You will also need these packages for FW control:

  • libraw1394
  • libiec61883
  • libavc1394

Be sure to load the kernel modules for firewire control:

  • modprobe ieee1394
  • modprobe raw1394

Then add them to the modules section of rc.conf

I had to change some udev specific configs found here.

[1]

If jackd complains: "Could not get 1394 handle: Permission denied:"

  • chmod a+rw /dev/raw1394

Add this line to rc.local so it runs on each boot

Contribution

If you manage to get a good setup for your system and would like to contribute, you can post your specifics here and in the Configuration/Tuning section in the archaudio forums at http://forums.archaudio.org/forum/configurationtuning

Personal tools