xrandr VSync issue
See original GitHub issueIssue details
The issue is that when an xrandr mode that has an underscore in it’s name is selected as the resolution for the computer, libgdx breaks. To resolve the issue, I have to stay on 1024x768 to make it work.
libGDX crashes because there is an underscore in my xrandr name for 1080p resolution. Every resolution works except for “1280x720_60.00” and “1920x1080_60.00 59.96”
My xrandr -q out put is :
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
VGA-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 60.00
800x600 60.32 56.25
848x480 60.00
640x480 59.94
1280x720_60.00 59.86
1920x1080_60.00 59.96*
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
1920x1080 (0x1bd) 173.000MHz -HSync +VSync
h: width 1920 start 2048 end 2248 total 2576 skew 0 clock 67.16KHz
v: height 1080 start 1083 end 1088 total 1120 clock 59.96Hz
Reproduction steps/code
Try running the desktop version of libGDX on ubuntu when your selected xrandr mode has an underscore in the name like “1920x1080_60.00 59.96*”
Version of LibGDX and/or relevant dependencies
gdxVersion = ‘1.10.0’
Stacktrace
BUILD SUCCESSFUL in 702ms
5 actionable tasks: 1 executed, 4 up-to-date
Exception in thread "LWJGL Application" java.lang.ExceptionInInitializerError
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setVSync(LwjglGraphics.java:643)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:125)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.lwjgl.opengl.XRandR.findPrimary(XRandR.java:326)
at org.lwjgl.opengl.XRandR.ScreentoDisplayMode(XRandR.java:315)
at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:746)
at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:743)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:743)
at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
... 2 more
AL lib: (EE) alc_cleanup: 1 device not closed
11:21:51 PM: Task execution finished 'DesktopLauncher.main()'.
Please select the affected platforms
- Android
- iOS
- HTML/GWT
- Windows
- Linux
- MacOS
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hey @JoshBot-Debug! That was to be expected, as the particle editor itself is using our LWJGL 2 backend. There are plans for migrating to LWJGL 3 (see #6247 in particular), so I think this issue here can be closed.
So, LibGDX works on my Linux now but I’m having the same problem with the particle editor. I downloaded the nightly build and ran the command :
java -cp gdx.jar:gdx-natives.jar:gdx-backend-lwjgl.jar:gdx-backend-lwjgl-natives.jar:extensions/gdx-tools/gdx-tools.jar com.badlogic.gdx.tools.particleeditor.ParticleEditor
The error was the same vSync error. I tried :
java -cp gdx.jar:gdx-natives.jar:gdx-backend-lwjgl3.jar:gdx-backend-lwjgl-natives.jar:extensions/gdx-tools/gdx-tools.jar com.badlogic.gdx.tools.particleeditor.ParticleEditor
and the error I got was : Exception in thread “AWT-EventQueue-0” java.lang.NoClassDefFoundError: com/badlogic/gdx/backends/lwjgl/LwjglCanvas