All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: Jaroslav Kysela <perex@suse.cz>
Cc: Paul Davis <paul@linuxaudiosystems.com>,
	alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Re: problems using select() on alsa pcm.
Date: Thu, 25 Mar 2004 15:13:34 +0000	[thread overview]
Message-ID: <4062F71E.50802@superbug.demon.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.58.0403251037200.1807@pnote.perex-int.cz>

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

  parent reply	other threads:[~2004-03-25 15:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-25  3:39 problems using select() on alsa pcm James Courtier-Dutton
2004-03-25  4:08 ` Paul Davis
2004-03-25  9:38   ` Jaroslav Kysela
2004-03-25 14:44     ` Paul Davis
2004-03-25 15:05       ` Jaroslav Kysela
2004-03-25 15:13     ` James Courtier-Dutton [this message]
2004-03-25 15:38       ` Jaroslav Kysela
2004-03-25 10:25   ` Martijn Sipkema
2004-03-25 13:19     ` Paul Davis
2004-03-25 14:00     ` Takashi Iwai
2004-03-25 14:35       ` Martijn Sipkema
2004-03-25 21:44       ` Glenn Maynard
2004-03-25  9:36 ` Jaroslav Kysela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4062F71E.50802@superbug.demon.co.uk \
    --to=james@superbug.demon.co.uk \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=paul@linuxaudiosystems.com \
    --cc=perex@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.