Commit a7e9ed7
committed
Add echo cancellation to loopback audio capture
When sharing system audio in stereo, playback leaks back through the
capture path and remote participants hear an echo. This adds a
WebRTC AudioProcessing (AEC) stage to the OpenAL capture loop inside
MixingAudioDeviceModule:
- Create an AudioProcessing instance with echo_canceller enabled
(mobile_mode) when the capture device opens in stereo.
- Feed far-end (rendered) audio into ProcessReverseAudioFrame via
LoopbackCaptureTakeFarEndLinux, which returns the estimated delay.
- Run the captured microphone + loopback mix through
ProcessAudioFrame before pushing samples to the collector.
- Track capture activity with SetLoopbackCaptureActiveLinux so the
far-end buffer is only maintained while capture is running.
Falls back to the existing non-AEC path when stereo capture is not
available or no far-end reference frame is ready.1 parent 01e1575 commit a7e9ed7
1 file changed
Lines changed: 965 additions & 0 deletions
0 commit comments