]> git.karo-electronics.de Git - karo-tx-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)
committerTakashi Iwai <tiwai@suse.de>
Wed, 4 Jan 2017 17:01:35 +0000 (18:01 +0100)
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>
sound/drivers/vx/vx_pcm.c

index 41a617886cc78b75e974d542f144a29316fe3bdc..ea7b377f03787cdb3ba5b21266b5df57b5b41340 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);