P20 eq fir convert the eq_fir module to only use the sink/source api - #11221
Open
piotrhoppeintel wants to merge 2 commits into
Open
piotrhoppeintel wants to merge 2 commits into
piotrhoppeintel wants to merge 2 commits into
Conversation
Replace legacy input/output buffer processing with the source/sink API. Handle circular-buffer wrapping in FIR kernels and use direct source-to-sink copy for pass-through operation. Validate matching source and sink formats and add tests for invalid configurations and odd frame counts. Signed-off-by: Piotr Hoppe <piotr.hoppe@intel.com>
Replace abbreviated local variable names with descriptive names across the generic, HiFi2EP, and HiFi3 EQ FIR implementations. Clarify channel, sample, pointer, filter, and stride handling without changing processing behavior. Signed-off-by: Piotr Hoppe <piotr.hoppe@intel.com>
piotrhoppeintel
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1,
plbossart and
singalsu
as code owners
September 22, 2026 09:17
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
eq_fir_process() returns -ENOSPC for fatal buffer-capacity mismatches, which can be silently treated as non-fatal by module_process_sink_src(), masking real errors and risking stalled processing.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Converts the eq_fir audio module (and its cmocka coverage) from legacy audio_stream buffer handling to the sink/source API, aligning it with the pipeline 2.0 direction.
Changes:
- Switch
eq_firprocessing entrypoint tomodule_interface.process()and implement processing usingsof_source/sof_sinkacquire/commit APIs. - Update FIR inner-loop implementations (generic + HiFi variants) to operate on
cir_buf_source/cir_buf_sinkviews. - Extend cmocka tests to prepare/process via sink/source APIs and add negative/config/alignment-related test cases.
| File | Description |
|---|---|
| test/cmocka/src/audio/eq_fir/eq_fir_process.c | Updates unit tests to use sink/source prepare + processing, and adds new validation/alignment tests. |
| src/audio/eq_fir/eq_fir.h | Updates FIR function signatures to take circular buffer views and explicit channel count. |
| src/audio/eq_fir/eq_fir.c | Reworks module processing + prepare to use sink/source APIs and passthrough via source_to_sink_copy(). |
| src/audio/eq_fir/eq_fir_hifi3.c | Adapts HiFi3 optimized FIR processing to circular buffer view API. |
| src/audio/eq_fir/eq_fir_hifi2ep.c | Adapts HiFi2EP optimized FIR processing to circular buffer view API. |
| src/audio/eq_fir/eq_fir_generic.c | Adapts generic FIR processing to circular buffer view API. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+437
to
+440
| if (buffer_size < source_bytes) { | ||
| source_release_data(source, 0); | ||
| return -ENOSPC; | ||
| } |
Comment on lines
365
to
+368
| /* copy and process stream data from source to sink buffers */ | ||
| static int eq_fir_process(struct processing_module *mod, | ||
| struct input_stream_buffer *input_buffers, | ||
| int num_input_buffers, | ||
| struct output_stream_buffer *output_buffers, | ||
| int num_output_buffers) | ||
| struct sof_source **sources, int num_of_sources, | ||
| struct sof_sink **sinks, int num_of_sinks) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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