Skip to content

STOP and PAUSE in pipeline task context - #4960

Merged
lgirdwood merged 7 commits into
thesofproject:mainfrom
lyakh:stop
Nov 12, 2021
Merged

lgirdwood merged 7 commits into
thesofproject:mainfrom
lyakh:stop

Conversation

@lyakh

@lyakh lyakh commented Nov 4, 2021

Copy link
Copy Markdown
Collaborator

Resurrecting the reverted #4724 - hopefully no regressions this time. Tested with an addition of 7141762 to pass multiple pipeline and multiple pause-resume on CNL with a multicore HDA topology.

@lyakh

lyakh commented Nov 4, 2021

Copy link
Copy Markdown
Collaborator Author

@keyonjie

keyonjie commented Nov 5, 2021

Copy link
Copy Markdown
Contributor

Looks this doesn't fix the multi-core xrun issues according to test plan result 7973, but good news is that looks there is no significant regression with it.

I will need some explain about how the start/stop in the pipeline task context work, especially for cases that there are pipeline list connected with this kind of triggering. Will check detail next week.

@keyonjie

keyonjie commented Nov 8, 2021 •

Copy link
Copy Markdown
Contributor

Hi @lyakh do you have clear logic or documentation to demonstrate of how the trigger start/stop sequence looks like with your design, e.g. for below 0,0 and 0,3 PCM devices:
image

We have 3 pipelines and 2 PCM devices here, when the trigger start/stop of PCM 0,0 and 0,3 IPCs came from the Linux host side, how those pipelines 1, 7, 11 are started/stopped?

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not following some parts.

Comment thread src/audio/pipeline/pipeline-stream.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks wrong.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgirdwood sorry, could you explain? I don't see what's wrong with this - if one of components returns PATH_STOP we abort trigger processing?

Comment thread src/include/sof/audio/pipeline.h Outdated
Comment thread src/schedule/ll_schedule.c Outdated
Comment thread src/audio/pipeline/pipeline-schedule.c Outdated
Currently -EINVAL is used to indicate an invalid trigger code,
requiring no handling. Use an explicit new COMP_TRIGGER_NO_ACTION
value for that for better clarity.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
struct ll_schedule_domain::registered[] is only used inside
ll_schedule_domain.h and only to update itself, it's exclusively
self-serving. Remove it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently there are two ways to stop scheduling an LL task: by
cancelling it from outside and by returning SOF_TASK_STATE_COMPLETED
from the task .run() function. In both cases the task will stop being
rescheduled, but in the latter case it will stay on the list of the
tasks, waiting to be cancelled. This means that even for those tasks
schedule_task_cancel() still has to be called. This is however
inconvenient because in some cases there is no suitable context to
cancel that task from. E.g. this will be the case with pipeline tasks
when we switch them over to handling STOP and PAUSE commands from the
task itself.

This patch restores the original behaviour when tasks are removed
from the list after completion, without waiting for cancellation.
For this we extend the calling convention of domain_unregister() to
be used with the task parameter equal to NULL when freeing the
scheduler. DMA domains preserve their current behaviour: they ignore
calls with task == NULL. The timer domain however now uses this call
to release the timer interrupt.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
A recent commit moved START and RESUME trigger processing to the
pipeline task for timer domain pipelines. This patch does the same
for STOP and PAUSE.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Improve readability by moving a block of code into a function.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Fix trace messages after moving them into different functions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Move a static function closer to where it is used.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@lyakh

lyakh commented Nov 11, 2021

Copy link
Copy Markdown
Collaborator Author

CI: a single suspend-resume device test https://sof-ci.01.org/sofpr/PR4960/build11067/devicetest/?model=CML_RVP_SDW&testcase=check-suspend-resume-with-playback-5 failed with a timeout, QB seems to have a problem with their ICL device - same failure as in #4983

@lgirdwood
lgirdwood merged commit c5bb947 into thesofproject:main Nov 12, 2021
@lyakh
lyakh deleted the stop branch November 12, 2021 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants