Skip to content

P20 crossover#10999

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

P20 crossover#10999
piotrhoppeintel wants to merge 3 commits into
thesofproject:mainfrom
piotrhoppeintel:p20-crossover

Conversation

@piotrhoppeintel

Copy link
Copy Markdown

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

Add a cmocka-based unit test suite for the crossover audio component.
The tests target portable C code only and do not require the full SOF
component stack.

crossover_lr4_test (7 tests):
crossover_split_test (10 tests):


Enable CONFIG_COMP_CROSSOVER and CONFIG_MATH_IIR_DF2T in
unit_test_defconfig to include the new targets in the build.

Signed-off-by: Piotr Hoppe <piotr.hoppe@intel.com>
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>
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 on lines +156 to +160
ret = sink_get_buffer_s16(sinks[j], bytes, &y[active_sinks],
&y_start[active_sinks], &y_samples);
if (ret)
return ret;
y_end[active_sinks] = y_start[active_sinks] + y_samples;
Comment on lines +229 to +233
ret = sink_get_buffer_s32(sinks[j], bytes, &y[active_sinks],
&y_start[active_sinks], &y_samples);
if (ret)
return ret;
y_end[active_sinks] = y_start[active_sinks] + y_samples;
Comment on lines +317 to +321
ret = sink_get_buffer_s32(sinks[j], bytes, &y[active_sinks],
&y_start[active_sinks], &y_samples);
if (ret)
return ret;
y_end[active_sinks] = y_start[active_sinks] + y_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.

2 participants