diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-06-19 18:39:31 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 22:53:04 +0200 |
commit | dff0f8c279e34089128e9687d77bfc72dbb471bd (patch) | |
tree | 04ba0d2f27da5fe363dc1a0890bfb94219ee638c /drivers/media/video/em28xx/em28xx-audio.c | |
parent | [media] em28xx-audio: Properly report failures to start stream (diff) | |
download | linux-dff0f8c279e34089128e9687d77bfc72dbb471bd.tar.xz linux-dff0f8c279e34089128e9687d77bfc72dbb471bd.zip |
[media] em28xx-audio: Some Alsa API fixes
Mark the alsa stream with SNDRV_PCM_INFO_BATCH,
as the timing to get audio streams can vary.
Also, add SNDRV_PCM_TRIGGER for pause/release.
while here, fix the stop indicator, to be sure that audio
will be properly released at the stop events.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 5381f6d7427d..47f21a382546 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c @@ -249,6 +249,7 @@ static struct snd_pcm_hardware snd_em28xx_hw_capture = { .info = SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BATCH | SNDRV_PCM_INFO_MMAP_VALID, .formats = SNDRV_PCM_FMTBIT_S16_LE, @@ -401,11 +402,15 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream, int retval = 0; switch (cmd) { + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through */ + case SNDRV_PCM_TRIGGER_RESUME: /* fall through */ case SNDRV_PCM_TRIGGER_START: atomic_set(&dev->stream_started, 1); break; + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through */ + case SNDRV_PCM_TRIGGER_SUSPEND: /* fall through */ case SNDRV_PCM_TRIGGER_STOP: - atomic_set(&dev->stream_started, 1); + atomic_set(&dev->stream_started, 0); break; default: retval = -EINVAL; |