Repository navigation
webrtc: audio processing modules suite (AEC, NS, VAD, RNNoise, AGC, HPF) - #11314
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved build, packaging, manifest, userspace, memory-safety, audio-processing, and topology defects block approval.
27 open findings
Honor the selected AEC backend in LLEXT builds · New Avoid global approximate sin/cos replacements · New Route WebRTC allocations through userspace module syscalls · New Fix AECm include paths and architecture definitions · New Route aligned AEC3 allocations through module syscalls · New Guard undefined CONFIG_WEBRTC_AGC_LIMITER usage · New Add the missing AGC LLEXT manifest wrapper · New Reject unsupported sample rates or implement resampling · New Add the missing HPF LLEXT manifest wrapper · New Ensure HPF stub output is valid passthrough PCM · New Handle circular source and sink buffer wrapping · New Validate switch payload size before dereferencing · New Add WebRTC root includes for noise suppression · New Use userspace allocation hooks for noise suppression · New Reject unsupported noise suppression rates above 16 kHz · New Guard or independently define the VAD threshold macro · New Move userspace scratch buffers into per-instance storage · New Provide resample dependency for AGC and VAD builds · New Restrict VAD frame duration to supported values · New Avoid VAD double-free during reset failure · New
And 7 more that still need to be addressed.
What changed in this PR
Introduces six WebRTC/RNNoise audio-processing modules for SOF: VAD, noise suppression, echo cancellation, neural denoising, automatic gain control, and high-pass filtering.
Changes:
- Adds processing backends, stubs, configuration, manifests, and documentation.
- Pins external dependencies and registers module UUIDs and VAD notifications.
- Adds Topology2 widgets, capture pipelines, and development targets.
| File | Description |
|---|---|
west.yml |
Pins three audio dependencies. |
uuid-registry.txt |
Registers six module UUIDs. |
tools/topology/topology2/include/pipelines/cavs/webrtc-ns2-capture.conf |
Defines RNNoise capture pipeline. |
tools/topology/topology2/include/pipelines/cavs/webrtc-ns-capture.conf |
Defines VAD/NS capture pipeline. |
tools/topology/topology2/include/pipelines/cavs/webrtc-aec-capture.conf |
Defines AEC capture routing. |
tools/topology/topology2/include/components/webrtc-vad.conf |
Defines VAD widget. |
tools/topology/topology2/include/components/webrtc-ns2.conf |
Defines RNNoise widget. |
tools/topology/topology2/include/components/webrtc-ns.conf |
Defines NS widget. |
tools/topology/topology2/include/components/webrtc-hpf.conf |
Defines HPF widget and control. |
tools/topology/topology2/include/components/webrtc-agc.conf |
Defines AGC widget and control. |
tools/topology/topology2/include/components/webrtc-aec.conf |
Defines AEC widget and controls. |
tools/topology/topology2/development/tplg-targets.cmake |
Registers development topology targets. |
tools/topology/topology2/development/cavs-nocodec-webrtc-ns2.conf |
Adds RNNoise loopback topology. |
tools/topology/topology2/development/cavs-nocodec-webrtc-ns.conf |
Adds VAD/NS loopback topology. |
src/include/sof/lib/notifier.h |
Adds VAD notification ID. |
src/audio/webrtc_vad/webrtc_vad.toml |
Defines VAD manifest metadata. |
src/audio/webrtc_vad/webrtc_vad.h |
Defines VAD backend interface. |
src/audio/webrtc_vad/webrtc_vad.cmake |
Cross-builds libfvad. |
src/audio/webrtc_vad/webrtc_vad-stub.c |
Adds stub classifier. |
src/audio/webrtc_vad/webrtc_vad-shims.c |
Supplies libc shims. |
src/audio/webrtc_vad/webrtc_vad-fvad.c |
Integrates libfvad backend. |
src/audio/webrtc_vad/README.md |
Documents VAD integration. |
src/audio/webrtc_vad/llext/llext.toml.h |
Wraps loadable manifest. |
src/audio/webrtc_vad/llext/CMakeLists.txt |
Configures loadable VAD builds. |
src/audio/webrtc_vad/Kconfig |
Adds VAD configuration. |
src/audio/webrtc_vad/CMakeLists.txt |
Selects VAD build sources. |
src/audio/webrtc_ns2/webrtc_ns2.toml |
Defines RNNoise manifest metadata. |
src/audio/webrtc_ns2/webrtc_ns2.h |
Defines RNNoise interface and buffers. |
src/audio/webrtc_ns2/webrtc_ns2.cmake |
Cross-builds RNNoise. |
src/audio/webrtc_ns2/webrtc_ns2-stub.c |
Adds pass-through backend. |
src/audio/webrtc_ns2/webrtc_ns2-rnn.c |
Integrates RNNoise processing. |
src/audio/webrtc_ns2/README.md |
Documents RNNoise integration. |
src/audio/webrtc_ns2/llext/llext.toml.h |
Wraps loadable manifest. |
src/audio/webrtc_ns2/llext/CMakeLists.txt |
Configures loadable RNNoise builds. |
src/audio/webrtc_ns2/Kconfig |
Adds RNNoise configuration. |
src/audio/webrtc_ns2/CMakeLists.txt |
Selects RNNoise build sources. |
src/audio/webrtc_ns/webrtc_ns.toml |
Defines NS manifest metadata. |
src/audio/webrtc_ns/webrtc_ns.h |
Defines NS backend interface. |
src/audio/webrtc_ns/webrtc_ns.cmake |
Cross-builds WebRTC NS. |
src/audio/webrtc_ns/webrtc_ns-webrtc.c |
Integrates WebRTC NS backend. |
src/audio/webrtc_ns/webrtc_ns-stub.c |
Adds pass-through backend. |
src/audio/webrtc_ns/webrtc_ns-shims.c |
Supplies libc and math shims. |
src/audio/webrtc_ns/README.md |
Documents NS integration. |
src/audio/webrtc_ns/llext/llext.toml.h |
Wraps loadable manifest. |
src/audio/webrtc_ns/llext/CMakeLists.txt |
Configures loadable NS builds. |
src/audio/webrtc_ns/Kconfig |
Adds NS configuration. |
src/audio/webrtc_ns/CMakeLists.txt |
Selects NS build sources. |
src/audio/webrtc_hpf/webrtc_hpf.toml |
Defines HPF manifest metadata. |
src/audio/webrtc_hpf/webrtc_hpf.h |
Defines HPF state and interface. |
src/audio/webrtc_hpf/webrtc_hpf.c |
Implements lifecycle, streaming, and controls. |
src/audio/webrtc_hpf/webrtc_hpf-stub.c |
Adds HPF stub backend. |
src/audio/webrtc_hpf/webrtc_hpf-filter.c |
Implements fixed-point filtering. |
src/audio/webrtc_hpf/README.md |
Documents HPF integration. |
src/audio/webrtc_hpf/llext/CMakeLists.txt |
Configures loadable HPF builds. |
src/audio/webrtc_hpf/Kconfig |
Adds HPF configuration. |
src/audio/webrtc_hpf/CMakeLists.txt |
Selects HPF build sources. |
src/audio/webrtc_agc/webrtc_agc.toml |
Defines AGC manifest metadata. |
src/audio/webrtc_agc/webrtc_agc.h |
Defines AGC state and interface. |
src/audio/webrtc_agc/webrtc_agc-stub.c |
Adds fallback backend. |
src/audio/webrtc_agc/webrtc_agc-agc.c |
Implements framed digital AGC. |
src/audio/webrtc_agc/README.md |
Documents AGC integration. |
src/audio/webrtc_agc/llext/CMakeLists.txt |
Configures loadable AGC builds. |
src/audio/webrtc_agc/Kconfig |
Adds AGC configuration. |
src/audio/webrtc_agc/CMakeLists.txt |
Selects AGC build sources. |
src/audio/webrtc_aec/webrtc_aec3_wrapper.h |
Declares AEC3 C interface. |
src/audio/webrtc_aec/webrtc_aec3_wrapper.cpp |
Wraps C++ AEC3 processing. |
src/audio/webrtc_aec/webrtc_aec3_shims.cpp |
Supplies C++ runtime adaptations. |
src/audio/webrtc_aec/webrtc_aec.toml |
Defines AEC manifest metadata. |
src/audio/webrtc_aec/webrtc_aec.h |
Defines AEC interfaces and state. |
src/audio/webrtc_aec/webrtc_aec.cmake |
Cross-builds AECm. |
src/audio/webrtc_aec/webrtc_aec-stub.c |
Adds microphone pass-through backend. |
src/audio/webrtc_aec/webrtc_aec-shims.c |
Supplies allocator wrappers. |
src/audio/webrtc_aec/webrtc_aec-math.c |
Supplies approximate math functions. |
src/audio/webrtc_aec/webrtc_aec-aecm.c |
Integrates AECm backend. |
src/audio/webrtc_aec/llext/llext.toml.h |
Wraps loadable manifest. |
src/audio/webrtc_aec/llext/CMakeLists.txt |
Configures loadable AEC builds. |
src/audio/webrtc_aec/Kconfig |
Adds AEC backend selection and options. |
src/audio/Kconfig |
Includes module configurations. |
src/audio/CMakeLists.txt |
Registers module build directories. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
661613d to
dc86942
Compare
|
Thanks for the thorough review! All 27 review comments have been addressed, and all 6 modules have been updated to strictly adhere to the Pipeline 2.0 Sink/Source circular buffer API conventions as described in #11297. Summary of Changes1. Sink/Source API Conformance (per #11297)Across all 6 modules (
2. Detailed Review Fixes
3. Verification
|
PR 11314: test resultsRun date: 2026-10-21 20:08 UTC Tested commit: dcfe5ac39a4675bdd0399c50ffdbfd194ad24f17 |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved linkage, userspace-access, audio-processing, configuration, and topology defects block approval.
12 open issues
Include missing webrtc AEC shim source in LLEXT build · New Place AEC allocator state in userspace-accessible memory · New Include missing AECm implementation dependencies · New Prevent pass-through FIFO from replaying previously output samples · New Place built-in NS state in userspace-accessible memory · New Provide RNNoise allocator and math dependencies · New Distinguish built-in from module providers in source guards · New Fix SSP capture sample-rate mismatch with SRC or reconfiguration · New Remove unsupported 48 kHz formats from WebRTC AGC · New Instantiate missing webrtc-aec widget · New Move AEC telemetry option outside mutually exclusive backend choice · New Add 48 kHz coefficients or remove unsupported rate · New
27 resolved since last review
Resolve incompatible NS pipeline sample rates Declare separate microphone and reference input pins Use the dedicated PTL SSP configuration override Use userspace allocation hooks for VAD Avoid VAD double-free during reset failure Restrict VAD frame duration to supported values Provide resample dependency for AGC and VAD builds Move userspace scratch buffers into per-instance storage Guard or independently define the VAD threshold macro Reject unsupported noise suppression rates above 16 kHz Use userspace allocation hooks for noise suppression Add WebRTC root includes for noise suppression Validate switch payload size before dereferencing Handle circular source and sink buffer wrapping Ensure HPF stub output is valid passthrough PCM Add the missing HPF LLEXT manifest wrapper Reject unsupported sample rates or implement resampling Add the missing AGC LLEXT manifest wrapper Guard undefined CONFIG_WEBRTC_AGC_LIMITER usage Route aligned AEC3 allocations through module syscalls
And 7 more resolved.
Review effort: Balanced
dc86942 to
dcfe5ac
Compare
|
Addressed all 12 new review comments and resolved the 3 CI build failures in the updated series: CI Fixes
Review Comments Addressed
|
Add official SOF fork projects for WebRTC audio processing: - libfvad: pure-C BSD-3 extraction of WebRTC GMM VAD for webrtc_vad (thesofproject/libfvad at sof-hifi) - webrtc-apm: WebRTC audio processing with AEC3 C++17 core, AECm, NS, and AGC (thesofproject/webrtc-audio-processing at sof-hifi) - rnnoise: xiph/rnnoise deep-learning noise suppressor for webrtc_ns2 (thesofproject/rnnoise at sof-hifi) Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Raise FW_MAX_EXT_MODULE_NUM from 48 to 64 to accommodate the new WebRTC modules in LLEXT all-modular builds. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the webrtc_vad SOF module wrapping the WebRTC Gaussian Mixture Model (GMM) Voice Activity Detector via libfvad. Module characteristics: - Single-source, single-sink PCM effect with pass-through audio - Supports 8, 16, 32, and 48 kHz sample rates - 10, 20, or 30 ms frame analysis - 4 operating modes (Quality, Low Bitrate, Aggressive, Very Aggressive) - Emits NOTIFIER_ID_VAD events when speech is detected - Backends: real (libfvad static library) and pass-through stub for CI/LLEXT - LLEXT packaging supported UUID: c790b11d-5d14-e54e-be36ba4ad732cc14 Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the webrtc_ns SOF module wrapping the classic WebRTC Noise Suppression algorithm (spectral Wiener filter, fixed-point) from the webrtc-audio-processing library. Module characteristics: - Single-source, single-sink PCM effect - Fixed-point implementation; no FPU required - Operates at 8 or 16 kHz on 10 ms frames - Supports S16_LE and S32_LE, mono or stereo - Four suppression levels: Mild/Medium/Aggressive/VeryAggressive - Two backends: real (WebRTC NS) and pass-through stub for CI/LLEXT - LLEXT packaging supported UUID: 0fc8faef-945f-004b-8d5f315047f1136a Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…/ AEC3)
Add the webrtc_aec SOF module wrapping WebRTC Acoustic Echo Cancellation.
Module characteristics:
- Dual-source (pin 0 = mic capture, pin 1 = playback echo reference)
- Single-sink: echo-cancelled microphone output
- Three selectable backends:
* AECm: lightweight fixed-point Q15 for embedded low-power DSP
* Classic Float AEC: single-precision floating-point with soft-float lowering
* Modern AEC3 (C++17): stereo 2x2 MIMO pipeline with native hardware
FPU acceleration on Panther Lake (ACE 3.0)
- Configurable filter length, suppression levels, and sample rates (8/16/32/48 kHz)
- Pass-through stub backend for CI validation
- LLEXT packaging supported
UUID: e5da7b5b-133a-ba46-b517651d6300bb83
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the webrtc_ns2 SOF module wrapping the RNNoise deep-learning noise suppressor (GRU recurrent neural network) from xiph/rnnoise. Module characteristics: - Single-source, single-sink PCM effect - Operates at 48000 Hz on 10 ms (480-sample) frames - Supports S16_LE and S32_LE up to 2 channels - Integrated speech probability detector emitting NOTIFIER_ID_VAD - Statically linked GRU weights in .rodata - Pass-through stub backend for CI validation - LLEXT packaging supported UUID: eacfacdc-2a87-c942-97e894c917a740db Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the webrtc_agc SOF module wrapping the WebRTC Digital Automatic Gain Control (AGC) and limiter implementation from webrtc-audio-processing. Module characteristics: - Single-source, single-sink PCM effect - Fixed-point digital AGC (digital_agc.c) - Target level and compression gain control via IPC4 / Kconfig - Digital limiter preventing hard clipping - Pass-through stub backend for CI validation - LLEXT packaging supported UUID: 0af7b529-9dc7-4bee-a8b159e8fbe414f3 Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the webrtc_hpf SOF module wrapping the WebRTC cascaded 2nd-order biquad IIR high-pass filter (<80/100 Hz cutoff). Module characteristics: - Eliminates DC offset and rejects speaker rumble / mechanical vibration - Fixed-point Q12/Q13 arithmetic with 32-bit accumulators - Supports S16 and S32 formats across up to 4 channels - Measured <0.35% CPU load on Panther Lake DSP - Pass-through stub backend for CI validation - LLEXT packaging supported UUID: 6dfb1bea-d858-4ef7-92abcf5b4ee48159 Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add Topology 2.0 component widgets, capture pipeline templates, and development topologies for WebRTC audio modules: Component widgets (include/components/): - webrtc-vad.conf: pass-through VAD (S16/S32, any sample rate) - webrtc-ns.conf: spectral noise suppressor (8/16 kHz, S16/S32) - webrtc-aec.conf: AECm echo canceller (dual input pins: mic + echo ref) - webrtc-ns2.conf: RNNoise GRU neural noise suppressor (48 kHz locked) - webrtc-agc.conf: WebRTC digital automatic gain control & limiter - webrtc-hpf.conf: cascaded 2nd-order biquad IIR high-pass filter Capture pipeline templates (include/pipelines/cavs/): - webrtc-ns-capture.conf: DAI copier -> VAD -> NS -> host copier - webrtc-aec-capture.conf: 2-pin capture copier -> AEC -> host copier - webrtc-ns2-capture.conf: RNNoise neural suppressor -> host copier Development topologies (development/): - cavs-nocodec-webrtc-ns.conf - cavs-nocodec-webrtc-aec.conf - cavs-nocodec-webrtc-ns2.conf Registered development targets in tplg-targets.cmake for TGL nocodec SSP. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
dcfe5ac to
a3f89dd
Compare


