react-native-webrtc / react-native-incall-manager

Handling media-routes/sensors/events during a audio/video chat on React Native
ISC License
547 stars 191 forks source link

Galaxy buds bluetooth does not connect in middle of VOIP (Android) #151

Open hmhm2292 opened 3 years ago

hmhm2292 commented 3 years ago

HI I have a question regarding trying to connect galaxy buds in middle of a voip call. I did some logging and it seems to disconnect the Bluetooth audio SCO if the bluetooth is paired in middle of a voip call. However for an apple air pod, it seems to work just fine.

I found the code where it seems to disconnect the SCO Audio, and I was wondering what the purpose of the code below is and if what possible errors can occur when removing bluetoothManager.stopScoAudio()?

*Update: bluetoothManager.stopScoAudio()? does not seem to disconnect bluetooth audio SCO,

Is there any way to keep the bluetooth audio SCO connected?

Any help would be greatly appreciated!

   // --- stop bluetooth if needed
        if (selectedAudioDevice == AudioDevice.BLUETOOTH
                && newAudioDevice != AudioDevice.BLUETOOTH
                && (bluetoothManager.getState() == AppRTCBluetoothManager.State.SCO_CONNECTED
                    || bluetoothManager.getState() == AppRTCBluetoothManager.State.SCO_CONNECTING)
                ) {
            bluetoothManager.stopScoAudio(); // SEEMS TO DISCONNECT SCO AUDIO HERE 
            bluetoothManager.updateDevice();
        }

Galaxy Buds pairing log Screen Shot 2020-12-10 at 1 53 09 PM

Airpod pairing log Screen Shot 2020-12-10 at 1 52 31 PM