From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Courtier-Dutton Subject: Re: problems using select() on alsa pcm. Date: Thu, 25 Mar 2004 15:13:34 +0000 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <4062F71E.50802@superbug.demon.co.uk> References: <200403250408.i2P48qDC021625@dhin.linuxaudiosystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Jaroslav Kysela Cc: Paul Davis , alsa-devel List-Id: alsa-devel@alsa-project.org Jaroslav Kysela wrote: > On Wed, 24 Mar 2004, Paul Davis wrote: > > >>>open pcm, and get a handle. >>> >>>snd_pcm_poll_descriptors(handle, &pfd, err); >>> >>>Get a poll file scriptor in pfd. >>> >>>select(nfds, rfds, wfds, efds, tvp); >>> >>>Is it possible to use this call with alsa ? >> >>select is generally deprecated in linux (linus says so!). but you can >>use the same pfds in select as in poll (select is implemented in the >>kernel using the poll code). the problem is interpreting the results >>you get back (as noted recently for the dmix plugin). > > > Nope, the application must give results back to pfd array and call > snd_pcm_poll_descriptors_revents() function. In this way, everything > will work as expected. > > Jaroslav So which of the following is needed: - snd_pcm_poll_descriptors(handle, &pfd, err); select(nfds, rfds, wfds, efds, tvp); snd_pcm_poll_descriptors_revents() <- decode the results of the select. or snd_pcm_poll_descriptors(handle, &pfd, err); snd_pcm_poll_descriptors_revents() <- rearrange the pfd so that select works as expected. select(nfds, rfds, wfds, efds, tvp); Cheers James ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click