[linux-audio-user] sound recording application

Kai Vehmanen kvehmanen at eca.cx
Mon Sep 11 14:38:34 EDT 2006


Hi,

On Sat, 9 Sep 2006, Maarten de Boer wrote:

> Could you explain what you mean with "much less reliable" ?
> I often use arecord, and find it very reliable.

arecord (and most other tools mentioned in this thread) do not separate 
disk i/o from audio i/o. Thus if disk i/o blocks for longer than the size 
of audio i/o buffering, you'll get an xrun (= a break in the recording in 
this case).

How big of an issue this is depends on your kernel, disk i/o subsystem, 
and the amount of audio buffering used (which again depends on the driver, 
soundcard hw and the sampling parameters). Many soundcards (but not all!) 
allow to use quite big buffers, so in practise arecord et al will work 
without glitches (especially for low-bandwidth usage like recording one or 
two channels of CD-quality audio).

Ecasound (as do many other apps, such as ardour, linuxsampler, etc), 
protect the audio i/o loop with multiple seconds of disk i/o buffering, 
thus they are able to guarantee reliable audio i/o even in extreme 
conditions (minimal audio i/o buffering to minimize latency + heavy system 
load).

And then a separate issue is rt-scheduling. This is another safety measure 
to protect the audio i/o loop against badly behaving other processes.

Couple of old links about this "why ecasound for recording" topic 
(btw; note the years, I've been repeating these things for over 5 years now! ;)):

http://eca.cx/ecasound-list/2001/06/0016.html
http://eca.cx/ecasound-list/2005/04/0038.html

> I have never used ecasound, and since I often use arecord and oggenc
> in different settings, piping them together was the logical solution
> for me... And frankly, I find my arecord / oggenc oneliner (even

Sure, I use arecord a lot myself, too. Due to high visibility of ALSA, I 
think aplay/arecord have become the de facto applications for these tasks, 
so it probably makes more sense to focus energy on improving these tools 
than to market other options. But there might not be a huge need for 
change the tools, as mentioned earlier, with current kernels, and the 
common use cases (low-bandwidth recording/playback), arecord/aplay may be 
already good enough for most people.

> arecord -f cd -d 14400 | oggenc -q 6 -o 4hours.ogg -

Btw, you can of course use ecasound for this as well:

ecasound -f:16,2,44100 -t:14400 -r -i alsa -o stdout |oggenc -q 6 -o 4hours.ogg -

... plus you get separate buffering for the pipe (blocking on the oggenc 
pipe won't interfere with the recording process) and benefits of
real-time scheduling (-r).

-- 
  links, my public keys, etc at http://eca.cx/kv



More information about the Linux-audio-user mailing list