Skip to content

P20 eq fir convert the eq_fir module to only use the sink/source api - #11221

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

piotrhoppeintel wants to merge 2 commits into
thesofproject:mainfrom
piotrhoppeintel:p20-eq-fir

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.

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>

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.

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 High severity · 1 Low severity

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_fir processing entrypoint to module_interface.process() and implement processing using sof_source/sof_sink acquire/commit APIs.
  • Update FIR inner-loop implementations (generic + HiFi variants) to operate on cir_buf_source/cir_buf_sink views.
  • 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 thread src/audio/eq_fir/eq_fir.c
Comment on lines +437 to +440
if (buffer_size < source_bytes) {
source_release_data(source, 0);
return -ENOSPC;
}
Comment thread src/audio/eq_fir/eq_fir.c
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)
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