praxis-live / support

Documentation and issue tracking
9 stars 2 forks source link

off-by-one in video renderer selection dropdown #98

Closed claudeha closed 4 years ago

claudeha commented 6 years ago

There seems to be an off-by-one error in the video renderer selection drop down box, I need to select the OpenGL name one below the one I want to really use. I don't have OpenGL 4 hardware on my laptop, but selecting OpenGL 4 seems to work (and presumably gives me a GL3 context), even though:

claude@latte:~$ glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 3.3
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL core profile version string: 3.3 (Core Profile) Mesa 18.1.7
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.1 Mesa 18.1.7
OpenGL shading language version string: 1.40
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 18.1.7
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

Selecting OpenGL 3 or OpenGLES2 or default OpenGL gives an error about GL3bc not supported:

com.jogamp.opengl.GLException: Profile GL3bc is not available on X11GraphicsDevice[type .x11, connection :0.0, unitID 0, handle 0x7f5998003490, owner true, ResourceToolkitLock[obj 0x128efe83, isOwner true, <16b1780a, 53b3f4b8>[count 1, qsz 0, owner <video-FPSAWTAnimator#09-Timer11>]]], but: [GLProfile[GLES1/GLES1.hw], GLProfile[GLES2/GLES3.hw], GLProfile[GL2ES1/GLES1.hw], GLProfile[GL4ES3/GLES3.hw], GLProfile[GL2ES2/GL3.hw], GLProfile[GL3/GL3.hw], GLProfile[GLES3/GLES3.hw], GLProfile[GL3/GL3.hw], GLProfile[GL2GL3/GL3.hw]]
  at com.jogamp.opengl.GLProfile.get(GLProfile.java:991)
  at jogamp.opengl.GLContextImpl.verifyInstance(GLContextImpl.java:1471)
  at jogamp.opengl.GLContextImpl.setGLFunctionAvailability(GLContextImpl.java:1942)
  at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:395)
  at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:765)
  at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:648)
  at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:586)
  at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1279)
  at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
  at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
  at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
  at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
  at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
  at java.util.TimerThread.mainLoop(Timer.java:555)
  at java.util.TimerThread.run(Timer.java:505)
Caused: java.lang.RuntimeException
  at org.praxislive.video.pgl.PGLPlayer.run(PGLPlayer.java:136)
  at org.praxislive.video.impl.components.DefaultVideoRoot$1.run(DefaultVideoRoot.java:120)
[catch] at org.praxislive.impl.AbstractRoot.run(AbstractRoot.java:216)
  at org.praxislive.impl.AbstractRoot$Controller.run(AbstractRoot.java:462)
  at org.praxislive.impl.AbstractRoot$Controller.lambda$start$0(AbstractRoot.java:443)
  at java.lang.Thread.run(Thread.java:748)

Selecting OpenGL 2 gives an error about OpenGLES:

    com.jogamp.opengl.GLException: Not a GL2ES2 implementation
  at jogamp.opengl.es1.GLES1Impl.getGL2ES2(GLES1Impl.java:4959)
  at processing.opengl.PJOGL.getGL(PJOGL.java:260)
  at processing.opengl.PSurfaceJOGL$DrawListener.init(PSurfaceJOGL.java:888)
  at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:644)
  at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:667)
  at jogamp.opengl.GLAutoDrawableBase$1.run(GLAutoDrawableBase.java:431)
  at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1291)
Caused: com.jogamp.opengl.GLException: Caught GLException: Not a GL2ES2 implementation on thread video-FPSAWTAnimator#12-Timer14
  at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
  at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327)
  at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
  at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
  at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
  at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
  at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
  at java.util.TimerThread.mainLoop(Timer.java:555)
  at java.util.TimerThread.run(Timer.java:505)
Caused: java.lang.RuntimeException
  at org.praxislive.video.pgl.PGLPlayer.run(PGLPlayer.java:136)
  at org.praxislive.video.impl.components.DefaultVideoRoot$1.run(DefaultVideoRoot.java:120)
[catch] at org.praxislive.impl.AbstractRoot.run(AbstractRoot.java:216)
  at org.praxislive.impl.AbstractRoot$Controller.run(AbstractRoot.java:462)
  at org.praxislive.impl.AbstractRoot$Controller.lambda$start$0(AbstractRoot.java:443)
  at java.lang.Thread.run(Thread.java:748)
neilcsmith-net commented 6 years ago

Thanks @claudeha for writing up / sharing the stack traces. I'll debug this as soon as I can and try and work out what's going on. It definitely worked OK when the code was first added, because it used to be the only way to get the Syphon support on macOS to work. Could be a Processing or JOGL code change.

neilcsmith-net commented 6 years ago

@claudeha well, this one's fun! :smile: Whatever it is isn't an off-by-one error - pretty sure PraxisLIVE is requesting that Processing request the right profile. However, if you see https://github.com/processing/processing/blob/master/core/src/processing/opengl/PSurfaceJOGL.java#L181 for GL3 it first requests a backwards compatible GL3, and if that fails should request the highest supported programmable pipeline. In your case it's like it's not failing to produce a GL3bc context but failing later. I assume requesting GL4 fails but then finds a working GL3 backup.

I'm not entirely sure what the best fix is for this right now - possibly overriding to request GL3 core profile. Going to wait and see if that Processing issue ( processing/processing#5476 ) gets any further response first, although not sure it's 100% related.