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 <ranjani.sridharan@linux.intel.com>
This commit is contained in:
Ranjani Sridharan 2022-06-29 14:07:13 -07:00 committed by Liam Girdwood
parent 67daf2ecf5
commit f8bbef3357
1 changed files with 17 additions and 5 deletions

View File

@ -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);