[alsa-devel] "Resource temporarily unavailable" while reading although poll returns POLLIN event
Stefan Schoenleitner
dev.c0debabe at gmail.com
Thu Apr 22 12:15:29 CEST 2010
Raymond Yau wrote:
> 2010/4/21 Stefan Schoenleitner <dev.c0debabe at gmail.com>
>> If it helps, I pasted the source code here so that you can view it nicely:
>> http://pastebin.com/fCicqctq
>>
> which sound card are you using ?
>
> The program did not run on my two sound card since you are using 160 frames
> and mono
>
> are you using "pulse" device for testing since only pulse device return the
> error messages "could not read from capture device: Resource temporarily
> unavailable" ?
Yes, I am using pulseaudio since my hardware sound card (an audigy 2)
does not support the period size I'm using.
The error message above is is from my own program (line 444):
-----------------------------------------------------------------
if ((ret=snd_pcm_readi(capture_device, buffer, 160))<0)
{
if (ret == -EPIPE)
{
fprintf(stderr, "XRUN while reading from capture device: %s\n",
snd_strerror(ret));
snd_pcm_prepare(capture_device);
snd_pcm_start(capture_device);
}
else
{
fprintf(stderr, "could not read from capture device: %s\n",
snd_strerror(ret));
exit(EXIT_FAILURE);
}
}
-----------------------------------------------------------------
cheers,
stefan
More information about the Alsa-devel
mailing list