AEC on Android not working

762 views
Skip to first unread message

Robert Li

unread,
Dec 8, 2014, 4:28:29 PM12/8/14
to discuss...@googlegroups.com
Hi,

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().

Henrik Andreasson

unread,
Dec 9, 2014, 4:09:28 AM12/9/14
to discuss...@googlegroups.com
We are working on alternative solutions where one is to support built-in (hardware) echo control to remove the dependency of delay estimates.
You can track progress here.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Li

unread,
Dec 9, 2014, 12:34:16 PM12/9/14
to discuss...@googlegroups.com
Henrik,

As I found, the built-in EC is not supported on many of today's phones. So, we need a secondary option for our VOIP app.

Can you please advise if the current WebRTC AEC is supported on Android? If yes, do you have any sample code or unit test case to share with us? 

One question for the "delay". it looks like AEC is depending on the users to set the delay with API set_delay_offset_ms(). shouldn't the APM algorithm detect the delay itself? such as using the far_end speaker signal pattern to calculate how late it arrives the near_end.

regards
Robert

Henrik Andreasson

unread,
Dec 9, 2014, 1:39:03 PM12/9/14
to discuss...@googlegroups.com
As I found, the built-in EC is not supported on many of today's phones. So, we need a secondary option for our VOIP app.

It is not supported on all but on many of the most common devices. Do you have issues with any particular model?

Can you please advise if the current WebRTC AEC is supported on Android? If yes, do you have any sample code or unit test case to share with us? 

The default AEC provided by WebRTC for Android is the AECM version and it can be tested in the WebRTCDemo. I don't know the exact details and there might be more isolated unit tests.
 

One question for the "delay". it looks like AEC is depending on the users to set the delay with API set_delay_offset_ms(). shouldn't the APM algorithm detect the delay itself? such as using the far_end speaker signal pattern to calculate how late it arrives the near_end.

The AECM requires high-quality, external, delay estimates. We are working on reducing the need for perfect delay estimates but nothing is released yet.
Reply all
Reply to author
Forward
0 new messages