Skip to content

P20 drc - convert the rc module to only use the sink/source api - #11001

Open
piotrhoppeintel wants to merge 2 commits into
thesofproject:mainfrom
piotrhoppeintel:p20-drc
Open

P20 drc - convert the rc module to only use the sink/source api#11001
piotrhoppeintel wants to merge 2 commits into
thesofproject:mainfrom
piotrhoppeintel:p20-drc

Conversation

@piotrhoppeintel

Copy link
Copy Markdown
Contributor

Convert the DRC module from the legacy audio_stream processing API
to the modern sof_source/sof_sink API.

Copilot AI review requested due to automatic review settings July 15, 2026 07:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Converts the DRC module processing path from the legacy audio_stream buffer API to the sof_source/sof_sink API, and adds a dedicated cmocka process-level test to validate the new data flow.

Changes:

  • Update DRC processing entrypoint to use sof_source/sof_sink and circular-buffer views (cir_buf_source/cir_buf_sink).
  • Refactor DRC kernels (generic + HiFi4) to operate on circular-buffer pointers rather than audio_stream helpers.
  • Add a new cmocka drc_process unit test and embed coefficient blobs for enabled / passthrough modes.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/cmocka/src/audio/drc/drc_process.c New cmocka test that instantiates the module adapter and directly exercises cd->drc_func() with circular-buffer views.
test/cmocka/src/audio/drc/cmocka_drc_coef.h Adds generated DRC configuration blobs used by the new process test.
test/cmocka/src/audio/drc/CMakeLists.txt Adds the drc_process test target and a small static audio_for_drc library to satisfy module dependencies.
src/audio/drc/drc_hifi4.c Updates passthrough + delay/processing routines to use cir_buf_* sources/sinks and wrapping.
src/audio/drc/drc_generic.c Same as above for the generic implementation; adds memcpy_s include usage.
src/audio/drc/drc.h Updates public DRC function signature to cir_buf_source/cir_buf_sink and stores channel count in drc_comp_data.
src/audio/drc/drc.c Switches module interface to .process and implements source/sink acquire/commit flow.

Comment thread test/cmocka/src/audio/drc/drc_process.c Outdated
Comment thread test/cmocka/src/audio/drc/drc_process.c Outdated
Comment thread test/cmocka/src/audio/drc/CMakeLists.txt Outdated
Comment thread src/audio/drc/drc_generic.c
Comment thread src/audio/drc/drc_hifi4.c
Comment thread src/audio/drc/drc.c Outdated

cmocka_test(drc_process
drc_process.c
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same: ztest?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Test moved to the Ztest framework.

@piotrhoppeintel piotrhoppeintel changed the title P20 drc P20 drc - convert the rc module to only use the sink/source api Sep 2, 2026
Add native_sim Ztest coverage for two-channel DRC processing.
Cover S16, S24, and S32 pass-through and enabled configurations
through component creation, configuration, preparation, and processing.

Add the minimal SOF allocator and context support required by the
standalone test application while keeping existing CMocka tests and
production sources unchanged.

Signed-off-by: Piotr Hoppe <piotr.hoppe@intel.com>
Convert the DRC module from the legacy audio_stream processing API
to the modern sof_source/sof_sink API.
@piotrhoppeintel

Copy link
Copy Markdown
Contributor Author

All comments have been addressed. @lyakh please review.

@intel-sofci

intel-sofci commented Sep 2, 2026

Copy link
Copy Markdown

PR 11001: test results

Run date: 2026-09-02 14:03 UTC

Tested commit: 1804c1e18e34c73771cc8bb4129e9ca07e002b84

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

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.

4 participants