ASoC: SOF: ipc4: Fix pipeline state transitions for aggregate DAIs#5765
Open
ujfalusi wants to merge 1 commit intothesofproject:topic/sof-devfrom
Open
ASoC: SOF: ipc4: Fix pipeline state transitions for aggregate DAIs#5765ujfalusi wants to merge 1 commit intothesofproject:topic/sof-devfrom
ujfalusi wants to merge 1 commit intothesofproject:topic/sof-devfrom
Conversation
For aggregate DAIs (num_cpus > 1) the pre_trigger/post_trigger callbacks send pipeline state IPCs per-DAI without considering that multiple DAIs may share the same pipeline. This causes premature state transitions where the pipeline goes RUNNING before all link DMAs have started, or individual DAIs send redundant IPCs for shared pipelines. Add a per-pipeline trigger_count to gate state transitions: - START/PAUSE_RELEASE: defer RUNNING IPC until all DAIs sharing the same pipeline have completed their link DMA operations - STOP/SUSPEND/PAUSE_PUSH: use pipeline state dedup so the PAUSED IPC is sent once regardless of how many DAIs share the pipeline The per-spipe DAI count is computed dynamically to handle all aggregate topologies: shared pipelines, independent pipelines, and mixed cases. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes IPC4 pipeline state transitions for aggregate back-end links (num_cpus > 1) where multiple CPU DAIs may share the same SOF pipeline, which can currently cause premature RUNNING transitions and redundant PAUSED IPCs.
Changes:
- Add a per-pipeline
trigger_countto gate START/PAUSE_RELEASE so RUNNING is sent only after all DAIs sharing a pipeline have completed link DMA triggering. - Deduplicate STOP/SUSPEND/PAUSE_PUSH PAUSED IPCs for shared pipelines by checking the current pipeline state.
- Compute the “DAIs-per-pipeline” threshold dynamically per BE link to support shared/independent/mixed aggregate topologies.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sound/soc/sof/sof-audio.h | Adds trigger_count to struct snd_sof_pipeline to track aggregate trigger completion per pipeline. |
| sound/soc/sof/intel/hda-dai-ops.c | Adds per-pipeline DAI counting and uses trigger_count to gate RUNNING/PAUSED IPC transitions for aggregate DAIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!w) | ||
| continue; | ||
|
|
||
| sw = w->dobj.private; |
Comment on lines
+443
to
+449
| int spipe_dais = hda_ipc4_count_spipe_dais(substream, | ||
| swidget->spipe); | ||
|
|
||
| swidget->spipe->trigger_count++; | ||
| swidget->spipe->started_count++; | ||
| if (swidget->spipe->trigger_count < spipe_dais) | ||
| break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For aggregate DAIs (num_cpus > 1) the pre_trigger/post_trigger callbacks send pipeline state IPCs per-DAI without considering that multiple DAIs may share the same pipeline. This causes premature state transitions where the pipeline goes RUNNING before all link DMAs have started, or individual DAIs send redundant IPCs for shared pipelines.
Add a per-pipeline trigger_count to gate state transitions:
The per-spipe DAI count is computed dynamically to handle all aggregate topologies: shared pipelines, independent pipelines, and mixed cases.