Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

WebRTC incoming call sound uses wrong speaker

Open cascheberg opened this issue 9 years ago • 11 comments

I have:

  • [x] searched open and closed issues for duplicates
  • [x] read https://github.com/WhisperSystems/Signal-Android/wiki/Submitting-useful-bug-reports

Bug description

The ringing sound for incoming WebRTC calls is using the (low volume, front facing) earpiece speaker instead of the loudspeaker. Reproducible on two different phones. Works on both phones when using Redphone calls. I had a glance at the code, and it seems to be using the same old redphone class?

Steps to reproduce

  • enable video calling beta
  • receive a video phone call

Actual result: Ringing sound is very low volume, uses wrong speaker Expected result: Should use loudspeaker, as in Redphone.

Device 1 info

Device: Nexus 4 Android version: stock Android 5.1.1 Signal version: 3.19.1

Device 2 info

Device: HTC Sensation XE Android version: CyanogenMod 12.1 - Android 5.1.1 Signal version: 3.19.1

Link to debug log

https://gist.github.com/anonymous/00a8a8029e8aaa8e3ff25875770adaca

cascheberg avatar Feb 05 '17 09:02 cascheberg

By low volume speaker you mean the earpiece speaker?

2-4601 avatar Feb 05 '17 13:02 2-4601

@2-4601 Yes, I believe that is the correct name, thanks

cascheberg avatar Feb 05 '17 16:02 cascheberg

Same with Nexus 5. Stock Rom. 6.0.1

sigenc avatar Feb 16 '17 10:02 sigenc

Have two devices, also happens. Huawie P8lite (ALE-L02) on EMUI 4.0 (6.0 based) and SM-J510GN on stock 6.0.1.

tsdmgz avatar Feb 16 '17 17:02 tsdmgz

I also have the same problem with three out of four devices. Samsung Galaxy ACE 2 (4.4.4 CM), OnePlus One (6.0.1 CM) & OnePlus 3 (6.0.1). Only on the Wileyfox Swift (6.0.1) does the speaker work properly. By activating the speaker button, the ringtone can be set "loud" on all three devices. Only on the Wileyfox does nothing happen (speaker is allways on - independent of the button).

Shenkaa avatar Feb 17 '17 19:02 Shenkaa

Same here, ASUS Zenfone 2, Andorid 6.0, earpiece speaker is ringing instead of loudspeaker.

nimdajitam avatar Feb 22 '17 18:02 nimdajitam

So, uh, git bisect again. Commit ea0945d406bae68df88b7351148b269e386fd9b2. Adding to @Shenkaa's remark on setting to speakerphone makes the phone actually ring, I noticed there's a degradation of sound quality on the ringtone. It sounds similar to what you'd hear in a call and higher frequencies are cut off.

Also have a 4.1.2 Samsung Galaxy Win (GT-i8552) which does not exhibit this problem but fails to activate the camera when in a video call and then crashes.

tsdmgz avatar Feb 22 '17 20:02 tsdmgz

EDIT log from users reporting this: User 1: https://gist.github.com/775655cd6dd3482cd00feea5504bf9af

riyapenn avatar Feb 22 '17 21:02 riyapenn

Same on OnePlus3t and Coolpad e560

kpuljek avatar Feb 26 '17 11:02 kpuljek

@moxie0 I tested cd28cd172f770eeae08f7adca8964284354ee479 on one of my devices (HTC Sensation XE, CyanogenMod 12.1) and it's now using the correct speaker, but not the correct Android volume setting. The volume of the incoming ringtone depends on the speaker volume level, not on the ringer volume level.

cascheberg avatar Mar 06 '17 16:03 cascheberg

@cascheberg I think we might already be at peak-workaround. The webrtc folks, in their infinite wisdom, do not seem to think it's important to support "ringing." As soon as I build a PeerConnection, it tries to take over and play an AudioTrack w/ STREAM_VOICE_CALL whether the AudioTrack is enabled or not.

If I try to play sounds with MODE_RINGTONE, they'll just get hijacked by webrtc and end up in the earpiece. The only thing I can do is play the ringtone into the voice call stream, but turn the speaker on.

I tried getting the STREAM_RING volume from the AudioManager and setting the STREAM_VOICE_CALL audio to the same level for the ringtone, but that doesn't seem to work. Android's audio stuff is pretty messed up.

moxie0 avatar Mar 06 '17 20:03 moxie0