Skip to content

module: copier: Rework module to use sink/source api - #11171

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

module: copier: Rework module to use sink/source api#11171
softwarecki wants to merge 2 commits into
thesofproject:mainfrom
softwarecki:p20-copier

Conversation

@softwarecki

Copy link
Copy Markdown
Collaborator

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

Migrate the copier from the legacy audio stream buffers to the sink/source
streaming API to prepare sof for the full transition to pipeline 2.0.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Rework the IPC gateway copier to use the sink/source API instead of
directly accessing struct comp_buffer and its audio_stream. Data copy
helpers now return an error code and roll back the committed/released
byte count on failure, and endpoints are taken from the module's
sources/sinks arrays instead of walking the buffer lists.

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

The new multi-sink copier path can advance the source by an amount inconsistent with per-sink processing, and IPC gateway paths may now fail IPCs spuriously due to -EBUSY instead of tolerating temporary unavailability.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR reworks the copier module to use the sink/source API (instead of legacy audio_stream buffer access) as part of preparing for the pipeline 2.0 transition.

Changes:

  • Updates copier.c module processing to accept struct sof_source ** / struct sof_sink ** and bridges sink/source windows into cir_buf_* descriptors for PCM conversion.
  • Refactors IPC gateway copier data transfers to use sink/source APIs (source_get_data() / sink_get_buffer()) and resets via audio_buffer_reset().
File summaries
File Description
src/audio/copier/copier.c Switches module copier processing over to sink/source APIs and updates module interface entry point.
src/audio/copier/copier_ipcgtw.c Migrates IPC gateway data copy/reset paths to sink/source APIs and audio_buffer reset helpers.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

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

Comment thread src/audio/copier/copier.c

input_buffers[0].consumed = processed_data.source_bytes;
/* consume the data read by the converter from the source */
source_release_data(source, frames * source_get_frame_bytes(source));
Comment on lines +162 to +165
ret = source_copy_bytes_to_linear(source, out->payload, data_size);
if (ret)
return ret;
out->u.size_avail = source_get_data_available(source);
Comment on lines +182 to +184
ret = sink_copy_bytes_from_linear(in->payload, sink, data_size);
if (ret)
return ret;
@intel-sofci

intel-sofci commented Sep 4, 2026

Copy link
Copy Markdown

PR 11171: test results

Run date: 2026-09-04 16:24 UTC

Tested commit: 4d0f757961f92b71fe0f412639fb6a58a2d4d1b7

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