I’m curious: what are the results with assertions disabled?
After disabling assertions, the application no longer crashes and works as expected both with and without an audio device plugged in.
I’d like to understand the cause of the OpenGLException
. To debug this, it might help to run the renderer in Graphics Debug mode. This is a bit tricky…
- I don’t know how to do this through the JME test chooser. You’ll need to figure out a way to run the app (
TestAmbient
) directly: not through the chooser. (In the JME SDK, by opening the source file and pressing Shift-F6.) - Change body of
TestAmbient.main()
like so:
TestAmbient test = new TestAmbient();
AppSettings as = new AppSettings(true);
as.setGraphicsDebug(true);
test.setSettings(as);
test.start();
- Run with assertions enabled and capture all console output. (There may be a lot of it.)
- The setting is persistent, so when you’re done, re-run the application with
as.setGraphicsDebug(false)
.
OK, this is the resulting debug message + full stacktrace:
[JME3] OpenGL debug message
ID: 1280
Source: API
Type: ERROR
Severity: HIGH
Message: Error has been generated. GL error GL_INVALID_ENUM in GetBooleanv: (ID: 659224037) Generic error
java.lang.Exception: Stack trace
at java.base/java.lang.Thread.dumpStack(Thread.java:1387)
at com.jme3.system.lwjgl.LwjglGLDebugOutputHandler.handleMessage(LwjglGLDebugOutputHandler.java:76)
at org.lwjgl.opengl.GL11.nglGetBooleanv(Native Method)
at org.lwjgl.opengl.GL11.glGetBoolean(GL11.java:1321)
at com.jme3.renderer.lwjgl.LwjglGL.glGetBoolean(LwjglGL.java:280)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.jme3.renderer.opengl.GLDebug.invoke(GLDebug.java:107)
at com.sun.proxy.$Proxy0.glGetBoolean(Unknown Source)
at com.jme3.renderer.opengl.GLRenderer.getBoolean(GLRenderer.java:603)
at com.jme3.renderer.opengl.GLRenderer.setMainFrameBufferSrgb(GLRenderer.java:3229)
at com.jme3.system.lwjgl.LwjglContext.initContextFirstTime(LwjglContext.java:296)
at com.jme3.system.lwjgl.LwjglContext.internalCreate(LwjglContext.java:429)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:121)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)
at java.base/java.lang.Thread.run(Thread.java:834)
Dec 01, 2020 8:29:37 PM com.jme3.app.LegacyApplication handleError
SEVERE: Failed to create display
com.jme3.renderer.RendererException: An OpenGL error occurred - Invalid enum argument (Error Code: 1280)
at com.jme3.renderer.opengl.GLDebug.checkError(GLDebug.java:101)
at com.jme3.renderer.opengl.GLDebug.invoke(GLDebug.java:113)
at com.sun.proxy.$Proxy0.glGetBoolean(Unknown Source)
at com.jme3.renderer.opengl.GLRenderer.getBoolean(GLRenderer.java:603)
at com.jme3.renderer.opengl.GLRenderer.setMainFrameBufferSrgb(GLRenderer.java:3229)
at com.jme3.system.lwjgl.LwjglContext.initContextFirstTime(LwjglContext.java:296)
at com.jme3.system.lwjgl.LwjglContext.internalCreate(LwjglContext.java:429)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:121)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)
at java.base/java.lang.Thread.run(Thread.java:834)
Dec 01, 2020 8:29:37 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.IllegalMonitorStateException
at java.base/java.lang.Object.notifyAll(Native Method)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:132)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)
at java.base/java.lang.Thread.run(Thread.java:834)
I have tested the sgold-issue-1383 branch.
I took the new LwjglAbstractDisplay.java and created a new jme3-lwjgl-3.2.1-stable.jar.
Copied that in the folder C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs
Run the jMonkeyEngine and run my new Game about 30 Times.
There no problems anymore.
(I use the sound card “Creative Sound Blaster Audigy Fx”.)
Thank you, sgold, for this bug fix.
That’s encouraging. Thanks for your help, @thomas1 !
I went ahead and integrated PR 1432.
I’m still interested in the GL_INVALID_ENUM
and any similar issue with LWJGL v3.