P20 drc - convert the rc module to only use the sink/source api - #11001
P20 drc - convert the rc module to only use the sink/source api#11001piotrhoppeintel wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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_sinkand circular-buffer views (cir_buf_source/cir_buf_sink). - Refactor DRC kernels (generic + HiFi4) to operate on circular-buffer pointers rather than
audio_streamhelpers. - Add a new cmocka
drc_processunit 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. |
|
|
||
| cmocka_test(drc_process | ||
| drc_process.c | ||
| ) |
There was a problem hiding this comment.
Done. Test moved to the Ztest framework.
cd35aa4 to
1804c1e
Compare
|
All comments have been addressed. @lyakh please review. |
PR 11001: test resultsRun date: 2026-09-03 13:03 UTC Tested commit: 2633f8f06e25714a1f9d5566718cf3697c6db6f1 |
1804c1e to
b70c5db
Compare
| } | ||
|
|
||
| if (!td->params.passthrough && output != expected) | ||
| td->diff_count++; |
There was a problem hiding this comment.
is this verifying, that since the input chirp was neither too quiet nor too loud it should pass unchanged?
There was a problem hiding this comment.
Not exactly. It has two meanings. With active DRC, a change is expected, while in pass-through mode, any change means a failure.
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.
b70c5db to
2633f8f
Compare
Convert the DRC module from the legacy audio_stream processing API
to the modern sof_source/sof_sink API.