AEC2 Overview¶
The older WebRTC echo cancellation implementation (AEC2) is less timing sensitive than AEC3 for some pipelines.
- AEC3 implementation:
libs/libwebrtc-aec - AEC2 implementation:
libs/libwebrtc-aec2
Source Extraction Map¶
AEC2 was extracted from $(HOME)/webrtc-aec2/src/webrtc into libs/libwebrtc-aec2/apm/webrtc using the same extraction approach as the AEC3 subtree.
Included source subtrees/files:
modules/audio_processing/aec(legacy AEC2 core and C API)modules/audio_processing/utility(delay estimator support used by AEC2)common_audio/signal_processing(signal processing primitives used by AEC2)common_audio/ring_buffer.c,common_audio/ring_buffer.hcommon_audio/wav_file.h(header dependency in AEC internals)system_wrappers/interface/cpu_features_wrapper.hsystem_wrappers/interface/compile_assert_c.hsystem_wrappers/source/cpu_features.cctypedefs.h
Wrapper API exposed to the app:
libs/libwebrtc-aec2/apm/WebRtcAec.hlibs/libwebrtc-aec2/apm/WebRtcAec.cpp
The wrapper preserves the existing app-facing WebRtcAec class shape used by AudioMgr.
Build Notes¶
The AEC2 target is built as static library webrtc-aec2 from libs/libwebrtc-aec2/apm/CMakeLists.txt.
Architecture-sensitive filtering is required when globbing signal processing sources:
- Exclude
*_mips.con non-MIPS builds. - Exclude
*_neon.cunless building ARM64.
This avoids non-native asm compilation failures on x64 hosts.
Selecting AEC2 vs AEC3¶
The root CMake option controls backend selection:
set(USE_AEC2 1): builds and linkslibs/libwebrtc-aec2set(USE_AEC2 0): builds and linkslibs/libwebrtc-aec
The configure log prints the active backend selection.