Can't save screen resolution setting

5,411

Not 100% sure because you've got Intel graphics, but it sounds like the good old trouble with bad EDID. In a nutshell, your monitor sends bad info to your graphic card, it cannot read the maximal frequencies and errs on the side of caution, using the lowest possible settings only.

randr is (by design!) only meant for run-time changes. For any permanent configuration, you need to change your X server settings. For this, edit /etc/X11/xorg.conf (This is an important system file! Make a backup first!). You need to add HorizSync and VertRefresh lines. The result should look like this:

Section "Monitor"
Identifier  "Configured Monitor"
HorizSync 30-35
VertRefresh 55-75
EndSection

Warning: Do not use the numbers I posted here! If you set a frequency in HorizSync which is too high, it might permanently damage your monitor. They fluctuate considerably between monitor models, I've seen them anywhere between 30 Hz and 75 Hz. You should look up the correct values in the monitor's user guide, or call the manufacturer's tech support and ask about vertical and horizontal frequency at your preferred resolution.

Maybe you'll need to add the mode line to the Xorg.conf manually (I forgot which section, I think Screen) but probably after the X restart you'll be able to set the resolution using the built-in graphical tool.

Even if this doesn't solve your problem, the xorg.conf is the place to save permanent changes to your screen configuration.


Edit, as an answer to your comments.

The HorizSync is the frequency, yes. On a nVidia card, setting the HorizSync and VertRefresh in the xorg.conf (then restarting X or just rebooting) makes all the usual resolutions available in the nVidia driver GUI. So choosing your preferred resolution there should be possible.

If this doesn't happen with the Intel drivers, you can manually add the resolution you want into your Xorg.conf. Still in the Monitor section, paste your modeline (which worked with xRandR). Then list the mode name as the Preferred mode option. Then, in the Screen section, Display subsection, add a Modes line, including the name of your mode.

The result should be something like this:

Section "Monitor"
    Identifier "Configured Monitor"
    HorizSync 30-80
    VertRefresh 55-75
    Modeline        "1152x864_60.00" 81.75 1152 1216 1336 1520 864 867 871 897 -hsync +vsync 
    Option          "PreferredMode" "1152x864_60.00"
EndSection

and below that, within the Screen section

    SubSection "Display"
        Depth           24
        Modes   "1152x864" "1024x768" "640x480"
    EndSubSection

I am not sure if you need the Display subsection, but I have found it in an old config file of mine. If it doesn't work, comment it out again. Cannot test it on my current system because I cannot restart just now, and my current monitor configuration is different. So it may still need some tweaking. But in theory, adding the modeline into Xorg.conf is the permanent version of adding it dynamically to RandR.

If you need to tweak, a good information source would be the Xorg.conf manual. http://www.x.org/archive/X11R6.8.0/doc/xorg.conf.5.html

If all else fails, I think there is a X profile file where you can add xRandR commands. It is certainly not elegant, and possibly as slow as your init script solution. Besides, I don't remember much about this file and how to use it, so cannot help you there.

And if these things fail too, maybe the problem is something else. As it is probably still X related, you could look into your /var/log/xorg.0.log file. If there are lines starting with (WW) or (EE), google these lines and you'll almost certainly find a solution.

Share:
5,411

Related videos on Youtube

Searock
Author by

Searock

Github Gist

Updated on September 17, 2022

Comments

  • Searock
    Searock over 1 year

    My screen resolution in windows and previous version of Ubuntu (9.04) was 1152 x 864.

    But in Ubuntu 10.04 it gives me an option of 1024 x 786 and 1360 x 786.

    I have some how managed to add 1152x684 resolution by using xrandr command.

    searock@searock-desktop:~$ cvt 1152 864

    1152x864 59.96 Hz (CVT 1.00M3) hsync: 53.78 kHz; pclk: 81.75 MHz Modeline "1152x864_60.00" 81.75 1152 1216 1336 1520 864 867 871 897 -hsync +vsync

    searock@searock-desktop:~$ xrandr --newmode "1152x864_60.00" 81.75 1152 1216 1336 1520 864 867 871 897 -hsync +vsync

    searock@searock-desktop:~$ xrandr --addmode S-video 1152x864
    xrandr: cannot find output "S-video"

    searock@searock-desktop:~$ xrandr
    Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
    VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
    1360x768 59.8
    1024x768 60.0*
    800x600 60.3 56.2
    848x480 60.0
    640x480 59.9 59.9
    1152x864_60.00 (0x124) 81.0MHz
    h: width 1152 start 1216 end 1336 total 1520 skew 0 clock 53.3KHz
    v: height 864 start 867 end 871 total 897 clock 59.4Hz

    searock@searock-desktop:~$ xrandr --addmode VGA1 1152x864_60.00

    But the problem is when ever I restart my computer I get this message.

    Could not apply the stored configuration for the monitors. Could not find a suitable configuration of screens.

    alt text

    And then it comes back to 1024 x 786

    My graphic card details : Intel(R) 82945G Express Chipset Family.

    Is there any way I can fix this once for all ?

    Thanks.

    Edit 1 : rumtscho has suggested me to modify xorg.conf file. But I am not sure what HorizSync means? is it Horizontal frequency ?

    My monitor model is Acer v173.

    Here's my specification.

    enter image description here

    So what should be HorizSync and VertRefresh ?

    Edit 2 :

    I have edited my Xorg.conf file as follows :

    Section "Monitor"
    Identifier "Configured Monitor"
    HorizSync 30-80
    VertRefresh 55-75
    EndSection

    then I added the resolution and restarted my computer and still I am facing the same problem.

    Is there something that I am missing?

    Edit 3 : For now I have edited /etc/gdm/Init/Default(gdm startup scripts) to include following xrandr commands, just below line initctl -q emit login-session-start DISPLAY_MANAGER=gdm

    xrandr --newmode "1152x864_60.00" 81.75 1152 1216 1336 1520 864 867 871 897 -hsync +vsync
    xrandr --addmode VGA1 1152x864_60.00<br/>
    xrandr -s  1152x864_60.00
    

    This has solved my problem, but this commands have increased my computer's boot time.

    I think I will have to edit xorg file properly.

    Edit 4 : Instead of adding this files to gdm startup scripts I have created a shell script and added it to startup (System -> Preference -> Startup Applications)

    #!/bin/bash
    xrandr --newmode "1152x864_60.00" 81.75 1152 1216 1336 1520 864 867 871 897 -hsync +vsync
    xrandr --addmode VGA1 1152x864_60.00
    xrandr -s  1152x864_60.00
    

    And don't forget to add execution rights. (Right Click -> Properties -> Permission -> Allow executing file as program)

    • jrc03c
      jrc03c almost 14 years
      It might be easier, too, if you turn off extra graphics effects.
    • Searock
      Searock almost 14 years
      Thanks for the suggestions, but it does not work.
  • Searock
    Searock almost 14 years
    Ok, what do you mean my HorizSync is it Horizontal frequency which is 30 ~ 80KHz? and how do I enter it? Is it like 30-80 ?
  • Searock
    Searock almost 14 years
    thanks for your answer, I have posted my monitor specification, can you help me with HorizSync? Please.
  • Searock
    Searock almost 14 years
    I have tried editing the xorg.conf file but it still doesn't work.