Hi Guys!
This is the most weirdest thing ever on Android!
My game hangs on Samsung Galaxy S (Android OS 2.2.1).
I build for armv7 / OpenGL ES 2.0. And it goes past the splash screen, it loads the first scene, and then the second. It plays the animation from the second scene and suddenly the app hangs. (the OS too)
At that moment the logs are filled with messages like these:
“PVRSRVEventObjectWait Timeout!
W/SharedBufferStack( 3149): waitForCondition(ReallocateCondition) timed out (identity=6, status=0). CPU may be pegged. trying again.”
Also the OS hangs and the only way to get it back working is by removing the phone battery.
I’m still investigating the issue and if I find anything new I’ll post it.
But most of the advices given at the above links did not seem to help in any way.
So the problem in my case was generated by the following case:
Somewhere in the game I had 3 cameras that were rendering something visible from a certain layer in 3 separate Render Textures.
The render textures were set as mainTexture on the material of 3 quads that were being rendered by the main camera.
When the application started the GameObjects of the 3 quads were set to inactive and thus they were not visible. But the 3 cameras
that were rendering to the 3 render textures were still active and generating draw calls.
THIS WAS THE PROBLEM FOR ANDROID! As soon as the app started it started rendering, it would start logging the above described timeout error.
BUT if I would activate the gameobjects for those 3 quads in Awake() or Start() the app worked fine.
So if a render texture rendered by a camera is used by another Renderer rendered by the main camera, but that renderer is inactive, on the Android (2.1, 2.2.1 - all I could test on) it generates something like a deadlock in the OS rendering API or something like that.
Conclusion:
So to keep those 3 quads hidden I had to disable the 3 cameras that were rendering to the render textures too. Which I should have done in the first place to avoid extra unnecessary draw calls.
Hope this helps someone out there. It was a painful experience in a tight deadline.
I can confirm having the same problems with Render Textures. But I have not yet found a solution to my particular problem. Disabling all cameras and models using the render textures did not help. But removing them completely from the game did.
But I really need them for my menu-system so I’ll have to keep banging my head at it.
I’m sry that my solution did not help you.
If you want maybe I can help. Try to isolate your problem in a simple Unity scene, make it a unitypackage and upload it here.
I will take a look at it as soon as I can and get back to you with some feedback.
I had the same problem. I was using NGUI and the program was crashing with “waitForCondition” error. After 2 days of testing and researching I found out that the problem was one of the shaders from the NGUI. Inside one of the shaders there was a call which made the error.
After commented the clip method, it will not crash, but the shader will not work as expected. Now I have to find a solution to this.
PS: the errors occours only on devices that have GPU - model: Adreno 205 .
Try to use the “Alpha Clip” instead of the “Hard Clip” as the Clipping Mode in every UIPanel(s).
Few old drivers of the GPUs like Adreno 205 doesn’t support the clip() function in the fragment shader correctly.
NGUI’s “Alpha Clip” or “Soft Clip” shader has been implemented as replacing fragments with transparent color inside clipping areas.
It has more compatibility, but it’ll be much slower.