Skip to content

module: multiband_drc: rework module to use sink/source api#10813

Open
softwarecki wants to merge 1 commit into
thesofproject:mainfrom
softwarecki:p20-multiband
Open

module: multiband_drc: rework module to use sink/source api#10813
softwarecki wants to merge 1 commit into
thesofproject:mainfrom
softwarecki:p20-multiband

Conversation

@softwarecki
Copy link
Copy Markdown
Collaborator

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

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to sof_source/sof_sink acquire+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)
{
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