[proaudio] Gentoo DAW HOWTO translation - 0.1

[ Thread Index | Date Index | More lists.tuxfamily.org/proaudio Archives ]


Hello :)
This is the first part of the translation from my Italian HOWTO. I hope
to finish it before tomorrow (it'll be difficult, anyway).

I prefer to post it here before than in the forum, so if anybody wants
to make some corrections (my English could be full of mistakes :D), they
can be made here.
And I also prefer to post this part even if not completed, so you don't
have to write redundant documentation from scratch (if anybody wants to
start)
A pair of observations:
- The part suggested by evermind about pam modificatios instead of
realtime-lsm is missing
- Should we write about using rt-sources?
- What about the final part? Should I choose various subjects
(sequencing, audio editing, live performances, Virtual
Instruments/Effects scelection, mastering, etc) and put a little guide
to the most important applications?
Or I better focus on a particular setup and just say there are some
alternatives?

Any feedback is welcome (and I would be glad if you'll take this as a
starting point for the new wiki).

Paolo



------------------------

If anybody is interested on this subject, please give me some feedback,
so that I know what is more interesting to be published (focusing on
installation processes, the various kind of programs, tips about EQing,
plugins, mastering, etc).
Please, don't write about application bugs on this thread. Open a new
one or write directly to Gentoo bugzilla.

LAST UPDATE: 2006, 15th MAY

[i]Note:[/i] Because my
[url=http://forums.gentoo.org/viewtopic-t-228122.html]old Italian
HOWTO[/url] was taken and copied around the web (and it's been quite
frustrating), I courtesly ask to who will find it useful and will decide
to re-use it for future articles, wikipedias or other HOWTOs at least to
mention me on the credits (a link to this forum thread would be
appreciated), not forgetting the credits I mentioned below. Thank you


#####################


[b]Introduction[/b]

This HOWTO would be a (little?) overview about how it could be possible
to use Linux (I'll focus on Gentoo Linux) as an 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 Ialso want to warn you that most of the software I'll
talk about are still in beta (or even alpha) versions... 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:
[list]- 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)[/list]


[b]PREREQUISITES: [/b]
- 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 easy 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 [code]nano
/etc/portage/package.keywords[/code] to add the application you want to
install.
I know that 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)


[b]INSTALLATION OF
[url=http://forums.gentoo.org/viewtopic-t-427211.html]EVERMIND's
OVERLAY[/url][/b]
What is this?
It's a portage Overlay with tweaked and more updated versions of most
Linux Audio-related programs. Here you'll find almost everything you
need for at least a simple home-recording (or, off course,
studio-recording, if you will go deeper with the subject)

Even if I'll try to write step-by-step instructions
, I suggest you to check these links about
([url=http://svnweb.tuxfamily.org/filedetails.php?repname=proaudio+%28ckpp%29&path=%2F00-README&rev=0&sc=0]overlay
installation[/url],
[url=http://svnweb.tuxfamily.org/filedetails.php?repname=proaudio+%28ckpp%29&path=%2F00-OVERLAY-INFO&rev=0&sc=0]base
packages installation[/url] and
[url=http://svnweb.tuxfamily.org/filedetails.php?repname=proaudio+%28ckpp%29&path=%2F00-PACKAGES-LIST&rev=0&sc=0]packages
list[/url])

- Let's start by installing subversion:
[code]emerge subversion[/code]
- Then let's checkout the overlay
[code]mkdir /usr/local/portage-proaudio
cd /usr/local/portage-proaudio
svn co svn://svn.tuxfamily.org/svnroot/ckpp/proaudio[/code]
Note that I created the /usr/local/portage-proaudio dir. Obviously, you
can choose any name/destination you like.
- Now let's add the overlay in /etc/make.conf
[code]PORTDIR_OVERLAY=""
PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage"
PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage-proaudio"[/code]
If what I wrote above semms voodoo-magic, take a look
[URL=http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds]here[/url],
so you'll be able to manage your overlays, if you already have more than
one.
- To update the overlay, you just have to do:
[code]cd /usr/local/portage-proaudio
svn up[/code]

Note: Sometimes it may happen you obtain error messages like "digest
verification failed". That happens when someone forgets to re-digest
ebuilds when they submit them. To solve that (supposing your package
name is foo), a
[code]cd /directory/of/the/ebuild/foo
ebuild foo.ebuild digest[/code]
should be enough to solve the problem.


[b]Sound Server (jack) configuration[/b]

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.

[b]- Instrucions for [size=18]2.4 Kernels[/size] (OBSOLETE) [/b]
Before compiling it, we need to make the following modifications:
[code]Processor type and features --->
[*] Preemptible Kernel
Device Drivers --->
Character devices --->
<*> Enhanced Real Time Clock Support
Sound --->
Advanced Linux Sound Architecture --->
<*> RTC Timer support[/code]
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 modofy is:
[code]/usr/src/linux/include/linux/capability.h[/code]
Let's look for the following 2 lines:
[code]#define CAP_INIT_EFF_SET to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP))
#define CAP_INIT_INH_SET to_cap_t(0)[/code]
Now, change them to:
[code]#define CAP_INIT_EFF_SET to_cap_t(~0)
#define CAP_INIT_INH_SET to_cap_t(~0)[/code]

If you don't like to edit files by hand, you can try this patch:
[url]http://nospoof.de/linux/patches/posix-draft-capabilities.patch[/url]
(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?


[b]- Instructions for [size=18]2.6 Kernels[/size][/b]
[color=red](WARNING: THIS PART OF THE GUIDE MUST BE UPDATED, because
realtime-lsm is discouraged. The recomended method is to use
sys-libs/pam with rt-limits activated. It can be found on the overlay.
If anybody could give me some documentation, I'll be able to integrate
it here immediatly, or you'll have to wait I'll learn to use/test it
before putting it on this HOWTO)[/color][/b]

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
[url=http://demudi.agnula.org/wiki/Low-latencyKernelBuildingHowto#Configuringthekernel]this
link[/url])


Low-latency specific configuration

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

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

and:

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

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

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

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

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


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

[code] 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[/code]

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:

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

If you don't find that voice, make sure in your
[code]/usr/src/linux/.config[/code] there are the following lines (as
written in realtime-lsm documentation):
[code] CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_SECURITY=y
CONFIG_SECURITY_CAPABILITIES=m
CONFIG_SECURITY_SELINUX=y [/code]
[b]It's VERY IMPORTANT that CONFIG_SECURITY_CAPABILITIES is compiled as
a module, or the patch WILL NOT WORK[/b]

Now let's compile the kernel as always, with a:
[code]make && make modules[/code]
copy the new bzImage in /boot, reinstall the bootloader, etc etc, then
let's install the patch [b](we need to redo that each time we recompile
the kernel)[/b]
[code]emerge realtime-lsm[/code]
Let's complete the module installation with:
[code]make modules_install[/code]

To have the patch working from boot time, I added this line to
/etc/modules.autoload.d/kernel-2.6
[code]realtime gid=18[/code]
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
[url=http://jackit.sourceforge.net/docs/faq.php]jack FAQ[/url]


NOTES:
A) I read that kernel preemption support decreases realtime performances
for Sound Server (Jack). But, because we're musicians, we also have to
use lots of applications in multi-tasking and it would be frustrating to
wait 3 secs to switch from sequencer to multi-track editor... So I think
it's an important feature. Don't you think?
B) I also 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.


[b]Important note about ALSA[/b]
DON'T use alsa-modules included on your kernel sources. Just follow the
official Gentoo guide (that suggests to use the alsa-driver package).
You'll find it here:
[url=http://www.gentoo.org/doc/it/alsa-guide.xml]qui[/url].
Why?
If you have a professional audio-card, maybe you'll need the package
[code]alsa-firmware[/code], 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)


[b]- Installation of jack[/b] (note we're using the overlay version, not
the portage one)
Once installed the new kernel, rebooted, etc etc, we're ready to install
Jack; remember we'll need the following USEFLAGS (add them to make.conf
manually or with ufed or remember to specify them before every emerge)
[code]USE=”+caps,+jack,+jack-tmpfs”[/code]
now let's install jack and its dependencies:
[code]emerge sys-libs/libcap
emerge alsa-lib
emerge alsa-jack
emerge jack-audio-connection-kit [/code]
I repeat once again it's better to use the latest unstable (~arch)
version... But who have to decide is you.


If you find too many xruns when working with audio-programs, you could
add to try these lines to your /etc/fstab
[code]#questa riga dovrebbe già esser presente
shmfs /dev/shm shm defaults 0 0
none /tmp/jack tmpfs defaults 0 0 [/code]
Then, after creating the /mnt/ramfs dir:
[code]mkdir /mnt/ramfs [/code]
add this line too
[code]
none /mnt/ramfs tmpfs defaults 0 0 [/code]
(you can understand why that gives better cjak performances by reading
the FAQ on Jack's homepage:
[url]http://jackit.sourceforge.net/docs/faq.php[/url] )

Now let's test if jack works:
[code]jackstart -v -R -d alsa -H -M -m[/code]
[color=red]IMPORTANT: DON'T SCROLL THE WINDOW! IT COULD CRASH YOUR
SYSTEM!! If something goes wrong, simply press ctrl+C, OK?[/color]

[b]Note for 2.6.x Kernels:[/b] use jackd instead of jackstart or it'll
give you an error message (it'll say you need capabilities anabled...
but if you folowed the guide, now you're using a perfectly configured
2.6 kernel! :D)

Now, if you want, you can use jack from commandline (for example to
launch it on boot time), so read carefully
[code]man jackd[/code]
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:
[code]emerge qjackctl[/code]
This is a frontend to control Jack and its connections between programs.
But we'll see that in the following part of the guide.

The only thing I can tell you, for now, is that it must be executed
BEFORE other audio apps (or they won't work.)



[b]INSTALLATION OF THE MOST IMPORTANT PACKAGES FROM THE OVERLAY:[/b]

[b]VST SUPPORT[/b]
[i]Cos'è un plugin VST?[/i] Detto in parole povere, si tratta di un
formato di plugin utilizzato dalla quasi totalità dei sequencer per
Win/Mac che permette di utilizzare effetti in real time, sintetizzatori
virtuali e tante altre cosette. Per una spiegazione più dettagliata,
guarda [url=http://en.wikipedia.org/wiki/Virtual_Studio_Technology]qui[/url]
[i]Ma questa roba mi serve? Io aborro Windows![/i] Si. Ti serve. Dai
un'occhiata al sito [url]http://kvraudio.com[/url] per renderti conto
della tonnellata di plugin/virtual instruments (anche gratuiti) che puoi
trovare, molti dei quali fatti pure molto bene.
[i]Come è possibile usare una cosa del genere? Non ci sto capendo più
niente[/i]
Esisono almeno 2 sistemi per utilizzare agevolmente plugin VST sotto linux:
-dssi-vst: si tratta di un plugin per dssi (il programma che state
usando deve supportare dssi!) che permette di hostare plugin VST. Per
fare ciò utilizza Wine, gli header di dssi, e gli header dello Steinberg
VST SDK (il protocollo VST è infatti stato inventato dalla Steinberg)
-fst: si tratta di un server che, sempre utilizzando Wine, Jack e lo
Steinberg VST SDK, permette di utilizzare plugin VST sotto Linux
-[url=http://www.notam02.no/arkiv/src/]Vst server[/url]. Non ho mai
capito come funziona. Se qualcuno ce la fa, mi faccia un fischio. Penso
sia stato il primo metodo per usare VST e VSTi sotto Linux, comunque
[i]Va bene, mi hai convinto. Cosa devo fare?[/i]Per prima cosa vai su
[url]http://www.steinberg.net/532+M52087573ab0.html[/url], leggiti bene
il contratto e scarica la versione 2.3 (già che ci sei, anche eventuali
versioni successive, a seconda delle richieste nell'overlay) dell'SDK.
Se il link non dovesse più funzionare, cerca su Google dove trovare il
file vstsdk2.3.zip, a sua volta contenuto nel file vst_sdk2_3.zip (o
quello che richiede l'overlay). [b]NON SI TRATTA DI UN FILE
REDISTRIBUIBILE LIBERAMENTE[/b], quindi siete tenuti a leggere e
rispettare le clausole presenti nell'Agreement. Se la cosa non vi piace,
semplicemente non utilizzatelo. In tal caso niente supporto VST.

Una volta trovato il file vstsdk2.3.zip (auguri), copiatelo in
[code]/usr/portage/distfiles[/code]
In seguito, aggiungete le (nuove) useflags [code]dssi vst
jackmidi[/code], al file [code]/etc/make.conf[/code]
Dovrebbe essere sufficiente per permettervi di avere tale supporto in
Ardour, Rosegarden ed altre importanti applicazioni.

NOTA: museseq potrebbe non compilare correttamente con fst-1.7, quindi,
in caso di problemi, provate a compilarlo con [code]USE=-vst emerge
museseq[/code]


[b]Lash e Ladcca[/b]
Tutte le applicazioni audio ormai utilizzano
[URL=http://www.nongnu.org/lash]Lash[/url], che è il successore di
[url=http://pkl.net/~node/ladcca.html]Ladcca[/url]. Rimandandovi ai
rispettivi siti se volete ulteriori info, vi consiglio di rimuovere
ladcca ed eventualmente ri-emergere i pacchetti vkeybd, jack-rack e
museseq affinchè utilizzino le librerie di lash.

[b]Installazione di Rosegarden (sequencer)[/b]
E qui possiamo già iniziare a fare qualcosina... Rosegarden, come non
tutti voi sanno, è un sequencer, basato su Kdelibs+QT ed integrabile in
KDE (spiacente per tutti quelli che odiano tale DE :-P).
Inizialmente era stato scritto per gestire solo file MIDI, ma, col
tempo, anche il supporto audio sta migliorando notevolmente (OK, non
siamo ancora a livello di Cubase o Sonar... Ma... diciamo che promette
molto bene).

Dunque, per farla breve... vi basta un
[code]USE=”+jack +dssi” emerge rosegarden[/code]
possibilmente usando la versione ~arch per avere l'ultima relase. È una
cosa che vi consiglio, poichè le nuove versioni stanno continuando ad
introdurre molte migliorie dal punto di vista dell'audio.
Perchè ho aggiunto la useflag DSSI?
DSSI è una API diciamo "provvisoria" per strumenti virtuali dotati di
una GUI. Senza dilungarmi in spiegazioni, posso solo dirvi che ci sono
alcuni virtual synth carini che la utilizzano e che esiste un plugin ad
esso appoggiato per utilizzare i VSTi sotto rosegarden (o altri host che
supportino DSSI). Guardate [url]http://dssi.sourceforge.net/[/url] per
ulteirori informazioni.

Ricordate infine che, se volete il supporto all'audio, è necessario
avviare jack prima di Rosegarden. Come prima, vi consiglio di usare
qjackctl.


[b]Strumenti Virtuali interessanti[/b]
zynaddsubfx: Sintetizzatore sottrattivo real-time virtual-analog
fluidsynth: Sintetizzatore MIDI basato su soundfont. Può essere
utilizzato sia tramite qsynth (GUI in QT, molto carina) che tramite la
sua versione DSSI
hexter: plugin DSSI che riproduce un sintetizzatore FM. Può caricare le
patch del DX7 di Yamaha.
hydrogen: drum machine molto carina, udite udite... Made in Italy!
ams: Alsa Modular Synth (devo ancora provarlo)
amsynth: altro synth virtuale, che sembra suonare molto bene (i filtri
mi sono sembrati un po' freddini, ma devo provarlo per bene)
Csound: Come dice la descrizione sul sito: "Csound is a sound and music
synthesis system, providing facilities for composition and performance
over a wide range of platforms". In realtà devo ancora provare pure
questo :D



[b]Installazione di Ardour (editor multitraccia)[/b]
Se volete il supporto VST, vi basta un:
[code]USE=vst emerge ardour-cvs[/code]
Volendo, potete sostituire ardour a ardour-cvs, in caso di problemi (io
preferisco la versione cvs)


[b]Installazione di Rezound (editor audio)[/b]
Assieme ad un sequencer, fa molto comodo avere un editor audio... Ad
esempio per tagliare sample, effettarli, rimuovere rumore, buttare
velocemente su CD una demo, salvarla in mp3, oggvorbis e tante, tante e
ancora tante altre cose.
In molti so che usano Audacity come editor audio sotto Linux... Io,
invece, preferisco utilizzare e proporvi ReZound.
Aldilà del fatto che trovo la sua interfaccia molto più comoda e
intuitiva di quella di Audacity, ReZound ha il grandissimo pregio che
può utilizzare jack come output.
Installiamolo immediatamente con un
[code]USE=”+jack” emerge rezound[/code]
Eventualmente aggiungendo altre useflags che pensiamo ci possano servire
(emerge -pv rezound per avere la lista completa).
Ribadisco il consiglio di mettere sia rezound, sia le sue dipendenze, in
/etc/portage/package.keywords in modo da usare sempre l'ultima versione.


[b]Installazione di Jamin[/b]
Si tratta di una "semplice" suite per il mastering, composta da
compressore multibanda ed equalizzatore a 30 bande. Come tutte le suite
per il mastering, necessita di una buona dimestichezza con la materia.
Si installa con un semplice [code]emerge jamin-cvs[/code] (o jamin, se
non volete la versione cvs)
Ricordate che il mastering è la fase finale della produzione audio,
quindi, quando fate il routing del segnale audio con qjackd, inserite
jamin subito prima dell'uscita che vi interessa.
Altra cosa importante, che mi suggeriscono dalla regia: il mastering è
una cosa molto seria, che può sia valorizzare le vostre produzioni, sia
comprometterle definitivamente. Per farlo è necessario avere sale ed
impianti di amplificazione fatti in un certo modo (leggi: fatti molto
bene ed appositamente per il mastering, cioè dalle caratteristiche il
più possibile neutre). Se non ne siete dotati.. Meglio se affidate il
vostro preziosissimo singolo appena sfornato ad uno studio apposito ;)


TODO:
- Adding at least a part of ,
[url=http://demudi.agnula.org/wiki/Low-latencyKernelBuildingHowto]
this[/url],ande [url=http://ck.kolivas.org/faqs/audio_hints] this guide
[/url], tweaking them to work with Gentoo and the overlay (adding an
rt-sources HOWTO?).
- tips on EQ, mixing, mastering, automation
- an introduction to the main effects used during HD recording
(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)


CREDITS:
Jack-audio-connection-kit HOWTO:
[url]http://forums.gentoo.org/viewtopic.php?t=88781&postdays=0&postorder=asc&start=0[/url]
Jack Homepage:[url]http://jackit.sourceforge.net/[/url]
Evermind's post about his overlay and related links
[url]http://forums.gentoo.org/viewtopic-t-427211.html[/url]



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/