Ubuntu xorg.conf: 1680x1050 with Ati 3850 AGP on 22" Samsung Syncmaster 2232BW

Following my previous post on getting Kubuntu 9.04 (Jaunty Jackalope) working on a 22" screen using 1680x1050 (and NVidia drivers) I'm going to post how I got a Ubuntu 9.10 (Karmic Koala) 1680x1050 resolution on a 22" screen (for ATI 3850 AGP).

I found out that using xrandr is by far the easiest and most sure-fire way of configuring obscure resolutions for Ubuntu. So this post is applicable even if your resolution is not the aforementioned, but it is obscure enough not to be available on the default display resolutions list provided by either Ubuntu or your graphics card manufacturer.

So this is how this works. Running xrandr gives us a bunch of info about the currently supported resolutions. Note that 1680x1050 is not there:

$ xrandr

Screen 0: minimum 320 x 200, current 1600 x 1200, maximum 1600 x 1600
DFP1 disconnected (normal left inverted right x axis y axis)
DFP2 disconnected (normal left inverted right x axis y axis)
CRT1 connected 1600x1200+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1600x1200 60.0*+
1400x1050 60.0
1280x1024 60.0 47.0 43.0
....

To add a new mode, first you must establish the modeline, so do this:

$ cvt 1680 1050 60.0Hz
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync

Now we can use the modeline to create and then add a new mode:

$ xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
$ xrandr --addmode CRT1 1680x1050_60.00


That's it! Now simply backup your /etc/X11/xorg.conf and run your graphics card manufacturer's utility (e.g. ATI Catalyst Center) and the new mode should be there. Do not use the built-in Ubuntu display manager (System->Preferences->Display) as it will overwrite your xorg.conf and mess up your resolution in the process!

The resulting xorg.conf for my setup was the following:

$ more /etc/X11/xorg.conf
Section "ServerLayout"
Identifier "amdcccle Layout"
Screen 0 "amdcccle-Screen[1]-0" 0 0
EndSection

Section "Files"
EndSection

Section "Module"
Load "glx"
EndSection

Section "Modes"
Identifier "16:10"
ModeLine "1680x1050 (GTF)" 147.1 1680 1784 1968 2256 1050 1051 1054
1087
EndSection

Section "Monitor"
Identifier "Generic Monitor"
UseModes "16:10"
HorizSync 30.0 - 83.0
VertRefresh 60.0 - 60.0
Option "DPMS"
EndSection

Section "Monitor"
Identifier "0-CRT1"
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
Option "PreferredMode" "1680x1050"
Option "TargetRefresh" "60"
Option "Position" "0 0"
Option "Rotate" "normal"
Option "Disable" "false"
EndSection

Section "Device"
Identifier "Default Device"
Driver "fglrx"
EndSection

Section "Device"
Identifier "amdcccle-Device[1]-0"
Driver "fglrx"
Option "Monitor-CRT1" "0-CRT1"
BusID "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "Default Screen"
Device "Configured Video Device"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1680x1050"
EndSubSection
SubSection "Display"
Depth 16
Modes "1680x1050"
EndSubSection
EndSection

Section "Screen"
Identifier "amdcccle-Screen[1]-0"
Device "amdcccle-Device[1]-0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

2 comments:

  1. once you restart, doesn't the xorg.conf file get written over anyways? Is there a more permanent solution so I wouldn't have to do this upon boot every time? Something other than putting those lines in a bash script and running the script on startup via .bash_profile

    ReplyDelete
  2. Not sure, I would put them in a startup script, to avoid executing the script myself...

    ReplyDelete