[Lancaster] Linux sound recording/editing demo.‏

andy baxter andy at earthsong.free-online.co.uk
Thu Sep 18 20:57:18 UTC 2008


andy baxter wrote:
>
> Will type up a proper report of the demo some time later, but not sure 
> where to put it online - would be good if we had our own wiki; otherwise 
> I could put it on my own website.
>   

I have now typed up my notes from the demo, which are attached here and 
also pasted below.

andy

== Notes from first linux audio applications workshop ==

The aim of this workshop was to have a look at a few of the audio 
editing programs available for linux, to give people an idea of what 
they can do, how to set them up, and how to use them.

=== Introduction ===

This write-up is just meant for people to refer back and jog their 
memory of what was covered in the demo. A good place to start looking 
for further information is here:
http://linuxaudio.org/about
Particularly this page:
http://lau.linuxaudio.org/

I did the demo using a distro called 64 Studio, which is a customised 
version of debian intended for multimedia applications - audio, video 
and graphics. It is very closely based on debian, to the point that you 
can run the 64studio repositories side by side with the latest version 
of debian stable. This seems to be a pretty good way of doing things, 
and gives you the rock solid stability and reliability of a debian core, 
together with a bit of extra effort made on their part keeping the audio 
applications up to date and bug free. Being compatible with debian 
repositories means that if you want to use the distro for other 
purposes, you still have access to the whole debian repository.

Unlike windows, which tends to have a few large audio programs like 
cubase or reason which then take many plugins, often only compatible 
with that program, linux uses a more open architecture which relies on a 
few low level 'glue' layers (daemons, kernel drivers, and open apis) to 
allow you to use several different programs together while working on a 
project. This can be confusing at first but makes for a more flexible 
and powerful system in the end.

