Freeze on Adreno 200 GPUs (SharedBufferStack)

I just stumbled over this since my device (along with tons of others) is affected: there is a well-known problem related to phones using an Adreno 200 GPU that causes them to completely freeze in GLES applications, see for example here:

In the game I’m currently developing it happens somewhere from a few seconds to minutes after starting it on my phone. It freezes the phone to a point where only removing the battery helps :frowning:
Here’s the log output that gets repeated until infinity:
W/SharedBufferStack( 1578): waitForCondition(LockCondition) timed out (identity=23, status=0). CPU may be pegged. trying again.
W/SharedBufferStack( 237): waitForCondition(LockCondition) timed out (identity=1, status=0). CPU may be pegged. trying again.
W/SharedBufferStack( 1578): waitForCondition(LockCondition) timed out (identity=23, status=0). CPU may be pegged. trying again.
W/SharedBufferStack( 237): waitForCondition(LockCondition) timed out (identity=1, status=0). CPU may be pegged. trying again.
W/SharedBufferStack( 1578): waitForCondition(LockCondition) timed out (identity=23, status=0). CPU may be pegged. trying again.
W/SharedBufferStack( 237): waitForCondition(LockCondition) timed out (identity=1, status=0). CPU may be pegged. trying again.
W/SharedBufferStack( 1578): waitForCondition(LockCondition) timed out (identity=23, status=0). CPU may be pegged. trying again.
W/SharedBufferStack( 237): waitForCondition(LockCondition) timed out (identity=1, status=0). CPU may be pegged. trying again.

As you can see from the links I provided there are many theories about what might cause the problem and it’s a pretty serious showstopper. I know this isn’t really an issue of jME, but do you maybe have any ideas which features of jME might trigger it or how to work around it when using jME?

The only thing really is to try turning off features and see if that helps…

If your phone is reasonably new take it back and demand an exchange (since it is faulty).

Yup I’m turning off stuff but couldn’t track it down so far.
Although its annoying during development I’m not that much worried about my own phone, but about the millions out there that use the same GPU (it’s a rather common one)…I wouldn’t release an app with such an issue and blocking the affected devices from downloading it wouldn’t be nice either, so I hope that a solution can be found.

I’m surprised this didn’t come up before the bug has been reported in october 2011

Also I never witnessed that with my Nexus one.
What android version do you have?

Digging a bit deeper, it seems that the issue comes from FBO (FrameBufferObjects). We don’t support them properly for android (it’s in our todo). So that would explain why I never had the problem.

FBO are used for : Shadows, Filters (all post process effects), and simple water for the reflection and refraction maps.
Here is a span of feature you may want to try to disable.

EDIT : also considering that he issue is 1 year and a half old, and occurring only on 2.3.6 (or lower) for Adreno 200…IMO it’ll probably be never fixed for those versions. My guess is that google will wait for android 2.3 to disappear…
That’s a shame…

I have a device with Adreno 200 (LG Optimus Link Dual Sim P698). Nehon’s tetris works ok.
android is 2.3.2 as far as i remember…

I’m using Android 2.2, but the problem remains unfixed until at least Honeycomb if you believe commet #13 over here:
http://code.google.com/p/android/issues/detail?id=7432

Also, I’m definitely not using any FBOs - just one shader without lighting and one with, and a few textures, so nothing that should be too uncommon…
I also read that it might be related to using sound or non-square textures, but that’s not the case for my game either.

Edit:
Here’s something that might be interesting:

What surface format are you using? I experienced the same kind of errors on my HTC Incredible if I created a 24-bit back-buffer format (8 bits per channel on RGB, no alpha). The fix was to add an 8-bit alpha channel
(Source: https://groups.google.com/forum/?fromgroups#!topic/android-ndk/XNuOmGjQyv0)

@nehon submitted some changes just yesterday that change which config my device chooses, so maybe that fixes the freeze as well? Will do some more testing.

To keep you updated, I didn’t have any more freezes since the config gets chosen properly. Phew :slight_smile:

Hi @Sebioff

I believe I also get this issue when running a test on HTC Desire, device freezes and reboots after a few seconds. When I interact with the game it happens even quicker. On other devices it seems to run perfectly. The device runs on Android 2.3.7 as far as I can remember.

The game runs very well on the device, its only this issue that gets to me. Any help will be appreciated.

I have actually reported this issue a looooong time ago… when I was still young :stuck_out_tongue: or did I ?! 8-O

@meeshter said: I believe I also get this issue when running a test on HTC Desire, device freezes and reboots after a few seconds.

The HTC Desire also uses the Adreno 200 GPU, so that could very well be. Did you try the latest version of jME from SVN? I tested a lot with that in the meantime and didn’t experience any more freezes.
If that doesn’t fix the problem for you, however, I think that since this is a fault of the GPU or drivers and not jME and nobody really seems to know what exactly triggers it it’s unlikely there’ll ever be a fix :frowning:

@Sebioff said: Did you try the latest version of jME from SVN?

I have updated to nightly if that is what you mean. Will continue testing on it from time to time.

For those interested:

@ndebruyn told me that he experienced the same issues a while back. He recommended that I test without using standard Particle Emitters as they are on JME.

After testing on the HTC Desire (GPU adreno 200) the game was running exceptionally well and it did not crash at all.

Is this something that can be fixed or should I not use the particle emitters?

Thanks to all