@@ -1102,3 +1102,8 @@ int avs_path_run(struct avs_path *path, int trigger)
return 0;
}
+
+bool avs_path_is_detecting(struct avs_path *path)
+{
+ return (path->state == AVS_PATH_STATE_DETECTING);
+}
@@ -76,5 +76,6 @@ int avs_path_unbind(struct avs_path *path);
int avs_path_reset(struct avs_path *path);
int avs_path_pause(struct avs_path *path);
int avs_path_run(struct avs_path *path, int trigger);
+bool avs_path_is_detecting(struct avs_path *path);
#endif
@@ -178,6 +178,14 @@ static int avs_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_d
if (!data->path)
return 0;
+ if (avs_path_is_detecting(data->path)) {
+ ret = avs_path_pause(data->path);
+ if (ret < 0) {
+ dev_err(dai->dev, "pause path failed: %d\n", ret);
+ return ret;
+ }
+ }
+
ret = avs_path_reset(data->path);
if (ret < 0) {
dev_err(dai->dev, "reset path failed: %d\n", ret);
FW pipeline machine state follows specific order, so running path needs to be paused before it can reset pipelines. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> --- sound/soc/intel/avs/path.c | 5 +++++ sound/soc/intel/avs/path.h | 1 + sound/soc/intel/avs/pcm.c | 8 ++++++++ 3 files changed, 14 insertions(+)