I have been trying different things to get AEC working on Android. As I found, if I hardcode the delay offset (with set_delay_offset_ms()) to an estimated value(e.g. 300ms), the pcm plots shows the echo is cancelled out when the near_end and far_end voice are aligned. But in Android, it does not cancel well since the total delay changes over the time, especially the far_end delay.
I saw the WebRTC code uses PlayAudio() time for "t_render" and RecordAudio() time for "t_capture", based on that, derive the total delay in SetVQEData().
BUT the problem is in Android, the total delay derived from SetVQEData() is way off. Can anyone share any experience getting AEC working on Android or it is simply not supported on Android?
Here is the rule used to calculate the delay from audio_processing.h:
// delay = (t_render - t_analyze) + (t_process - t_capture)
// where,
// - t_analyze is the time a frame is passed to AnalyzeReverseStream() and .
// t_render is the time the first sample of the same frame is rendered by
// the audio hardware.
// - t_capture is the time the first sample of a frame is captured by the
// audio hardware and t_pull is the time the same frame is passed to
// ProcessStream().