AndEngine icon indicating copy to clipboard operation
AndEngine copied to clipboard

java.lang.RuntimeException: eglSwapBuffers failed

Open walidhalabi opened this issue 13 years ago • 5 comments

Getting this very often (but still intermittently)

Comes in a few flavours

java.lang.RuntimeException: eglSwapBuffers failed: EGL_SUCCESS at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1085) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1043) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1369) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1123)

Similarly, the following:

java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1079) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1037) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1342) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)

And another:

java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_CURRENT_SURFACE at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1142) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1100) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1440) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1180)

walidhalabi avatar Feb 14 '12 21:02 walidhalabi

Same here, also : EGL_BAD_MATCH.

kocus avatar Mar 08 '12 09:03 kocus

I've seen this issue on my games also. There isn't clear information on the internet to why this is happening. Most people say it's because the devices running the game are to old or don't have enough resources to load the entire game. I believe that to be true in my case. My game loads 100+ sprites into memory...

liquidjoshair avatar Aug 07 '12 15:08 liquidjoshair

The same problem

java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1229) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1187) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1514) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1267)

oleonov avatar Jan 09 '13 05:01 oleonov

HI, I have a lot of EGL_SUCCESS in my applications. From my research, it should come from memory issues with the usage of big textures (e.g. more than 1024x1024). But even after a huge reductions of the textures, it still happens on low end devices...

I don't have any EGL_BAD_ALLOC though. This one is supposed to come from bad synchro between the application lifecycle and the GLSurfaceView. See the solution here: http://stackoverflow.com/questions/6039107/android-glsurfaceview-egl-bad-alloc

flomin avatar Jan 09 '13 08:01 flomin

BaseGameActivity already has calls onPause and onResume for GLSurfaceView so http://stackoverflow.com/questions/6039107/android-glsurfaceview-egl-bad-alloc is not solution.

oleonov avatar Jan 09 '13 09:01 oleonov