Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mads Kiilerich <mads@kiilerich.com>
To: alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: handling of underrunning snd_pcm_writei
Date: Wed, 11 Nov 2009 19:12:24 +0100	[thread overview]
Message-ID: <4AFAFE88.5020508@kiilerich.com> (raw)
In-Reply-To: <4AFAEB44.60104@kiilerich.com>

On 11/11/2009 05:50 PM, Mads Kiilerich wrote:

> http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gf13067c0ebde29118ca05af76e5b17a9
> says about snd_pcm_writei:
>
>> Returns: a positive number of frames actually written otherwise a
>> negative error code
>> ...
>> Return values:
>> ...
>> -EPIPE an underrun occurred
>> ...
>> The count of bytes can be less only if a signal or underrun occurred.
...
> It surprises me that snd_pcm_writei shows non-blocking behaviour in case
> of underruns and don't use all the offered data. I would guess that it
> either blocked and enjoyed the data it finally got, or that it gave an
> error and didn't take any data at all. But if this is how it is, then
> ... that is how it is ;-)

Ok, experiments indicates that the documented blocking behaviour only 
applies in SND_PCM_STATE_RUNNING. snd_pcm_writei apparently behaves 
non-blocking in SND_PCM_STATE_PREPARED. I can see how that kind of makes 
sense - I just didn't expect that. Is that correctly understood?

/Mads

  reply	other threads:[~2009-11-11 18:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-11 16:50 handling of underrunning snd_pcm_writei Mads Kiilerich
2009-11-11 18:12 ` Mads Kiilerich [this message]
2009-11-12  7:12 ` Takashi Iwai
2009-11-12 12:10   ` Mads Kiilerich
2009-11-12 14:01     ` Mads Kiilerich
2009-11-14 13:03       ` 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=4AFAFE88.5020508@kiilerich.com \
    --to=mads@kiilerich.com \
    --cc=alsa-devel@alsa-project.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox