Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voice/Video chat beta: Missing Echo Cancellation #6241

Closed
2 tasks done
Spindel opened this issue Feb 16, 2017 · 109 comments
Closed
2 tasks done

Voice/Video chat beta: Missing Echo Cancellation #6241

Spindel opened this issue Feb 16, 2017 · 109 comments
Milestone

Comments

@Spindel
Copy link

Spindel commented Feb 16, 2017

I have:


Bug description

When doing an audio call on Speaker mode in the new Voice/Video call beta enabled, you can hear your own voice clearly reflected through the microphone. This causes a rather high level of annoyance as you hear your own voice, with a double round-trip time in between, making it a very sad communication companion that constantly interrupts you when you speak.

Steps to reproduce

  • Enable voice calling beta
  • Put both phones on speaker mode
  • Pull up volume a bit
  • Speak slowly and hear your own voice with a delay, routed through the aether.

Actual result:
Annoyingly noise of your own voice

Expected result: Effective echo cancellation on the remote side that cancels out the noises from the speaker against the microphone.

Screenshots

Not applicable

Device info

Device 1: Fairphone 2
Device 2 Nexus 5x
Android version: 7.1.1 and the current fairphone (5/6 something?)
Signal version: Pass.

Link to debug log

Not applicable.

@haffenloher
Copy link
Contributor

Do you observe this on both ends?

Just to be sure: are the devices isolated from each other / in different rooms?

@moxie0
Copy link
Contributor

moxie0 commented Feb 17, 2017

