ASoC: soc-pcm: improve BE transition for TRIGGER_START
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 6 Apr 2022 19:00:56 +0000 (14:00 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 19 Apr 2022 15:33:52 +0000 (16:33 +0100)
When the BE was in PAUSED state, the correct trigger is PAUSE_RELEASE.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220406190056.233481-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-pcm.c

index e8700dd..6f43db3 100644 (file)
@@ -2122,6 +2122,13 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
                        if (be->dpcm[stream].be_start != 1)
                                goto next;
 
+                       if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_PAUSED)
+                               ret = soc_pcm_trigger(be_substream,
+                                                     SNDRV_PCM_TRIGGER_PAUSE_RELEASE);
+                       else
+                               ret = soc_pcm_trigger(be_substream,
+                                                     SNDRV_PCM_TRIGGER_START);
+
                        ret = soc_pcm_trigger(be_substream, cmd);
                        if (ret) {
                                be->dpcm[stream].be_start--;