From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] a52: Ignore start request if we're already running Date: Wed, 12 Nov 2014 16:14:45 +0100 Message-ID: References: <1415804143-11519-1-git-send-email-david.henningsson@canonical.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 62FFB2656EE for ; Wed, 12 Nov 2014 16:14:45 +0100 (CET) In-Reply-To: <1415804143-11519-1-git-send-email-david.henningsson@canonical.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: David Henningsson Cc: alsa-devel@alsa-project.org, hyperair@ubuntu.com List-Id: alsa-devel@alsa-project.org At Wed, 12 Nov 2014 15:55:43 +0100, David Henningsson wrote: > > When trying to start a PCM that's already running, the result is EBADFD. > We might have implicitly started the buffer by filling it up, > so just ignore this request if we're already running. > > Reported-by: Chow Loong Jin > Signed-off-by: David Henningsson Thanks, applied. Takashi > --- > a52/pcm_a52.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c > index b467ec8..59e25cb 100644 > --- a/a52/pcm_a52.c > +++ b/a52/pcm_a52.c > @@ -482,6 +482,12 @@ static int a52_start(snd_pcm_ioplug_t *io) > { > struct a52_ctx *rec = io->private_data; > > + /* When trying to start a PCM that's already running, the result is > + EBADFD. We might have implicitly started the buffer by filling it > + up, so just ignore this request if we're already running. */ > + if (snd_pcm_state(rec->slave) == SND_PCM_STATE_RUNNING) > + return 0; > + > return snd_pcm_start(rec->slave); > } > > -- > 1.9.1 >