DAW Digital Audio Workstation

From ProAudioOverlay

Revision as of 16:19, 1 June 2008 by (Talk)
Jump to: navigation, search



This Howto was originally written by Paolo aka SteelRage and posted on the Gentoo forums:

It gives an overview about how it's possible to use Linux (I'll focus on Gentoo Linux) as a Hard Disk Recording/Mastering Workstation. I hope, after finishing that, to be able to give some misc tips, for example about how to use your Gentoo box as part of your multi-effects rack for live performances and stuff like that (any suggestions are VERY appreciated!)

I know very well there's A LOT of work to be done to reach the quality of the ultra-expensive Mac or Win professional softwares (and their quality continues to increase...), but you'll see that our penguin is already able to let us produce decent audio productions (demos, simple soundscores, etc)

Before starting I also want to warn you that most of the software I'll talk about is still in beta (or even alpha) state. So keep in mind they could crash or even lead your whole system to a crash.

Our Workstation will be made at least by the following elements:

  • Low Latency Sound Server (Jack)
  • SEQUENCER (Rosegarden) + DRUM MACHINE (Hydrogen)
  • MULTI-TRACK Editor/Recorder (Ardour)
  • DSP MultiEffects (LADSPA plugins and VSTi/VST Plugins under Rosegarden and Ardour)
  • AUDIO EDITOR (Rezound)
  • MASTERING Software (Jamin)


  • I'll suppose your workstation has a working audio card, with working ALSA drivers.

