Open tech-ajit-mob opened 1 month ago
@afalls-twilio did you get a chance to look up this issue? It's 100% reproducible.
13:02:38.024 D Current user selected AudioDevice = null 13:02:38.033 D Current user selected AudioDevice = null 13:02:38.037 D Current user selected AudioDevice = null 13:02:38.041 D Current user selected AudioDevice = null 13:02:38.048 D Current user selected AudioDevice = null 13:02:38.052 D Current user selected AudioDevice = null 13:02:38.056 D Current user selected AudioDevice = null 13:02:38.061 D Current user selected AudioDevice = Speakerphone(name=Speakerphone) 13:02:38.067 D Current user selected AudioDevice = null 13:02:38.071 D Current user selected AudioDevice = null 13:02:38.074 D Current user selected AudioDevice = Earpiece(name=Earpiece) 13:02:38.079 D Current user selected AudioDevice = Speakerphone(name=Speakerphone) 13:02:38.281 D Current user selected AudioDevice = null 13:02:38.287 D Current user selected AudioDevice = null
See the log, the selected audio device is the Speaker.
@tech-ajit-mob thank you for the info, we will circle back with you when get a chance to investigate.
Thank you so much @afalls-twilio for paying attention to this genuine and serious issue. If you want any supporting documents, logs, or recordings I am always available, please figure out and fix it as soon as possible. Based on Twilio's recommendation we are using this library.
More details:
override fun onDisconnected(call: Call, callException: CallException?) {
_audioSwitch.deactivate()
}
override fun onConnected(call: Call) {
_audioSwitch.activate()
}
Note: I am not calling _audioSwitch.stop()
after disconnecting the call
@tech-ajit-mob It appears that your bluetooth headset is connected to multiple devices at the same time, i.e. two or more android devices. Make sure that the bluetooth device is connected to one android device at a time. Let us know if that resolves the issue.
Thanks for the update @ocarevs I will let you know.
Hello @ocarevs , The issue has been fixed with the single connected device but kept under observation for multiple connected devices.
Changes I did
mService?.getAudioSwitch()?.stop()
startAudioSwitch()
private fun startAudioSwitch() {
/*
* Start the audio device selector after the menu is created and update the icon when the
* selected audio device changes.
*/
mService?.let {
it.getAudioSwitch().start { _: List<AudioDevice?>?, selectedDevice: AudioDevice? ->
updateAudioDeviceIcon(selectedDevice)
}
}
}
Describe the bug Audio is breaking or sometimes coming via Bluetooth and Speaker/Earpiece after changing from Bluetooth to speaker/Earpiece mode.
To Reproduce Steps to reproduce the behavior: Case 1:
Case 2:
Case 3: Working fine
Expected behavior Voice is coming via selected audio mode.
Actual behavior The voice coming via Bluetooth and Earpiece like 1 sec in Bluetooth and the next 1 second in Earpiece again 1 sec in BT and next 1 sec in Earpiece etc.
Application Logs
LogFile.txt
https://github.com/twilio/audioswitch/assets/134035235/ada0064b-72d7-4e83-805c-bea81475d77b
AudioSwitch Version
Android Device (please complete the following information):
Screenshots If applicable, add screenshots to help explain your problem.
Additional context I have attached a log file along with recorded audio in which you can listen to audio coming via speaker and BT after switching from BT to speaker.
The code is given below: