WARN/SharedBufferStack(2005): waitForCondition(LockCondition) timed out(identity=9, status=0). CPU may be pegged. trying again.
WARN/SharedBufferStack(71): waitForCondition(LockCondition) timed out (identity=9, status=0). CPU may be pegged. trying again.
The thing to note here is that eglSwapBuffers and eglCreateSurface are never, ever supposed to block. If they can't succeed, they're supposed to return with an error indicating so. All error checking for these is meant to be done after the fact -- you call them, check if it worked, try again if it didn't. This means there's nothing built into OpenGL to help with this, and the error is low level enough that it's well below my code's level of visibility.
Behaviorally, this primarily seems to happen upon losing and recreating the OpenGL context during a portrait/landscape switch, and is uncommon in the sense that it happens maybe one or two percent of the time. Doesn't sound like a lot, but that's actually pretty high if you're using your phone actively. It happens about 25% of the time if you call glFinish before swapping the buffers -- pretty good evidence it's a race condition.
While I can avoid glFinish easily enough, I must support both portrait and landscape for these wallpapers, as I'm at the mercy of the home screen there. An application can simply insist in running one or the other and minimize its exposure, but that's not the case with a live wallpaper. Odds are HTC just didn't test any of the marketplace ones at all, and only tested Google's default wallpapers, which are written with the NDK and take a different route, though I wouldn't be shocked if they lockup occasionally as well.
Since it doesn't appear I can actually fix the problem, I unfortunately need to admit defeat. I've added a note about locking up on the G2 to all of our market listings and we will offer a refund to G2 owners upon request. Sorry folks, until HTC looks at the issue there doesn't appear to be anything I can do.
No comments:
Post a Comment