Latency before first Characteristic ValueChanged Event
We are developing a BLE notepad, https://www.xp-pen.com/product/516.html
SDK available: https://github.com/woodemi/notepad-sdk-uwp
The notepad collects 200 NotePenPointer
per seconds and transfers the data though BLE.
But there seem to be a latency before the GattCharacteristic.ValueChanged triggered
I've tried the BluetoothLEExplorer
, same issure. Is there any work around?
When developing on Android, we use BluetoothGatt#requestConnectionPriority to solve a similiar problem.
Related:
Universal Windows Platform (UWP)
-
Sunbreak Wang • 1 Reputation point
2020-02-20T03:56:25.463+00:00 -
Sunbreak Wang • 1 Reputation point
2020-02-20T04:01:31.997+00:00 -
Fay Wang - MSFT • 5,221 Reputation points
2020-02-20T06:01:18.013+00:00 Can you please use this guidance to provide your Bluetooth log for us to check? This will be more helpful.
-
Sunbreak Wang • 1 Reputation point
2020-02-20T07:11:11.583+00:00 Sure. Right now
-
Sunbreak Wang • 1 Reputation point
2020-02-20T07:54:50.6+00:00 BthTracing-2020-0220-1539.etl
https://send.firefox.com/download/3ee724683984d7dd/#pJvjDXTJCmX-C8vZs-agdA
-
Fay Wang - MSFT • 5,221 Reputation points
2020-02-21T01:14:18.907+00:00 Can you please collect the traces again? This time start with the device disconnected, connection and then the perceived delay. If you can quantify the delay/latency you are perceiving that would also help. The trace you shared does not show 200 events per second and does not show any delay in the OS.
-
Sunbreak Wang • 1 Reputation point
2020-02-21T01:15:28.55+00:00 All right.
-
Sunbreak Wang • 1 Reputation point
2020-02-21T01:18:25.92+00:00 BthTracing-2020-0221-0917.etl
https://send.firefox.com/download/c95efe86d0a699db/#bQLDo_vyUpPmH2YxgTUDpw
-
Sunbreak Wang • 1 Reputation point
2020-02-21T01:28:40.49+00:00 The latency comes the first time when the notepad starts to report the data, not between each
NotePenPointer
.When the pen put down on the notepad, notepad starts to report the
NotePenPointer
s.
Android/iOS/MacOS receives the first report at once, but Windows couldn't until 500ms~800ms later.
After the first report latency, Windows works well. NO latency between followingNotePenPointer
s. -
Fay Wang - MSFT • 5,221 Reputation points
2020-02-25T01:05:12.817+00:00 Hi, can you refresh/reupload the link again? Unfortunately it has expired already when I want to download it.
-
Sunbreak Wang • 1 Reputation point
2020-02-25T01:07:02.523+00:00 BthTracing-2020-0221-0917.etl
https://send.firefox.com/download/650e3fda5e06d185/#_dMV8RhL0mwTeKGt47sAPA
-
Fay Wang - MSFT • 5,221 Reputation points
2020-02-25T01:24:44.873+00:00 From the trace, we saw a 24 seconds gap between the connection established and the first notification from the device. This doesn’t seem to align with the 500ms-800ms. Can you provide a description of what happened in the latest trace?
-
Sunbreak Wang • 1 Reputation point
2020-02-25T01:29:45.837+00:00 There a video showing how the notepad work. As you can see, when the first pen down, there is a latency before the canvas drawing
https://send.firefox.com/download/4404cfd93e027d66/#1YmCPv-yOmuTfcoD0YmrvA
-
Sunbreak Wang • 1 Reputation point
2020-02-25T01:35:31.323+00:00 We take some investigation and it seems that the BLE on Win10 will
suspend
withoutValueChanged
event in 500ms.As a workaround, we update the notepad firmware and keep heartbeat notifications to Win10 within every 50ms. It works.
-
Fay Wang - MSFT • 5,221 Reputation points
2020-02-25T01:40:16.503+00:00 OK, glad you solved it.
-
Sunbreak Wang • 1 Reputation point
2020-02-25T02:15:34.647+00:00 It just a workaround for demo. The heartbeat consumes battery vary fast.
Could we find something like BluetoothGatt#requestConnectionPriority to eleminate the latency?
-
Fay Wang - MSFT • 5,221 Reputation points
2020-02-26T05:21:02.207+00:00 We still need traces where the latency happens and enough description to identify the perceived latency. Whether that is a video that was captured along the tracing or more descriptions of the timing of the repro. Can you provide more details about them?
-
Sunbreak Wang • 1 Reputation point
2020-02-26T07:00:28.913+00:00 Sure. I'll make a UWP project to simulate our notepad.
-
Fay Wang - MSFT • 5,221 Reputation points
2020-02-27T01:12:44.42+00:00 OK, once you have finished, please share it and provide the details needed above.
-
Fay Wang - MSFT • 5,221 Reputation points
2020-02-28T09:31:01.023+00:00 Hi, is there any update?
Sign in to comment