Could not switch display mode on Ubuntu Gutsy

Started by NeTRaY, December 20, 2007, 10:01:22

Previous topic - Next topic

NeTRaY

Hello :),

I have an odd problem with starting my app on Gutsy Gibbon, standard / fresh install.
I have talked to Matzon on IRC about this the other day and he adviced me to post here... :)

Could not switch display mode

It happens only when the computer is off for some time, then after a few reboots everything works fine until next turn off... Odd huh? This is the debug output:

etPathFromClassLoader: searching for: openal
getPathFromClassLoader: Path found: /home/gcadmin/.java/deployment/cache/6.0/48/66d7d1b0-14209ea6-n/libopenal.so
getPathFromClassLoader: searching for: lwjgl
getPathFromClassLoader: Path found: /home/gcadmin/.java/deployment/cache/6.0/61/735b167d-6f0d0112-n/liblwjgl.so
getPathFromClassLoader: searching for: lwjgl
getPathFromClassLoader: Path found: /home/gcadmin/.java/deployment/cache/6.0/61/735b167d-6f0d0112-n/liblwjgl.so
Found 25 OpenAL paths
Testing '/home/gcadmin/.java/deployment/cache/6.0/48/66d7d1b0-14209ea6-n/libopenal.so'
Found OpenAL at '/home/gcadmin/.java/deployment/cache/6.0/48/66d7d1b0-14209ea6-n/libopenal.so'
Xrandr extension version 1.2
Using Xrandr for display mode switching
XF86VidMode extension version 2.2
Initial mode: 800 x 600 x 24 @62Hz
Removed 0 duplicate displaymodes
Mode 0: 1280x1024 @50
Mode 1: 1280x1024 @51
Mode 2: 1280x960 @52
Mode 3: 1280x800 @53
Mode 4: 1280x768 @54
Mode 5: 1152x864 @55
Mode 6: 1024x768 @56
Mode 7: 1024x768 @57
Mode 8: 1024x768 @58
Mode 9: 960x600 @59
Mode 10: 840x525 @60
Mode 11: 832x624 @61
Mode 12: 800x600 @62
Mode 13: 800x600 @63
Could not switch mode
Mode 14: 800x600 @64
Mode 15: 800x600 @65
Mode 16: 800x600 @66
Mode 17: 800x600 @67
Mode 18: 800x512 @68
Mode 19: 720x450 @69
Mode 20: 640x512 @70
Mode 21: 640x512 @71
Mode 22: 640x480 @72
Mode 23: 640x480 @73
Mode 24: 640x480 @74
Mode 25: 640x480 @75
Mode 26: 640x400 @76
Mode 27: 640x384 @77
Mode 28: 576x432 @78
Mode 29: 512x384 @79
Mode 30: 512x384 @80
Mode 31: 512x384 @81
Mode 32: 416x312 @82
Mode 33: 400x300 @83
Mode 34: 400x300 @84
Mode 35: 400x300 @85
Mode 36: 400x300 @86
Mode 37: 320x240 @87
Mode 38: 320x240 @88
Mode 39: 320x240 @89
org.lwjgl.LWJGLException: Could not switch mode.
	at org.lwjgl.opengl.LinuxDisplay.nSwitchDisplayMode(Native Method)
	at org.lwjgl.opengl.LinuxDisplay.switchDisplayModeOnTmpDisplay(LinuxDisplay.java:430)
	at org.lwjgl.opengl.LinuxDisplay.switchDisplayMode(LinuxDisplay.java:420)
	at org.lwjgl.opengl.Display.switchDisplayMode(Display.java:302)
	at org.lwjgl.opengl.Display.create(Display.java:753)
	at org.lwjgl.opengl.Display.create(Display.java:709)
	at org.lwjgl.opengl.Display.create(Display.java:691)
	at pl.netray.hype.game.Game.initDisplay(Unknown Source)
	at pl.netray.hype.game.Game.startGame(Unknown Source)
	at gcblackjack.GCBlackJack.<init>(Unknown Source)
	at gcblackjack.GCBlackJack.main(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.javaws.Launcher.executeApplication(Launcher.java:1272)
	at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1218)
	at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1065)
	at com.sun.javaws.Launcher.run(Launcher.java:105)
	at java.lang.Thread.run(Thread.java:619)


I suppose that this has something to do with Xrandr... but I do not know how to cope with this problem on my own...

Thanks.

Schnitter

Eh...do you use SUN's Java-Version? Or another one?
(I've no idea what's going on, but I think it could be important^^)


NeTRaY

I have found a solution thanks to guys from IRC (thanks again)

i have to start the game with LWJGL_DISABLE_XRANDR set to true, everything works fine if i set it via command line but for some reason it does not work when starting with java webstart.

i had to set it programmatically