Android engine reporting errors when running in background?

Started by monkey0506, Fri 04/10/2013 15:00:57

Previous topic - Next topic

monkey0506

I originally posted this as a GitHub issue, but maybe this will spark some more attention.

Whenever the Android engine is running in the background (pressing the Home button, switching to another app or activity, etc.) it repeatedly logs errors, such as:

09-28 01:42:42.972: E/Adreno200-EGLSUB(29061): GetBackBuffer() dequeue native buffer failed: No such device
09-28 01:42:42.972: E/Adreno200-EGL(29061): <qeglDrvAPI_eglSwapBuffers:3339>: EGL_BAD_ALLOC
09-28 01:43:02.291: E/Adreno200-ES11(29061): <qglDrvAPI_glTexSubImage2D:2055>: GL_OUT_OF_MEMORY

The timestamps are irrelevant, these errors show up several times per second any time the engine is running in the background. I am trying to determine why these errors are being logged, and whether they are related to the engine silently crashing. At apparently random intervals the Android engine is silently closing, across multiple devices. I have been unable to determine any solid information about this due to its seemingly random nature.

Any insight on these errors and how they might relate would be greatly appreciated.

Crimson Wizard

#1
GetBackBuffer() - is a function in the engine's C++ code? Hmm, maybe not, nevermind.

monkey0506

I was digging around more, and I found a related Android 2.3.3 bug which apparently would cause something similar. In the Android library there's a CustomGlSurfaceView (presumably authored by JJS, I'm too lazy to run back though the git history ATM :P ) which serves as a replacement to the built-in android.opengl.GLSurfaceView. This actually makes me curious why we need a "custom" replacement. Also, the built-in view has onPause and onResume methods for the view to be updated with the activity's lifecycle (e.g., when switching away from the app), but the custom view does not have these methods. This makes me wonder whether the custom view is being appropriately notified of these changes. ??? I really don't know...

monkey0506

Regarding what I said about the view lacking onPause/onResume methods, I tried to manually force the EngineGlue thread to wait while the engine was paused (from the Java side), and there was literally no difference. From what I can tell, it appears the errors are being thrown by native code, but from the OS side not from the engine code.

I put an app through a major stress test, switching away from it and back to it, with and without input during the interim, rotating the screen, switching away during speech clips, locking the screen in and out of the app...everything I could think of to try and force the app to crash (running on the software renderer), but it kept going. Subsequently, the app continued reporting these errors (via logcat) for the entire duration the app was running though (even some 30 minutes later!).

I'm going to try a similar stress test using the hardware renderers to see what happens. Regardless of any fatal errors though, it's still bothersome to see ANY errors being reported in the logs.

Another interesting, but potentially coincidental revelation is that when I was running the app (post-stress test) it was reporting GL_OUT_OF_MEMORY 40 times per second. That being the default FPS of AGS games, it could be leading... >:( This is frustrating! Hopefully I can figure this out before it drives me completely mad.

SMF spam blocked by CleanTalk