Google
 

Thursday, February 03, 2011

Fixing resolution for bigger external monitor

If you happen to connect our Linux laptop or netbook to an external monitor, you're likely to get into resolution trouble. For smaller resolutions (<=1024x768), it's not a bigger deal but once you try higher and unusual resolutions, like 1440x900, things don't turn out that well. Here's how to switch to such resolutions under (Ubuntu) Linux. I'm connecting my laptop (Intel 845GM chipset) to an external monitor (1440x900 native).

Fire up terminal and run the following command; first calculate VESA CVT mode lines

$ cvt 1440 900
Output:
# 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz
Modeline "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync

Now, lets see my card's supported resolutions out of the box.
$ xrandr
Output:
Screen 0: minimum 320 x 200, current 1280 x 800, maximum 4096 x 4096
VGA1 connected (normal left inverted right x axis y axis)
1360x768 59.8
1024x768 60.0
800x600 60.3 56.2
848x480 60.0
640x480 59.9 59.9
1440x900_60.00 59.6
LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 331mm x 207mm
1280x800 59.9*+
1024x768 60.0
800x600 60.3
640x480 59.9
TV1 disconnected (normal left inverted right x axis y axis)

In the above output, VGA1 is the external monitor and LVDS1 is the laptop's LCD panel. Now use the modeline information to create a new custom resolution and add it to VGA1
$ xrandr --newmode "1440x900"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync
$ xrandr --addmode VGA1 1440x900
The changes are temporary though. If you want it to make it permanent, add them to ~/.xprofile

Now go to System > Preferences > Monitors. The external monitor's list of resolutions should show 1440x900.

Some more info:
Connecting to external monitor has two options, mirror or extend. Choosing mirror gives the same output to both monitors. Extend, well, extends the display over both monitors. But it has a catch: for Compiz to extend over external monitor, the maximum possible horizontal resolution (see first line of xrandr output above, in my case 4096) should be at least double of sum of total horizontal resolution of two monitors.

In my case, if I try to extend my 1280x800 to an 1440x900 external monitor, its not gonna work as 2*(1280+1440)=5440 > 4096. So mirroring is the only option. However if you set the resolution while compiz is on, it's gonna be "confused". Here's the workaround:

1. Add the custom resolution as described above
2. Disable Compiz (System > Preference > Appearance > Visual Effects > None)
3. Change Resolution, and set the laptop's output to off
4. Enable Compiz again

6 comments:

  1. I've been using resapplet to switch resolutions. It's really helpful when I connect the projectors. Switching resolution from the drop down menu on the panel is really nice. :)

    Long story short: sudo apt-get install resapplet

    ReplyDelete
  2. Thanks for this nice info. I think we need to change /etc/X11/xorg.conf, which is set up to say that the maximum resolution is that of the built-in screen.

    ReplyDelete
  3. This post was very well written, and it also contains many useful facts. I enjoyed your professional way of writing this post. Thanks!

    ReplyDelete
  4. Thanks for this insightful post. The info I have gained from your blog is truly encouraging! The subject is really interesting. Congratulations to the creator of the webblog!

    ReplyDelete
  5. I was very pleased to find this site. I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.

    ReplyDelete
  6. I am really pleased to post my comment on this blog .I love your blog by the way, I am gonna have to add you to my list of watched blogs.

    ReplyDelete