P20 crossover - convert the crossover module to only use the sink/source api - #10999
P20 crossover - convert the crossover module to only use the sink/source api#10999piotrhoppeintel wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Reworks the Crossover component’s processing path to use the SOF sof_source / sof_sink APIs (instead of stream buffers) as preparation for the pipeline 2.0 transition, and adds dedicated CMocka unit tests for LR4 filter behavior and split topology routing.
Changes:
- Switch crossover processing entrypoint and processing function pointers to
source/sink-based APIs. - Implement
source/sinkcircular-buffer processing incrossover_generic.cfor s16/s24/s32 formats plus passthrough copy viasource_to_sink_copy(). - Add CMocka unit tests and build integration for LR4 filter properties and 2/3/4-way split topology functions.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/cmocka/src/audio/crossover/crossover_test_mocks.c | Adds link-time stubs for source/sink APIs needed by unit tests that compile crossover_generic.c. |
| test/cmocka/src/audio/crossover/crossover_split_test.c | Adds split topology unit tests validating routing/energy behavior for 2/3/4-way splits. |
| test/cmocka/src/audio/crossover/crossover_lr4_test.c | Adds LR4 filter property tests (DC/HF behavior, split symmetry at fc, selectivity, denominator consistency). |
| test/cmocka/src/audio/crossover/CMakeLists.txt | Adds CMocka targets for crossover LR4 and split tests, wiring required sources. |
| test/cmocka/src/audio/CMakeLists.txt | Enables the new crossover test subdirectory behind CONFIG_COMP_CROSSOVER. |
| src/audio/crossover/crossover.h | Updates processing function typedefs to return int and take sof_source/sof_sink handles. |
| src/audio/crossover/crossover.c | Converts module .process implementation to source/sink APIs and updates sink assignment logic accordingly. |
| src/audio/crossover/crossover_generic.c | Reworks per-format processing/passthrough to use source/sink APIs and circular buffer helpers. |
| src/arch/xtensa/configs/unit_test_defconfig | Enables crossover component config for unit-test builds. |
| endif() | ||
| if(CONFIG_COMP_CROSSOVER) | ||
| add_subdirectory(crossover) | ||
| endif() |
There was a problem hiding this comment.
we've had a few PRs recently moving from over cmocka to Zephyr native tasting. Shouldn't this be done as a ztest too?
There was a problem hiding this comment.
Done. Tests moved to the Ztest framework.
|
Please fix PR and commit title btw: #10110 |
11d81d9 to
9fc9a6b
Compare
Add seven LR4 filter tests and ten split topology tests as dedicated Ztest suites running on native_sim. Add the Twister test package and shared crossover mocks. Signed-off-by: Piotr Hoppe <piotr.hoppe@intel.com>
Rework the crossover module to only use the sink/source api to prepare the SOF for the full transition to pipeline 2.0. Signed-off-by: Piotr Hoppe <piotr.hoppe@intel.com>
9fc9a6b to
2915070
Compare
|
All comments have been addressed. @lyakh please review. |
PR 10999: test resultsRun date: 2026-09-02 12:07 UTC Tested commit: 9fc9a6bcdb7acf8526108ad8e14e5a069983d679 |
Rework the crossover module to only use the sink/source api to
prepare the SOF for the full transition to pipeline 2.0.