[alsa-devel] "Resource temporarily unavailable" while reading although poll returns POLLIN event

Stefan Schoenleitner dev.c0debabe at gmail.com
Wed Apr 21 18:15:40 CEST 2010

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 ?


More information about the Alsa-devel mailing list