All of lore.kernel.org
 help / color / mirror / Atom feed
* The different STATES of ALSA
@ 2005-07-31 13:35 Hynek Hanke
  2005-07-31 14:17 ` James Courtier-Dutton
  0 siblings, 1 reply; 8+ messages in thread
From: Hynek Hanke @ 2005-07-31 13:35 UTC (permalink / raw)
  To: alsa-devel


Hi everyone,

I'm having very much troubles programming an ALSA interface because the
documentation is pretty poor. I'm very much confused about the different states
in alsa-lib.

(After I was told alsa-lib is not thread-safe and there is some bug in the kernel
implementation of the underlaying calls of snd_pcm_writei(), I'm now running the
non-blocking/polling approach).

My questions:

1) In which states am I allowed to call
	a) snd_pcm_hw_params_any
	b) snd_pcm_hw_params
	c) snd_pcm_prepare
	d) snd_pcm_drop and _drain

2) Which states do they bring me to, if they don't return an error?

3) How is it possible that snd_pcm_drain returns with a success value *and*
   the snd_pcm_state() still reports SND_PCM_STATE_DRAINING ? Is this a bug?

4) How is it possible, that the whole time a sound is played snd_pcm_writei()
   never returns the value -EPIPE and still, when checking the state before
   playing the next sound, I find the device in the SND_PCM_STATE_XRUN
   (snd_pcm_drain() gets called in the meantime).

The problems (3) and (4) seem to arrise only under some circumstances, possibly
when more sounds are played in a quick succession.

Thank you for help,
Hynek Hanke



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-08-01  8:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-31 13:35 The different STATES of ALSA Hynek Hanke
2005-07-31 14:17 ` James Courtier-Dutton
2005-07-31 15:17   ` Hynek Hanke
2005-07-31 15:31     ` James Courtier-Dutton
2005-07-31 15:38       ` Hynek Hanke
2005-07-31 15:51         ` James Courtier-Dutton
2005-08-01  8:11         ` Jaroslav Kysela
2005-08-01  8:09       ` Jaroslav Kysela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.