Skip to content

ASoC: SOF: ipc4-topology: Pick the output pin format per path - #5961

Open
ujfalusi wants to merge 1 commit into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/ipc4-tplg-process-with-pins
Open

ujfalusi wants to merge 1 commit into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/ipc4-tplg-process-with-pins

Conversation

@ujfalusi

Copy link
Copy Markdown
Collaborator

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.

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>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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.

2 participants