Assuming I correctly identified the code that unixseb uses as the
workaround/fix for orientation changes on Droid in Live Wallpaper with
OpenGL, the following code is the same with the exception of
recursion:

    public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay
display, EGLConfig config, Object nativeWindow) {
        EGLSurface eglSurface = null;
        while (eglSurface == null) {
            try {
                eglSurface = egl.eglCreateWindowSurface(display,
config, nativeWindow, null);
            } catch (Throwable t) {
            } finally {
                if (eglSurface == null) {
                    try {
                        Thread.sleep(10);
                    } catch (InterruptedException t) {
                    }
                }
            }

        }
        return eglSurface;
    }



I'd like to know if unixseb's fix works for others.  I still cannot
test.


On Apr 6, 11:00 am, Ralf Schneider <[email protected]> wrote:
> I'm also interested in this topic. I got an 404 on the link: This seems to
> work:
>
> http://code.google.com/p/earth-live-wallpaper/
>
> Thank you for sharing your code!
>
> 2010/4/6 unixseb <[email protected]>
>
>
>
> > have a look at the svn repository on code.google.com/project/earth-
> > live-wallpaper <http://code.google.com/project/earth-%0Alive-wallpaper>
> > the hack int the glwallpaperservice class avoid some crashes with
> > screen rotation on droids.
>
> > On 5 avr, 20:24, Robert Green <[email protected]> wrote:
> > > Oh, so you solved it??  What's the issue and what's the workaround?
>
> > > On Apr 4, 3:33 pm, unixseb <[email protected]> wrote:
>
> > > > i can help you,
> > > > i'm having this issue with earth live wallpaper.
> > > > i tracked a bug in the swap function taht causes service dies, but i
> > > > was looking for this one for a long time now !
>
> > > > On 3 avr, 23:56, Robert Green <[email protected]> wrote:
>
> > > > > I've had this reported to me by a few people using the
> > > > >GLWallpaperServicecode I posted.  I've been debugging this for hours
> > > > > and have so far tracked the problem down to
> > > > > egl.eglCreateWindowSurface(display, config, nativeWindow, null);
>
> > > > > It never returns and every notifyAll() after that results in:
> > > > > W/SharedBufferStack( 1030): waitForCondition(ReallocateCondition)
> > > > > timed out (identity=288, status=0). CPU may be pegged. trying again.
>
> > > > > It seems to happen when switching orientation - so when the surface
> > is
> > > > > being destroyed/recreated and more specifically when calls to render
> > > > > the frame are being made at the same time.  If there are no render
> > > > > calls happening while switching, things seem mostly ok.  I'm
> > debugging
> > > > > this further but I feel like a method like that should never
> > > > > deadlock.  Seems like a bug somewhere below the line to me.
>
> > > > > Since none of the GL init code from the shipped live wallpapers was
> > > > > posted anywhere, I have no good reference to use for how to properly
> > > > > handle the window resizing.  Clearly the code I'm using does it a
> > > > > little differently but I still feel like a deadlock like this should
> > > > > not occur.
>
> > --
> > 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]<android-developers%2bunsubs­[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> > To unsubscribe, reply using "remove me" as the subject.- Hide quoted text -
>
> - Show quoted text -

-- 
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