* [PATCH] a52: Ignore start request if we're already running
@ 2014-11-12 14:55 David Henningsson
2014-11-12 15:14 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: David Henningsson @ 2014-11-12 14:55 UTC (permalink / raw)
To: alsa-devel; +Cc: tiwai, hyperair, David Henningsson
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 <hyperair@ubuntu.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] a52: Ignore start request if we're already running
2014-11-12 14:55 [PATCH] a52: Ignore start request if we're already running David Henningsson
@ 2014-11-12 15:14 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2014-11-12 15:14 UTC (permalink / raw)
To: David Henningsson; +Cc: alsa-devel, hyperair
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 <hyperair@ubuntu.com>
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-12 15:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12 14:55 [PATCH] a52: Ignore start request if we're already running David Henningsson
2014-11-12 15:14 ` Takashi Iwai
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.