module: copier: Rework module to use sink/source api - #11171
Open
softwarecki wants to merge 2 commits into
Open
Conversation
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>
softwarecki
requested review from
abonislawski,
piotrhoppeintel,
serhiy-katsyuba-intel,
tmleman and
wjablon1
September 4, 2026 15:30
Contributor
There was a problem hiding this comment.
🟡 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.cmodule processing to acceptstruct sof_source **/struct sof_sink **and bridges sink/source windows intocir_buf_*descriptors for PCM conversion. - Refactors IPC gateway copier data transfers to use sink/source APIs (
source_get_data()/sink_get_buffer()) and resets viaaudio_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.
|
|
||
| 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; |
PR 11171: test resultsRun date: 2026-09-04 16:24 UTC Tested commit: 4d0f757961f92b71fe0f412639fb6a58a2d4d1b7 |
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.
Rework the copier module to only use the sink/source api to prepare sof for the full transition to pipeline 2.0.