Re: [ecasound] buffering question

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] buffering question
From: Kai Vehmanen (k_AT_eca.cx)
Date: Wed Jan 08 2003 - 01:12:16 EET


On Thu, 26 Dec 2002, The Eye wrote:

> man-page says the -b: option gives the buffer size in samples, and that
> the default was 1024 .. so I was thinking to meself, if I got this
> right, we are sampling analog audio at 44100 Hz, so if I had a buffer of
> 44100 Samples, that would be equal to 1 second of a buffer, which is

Correct. The problem is that there are multiple types and levels of
buffers involved. The -b options sets the blocksize of ecasound, i.e. how
much ecasound processes audio data during one engine iteration. Other
parts of ecasound try to adapt their internal workings to this value.
So although using a buffer value for -b:xxx does increase reliability in
most cases, it's not quite that simple...

> (eca-control) ERROR: Connecting chainsetup failed: "Enabling chainsetup:
> AUDIOIO-ALSA: buffersize 10240 is out of range!"
[...]
> strange .. this buffer, as I understood it, is it not created in Memory?
> so it shouldn't be possible for it to be "out of range" as long as I
> don't run out of RAM, right?

For efficient, low-latency processing, ecasound tries to set the soundcard
interrupt generation frequency to match the engine iteration frequency
(i.e. what is set with -b:xxx). This means that the set of valid values
for -b:xxx is limited by the used audio soundcard hardware. In practice
good values for -b:xxx range 64 to 4096. Other values are sometimes
allowed, but rarely results in better results.

A short overview of paramateres affecting buffering:
-b:xxxx - engine blocksize, soundcard interrupt freq, ...
-z:intbuf/-z:nointbuf - whether soundcard is allowed to use
                       all available memory for buffering
-z:db,xxx - utilize disk i/o buffering

Basicly just using one buffer is not enough. We need different buffering
mechanisms to protect against scheduling latency spikes, disk i/o
scheduling latencies, interrupt dispatch latencies and so on. The good
news is that ecasound has mechanisms in place to handle all these things.

-- 
 http://www.eca.cx
 Audio software for Linux!


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Jan 08 2003 - 01:07:02 EET