Conversation
A process module with several output pins can be shared by paths of different PCMs, each using a different pin, e.g. an ECNS module with a mono pin 0 feeding a keyword buffer and a stereo pin 1 feeding a host copier. The output format is chosen per path from the FE params when the widget is first prepared, but it is only stored in process->output_format, and only propagated to the downstream widgets, when it belongs to pin 0. When a second PCM walks the already prepared widget, the prepared shortcut propagates process->output_format. If the first PCM used pin 1, that format was never set and hw_params fails: invalid PCM valid_bits 0 failed to prepare widget ecns.115.1 Even when it was set, it is the pin 0 format regardless of the pin the current path uses. Move the output format lookup to sof_ipc4_process_output_fmt() and use it for already prepared widgets too, based on the input format already selected for the module. The lookup writes to a scratch copy of the base config, as the module has been instantiated already. Update the pipeline params from the selected pin format for every pin index, not only for pin 0. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
ujfalusi
requested review from
bardliao,
dbaluta,
kv2019i,
lgirdwood,
plbossart and
ranj063
as code owners
September 30, 2026 10:23
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused refactor fixes per-pin propagation while preserving instantiated module configuration.
Review effort: Balanced
Findings: None
What changed in this PR
Selects the correct SOF IPC4 process output format for each PCM path, including already-prepared shared modules.
Changes:
- Extracts per-path output-format selection into a helper.
- Recomputes the selected format for prepared widgets.
- Propagates formats from every output pin.
| File | Description |
|---|---|
sound/soc/sof/ipc4-topology.c |
Corrects process output-format selection and propagation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
A process module with several output pins can be shared by paths of different PCMs, each using a different pin, e.g. an ECNS module with a mono pin 0 feeding a keyword buffer and a stereo pin 1 feeding a host copier. The output format is chosen per path from the FE params when the widget is first prepared, but it is only stored in process->output_format, and only propagated to the downstream widgets, when it belongs to pin 0.
When a second PCM walks the already prepared widget, the prepared shortcut propagates process->output_format. If the first PCM used pin 1, that format was never set and hw_params fails:
invalid PCM valid_bits 0
failed to prepare widget ecns.115.1
Even when it was set, it is the pin 0 format regardless of the pin the current path uses.
Move the output format lookup to sof_ipc4_process_output_fmt() and use it for already prepared widgets too, based on the input format already selected for the module. The lookup writes to a scratch copy of the base config, as the module has been instantiated already. Update the pipeline params from the selected pin format for every pin index, not only for pin 0.