Skip to content

aec3: revert the soft-float optimizations and add runtime AEC output selection - #3

Open
singalsu wants to merge 5 commits into
thesofproject:sof-hififrom
singalsu:aec3_native_float
Open

singalsu wants to merge 5 commits into
thesofproject:sof-hififrom
singalsu:aec3_native_float

Conversation

@singalsu

@singalsu singalsu commented Dec 4, 2026

Copy link
Copy Markdown
  • Revert the AEC3 soft-float and stereo 2x2 MIMO optimization commits (3c4c034, 3e9c41a). SOF builds AEC3 for the HiFi4 hardware FPU now, so the AEC3 code goes back to the upstream WebRTC version, which is easier to maintain.
  • Keep the parts of 3c4c034 that SOF needs to build AEC3: the gtest_prod_util.h and field trial stubs, the lightweight audio buffer include paths, and the stdint.h include in vector_math.h.
  • Fix AEC3 with a refined filter shorter than 9 blocks. The early reverb estimator size used to wrap to a huge value and the allocation failed. SOF's real-time stereo AEC3 setup uses 8 blocks.
  • Float AEC: replace the build-time WEBRTC_AEC_LINEAR_ONLY choice with the runtime WebRtcAec_enable_linear_only(). Each SOF AEC instance can then choose between the linear filter output (wake on voice) and residual echo suppression (VoIP) from its topology bytes control. The define remains the default.
  • Float AEC: add WebRtcAec_set_normal_mu() to set the filter adaptation step size after init.
  • Tested on PTL with SOF webrtc_aec: Float AEC with a mono echo reference and AEC3 with a stereo reference, in the same firmware build.

Keep the parts of commit 3c4c034 that are needed to build AEC3 in SOF
and are not soft-float optimizations: the gtest_prod_util.h stub, the
field trial stubs, the lightweight audio buffer include paths and the
stdint.h include in vector_math.h.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The early reverb length estimator is sized with the refined filter
length minus 9 blocks. With a shorter filter the vector size wraps to a
huge value and the allocation fails. Limit the size to zero, as in
commit 3c4c034.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Replace the build time WEBRTC_AEC_LINEAR_ONLY choice between the linear
filter error output and the residual echo suppression (NLP) with the
runtime WebRtcAec_enable_linear_only(), so that each AEC instance can
select its output. The define remains the default that
WebRtcAec_InitAec() sets. Add also WebRtcAec_set_normal_mu() to set
the normal filter adaptation step size after the initialization.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
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.

1 participant