The topics covered during the workshop were:
 - a quick look at audacity ( http://audacity.sourceforge.net/ ), a 
simple cross platform multitrack recorder / editor.
 - a more detailed look at rezound ( 
http://rezound.sourceforge.net/index.shtml ), which is a nice single 
track recorder / editor with a well designed interface and some useful 
features.
 - setting up jackd ( http://jackaudio.org/ ) using the qjackctl control 
panel. Jackd is an audio routing daemon, used to move audio streams both 
between programs and to the sound card.
 - then a fair amount of time was spent developing a simple two track 
project in ardour ( http://www.ardour.org/ ), which is a really nice 
professional quality hard disk recorder / editor / mixer.

I was hoping to cover a bit more ground, also taking a look at midi, 
soft synths, and the hydrogen drum machine, but we would have been 
leaving at 2 in the morning by the time I had covered them properly, so 
I decided it was better to cover a few programs in detail than rush 
through things too much.

=== Audacity ===

We had a quick look at audacity, which is a simple multitrack recorder / 
editor. It is reasonably simple to use, and has the advantage of being 
cross platform, so is many peoples' first experience of open source 
audio editing. I decided not to cover this in detail, because for single 
track work it's not as nice to use as rezound, and then if you want to 
do multitrack projects (where you record several tracks and then mix 
them together), it's much less powerful than ardour. So it seemed better 
to show people rezound for doing simple single track work (e.g. 
recording an album from vinyl and editing it into tracks), then move on 
to ardour.

=== Rezound ===

Rezound is a single track recorder / editor. It is less powerful in some 
ways than audacity, but has a nicer interface and some useful features 
which audacity doesn't, such as seamless zooming of the time and 
amplitude displays, and a sprung transport wheel which lets you move 
through the track at any speed forwards or backwards. One drawback of 
this program is that it has no graphical interface for editing the 
preferences - you have to close the program and edit a text file 
(~/.rezound/registry.dat).

The topics covered were:
 - recording a short guitar track from the sound card.
 - cutting this to length.
 - adding a reverb effect.
 - normalising the amplitude.
 - exporting the file.

=== Jackd and Qjackctl ===

Jackd is an audio routing daemon, which allows programs a standardised 
interface for sending multiple audio streams either between each other, 
to and from the sound card, or even within a single program. It works 
like a patchbay - each program has several inputs and outputs which can 
be connected without any restrictions to the inputs and outputs of other 
programs, to the sound card and, if you want to be adventurous, to 
network sockets. It also provides a common transport timer between 
applications, to allow you for example to play a midi sequencer and soft 
synth in sync with an audio track you have laid down in ardour.

It is reckoned to be more powerful and flexible in its design than any 
of the similar technologies available for windows or the mac; for 
example it allows programs to send audio streams to each other unlike 
vst, and it has no restictions on the number of channels, unlike rewire.

It does not replace alsa, which is linux's kernel level sound driver 
system. Usually alsa will take care of actaully talking to the sound 
card, and then jackd will feed data between the alsa api and the 
programs that use jackd. The usual situation is to start jackd using the 
normal alsa driver that you use for your sound card ; however there are 
a few firewire cards which are not supported by alsa but are supported 
by the ffdao (was called freebob) library. If you use one of these cards 
(e.g. the firewire solo which I use), then you can use a jackd plugin 
which uses this library and bypasses alsa.

Most audio editing programs have a jack output plugin; however there are 
fewer media players which support it, and it also adds a slight cpu 
overhead, so it's probably best to keep jack for doing proper recording 
and editing, and use the normal alsa plugins for your media player to 
play music, dvds etc.

There are two important things you need to be aware of when doing proper 
audio work; xruns and latency. Xruns are the underruns and overruns 
caused when the sound card either plays all the data it has been sent 
before the program controlling it has time to fill its internal buffer 
(during playback), or during recording when the opposite occurs and the 
program can't empty the buffer quickly enough. Xruns will appear as 
slight clicks or dropouts in the audio. Short ones may be hard to hear, 
but will still spoil the quality of the sound.

The first and most important thing you can do to reduce xruns is to use 
a 'realtime' kernel. The normal linux kernel has a scheduling algorithm 
which is used to decide at any given time which program should be 
running on the cpu. This works fine for most purposes, but is not suited 
to audio work, as it cannot guarantee that a program will be run again 
within a given period of time. So for audio work and similar 
applications, a different scheduler has been developed called 
SCHED_FIFO. This is driven (as I understand it) more directly by the 
interrupts from the sound card, and allows real time programs to be 
woken up as soon as they are needed rather than waiting their turn in 
the normal scheduler. The simplest way to install this is to use a 
distro which either has this installed by default (like 64studio), or 
has a kernel package which will install a real time kernel. Once you 
have installed it, there is a bit of faffing around you need to do to 
allow normal users to run programs which use the realtime capabilities, 
but it's not too hard to do.

For many purposes, installing a realtime kernel is enough to get a 
pretty good system for doing audio work; however if you are doing live 
work like playing an external keyboard into a midi soft synth, then you 
also need to consider latency. This is the amount of time between you 
pressing a key, for example, and the sound starting. The idea is to get 
latency as low as possible without causing xruns. Latency begins to be 
noticeable at maybe 50ms (?) and is reckoned to make the system unusable 
above 100ms.

To achieve low latencies, there are a few other things you can do, like 
looking at which interrupts are given to different parts of the system 
and trying to make sure that your sound card has an interrupt to itself. 
I am not an expert on this, so you should look for information on the 
net about how to do this for your distro.

Having explained about all this, we then looked at how to actually set 
up and start jackd using a graphical control panel called qjackctl.

=== Ardour ===
Ardour is a professional quality multitrack hard disk recorder and audio 
workstation for linux. It doesn't run in Windows at all; it may be 
possible to run it on a Mac but I'm not sure. It is a really good 
program with many features; it takes a bit of time to get started just 
because of the sheer power of the program, but it's worth taking the 
time to do this if you're at all interested in recording and editing 
music in linux.

It was written initially by someone who had made enough money in the 
computer industry to be able to take 3 years off from paid work and 
develop the program, and is now developed and supported by around a 
dozen key volunteers.

You use it to lay down a series of tracks, edit them, mix them and add 
effects etc. It only does audio not midi at the moment, though a midi 
sequencer is planned for the next major release. It is based around 
jackd, and actually uses jack for internal audio routing as well as to 
enable it to be connected to other programs. For example there is a 
program called jamin which you can connect to ardour for doing a 
professional master of your mix. You can also record output from other 
jack capable programs into an ardour track - e.g. you can record from 
the qsynth soft synthesiser into ardour.

The topics covered were:
 - starting a new project.
 - recording a mono guitar track.
 - then recording a mono drum rack.
 - adjusting the levels of the two tracks.
 - adding effects using a bus.

That was the end of the workshop, though I may be up for doing another 
one on midi stuff at some time. Thanks to everyone who attended and I 
hope you all found it interesting and useful.




-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: demo-notes.txt
Url: http://mailman.lug.org.uk/pipermail/lancaster/attachments/20080918/b14600fb/attachment-0001.txt 


More information about the Lancaster mailing list