From: Eric Laurent Date: Wed, 2 Mar 2016 17:54:57 +0000 (-0800) Subject: ALSA: compress: allow writes in SNDRV_PCM_STATE_PREPARED state X-Git-Tag: next-20160307~62^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=35383a24129a47a0b8365ed17d3dcd2f75175929;p=karo-tx-linux.git ALSA: compress: allow writes in SNDRV_PCM_STATE_PREPARED state Allow writes in SNDRV_PCM_STATE_PREPARED state so that more than one buffer fragment can be written from user space before calling SNDRV_COMPRESS_START. Signed-off-by: Eric Laurent Acked-by: Vinod Koul Signed-off-by: Takashi Iwai --- diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 7fac3cae8abd..9e7c2f0831d7 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -286,6 +286,7 @@ static ssize_t snd_compr_write(struct file *f, const char __user *buf, mutex_lock(&stream->device->lock); /* write is allowed when stream is running or has been steup */ if (stream->runtime->state != SNDRV_PCM_STATE_SETUP && + stream->runtime->state != SNDRV_PCM_STATE_PREPARED && stream->runtime->state != SNDRV_PCM_STATE_RUNNING) { mutex_unlock(&stream->device->lock); return -EBADFD;