All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Hynek Hanke <hanke@brailcom.org>
Cc: alsa-devel@alsa-project.org
Subject: Re: snd_pcm_drain() always fails
Date: Mon, 01 Aug 2005 20:28:09 +0200	[thread overview]
Message-ID: <s5hoe8hms06.wl%tiwai@suse.de> (raw)
In-Reply-To: <20050801181015.GE10144@brailcom.cz>

At Mon, 1 Aug 2005 20:10:15 +0200,
Hynek Hanke wrote:
> 
> > Nothing. If drain() is supposed to wait until all data are played and 
> > you're using the non-blocking mode, then it's definitely an error (thus 
> > -EAGAIN is returned - and it means from the driver perspective - I must 
> > wait and the application does not want this from me).
> 
> The documentation is very unclear about this. My guess was that it should bring
> me to the state DRAINING which should remain until all frames are played.

Patches are always welcome :)

> > Set the blocking mode before drain() is called (and return the mode back 
> > after it, if you want).
> 
> This is not possible. I'm using the non-blocking mode and poll() specifically
> because I need to receive external events (not comming from ALSA) too.
> 
> > The better way might be setting sw_params to wakeup app after all frames are
> > played and use the standard poll() call to wait in app.  
> 
> How can I do this or where can I read about it? I still need to receive those
> external events on other file descriptors. Is it possible with this approach?

Set avail_min swparams to the buffer size so that poll() won't return
unless the full buffer size becomes free (i.e. all samples are
played).  If stop_threshold is set to buffer size, the pcm stream will
be stopped automatically and set to XRUN state.


Takashi


-------------------------------------------------------
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

  reply	other threads:[~2005-08-01 18:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050801172719.GB10144@brailcom.cz>
2005-08-01 17:57 ` snd_pcm_drain() always fails Jaroslav Kysela
2005-08-01 18:04   ` Hynek Hanke,,,
2013-12-26 11:02     ` Giridhara
2005-08-01 18:10   ` Hynek Hanke
2005-08-01 18:28     ` Takashi Iwai [this message]
2005-08-01 18:36       ` Hynek Hanke
2005-08-01 18:45         ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hoe8hms06.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=hanke@brailcom.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.