String, I could try and make sure I'm not drawing to the screen from
several places at the same time, but I don't think this is the
problem. My drawing loop is strictly single threaded (fed data by
several other threads, obviously), so Android would have to be
maintaining multiple GL message loops at once. At any rate, I think
the problem is more "mechanical"...

My app has been on the Market for almost a year now, and hasn't had
these problems until now. I recently changed a couple of things, the
most noteworthy being the ability to use 256x256 textures rather than
128x128. As the crashes are completely random, I cannot be completely
certain if this is the problem, but I don't seem to be getting the
crashes when sticking to 128x128 textures, so maybe I'm exceeding some
secret limit? For the record, aside from some 6 UI buttons at 64x64,
I'm using about 9 256x256 textures and a single 1024x1024 texture. I
am aware that this can be optimized to use less textures, and that may
well be the fix to stop the phone from crashing.

So I'm not sure the problems are the same, but maybe they're related?

- Mark

On Aug 16, 9:59 pm, String <sterling.ud...@googlemail.com> wrote:
> On Aug 15, 12:46 pm, Mark Gjøl <bitflips...@gmail.com> 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/f...
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to