module: asrc: rework module to use only sink/source api - #11043
Open
softwarecki wants to merge 1 commit into
Open
module: asrc: rework module to use only sink/source api#11043softwarecki wants to merge 1 commit into
softwarecki wants to merge 1 commit into
Conversation
Rework the asrc module to only use the sink/source API to prepare the sof for the full transition to pipeline 2.0. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
softwarecki
requested review from
abonislawski,
Copilot,
piotrhoppeintel,
serhiy-katsyuba-intel,
tmleman and
wjablon1
July 28, 2026 16:07
softwarecki
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
July 28, 2026 16:07
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the ASRC module to operate exclusively through the sink/source API, aligning it with the project’s direction toward Pipeline 2.0 and away from direct audio_stream/buffer access patterns.
Changes:
- Switch ASRC processing callbacks and hot-path copy routines to use
cir_buf_source/cir_buf_sinkviews obtained viasource_get_data()andsink_get_buffer(). - Update parameter preparation to configure formats/rates through
sof_source/sof_sinkhelpers instead ofcomp_buffer/audio_stream. - Split buffer format updates into explicit source vs. sink update functions for IPC3/IPC4.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/audio/asrc/asrc.h | Updates ASRC processing function type and public helpers to use sink/source and circular-buffer views. |
| src/audio/asrc/asrc.c | Reworks prepare/process paths to acquire/commit data via sink/source APIs and removes direct stream pointer manipulation. |
| src/audio/asrc/asrc_ipc4.c | Routes IPC4 format updates through ipc4_update_source_format() / ipc4_update_sink_format(). |
| src/audio/asrc/asrc_ipc3.c | Updates IPC3 stubs to the new source/sink format-update function split. |
Comments suppressed due to low confidence (1)
src/audio/asrc/asrc_ipc3.c:66
- This function intentionally does nothing for IPC3, but the parameters are unused and may trigger -Wunused-parameter warnings depending on build flags. Mark them unused to keep builds warning-clean.
void asrc_update_sink_format(struct sof_sink *sink, struct comp_data *cd)
{
/* IPC3 don't need to update audio stream format here. */
}
| ret = asrc_params(mod); | ||
| /* SRC component will only ever have 1 source and 1 sink buffer */ | ||
| if (num_of_sources != 1 || num_of_sinks != 1) { | ||
| comp_err(dev, "no source or sink buffer"); |
Comment on lines
+58
to
+61
| void asrc_update_source_format(struct sof_source *source, struct comp_data *cd) | ||
| { | ||
| /* IPC3 don't need to update audio stream format here. */ | ||
| } |
lyakh
reviewed
Jul 29, 2026
| @@ -796,18 +764,32 @@ static int asrc_process(struct processing_module *mod, | |||
| } | |||
|
|
|||
| if (cd->source_frames && cd->sink_frames) { | |||
Collaborator
There was a problem hiding this comment.
can we use this occasion and invert this to if (!cd->source_frames || !cd->sink_frames) return 0;?
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 asrc module to only use the sink/source API to prepare the sof for the full transition to pipeline 2.0.