On Wed, 21 Apr 2010, Stefan Schoenleitner wrote:
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 ?
It might be. Could you post snd_pcm_dump() when you read less frames?
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.