From 62283c0ebf787d81132f5eee5c8eec6588a46785 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Tue, 13 Mar 2012 19:43:47 +0000 Subject: [PATCH] Quick fix to avoid non-causal AEC signals on PulseAudio. BUG=340 TEST=manually with voe_cmd_test Review URL: https://webrtc-codereview.appspot.com/451007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1884 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/source/linux/audio_device_pulse_linux.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/audio_device/main/source/linux/audio_device_pulse_linux.cc b/src/modules/audio_device/main/source/linux/audio_device_pulse_linux.cc index 917229701a..449ae8e093 100644 --- a/src/modules/audio_device/main/source/linux/audio_device_pulse_linux.cc +++ b/src/modules/audio_device/main/source/linux/audio_device_pulse_linux.cc @@ -2712,8 +2712,16 @@ WebRtc_Word32 AudioDeviceLinuxPulse::ProcessRecordedData( } } - // Set vqe data const WebRtc_UWord32 clockDrift(0); + // TODO(andrew): this is a temporary hack, to avoid non-causal far- and + // near-end signals at the AEC for PulseAudio. I think the system delay is + // being correctly calculated here, but for legacy reasons we add +10 ms to + // the value in the AEC. The real fix will be part of a larger investigation + // into managing system delay in the AEC. + if (recDelay > 10) + recDelay -= 10; + else + recDelay = 0; _ptrAudioBuffer->SetVQEData(_sndCardPlayDelay, recDelay, clockDrift); // Deliver recorded samples at specified sample rate,