STMicroelectronics / STBLESensor_Android

"ST BLE Sensor" Android application source code.
https://www.st.com/en/embedded-software/stblesensor.html
Other
115 stars 58 forks source link

Android 10 Compatibility #12

Open SaraHackett13 opened 4 years ago

SaraHackett13 commented 4 years ago

Hello,

I am running the ST BLE Sensor app V 4.7.1 on a Motorola Moto g7 Power that runs Android 10 (API 29). I am using the BVBNRG board.

I am having trouble using the BlueVoice portion of the app. After a few seconds, the audio data stops streaming and the waveform graph stops plotting. If I wait a few more seconds, the Bluetooth connection between the phone and BVBNRG board disconnects and reconnects (see log below). Upon reconnection, the audio stream resumes then stops again after a few seconds.

Is the ST BLE Sensor app compatible with Android 10? If so, what changes do I need to make to allow continuous audio stream with the BlueVoice fragment?

Thanks.

09/15 15:01:00: Launching 'BlueMS' on motorola moto g(7) power.
$ adb shell am start -n "com.st.bluems.debug/com.st.BlueMS.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 22070 on device 'motorola-moto_g_7__power-ZF6523P5X4'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/st.bluems.debu: Method Landroidx/appcompat/graphics/drawable/a;.b is abstract, but the declaring class is neither abstract nor an interface in dex file /data/app/com.st.bluems.debug-X36GYPY5xORBt7A6HCYERw==/base.apk
W/st.bluems.debu: Method Landroidx/appcompat/graphics/drawable/a;.isStateful is abstract, but the declaring class is neither abstract nor an interface in dex file /data/app/com.st.bluems.debug-X36GYPY5xORBt7A6HCYERw==/base.apk
W/st.bluems.debu: Method Lio/reactivex/internal/operators/flowable/FlowableReplay$a;.m is abstract, but the declaring class is neither abstract nor an interface in dex file /data/app/com.st.bluems.debug-X36GYPY5xORBt7A6HCYERw==/base.apk!classes2.dex
W/st.bluems.debu: Method Lokhttp3/internal/cache/a;.a is abstract, but the declaring class is neither abstract nor an interface in dex file /data/app/com.st.bluems.debug-X36GYPY5xORBt7A6HCYERw==/base.apk!classes2.dex
W/st.bluems.debu: Method Lorg/bouncycastle/x509/b;.a is abstract, but the declaring class is neither abstract nor an interface in dex file /data/app/com.st.bluems.debug-X36GYPY5xORBt7A6HCYERw==/base.apk!classes3.dex
    Method Lorg/bouncycastle/x509/b;.b is abstract, but the declaring class is neither abstract nor an interface in dex file /data/app/com.st.bluems.debug-X36GYPY5xORBt7A6HCYERw==/base.apk!classes3.dex
I/MultiDex: VM with version 2.1.0 has multidex support
    Installing application
    VM has multidex support, MultiDex support library is disabled.
W/st.bluems.debu: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/st.bluems.debu: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
D/LeakCanary: LeakCanary is running and ready to detect leaks
I/AdrenoGLES: QUALCOMM build                   : 961b24f, Ib57168459a
    Build Date                       : 02/24/20
    OpenGL ES Shader Compiler Version: EV031.27.05.06
    Local Branch                     : 
    Remote Branch                    : 
    Remote Branch                    : 
    Reconstruct Branch               : 
    Build Config                     : S L 8.0.12 AArch64
I/AdrenoGLES: PFP: 0x005ff112, ME: 0x005ff066
W/Gralloc3: mapper 3.x is not supported
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@18a8c
D/com.st.BlueSTSDK.gui.NodeListActivity: onDiscoveryChange true
D/BluetoothAdapter: isLeEnabled(): ON
D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=8 mScannerId=0
D/com.st.BlueSTSDK.gui.NodeListActivity: onNodeDiscovered C0:79:46:34:55:38
D/BluetoothAdapter: isLeEnabled(): ON
D/com.st.BlueSTSDK.gui.NodeListActivity: onDiscoveryChange false
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@7c78393
D/ConnectionService: id: 1 action:com.st.BlueSTSDK.gui.NodeConnectionService.CONNECT
D/NodeConnectionService: connect C0:79:46:34:55:38
D/NodeStateListener: BVBNRG1 Idle->Connecting
D/BluetoothGatt: connect() - device: C0:79:46:34:55:38, auto: false
D/BluetoothGatt: registerApp()
    registerApp() - UUID=c68bdebb-0bbf-4847-ba48-702f79c27b1d
