Repository navigation
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.
Add multi-channel stereo/MIMO processing (up to 4 mic x 4 ref channels), 32 kHz internal sample rate with linear resampler support, and IPC/Kconfig controls across the Float, AECM, and AEC3 backends. Addresses PR thesofproject#11545 review feedback: - Remove hardcoded /home/lrg toolchain fallback in CMakeLists.txt - Fix IPC3 fragment_size bounds check for payload headers - Validate dynamic reference stream channels/format on mismatch and check src_drop_frames() errors before clamping block frames - Move per-block int16 scratch buffers (3840 bytes) into comp_data - Remove dead IPC4_AEC_SET_EXT_FMT stub and integer delay switch overload - Replace DP-thread AEC3 engine recreation with lock-free atomic state handoff applied in prepare()/reset(), support 8 kHz frame sizes, and rebuild buffers on init() sample rate change - Guard against non-positive channel/sample counts in Float/AEC3 downmix - Extract shared apply_cfg and resampler reset helpers for reset() - Sync README.md with 32 kHz, up to 4x4 asymmetric R x C, and Kconfig options
Add Zephyr native_sim unit tests exercising mono 16 kHz, stereo 2x2 16 kHz / 48 kHz resampled echo cancellation (Float and AECM backends), runtime bypass/suppression/delay controls, and component reset(). Addresses PR thesofproject#11545 review feedback: - Remove -Wno-implicit-function-declaration and align includes with main - Unlink buffer list nodes and call comp_free() before buffer_free() - Replace legacy switch ctl id=2 with backend->set_delay()
Add 16 kHz and asymmetric 2-ref/1-mic (2r1c) nocodec SSP loopback AEC topologies along with DMIC + SSP2 loopback AEC topologies for TGL and PTL. Addresses PR thesofproject#11545 review feedback: - Set MIC_CH_MAP=0xFFFFFFF0 on sof-ptl-nocodec-webrtc-aec-2r1c - Match SSP BCLK/FSYNC to 16 kHz (1024000 Hz / 16000 Hz) via literal hw_config entries and default_hw_conf_id selection
0fd4712 to
4f70354
Compare
|
All review comments have been addressed and the branch has been rebased cleanly onto
|
kv2019i
left a comment
There was a problem hiding this comment.
A bit hard to review with lots of different types of changes put into single commits. SOBs missing from all commits.
| @@ -40,13 +40,30 @@ else() | |||
| else() | |||
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.
| $<$<COMPILE_LANGUAGE:CXX>:${_sdk_cxx_dir}/include/c++/14.3.0/xtensa-${_xtensa_target}_zephyr-elf> | ||
| $<$<COMPILE_LANGUAGE:CXX>:${_sdk_cxx_dir}/include> | ||
| ) | ||
| set(_sdk_cxx_dir "") |
There was a problem hiding this comment.
This is doing all sorts of things in a single commit, please split into multiple commits with "one commit per logical change" approach.
There was a problem hiding this comment.
Split into 13 small single-concern commits (991f7b95e..df5cfe350): separating LLEXT/CMake linkage, IPC config cleanup, reset/stack safety, dynamic ref source guards, multi-ch asymmetric R x C, 32 kHz resampling, delay/metrics controls, AEC3 MIMO/atomics, docs, ztest, nocodec topology, DMIC+SSP2 topology, and west.yml.
| @@ -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.
| @@ -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.
| "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.
lgirdwood
left a comment
There was a problem hiding this comment.
This needs split into smaller patches that just deal with 1 thing or a few things if they are tightly bound.
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.
Remove unused sof_ipc4_aec_config and <ipc4/aec.h>, add bounds-checked IPC3 switch control handling and IPC4 get_config fragment_size validation, clear active module pointer safely in free(), and share webrtc_aec_apply_ctl().
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.
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.
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.
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.
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.
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.
Document 32 kHz resampling support, asymmetric up-to-4x4 R x C MIMO operation, and all new AEC / AEC3 / Float Kconfig options.
Add Zephyr native_sim 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, runtime controls, and component reset(). Fix source-level -Wno-double-promotion for Clang CI builds.
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.
Add hybrid DMIC0 capture + SSP2 digital loopback (lbm_mode) speaker reference AEC topology and TGL/PTL build targets (with nvl mapping).
Update webrtc-apm module revision to 07232bb5e5252210da688796eac66538ca8d5939 with linear-only Classic Float AEC updates.
4f70354 to
df5cfe3
Compare
|
Updated PR #11545 (HEAD
|
PR 11545: test resultsRun date: 2026-11-27 21:44 UTC Tested commit: df5cfe350b7a27a10d7cbc786416a9ead62a3e42 |
Summary
Rebased cleanly onto
main(032bf6eb6), split into 13 small single-concern patches (991f7b95e..df5cfe350), and pairs withthesofproject/sof-test#1369(topic/webrtc-aec-ssp-loopback) andthesofproject/sof-test#1370(topic/webrtc-tests).Patch Series (
991f7b95e..df5cfe350)audio: webrtc_aec: fix LLEXT math linkage and CMake path— Omit__attribute__((weak))underLL_EXTENSION_BUILDso Zephyr's Xtensa LLEXT loader relocateswebrtc_aec-math.csymbols properly (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
df5cfe350)ztest(host/llvm, Clang 20.1.8,CONFIG_COMPILER_WARNINGS_AS_ERRORS=y):3/3passed (test_asymmetric_2r1c_and_2r4c_32k,test_bypass_48k_s32_and_controls,test_stereo_2x2_independence_and_erlewith53.51 dBERLE).Ladybird, WCL-U RVP,sof-wcl.ri+sof-wcl-openmodules.riFloat LLEXT):sof-wcl-rt722-aec.tplg(SDW RT722 speaker ref + SmartMic viawebrtc-aec,backend='aec_float',16 kHz,S32_LE/S16_LE).aplay+arecordacrossAEC switch=0(bypass),AEC switch=1(S16_LE), andAEC high suppression switch=1(S32_LE) with 0 DSP panics and 0 kernel errors. (Note: Ladybird RVPhw:0,4SmartMic has no active physical transducer, so acoustic cancellation magnitude was verified vianative_simztest while live DSP scheduling/LLEXT execution/controls were verified on Ladybird silicon.)zephyr-sdk-1.0.1,CONFIG_COMP_BT_CODEC=nlocally due to missingliblc3):intel_adsp/ace30/ptl(AEC3=y): built & linked cleanly.intel_adsp/ace30/ptl(FLOAT=mLLEXT):webrtc_aec.llext+zephyr.elfbuilt cleanly.intel_adsp/ace30/ptl(AECM=mLLEXT):webrtc_aec.llext+zephyr.elfbuilt cleanly.intel_adsp/cavs25/tgph(FLOAT=y): built & linked cleanly.intel_adsp/ace30/wcl(FLOAT=mLLEXT, debug-key signed):sof-wcl.ri+sof-wcl-openmodules.ribuilt cleanly.alsatplg): All 7 AEC targets +PLATFORM=nvlbuilds for bothcavs-nocodec-webrtc-aec.confandcavs-dmic-ssp-lbm-webrtc-aec.confpassed with 0 errors.