HTC 仅在 OpenGL 内发生硬崩溃
我在我的应用程序中看到这个问题已经有一段时间了。它通过在使用 OpenGL 渲染时随机硬锁定或重新启动 HTC 手机来显示自己。检查 logcat 似乎是一个死锁问题,因为您将看到打印的内容...
waitForCondition(LockCondition) timed out (identity=9, status=0). CPU may be pegged. trying again.
到目前为止我能找到的最佳信息来源就在这里: http://groups.google.com/group/android-developers/browse_thread/thread/d5b7e87f4b42fa8f/d6214ed7a02efc98?q=freeze&lnk=ol&
他们建议在glSurface 的 OnDraw 函数结束。我使用这个解决方案并没有得到很好的结果(它仍然崩溃,但频率较低)。还有其他人听说过这个问题吗?遇到过更好的解决方案吗?
I have been seeing this problem for a while in my application. It shows itself by randomly hardlocking or rebooting HTC phones when they are rendering using OpenGL. Checking the logcat it appears to be a deadlock issue as you will see this printed...
waitForCondition(LockCondition) timed out (identity=9, status=0). CPU may be pegged. trying again.
The best source for information I have been able to find so far is over here:
http://groups.google.com/group/android-developers/browse_thread/thread/d5b7e87f4b42fa8f/d6214ed7a02efc98?q=freeze&lnk=ol&
Where they suggest adding a glFinish at the end of your glSurface's OnDraw function. I am not having great results using this solution (its still crashing but less often). Has anyone else heard about this problem? Encountered any better solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们在使用 HTC Sensation 设备和 Android 2.3.4 进行游戏时就遇到了这个问题 - 因此我们购买了该设备并进行了一些实验。解决方案之一是在 onDraw() 方法末尾调用egl.eglWaitGL() ,但这将帧速率减半 - 令人惊讶的是仅在该设备上,但我考虑了这是一个糟糕的解决方案,并一直在寻找。
第二个修复方案(也是我们当前使用的几乎没有性能损失的修复方案)是停止使用glBufferSubData 来更新顶点数组,并继续使用glBufferData 上传整个数组。如果您使用 VBO 和 glBufferSubData 来更新它们,请尝试更改它。
We have been getting exactly this problem on our game with HTC Sensation devices and Android 2.3.4 - so we went and bought the device and experimented for a bit. One of the solutions was to call
egl.eglWaitGL()
at the end of theonDraw()
method but that halved the framerate - suprisingly only on that device, but I consodered it a bad solution and kept looking.The second fix and the one we are using currently which had almost no performance penalty was to stop using
glBufferSubData
to update our vertex arrays and keep uploading the whole array withglBufferData
. If you are using VBO's and glBufferSubData to update them, try changing it.