signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.56k stars 6.13k forks source link

Heavily distorted audio when making Signal calls through Bluetooth headunit #13207

Closed 0xunusedusername closed 10 months ago

0xunusedusername commented 1 year ago

Bug description

When making or receiving a call via Bluetooth through the car head-unit, the audio quality is garbled and robotic; even the dialing tone is distorted. The other call also hears my voice but unrecognizably distorted. Updated head-unit firmware and it's still not working.

Works fine over Bluetooth earbuds.

Other Bluetooth audio outputs work: other phone calls, Signal voice messages, music, navigation, browser.

Steps to reproduce

Actual result: Unusable audio ensues. Expected result: Normal, clear, Signal call audio. It was previously working.

Screenshots

Not needed

Device info

Device: Google Pixel 7 GrapheneOS Version: 2023100300 Signal version: 6.35.3

Link to debug log

nicholas-signal commented 1 year ago

We do not have any special handling for head units vs. other headsets; perhaps an issue between your phone and your head unit with negotiating a Bluetooth SBC link? If you add a debug log, we can see if the phone's Bluetooth stack prints any errors it encounters.

nicholas-signal commented 1 year ago

I see in the logs that the phone is able to successfully connect to Bluetooth devices without error, except on one occasion where it looks like the selected Bluetooth device was unavailable (could be caused by something as innocuous as the device being out of range).

For some context: on Android 12+, we simply just ask the OS to change the audio device for us, and do not manage the connection or codec ourselves. See the API call here: https://github.com/signalapp/Signal-Android/blob/3d94122abc1ac2685230faad7322d405cb631013/app/src/main/java/org/thoughtcrime/securesms/webrtc/audio/AudioManagerCompat.java#L138

My speculation is that there's an issue with the phone assigning the SCO profile properly and choosing the right audio codec to this communication channel. SCO, or Synchronous Connection-Oriented Link, is the realtime-bound protocol used for voice communication that ensures that audio is being both sent and received on-time. This should be the same connection used for your phone calls. However, pure 1-way playback, like voice notes, would more likely be using the ACL link, which is a different connection your phone and head unit will have to negotiate, therefore it would not run into a bug in the SCO implementation.

I know you mentioned updating your head unit firmware already, but have you tried updating your phone's firmware?

0xunusedusername commented 1 year ago

@nicholas-signal Hi Nicholas, my phone is running the latest firmware. I guess a factory reset is the only thing that would help at this point?

The weird thing is that it was working about a month ago and then just suddenly stopped.

nicholas-signal commented 12 months ago

I can't promise that a factory reset will fix it; all I can say is that wherever the problem lies, it's caused by something in a layer beneath the Signal application.

0xunusedusername commented 12 months ago

@nicholas-signal Alright, thanks for looking. I'll look into getting a test device to see if I can isolate it.

Is it possible to get my log purged for privacy?

Thank you

0xunusedusername commented 11 months ago

@nicholas-signal factory reset the head unit and tried another Android device; issue still persists.

nicholas-signal commented 11 months ago

Is it possible to get my log purged for privacy?

Feel free to edit out the URL from your comment so it's un-indexable, and our log retention rules will take care of the rest.

factory reset the head unit and tried another Android device; issue still persists.

Unfortunately, without access to your specific head unit, it's going to be practically impossible to figure out what's going wrong. Feel free to share the specific SKU you're having trouble with, but I want to set expectations properly that we cannot realistically support device-specific bugs in the over 1,000 different Android Auto head units out there.

0xunusedusername commented 10 months ago

Solved after a deep investigation.

In the event anyone else stumbles on this and is having a similar issue:

This is an issue with the Bluetooth hardware in certain Sony head units. The problem arises if the system Bluetooth call volume is above the minimum value. If it is, it will overload the BT receiver in the head unit and distort the audio.

Set the system BT call volume to minimum, only control the call volume from the head unit, and it will work as expected.

CapricanDRJ commented 9 months ago

I have this problem without other hardware. It has happened off and on to friends and myself for the last 3 years. There is another issue that was closed without solution and appears to be duplicate https://github.com/signalapp/Signal-Android/issues/7253

While I don't use bluetooth devices, I have found that connecting and disconnecting a bluetooth device seems to reinitialize the mic. Restarting also tends to work. I would assume that another app had changed something and signal doesn't properly re-initialize it until a device is connected/disconnected. If it was the windows 3.11 days, the issue sounds like the wrong bitrate on a sound card.

0xunusedusername commented 9 months ago

I have this problem without other hardware. It has happened off and on to friends and myself for the last 3 years. There is another issue that was closed without solution and appears to be duplicate #7253

While I don't use bluetooth devices, I have found that connecting and disconnecting a bluetooth device seems to reinitialize the mic. Restarting also tends to work. I would assume that another app had changed something and signal doesn't properly re-initialize it until a device is connected/disconnected. If it was the windows 3.11 days, the issue sounds like the wrong bitrate on a sound card.

Yeah, it's pretty disappointing.

If I want to make a Signal call over the BT unit I have to call, immediately end it, then call again to get the mic to work. Signal is the only app that has this issue for me.