On Aug 15, 12:46 pm, Mark Gjøl <[email protected]> wrote:

> It's always a problem if you can crash the phone. As I'm working with
> OpenGL I'm guessing this is the problem, as I'm working directly with
> the hardware. When the phone crashes it hangs for a couple of minutes,

Mark,

It's not just you. One of my OpenGL apps has been plagued with this
problem for a couple of months now, and I've virtually given up on it
as unsolvable. I've actually unpublished the free version of this app
because so many users were affected, and my fear is that the paid
version will ultimately be doomed as well.

The thing that makes it just so difficult is that I cannot make it
happen with any regularity. I see it on either my G1 or N1 maybe once
every couple of weeks, but with no discernible pattern. This makes it
essentially impossible to test any proposed fix, because I just can't
tell if the problem has gotten any better.

You might look at the following old thread, if you haven't already:
http://groups.google.com/group/android-developers/browse_frm/thread/f7b6b17b04f93ef3
There is a proposed solution in there that didn't help me, but you
might have better luck. There are also a couple of issues in the
bugtracker linked from that thread.

My best theory is that it's some sort of race condition between the UI
and OpenGL threads... I think I was able to reduce (but not eliminate)
the occurrences by making my code as thread-safe as possible. Things
like:
- using the "volatile" modifier on all variables touched in
onDrawFrame()
- using "synchronize" on other functions called from within my OpenGL
code
- putting a semaphore in onDrawFrame() to ensure that it's only ever
got one instance running at a time
...and so on.

Good luck with this, and I mean that with all my heart. It's the most
dispiriting programming problem I've faced in a long, long time.
Please let us know if you get anywhere with it.

String

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to