Re: [OT] ALSA userspace API complexity

Hannu Savolainen
2006-01-06T02:20:13Z

On Fri, 6 Jan 2006, Joern Nettingsmeier wrote:

> shuffle 16 tracks of 24bit 48k audio in and out of the machine at a latency
> where a professional drummer will not complain, with routing options adequate
> for professional work, and then let's see how simple your API is.
This is nonsense. This is something where the API design cannot make any
difference.

To get (say) 10 ms latencies you have to tell the sound subsystem
to allocate to buffer that is smaller than 10 ms. This in turn means that
the application must be able to run it's processing loop within less than 10
ms with 100.000...0% confidence. This is true regardless of how advanced
or primitive the audio subsystem (API) is.

What happens if some system load peak delays the application by 20 ms? The
result is complete failure. What is the ALSA (API) feature OSS doesn't
have that makes it able to predict what kind of output the application
should have fed to the device during the (about) 20 ms period of silence?

The fact is that there is nothing the audio subsystem can do to recover
the situation. For this very simple reason the OSS API lacks everything
that would be necessary to cope with this kind of problems.

After all the lowest possible audio latency depends on the level of real
time response capabilities of the underlaying OS/hardware/application
environment. If the app doesn't get the CPU right in time it will fail
(believe or not).

If the system can fullfill the response time requirements then any sound
subsystem will work equally well (unless they are seriously broken).

The sound subsystem implementations may have performance
differences of few usecs. However they don't make one better than another
in cases when the peak latencies are in millisecond range. In addition
same devices have FIFO/bus delays of up to few msec byt even then
advances in the audio subsystem/API design cannot help at all.

Best regards,

Hannu
-----
Hannu Savolainen (hannu@opensound.com)
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages)
OH2GLH QTH: Karkkila, Finland LOC: KP20CM