Resolution Switching

Archives Forums/Linux Discussion/Resolution Switching

jonmiles(Posted 2005) [#1]
I'm running Ubuntu, with a GeForce 2 and the nvidia drivers installed (as well as the nvidia-dev ones). The problem I'm having is that after running a compiled BlitzMax program, I get the following error message:

X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 135 (XFree86-VidModeExtension)
Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)
Value in failed request: 0x3c00006
Serial number of failed request: 74
Current serial number in output stream: 75

The result of this is that the desktop resolution fails to return to what it was originally. So if I run a BlitzMax program at 800x600, then my desktop will be at that resolution when I return.


computercoder(Posted 2005) [#2]
That would be true of video if you failed. Reason is that the code for returning to the original video settings never gets executed. So when it fails, it leaves it like it is. Kinda bites, but thats how it is.

Next... Have you been able to run other BlitzMax programs? It could be that you are missing the X11-dev libs. If you'd like, i can get you a list of the libraries needed to run BlitzMax in Linux...


jonmiles(Posted 2005) [#3]
So far I've compiled some of the sample BlitzMax programs (Digesteroids etc) and they run okay. The only problem that I seem to be experiencing is this resolution one, which always occurs.

I checked Synaptic and I have X11-dev lib installed, but I'd definitely appreciate a list of libraries if you think it might help.


Craig Watson(Posted 2005) [#4]
Could you paste the output of "xpdyinfo"? You can run this from a console. It sounds like there's some sort of misconfiguration with your xorg.conf.

I did an install of Ubuntu yesterday and installed the nvidia drivers, however I noted you need to run some sort of enable function, then reboot the system for the drivers to work.

I think the command is "nvidia-glx-config enable". This should make the necessary changes to xorg.conf for you.


jonmiles(Posted 2005) [#5]
I ran xpdyinfo and you can see the results here: http://www.jonmiles.co.uk/xpdyinfo.txt I took a look through it but couldn't see much - though I'm not really sure what I'm looking for.

My nvidia drivers are enabled as I get the splash screen on boot up and the relevant part of xorg.conf is set. Something I noticed last night when using Blitzmax, is that GraphicsModeExists() seems to fail all the time, despite the program being able to run with the settings I choose.


computercoder(Posted 2005) [#6]
I don't think you are missing any libraries if you have successfully compiled and ran Blitz apps.

I am working on a list of them anyways, from which I'll still post to the forums.


Craig Watson(Posted 2005) [#7]
The xpdyinfo is just to confirm that extensions such as GLX and NVIDIA-GLX are enabled.

The only other possibility is that your x-server misdetected the default settings for your monitor and now you only have a bunch of non-standard resolutions available.

What the server does is tries to detect the physical dimensions of your monitor and then calculates the available screen resolutions based on your DPI. What can happen if this is messed up, is you'll get your standard desktop resolution, and a lot of weird ones like 640x350.

Generally you'll be able to tell if this is a problem by using the KDE or Gnome Controls to change the desktop resolution.


jonmiles(Posted 2005) [#8]
I have to say that setting up my monitor was a bit of a pain in Ubuntu - 60hz is just nasty on the eyes. I eventually found some modelines for my particular monitor (Hansol 900P, at the bottom of http://linuxreviews.org/howtos/xfree/monitor/hansol/hansol-monitors.txt ), which I stuck in the Monitor section of my xorg.conf. That seemed to help, but now that you mention it I do have some strange resolutions mixed in with the usual ones, e.g. 928x696.


Craig Watson(Posted 2005) [#9]
Well, this I ripped off from a Slashdot post a while ago to make fonts look nicer, but it should also fix the weird resolutions problem:
Configure X and Gnome to 96 dpi 
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak 
sudo gedit /etc/X11/xorg.conf

Locate Section "Monitor" and add the following lines before EndSection:
# DisplaySize 270 203 # 1024x768 96dpi
# DisplaySize 338 254 # 1280x960 96dpi
# DisplaySize 338 270 # 1280x1024 96dpi
# DisplaySize 370 277 # 1400x1050 96dpi
# DisplaySize 423 370 # 1600x1400 96dpi

Uncomment the line corresponding to your current resolution.

To get other values, use the following formula:

displaysize = {pixelsize}/96*25.4

Remember:

The display size must be "right" so adjust those values till you get your size right.