module: copier: Rework module to use sink/source api - #11171
softwarecki wants to merge 2 commits into
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>
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)); |
| ret = source_copy_bytes_to_linear(source, out->payload, data_size); | ||
| if (ret) | ||
| return ret; | ||
| out->u.size_avail = source_get_data_available(source); |
| 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 |
lgirdwood
left a comment
There was a problem hiding this comment.
@softwarecki LGTM, can you resolve the copilot comments and think we are good to go !
Rework the copier module to only use the sink/source api to prepare sof for the full transition to pipeline 2.0.