Sunday, October 3, 2010

Various Updates & HTC Drivers

So, HTC has rather iffy OpenGL drivers on their phones.  They suffer from a long-standing intermittent bug that locks up your whole phone, frequently requiring a battery-pull to recover.  The bug appears to be a race condition when they swap framebuffer frames, so it's really below my ability to to anything about, and I suspect it's somewhat framerate dependent.

Now, one way you can minimize the problem, one fellow on the mailing list identified, is by using glFinish() to wait until all operations are done before swapping the buffers.  The problem is this slows down rendering substantially across all phones (not just HTC's phones).  The other problem is that starting with the G2, using glFinish() causes the wallpaper rendering to lock up when switching between portrait and landscape.  No other phones do this, just the G2.

All of these will eventually boil down to a whole mess of messages in your logs, all reading something like this:

W/SharedBufferStack(21310): waitForCondition(LockCondition) timed out
(identity=2376, status=0). CPU may be pegged. trying again.
W/SharedBufferStack(21310): waitForCondition(LockCondition) timed out
(identity=2376, status=0). CPU may be pegged. trying again.
W/SharedBufferStack(21310): waitForCondition(LockCondition) timed out
(identity=2376, status=0). CPU may be pegged. trying again.

Whatever they did with the G2, they did improve one thing because this doesn't appear to be pull-your-battery fatal anymore.  It does seem to happen much more easily though, and as it appears to happen much more often when I have glFinish() being called, and as calling glFinish() really hurts the framerate, I'm going to go back to the original status quo and remove it from the wallpapers that I'd added it to.  My hope is that this change of behavior on the G2 at least signals that someone at HTC is attempting to fix the problem, and maybe in a future update they'll fix it for real.

As it is, whatever I do results in failure on some HTC devices, so I may as well make failure rare if I can't fix it.  So, this is the purpose of a handful of updates that are going to go out today -- get everything on an even keel and hopefully minimize whatever failures occur on HTC devices, as I'm fairly confident I can't completely fix it.

No comments:

Post a Comment