EGL_BAD_ALLOC error

Started by AeroShark333, January 21, 2015, 05:38:51 PM

Previous topic - Next topic

AeroShark333

Hello everyone,

I hope I can get some help with an odd error.
I am getting this error a lot lately in the Google Developers Console:
java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC
at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1077)
at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1035)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1333)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)


I got three reports of this error.
I found it odd that all three reports came from Android 2.2 devices.
Devices:
Galaxy Mini (GT-S5570)
IDEOS S7 Slim (qsd8k_slim)
Galaxy Precedent (SCH-M828C)

I hope that I can get some help with this error! :)

Cheers,
Abiram

EgonOlsen


AeroShark333

I mainly found that adding (instance GLSurfaceView).onPause() and (instance GLSurfaceView).onResume() should work in the Overridden methods of Activity. However, I already have those...

AeroShark333

#3
Update.

New error:
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)

But this time it is not on Android 2.2, but Android 4.0.3 - 4.0.4.
Device: nuclear-XIONhh901

I couldn't find anything about this device.
However, the Android 2.2 devices all had an Andreno 200 GPU (if that matters)...

EgonOlsen

Does this happen at startup or randomly at runtime...or when? It's clearly something on your side, because jPCT-AE just renders into a gl context. It doesn't care about any buffer swapping and such and it doesn't trigger anything in that regard.

AeroShark333

I really do noy have a clue...
The Play Store doesn't give more information tham that.
Any other suggestions?

EgonOlsen

Not really. If that's all you get as debug information, it's hard to make something out of it. Maybe it's related to memory? It might be worth a  try to add "android:largeHeap" to your manifest (in case you haven't already) and see if that helps, but other than that, it's hard to fix this (if it's even possible) without an actual device that allows you to reproduce this error.

AeroShark333

#7
Hmm, I can add android:largeHeap="true"
However, I do not think that would fix the error on Android 2.2 devices.
Why? Because the largeHeap feature is added in API Level 11.
Android 2.2 (API Level 8 ) would ignore that line, since it's function is known.

EgonOlsen

I wasn't sure when it was added...it won't help then.

AeroShark333

java.lang.NullPointerException
at com.threed.jpct.GLRenderer.setTextures(GLRenderer.java:2441)
at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2297)
at com.threed.jpct.World.draw(World.java:1417)
at com.threed.jpct.World.draw(World.java:1100)
at com.aeroshark333.skinviewer.SkinActivity$ViewerRenderer.onDrawFrame(SkinActivity.java:1048)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1146)

How does this happen?

line 1048: [mainWorld.draw(frameBuffer);]

EgonOlsen

Most likely because you are fiddling around with something jPCT related in some other than the rendering thread, like changing textures in an async way or in an event listener.


AeroShark333

#12
So passing "Runnable"s to the GLSurfaceView thread should solve my problem, right?

Edit: Using GLSurfaceView.queueEvent(Runnable r);

EgonOlsen

That's one solution...at least if something like this really causes your problem.

AeroShark333

A bit offtopic but is it possible to bend an Object3D.
For instance, let's say I have an cube object (uv mapped). Is it possible to curve/bend it so there probably will be more vertices, but it still has the appropriate texture on each cube face. Bend/curve = making a cube a bit 'U' shaped for example.

Sorry for this question, I am very noob at OpenGL related stuff :/