Repository navigation
audio: webrtc_aec: add stereo/MIMO AEC, 32 kHz resampling, and SSP loopback tests - #11545
Conversation
lgirdwood
left a comment
There was a problem hiding this comment.
Thanks for the detailed PR and unit test coverage for stereo/MIMO AEC, 32 kHz resampling, and the SSP loopback topologies.
I reviewed the full PR (noting the first 10 commits are stacked from #11426 and the final 4 commits are new to #11545). Below are the key findings — several blocking correctness/RT/concurrency bugs need addressing before merge:
Blocking / Bugs
- Out-of-bounds read in IPC3
set_config(src/audio/webrtc_aec/webrtc_aec.c:820-826):fragment_sizeis checked againstsizeof(struct sof_ipc_ctrl_data)without includingsizeof(struct sof_ipc_ctrl_value_chan)forchanv[0]. - AEC3 real-time allocation & DP/IPC thread UAF/data race (
src/audio/webrtc_aec/webrtc_aec3_wrapper.cpp:121-123, 154-168):webrtc_aec3_buffer_farend()recreatesEchoCanceller3(std::make_unique) inside the audio processing path, racing withwebrtc_aec3_set_delay()/webrtc_aec3_set_suppression()called from IPC context. Also hardcodesnum_samples != 160, breaking 8 kHz streams. - Dynamic reference bind channel/format mismatch (
src/audio/webrtc_aec/webrtc_aec.c:623-667): If capture prepares with 1 source (cd->ref_channels = 1) and a stereo ref binds dynamically inprocess(),src_to_s16()reads usingcd->ref_channelsinstead ofsource_get_channels(ref), corrupting the reference stream. reset()loses backend & resampler state (src/audio/webrtc_aec/webrtc_aec-aec.c:308-311,webrtc_aec-aecm.c:195,webrtc_aec.c:714):WebRtcAec_Init()/WebRtcAecm_Init()reset NLP/CNG/metrics/delay-agnostic settings to defaults andreset()does not re-apply them or clear resampler states.- Infinite recursion in soft-float
sqrtf()shims (webrtc_ns-shims.c:242-247,webrtc_ns2-shims.c:209-214, from stacked #11426):sqrtf()calls__builtin_sqrtf(x), which lowers back tosqrtf()on soft-float targets (unlikewebrtc_aec-math.cwhich uses Newton-Raphson). - Broken 16 kHz / 2R×1C topology clock & channel map (
tplg-targets.cmake:344,cavs-dmic-ssp-lbm-webrtc-aec.conf:115,cavs-nocodec-webrtc-aec.conf:99,116):MIC_CH_MAP=0should be0xFFFFFFF0(CHANNEL_MAP_MONO), and SSPbclk_freq 3072000is hardcoded for 48 kHz stereo even in 16 kHz topologies. - Hardcoded developer path in
src/audio/webrtc_aec/CMakeLists.txt:55-57(/home/lrg/zephyr-sdk-1.0.1/...).
Hygiene & Docs
- CI & mergeability:
intel-innersource/sof-pr-testis currently failing and the branch has conflicts againstmain(mergeable=False). - Commit subjects (> 75 chars per
AGENTS.md):12e4e8a81c(86 chars),8ffbf5801e(83 chars), and0fd471281c(79 chars). - Docs out of sync:
src/audio/webrtc_aec/README.mddoes not document the 7 new Kconfig options, 32 kHz resampling, or 4-ch asymmetricR x Csupport;src/include/sof/userspace/README.mdsyscall table does not list the newnotifier_eventsyscall (zephyr/syscall/notifier.c).
| if(NOT _sdk_cxx_dir AND EXISTS "/home/lrg/zephyr-sdk-1.0.1/gnu/xtensa-${_xtensa_target}_zephyr-elf/xtensa-${_xtensa_target}_zephyr-elf") | ||
| set(_sdk_cxx_dir "/home/lrg/zephyr-sdk-1.0.1/gnu/xtensa-${_xtensa_target}_zephyr-elf/xtensa-${_xtensa_target}_zephyr-elf") | ||
| endif() |
There was a problem hiding this comment.
Blocking: Please remove this hardcoded personal host path (/home/lrg/zephyr-sdk-1.0.1/...). The CMAKE_CXX_COMPILER and ENV{ZEPHYR_SDK_INSTALL_DIR} discovery immediately above already handles SDK lookup portably.
There was a problem hiding this comment.
Fixed in 0bd5377: removed the hardcoded /home/lrg toolchain fallback path in src/audio/webrtc_aec/CMakeLists.txt and kept only portable CMAKE_CXX_COMPILER and ENV{ZEPHYR_SDK_INSTALL_DIR} discovery.
| if (fragment_size >= sizeof(struct sof_ipc_ctrl_data)) { | ||
| const struct sof_ipc_ctrl_data *cdata = | ||
| (const struct sof_ipc_ctrl_data *)fragment; | ||
|
|
||
| comp_err(dev, "webrtc_aec: unknown control id %d", ctl->id); | ||
| return -EINVAL; | ||
| if (cdata->cmd == SOF_CTRL_CMD_SWITCH && cdata->num_elems >= 1) | ||
| return webrtc_aec_apply_ctl(mod, cd, cdata->index, cdata->chanv[0].value); | ||
| } |
There was a problem hiding this comment.
Blocking (Out-of-Bounds Read): struct sof_ipc_ctrl_data ends with a zero-length array chanv[], so sizeof(struct sof_ipc_ctrl_data) does not include chanv[0]. If fragment_size == sizeof(struct sof_ipc_ctrl_data) and num_elems >= 1, reading cdata->chanv[0].value reads past the end of fragment.
Match the IPC4 bounds check above:
| if (fragment_size >= sizeof(struct sof_ipc_ctrl_data)) { | |
| const struct sof_ipc_ctrl_data *cdata = | |
| (const struct sof_ipc_ctrl_data *)fragment; | |
| comp_err(dev, "webrtc_aec: unknown control id %d", ctl->id); | |
| return -EINVAL; | |
| if (cdata->cmd == SOF_CTRL_CMD_SWITCH && cdata->num_elems >= 1) | |
| return webrtc_aec_apply_ctl(mod, cd, cdata->index, cdata->chanv[0].value); | |
| } | |
| if (fragment_size >= sizeof(struct sof_ipc_ctrl_data) + | |
| sizeof(struct sof_ipc_ctrl_value_chan)) { | |
| const struct sof_ipc_ctrl_data *cdata = | |
| (const struct sof_ipc_ctrl_data *)fragment; | |
| if (cdata->cmd == SOF_CTRL_CMD_SWITCH && cdata->num_elems >= 1) | |
| return webrtc_aec_apply_ctl(mod, cd, cdata->index, cdata->chanv[0].value); | |
| } |
There was a problem hiding this comment.
Fixed in 0bd5377: corrected the IPC3 set_config fragment_size bounds check in src/audio/webrtc_aec/webrtc_aec.c to sizeof(struct sof_ipc_ctrl_data) + sizeof(struct sof_ipc_ctrl_value_chan).
| ref_s32 = ref ? (source_get_frm_fmt(ref) == SOF_IPC_FRAME_S32_LE) : cd->is_s32; | ||
| if (fref > fmic) { | ||
| src_drop_frames(ref, fref - fmic); | ||
| fref = fmic; | ||
| } | ||
| if (fref >= n) { | ||
| src_to_s16(ref, n, cd->ref_buf, cd->buffered_in_frames, cd->channels, cd->is_s32); | ||
| src_to_s16(ref, n, cd->ref_buf, cd->buffered_in_frames, cd->ref_channels, ref_s32); | ||
| } else if (fref > 0) { | ||
| src_to_s16(ref, fref, cd->ref_buf, cd->buffered_in_frames, cd->channels, cd->is_s32); | ||
| for (c = 0; c < cd->channels; c++) | ||
| src_to_s16(ref, fref, cd->ref_buf, cd->buffered_in_frames, cd->ref_channels, ref_s32); | ||
| for (c = 0; c < cd->ref_channels; c++) |
There was a problem hiding this comment.
Bug (Dynamic ref bind mismatch & unchecked drop):
- If
webrtc_aec_prepare()ran withnum_of_sources == 1,cd->ref_channelswas initialized to1. When a stereo reference source later binds dynamically inprocess(),src_to_s16()computesframe_bytes = cd->ref_channels * sample_szinstead ofsource_get_channels(ref) * sample_sz, consuming only half a frame per frame and corruptingref_bufand alignment. Validatesource_get_channels(ref) == cd->ref_channels(and thatrefformat isS16_LEorS32_LE) or fall back to silence / reconfigure before reading. src_drop_frames()silently ignores errors fromsource_get_data(), yet line 654 unconditionally assumesfref - fmicframes were dropped and setsfref = fmic.
There was a problem hiding this comment.
Fixed in 0bd5377: src_drop_frames() now returns int and is checked before clamping fref = fmic. In addition, webrtc_aec_process() validates dynamic ref channels (ref_ch != cd->ref_channels) and sample format (S16_LE / S32_LE), dropping mismatched ref frames and zero-filling ref_buf with a one-shot comp_warn.
| int16_t mic16[WEBRTC_AEC_CHANNELS_MAX][WEBRTC_AEC_FRAME_SAMPLES_16K]; | ||
| int16_t ref16[WEBRTC_AEC_CHANNELS_MAX][WEBRTC_AEC_FRAME_SAMPLES_16K]; | ||
| int16_t out16[WEBRTC_AEC_CHANNELS_MAX][WEBRTC_AEC_FRAME_SAMPLES_16K]; |
There was a problem hiding this comment.
Design / Stack Usage: These three arrays allocate 4 * 160 * 2 * 3 = 3840 bytes (~3.75 KB) directly on the DSP thread stack inside process() right before calling into WebRTC / C++ AEC frames. Consider moving mic16, ref16, and out16 into struct webrtc_aec_comp_data (or sizing to actual channel count) to keep stack usage bounded.
There was a problem hiding this comment.
Fixed in 0bd5377: moved mic16, ref16, and out16 (3840 bytes) off the webrtc_aec_run_block() stack into struct webrtc_aec_comp_data.
| if (param_id == IPC4_AEC_SET_EXT_FMT) { | ||
| if (pos != MODULE_CFG_FRAGMENT_SINGLE || | ||
| fragment_size < sizeof(struct sof_ipc4_aec_config)) { | ||
| comp_err(dev, "webrtc_aec: invalid IPC4_AEC_SET_EXT_FMT size %zu", | ||
| fragment_size); | ||
| return -EINVAL; | ||
| } | ||
| memcpy(&cd->config, fragment, sizeof(struct sof_ipc4_aec_config)); | ||
| comp_info(dev, "webrtc_aec: updated IPC4_AEC_SET_EXT_FMT"); | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
Design:
IPC4_AEC_SET_EXT_FMTcopies intocd->config, butcd->configis never read anywhere inwebrtc_aec_prepare()or the backends — is this intentionally a stub for a follow-up?- In
webrtc_aec_apply_ctl()above,id == 2(delay_ms,0..500) is dispatched underSOF_IPC4_SWITCH_CONTROL_PARAM_ID/SOF_CTRL_CMD_SWITCH, which in ALSA/IPC4 represents a boolean (0/1) switch rather than an integer range control (and none of the topologywebrtc-aecdefinitions expose controlid == 2yet).
There was a problem hiding this comment.
Fixed in 0bd5377: removed the dead IPC4_AEC_SET_EXT_FMT / cd->config stub and <ipc4/aec.h> include, and removed the id == 2 (delay_ms) integer overload from the boolean switch controls (SOF_IPC4_SWITCH_CONTROL_PARAM_ID / SOF_CTRL_CMD_SWITCH).
| __attribute__((weak)) float sqrtf(float x) | ||
| { | ||
| if (x <= 0.0f) | ||
| return 0.0f; | ||
| return __builtin_sqrtf(x); | ||
| } |
There was a problem hiding this comment.
Blocking (Infinite Recursion on Soft-Float Targets): Same issue as webrtc_ns-shims.c — __builtin_sqrtf(x) inside sqrtf() lowers to a self-recursive call on soft-float targets without hardware FP sqrt. Replace with the Newton-Raphson implementation from webrtc_aec-math.c.
There was a problem hiding this comment.
Resolved by rebasing directly onto main (032bf6eb6), where #11426 has already landed—dropping the stale stacked commits and removing webrtc_ns2-shims.c from this PR's diff.
| "development/cavs-nocodec-webrtc-aec\;sof-ptl-nocodec-webrtc-aec-16k\;PLATFORM=ptl,\ | ||
| AEC_RATE=16000,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-nocodec-webrtc-aec-16k.bin" | ||
| "development/cavs-nocodec-webrtc-aec\;sof-ptl-nocodec-webrtc-aec-2r1c\;PLATFORM=ptl,\ | ||
| AEC_RATE=16000,MIC_CH=1,REF_CH=2,MIC_CH_CFG=0,MIC_CH_MAP=0,\ |
There was a problem hiding this comment.
Bug: CHANNEL_MAP_MONO in common_definitions.conf is 0xFFFFFFF0 (bits [3:0]=0, unused slots 0xF), not 0. Passing MIC_CH_MAP=0 maps all 8 channel slots to channel 0.
| AEC_RATE=16000,MIC_CH=1,REF_CH=2,MIC_CH_CFG=0,MIC_CH_MAP=0,\ | |
| AEC_RATE=16000,MIC_CH=1,REF_CH=2,MIC_CH_CFG=0,MIC_CH_MAP=0xFFFFFFF0,\ |
There was a problem hiding this comment.
Fixed in 6cdef34: set MIC_CH_MAP=0xFFFFFFF0 on sof-ptl-nocodec-webrtc-aec-2r1c in tools/topology/topology2/development/tplg-targets.cmake.
| Object.Base.hw_config.1 { | ||
| name "SSP2" | ||
| id 0 | ||
| bclk_freq 3072000 |
There was a problem hiding this comment.
Bug (Clock Mismatch on Hardware): AEC_RATE defaults to 16000 in this file, but SSP2 hardcodes bclk_freq 3072000 (48000 * 2ch * 32-bit slot). At 16 kHz / 2ch / 32-bit slot width, bclk_freq should be 1024000 (or computed from $AEC_RATE), otherwise SSP2 runs 3x too fast on Spider/Aphid hardware. The same hardcoded bclk_freq 3072000 affects the new -16k and -2r1c targets in cavs-nocodec-webrtc-aec.conf (lines 99 and 116).
There was a problem hiding this comment.
Fixed in 6cdef34: updated cavs-dmic-ssp-lbm-webrtc-aec.conf SSP2 to bclk_freq 1024000 / fsync_freq 16000, and updated cavs-nocodec-webrtc-aec.conf SSP0/SSP2 with hw_config.1 (3072000/48000) and hw_config.2 (1024000/16000) selected via default_hw_conf_id $AEC_HW_CONF_ID (AEC_HW_CONF_ID=1 on -16k and -2r1c). All 7 targets pass alsatplg.
| target_compile_options(app PRIVATE | ||
| -Wno-error=deprecated-declarations | ||
| -Wno-double-promotion | ||
| -Wno-implicit-function-declaration |
There was a problem hiding this comment.
Nit / Portability: Avoid suppressing -Wno-implicit-function-declaration in unit tests — it hides missing headers and can mask ABI/prototype mismatches (especially on 64-bit native_sim).
There was a problem hiding this comment.
Fixed in 06efe37: removed -Wno-implicit-function-declaration and updated the includes/sources in test/ztest/unit/audio/webrtc_aec/CMakeLists.txt for main.
| if (ctx->mic_buf) { | ||
| free(ctx->mic_buf->source); | ||
| buffer_free(ctx->mic_buf); | ||
| } | ||
| if (ctx->ref_buf) { | ||
| free(ctx->ref_buf->source); | ||
| buffer_free(ctx->ref_buf); | ||
| } | ||
| if (ctx->out_buf) { | ||
| free(comp_buffer_get_sink_component(ctx->out_buf)); | ||
| buffer_free(ctx->out_buf); | ||
| } | ||
| if (ctx->dev) | ||
| comp_free(ctx->dev); |
There was a problem hiding this comment.
Bug: create_buf() appends mic_buf, ref_buf, and out_buf to dev->bsource_list / dev->bsink_list, and destroy_ctx() frees the buffers with buffer_free() before comp_free(ctx->dev) without unlinking them from the lists. Call comp_free(ctx->dev) first (or unlink sink_list/source_list before buffer_free()) to avoid dangling list pointers.
There was a problem hiding this comment.
Fixed in 06efe37: unlinked sink_list / source_list nodes via list_item_del(), called comp_free(ctx->dev) before buffer_free(), updated the delay test to use cd->backend->set_delay(), and added webrtc_aec_reset() coverage.
0fd4712 to
4f70354
Compare
commented
Nov 27, 2026
|
All review comments have been addressed and the branch has been rebased cleanly onto
|
| @@ -0,0 +1,140 @@ | |||
| # SPDX-License-Identifier: BSD-3-Clause | |||
There was a problem hiding this comment.
Per AGENTS.md, AI agents do not add Signed-off-by tags; @lgirdwood will apply developer sign-off (git rebase --signoff) prior to merge.
There was a problem hiding this comment.
Fixed in rebase onto main (28cd724d3): added Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> across all 13 commits (88cac41ba..a3dac24e4).
| @@ -0,0 +1,306 @@ | |||
| # | |||
There was a problem hiding this comment.
Per AGENTS.md, AI agents do not add Signed-off-by tags; @lgirdwood will apply developer sign-off (git rebase --signoff) prior to merge.
There was a problem hiding this comment.
Fixed in rebase onto main (28cd724d3): added Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> across all 13 commits (88cac41ba..a3dac24e4).
| "adl" "platform/intel/tgl.conf" | ||
| "mtl" "platform/intel/mtl.conf" | ||
| "lnl" "platform/intel/lnl.conf" | ||
| "ptl" "platform/intel/ptl.conf" |
There was a problem hiding this comment.
This is missing "nvl". On purpose?
There was a problem hiding this comment.
Good catch — added "nvl" "platform/intel/ptl.conf" to IncludeByKey.PLATFORM in both cavs-dmic-ssp-lbm-webrtc-aec.conf (commit aaa4b0791) and cavs-nocodec-webrtc-aec.conf (commit dc5dd37e0), and verified both build cleanly with PLATFORM=nvl via alsatplg.
| @@ -51,7 +51,7 @@ manifest: | |||
| - name: webrtc-apm | |||
There was a problem hiding this comment.
Per AGENTS.md, AI agents do not add Signed-off-by tags; @lgirdwood will apply developer sign-off (git rebase --signoff) prior to merge.
There was a problem hiding this comment.
Fixed in rebase onto main (28cd724d3): added Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> across all 13 commits (88cac41ba..a3dac24e4).
4f70354 to
df5cfe3
Compare
|
Updated PR #11545 (HEAD
|
PR 11545: test resultsRun date: 2026-11-28 18:25 UTC Tested commit: e4903a7937447dd66184477a641a8349422597c0 |
Avoid STB_WEAK linkage on math functions under LL_EXTENSION_BUILD so Zephyr's Xtensa LLEXT loader relocates them properly instead of leaving zeroed literal pool entries. Add double-precision wrappers (pow, log, log10, floor, ceil, round, sin, cos) for C++/AEC3 targets, and replace the hardcoded developer toolchain path in CMakeLists.txt with portable discovery. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
df5cfe3 to
a3dac24
Compare
commented
Nov 28, 2026
|
Rebased onto latest
|
| if (id == 0) { | ||
| cd->enabled = (value != 0); | ||
| comp_info(dev, "webrtc_aec: switch enable = %d", cd->enabled); | ||
| return 0; | ||
| } | ||
| if (id == 1) { |
There was a problem hiding this comment.
can we use macros for the control IDs. These need to align with topology IDs
There was a problem hiding this comment.
Done in 7ffd360: added WEBRTC_AEC_CTL_ID_ENABLE (0), WEBRTC_AEC_CTL_ID_HIGH_SUPPRESSION (1), and WEBRTC_AEC_CTL_NUM_ELEMS (1) in src/audio/webrtc_aec/webrtc_aec.h matching the 0-based Object.Control.mixer instances in webrtc-aec.conf, and used them across apply_ctl(), get_config(), and webrtc_aec_ztest.c.
| struct comp_dev *dev = mod->dev; | ||
|
|
||
| webrtc_aec_set_active_mod(mod); | ||
| #ifdef CONFIG_IPC_MAJOR_4 |
There was a problem hiding this comment.
| if (num_of_sources <= 1) | ||
| return; | ||
|
|
||
| #ifdef CONFIG_IPC_MAJOR_4 |
There was a problem hiding this comment.
Done in 2218d20: removed the pipeline-ID heuristic fallback and unused sink parameters in webrtc_aec_resolve_sources(), resolving mic (queue 0) vs. ref (queue 1) strictly via IPC4_SINK_QUEUE_ID().
Require IPC_MAJOR_4 in Kconfig, drop IPC3 switch fallback and pipeline-ID fallback, use WEBRTC_AEC_CTL_ID_* macros aligned with topology mixer IDs, remove unused ipc4/aec.h, and validate IPC4 get_config fragment bounds. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Extract apply_cfg helpers in the Float and AECm backends and webrtc_aec_reset_resamplers() in core so reset() preserves suppression and clean resampler state. Move 16 kHz resampler scratch buffers from the real-time thread stack into struct webrtc_aec_comp_data. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Resolve mic and reference sources dynamically per call, validate dynamic reference stream channel/format mismatches before reading, return errors from src_drop_frames(), and drain only surplus reference frames when idle. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Decouple microphone and reference channel counts across the core module and backends, add optional stereo reference downmixing (WEBRTC_AEC_STEREO_DOWNMIX_REF), and remove ch0-cloning so Float and AECm process all mic channels independently. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Support 32 kHz pipelines via WebRtcSpl_DownsampleBy2 and WebRtcSpl_UpsampleBy2, adding resample_by_2.c to built-in and LLEXT builds and stubbing it for stub-backend builds. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add WEBRTC_AEC_DELAY_MS and WEBRTC_AEC_DELAY_AGNOSTIC configuration, backend set_delay()/get_metrics() hooks, Float metrics reporting, and configurable msInSndCardBuf delay in Float and AECm backends. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add webrtc_aec3_cfg options and Kconfigs for asymmetric R x C MIMO, filter blocks, coarse filter fallback, stereo content detection, and external delay estimation; replace DP-thread reallocation with atomic handoffs; support 8 kHz frames; and add delay/metrics helpers. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Document 32 kHz resampling support, asymmetric up-to-4x4 R x C MIMO operation, and all new AEC / AEC3 / Float Kconfig options. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add Zephyr native_sim IPC4 unit tests covering stereo 2x2 independence and ERLE, asymmetric 2R x 1C (16 kHz) and 2R x 4C (32 kHz) multi-channel processing, 48 kHz S32_LE bypass, IPC4 switch controls via WEBRTC_AEC_CTL_ID_*, get_configuration readback, and reset(). Reuse unit/common/sof_context.c. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Parameterize sample rate, bits, format, channel counts/maps, and rate-matched SSP hw_config (48k/16k) on cavs-nocodec-webrtc-aec.conf, add nvl platform mapping, and add -16k and -2r1c targets. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add hybrid DMIC0 capture + SSP2 digital loopback (lbm_mode) speaker reference AEC topology and TGL/PTL build targets (with nvl mapping). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Update webrtc-apm module revision to 07232bb5e5252210da688796eac66538ca8d5939 with linear-only Classic Float AEC updates. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
a3dac24 to
e4903a7
Compare
commented
Nov 28, 2026
|
Addressed latest review feedback and force-pushed e4903a7:
Verified locally after the rebase on |
commented
Nov 28, 2026
|
CI unrelated. |
Changes made as requested and agents.md updated to reflect that.
Summary
Rebased cleanly onto
main(28cd724d3), split into 13 small single-concern signed-off commits (88cac41ba..a3dac24e4), and pairs withthesofproject/sof-test#1369(topic/webrtc-aec-ssp-loopback) andthesofproject/sof-test#1370(topic/webrtc-tests).Patch Series (
88cac41ba..a3dac24e4)audio: webrtc_aec: fix LLEXT math linkage and CMake path— Omit__attribute__((weak))underLL_EXTENSION_BUILDwith aTODOto restore uniform__attribute__((weak))linkage once Zephyr's Xtensallext_link_plt()supportsSTB_WEAKrelocations (fixing a runtimeInstFetchPrivilegeCause/PC=0panic found on WCL hardware), add double-precision wrappers for C++, add non-PIC Xtensawebrtc_aec.cmakeflags, and replace the hardcoded toolchain path.audio: webrtc_aec: clean up IPC3/IPC4 config bounds and dead stub— Drop unusedsof_ipc4_aec_config/<ipc4/aec.h>, add bounds-checked IPC3 switch handling, validateget_configsize, and sharewebrtc_aec_apply_ctl().audio: webrtc_aec: preserve backend config on reset and slim stack— Extractapply_cfg+webrtc_aec_reset_resamplers()forreset()and move16 kHzscratch arrays from stack tocomp_data.audio: webrtc_aec: dynamically resolve ref source and drop surplus— Dynamic pin/pipeline source resolution, ref channel/format validation on mismatch, error-checkedsrc_drop_frames(), and surplus-only draining inis_ready_to_process().audio: webrtc_aec: support multi-channel and asymmetric R x C— Decouplemic_channels/ref_channels, remove ch0-cloning so Float and AECm process all mic channels independently, and addCONFIG_WEBRTC_AEC_STEREO_DOWNMIX_REF.audio: webrtc_aec: add 32 kHz resampling support— 32 kHz ↔ 16 kHz resampling viaWebRtcSpl_DownsampleBy2/UpsampleBy2(resample_by_2.c).audio: webrtc_aec: add delay, delay-agnostic, and metrics controls—WEBRTC_AEC_DELAY_MS,WEBRTC_AEC_DELAY_AGNOSTIC, andset_delay()/get_metrics().audio: webrtc_aec3: support asymmetric R x C MIMO and lock-free ctls—webrtc_aec3_cfgKconfigs, atomic suppression/delay handoff intoprepare()/reset(), 8 kHz support, and buffer rebuilds oninit().docs: webrtc_aec: update README for 32 kHz, 4x4 MIMO, and Kconfigs— Syncsrc/audio/webrtc_aec/README.md.test: ztest: add webrtc_aec stereo, bypass, and 32/48 kHz unit tests—native_simztest suite (with per-source-Wno-double-promotionfor Clang-WerrorCI).topology2: development: parameterize nocodec SSP loopback AEC— Rate-matchedhw_config(48 kHz/16 kHz),nvlplatform mapping,-16kand-2r1ctargets.topology2: development: add DMIC + SSP2 loopback AEC topology— HybridDMIC0capture +SSP2lbm_modeloopback topology withnvlmapping for TGL/PTL.west.yml: bump webrtc-apm to 07232bb5e525— Linear-only Classic Float AEC updates (07232bb).Verification Results (against rebased tree
88cac41ba..a3dac24e4/ priordf5cfe350)ztest(host/llvm, Clang 20.1.8,CONFIG_COMPILER_WARNINGS_AS_ERRORS=y): Re-verified ona3dac24e4—3/3passed (test_asymmetric_2r1c_and_2r4c_32k,test_bypass_48k_s32_and_controls,test_stereo_2x2_independence_and_erlewith53.51 dBERLE).intel_adsp/ace30/ptl,FLOAT=m,CONFIG_COMP_BT_CODEC=nlocally): Re-verified ona3dac24e4—webrtc_aec.llext(0WEAKsymbols) +zephyr.elfbuilt cleanly.Ladybird, WCL-U RVP,sof-wcl.ri+sof-wcl-openmodules.riFloat LLEXT): Verified liveaplay+arecordonsof-wcl-rt722-aec.tplgacrossAEC switch=0,AEC switch=1(S16_LE), andAEC high suppression switch=1(S32_LE) with 0 DSP panics or kernel errors.ptlAEC3=y,AECM=m;tglFLOAT=y) & Topology2 (alsatplg7 AEC targets +PLATFORM=nvl): Verified on identical pre-comment-only treedf5cfe350.