Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: samsung dma - Don't indicate support for pause/resume.

The pause and resume operations indicate that the stream can be
un-paused/resumed from the exact location they were paused/suspended.
This is not true for this driver, the pause and suspend triggers share
the same code path with stop, they flush all pending DMA transfers.
This drops all pending samples. The pause_release/resume triggers are
the same as start, except that prepare won't be called beforehand,
nothing will be enqueued to the DMA engine and nothing will happen (no
audio). Removing the pause flag will let apps know that it isn't
supported. Removing the resume flag will cause user space to call
prepare and start instead of resume, so audio will continue playing when
the system wakes up.

Before removing the pause and resume flags, I tested this on an exynos
5250, using 'aplay -i'. Pause/un-pause leads to silence followed by a
write error. Suspend/resume testing led to the same result. Removing
the two flags fixes suspend/resume (since snd_pcm_prepare is called
again). And leads to a proper reporting of pause not supported.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org

authored by

Dylan Reid and committed by
Mark Brown
57b2d688 37f45cc5

+1 -7
+1 -7
sound/soc/samsung/dma.c
··· 34 34 .info = SNDRV_PCM_INFO_INTERLEAVED | 35 35 SNDRV_PCM_INFO_BLOCK_TRANSFER | 36 36 SNDRV_PCM_INFO_MMAP | 37 - SNDRV_PCM_INFO_MMAP_VALID | 38 - SNDRV_PCM_INFO_PAUSE | 39 - SNDRV_PCM_INFO_RESUME, 37 + SNDRV_PCM_INFO_MMAP_VALID, 40 38 .formats = SNDRV_PCM_FMTBIT_S16_LE | 41 39 SNDRV_PCM_FMTBIT_U16_LE | 42 40 SNDRV_PCM_FMTBIT_U8 | ··· 246 248 247 249 switch (cmd) { 248 250 case SNDRV_PCM_TRIGGER_START: 249 - case SNDRV_PCM_TRIGGER_RESUME: 250 - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 251 251 prtd->state |= ST_RUNNING; 252 252 prtd->params->ops->trigger(prtd->params->ch); 253 253 break; 254 254 255 255 case SNDRV_PCM_TRIGGER_STOP: 256 - case SNDRV_PCM_TRIGGER_SUSPEND: 257 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 258 256 prtd->state &= ~ST_RUNNING; 259 257 prtd->params->ops->stop(prtd->params->ch); 260 258 break;