D/BluetoothGatt: onClientRegistered() - status=0 clientIf=8
D/BluetoothGattServer: registerCallback()
D/BluetoothGattServer: registerCallback() - UUID=2a3fa437-fc4a-44b9-aa9f-f4f439800be3
D/BluetoothGattServer: onServerRegistered() - status=0 serverIf=9
D/BluetoothGattServer: addService() - service: 00000000-0001-11e1-9ab4-0002a5d5c51b
D/BluetoothGattServer: connect() - device: C0:79:46:34:55:38, auto: true
W/st.bluems.debu: Accessing hidden method Landroid/bluetooth/BluetoothGatt;->refresh()Z (greylist, reflection, allowed)
D/BluetoothGatt: refresh() - device: C0:79:46:34:55:38
D/BluetoothGattServer: onServiceAdded() - handle=40 uuid=00000000-0001-11e1-9ab4-0002a5d5c51b status=0
D/com.st.BlueSTSDK.Node: Refreshing Device Cache: true
D/BluetoothGattServer: onServerConnectionState() - status=0 serverIf=9 device=C0:79:46:34:55:38
D/com.st.BlueSTSDK.NodeServer: Our gatt server connection state changed:2
D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=8 device=C0:79:46:34:55:38
D/com.st.BlueSTSDK.Node: Node: BVBNRG1 Status: 0 newState: 2 boundState:12
D/BluetoothGatt: discoverServices() - device: C0:79:46:34:55:38
D/BluetoothGatt: onConnectionUpdated() - Device=C0:79:46:34:55:38 interval=9 latency=0 timeout=400 status=0
D/BluetoothGattServer: onConnectionUpdated() - Device=C0:79:46:34:55:38 interval=9 latency=0 timeout=400 status=0
D/BluetoothGatt: onConnectionUpdated() - Device=C0:79:46:34:55:38 interval=6 latency=0 timeout=500 status=0
D/BluetoothGattServer: onConnectionUpdated() - Device=C0:79:46:34:55:38 interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt: onSearchComplete() = Device=C0:79:46:34:55:38 Status=0
D/BluetoothGatt: setCharacteristicNotification() - uuid: 00002a05-0000-1000-8000-00805f9b34fb enable: true
D/BluetoothGatt: onConnectionUpdated() - Device=C0:79:46:34:55:38 interval=9 latency=0 timeout=400 status=0
D/BluetoothGattServer: onConnectionUpdated() - Device=C0:79:46:34:55:38 interval=9 latency=0 timeout=400 status=0
D/BluetoothGatt: discoverServices() - device: C0:79:46:34:55:38
D/BluetoothGatt: onSearchComplete() = Device=C0:79:46:34:55:38 Status=0
D/NodeStateListener: BVBNRG1 Connecting->Connected
W/AudioTrack: Use of stream types is deprecated for operations other than volume control
    See the documentation of AudioTrack() for what to use instead with android.media.AudioAttributes to qualify your playback use case
