[linux-audio-dev] select() ?? before snd_pcm_writei(handle, buffer, frames);

Richard Spindler richard.spindler at gmail.com
Sat Mar 25 08:03:02 UTC 2006


2006/3/24, kurmisk <kurmisk at inbox.lv>:
> I have write my small _alsa_test_program_.
> [C code ckunkz see below]
> It works good but now i wanna before call
> rc = snd_pcm_writei(handle, buffer, frames);
> somehow check - is sound device free for this call or not.
>
> For OSS i have such problem solve with  select() :
>  fdo = open("/dev/dsp", O_WRONLY );
> .....
>       FD_ZERO(&wfds);
>       FD_SET( fdo , &wfds);     Zeit.tv_sec=0;   Zeit.tv_usec=1;
>       response=select(fdo+1, NULL, &wfds, NULL, & Zeit );

You can use snd_pcm_poll_descriptors to get a fildescriptor to select on.

-Richard



More information about the Linux-audio-dev mailing list