-
Notifications
You must be signed in to change notification settings - Fork 50
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
Audio is routing via Bluetooth but device list have Earpiece & Speaker phone only and BT option is not available #167
Comments
Hi Team, |
Hi @tech-ajit-mob to clarify, in the initial steps 1-5, bluetooth is connected, but does not appear in the list of available devices, only after reconnecting the BT device it becomes listed? And then when you make a second call (while bluetooth is connected and active) then the BT device is missing in the device list again, is that correct? |
Are you using BluetoothHeadsetConnectionListener to see bluetooth related callbacks? |
Yes, I was using it to get status only. |
@ocarevs |
@tech-ajit-mob We are investigating this issue. One question, have you tried our Voice quickstart, do you experience the same issue with quickstart? |
@ocarevs sorry for the delayed response due to festive season |
The Bluetooth icon is not showing but the audio is routing via Bluetooth.
BT- Bluetooth
To Reproduce
Steps to reproduce the behavior:
Expected behavior
BT options should be there in the device list.
Actual behavior
The voice is transmitted through Bluetooth, but Bluetooth does not appear in the device list, preventing us from displaying the Bluetooth option in the UI.
Application Logs Steps wise
Step1 to 5
15:03:19.267 D Preferred device list = [BluetoothHeadset, WiredHeadset, Earpiece, Speakerphone]
15:03:19.276 D Earpiece available
15:03:19.276 D Speakerphone available
15:03:19.277 D Available AudioDevice list updated: [Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
15:03:19.277 D Current user selected AudioDevice = null
15:03:19.304 D Bluetooth Jabra Elite 4 connected
15:03:19.309 D Device size 1 with device name: Jabra Elite 4
15:03:19.309 D Earpiece available
15:03:19.309 D Speakerphone available
15:03:19.309 D Available AudioDevice list updated: [Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
15:03:19.309 D Current user selected AudioDevice = null
15:03:19.309 D Bluetooth SCO connected
15:03:22.133 W Cannot deactivate when in the Disconnected state
Step 6 : Disconnect BT
15:00:04.001 D Headset state changed to Disconnected
15:00:04.001 D Earpiece available
15:00:04.908 D Speakerphone available
15:00:04.908 D Available AudioDevice list updated: [Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
15:00:04.908 D Current user selected AudioDevice = null
15:00:04.930 W Cannot deactivate when in the Disconnected state
15:00:04.942 D Bluetooth SCO disconnected
Step 6: Reconnect BT: Working fine
15:00:33.896 D Bluetooth SCO disconnected
15:00:34.077 D Bluetooth headset BluetoothDeviceWrapperImpl(device=XX:XX:XX:XX:54:B4, name=Jabra Elite 4, deviceClass=7936) connected
15:00:34.080 D Headset state changed to Connected
15:00:34.080 D Earpiece available
15:00:34.418 D Speakerphone available
15:00:34.419 D Available AudioDevice list updated: [BluetoothHeadset(name=Jabra Elite 4), Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
15:00:34.419 D Current user selected AudioDevice = null
15:00:34.426 D Scheduled bluetooth sco job
15:00:34.429 D Bluetooth SCO disconnected
15:00:34.432 D Attempting to enable bluetooth SCO
15:00:34.432 D Headset state changed to AudioActivating
15:00:34.482 D Bluetooth SCO connecting
15:00:34.580 D Bluetooth audio connected on device BluetoothDeviceWrapperImpl(device=XX:XX:XX:XX:54:B4, name=Jabra Elite 4, deviceClass=7936)
15:00:34.580 D Canceled bluetooth sco job
15:00:34.580 D Headset state changed to AudioActivated
15:00:34.580 D Earpiece available
15:00:34.598 D Speakerphone available
15:00:34.598 D Available AudioDevice list updated: [BluetoothHeadset(name=Jabra Elite 4), Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
15:00:34.598 D Current user selected AudioDevice = null
15:00:34.745 W Cannot activate when in the AudioActivated state
15:00:34.746 D Bluetooth SCO disconnected
15:00:35.624 D Bluetooth SCO connected
Step 7: Disconnect the call
15:02:01.251 D AudioSwitch(1.2.0)
15:02:01.252 D Preferred device list = [BluetoothHeadset, WiredHeadset, Earpiece, Speakerphone]
15:02:01.289 D Redundant stop() invocation while already in the stopped state
Step 8: When receiving incoming calls and clicking the accept button, the audio comes through Bluetooth, but the Bluetooth option is not available in the UI:
15:03:19.267 D Preferred device list = [BluetoothHeadset, WiredHeadset, Earpiece, Speakerphone]
15:03:19.276 D Earpiece available
15:03:19.276 D Speakerphone available
15:03:19.277 D Available AudioDevice list updated: [Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
15:03:19.277 D Current user selected AudioDevice = null
15:03:19.304 D Bluetooth Jabra Elite 4 connected
15:03:19.309 D Device size 1 with device name: Jabra Elite 4
15:03:19.309 D Earpiece available
15:03:19.309 D Speakerphone available
15:03:19.309 D Available AudioDevice list updated: [Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
15:03:19.309 D Current user selected AudioDevice = null
15:03:19.309 D Bluetooth SCO connected
15:03:22.133 W Cannot deactivate when in the Disconnected state
Sometimes Logcat observation:
15:00:58.073 D Bluetooth disconnected
15:00:58.073 D Headset state changed to Disconnected
15:00:58.094 D Attempting to disable bluetooth SCO
15:00:58.103 D Headset state changed to Connected
15:00:58.746 D Attempting to disable bluetooth SCO
15:00:59.250 D Attempting to disable bluetooth SCO
15:00:59.759 D Attempting to disable bluetooth SCO
15:01:00.269 D Attempting to disable bluetooth SCO
15:01:00.777 D Attempting to disable bluetooth SCO
15:01:01.287 D Attempting to disable bluetooth SCO
15:01:01.794 D Attempting to disable bluetooth SCO
15:01:02.304 D Attempting to disable bluetooth SCO
15:01:02.812 D Attempting to disable bluetooth SCO
15:01:03.319 D Attempting to disable bluetooth SCO
15:01:03.832 E Bluetooth sco job timed out
java.util.concurrent.TimeoutException
at com.twilio.audioswitch.bluetooth.BluetoothScoJob$BluetoothScoRunnable.run(BluetoothScoJob.kt:55)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8592)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
15:01:03.832 D Headset state changed to AudioActivationError
15:01:03.833 D Canceled bluetooth sco job
AudioSwitch Version
Android Device (please complete the following information):
Screenshots: Audio is coming via BT
My Observation and logs based on steps
There are two options to disconnect the call: from the main UI and the notification drawer. The issue typically occurs when I disconnect the call via the notification drawer but the code is same in both cases.
Code snippet related audio switch:
VoiceCallService:
Audio Switch Initialization:
_audioSwitch = AudioSwitch(applicationContext, loggingEnabled = true)
The text was updated successfully, but these errors were encountered: