cancel
Showing results for 
Search instead for 
Did you mean: 

Bluetooth and Restart

Abelardo21
Occasional Contributor
Hola buen dia, escribo en este medio porque tengo ciertos detalles respecto al bluetooth, se realizaron las siguientes pruebas:
Llamada 1
Empiezo la llamada con bluetooth activo - funciona bluetooth
Desactivo bluetooth - funciona altavoz
Activo bluetooth - funciona bluetooth
 
Llamada 2
Empiezo la llamada con bluetooth activo - funciona bluetooth
Desactivo bluetooth - funciona altavoz
Activo bluetooth - funciona altavoz y ya no jala de nuevo el bluetooth.
 
Se me hace extraño que la primera llamada todo funcione bien y la segunda ya no.

Tambien mencionar que hay un incidente, durante una llamada de prueba ambos teléfonos usados se reiniciaron, uno incluso tardo un poco en volverse a encender y mostraba una pantalla que jamas habia visto que me preguntaba si quería "reiniciar el sistema" o "borrar los datos".

Espero pueden apoyarme con estos detalles, muchas gracias.
 
Hello everyone, I write in this medium because I have certain details regarding bluetooth, the following tests were carried out:
call 1
I start the call with bluetooth active - bluetooth works
Deactivate bluetooth - speaker works
active bluetooth - bluetooth works

call 2
I start the call with bluetooth active - bluetooth works
Deactivate bluetooth - speaker works
Active bluetooth - speaker works and no longer pulls bluetooth again.

It seems strange to me that the first call everything works fine and the second no longer.

I also mentioned that there is an incident, during a test call both used phones rebooted, one even took a while to turn back on and showed a never seen screen asking me if I wanted to "reboot system" or "wipe the data ".
 
I hope you can help me with these problems, thank you very much.
1 ACCEPTED SOLUTION

Accepted Solutions

Roland_Ian
Employee
Employee

Hi Alberado21,

 

I was unable replicate your bluetooth issue with the tests I carried out ( a seven call test) after setting the bluetooth device connection after the first call (see EstablishedCallFragment below)

 

Below is some debug output from the calls that you can also verify for yourself with logcat in Android Studio.

 

I connected the bluetooth using the onAudioStateChanged from our Android Reference application hosted on github (https://github.com/sinch/rtc-reference-applications/) as shown below.

 

Sinch Voice Reference App audio state manipulation

com.sinch.rtc.vvc.reference.app > features > calls > established > EstablishedCallFragment

private fun attachBindings() {
┊ binding.hangUpButton.setOnClickListener { onBackPressed() }

┊ binding.audioStateButton.onAudioStateChanged = { newState ->
┊ ┊ viewModel.onAudioStateChanged(newState)
┊ ┊ showModeMessage(newState)
┊ }

 

Can you verify that onAudioStateChanged toggles between devices when your call is connected?

In your application are you able to verify that on each call:

  1. The Bluetooth device is still available? (checking the connectionState)
  2. If it is still the TYPE_BLUETOOTH_SCO for the call (or whichever type your bluetooth device shows as when connected.)

Logcat verification in Android Studio

Device connection

 

Here are some example logs showing the bluetooth connection verification upon changing the audioState from the sample application:

2022-09-04 20:43:57.967 21760-21760/com.sinch.rtc.vvc.reference.app D/BluetoothManager: Connected bluetooth headset: name=<your bluetooth device will be here>, state=CONNECTED, SCO audio=false
2022-09-04 20:43:57.986 2466-843/? I/HeadsetService: isHaDeviceConnected : false
2022-09-04 20:43:58.016 1350-1538/? D/BluetoothController: updateConnected = 2mConnectionState = 2
2022-09-04 20:43:58.064 1350-1350/? I/PowerUI: mBootCompleted = true | mFullyConnected = true
2022-09-04 20:43:58.350 2466-723/? I/HeadsetStateMachine: AudioConnecting: currentDevice=305075_1, msg=processAudioEvent: audio connected
2022-09-04 20:43:58.409 1350-1538/? D/BluetoothController: updateConnected = 2mConnectionState = 2
2022-09-04 20:43:58.413 21760-21760/com.sinch.rtc.vvc.reference.app D/BluetoothManager: +++ Bluetooth audio SCO is now connected
2022-09-04 20:43:58.413 21760-21760/com.sinch.rtc.vvc.reference.app D/AudioManagerInternal: --- updateAudioDeviceState: wired headset=false, BT state=SCO_CONNECTED
2022-09-04 20:43:58.413 21760-21760/com.sinch.rtc.vvc.reference.app D/AudioManagerInternal: Need BT audio: start=false, stop=false, BT state=SCO_CONNECTED
2022-09-04 20:43:58.419 21760-21760/com.sinch.rtc.vvc.reference.app D/BluetoothManager: onReceive done: BT state=SCO_CONNECTED

Logcat showing the AudioDevice on each call

Logcat will shows the audio device on each received call. (The Sinch client was not stopped between tests)

2022-09-04 20:36:08.080 21760-3011/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=321 (321)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:36:41.041 21760-3247/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=353 (353)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:37:03.773 21760-3425/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=385 (385)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:37:15.963 21760-3627/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=417 (417)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:37:35.422 21760-3794/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=449 (449)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:37:54.367 21760-3963/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=481 (481)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:38:31.556 21760-4125/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=513 (513)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28

 

I hope this gives you some insight into troubleshooting your bluetooth issue.

If you need us to look at any of your Android logcat output, please open a ticket with us. 

 

Roland-Ian Clothier, Developer Support Engineer

View solution in original post

4 REPLIES 4

Shahzad_Ismail
Community Manager
Community Manager

Hi,

Thanks for your question. I have shared this information with our Product Team who will look into this and get back to you with an answer.

Kind regards,

Shahzad Ismail
Head of Knowledge Management and Community Engagement, Sinch

Roland_Ian
Employee
Employee

Hi Abelardo21,

 

Thanks for the question!   In regard to the : "reboot system" or "wipe the data " incident.   

 

This sounds like you accidentally entered the Android fastboot menu.  Were you pressing the volume switch at the same time as the power button.  If you were this would send you to the menu allowing you to reboot and wipe the data amongst other functionality.  More information on fastboot can be found at the Android developer site here: https://source.android.com/docs/core/bootloader

 

As your enquiry is missing some important information like your handsets, SDK version etc, I have sent you a message regarding your call attempts for some more information so we can assist you. 

Roland-Ian Clothier, Developer Support Engineer

Abelardo21
Occasional Contributor

Hola, gracias.
Respecto al tema del bluetooth que mencioné ¿hay alguna solución?, también note que en algunas llamadas aproximadamente la numero 7 el audio comenzó a salir del speaker y bocina de forma intercalada en la misma llamada, cabe mencionar que en las otras que realice de prueba funciono el audio correctamente.

Hi thanks
Regarding the bluetooth issue that I mentioned, is there a solution? I also saw that in some calls approximately number 7 the audio began to come out of the call speaker and main speaker interspersed in the same call, it is worth mentioning that in the other tests the audio works fine.

Roland_Ian
Employee
Employee

Hi Alberado21,

 

I was unable replicate your bluetooth issue with the tests I carried out ( a seven call test) after setting the bluetooth device connection after the first call (see EstablishedCallFragment below)

 

Below is some debug output from the calls that you can also verify for yourself with logcat in Android Studio.

 

I connected the bluetooth using the onAudioStateChanged from our Android Reference application hosted on github (https://github.com/sinch/rtc-reference-applications/) as shown below.

 

Sinch Voice Reference App audio state manipulation

com.sinch.rtc.vvc.reference.app > features > calls > established > EstablishedCallFragment

private fun attachBindings() {
┊ binding.hangUpButton.setOnClickListener { onBackPressed() }

┊ binding.audioStateButton.onAudioStateChanged = { newState ->
┊ ┊ viewModel.onAudioStateChanged(newState)
┊ ┊ showModeMessage(newState)
┊ }

 

Can you verify that onAudioStateChanged toggles between devices when your call is connected?

In your application are you able to verify that on each call:

  1. The Bluetooth device is still available? (checking the connectionState)
  2. If it is still the TYPE_BLUETOOTH_SCO for the call (or whichever type your bluetooth device shows as when connected.)

Logcat verification in Android Studio

Device connection

 

Here are some example logs showing the bluetooth connection verification upon changing the audioState from the sample application:

2022-09-04 20:43:57.967 21760-21760/com.sinch.rtc.vvc.reference.app D/BluetoothManager: Connected bluetooth headset: name=<your bluetooth device will be here>, state=CONNECTED, SCO audio=false
2022-09-04 20:43:57.986 2466-843/? I/HeadsetService: isHaDeviceConnected : false
2022-09-04 20:43:58.016 1350-1538/? D/BluetoothController: updateConnected = 2mConnectionState = 2
2022-09-04 20:43:58.064 1350-1350/? I/PowerUI: mBootCompleted = true | mFullyConnected = true
2022-09-04 20:43:58.350 2466-723/? I/HeadsetStateMachine: AudioConnecting: currentDevice=305075_1, msg=processAudioEvent: audio connected
2022-09-04 20:43:58.409 1350-1538/? D/BluetoothController: updateConnected = 2mConnectionState = 2
2022-09-04 20:43:58.413 21760-21760/com.sinch.rtc.vvc.reference.app D/BluetoothManager: +++ Bluetooth audio SCO is now connected
2022-09-04 20:43:58.413 21760-21760/com.sinch.rtc.vvc.reference.app D/AudioManagerInternal: --- updateAudioDeviceState: wired headset=false, BT state=SCO_CONNECTED
2022-09-04 20:43:58.413 21760-21760/com.sinch.rtc.vvc.reference.app D/AudioManagerInternal: Need BT audio: start=false, stop=false, BT state=SCO_CONNECTED
2022-09-04 20:43:58.419 21760-21760/com.sinch.rtc.vvc.reference.app D/BluetoothManager: onReceive done: BT state=SCO_CONNECTED

Logcat showing the AudioDevice on each call

Logcat will shows the audio device on each received call. (The Sinch client was not stopped between tests)

2022-09-04 20:36:08.080 21760-3011/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=321 (321)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:36:41.041 21760-3247/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=353 (353)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:37:03.773 21760-3425/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=385 (385)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:37:15.963 21760-3627/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=417 (417)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:37:35.422 21760-3794/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=449 (449)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:37:54.367 21760-3963/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=481 (481)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28
2022-09-04 20:38:31.556 21760-4125/com.sinch.rtc.vvc.reference.app I/org.webrtc.Logging: WebRtcAudioRecordExternal: client audio source=VOICE_COMMUNICATION, client session id=513 (513)
┊ AudioDevice: type=TYPE_BLUETOOTH_SCO, id=28

 

I hope this gives you some insight into troubleshooting your bluetooth issue.

If you need us to look at any of your Android logcat output, please open a ticket with us. 

 

Roland-Ian Clothier, Developer Support Engineer