From f8bbef335749390fd661145853c5e13099c44a9e Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Wed, 29 Jun 2022 14:07:13 -0700 Subject: [PATCH] pipeline-schedule: clear aborted flag for non-host connected pipelines Consider the mixer-based pipeline in the nocodec topologies: PCM0 (pipeline 11) ---> Volume -----| V Mixer (Pipeline 1)----> SSP0 ^ PCM3 (pipeline 7) ---> Volume -----| When PCM0 is started it triggers pipelines 7 and 1. When PCM3 is started followed by PCM0, it will trigger pipelines 11 and 1. But since pipeline 1 is already is started, it's aborted flag will be set. But the aborted flag is never cleared for pipeline 1 because it is not the host pipeline. Fix this, by clearing the aborted flag for non-host pipelines in pipeline_task_cmd() Signed-off-by: Ranjani Sridharan --- src/audio/pipeline/pipeline-schedule.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/audio/pipeline/pipeline-schedule.c b/src/audio/pipeline/pipeline-schedule.c index bbd30917c..f352423b4 100644 --- a/src/audio/pipeline/pipeline-schedule.c +++ b/src/audio/pipeline/pipeline-schedule.c @@ -46,21 +46,33 @@ static enum task_state pipeline_task_cmd(struct pipeline *p, int err, cmd = p->trigger.cmd; if (!p->trigger.host) { + int ret; + p->trigger.cmd = COMP_TRIGGER_NO_ACTION; switch (cmd) { case COMP_TRIGGER_STOP: case COMP_TRIGGER_PAUSE: - return p->trigger.aborted ? SOF_TASK_STATE_RUNNING : - SOF_TASK_STATE_COMPLETED; + if (p->trigger.aborted) + ret = SOF_TASK_STATE_RUNNING; + else + ret = SOF_TASK_STATE_COMPLETED; + break; case COMP_TRIGGER_PRE_START: case COMP_TRIGGER_PRE_RELEASE: - if (p->status == COMP_STATE_ACTIVE) - return SOF_TASK_STATE_RUNNING; + if (p->status == COMP_STATE_ACTIVE) { + ret = SOF_TASK_STATE_RUNNING; + break; + } p->status = COMP_STATE_ACTIVE; + COMPILER_FALLTHROUGH; + default: + ret = SOF_TASK_STATE_RESCHEDULE; + break; } - return SOF_TASK_STATE_RESCHEDULE; + p->trigger.aborted = false; + return ret; } err = pipeline_trigger_run(p, p->trigger.host, cmd);