alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Raymond Yau <superquad.vortex2@gmail.com>
To: ALSA Development Mailing List <alsa-devel@alsa-project.org>
Subject: Re: "Resource temporarily unavailable" while reading although poll returns POLLIN event
Date: Thu, 22 Apr 2010 12:28:51 +0800	[thread overview]
Message-ID: <y2n4f3252891004212128x22c1be90pd22a4fa58a31a57c@mail.gmail.com> (raw)
In-Reply-To: <4BCF24AC.3000301@gmail.com>

2010/4/22 Stefan Schoenleitner <dev.c0debabe@gmail.com>

> Stefan Schoenleitner wrote:
> > Since a POLLIN event only occurs after at least a full period is
> available for
> > reading (as set up by snd_pcm_sw_params_set_avail_min() above)
> > and I only read after a POLLIN event occured on the capture device fd,
> > I really do not understand why I get the above error.
>
> By using snd_pcm_avail_update() I found out that polling on the PCMs
> *does not work at all*.
>
> Although I verified that avail_min is 160 frames, polling on the
> capture/playback PCMs returns a POLLIN/POLLOUT event even if the number
> of frames for reading/writing *is less than avail_main*.
>
> I also tried snd_pcm_wait() which should also wait until there are at
> least avail_min frames available for reading/writing.
> The result is the same: snd_pcm_avail_update() shows that it returns
> even if there are far less than avail_min frames available for processing.
>
> I suspect that this is a bug in ALSA ?
>
>
> cheers,
> stefan
>


your program expect the driver support 2 periods per buffer but does not
expicitly set the period

8000 Hz , S16_LE and mono

>> I verified that avail_min is 160 frames

is there any specific reason to choose 160 frames ?

  parent reply	other threads:[~2010-04-22  4:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21 11:28 "Resource temporarily unavailable" while reading although poll returns POLLIN event Stefan Schoenleitner
2010-04-21 16:15 ` Stefan Schoenleitner
2010-04-21 17:18   ` Jaroslav Kysela
2010-04-22 10:09     ` Stefan Schoenleitner
2010-04-23  4:10       ` Raymond Yau
2010-04-24  1:32       ` Raymond Yau
2010-04-24 14:38         ` Stefan Schoenleitner
2010-04-24 23:43           ` Raymond Yau
2010-04-26  7:52             ` Stefan Schoenleitner
2010-04-27  0:35               ` Raymond Yau
2010-04-26  1:46           ` Raymond Yau
2010-04-26  8:19             ` Stefan Schoenleitner
2010-04-26 11:10               ` Raymond Yau
2010-04-22  4:28   ` Raymond Yau [this message]
2010-04-22 10:49     ` Stefan Schoenleitner
2010-04-23  7:45       ` Raymond Yau
2010-04-23 11:16         ` Stefan Schoenleitner
2010-04-22  2:41 ` Raymond Yau
2010-04-22 10:15   ` Stefan Schoenleitner

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=y2n4f3252891004212128x22c1be90pd22a4fa58a31a57c@mail.gmail.com \
    --to=superquad.vortex2@gmail.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;
as well as URLs for NNTP newsgroup(s).