@@ -1095,7 +1095,10 @@ int avs_path_run(struct avs_path *path, int trigger)
}
}
- path->state = AVS_PATH_STATE_RUNNING;
+ if (trigger == AVS_TPLG_TRIGGER_AUTO)
+ path->state = AVS_PATH_STATE_RUNNING;
+ else if (trigger == AVS_TPLG_TRIGGER_DETECT)
+ path->state = AVS_PATH_STATE_DETECTING;
return 0;
}
@@ -185,8 +185,14 @@ static int avs_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_d
}
ret = avs_path_pause(data->path);
- if (ret < 0)
+ if (ret < 0) {
dev_err(dai->dev, "pause path failed: %d\n", ret);
+ return ret;
+ }
+
+ ret = avs_path_run(data->path, AVS_TPLG_TRIGGER_DETECT);
+ if (ret < 0)
+ dev_err(dai->dev, "run path failed: %d\n", ret);
return ret;
}
@@ -112,6 +112,7 @@ struct avs_tplg_modcfg_ext {
/* Specifies path behaviour during PCM ->trigger(START) command. */
enum avs_tplg_trigger {
AVS_TPLG_TRIGGER_AUTO = 0,
+ AVS_TPLG_TRIGGER_DETECT = 1,
};
struct avs_tplg_pplcfg {
Setup and run detecting paths during snd_pcm_prepare() call, so they can wait for event to start drain pipelines. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> --- sound/soc/intel/avs/path.c | 5 ++++- sound/soc/intel/avs/pcm.c | 8 +++++++- sound/soc/intel/avs/topology.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-)