Subject: [ecasound] Re: [linux-audio-dev] recording large audio files
From: Kai Vehmanen (email@example.com)
Date: Wed Jun 06 2001 - 02:23:31 EEST
On Tue, 5 Jun 2001, Frank Barknecht wrote:
> Now, seriously, I just today found, that one of the mp3-soundfiles,
> I record daily in real time, had errors (BTW: This was first time it
> ever happend, and I used ecasound for more than a year every day)
> ecasound was running without "-r", now I changed this to run ecasound with
> high priority.
> Will -r help, although I can't run a low latency patched kernel, just plain
> kernel.org stuff?
-r will help with all kernels, but you really should also add -z:db. This
adds a big (default is 400kB) buffer between the soundcard and the mp3
encoder. And in addition, communication between the audio thread and the
disk thread (encoder) uses lock-free buffering, so audio thread will not
get blocked in any circumstance. If you have lots of memory, you can use
even bigger buffers (-z:db,size_in_audio_frames or in ~/.ecasoundrc).
Here's a message about this issue on ecasound-list:
Ecasound even lets you record and encode directly to mp3, so you can
record for LONG periods of time without needing too much disk space. (I
suspect -z:db here really is the magic trick for the whole thing to come
smoothly.) I used to record my jams on tape so that I could listen to them
afterwards to look for good melodic lines and song ideas in them. Now I
just do it with ecasound. :) Real time encoding (with lame) doesn't even
suck up too much CPU time!
Another trick is to add -z:intbuf that will increase the amount of
buffering done on the soundcard driver level (>3 buffer fragments). With
these options, the recording system can handle latencies of 300-400ms from
scheduling, and ~2000ms from disk/mp3_encoding. With -r (SCHED_FIFO, helps
against scheduling latency) enabled, this setup has proven to be reliable,
even under heavy cpu/disk use.
Of course, no buffering system can save you in cases where cpu and/or disk
just can't keep up with realtime (ie. the soundcard).
-- http://www.eca.cx Audio software for Linux!
-- To unsubscribe send message 'unsubscribe' in the body of the message to <firstname.lastname@example.org>.
This archive was generated by hypermail 2b28 : Wed Jun 06 2001 - 02:23:02 EEST