module: multiband_drc: rework module to use sink/source api#10813
Open
softwarecki wants to merge 1 commit into
Open
module: multiband_drc: rework module to use sink/source api#10813softwarecki wants to merge 1 commit into
softwarecki wants to merge 1 commit into
Conversation
Rework the multiband drc module 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>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the multiband_drc module to use the sink/source API exclusively, aligning it with the ongoing transition toward Pipeline 2.0.
Changes:
- Migrates Multiband DRC module processing from
audio_stream/buffer-position updates tosof_source/sof_sinkacquire+commit semantics. - Updates Multiband DRC processing function signatures to return status (
int) and propagate errors. - Adds small helper utilities for computing “samples until wrap” in circular buffers.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/include/module/audio/audio_stream.h |
Adds circular-buffer wrap helper inlines used by sink/source-based sample processing. |
src/audio/multiband_drc/multiband_drc.h |
Updates processing function typedefs/prototypes to use sink/source API and return int. |
src/audio/multiband_drc/multiband_drc.c |
Switches module interface to .process and routes processing through sink/source APIs. |
src/audio/multiband_drc/multiband_drc_generic.c |
Reworks passthrough + per-format processing to acquire/release source data and sink buffers via sink/source APIs. |
Comment on lines
301
to
308
| static int multiband_drc_process(struct processing_module *mod, | ||
| struct input_stream_buffer *input_buffers, int num_input_buffers, | ||
| struct output_stream_buffer *output_buffers, | ||
| int num_output_buffers) | ||
| struct sof_source **sources, int num_of_sources, | ||
| struct sof_sink **sinks, int num_of_sinks) | ||
| { | ||
| struct multiband_drc_comp_data *cd = module_get_private_data(mod); | ||
| struct comp_dev *dev = mod->dev; | ||
| struct audio_stream *source = input_buffers[0].data; | ||
| struct audio_stream *sink = output_buffers[0].data; | ||
| int frames = input_buffers[0].size; | ||
| int frames = source_get_data_frames_available(sources[0]); | ||
| int ret; |
Comment on lines
+77
to
+85
| /** | ||
| * @brief Calculates numbers of s16 samples to buffer wrap. | ||
| * @param ptr Read or write pointer of circular buffer. | ||
| * @param buf_start Start address of circular buffer. | ||
| * @return Number of samples to buffer wrap. | ||
| */ | ||
| static inline int cir_buf_samples_to_wrap_s16(const int16_t *ptr, const int16_t *buf_start, | ||
| int buf_samples) | ||
| { |
serhiy-katsyuba-intel
approved these changes
May 26, 2026
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 multiband drc module to only use the sink/source api to prepare sof for the full transition to pipeline 2.0.