Overview
This is PR 2 in the series splitting monolithic PR #10990 into modular, reviewable PRs rebased on
main.This PR introduces the WebRTC & Neural Audio Processing Suite, enabling real-time on-DSP speech enhancement, acoustic echo cancellation, voice activity detection, and noise suppression across SOF hardware platforms (including Panther Lake, Tiger Lake, Lunar Lake, Meteor Lake, and Arrow Lake).
All third-party library dependencies are managed via West (
west.yml) pointing to officialthesofprojectforks, with complete pass-through stub backends (CONFIG_COMP_WEBRTC_*_STUB=y) to guarantee 100% test pass rates in CI without external checkouts.Audio Processing Modules in this PR
1.
webrtc_vad(Voice Activity Detection)thesofproject/libfvad(pure C).1speech /0silence) overNOTIFIER_ID_VADfor downstream processing without polling.c790b11d-5d14-e54e-be36ba4ad732cc142.
webrtc_ns(Classic Spectral Noise Suppression)thesofproject/webrtc-audio-processing(0.3.1 pure-C core).fabsf,fabs,expf,exp,tanh,atanf) to eliminate hostlibmdependencies in minimal libc.0fc8faef-945f-004b-8d5f315047f1136a3.
webrtc_aec(Acoustic Echo Cancellation)e5da7b5b-133a-ba46-b517651d6300bb834.
webrtc_ns2(RNNoise Deep Learning Noise Suppression)thesofproject/rnnoise(pure C, BSD-3-Clause)..rodata.NOTIFIER_ID_VADevents above configurable threshold.eacfacdc-2a87-c942-97e894c917a740db5.
webrtc_agc(Digital Automatic Gain Control)digital_agc.c).0af7b529-9dc7-4bee-a8b159e8fbe414f36.
webrtc_hpf(Cascaded Biquad High-Pass Filter)6dfb1bea-d858-4ef7-92abcf5b4ee48159West Manifest Integration (
west.yml)The module suite sources dependencies from official
thesofprojectforks:libfvadat branchsof-hifi(e4b0c4d00b3db23f5825631ae8f84058e7a1b366)webrtc-apmat branchsof-hifi(3e9c41a268fbeb36a7de2c5cb2f1b02bc7fef098)rnnoiseat branchsof-hifi(24dbb35115c6d27f9f14cc654bf0a32417f70bf9)Topology2 & Pipelines
webrtc-vad.conf,webrtc-ns.conf,webrtc-aec.conf,webrtc-ns2.conf,webrtc-agc.conf,webrtc-hpf.confwebrtc-ns-capture.conf,webrtc-aec-capture.conf,webrtc-ns2-capture.confcavs-nocodec-webrtc-ns.conf,cavs-nocodec-webrtc-aec.conf,cavs-nocodec-webrtc-ns2.conftplg-targets.cmakefor TGL nocodec.Verification & Build Results
xtensa-build-zephyr.py -z -p ptl: PASS (code 0)webrtc_all_stubs.conf):xtensa-build-zephyr.py -z -p -o webrtc_all_stubs.conf ptl: PASS (code 0)webrtc_real_y.conf):xtensa-build-zephyr.py -z -p -o webrtc_real_y.conf ptl: PASS (code 0)xtensa-build-zephyr.py -z -p -o webrtc_all_stubs.conf tgl: PASS (code 0)