This HOWTO has been written for Gentoo-Linux with 2.6 kernel, but could be easily adapted to other distros with different kernels (I'll discuss, for example, how to configure a 2.4 kernel, that were better than early 2.6 kernels regarding latency)

  • I HIGLY reccomend you to use the unstable (~arch) versions of all the programs I'll discuss here.

So be always ready to run a

nano /etc/portage/package.keywords

to add the application you want to install.

I know that this won't ensure you a 100% reliability, but the new features (an example was the introduction in some programs of DSSI, VST support, etc) introduced by the latest versions are often too much important if you want to be productive.

Another good reason to do that is that, if you find something wrong, you can make a good bug report that will help the whole community (the number of musicians doesn't seem to be too high, in fact)


      • We will not go into the dependency requirement of a particular application because portage install them when needed and we want to focus on practical matter, not to re-invent the wheel.***

In consequence, if you are on Gentoo, please read the ebuilds (non Gentoo users will find the overlay's ebuilds into the overlay SVN repository at the left). If you want to follow this HOWTO and are using another distribution as Gentoo, please follow the Install procedure of our distribution or from the source code when installing from the source.

Thank you for our comprehension!

Installation of Everminds proaudio overlay

What is this? See the Main Page
How to install? See the Usage Notes

Kernel configuration

Instructions for Kernel 2.4 (deprecated)

Before compiling it, we need to make the following modifications:

Processor type and features  --->
 [*] Preemptible Kernel
Device Drivers  --->
 Character devices  ---> 
 <*> Enhanced Real Time Clock Support     
 Sound  --->
  Advanced Linux Sound Architecture  ---> 
  <*> RTC Timer support

Because it's a good idea to use Jack (and all the applications that depend on it) as normal user, but we don't want to lose real time scheduling advantages, we need to activate "POSIX draft capabilities" (called, more commonly, caps). That's not difficult, we just need to modify a configuration file.

The file to modify is:


Let's look for the following 2 lines:

#define CAP_INIT_EFF_SET    to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP))
#define CAP_INIT_INH_SET    to_cap_t(0)

Now, change them to:

#define CAP_INIT_EFF_SET    to_cap_t(~0)
#define CAP_INIT_INH_SET    to_cap_t(~0)

If you don't like to edit files by hand, you can try this patch: http://nospoof.de/linux/patches/posix-draft-capabilities.patch (the link should be correct, but I've never tried it)

IMPORTANT: Every time we install/reinstall a new/different version of kernel sources, we need to remember to make this operation manually, or the new kernel won't be "caps-enabled", OK?

Instructions for 2.6 Kernels

The recommended method is to use sys-libs/pam with rt-limits activated.

install sys-libs/pam from the proaudio-overlay (only needed for <sys-libs/pam-0.99) to make sure realtime settings are possible with your installed version of sys-libs/pam try the following

strings /lib/security/pam_limits.so|egrep 'memlock|nice|rtprio'

if the result looks like this pam is will work


So next edit /etc/security/limits.conf and scroll down and add this settings (when using ebuild from the overlay this settings should already be there)

# REALTIME support for audio group users 
@audio          -       rtprio          100
@audio          -       nice            -10
@audio          -       memlock         250000 

After this relogin and the realtime stuff should work. If you don't like the "pam way" you can use instead the realtime modul described later in this section.

TODO: make next step clearer

If you already did the changes written above, then you better undo them :D If you don't want to do that, rimply re-emerge your favourite kernel-sources. (the command jackstart would work anyway, but I noticed performances were better with the following method)

In 2.6 kernels, in fact, there's a new way to allow users to perform real-time tasks; let's see how to enable it:

First let's compile the kernel we like with the following options (this is not the translation of the Italian guide I wrote, but it's taken from this link)

Low-latency specific configuration

For kernels starting with 2.6.25-rc1, you should check that the following options are *not* enabled, or you will not be able to run realtime processes using the RLIMITS method below:

General setup --->
        [ ] Group CPU scheduler
        [ ]    Group scheduling for SCHED_RR/FIFO # make sure this one is disabled

You should set these voices in the kernel configuration to achieve good low-latencies performances:

Processor type and features --->
        Preemption Model (Preemptible Kernel (Low-Latency Desktop))
    [*] Preempt The Big Kernel Lock                                 
        Timer frequency (1000 HZ)         


Block layer  --->
    IO Schedulers --->
        <*> Anticipatory I/O scheduler
        <*> Deadline I/O scheduler
        <*> CFQ I/O scheduler
        Default I/O scheduler (CFQ)

JACK needs support for the tmpfs pseudo file system to achieve good performances:

File systems  --->
    Pseudo filesystems  --->
        [*] Virtual memory file system support (former shm fs)

The RTC can be needed by some applications, is better to compile it:

Device Drivers  --->
    Character devices  --->
        <M> Enhanced Real Time Clock Support
        <M> Generic /dev/rtc emulation
        [*]   Extended RTC operation     

The IDE sub-system can be a bottleneck if not properly configured. As pointed out by Con Kolivas in his Audio Hints, you should set the following config option for your ATA drive (relevant on and off options are showed):

Device Drivers  --->
    ATA/ATAPI/MFM/RLL support  --->
        <*> ATA/ATAPI/MFM/RLL support
        <*>     Include IDE/ATA-2 DISK support
        [*]       Use multi-mode by default
        [ ]     IDE Taskfile Access
        < >     generic/default IDE chipset support
        [*]     PCI IDE chipset support
        [*]       Generic PCI bus-master DMA support
        [*]         Use PCI DMA by default when available
        <*>         Intel PIIXn chipsets support

The latest config option is just an example and, almost certainly, you have to change it to reflect your hardware (again lspci -v will tell you which chip-set you have).

Finally, if you want to use the realtime-lsm module to grant realtime privileges to normal user you should also set:

Security options --->
    [*] Enable different security models
    <M>   Default Linux Capabilities   

If you don't find that voice, make sure in your /usr/src/linux/.config there are the following lines (as written in realtime-lsm documentation):


It's VERY IMPORTANT that CONFIG_SECURITY_CAPABILITIES is compiled as a module, or the patch WILL NOT WORK

Now let's compile the kernel as always, with a:

make && make modules_install

copy the new bzImage in /boot, reinstall the bootloader if you use lilo, etc etc, then let's install the realtime-lsm module (we need to redo that each time we recompile the kernel, make sure to set the link /usr/src/linux correctly)

emerge realtime-lsm

To have the patch working from boot time, I added this line to autoload.d

echo "realtime" >> /etc/modules.autoload.d/kernel-2.6
echo "options realtime gid=18" >> /etc/modules.d/realtime

NOTE: The gid 18 is necessary, because it's the number given by default to audio group in Gentoo; you can experiment with any other group. An alternative approach would be to use the option any=1, but remember it could give some security problems, because you would allow every user to launch programs with realtime priority (and, if something goes wrong, it could crash the whole system :-D)

There are some other interesting options you can try, but I wont discuss them here. Simply take a look in /usr/portage/distfiles/realtime-lsm-number-version, or read jack FAQ


  • I read that aggressive settings for hdparm could increase latency too (somebody said at least 59 ms!! TOOO MUCH FOR A MUSICIAN!). Honestly, I use hdparm only to have DMA mode on My various Hard Disks, so I don't have problems.

So, if you find your latency too high, keep in mind this suggestion.

  • 'Important note about ALSA'

DON'T use alsa-modules included on your kernel sources. Just follow the official Gentoo guide (that suggests to use the alsa-driver package). Why? If you have a professional audio-card, maybe you'll need the package Code: alsa-firmware, whose version must be the same of the installed alsa-driver or you may have problems. Alsa modules included on your kernel sources may be older than current alsa-driver (and alsa-firmware)

Jack configuration

Jack is an audio-server made to work with low-latency. Unlike other famous sound-servers (Arts, ESD, Gstreamer, etc), it has some features (and we'll discover some of them, such low latency, flexible audio routing between applications, AUDIO/MIDI syncronization during this HOWTO) that make it a core compoent of a Linux DAW.

Installation of Jack

Once installed the new kernel, rebooted, etc etc, we're ready to install Jack. We'll need the following use flags

  • In /etc/make.conf you should have at least the following:
USE="alsa jack mmx sse"

As you will need it a lot. Note: mmx and sse are CPU optimizations which should have been set when you installed Gentoo. Your processor may also support mmx2 and sse2. To see what your processor supports, see

grep -i Flags /proc/cpuinfo

Then for jack do

echo "media-sound/jack-audio-connection-kit jack-tmpfs jackmidi" >> /etc/portage/package.use
  • Now let's install jack and its dependencies:
emerge --oneshot alsa-lib alsa-jack jack-audio-connection-kit

I repeat once again it's better to use the latest ~arch version... but it's up to you.

  • If you find too many xruns when working with audio-programs, you could add to try these lines to your /etc/fstab
shmfs       /dev/shm     shm    defaults        0       0
none        /tmp/jack    tmpfs  defaults        0       0

Then, after creating the /mnt/ramfs dir:

mkdir /mnt/ramfs

add this line too

none        /mnt/ramfs   tmpfs  defaults        0        0

For details refer to the Jack FAQ at http://jackit.sourceforge.net/docs/faq.php (very outdated).

  • Now let's test if jack works:
jackd -R -dalsa &

If you want, you can use jack from commandline (for example to launch it on boot time), so read carefully

man jackd

that can avoid you some future headcaches.

But, believe me... it's not too much comfortable! That's the reason why I suggest you to use qjackctl:

emerge -av qjackctl

This is a frontend to control Jack and its connections between programs. But we'll see that in the following part of the guide.

NOTE: Be sure to execute Jack BEFORE other audio apps (or they won't work.)

Under Settings in qjackctl, set Priority to 65 to avoid letting jackd run with a lower priority than your graphics card, serial port and other hardware that might interrupt the sound.

jack and alsa/oss applications

Alsa and oss applications can work with jack. The following will work with sound cards with hardware mixing capability (as exemple soundblaster live and audigy).

Alsa and jack

Edit ~/.asoundrc or /etc/asound.conf and add the following

# convert alsa API over jack API
# use it with 
# % aplay foo.wav
# use this as default
pcm.!default {
    type plug
    slave { pcm "jack" }
# pcm type jack
pcm.jack {
    type jack
    playback_ports {
        0 alsa_pcm:playback_1
        1 alsa_pcm:playback_2
    capture_ports {
        0 alsa_pcm:capture_1
        1 alsa_pcm:capture_2

This will work with most alsa applications. Some applications will not work, as exemple beast with the alsa plugin. When starting an alsa application as usual, if jackd is started, the application will use by default the jack plugin and appear in the connection panel of qjackctl. Otherwise, it will generate an error message and start using alsa.

OSS and jack

Edit ~/.asoundrc and add the text in the preceding text box (alsa and jack) as well as the following:

# oss will use the alsa to jack API by default
# test it with
# % aoss mpg123 some.mp3
pcm.dsp pcm.!default

It will work the same as the alsa to jack converter. Some applications will not work, as exemple beast.


mplayer will crash with this setting when jackd is started. To avoid it, start mplayer with native jack driver:

# mplayer -ao jack movie.avi


  • Knowing JACK: Very informative reading on JACK and its configuration.

Installation of needed packages

Now it's time to install the most important packages from the overlay

VST Support

What is a VST plugin? Without getting technical, VST is a plugin format used by most Win/Mac audio-related applications. You can use it within other audio programs (called hosts) for real time effects, virtual synths and other things. If you are interested and want a more detailed explanation, take a look here. Do I really need that stuff? I hate Wincows, Micro$oft and Macintrash! Yes. You need it. Just take a look at http://kvraudio.com to see how many tons of free plugins (some are really really good!) you can have access to. How could it be? Sounds like magic; I suppose I didn't understand anything There are at least 2 systems to use VST plugins under Linux:

  • dssi-vst: it's a dssi plugin (so the host you're going to use must supporte DSSI!) that can make use of VST plugins. To do that, it uses Wine, DSSI headers and Steinberg VST SDK headers (VST protocol, in fact, was created by Steinberg)
  • fst: it's a server that, with the combination of Wine, Jack and Steinberg VST SDK, allows you to use VST plugins under Linux
  • Vst server. This should be the first program who gave VST support to Linux. I did never understand how to use it, so if you know how to, please write me a note, so I can add it to this documentation.

OK, it sounds cool. What do I have to do? First go here http://www.steinberg.net/532+M52087573ab0.html, read the agreement and download the 2.3 version of the SDK (or a following one, depending on what the overlay will require by the time you read this). If the link doesn't work anymore, go to Google to find the vstsdk2.3.zip file (it's part of the vst_sdk2_3.zip archive). Remember that YOU CANNOT REDISTRIBUTE IT, SO READ CAREFULLY THE AGREEMENT I told you above. If you don't like it, simply don't use it (and you won't have VST support).

Once you found vstsdk2.3.zip (good luck), copy it in /usr/portage/distfiles

Now add to your /etc/make.conf the following (new) useflags:

(I know you just need the vst USEFLAG, but I prefer to set them all at this stage). This should be enough to let you have that support in Ardour, rosegarden and other important applications.

NOTE: museseq may not compile with >=fst-1.7, so, if it gives you problems, try to install it with a Code: USE=-vst emerge museseq

Lash or Ladcca

Almost all the newest audio applications now use Lash, instead of Ladcca. After recommending you to take a look at their web sites, I also suggest to remove ladcca (emerge -C ladcca) and re-emerging your (~arch) version of vkeybd, jack-rack and museseq so they'll use Lash libraries.

You need to add 2 lines at the end of /etc/services:

lash            14541/tcp                       # Lash client/server protocol
lash            14541/udp

Rosegarden (sequencer) installation

With this one we can start to be a bit productive... Rosegarden is an audio and MIDI sequencer, based on KDElibs+QT (sorry for the users who hate this DE :-P). In the beginning it was written only to manage/edit MIDI files, but now audio support has been integrated (OK... it cannot be compared to Cubase or Sonar... But... It's growing quite well). It also have a good score editor, that allows you to export files to Lilypond and nice editing features.

So, if you want to start using it, you just need to do an Code: USE=”+jack +dssi” emerge rosegarden (remember I suggest you to use the latest ~arch version). On the overlay you'll also find rosegarden-9999 (svn-snapshot) ebuild. Take a look at it too, because audio support is getting better and better in newest relases
To enable snapshot ebuilds *-9999 read our FAQ about svn/cvs/whatever-ebuilds
Why did I add DSSI useflag? DSSI is a "temporary" API for wirtual instruments with a GUI. Without going deep in details, I'll just tell you there are some nice virtual synths using it and that there's an extra-plugin that lets you use VSTi and VST plugins under rosegarden (or other DSSI-compatible hosts), but if you read this guide carefully, you already know that. Take a look at http://dssi.sourceforge.net/ for further informations.

Remember that, if you want audio support, you have to run jackd BEFORE Rosegarden. It would be a good idea to run it through qjackctl.

Ardour Installation (multi-track audio editor)

If you need VST support, you just have to do a

 USE=vst emerge ardour

If that gives you problems, try to emerge ardour-9999 (cvs) instead (I prefer the cvs version). You can also try to emerge ardour2 if you want a bunch of new features but less stabilty.
To enable snapshot ebuilds *-9999 read our FAQ about svn/cvs/whatever-ebuilds

Interesting Virtual synths

Real time Virtual Analog synth
MIDI virtual Synth based on SoundFont. You can use it either via qsynth (a nice QT GUI) or via his DSSI version, called fluidsynth-dssi
A Yamaha DX7 reprodution via DSSI. It can also import your old Yamaha DX5 and DX7 patches. Take a look if you need a nice FM synth
A very good drum machine
Alsa Modular Synth (still have to try it)
another virtual synth that seems to sound very nice (I found filters to be a bit "cold", but I still have to experiment well with it)
As the homepage says: "Csound is a sound and music synthesis system, providing facilities for composition and performance over a wide range of platforms". Ehm... Still have to try it too :D
a synthesised pipe-organ instrument written by Fons Adriaensen. The default sounds have been skillfully programmed and are very realistic; this means that Aeolus can be very satisfying to play, or to listen with your favourite MIDI files. Aeolus Quickstart Guide
an excellent project written by Nicky Copeland. The project emulates twenty of the classic instruments from the 60's, 70's and 80's. The sounds are distinctive to the Bristol project and are not intended to be totally authentic, however they do sound great. Bristol home page Note that JACK support by Bristol is considered experimental.

Rezound (audio editor) installation

If you need to cut&paste samples, resample, apply offline effects, remove noise, to put quickly your latest demo on a CD, converting it to mp3, ogg and other things, a sequencer couldn't be enough... You need an audio editor! Lots of people use Audacity, because it's muti-platform, it's well known, etc etc. Well, I really hate it. That's why I suggest to try rezound. First because I find its GUI is more intuitive, second because it can use jack as an output.

To install it, a Code: USE=”+jack” emerge rezound should be enough. Feel free to add other USEFLAGS you may need (emerge -pv rezound to have a complete list). Once again, I recommend to put rezound and its deps to /etc/portage/package.keywords so you can use the latest version.

Jamin installation

Jamin is a "simple" mastering suite, made by a multi-band compressor and a 30-bands EQ. As all the other mastering suites, it requires you know very well what you're doing. You can install it with a simple

 emerge jamin

(or jamin-9999, if you want the cvs version). Remember that mastering is the final stage of the audio-production process, so, when you route the signal via qjackctl, insert jamin right before the output you want to send audio to. (Jamin is used as an audio effect, so it must be used in real time with jack! you cannot import, for example, wave files on it to modofy them!)

Mastering is a very important aspect of music production, because it decides how your music will sound when played all around the world (from the ultra-expensive stereo to the cheapest walkman or mp3 player). That's why you need a studio and amplification system made just for mastering. If you don't have it... Well... You better give your precious single to a studio specialized in mastering ;)


PulseAudio is a networked sound server, similar in theory to the Enlightened Sound Daemon (EsounD). PulseAudio is however much more advanced and has numerous features.

PulseAudio comes with many plugin modules. Among them, 2 jack modules that make possible to interface PulseAudio with jack. It is also possible to interface alsa and Pulse Audio with an ALSA pulse plugin in ~/.asoundrc. The result will be that any alsa application will use jack trough this Pulse plugin.

To install it, just run

 emerge pulseaudio

Other programs that you may want to install at the same time are:

  • PulseAudio Volume Control
  • PulseAudio Volume Meter
  • PulseAudio Manager
  • PulseAudio Device Chooser
  • PulseAudio Preferences

Those programs are GUI using gtk+.

To install all of them:

 emerge pavucontrol pavumeter paman padevchooser paprefs

In order to install paman, you must install PulseAudio with USE="avahi". I added it in make.conf because it was a blocking and it is a global USE flag. A full update as explained in the handbook will not arm in such a case.

To take a look at some configuration and usage examples, read the PulseAudio wiki article.


Jack and sound level

Jack uses a floating point sample format, which allows values above 0 dBFS. When such a value is passed to a DAC, it will be clipped and cause distortion or worse. (A DAC in a sound card use fixed point values.)

Within JACK, 0 dBFS corresponds to a sample value of +/-1.0, and will emerge from the other side of your DAC with the maximum voltage level that the DAC can emit. Values above 0 dBFS are legal within JACK, but should probably never be routed to a physical output port.

Jack transport

From Robin Gareus on linux-audio-dev email list:

"Rolling" (like "Starting" and "Stopped") is a state of the jack-transport (SMPTE timecode) mechanism. (see the diagram on this page).

This has nothing to do with JACK audio-process callbacks which is/are always running. Every JACK application can *optionally* synchronize it's play position to jack-transport. Many jack aware application does not support this feature or have they own "motor" to do that (as example audacity).

Quoting Paul Davis on linux-audio-dev email list:

"Most JACK clients pay no attention to JACK transport status. Only those that wish to participate in a fully synchronized start/stop/move-to system do so, and there are few of them. Clients are free to completely ignore transport status without any side effects.

"rolling" means that transport-aware clients should think of themselves as moving along a linear timeline. JACK transport info tells them where they are."

Recommended books for new audio developers

What if you want to hack some linux sound software? Here are some books recommended by developers on linux-audio-dev mailing list:

  • Computer Music Tutorial by Curtis Roads (1995, 1254 pages) A misnamed classic. It's no tutorial, but it is crammed with information. It provides a background, a context, a way of thinking about the goals. Its certainly not useful directly for developers, but everyone writing audio software should know most (or at least a good chunk) of what is in there.
  • Computer Music: Synthesis, Composition, and Performance by Charles Dodge and Thomas Jerse (1997, 480 pages). Recommend to newbies to computer-assisted sound design and music-making.
  • Read the docs/source for things like ALSA, Jack, LADSPA/LV2, DSSI & LASH.
  • musicdsp.org has tons of examples for concrete tasks like oscillators and filters, often in a portable way, read pure c or c++ so it helps you on every OS.
  • The Science of Musical Sound by John Pierce. It only has a bit of material about computer music, and that is pretty light and pretty dated, but otherwise it's GREAT background for thinking about how sound works.
  • "Recording Studio Design" by Philip Newell.
  • Elements of Computer Music by F. Richard Moore. This book is for anyone interested in using computers to extend the boundaries of music.
  • Musical Signal Processing, 1997 Swets & Zeitlinger Publishers
  • Electronic and computer music by Manning Peter (2004)
  • Digital Audio Signal Processing by Udo Zolzer
  • DAFX - Digital Audio Effects by direction Udo Zolzer


(flangers, reverbs, panning) and how/when to use them (help appreciated)

  • To insert other programs, after testing them: Wired (DAW with

nativeakai support), Seq24 (light sequencer for live performances), Bristol (moog emulator, etc)


Personal tools