ASoC: dsp: Always call trigger start when back end is started
This problem is found when doing device switch. DSP framework
has this optimization not to start back-end if front-ends that
are connected to it are not active. This behavior results in
audio mute because framewokr does not really track status of
front-ends. Change the behavior to always start the back end
whenever routing command comes.
CRs-Fixed: 294431
Signed-off-by: Patrick Lai <plai@codeaurora.org>
diff --git a/sound/soc/soc-dsp.c b/sound/soc/soc-dsp.c
index b67625f..30dc9b7 100644
--- a/sound/soc/soc-dsp.c
+++ b/sound/soc/soc-dsp.c
@@ -954,25 +954,6 @@
return 0;
}
-/* check for running FEs */
-static int dsp_get_be_trigger_cmd(struct snd_soc_pcm_runtime *fe, int stream)
-{
- struct snd_soc_dsp_params *dsp_be_params, *dsp_fe_params;
-
- /* get the FEs for each BE */
- list_for_each_entry(dsp_be_params, &fe->dsp[stream].be_clients, list_be) {
- struct snd_soc_pcm_runtime *be = dsp_be_params->be;
-
- /* get the FEs for this BE */
- list_for_each_entry(dsp_fe_params, &be->dsp[stream].fe_clients, list_fe) {
-
- if (dsp_fe_params->state == SND_SOC_DSP_LINK_STATE_START)
- return SND_SOC_DSP_LINK_STATE_START;
- }
- }
- return SND_SOC_DSP_LINK_STATE_PAUSED;
-}
-
/* check for running BEs */
static int dsp_get_fe_trigger_cmd(struct snd_soc_pcm_runtime *fe, int stream)
{
@@ -1058,17 +1039,11 @@
} else {
list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) {
-
- /* there is no point in triggering start iff all FEs are PAUSED */
- cmd = dsp_get_be_trigger_cmd(fe, stream);
-
- dev_dbg(&fe->dev, "dsp: trigger FE %s cmd start\n",
- fe->dai_link->name);
-
- ret = soc_dsp_be_dai_trigger(fe, stream, cmd);
+ ret = soc_dsp_be_dai_trigger(fe, stream,
+ SNDRV_PCM_TRIGGER_START);
if (ret < 0)
return ret;
- }
+ }
}
return 0;