D/BluetoothGatt: setCharacteristicNotification() - uuid: 40000000-0001-11e1-ac36-0002a5d5c51b enable: true
D/BluetoothGatt: setCharacteristicNotification() - uuid: 08000000-0001-11e1-ac36-0002a5d5c51b enable: true
D/LeakCanary: Watching instance of androidx.coordinatorlayout.widget.CoordinatorLayout (com.st.BlueMS.demos.Audio.SpeechToText.SpeechToTextFragment received Fragment#onDestroyView() callback (references to its views should be cleared to prevent leaks)) with key 9b6df368-13d6-43fd-887a-fa409b36b284
D/BluetoothGatt: setCharacteristicNotification() - uuid: 08000000-0001-11e1-ac36-0002a5d5c51b enable: false
D/LeakCanary: Scheduling check for retained objects because found new object retained
I/st.bluems.debu: Explicit concurrent copying GC freed 194049(7999KB) AllocSpace objects, 32(640KB) LOS objects, 49% free, 3950KB/7901KB, paused 251us total 57.550ms
D/LeakCanary: Rescheduling check for retained objects in 2000ms because found only 1 retained objects (< 5 while app visible)
W/AudioTrack: Use of stream types is deprecated for operations other than volume control
    See the documentation of AudioTrack() for what to use instead with android.media.AudioAttributes to qualify your playback use case
I/st.bluems.debu: Explicit concurrent copying GC freed 13847(631KB) AllocSpace objects, 27(540KB) LOS objects, 49% free, 3933KB/7867KB, paused 149us total 58.160ms
D/AudioTrack: stop(33): called with 185080 frames delivered
D/LeakCanary: Check for retained object found no objects remaining
D/BluetoothGattServer: onServerConnectionState() - status=0 serverIf=9 device=C0:79:46:34:55:38
E/com.st.BlueSTSDK.Node: onDescriptorWrite Error writing the descriptor for char: 08000000-0001-11e1-ac36-0002a5d5c51b
D/com.st.BlueSTSDK.NodeServer: Our gatt server connection state changed:0
E/com.st.BlueSTSDK.Node: Error connecting to the node:BVBNRG1
D/BluetoothGattServer: clearServices()
D/BluetoothGattServer: close()
    unregisterCallback() - mServerIf=9
D/BluetoothGatt: close()
    unregisterApp() - mClientIf=8
D/NodeStateListener: BVBNRG1 Connected->Dead
D/NodeConnectionService: re connectC0:79:46:34:55:38
D/NodeStateListener: BVBNRG1 Dead->Connecting
D/BluetoothGatt: onClientConnectionState() - status=22 clientIf=8 device=C0:79:46:34:55:38
D/BluetoothGatt: connect() - device: C0:79:46:34:55:38, auto: false
    registerApp()
    registerApp() - UUID=d617ebcd-7aa0-4fcd-83f6-df993a4face3
D/BluetoothGattServer: registerCallback()
    registerCallback() - UUID=f847a361-1631-4273-acfd-cddaa076ea12
D/BluetoothGatt: onClientRegistered() - status=0 clientIf=8
D/BluetoothGattServer: onServerRegistered() - status=0 serverIf=9
D/BluetoothGattServer: addService() - service: 00000000-0001-11e1-9ab4-0002a5d5c51b
D/BluetoothGattServer: connect() - device: C0:79:46:34:55:38, auto: true
D/BluetoothGattServer: onServiceAdded() - handle=40 uuid=00000000-0001-11e1-9ab4-0002a5d5c51b status=0
D/BluetoothGattServer: onServerConnectionState() - status=0 serverIf=9 device=C0:79:46:34:55:38
D/com.st.BlueSTSDK.NodeServer: Our gatt server connection state changed:2
D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=8 device=C0:79:46:34:55:38
D/com.st.BlueSTSDK.Node: Node: BVBNRG1 Status: 0 newState: 2 boundState:12
D/BluetoothGatt: discoverServices() - device: C0:79:46:34:55:38
D/BluetoothGatt: onSearchComplete() = Device=C0:79:46:34:55:38 Status=0
D/BluetoothGatt: setCharacteristicNotification() - uuid: 00002a05-0000-1000-8000-00805f9b34fb enable: true
D/BluetoothGatt: onConnectionUpdated() - Device=C0:79:46:34:55:38 interval=9 latency=0 timeout=400 status=0
D/BluetoothGattServer: onConnectionUpdated() - Device=C0:79:46:34:55:38 interval=9 latency=0 timeout=400 status=0
D/BluetoothGatt: discoverServices() - device: C0:79:46:34:55:38
D/BluetoothGatt: onSearchComplete() = Device=C0:79:46:34:55:38 Status=0
D/NodeStateListener: BVBNRG1 Connecting->Connected
W/AudioTrack: Use of stream types is deprecated for operations other than volume control
    See the documentation of AudioTrack() for what to use instead with android.media.AudioAttributes to qualify your playback use case
D/BluetoothGatt: setCharacteristicNotification() - uuid: 40000000-0001-11e1-ac36-0002a5d5c51b enable: true
D/BluetoothGatt: setCharacteristicNotification() - uuid: 08000000-0001-11e1-ac36-0002a5d5c51b enable: true
SaraHackett13 commented 4 years ago

I have also downloaded ST BLE Sensor app version 4.7.2 from the Google Play store, and I have the same issue.

PezzoniL commented 4 years ago

Ciao Sara, Yes we test our application on Android 10 on a some devices (but here we don't have a motorola moto g7 Power sorry)

But please could you make a test?

On your code running on your BVBRNG board (sorry which firmware is running on it and which board is? BVBNRG it's only the ble advertise name) where there are are the other callbacks coming from BLE module

Please add also this one: void aci_gatt_indication_event(uint16_t Connection_Handle, uint16_t Attribute_Handle, uint8_t Attribute_Value_Length, uint8_t Attribute_Value[]) { aci_gatt_confirm_indication(Connection_Handle); }

Recompile the binary and flash it on your board and please make again the test and let me know if the problem is solved or not

Ciao and thanks a lot Luca

ps: please give to me more info on your running functional pack on your board and which board are you using Ciao

Il giorno mar 15 set 2020 alle ore 22:48 SaraHackett13 < notifications@github.com> ha scritto:

I have also downloaded ST BLE Sensor app version 4.7.2 from the Google Play store, and I have the same issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/STMicroelectronics/STBlueMS_Android/issues/12#issuecomment-692970885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMVJZUES6W436LYN3KVPZTSF7HLTANCNFSM4RNV4G2Q .

-- Luca Pezzoni

SaraHackett13 commented 4 years ago

Hi Luca,

Thanks for getting back to me.

I am using the STEVAL-BLUEMIC-1. I am not sure what firmware version is on the board. I am using the board by itself, not with a larger microcontroller.

The block of code callbacks I posted was from the BlueMS Java code in Android Studio. Those callbacks were coming from the app side, not the board. I haven't touched the binary code that the board runs. How can I re-flash the STEVAL-BLUEMIC-1 board?

Perhaps there is something I can test on the Android Studio side?

Thanks!

PezzoniL commented 4 years ago

Ciao Sara, I know that your log comes from Android Studio

We have found that for some devices (for example Samnsung s10e) if the code running on the board will not answer to that event indication... The phone will stop speaking with the board after a while (even if longer than a few seconds... )

I will speak with the developers of the STEVAL-BLUEMIC-1 and I will ask them if they could create one binary with the below modification... And I will tell you all the info for flashing the new binary on the STEVAL-BLUEMIC-1 and test it (I had never used that board... so I could not tell to you how flash the new binary to it in this moment.. sorry) Ciao Luca

Il giorno mer 16 set 2020 alle ore 16:21 SaraHackett13 < notifications@github.com> ha scritto:

Hi Luca,

Thanks for getting back to me.

I am using the STEVAL-BLUEMIC-1. I am not sure what firmware version is on the board. I am using the board by itself, not with a larger microcontroller.

The block of code callbacks I posted was from the BlueMS Java code in Android Studio. Those callbacks were coming from the app side, not the board. I haven't touched the binary code that the board runs. How can I re-flash the STEVAL-BLUEMIC-1 board?

Perhaps there is something I can test on the Android Studio side?

Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/STMicroelectronics/STBlueMS_Android/issues/12#issuecomment-693438432, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMVJZQADKZGGTL3M4NKXYTSGDCVDANCNFSM4RNV4G2Q .

-- Luca Pezzoni

SaraHackett13 commented 4 years ago

That'd be great, thank you!

Just a side note, on a Samsung Galaxy s6 (Android 7.0) the BlueMS app works fine with the STEVAL-BLUEMIC-1 board.

PezzoniL commented 4 years ago

Ciao,

Attached the new binary that you could test on your board

Here you should find the instruction on how flash the board: https://www.st.com/resource/en/user_manual/dm00411757-getting-started-with-the-stevalbluemic1-evaluation-board-ultralow-power-wireless-microphone-based-on-spbtle1s-module-stmicroelectronics.pdf

Let me know if this could resolve the problem with your phone Ciao Luca

Il giorno mer 16 set 2020 alle ore 16:47 SaraHackett13 < notifications@github.com> ha scritto:

That'd be great, thank you!

Just a side note, on a Samsung Galaxy s6 (Android 7.0) the BlueMS app works fine with the STEVAL-BLUEMIC-1 board.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/STMicroelectronics/STBlueMS_Android/issues/12#issuecomment-693455739, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMVJZXAHEABHGEMVGHBNQ3SGDFYZANCNFSM4RNV4G2Q .

-- Luca Pezzoni

SaraHackett13 commented 4 years ago

Hi Luca,

I don't see a binary attachment to your previous reply.

Do you know why some phones don't respond to the event indication you recommended below, like the Samsung s10e you mentioned above? If the board doesn't respond to this indication, is there a way to fix it or will I not be able to use that phone?

void aci_gatt_indication_event(uint16_t Connection_Handle,
                               uint16_t Attribute_Handle,
                               uint8_t Attribute_Value_Length,
                               uint8_t Attribute_Value[])
{
  aci_gatt_confirm_indication(Connection_Handle);
}

Are there certain phones that are guaranteed to properly communicate with the STEVAL-BLUEMIC-1 board and run the BlueMS app?

PezzoniL commented 4 years ago

BlueVoice-BlueNRG1.zip

Sorry the email from gmail had the attach,,, but github don't want a .hex attached the .zip ciao