New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 806999 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

chrome.bluetoothLowEnergy.registerAdvertisement fails when unregistering/registering advertisements on a regular interval

Reported by jnebe...@radiusnetworks.com, Jan 29 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
Platform: 10032.86.0 (Official Build) stable-channel veyron_tiger

Steps to reproduce the problem:
1. Register first BLE advertisement with chrome.bluetoothLowEnergy.registerAdvertisement API
2. Register second BLE advertisement a short time later (e.g., 10 seconds)
3. Unregister and immediately re-register each advertisement on a regular interval (e.g., 10 seconds)
4. Wait a little while, eventually calls to register new advertisements will fail

What is the expected behavior?
The API should handle regular calls to unregister and re-register BLE advertisements, to effectively "rotate" what is being advertised on a regular interval (e.g., every 30 seconds).

What went wrong?
It appears that after calling the chrome.bluetoothLowEnergy.registerAdvertisement API on a short regular interval (e.g., once every 10 seconds) for a little while the API begins to fail. Initially when the failure occurs the API takes a while to return, but will eventually return with the error: "Operation failed". 

Even though the API returns with a failure (and doesn't return an advertisement ID), it appears that the OS has still registered that advertisement under the hood because after the fifth "Operation failed" attempt the API instead returns "An advertisement is already advertising", which means that the maximum number of registered advertisements has been reached.  While the OS believes it has registered advertisements, nothing appears to be being broadcast from the device.

Since the API did not return advertisement IDs, the chrome.bluetoothLowEnergy.unregisterAdvertisement API can't be used to try to recover from this state by freeing up one of the advertisement slots.  In addition, the "An advertisement is already advertising" errors are still present after resetting BLE advertising with the chrome.bluetoothLowEnergy.resetAdvertising API, so that doesn't resolve the issue either.  Once in this state, a reboot is the only way to recover.

I have attached a screenshot of the logs of the provided test app from when the issue was occurring.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 63.0.3239.140  Channel: stable
OS Version: 63.0.3239.140
Flash Version: 

I have attached a test Chrome app that allows you to reproduce the issue, you can input an advertisement rotation interval and the app will call the registerAdvertisement API on that interval.  A shorter interval (e.g., 2 seconds) allows you to reproduce the issue quickly and reliably.  Longer intervals (e.g., 30-45 seconds) take longer to exhibit the issue but it can still occur after running for an extended period of time.

The attached test app has also been uploaded to the Chrome web store at this link:
https://chrome.google.com/webstore/detail/chrome-multiple-ble-adver/ikpgoppmdfdpgejjelkfladjbnecjkgg

Testing on different hardware, it does appear to happen more often on some models with the AOpen Chromebase Mini being the worst offender.  That said, the problem has been seen on an ASUS Chromebit as well.
 
dk_1.0.3.zip
16.4 KB Download
Screen Shot 2018-01-29 at 3.42.30 PM.png
595 KB View Download
The test app can also be found on Github here:

https://github.com/RadiusNetworks/chrome-806999

Comment 2 by ortuno@chromium.org, Jan 29 2018

Cc: mcchou@chromium.org sonnysasaka@chromium.org
Components: -Blink>Bluetooth OS>Systems>Bluetooth
Owner: r...@chromium.org
Status: Untriaged (was: Unconfirmed)
Any chance you could test with chrome beta or dev?

Instructions: https://support.google.com/chromebook/answer/1086915?hl=en
I tested this on a 2012 Chromebook Pixel and could not reproduce on that specific hardware. I did, however, reproduce on an Asus Chromebit.
I tested on the beta and dev channels and was able to reproduce with an advertisement registration interval of 10 seconds, OS details below.


Beta:
Google Chrome Version	
64.0.3282.122
Platform Version	
10176.61.0 (Official Build) beta-channel veyron_tiger

Dev:
Google Chrome Version	
65.0.3325.9
Platform Version	
10323.1.0 (Official Build) dev-channel veyron_tiger

Comment 5 by mcchou@chromium.org, Apr 19 2018

Cc: r...@chromium.org rjahagir@chromium.org dwmclary@chromium.org
Labels: -Via-Wizard-API
Owner: ----
Status: Available (was: Untriaged)

Sign in to add a comment