Skip to content

Commit

Permalink
ALSA: compress: allow writes in SNDRV_PCM_STATE_PREPARED state
Browse files Browse the repository at this point in the history
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 <elaurent@google.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Eric Laurent authored and Takashi Iwai committed Mar 4, 2016
1 parent 59e4282 commit 35383a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/core/compress_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 35383a2

Please sign in to comment.