Repository navigation
audio: webrtc: add 32/48 kHz AGC support, AEC DP scheduling, and Kconfig overlays - #11419
Conversation
lgirdwood
left a comment
There was a problem hiding this comment.
Commit messages are not line wrapped correctly, and webrtc modules will be deployed as llext raher than built in so we need to make sure we can build as llext.
1da5608 to
7aec035
Compare
|
Updated the branch to address the review comments:
|
There was a problem hiding this comment.
🟡 Changes recommended
Critical issues can silently discard 240 audio samples during consecutive 48 kHz calls and leave the advertised real-AEC overlay using a pass-through stub, while unfiltered band splitting also distorts VAD-driven gain decisions.
3 open issues
What changed in this PR
Extends SOF’s WebRTC AGC to higher sample rates and adds configuration options for WebRTC deployment and scheduler stack sizing.
Changes:
- Adds 32/48 kHz AGC processing and matching topology formats.
- Makes the per-core LL scheduler stack configurable, with a larger default for AEC3.
- Adds real and stub WebRTC overlays and enables all six modules in the IPC4 stub configuration.
| File | Description |
|---|---|
| tools/topology/topology2/include/components/webrtc-agc.conf | Adds 32/48 kHz input and output formats. |
| src/schedule/zephyr_domain.c | Uses the configurable LL stack size. |
| src/schedule/Kconfig | Defines LL stack sizing and the AEC3 default. |
| src/audio/webrtc_hpf/Kconfig | Defaults HPF to its stub under COMP_STUBS. |
| src/audio/webrtc_agc/webrtc_agc.c | Accepts 32/48 kHz streams. |
| src/audio/webrtc_agc/webrtc_agc-agc.c | Adds phase splitting and peak ordering for higher rates. |
| src/audio/webrtc_agc/README.md | Documents expanded frame sizes and rates. |
| src/audio/webrtc_agc/Kconfig | Defaults AGC to its stub under COMP_STUBS. |
| src/audio/webrtc_aec/Kconfig | Defaults AEC to its stub under COMP_STUBS. |
| app/webrtc_stubs_overlay.conf | Adds a six-module pass-through overlay. |
| app/webrtc_overlay.conf | Adds real-backend settings and heap sizing. |
| app/stub_build_all_ipc4.conf | Enables all six WebRTC modules. |
Review effort: Balanced
7aec035 to
6f6c3d0
Compare
6f6c3d0 to
8a980f7
Compare
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
5 open issues
webrtc_agc_process_multiband()always callsWebRtcAgc_ProcessDigital()withnum_bands = 2… · New The loop consumes input (offset += chunk) even when there isn’t enough processed output available… · New Use 64-bit multiplication before saturating scaled samples Bound probe amplitude by the maximum gain-table entry This option is explicitly Zephyr-specific (and is consumed inzephyr_domain.c), but it’s… · New
Review effort: Lite
8a980f7 to
5b121ff
Compare
Extend webrtc_agc to accept 32 kHz and 48 kHz streams in addition to 8 kHz and 16 kHz. Downsample 32/48 kHz 10 ms frames to an anti-aliased 16 kHz signal via WebRtcSpl_DownsampleBy2 and WebRtcSpl_Resample48khzTo16khz for Band 0 VAD and adaptive gain analysis, while tracking full-rate 1 ms subframe peaks separately for the overload limiter. Interleave FIFO filling, 10 ms processing, and draining in chunks so calls larger than 10 ms never overflow the framing FIFOs. Update the webrtc-agc topology2 widget definition to list 8, 16, 32, and 48 kHz. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Configure the webrtc_aec LLEXT manifest (.domain_dp = 1), rimage TOML (domain_types = "1"), and topology2 widget definition (scheduler_domain "DP" with stack_bytes_requirement 16384) to run in the Data Processing (DP) scheduling domain rather than on the 1 ms Low Latency (LL) thread. Add webrtc_aec_is_ready_to_process() so the DP scheduler triggers processing whenever a full 10 ms microphone capture frame is available and output space is free, without blocking when the playback echo reference stream is idle. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Select the pass-through stub backends by default for webrtc_aec, webrtc_agc, and webrtc_hpf when CONFIG_COMP_STUBS=y (matching webrtc_ns, webrtc_ns2, and webrtc_vad), and include all six WebRTC modules as LLEXT modules (=m) in app/stub_build_all_ipc4.conf. Add app/webrtc_overlay.conf (LLEXT real backends + heap sizing) and app/webrtc_stubs_overlay.conf (LLEXT stub backends) for firmware builds. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
5b121ff to
1bf9c20
Compare
PR 11419: test resultsRun date: 2026-11-09 10:58 UTC Tested commit: 1bf9c2043f1ab8f06687a154e8bd3146337b6a0c |
|
Unrelated CI failures. Feature not yet tested in CI. |


Summary
Follow-up improvements for the WebRTC audio processing module suite merged in #11044:
audio: webrtc_agc: add 32 kHz and 48 kHz sample rate supportWebRtcAgc_ProcessDigital()natively accepts 8, 16, 32, and 48 kHz sample rates using 160-sample sub-bands (num_bands = 1at 8/16 kHz,2at 32 kHz,3at 48 kHz).webrtc_agcandwebrtc-agc.confto support 32 kHz and 48 kHz streams alongside 8 kHz and 16 kHz by downsampling each 10 ms frame to 16 kHz for VAD/envelope tracking, running a separate full-rate overload limiter pass across all 10 subframes, and applying piecewise-linear Q16 gain interpolation directly to the full-rate samples.audio: webrtc_aec: configure module for DP domain schedulingwebrtc_aecLLEXT manifest (.domain_dp = 1), rimage TOML (domain_types = "1"), and topology2 widget definition (scheduler_domain "DP"withstack_bytes_requirement 16384) to run in the Data Processing (DP) scheduling domain rather than on the 1 ms Low Latency (LL) thread.webrtc_aec_is_ready_to_process()so the DP scheduler triggers processing whenever a full 10 ms microphone capture frame is available and output space is free, without blocking when the playback echo reference stream is idle.app: add WebRTC Kconfig overlays and COMP_STUBS defaultswebrtc_aec,webrtc_agc, andwebrtc_hpfto their pass-through stub backends whenCONFIG_COMP_STUBS=y(matchingwebrtc_ns,webrtc_ns2, andwebrtc_vad), and enable all six WebRTC modules inapp/stub_build_all_ipc4.conf.app/webrtc_overlay.conf(LLEXT real backends + heap sizing) andapp/webrtc_stubs_overlay.conf(LLEXT stub backends).