Some devices have broken hardware AEC. If you hear echo, the problem is on the other end (that device isn't canceling out the speaker audio from the microphone input), so we'd need information about the device on the other side.

@Spindel
Copy link
Author

Spindel commented Feb 17, 2017

It was observed on one end, devices are isolated from each other with a nice wide swath of ocean and some land.

The device that would be missing AEC would be the Fairphone2, which is also, sadly, the one that I don't have here to get specifications & logs from.

@FeuRenard
Copy link
Contributor

I have a Fairphone 2. I will try to reproduce this issue in the next few days.

@FeuRenard
Copy link
Contributor

Just tested it. I heard a very clear echo speaking into device XU -> FP's echo cancellation failed. I heard the echo cancellation working speaking into device FP -> XU's echo cancellation works fine. There is always some soft noise coming from FP's earphone but directly after I spoke a word into FP this noise was somehow disturbed. I interpreted this as working echo cancellation.

tl;dr I can reproduce this issue and it's device FP's fault.

Device info FP

Device: Fairphone 2
Android version: 5.1.1
Signal version: 3.29.6

Device info XU

Device: Sony Xperia U
Android version: 4.4.4
Signal version: 3.29.6

@Spindel
Copy link
Author

Spindel commented Feb 17, 2017 via email

@FeuRenard
Copy link
Contributor

I tested the dialer app with my landline phone and I hear no echo speaking to my landline phone. But maybe the landline phone can also do echo cancellation for the other side...

Can you follow up with upstream fairphone?

I just revived this thread: https://forum.fairphone.com/t/echo-with-google-hangout/15745

@moxie0
Copy link
Contributor

moxie0 commented Feb 17, 2017

@FeuRenard I can try blacklisting the fairphone from hardware AEC in the webrtc code, can you give me the fairphone2's "ro.product.model" string?

@FeuRenard
Copy link
Contributor

In settings -> about phone -> model number it says "FP2". Is this what you want? If not: From where can I get this string?

@moxie0
Copy link
Contributor

moxie0 commented Feb 17, 2017

Yeah I think that's it

@moxie0 moxie0 self-assigned this Feb 17, 2017
@moxie0 moxie0 added the webrtc label Feb 17, 2017
@moxie0
Copy link
Contributor

moxie0 commented Feb 17, 2017

@FeuRenard can you try this test apk on your FP2 and see if that helps?

@FeuRenard
Copy link
Contributor

I tried. Good news: echo cancellation seems to work with this apk. Bad news: Fairphone 2 reboots after a couple of seconds.

@moxie0
Copy link
Contributor

moxie0 commented Feb 17, 2017

Hah, what!? Just... reboots?

@FeuRenard
Copy link
Contributor

Yes. 4 out of 5 times I tried it rebooted. I sent you logcat of the final seconds before reboot via e-mail if you are interested.

@rainerzufall
Copy link

@FeuRenard can you explain how to install this apk (in the community forum for example)? Can i run it alongside my normal signal installation? Then I could try and test it on my Fairphone 2 tomorrow...

@moxie0
Copy link
Contributor

moxie0 commented Feb 17, 2017

Sounds like the fairphone has some issues. Either they need to fix the AEC or they need to fix the crash, I don't think there's anything else I can do.

@Trolldemorted
Copy link
Contributor

My redmi note 3 pro is displaying the same issues: my conversation partner is complaining about echo, but on my end everything is fine.

If you push your commits from your testapk somewhere i can give it a shot.

getprob says:

[ro.product.board]: [MSM8952]
[ro.product.brand]: [Xiaomi]
[ro.product.cpu.abi]: [arm64-v8a]
[ro.product.cpu.abilist]: [arm64-v8a,armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: [arm64-v8a]
[ro.product.device]: [kenzo]
[ro.product.locale]: [en-US]
[ro.product.manufacturer]: [Xiaomi]
[ro.product.model]: [Redmi Note 3]
[ro.product.name]: [cm_kenzo]

Despite it saying redmi note 3 it is a redmi note 3 pro, which has slightly different hardware.

@FeuRenard
Copy link
Contributor

Just for the record:
My conversation partner even complains about hearing herself while none of us uses the speaker mode. She uses an iPhone SE and I use a Fairphone 2.

@haffenloher
Copy link
Contributor

haffenloher commented Feb 28, 2017

@FeuRenard interesting. Sounds just like something I experienced when calling a Xiaomi Mi4 (ro.product.model = "MI 4LTE"):

  1. I heard a loud, clear, and very disturbing echo with a delay of maybe 1-2 seconds, regardless of whether the Mi4's speaker was on or off.
  2. The first words of every sentence I spoke could be heard clearly on the Mi4, but (roughly) as soon as I started hearing the echo, my voice started to drop out on the Mi4. To be understood, I had to stop every few words and wait till the echo subsided.

We tried every combination of the three blacklists in WebRtcAudioUtils.java. The minimal change required to make it work properly was to add "MI 4LTE" to both the OPEN_SL_ES and the AEC blacklists. Tested in a 40 minute video call with speaker mode on and off, no problems.

If you're interested in investigating this further, I could provide you with test builds of the AppRTC demo app with and without your model blacklisted.

@skulumani
Copy link

I've noticed similar echo issues with a Samsung S5? Is there any similarity between the hardware on these devices?

@haffenloher
Copy link
Contributor

@skulumani what exactly are you seeing? You're hearing an echo when you do a WebRTC call to someone who has a Samsung Galaxy S5 and they enable speaker mode?

@Trolldemorted
Copy link
Contributor

ftr: i too was not using the speaker mode, but the other party complained about echo.

@skulumani
Copy link

skulumani commented Mar 1, 2017 via email

@jeremymasters
Copy link

By the way @moxie0, I have an s5 I could test on if needed.

@swltr
Copy link

swltr commented Mar 19, 2017

We're hearing echoes since video calls were added, too. (When video calls were in opt-in beta, we enabled it for testing, heard the echoes and disabled it again.) Before, we didn't hear any echoes at all.

Both devices are Wileyfox Swift (and the echoes can be heard on both ends).

@0o-o0
Copy link

0o-o0 commented Mar 20, 2017

I am still getting echoes (Pixel Phone to Pixel Phone). One thing that I noticed is that I have speaker on when the video call starts. If I turn speaker off it mitigates the echoing (but doesn't make it go away). With speaker off it is still loud enough for me to hear the other person (in a quiet room). Not sure if it's being tested with/without speaker.

@moxie0
Copy link
Contributor

moxie0 commented Mar 20, 2017

Seems like we should get more aggressive about adding devices to the hardware AEC blacklist. @haffenloher I'm surprised that OpenSL was a contributing factor with echo.

moxie0 added a commit that referenced this issue Mar 20, 2017
@haffenloher
Copy link
Contributor

haffenloher commented Jul 5, 2017

@lantsem What does that mean? You're hearing echo when you're talking to someone else who has a Moto X (2014) running LineageOS 14.1 and Signal 4.7.4?

edit: sorry, just scrolled back through this thread, looks like you're aware of this distinction, so the answer is probably yes :)

@minnmann
Copy link

minnmann commented Jul 5, 2017

Moto X (2014) running LineageOS 14.1 got echo again with 4.7.4.

I'm running 4.7.4 with Android 6.0 on a Moto X 2014 (XT1092), too (since the beta has been available). The other side is usually a Galaxy A5 2015 (SM-A500FU) and we do not have any echo or other calling issues, even outside when I'm using my Moto X and it's quite windy.

@lantsem
Copy link

lantsem commented Jul 5, 2017

@haffenloher Yes, from several phones that I tested with 4.7.4 only Moto X 2014 running LOS 14.1 shows an issue. But the impression was created that the echo became less noticeable for normal talk (not on speaker).

@minnmann My second Moto X 2014 with stock 6.0 didn't have echo with hardware AEC even with OpenSL ES. I wrote about it earlier.

@lantsem
Copy link

lantsem commented Jul 6, 2017

Moto G5 with stock 7.0 and 4.7.4 also has an echo with speaker mode.

@adlererik
Copy link

Was having echo issues with the Moto G5. Compiled v4.7.4 with add("Moto G5"); in the blacklist.
No more tortuous echo for the people that listen to me.

src/org/thoughtcrime/securesms/ApplicationContext.java

private void initializeWebRtc() {
Set HARDWARE_AEC_BLACKLIST = new HashSet() {{
add("Pixel");
add("Pixel XL");
add("Moto G5");
......

Echo is gone. Works well now. Could you add the Moto G5. It has a very broken AEC

@haffenloher
Copy link
Contributor

@adlererik with the Moto G5's stock rom or with a custom OS?

moxie0 added a commit that referenced this issue Jul 21, 2017
@moxie0
Copy link
Contributor

moxie0 commented Jul 21, 2017

@adlererik What happens when you also add Moto G5 to the opensles whitelist?

@moxie0 moxie0 removed their assignment Jul 21, 2017
@adlererik
Copy link

adlererik commented Sep 18, 2017

@moxie0 Sorry for the late response. Have tested two Moto G5 phones with opensles whitelisted

Signal v4.9.9 and v4.10.10 tested.
Phone 1: Moto G5 100% stock unrooted
Phone 2: Moto G5 LineageOS

src/org/thoughtcrime/securesms/ApplicationContext.java

  Set<String> HARDWARE_AEC_BLACKLIST = new HashSet<String>() {{
    add("Pixel");
    add("Pixel XL");
    add("Moto G5");

  Set<String> OPEN_SL_ES_WHITELIST = new HashSet<String>() {{
    add("Pixel");
    add("Pixel XL");
    add("Moto G5");

Test conditions:
Both Moto G5s called each other. Both Moto G5s called an iPhone 6.

Results:
Additionally whitelisting opensles ever so slightly might have improved the sound on the stock G5 during phone conversations. This is subjective. No improvement was noted with LineageOS.

Conclusion:
a) Using AEC_BLACKLIST is a must have as AEC is broken on the G5. OPEN_SL_ES_WHITELIST is probably redundant.
b) Lenovo Moto hw is junk and their code is profoundly buggy.

@equaeghe
Copy link

My Samsung GT-I9192 Galaxy S4 Mini Duos (serranodsxx) with Signal 4.11.5 on Android 7.1.2 (LineageOS 14.1-20170615-nightly-serranodsdd) is causing echo for other end (Samsung Note 3, I think).

This echo gets worse when a headphone is used on my end. This means that the echo does not originate from my microphone picking up the other end's audio, but must happen inside the system/software stack. (Perhaps echo cancellation is effectively adding the echo?)

  • Is it possible to add the GT-I9192 to the blacklist? (Cf. blacklist request for variant GT-I9195 above by @haffenloher.)
  • Is it possible to disable echo cancellation when headphone output only is used? (Should be most energy efficient.)

The other end is my mother, who I'm trying to convince to continue using Signal, so this is important. ;-)

@haffenloher
Copy link
Contributor

I don't think I ever encountered a Lineage OS phone which didn't produce echo. If it's their bug, putting every Lineage user's phone on Signal's hardware blacklist would be counterproductive.

@AlfonsoMuskedunder
Copy link

@haffenloher I have made Signal calls regularly on a Moto G, Moto G2, and Moto G4 Play, all on LineageOS, and never experienced echo issues.

@equaeghe
Copy link

@AlfonsoMuskedunder To be sure: you do mean that no echo was produced at the other end, no? In any case, it may still be a LineageOS bug, but just not for all devices.

@haffenloher
Searching for ‘echo’ in the LineagOS bug tracker, I find the following reports (all reported for specific devices) that may be relevant:

Most promising:

  • Other Persons hears echo on line and skype – Also mentions echo is present when headphone is used

  • Phone echo – Little information in bug report, but a linked patch mentions something interesting about the second microphone:

    default backends of IN_HDMI_MIC and IN_HANDSET_MIC by qualcomm are defined for single mic devices which breaks secondary mic for noise cancellation on dual mic devices like onyx while recording audio on apps like whatsapp, telegram etc.

May be useful:

In any case, it may be useful to get a LineageOS developer to chip in here. I guess the best way is via a bug report in their tracker referencing this issue. I could do that, but I guess a Signal contributor would be better suited.

Also, to not let this idea fall by the wayside: Is disabling echo cancellation when using a headphone a possibility?

@lantsem
Copy link

lantsem commented Dec 3, 2017

@haffenloher Tested voice calls with Moto G and Galaxy S5, both on latest LineageOS 14.1 builds. They didn't have echo issue.

@Le1b1
Copy link

Le1b1 commented Dec 10, 2017

I have to report a massive echo during video calls with a Sony Xperia Z5 compact.

Model: E5823
Android-Version: 7.1.1
Signal-Version: 4.13.6

The owner is willing to update to a test-build or join the Beta-club.

@McLoo Do you still use that model and people you talk to can confirm the problem?

@ghost
Copy link

ghost commented Dec 11, 2017

I have an FP2 (Open OS v17.11.2) with Signal v4.13.6 installed via YalpStore. People I call experience an echo of themselves at their end unless I use headphones. This has been the case since August (following stable update releases).

@billie80
Copy link

If you read this thread from the beginning you will find out that this issue was originally about the FP2. Unfortunately this seems to be an issue with the hardware AEC of the Fairphone ROM. Additionally working around this by blacklisting hw AEC seems to make the phone crash. So if I got it correct Fairphone should either fix their hardware AEC or the crash when it is blacklisted.

@janvlug
Copy link

janvlug commented Dec 23, 2017

I experience an echo with someone who is using the following:
Device : OnePlus ONE E1003 (OnePlus)
Android : 5.1.1 (4, ONE E1003_14_160420)
Memory : 38M (33.31% free, 512M max)
Memclass: 192
OS Host : ubuntu-56
App : Signal 4.14.10

@ghostofkendo
Copy link

Similarly to @ghost, I have a Fairphone 2 running Fairphone Open OS v17.12.1 (based on Android 6.0.1) and Signal v4.14.10.
The people I call hear an echo of themselves as long as I don't use headphones, but I don't hear an echo of myself.

So I tried adding the Fairphone 2 to Signal's hardware AEC blacklist as follows, in src/org/thoughtcrime/securesms/ApplicationContext.java:

private void initializeWebRtc() {
    try {
      Set<String> HARDWARE_AEC_BLACKLIST = new HashSet<String>() {{
        add("Pixel");
        add("Pixel XL");
        add("Moto G5");
        add("FP2");
      }};

I only tried this change with a single call for now, but the other party's echo was almost gone (i.e. it was still there, but its volume was so low it wasn't really bothersome) and my FP2 did not crash.
The only downside is that I could hear a low-volume echo of myself, just like the other party, during that call.
Anyway, the situation is still better than with Signal 4.14.10 vanilla.

@minnmann
Copy link

After updating to 4.15 (beta), the following combination leads to an echo when using video chat:
Me: "motorola Moto G (5) (cedric)" (Moto G5), Signal 4.15 (beta)
Other person: "SM-A500FU" (Samsung Galaxy A5 2015), Signal 4.14 as well as Signal 4.15 (beta)

The echo occurs only on the other phone (Samsung A5). After 5-10 minutes the echo vanishes; only then and now some minor noise can be heard.

@codingluke
Copy link

codingluke commented Feb 3, 2018

I really appreciate the effort and all the new features coming to signal last year!

However, I can support @Le1b1 on echoing problems with the Sony Xperia Z5 Compact. I can hear my counterpart clearly, but they experience bad quality since the change to webRTC. This makes my live bringing friends and family to Signal quite hard. It would be very interesting to see what happens by adding all the Xperia Z5 models to the blacklist, as I only use signal for messaging these days.

I also support a settings feature to Enable/Disable AEC. I see the point that it is not easy understandable for non-techies that the one with the clear audio has to disable it. So what about a dialog after the call which asks something like, "did your counterpart complained about hearing himself during the call? (yes/no)" when they click yes, It will disable it, so there is no technical understanding needed.

Maybe this dialog has to be shown only once, or once after each update, to not annoy the ones that experience no problems. Also, on a yes, I would kindly ask if it would be possible to send the logs - by clicking a nice button in friendly letters - which would bring even more light to the problem.

Name: Sony Xperia Z5 Compact
Model: E5803
Android-Version: 7.1.1
Signal-Version: 4.15.5 / Happens also on all minor versions since webRTC

@mkampl
Copy link

mkampl commented Feb 9, 2018

My communication partners also hear them self, if I use headphones or speaker.

Phone: Honor 5X (KIW-L21)
OS: LineageOS 14.1 (Android 7.1.2)
Signal: 4.15.5

@equaeghe
Copy link

equaeghe commented Feb 9, 2018

I understand that you (the developers) would prefer a real solution instead of a workaround. But given that this issue with high impact has not been fixed for a while now, it seems to me that a workaround (setting, disabling AEC when using headphones,…) would be the right thing to do for now.

I have been driven back to Skype for communicating with people I'd managed to convince to install Signal. Before the whitelist-to-blacklist change, things worked well for me. I'd like to avoid using Skype for all kinds of reasons, as you probably understand. So, please do something about this.

@xander9285
Copy link

xander9285 commented Feb 20, 2018

I've had to switch to Wire's videochat, which isn't as good. Signal's current blacklist approach is not sustainable.
There's a strong echo with Motorola Moto G 3rd generation (XT1540), stock unrooted Android 6.0, current Signal version 4.15.5 .

@ADepic
Copy link

ADepic commented Feb 24, 2018

I have a oneplus 2 running lineage OS 14.1 and every time I call my friend on speakerphone he (has a iPhone 5 or something) complains how he can hear himself louder than me.

This means I can't use speaker phone.

Signal version: 4.15.5 ( had this issues a few versions back too... Since I started using Signal which was 5 months ago)

@MiscDev
Copy link

MiscDev commented Mar 2, 2018

The Moto G4, running LineageOS 14.1, also causes the person on the other end to hear an echo when speaker is enabled.

[ro.product.device]: [athene]
[ro.product.manufacturer]: [Motorola]
[ro.product.model]: [Moto G4]
[ro.product.name]: [lineage_athene]

@automated-signal
Copy link

GitHub Issue Cleanup:
See #7598 for more information.

@signalapp signalapp locked and limited conversation to collaborators Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests