pdjstone / cloudpets-web-bluetooth

Demo of CloudPets toy functionality using Web Bluetooth
MIT License
29 stars 12 forks source link

Works best on Android? #1

Closed beaufortfrancois closed 7 years ago

beaufortfrancois commented 7 years ago

In https://github.com/pdjstone/cloudpets-web-bluetooth/#cloudpets-web-bluetoooth-demo, you say it works best on Android? Can you tell us why?

Thanks in advance, Francois.

Re: audio issue, once https://codereview.chromium.org/2707823002/ is pushed, it should be solved. See https://bugs.chromium.org/p/chromium/issues/detail?id=647673&desc=2#c10

pdjstone commented 7 years ago

It's actually more to do with the fact that I've only tested it on Android and a Chromebook, and it seems to work best on Android. I've not tried it out on Windows, and Chrome on Linux doesn't seem to support Web Bluetooth (at least, not with the version of BlueZ that ships with Ubuntu 16.04)

beaufortfrancois commented 7 years ago

Which issues did you face on the chromebook? I'm asking because I use one on a daily basis and it works fine for me.

Windows is not yet supported. Linux is still behind a flag and as you've said, you need recent version of BlueZ.

pdjstone commented 7 years ago

We were running into some issues on the Chromebook with getting 'GATT operation in progress' errors which could only be resolved by rebooting it (rebooting the toy and disabling/reenabling Bluetooth on the Chromebook didn't seem to sort it). We're using an Acer C810.

Also I had to work around https://github.com/WebBluetoothCG/web-bluetooth/issues/188 when sending audio to the toy (for both ChromeOS and Android). Currently the code waits a few ms after sending each chunk of data, but this means we're either sending slower than is possible, or getting GATT errors on certain hardware combinations I've not tested.

beaufortfrancois commented 7 years ago

@pdjstone Do you mind filing a bug at https://bugs.chromium.org/p/chromium/issues/entry?components=Blink%3EBluetooth regarding the "GATT operation in progress" errors ?

Is this how I could reproduce the issue?



    await chars.audio_send.writeValue(bytes);
    if (remaining_data - len > 0) {
-     setTimeout(sendNextChunk, 8);
+     sendNextChunk();
      return true;
pdjstone commented 7 years ago

We kept getting the GATT errors while recording our video for the blog at the last minute. I'm totally unable to reproduce it today (even if I change the setTimeout to requestAnimationFrame). I'm going to put it down to demo gremlins.

pdjstone commented 7 years ago

I've updated Readme to suggest either Android or Chrome OS