Skip to content

P20 crossover - convert the crossover module to only use the sink/source api - #10999

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

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

Conversation

@piotrhoppeintel

Copy link
Copy Markdown
Contributor

Rework the crossover module to only use the sink/source api to
prepare the SOF for the full transition to pipeline 2.0.

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

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

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/sink circular-buffer processing in crossover_generic.c for s16/s24/s32 formats plus passthrough copy via source_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.

Comment thread src/audio/crossover/crossover_generic.c Outdated
Comment thread src/audio/crossover/crossover_generic.c Outdated
Comment thread src/audio/crossover/crossover_generic.c
endif()
if(CONFIG_COMP_CROSSOVER)
add_subdirectory(crossover)
endif()

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.

we've had a few PRs recently moving from over cmocka to Zephyr native tasting. Shouldn't this be done as a ztest too?

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. Tests moved to the Ztest framework.

@abonislawski

Copy link
Copy Markdown
Member

Please fix PR and commit title

btw: #10110

@piotrhoppeintel piotrhoppeintel changed the title P20 crossover P20 crossover - convert the crossover module to only use the sink/source api Aug 11, 2026
@piotrhoppeintel
piotrhoppeintel force-pushed the p20-crossover branch 2 times, most recently from 11d81d9 to 9fc9a6b Compare September 2, 2026 10:24
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>
@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 10999: test results

Run date: 2026-09-02 12:07 UTC

Tested commit: 9fc9a6bcdb7acf8526108ad8e14e5a069983d679

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.

5 participants