Skip to content

ipc3: module: cadence: rework module to use sink/source api - #11289

Open
softwarecki wants to merge 2 commits into
thesofproject:mainfrom
softwarecki:p20-cadence
Open

softwarecki wants to merge 2 commits into
thesofproject:mainfrom
softwarecki:p20-cadence

Conversation

@softwarecki

@softwarecki softwarecki commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Rework the cadence ipc3 module variant to only use the sink/source api to prepare sof for the full transition to pipeline 2.0.

Add sink_set_size() and source_set_size() backed by a new optional set_size op in struct sink_ops / source_ops, allowing a module to grow the buffer behind a sink or source after allocation.

@dbaluta: please review. I dropped cadence_codec_deep_buff_allowed() and the mod->deep_buff_bytes. It fed silence to the DAI until the decoder produced its first frame. The sink/source path has no such startup zero-fill. Is it safe to drop them, or do we need to keep that behaviour?

Add sink_set_size() and source_set_size() backed by a new optional
set_size op in struct sink_ops / source_ops, allowing a module to grow
the buffer behind a sink or source after allocation.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Rework the cadence ipc3 module variant to only use the sink/source api to
prepare sof for the full transition to pipeline 2.0.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Startup underruns, unsafe output-space handling, unintended shrinking, and incomplete failure cleanup must be addressed.

1 open finding
What changed in this PR

Reworks the Cadence IPC3 codec to use sink/source APIs and introduces buffer-resizing support.

Changes:

  • Adds optional sink/source resize operations.
  • Implements resizing for component buffers.
  • Migrates Cadence IPC3 processing from raw buffers to sink/source APIs.
File Description
src/​module/​audio/​source_api.c Adds source resize dispatch.
src/​module/​audio/​sink_api.c Adds sink resize dispatch.
src/​include/​module/​audio/​source_api.h Defines the source resize API.
src/​include/​module/​audio/​sink_api.h Defines the sink resize API.
src/​audio/​module_adapter/​module/​cadence_ipc3.c Migrates Cadence IPC3 processing.
src/​audio/​buffers/​comp_buffer.c Implements component-buffer resizing callbacks.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

}

/* grow the sink so a whole decoded frame fits */
ret = sink_set_size(sinks[0], 2 * codec->mpd.out_buff_size);
@intel-sofci

intel-sofci commented Oct 9, 2026 •

Copy link
Copy Markdown

PR 11289: test results

Run date: 2026-10-09 19:32 UTC

Tested commit: 6421b53df3bb04a0a144918e295f76b0b1c2c8d2

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

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