]> xenbits.xensource.com Git - arm/linux.git/commitdiff
ALSA: vx: Don't try to update capture stream before running
authorTakashi Iwai <tiwai@suse.de>
Wed, 4 Jan 2017 11:34:14 +0000 (12:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Nov 2017 08:23:25 +0000 (09:23 +0100)
[ Upstream commit ed3c177d960bb5881b945ca6f784868126bb90db ]

The update of stream costs significantly, and we should avoid it
unless the stream really has started.  Check pipe->running flag
instead of pipe->prepared.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/drivers/vx/vx_pcm.c

index 11467272089e45632935912c4e2b94f8cb604978..69f25258578044fb9e1fb2c6905bf2ab5423e1ad 100644 (file)
@@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream
        int size, space, count;
        struct snd_pcm_runtime *runtime = subs->runtime;
 
-       if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE))
+       if (!pipe->running || (chip->chip_status & VX_STAT_IS_STALE))
                return;
 
        size = runtime->buffer_size - snd_pcm_capture_avail(runtime);