characteristicvaluechanged is fired in batches |
||||||
Issue descriptionObserved on a Nexus 5 and Nexus 6P, Chrome Dev & Chrome Canary respectively. Observed on Miband and heart rate monitor. https://webbluetoothcg.github.io/demos/heart-rate-sensor/ I get between 30-50 characteristicvaluechanged events before they stop. Refreshing the browser doesn't bring them back, the tab must be closed and reopened to get another 30-50 events.
,
Mar 14 2016
There seem to be two issues here: 1. Notifications stops 2. After reloading notifications don't work. Did the screen turn off by any chance? We currently disconnect when the screen turns off which would explain 1. I'm still looking into 2.
,
Mar 14 2016
I was able to reproduce both. I'll look into why this is happening.
,
Mar 15 2016
I didn't turn the screen off to trigger the notifications stopping.
,
Mar 16 2016
1. I cannot reproduce this with the BLE Simulator Android App on a Nexus 6 and a Nexus 5 on https://webbluetoothcg.github.io/demos/heart-rate-sensor/ 2. Yup. Could it be related to https://bugs.chromium.org/p/chromium/issues/detail?id=589796?
,
Mar 16 2016
2. Yup. Could it be related to https://bugs.chromium.org/p/chromium/issues/detail?id=589796 ?
,
Mar 16 2016
1. Weird that you were not able to reproduce. I was able to reproduce with a N6 and N5 running as central and a N9 as a peripheral. After a while the events no longer reach js or if they do, they reach in batches rather than when they are received by the device. 2. Maybe. I need to check that part of the code more carefully. Also I'm refactoring that part of the code so it'll probably get fixed then.
,
Mar 17 2016
1. I've been stressing the demo enough to notice these batches. As you can read from these adb logs, the 'characteristicvaluechanged' event is triggered in batches while "cr_Bluetooth: onCharacteristicChanged" have been logged properly ahead of time. 03-17 11:45:29.375 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK ON using UART driver's ioctl() 03-17 11:45:29.378 354 380 I cr_Bluetooth: wrapper onCharacteristicChanged. 03-17 11:45:29.378 354 380 I cr_Bluetooth: device onCharacteristicChanged. 03-17 11:45:29.380 354 354 I cr_Bluetooth: onCharacteristicChanged 03-17 11:45:29.416 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK OFF using UART driver's ioctl() 03-17 11:45:29.545 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK ON using UART driver's ioctl() 03-17 11:45:29.548 354 1459 I cr_Bluetooth: wrapper onCharacteristicChanged. 03-17 11:45:29.548 354 1459 I cr_Bluetooth: device onCharacteristicChanged. 03-17 11:45:29.549 354 354 I cr_Bluetooth: onCharacteristicChanged 03-17 11:45:29.554 354 354 I chromium: [INFO:CONSOLE(16)] "valuechanged", source: http://localhost:8001/app.js (16) 03-17 11:45:29.586 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK OFF using UART driver's ioctl() 03-17 11:45:29.770 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK ON using UART driver's ioctl() 03-17 11:45:29.773 354 382 I cr_Bluetooth: wrapper onCharacteristicChanged. 03-17 11:45:29.774 354 382 I cr_Bluetooth: device onCharacteristicChanged. 03-17 11:45:29.775 354 354 I cr_Bluetooth: onCharacteristicChanged 03-17 11:45:29.812 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK OFF using UART driver's ioctl() 03-17 11:45:29.951 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK ON using UART driver's ioctl() 03-17 11:45:29.953 354 449 I cr_Bluetooth: wrapper onCharacteristicChanged. 03-17 11:45:29.953 354 449 I cr_Bluetooth: device onCharacteristicChanged. 03-17 11:45:29.954 354 354 I cr_Bluetooth: onCharacteristicChanged 03-17 11:45:29.992 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK OFF using UART driver's ioctl() 03-17 11:45:30.131 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK ON using UART driver's ioctl() 03-17 11:45:30.134 354 380 I cr_Bluetooth: wrapper onCharacteristicChanged. 03-17 11:45:30.134 354 380 I cr_Bluetooth: device onCharacteristicChanged. 03-17 11:45:30.135 354 354 I cr_Bluetooth: onCharacteristicChanged 03-17 11:45:30.174 6404 6404 I WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK OFF using UART driver's ioctl() 03-17 11:45:30.319 354 354 I chromium: [INFO:CONSOLE(16)] "valuechanged", source: http://localhost:8001/app.js (16) 03-17 11:45:31.124 354 354 I chromium: [INFO:CONSOLE(16)] "valuechanged", source: http://localhost:8001/app.js (16) 03-17 11:45:31.971 354 354 I chromium: [INFO:CONSOLE(16)] "valuechanged", source: http://localhost:8001/app.js (16) 03-17 11:45:32.760 354 354 I chromium: [INFO:CONSOLE(16)] "valuechanged", source: http://localhost:8001/app.js (16) 03-17 11:45:33.590 354 354 I chromium: [INFO:CONSOLE(16)] "valuechanged", source: http://localhost:8001/app.js (16) 03-17 11:45:34.415 354 354 I chromium: [INFO:CONSOLE(16)] "valuechanged", source: http://localhost:8001/app.js (16) 03-17 11:45:35.229 354 354 I chromium: [INFO:CONSOLE(16)] "valuechanged", source: http://localhost:8001/app.js (16) 03-17 11:45:36.084 354 354 I chromium: [INFO:CONSOLE(16)] "valuechanged", source: http://localhost:8001/app.js (16)
,
Mar 17 2016
,
Mar 17 2016
The issue isn't just batching. I can leave the device for many minutes and no further events are received. If I refresh the page I get no events.
,
Mar 17 2016
If you leave the device for many minutes, I believe Android will turn off your screen which will then fire a visibilitychange event. This event actually disconnect your device, hence why you don't receive further events. Refreshing the page is another issue I believe: https://bugs.chromium.org/p/chromium/issues/detail?id=589796
,
Mar 17 2016
@fbeaufort: My experience was that first the events will start to get fired in batches rather than when they arrive, after a while I would stop getting events altogether.
,
Mar 18 2016
,
Mar 18 2016
Could it be related to https://github.com/thegecko/web-bluetooth-dfu/issues/18#issuecomment-198292305 somehow?
,
Mar 18 2016
I don't need to turn off the screen to recreate this bug
,
Mar 18 2016
Thanks Jake. Gio, can you have a deeper look today?
,
Apr 15 2016
(gentle ping)
,
Apr 15 2016
I'm hoping this patch fixes the issue: http://crrev.com/1818663002
,
Apr 22 2016
I've just tried with latest Chromium build (currently 52.0.2716.0) and after 324 notifications I wasn't able to reproduce it. ortuno, jake can you have a look as well and confirm before marking this bug as Verified?
,
Apr 25 2016
Can't reproduce anymore.
,
Sep 12 2016
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by scheib@chromium.org
, Mar 14 2016Status: Available (was: Untriaged)