All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Daniel Sanz <daniellsanz2@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Non-blocking snd_pcm_drain?
Date: Sat, 10 Nov 2012 18:28:45 +0100	[thread overview]
Message-ID: <509E8ECD.7080205@ladisch.de> (raw)
In-Reply-To: <CAHU0+dREbMHoAKOHgPpHfEO+kr93d1FmtrrQ6-nXUN3=7MqGxw@mail.gmail.com>

Daniel Sanz wrote:
> I noticed that the snd_pcm_drain call blocks until the buffer is
> completely drained. Is there any way to drain the buffer without
> a block?

Try calling snd_pcm_nonblock(handle, 1).

> I've tried calling snd_pcm_nonblock(handle, 1) before the call to
> snd_pcm_drain but it does not work.

How so?

> The context is that this is an application that plays a particular WAV
> sound repeatedly, so I don't want to wait until the sound is played
> completely before it is played again.

Then why do you drain at all?  Just write the new data into the buffer.


Regards,
Clemens

  reply	other threads:[~2012-11-10 17:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-10 17:08 Non-blocking snd_pcm_drain? Daniel Sanz
2012-11-10 17:28 ` Clemens Ladisch [this message]
2012-11-10 17:57   ` Daniel Sanz
2012-11-11 18:10     ` Daniel Sanz

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=509E8ECD.7080205@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=daniellsanz2@gmail.com \
    /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.