Hi everybody!
I do have a strange problem while getting all available display modes unter Linux (Ubuntu 9.04).
In my initializing routine i call Display.getAvailableDisplayModes(), but the returning array just contains the current display mode!
Have you ever heard of such a problem?
Some details:
JDK: 1.6
LWJGL: 2.1.0
OS: Ubuntu 9.04, nvidia graphics driver 180
Thanks, daende
Okay, i do have more information.
After switching on LWJGL-Debugging i noticed, that the lwjgl is using the xrandr library to query all display modes.
Calling xrandr on the terminal results in just one available display mode:
> $ xrandr
> Screen 0: minimum 1680 x 1050, current 1680 x 1050, maximum 1680 x 1050
> default connected 1680x1050+0+0 0mm x 0mm
> 1680x1050 50.0* 51.0
Furthermore i'm using 2 monitors and installed the nvidia graphics driver 180 (and the nvidia configuration tool).
I suggest that xrandr doesn't work properly while using nvidia drivers?
I'll deactivate the nvidia driver for testing...
Quote from: daende on August 27, 2009, 07:41:01
Furthermore i'm using 2 monitors and installed the nvidia graphics driver 180 (and the nvidia configuration tool).
I suggest that xrandr doesn't work properly while using nvidia drivers?
I'll deactivate the nvidia driver for testing...
xrandr works fine for me on Ubuntu with the latest nvidia drivers for my card (185.something). It returns about 20 resolutions with various frequencies. No idea why only one resolution shows up for you, though. Maybe you have to define something in /etc/X11/xorg.conf.
Hm, i've experimented with various configuration.
What i found out is that if the "nvidia" driver declaration is taken out of the xorg.conf, xrandr works fine.
And so lwjgl returns the right resolutions.
If i activate the nvidia driver again, xrandr gives me just one resolution.
VERY strange though...
I think the problem is the combination of the nvidia driver, xorg.conf, xrandr and my 2 monitors.
Jep, it has to be the 2nd-monitor-thing. If i plug the 2nd one off, i get the correct results.
>>
$ xrandr
Screen 0: minimum 576 x 432, current 1680 x 1050, maximum 1680 x 1050
default connected 1680x1050+0+0 0mm x 0mm
1680x1050 50.0* 51.0 52.0 53.0
1600x1024 54.0
1440x900 55.0
...
576x432 64.0
;D
I ran into the same problem. The trick is to supply a load of metamodes in your /etc/X11/xorg.conf file. The relevant section from mine looks like
Section "Device"
Identifier "Configured Video Device"
Driver "nvidia"
Option "TwinView" "true"
Option "TwinViewOrientation" "LeftOf"
Option "TwinViewXineramaInfoOrder" "DFP"
Option "MetaModes" "nvidia-auto-select,nvidia-auto-select; 1920x1200,NULL; 1680x1050,NULL; 1600x1200,NULL; 1440x1080,NULL; 1440x900,NULL; 1280x1024,NULL; 1280x800,NULL; 1152x864,NULL; 1024x768,NULL; 1024x640,NULL; 960x720,NULL; 800x600,NULL; 768x480,NULL; 640x480,NULL; 320x240,NULL"
EndSection
Not all of those modes are valid for my hardware, but happily the invalid ones are checked and culled automatically