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

From: Richard Spindler <richard.spindler@email-addr-hidden>
Date: Sat Mar 25 2006 - 10:03:02 EET

2006/3/24, kurmisk <kurmisk@email-addr-hidden>:
> 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
Received on Sat Mar 25 12:15:02 2006

This archive was generated by hypermail 2.1.8 : Sat Mar 25 2006 - 12:15:02 EET