[alsa-devel] "Resource temporarily unavailable" while reading although poll returns POLLIN event
superquad.vortex2 at gmail.com
Thu Apr 22 06:28:51 CEST 2010
2010/4/22 Stefan Schoenleitner <dev.c0debabe at 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 ?
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 ?
More information about the Alsa-devel