Skip to content

Commit 21fca8b

Browse files
gt82leebroonie
authored andcommitted
ASoC: dpcm: allow start or stop during pause for backend
soc_compr_trigger_fe() allows start or stop after pause_push. In dpcm_be_dai_trigger(), however, only pause_release is allowed command after pause_push. So, start or stop after pause in compress offload is always returned as error if the compress offload is used with dpcm. To fix the problem, SND_SOC_DPCM_STATE_PAUSED should be allowed for start or stop command. Signed-off-by: Gyeongtaek Lee <[email protected]> Reviewed-by: Vinod Koul <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3bbbb77 commit 21fca8b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sound/soc/soc-pcm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,7 +2324,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
23242324
switch (cmd) {
23252325
case SNDRV_PCM_TRIGGER_START:
23262326
if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
2327-
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
2327+
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) &&
2328+
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
23282329
continue;
23292330

23302331
ret = dpcm_do_trigger(dpcm, be_substream, cmd);
@@ -2354,7 +2355,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
23542355
be->dpcm[stream].state = SND_SOC_DPCM_STATE_START;
23552356
break;
23562357
case SNDRV_PCM_TRIGGER_STOP:
2357-
if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
2358+
if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) &&
2359+
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
23582360
continue;
23592361

23602362
if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream))

0 commit comments

Comments
 (0)