Friday, December 19, 2014

OpenGL Config Crash on Smart Watches

After being pretty excited to have gotten a collection of watch faces out and working so quickly, of course an issue had to show up.  In this case we got some crash reports from folks about the Moto360 and the Sony SmartWatch3.  We were kind of surprised, honestly, since we'd been testing extensively on the various emulators and on a LG G Watch R and hadn't seen a single issue.

So, we acquired a Moto360 to test on, and lo and behold it did indeed crash.  After fiddling with bluetooth debugging for a bit, we finally got a working callstack.  So, what was the problem?

Well, we use OpenGL for all this stuff, and when you instantiate an OpenGL viewport you make some requests about color depth, whether you need a z-buffer, etc.  That's all well and good, but it was failing to return a valid viewport on the 360.  As it turns out, we request a 16-bit buffer by default, and the 360 only supports a 32-bit one.  That's something we've never seen from a chipset before.

Our code wasn't tolerant of this situation and since we've never had the problem, it had never really been an issue previously.  So, we made some changes, and now we handle it properly.  Hopefully that wraps things up across the various devices that were seeing a crash, and lets everybody run these with no problems.

As a result, we've updated these products to version 1.11.


  1. Thank you for telling about this bug! We won't use 16-bit in watch faces too.

    1. Just something to be aware of. It's easy enough to fall back to a 32-bit buffer if a 16-bit one isn't available. We just didn't realize our code wasn't handling it since no other devices disallow 16-bit.