twilio / audioswitch

An Android audio management library for real-time communication apps.
Apache License 2.0
160 stars 49 forks source link

Audio switching misbehaves with Bluetooth headphones #140

Closed rakeshandroid1502 closed 11 months ago

rakeshandroid1502 commented 1 year ago

Describe the bug After selecting the Bluetooth device using selectDevice() , I can sense that Bluetooth is connected but also connection and disconnection happens every seconds. This leads user voice to come through Bluetooth and Earpiece/Speaker and ended up with disconnection of the call.

To Reproduce Steps to reproduce the behavior:

  1. By Default, the Earpiece mode is selected and working fine.
  2. Enabling the bluetooth from phone settings and the audio mode is switched to Bluetooth automatically.
  3. Now, again I have tried to switch to Speaker. And, it worked fine.
  4. Tried to switch to Earpiece and it worked fine.
  5. Now, Again tried to switch to Bluetooth by selectDevice().

Expected behavior The Audio mode should be switched to Bluetooth and the communication through the bluetooth should be fine.

Actual behavior By wearing bluetooth headphone, I sense that bluetooth connects and disconnects as I sense tik-tik sound from Bluetooth device. And audio is partially scattered to Bluetooth and partially to Earpiece/Speaker.

AudioSwitch Version 1.0.1 , 1.1.12, 1.1.14, 1.1.15

Android Device

Additional context It works fine if I let the device automatically switch. But the issue happens only when I try to manually switch.

ocarevs commented 1 year ago

Hi @rakeshandroid1502 would it be possible for you to add some logs when you encounter this issue?

mbitanga-indeed commented 10 months ago

@ocarevs This issue is happening for me as well, and the audio output is oscillating and switching back and forth between bluetooth and earpiece or speaker even with no additional switching from me. I will try to add logs when I have time, but just wanted to bring this up to your attention. Device: samsung galaxy s22