Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* snd_pcm_wait function
@ 2012-11-10 16:43 Enno Fennema
  2012-11-10 17:20 ` Clemens Ladisch
  0 siblings, 1 reply; 8+ messages in thread
From: Enno Fennema @ 2012-11-10 16:43 UTC (permalink / raw)
  To: alsa-devel

The documentation says this functions waits for the pcm to become ready 
for I/O. I am not sure what ready means in this context.

I assume entering the PREPARED state. Is that correct?

Is there a function to wait for entering the SETUP state. In particular 
I would like to wait for pcm_snd_drain to finish.

Appreciate any help.

Enno Fennema

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: snd_pcm_wait function
@ 2012-11-12  7:23 Enno Fennema
  2012-11-12  7:36 ` Clemens Ladisch
  0 siblings, 1 reply; 8+ messages in thread
From: Enno Fennema @ 2012-11-12  7:23 UTC (permalink / raw)
  To: clemens; +Cc: alsa-devel, daniellsanz2

Thanks for your reply. I may not have expressed myself clearly. I appear 
to have the opposite problem from Daniel Sanz re Non-blocking 
snd_pcm_drain (also posted 10 Nov). He wants the new sound to start 
immediately. I want to close the pcm AFTER the sound finished.

The docs say calling drain() puts the pcm in the DRAINING state. When I 
obtain the state immediately after drain() it is already SETUP.
I hoped a state change from DRAINING to SETUP  would be the right time 
to close the pcm but there appears to be no such state change.

Currently I solved my problem by a usleep() based on an estimate of the 
time needed to finish playing the last samples in the buffer.

If there is a more elegant way I would like to know. Otherwise I will 
stick with usleep(),

Regards,
Enno

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

end of thread, other threads:[~2012-11-16 10:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-10 16:43 snd_pcm_wait function Enno Fennema
2012-11-10 17:20 ` Clemens Ladisch
  -- strict thread matches above, loose matches on Subject: below --
2012-11-12  7:23 Enno Fennema
2012-11-12  7:36 ` Clemens Ladisch
2012-11-12 20:57   ` Trent Piepho
2012-11-13  0:15     ` Daniel Sanz
2012-11-13  4:45       ` Trent Piepho
2012-11-16 10:41         ` Daniel Sanz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox