From: Takashi Iwai Subject: Re: [COMPRESS] [PATCH] ALSA: compress_core: don't return -EBADFD from poll if paused Date: Tue, 12 Nov 2013 07:15:06 +0100 Message-ID: References: <20131022102631.GA7466@opensource.wolfsonmicro.com> <20131112045746.GI8834@intel.com> 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 E1BFC261689 for ; Tue, 12 Nov 2013 07:15:07 +0100 (CET) In-Reply-To: <20131112045746.GI8834@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Vinod Koul Cc: alsa-devel@alsa-project.org, broonie@kernel.org, Richard Fitzgerald , lgirdwood@gmail.com List-Id: alsa-devel@alsa-project.org At Tue, 12 Nov 2013 10:27:46 +0530, Vinod Koul wrote: > > On Tue, Oct 22, 2013 at 11:26:48AM +0100, Richard Fitzgerald wrote: > > Pausing audio playback is not an illegal state so it doesn't > > seem sensible for poll() to return -EBADFD on a paused stream. > > There's also no reason to assume that we can't write more data > > to the DSP while playback is paused. Remove the -EBADFD so that > > a stream in paused state will still report the buffer > > availability from poll(). It is up to the user process to > > manage its state so that it knows whether it is paused or not. > > > > Signed-off-by: Richard Fitzgerald > Acked-by VInod Koul > > Takashi, looks like I missed checking this earlier.. OK, applied now. Thanks. Takashi > > -- > ~Vinod > > --- > > sound/core/compress_offload.c | 3 +-- > > 1 files changed, 1 insertions(+), 2 deletions(-) > > > > diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c > > index bea523a..30ca133 100644 > > --- a/sound/core/compress_offload.c > > +++ b/sound/core/compress_offload.c > > @@ -384,8 +384,7 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait) > > return -EFAULT; > > > > mutex_lock(&stream->device->lock); > > - if (stream->runtime->state == SNDRV_PCM_STATE_PAUSED || > > - stream->runtime->state == SNDRV_PCM_STATE_OPEN) { > > + if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) { > > retval = -EBADFD; > > goto out; > > } > > -- > > 1.7.2.5 > > > > -- >