Fixing External Monitor Resolution/Mode in Ubuntu

I have an LG 22″ display capable of running 1920×1080 resolution. If I plug the monitor before booting Ubuntu 10.04, all will go well, the monitor brand is shown properly in Monitor Preferences dialog and I can use the monitor in its highest resolution.

The problem is if I attached it after Ubuntu is started, Monitor Preferences will show it as “Unknown” monitor, and I will only get much lower resolution. And restarting X (with Ctrl-Alt-Backspace), or running “xrandr -q” don’t help, somehow the bad resolution stucks. The only way to fix this is to reboot the whole system, which is annoying.

If that sounds like the problem you have, this post may help you.

Step 1.

Find the so called X mode line for your desired resolution/mode. The best way is to look it in /var/log/Xorg.0.log file when the system is booting with the correct resolution. The whole line will look something like:

(II) intel(0): Modeline "1920x1080"x0.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync -vsync (67.5 kHz)

but the needed part is:

"1920x1080"x0.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync -vsync

If your system can’t boot with the desired resolution, you will have to find the mode line for your resolution elsewhere, or use mode line calculators for this. You can use gtf or cvt tool:

~$ gtf 1920 1080 60
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz  Modeline "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

$ cvt 1920 1080 60
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

In my experience, gtf or cvt may not get the correct numbers for you (in my case, the display is shifted up by few pixels), YMMV.


Step 2.

Add new mode with xrandr:

$ xrandr --newmode "1920x1080_60.00"  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync -vsync


Step 3.

Register the mode with you monitor:

$ xrandr --addmode VGA1 "1920x1080_60.00"

Replace VGA1 with the identifier for your monitor (just run xrandr without any argument to view detected monitors).

The last argument of –-addmode is the mode name, it must match the mode name added with –newmode command previously. Also, cAPiTalizAtion matters.


Step 4.

Now the mode is ready to be used:

$ xrandr --output VGA1 --mode "1920x1080_60.00"

I’m not expert on this, I only got this after hours of searching, but hopefully this helps. Good luck!





Filed under Uncategorized

16 responses to “Fixing External Monitor Resolution/Mode in Ubuntu

  1. Cheers for this worked a treat

  2. shrikar

    Really nice .. It solved my problem with ubuntu 10.04 and LG 27 inch monitor

  3. What a great post! Thank You for this tip from the heart! )

  4. balta

    Thanks a lot, saved a lot of time and worked just fine on ubuntu 12.04 attached to a telly 😀

  5. Seb

    Ace. Worked out of the box fo LG Flatron E2381

  6. Rakesh

    you are great!!!!!

  7. Paolo

    Thank you for sharing, you solved my problem!
    A tip for everybody: before using gtf or cvt, have a look at this page:
    There I found a working modeline for my Samsung screen (the modeline generated by cvt/gtf weren’t perfect, the image didn’t fill the screen).

  8. beezwings

    Thanks! This worked, except that now, with the better, higher screen resolution, I notice annoying shadows to the right of all text/images/icons/etc. Any ideas?

  9. Tomek

    Thanks a lot! I’ve been looking for a solution to that problem for ages! It helped me with my NEC AccuSync LCD 92VM. The values calculated by gtf/cvt were not perfect but my NEC adjusted itself properly.

  10. Great stuff, this worked for me!

  11. Pingback: Low resolution on second monitor, xrandr throws error | Ubuntu InfoUbuntu Info

  12. Pingback: Low resolution on second monitor, xrandr throws error | -

  13. Pingback: Low resolution on second monitor, xrandr throws error | James n Sheri.comJames n

  14. Pingback: Low resolution on second monitor, xrandr throws error - Tech Forum Network

  15. Marcos Almeida

    Worked fine for me, thank you very much.

  16. Thank’s a lot. You saved my nerves 🙂 Smart and simple.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s