Skip to contentSkip to conversation

reading constant length of data from sound card using readi api of alsa

DISCUSSION Koushik jaikishan 2 participants 2 messages May 5, 2005 – May 6, 2005

lore
Share & tools
lore
#0 lore raw

hello all,

i am not able to read constant amount of data from the sound card i dont know why, it always gives me - 11 as the returned value for reading 960 bytes of data.

r = snd_pcm_readi(handle, buf, 960);

r value will be always -11, i suppose this is a error value for not getting any data from the sound card. please give me a suggestion on this. Thank you,

regards,

Koushik P S R

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20

#1 lore raw
Quoted 3 lines · Koushik jaikishan

i am not able to read constant amount of data from the sound card i dont know why, it always gives me - 11 as the returned value for reading 960 bytes of data.

-11 is -EAGAIN. You would be able to read some data if you waited some time.

Either disable the non-blocking mode with snd_pcm_nonblock, or wait with snd_pcm_wait, or, if you have other devices to wait for, use the snd_pcm_poll_* functions with poll().

HTH
Clemens

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20