Hi.

I've been playing around with the asound library for a while now, and there's someting 
that really gets under my skin.

The snd_pcm_open function, requires an open mode parameter, which, according to the 
documentation, defaults to blocking mode, but can be set to SND_PCM_NONBLOCK, or 
SND_PCM_ASYNC, as well. 

Its great that the function defaults to blocking mode, but I still have to pass a mode 
parameter to the mode function. What am I supposed to pass, if blocking mode is what I 
want (which is most if the time for me, ATM)? A look at the code shows that 
SND_PCM_NONBLOCK and SND_PCM_ASYNC are #defined as 1 and 2 respectively, so I can't 
pass those values. And the sample code, test/pcm.c, provided with alsa-lib passes 0. 

Ok, problem solved. Pass zero. Fine. But that creates an inconsistent interface, and 
requires me to have access to more than documentation in order to use the API (a Bad 
Thing <TM>). A simple fix, and indeed one I've implimented locally, is to add  

#define SND_PCM_BLOCK 0x0000 

to include/pcm.h in alsa/lib. that way, when I call snd_pcm_open, I have something to 
give the mode parameter, and don't have to think about what the underlying value is.

Sounds like a good idea to me. -Or is there a reason for not adding that line that I'm 
not aware of?


Kyle C.


-- 

_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Win a ski trip!
http://ad.doubleclick.net/clk;3840379;4478627;x?http://www.nowcode.com/register.asp?affiliate=1net2phone3a



_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to