[linux-audio-dev] ALSA Picture

Clemens Ladisch clemens at ladisch.de
Fri Mar 24 13:10:11 UTC 2006


Richard Spindler wrote:
> on my quest to understand the ALSA API, I created a little Image to
> get an overview about the various states and how they relate to each
> other.
> 
> http://propirate.net/oracle/bilder/ALSA.png

Cool, the first complete page of The ALSA Programming Manual!

Now we only need somebody to write the remaining 999 pages ... ;-)

> Hopefully I got everyting right, can you have a look at this image and
> tell me whether this is correct?

snd_pcm_hw_params() goes into the SETUP state and then calls
snd_pcm_prepare(); I don't know how to display this in a picture. :)

You probably want an arrow from snd_pcm_writei() to RUNNING.

The SUSPENDED and XRUN states can happen asynchronously, i.e., the
device can go into them at any time (from some other states), and the
next call to snd_pcm_writei() only reports them.  In this regard, they
are similar to the DISCONNECTED state.

XRUN happens not only when an over/underrun occurs but also when some
other error causes the device to stop (this error may be recoverable or
not).


Regards,
Clemens



More information about the Linux-audio-dev mailing list