[alsa-devel] alsa-lib: snd_pcm_delay and friends do not account for a write being currently in progress

John Lindgren john.lindgren at tds.net
Thu Jun 3 19:51:41 CEST 2010


On Thu, 2010-06-03 at 19:03 +0200, Clemens Ladisch wrote:
> John Lindgren wrote:
> > I understand that snd_pcm_delay and snd_pcm_writei currently "interfere
> > with each other" in that snd_pcm_delay returns wrong values if called
> > during snd_pcm_writei.  That is the problem my patch tries to correct.
> 
> These values are not wrong; the problem is that your program does not
> have enough information to interpret it correctly.

Same thing.

> > What would be the cleanest way to interrupt snd_pcm_wait when we need to
> > stop the stream?  Will snd_pcm_drop work?
> 
> *sigh*
> This will _not_ work.
> 
> You have to use poll so that you can send your loop a message (through
> a pipe/eventfd/whatever) that tells it to stop.

Ugh.  It seems you are determined to avoid complexity in ALSA at the
expense of complexity in programs that use it.

At any rate, at least I know what needs to be done now, so thanks for
that.

John Lindgren



More information about the Alsa-devel mailing list