From: Takashi Iwai Subject: Re: patch for jack plugin Date: Mon, 09 Jan 2012 18:19:01 +0100 Message-ID: References: <20111229161204.GB22822@linuxaudio.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 8AC9D103AA2 for ; Mon, 9 Jan 2012 18:19:04 +0100 (CET) In-Reply-To: <20111229161204.GB22822@linuxaudio.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Fons Adriaensen Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 29 Dec 2011 16:12:04 +0000, Fons Adriaensen wrote: > > The following patch will make snd_pcm_poll_descriptors_revents() > return the correct value when used on a jack plugin device. > The current version returns POLLIN regardless of capture or > playback. Applied now. Thanks. Takashi > > > --- pcm_jack_orig.c 2011-12-29 16:42:07.000000000 +0100 > +++ pcm_jack.c 2011-12-29 16:51:18.000000000 +0100 > @@ -77,17 +77,18 @@ > return 0; > } > > -static int snd_pcm_jack_poll_revents(snd_pcm_ioplug_t *io ATTRIBUTE_UNUSED, > +static int snd_pcm_jack_poll_revents(snd_pcm_ioplug_t *io, > struct pollfd *pfds, unsigned int nfds, > unsigned short *revents) > { > static char buf[1]; > > assert(pfds && nfds == 1 && revents); > - > read(pfds[0].fd, buf, 1); > - > - *revents = pfds[0].revents; > + *revents = pfds[0].revents & ~(POLLIN | POLLOUT); > + if (pfds[0].revents & POLLIN) { > + *revents |= (io->stream == SND_PCM_STREAM_PLAYBACK) ? POLLOUT : POLLIN; > + } > return 0; > } > > > > Ciao, > > > -- > FA > > Vor uns liegt ein weites Tal, die Sonne scheint - ein Glitzerstrahl. > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >