10 Mar
2008
10 Mar
'08
7:38 p.m.
On Mon, 10 Mar 2008, Johannes Dohmen wrote:
Hi there,
With a sampling rate of 8000 I want to capture every 20ms a chunk (160 frames) of data from the soundcard. That works ok, but every ~5 seconds I get a EGAIN from snd_pcm_readi(). I understand that this is not an error but a notification that the sound card is not ready and should be asked again for data later on.
Probably the easiest way to get rid of the EGAINs would be to use blocking IO, which I would prefer, but I have timing restrictions and snd_pcm_readi() has no sort of timeout (which I could see at least).
Just use poll() - it's standard unix interface to wait for an event.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.