Resolution

Differences between revisions 38 and 39
Revision 38 as of 2011-12-12 16:23:05
Size: 19295
Editor: CPE-124-189-24-200
Comment: Formatting & grammar improvements
Revision 39 as of 2012-04-17 00:16:29
Size: 19118
Editor: 63-144-199-3
Comment: To many changes from revision 35 to 36. A lot of what I did I had reasons for.
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
== Resetting an out‐of‐range resolution ==
If you set a resolution inappropriate for your monitor in the Displays GUI tool ({{{gnome-control-center display}}}), you can reset it by running {{{rm ~/.config/monitors.xml}}} from a terminal.
== Resetting an out-of-range resolution ==

If you set a resolution inappropriate for your monitor in the {{{Screen Resolution}}} GUI tool, you can reset it by running {{{rm ~/.config/monitors.xml}}} from a terminal.
Line 7: Line 8:
You can either use the Displays GUI tool to experiment with different resolutions, or the more powerful XRandR command‐line tool ({{{xrandr}}}).

XRandR
shows you the names of different outputs available on your system (LVDS, VGA-0, etc.) and resolutions available on each:

You can either use the {{{Screen Resolution}}} GUI tool to experiment with different resolutions, or the more powerful xrandr command-line tool:

{{{
  $ xrandr
}}}

shows you the names of different outputs available on your system (LVDS, VGA-0, etc.) and resolutions available on each:
Line 19: Line 25:
You can direct XRandR to set a different resolution like this:
 * {{{xrandr --output LVDS --mode 1024x768}}}
 * {{{xrandr --output VGA1 --mode 1024x768}}}
You can direct xrandr to set a different resolution like this:

{{{
  $
xrandr --output LVDS --mode 1024x768
}}}

{{{
  $
xrandr --output VGA1 --mode 1024x768
}}}
Line 24: Line 36:
 * {{{xrandr --output LVDS --mode 1024x768 --rate 75}}}
 * {{{
xrandr --output VGA1 --mode 1024x768 --rate 60}}}

Note that changes you make using {{{xrandr}}} only last through the current session. XRandR has many more capabilitiessee {{{man xrandr}}} for details.

{{{
  $
xrandr --output LVDS --mode 1024x768 --rate 75
}}}

{{{
  $
xrandr --output VGA1 --mode 1024x768 --rate 60
}}}

Note that changes you make using {{{xrandr}}} only last through the current session.  xrandr has a lot more capabilities - see {{{man xrandr}}} for details.
Line 30: Line 48:
If you want to have a panning viewport, i.e., a virtual screen thats bigger than your physical screen that moves when you move the mouse to the edge (zoomed‐in” view), specify the desired physical resolution with {{{--mode}}}, the virtual screen size with {{{--fb}}} and the panning area (typically same as virtual screen size) with {{{--panning}}}.

For example:

If you want to have a panning viewport, i.e., a virtual screen that's bigger than
your physical screen that moves when you move the mouse to the edge ("zoomed in" view)
specify the desired physical resolution with --mode and the virtual screen size with --fb
and
panning area (typically same as virtual screen size) with --panning.

For example,
Line 37: Line 60:
== How to set up a dual monitor ==
{{{#!wiki note
'''Note'''

The following guide is outdated and only applies to versions of Ubuntu prior to 11.04.
}}}
== How to setup a dual monitor ==
Line 45: Line 63:
[[http://www.thegeekstuff.com/2009/08/ubuntu-tips-how-to-setup-dual-monitor/|This article]] will give you some important background information. I will summarize the points that I think are important and add a few points. It makes life easier if you pop open a terminal and type to open your GUI monitor program:
{{{
gnome-display-properties
}}}
Next uncheck same image in all Monitors. If your watch a lot of movies it is important to set your Monitors to your lower resolution. For example, if they are both 1440×900 monitors, make sure it is set to that resolution. If the monitors are different resolutions, you will need it to the resolution of the smaller monitor. So, for example, if one monitor is 1440×900 and the other is full HD resolution, you will have to set it at 1440×900. The reason for this is your video will be a black screen when trying to watch a movie so this is very important. Click ''Apply''. Then, you will get a warning and you need to keep your new configuration. You will need to restart your session for this to take effect sometimes. There are two simple ways to do this. The first is to log out then log back in, and the second is to hit Ctrl+Alt+Backspace. The second method restarts your X session, so make sure you save your work.

[[http://intellinuxgraphics.org/dualhead.html|This guide]] is targeted for people who want to use extended desktop mode on two outputs. Clone mode should work out-of-box with a normal configuration.

With RandR 1.2, you can set up dual head and add/remove monitor dynamically (i.e. on‐the‐fly, without restarting X).

http://www.thegeekstuff.com/2009/08/ubuntu-tips-how-to-setup-dual-monitor/

The article above will give you some important background information. I will summarize the points that I think are important and add a few points. It makes life easier if you pop open a terminal and type to open your gui monitor program:
{{{
  $ gnome-display-properties
}}}
Next uncheck same image in all Monitors. If your watch a lot of movies it is important to set your Monitors to your lower resolution. For example, if they are both 1440 x 900 monitors, make sure it is set to that resolution. If the monitors are different resolutions, you will need it to the resolution of the smaller monitor. So, for example, if one monitor is 1440 x 900 and the other is full HD resolution, you will have to set it at 1440×900. The reason for this is your video will be a black screen when trying to watch a movie so this is very important. Click APPLY. Then you will get a warning and you need to keep your new configuration. You will need to restart your session for this to take effect sometimes. There are 2 simple ways to do this. The first is to log out then log back in, and the second is to hit ctrl+alt+backspace. The second method restarts your x session so make you save your work.

http://intellinuxgraphics.org/dualhead.html

This guide is targeted for people who want to use extended desktop mode on two outputs. Clone mode should work out-of-box with a normal configuration.

With RandR 1.2, you can setup dual head and add/remove monitor dynamically (i.e. on-the-fly, without restarting X). 
Line 57: Line 80:
===== Intel driverUMS =====
 
VGA:: Analog VGA output
 LVDS:: Laptop panel
 DP1:: DisplayPort output
 TV:: Integrated TV output
 TMDS-1:: First DVI SDVO output
 TMDS-2:: Second DVI SDVO output
'''Intel driver - UMS'''
 * '''
VGA''' - Analog VGA output
 * '''LVDS''' - Laptop panel
 * '''DP1''' - DisplayPort output
 * '''TV''' - Integrated TV output
 * '''TMDS-1''' - First DVI SDVO output
 * '''TMDS-2''' - Second DVI SDVO output
Line 66: Line 89:
===== Intel driver—KMS =====
 LVDS1:: Laptop panel
 VGA1:: Analog VGA output
 DVI1:: Digital video output

===== Radeon driver =====
 VGA-0:: Analog VGA output
 LVDS:: Laptop panel
 S-video:: Integrated TV output
 DVI-0:: DVI output
'''Intel driver - KMS'''
 * '''LVDS1''' - Laptop panel
 * '''VGA1''' - Analog VGA output
 * '''DVI1''' - Digital video output

'''[[radeon]] driver '''
 * '''VGA-0''' - Analog VGA output
 * '''LVDS''' - Laptop panel
 * '''S-video''' - Integrated TV output
 * '''DVI-0''' - DVI output
Line 79: Line 102:
=== Four methods of setup ===
 1. By session with .xprofile.
 1. Dynamically by using XRandR tool
 1. Statically by setting in xorg.conf.
 1. XRandR GUIs (Graphical user interfaces).
=== Three methods to setup ===

 1. By session with .xprofile. 
 2. Dynamically by using xrandr tool
 3. Statically by setting in xorg.conf. 
 4. Xrandr Graphical Front End GUI. 
Line 85: Line 109:
XRandR tool (an app component in Xorg) is a command line interface to RandR extension, and can be used to set outputs for a screen dynamically, without any specific setting in xorg.conf. You can refer the XRandR manual for details. xrandr tool (an app component in Xorg) is a command line interface to RandR extension, and can be used to set outputs for a screen dynamically, without any specific setting in xorg.conf. You can refer the xrandr manual for details.
Line 88: Line 112:
Use your favorite editor and create ~/.xprofile. Put something similar to what you see below in it. Now every time your start your X session that command will be run. You can force it to run by logging out and logging back in, Ctrl+Alt+Backspace, or running {{{~/.xprofile}}} from your terminal.
{{{
xrandr --output VGA1 --mode 1024x768 --rate 60
}}}

Here is an example of my ~/.xprofile. The '''#''' are for comments, just like you do with shell scripts. The purpose of my set up is sometime have laptop on the left and other times I have my laptop on the right. This makes it very simple and easy to change which side you want each monitor to be on. I just added the information on how to set your primary monitor:

Use your favorite editor and create ~/.xprofile. Put something similar to what your see below in it. Now every time your start your Xsession that command will be run. You can force it to run by logging out and logging back in, ctrl+alt+backspace, or running ~/.xprofile from your terminal.

{{{
  $ xrandr --output VGA1 --mode 1024x768 --rate 60
}}}

Here is an example of my ~/.xprofile. The '''#''' are for comments just like you do with shell scripts. The purpose of my setup is sometime have laptop on the left and other times I have my laptop on the right. This makes very simple and easy to change which side you want each monitor to be on. I just added the information on how to set your primary monitor.
Line 110: Line 137:
}}}

Some people think it is a disadvantage that this only works for one user, other people think this is an advantage. If you want to be able to use this just copy it over to your profile folder.

{{{{#!w
iki important
'''Important note'''

Be careful with
your '''X''' if you copy from a website, such as [[http://ubuntugeek.com/how-to-adjust-screen-resolution-on-ubuntu.html|Ubuntu Geek]], otherwise you will get this nice message:
{{{
xrandr: cannot find mode 1024×768
}}}


This happens because in the above context, the x character is automatically replaced with a multiplication sign.

Correct:
 *
{{{xrandr --output VGA1 --mode 1024x768 --rate 60}}}
 * {{{
xrandr --output VGA1 --mode 1024x768 --rate 60}}}

Incorrect:
 *
{{{xrandr --output VGA1 --mode 1024×768 --rate 60}}}
 * {{{
xrandr --output VGA1 --mode 1024×x768 --rate 60}}}
Take a look at the sizes of the the '''×x''' on the second line.
}
}}}

==== Dynamically set up with XRandR ====
XRandR can be used to change an output’s mode, rotation direction, position, etc. In this guide, we only introduce options related with dual head setting.

You can see the output’s status with option {{{-q}}}. Below is an example:

}}}

Some people think it is a disadvantage that this only works for one user, other people think this is an advantage. If you want to be able to use this just copy it over to your profile folder.   '''Important Note'''
Be careful with your '''X''' if you copy from a website l
ike what you see below otherwise you will get this nice message.  '''xrandr: cannot find mode 1024×768'''

http://www.ubuntugeek.com/how-to-adjust-screen-resolution-on-ubuntu.html


This website uses some kind of mini '''x''' which does not work.   '''Correct'''
{{{
  $
xrandr --output VGA1 --mode 1024x768 --rate 60
  $
xrandr --output VGA1 --mode 1024x768 --rate 60
}}}

'''Incorrect'''

Take a look at the sizes of the the '''×x''' on the second line.
{{{
  $
xrandr --output VGA1 --mode 1024×768 --rate 60
  $
xrandr --output VGA1 --mode 1024×x768 --rate 60
}}}

==== Dynamically setup with xrandr ====

Xrandr can be used to change outputs' mode, rotation direction, position, etc. In this guide, we only introduce options related with dual head setting.

You can see the outputs' status with option '-q'. Below is an example:
Line 156: Line 188:
}}}

In the above example, two outputs (VGA1 and LVDS1) are connected, the resolution of both is 1024×768@60, output VGAs viewport is at (1024, 0) and output LVDSs viewport is at (0, 0), i.e. LVDS1 is located at left of VGA. The size of occupied area by both outputs is 2048×768. The virtual screen size (maximum framebuffer) is 4096×4096 which is statically set in xorg.conf (see next section). You can decrease the maximum with {{{--fb}}} option but can not increase it. You need make sure your screen size fall into the maximum framebuffer, otherwise you should increase the value in xorg.conf.

There are five XRandR options that can be used to set Dual Monitor
:
 * {{{xrandr --pos <x>x<y>}}}
 * {{{xrandr --left-of <output>}}}
 * {{{xrandr --right-of <output>}}}
 * {{{xrandr --above <output>}}}
 * {{{xrandr --below <output>}}}

The last four will set the output’s relative position to another output, for example:
{{{
xrandr --output VGA1 --left-of LVDS1
}}}

Option {{{-pos}}} is more flexible which can place output to anywhere, for example:
 * {{{
xrandr --output VGA1 --pos 200x200}}}
 * {{{
xrandr --output LVDS1 --pos 400x500}}}

==== Statically set up in xorg.conf ====
RandR1.2 configuration in xorg.conf is based on per monitor. So you need write a Monitor section for each output and specify these monitors in the “Device section.

Below is a example snippet in xorg.conf:

}}}

In above example, two outputs (VGA1 and LVDS1) are connected, the resolution of both is 1024x768@60, output VGA's viewport is at (1024, 0) and output LVDS's viewport is at (0, 0), i.e. LVDS1 is located at left of VGA. The size of occupied area by both outputs is 2048x768. The virtual screen size (maximum framebuffer) is 4096 x 4096 which is statically set in xorg.conf (see next section). You can decrease the maximum with '--fb' option but can not increase it. You need make sure your screen size fall into the maximum framebuffer, otherwise you should increase the value in xorg.conf.
There are five xrandr options that can be used to set Dual Monitor:
{{{
  $ xrandr --pos <x>x<y>
  $ xrandr --left-of <output>
  $ xrandr --right-of <output>
  $ xrandr --a
bove <output>
  $ xrandr --below <output>
}}}
The last four will set the output's relative position to another output
, for example:
{{{
  $
xrandr --output VGA1 --left-of LVDS1
}}}
Option '-pos' is more flexible which can place output to anywhere, for example:
{{{
  $
xrandr --output VGA1 --pos 200x200
  $
xrandr --output LVDS1 --pos 400x500
}}}

==== statically setup in xorg.conf ====

RandR1.2 configuration in xorg.conf is based on per monitor. So you need write a 'Monitor' section for each output and specify these monitors in 'Device' section.

Below is a example snippet in xorg.conf.
Line 237: Line 273:
==== XRandR GUIs (Graphical user interfaces) ==== ==== Xrandr Graphical Front End GUI ====
Line 245: Line 282:
Due to buggy hardware or drivers, your monitors correct resolutions may not always be detected. For example, the EDID data block queried from your monitor may be incorrect.

If the mode already exists, but just isnt associated for the particular output, you can add it like this:
{{{
xrandr --addmode S-video 800x600
}}}

If the mode doesnt yet exist, you'll need to '''create it first''' by specifying a modeline:
{{{
xrandr --newmode <Mode``Line>
}}}

You may create a modeline using the {{{gtf}}} or {{{cvt}}} utility. For example, if you want to add a mode with resolution 800×600, you can enter the following command:

Due to buggy hardware or drivers, your monitor's correct resolutions may not always be detected.  For example, the EDID data block queried from your monitor may be incorrect.

If the mode already exists, but just isn't associated for the particular output, you can add it like this:

{{{
  $
xrandr --addmode S-video 800x600
}}}

If the mode doesn't yet exist, you'll need to '''create it first''' by specifying a modeline:

{{{
  $
xrandr --newmode <Mode``Line>
}}}

You may create a modeline using the {{{gtf}}} or {{{cvt}}} utility. For example, if you want to add a mode with resolution 800x600, you can enter the following command: (The output is shown following.)
Line 264: Line 305:
Then, copy the information after the word Modeline into the XRandR command: Then copy the information after the word "Modeline" into the xrandr command:
Line 269: Line 311:
After the mode is entered, it needs to be added to the output using the {{{--addmode}}} command as explained above.

== Setting XRandR changes persistentl
y ==

There are several
ways to make XRandR customizations permanent from session to session:
 1. .xprofile
 1. kdm/gdm
 1. xorg.conf

Each of these mechanisms will be discussed in turn.

=== Setting XRandR commands in .xprofile ===

A user’s ~/.xprofile file is executed on Xorg startup if it exists and is executable. You can copy and paste XRandR command line strings into this file so they’re executed when you log in. For example:

{{{
xrandr --output VGA-0 --mode 800x600
}}}

There are two disadvantages to using .xprofile for {{{xrandr}}} settings.

First, it occurs fairly late in the startup process, so youll see some resolution resizing during the initial screen draw; in some cases panel windows may resize improperly as a result.

Second, as this is a per-user setting, it wont affect the resolutions of other users, nor will it alter the resolution on the login screen.

=== Setting XRandR commands in KDM/GDM startup scripts ===

Both KDM and GDM
have startup scripts that are executed when X is initiated. For GDM, these are in /etc/gdm/, while for KDM this is done at /etc/kde4/kdm/Xsetup. In either case, you can paste in an XRandR command line string into one of these scripts. For GDM, try putting them right before {{{initctl -q emit login-session-start DISPLAY_MANAGER=gdm}}} in /etc/gdm/Init/Default.

This process requires root access and mucking around in system configuration files, but will take effect earlier in the startup process than using .xprofile, and will apply to all users including the login screen.
After the mode is entered, it needs to be added to the output using the --addmode command as explained above.

== Setting xrandr changes persistently ==

There are several ways to make xrandr customizations permanent from session to session: a) .xprofile, b) kdm/gdm, c) xorg.conf. Each of these mechanisms will be discussed in turn.

=== Setting xrandr commands in .xprofile ===

A user's
{{{~/.xprofile}}} file is executed on Xorg startup if it exists and is executable. You can copy and paste xrandr command line strings into this file so they're executed when you log in. For example:

{{{
  $ xrandr --output VGA-0 --mode 800x600
}}}

There are two disadvantages to using .xprofile for xrandr settings. First, it occurs fairly late in the startup process, so you'll see some resolution resizing during the initial screen draw; in some cases panel windows may resize improperly as a result.  Second, as this is a per-user setting, it won't affect the resolutions of other users, nor will it alter the resolution on the login screen.

=== Setting xrandr commands in kdm/gdm startup scripts ===

Both
KDM and GDM have startup scripts that are executed when X is initiated.  For GDM, these are in /etc/gdm/ , while for KDM this is done at /etc/kde4/kdm/Xsetup.  In either case, you can paste in an xrandr command line string into one of these scripts. For GDM, try putting them right before
{{{initctl -q emit login-session-start DISPLAY_MANAGER=gdm}}} in /etc/gdm/Init/Default

This process requires root access and mucking around in system config files, but will take effect earlier in the startup process than using .xprofile, and will apply to all users including the login screen.
Line 300: Line 335:
While xorg.conf is largely empty these days, it can still be used for setting up resolutions. For example:
While {{{xorg.conf}}} is largely empty these days, it can still be used for setting up resolutions.  For example:
Line 330: Line 367:
=== Setting resolution changes in xorg.confresolution lower than expected ===
=== Setting resolution changes in xorg.conf -- resolution lower than expected ===
Line 335: Line 371:
{{{#!wiki note
'''Background'''

I use Ubuntu 9.0.4 x86, ATI X1550 based video card and two LCD monitors DELL 2408 (up to 1920×1200) and Samsung 206BW (up to 1680×1050). Upon first login after installation, the resolution default to 1152×864. XRandR does not list any resolution higher than 1152×864. You may want to try editing /etc/X11/xorg.conf, add a section about virtual screen, logout, login and see if this helps. If not, then read on.
}}}


Change the default xorg.conf from:
Background: I use Ubuntu 9.0.4 x86, ATI X1550 based video card and two LCD monitors DELL 2408(up to 1920x1200) and Samsung 206BW(up to 1680x1050). Upon first login after installation, the resolution default to 1152x864. xrandr does not list any resolution higher than 1152x864. You may want to try editing /etc/X11/xorg.conf, add a section about virtual screen, logout, login and see if this helps. If not then read on.

Change the default xorg.conf
Line 357: Line 389:
to: To
Line 376: Line 408:

About the numbers: I put Dell on the left and Samsung on the right. So the virtual width is of sum of both LCD width 3600=1920+1680; Height then is figured as the max of them, which is max(1200,1050)=1200. If you put one LCD above the other, use this calculation instead: (max(width1, width2), height1+height2).

If that does not help, heres what I did:
About the numbers: I put DELL on the left and Samsung on the right. So the virtual width is of sum of both LCD width 3600=1920+1680; Height then is figured as the max of them, which is max(1200,1050)=1200. If you put one LCD above the other, use this calculation instead: (max(width1, width2), height1+height2).

If that does not help, here's what I did:
Line 382: Line 412:
The actual order was different, as I tried to add new mode to one LCD at a time. Below is the combined/allinone quote: The actual order was different, as I tried to add new mode to one LCD at a time. Below is the combined/all-in-one quote
Line 396: Line 426:
==== Go to Ubuntu Menu: System -> Preference -> Display ====
Change one of the LCDs resolution to a lower one, e.g. 800×600. Apply change, then (I dont remember the exact order/wording here:) hopefully the GUI will give you a prompt saying something like the resolution can be improved but virtual screen has to be enabled, you need to however logout and log back in. I did it and on second login, I am able to find the higher resolution listed for that LCD. After that I follow suite and make similar change to 2nd LCD and am able to get both of them working.
==== Goto Ubuntu Menu: System -> Preference -> Display ====
Change one of the LCD's resolution to a lower one, e.g. 800x600. Apply change, then (I don't remember the exact order/wording here:) hopefully the GUI will give you a prompt saying something like "the resolution can be improved but virtual screen has to be enabled, you need to however logout and log back in". I did it and on 2nd login, I am able to find the higher resolution listed for that LCD. After that I follow suite and make similar change to 2nd LCD and am able to get both of them working.

Resetting an out-of-range resolution

If you set a resolution inappropriate for your monitor in the Screen Resolution GUI tool, you can reset it by running rm ~/.config/monitors.xml from a terminal.

Dynamically testing different resolutions

You can either use the Screen Resolution GUI tool to experiment with different resolutions, or the more powerful xrandr command-line tool:

  $ xrandr

shows you the names of different outputs available on your system (LVDS, VGA-0, etc.) and resolutions available on each:

Screen 0: minimum 320 x 200, current 1400 x 1050, maximum 1400 x 1400
VGA disconnected (normal left inverted right x axis y axis)
LVDS connected 1400x1050+0+0 (normal left inverted right x axis y axis) 286mm x 214mm
   1400x1050      60.0*+   50.0  
[...]

You can direct xrandr to set a different resolution like this:

  $ xrandr --output LVDS --mode 1024x768

  $ xrandr --output VGA1 --mode 1024x768

The refresh rate may also be changed, either at the same time or independently:

  $ xrandr --output LVDS --mode 1024x768 --rate 75

  $ xrandr --output VGA1 --mode 1024x768 --rate 60

Note that changes you make using xrandr only last through the current session. xrandr has a lot more capabilities - see man xrandr for details.

Panning viewport

If you want to have a panning viewport, i.e., a virtual screen that's bigger than your physical screen that moves when you move the mouse to the edge ("zoomed in" view) specify the desired physical resolution with --mode and the virtual screen size with --fb and panning area (typically same as virtual screen size) with --panning.

For example,

xrandr --output VGA1 --rate 60 --mode 800x600 --fb 1280x1024 --panning 1280x1024

How to setup a dual monitor

Introduction

http://www.thegeekstuff.com/2009/08/ubuntu-tips-how-to-setup-dual-monitor/

The article above will give you some important background information. I will summarize the points that I think are important and add a few points. It makes life easier if you pop open a terminal and type to open your gui monitor program:

  $ gnome-display-properties

Next uncheck same image in all Monitors. If your watch a lot of movies it is important to set your Monitors to your lower resolution. For example, if they are both 1440 x 900 monitors, make sure it is set to that resolution. If the monitors are different resolutions, you will need it to the resolution of the smaller monitor. So, for example, if one monitor is 1440 x 900 and the other is full HD resolution, you will have to set it at 1440×900. The reason for this is your video will be a black screen when trying to watch a movie so this is very important. Click APPLY. Then you will get a warning and you need to keep your new configuration. You will need to restart your session for this to take effect sometimes. There are 2 simple ways to do this. The first is to log out then log back in, and the second is to hit ctrl+alt+backspace. The second method restarts your x session so make you save your work.

http://intellinuxgraphics.org/dualhead.html

This guide is targeted for people who want to use extended desktop mode on two outputs. Clone mode should work out-of-box with a normal configuration.

With RandR 1.2, you can setup dual head and add/remove monitor dynamically (i.e. on-the-fly, without restarting X).

Output port names

Intel driver - UMS

  • VGA - Analog VGA output

  • LVDS - Laptop panel

  • DP1 - DisplayPort output

  • TV - Integrated TV output

  • TMDS-1 - First DVI SDVO output

  • TMDS-2 - Second DVI SDVO output

The SDVO and DVO TV outputs are not supported by the driver at this time.

Intel driver - KMS

  • LVDS1 - Laptop panel

  • VGA1 - Analog VGA output

  • DVI1 - Digital video output

radeon driver

  • VGA-0 - Analog VGA output

  • LVDS - Laptop panel

  • S-video - Integrated TV output

  • DVI-0 - DVI output

http://www.thinkwiki.org/wiki/Xorg_RandR_1.2

Three methods to setup

  1. By session with .xprofile.
  2. Dynamically by using xrandr tool
  3. Statically by setting in xorg.conf.
  4. Xrandr Graphical Front End GUI.

xrandr tool (an app component in Xorg) is a command line interface to RandR extension, and can be used to set outputs for a screen dynamically, without any specific setting in xorg.conf. You can refer the xrandr manual for details.

By Session with .xprofile

Use your favorite editor and create ~/.xprofile. Put something similar to what your see below in it. Now every time your start your Xsession that command will be run. You can force it to run by logging out and logging back in, ctrl+alt+backspace, or running ~/.xprofile from your terminal.

  $ xrandr --output VGA1 --mode 1024x768 --rate 60

Here is an example of my ~/.xprofile. The # are for comments just like you do with shell scripts. The purpose of my setup is sometime have laptop on the left and other times I have my laptop on the right. This makes very simple and easy to change which side you want each monitor to be on. I just added the information on how to set your primary monitor.

xrandr --output VGA1 --mode 1024x768 --rate 60

#Laptop right extra Monitor Left
#xrandr --output VGA1 --left-of LVDS1

#Laptop left extra Monitor right
xrandr --output LVDS1 --left-of VGA1

#This is to set your primary monitor.

#This sets your laptop monitor as your primary monitor. 
xrandr --output LVDS1 --primary

#This sets your VGA monitor as your primary monitor. 
#xrandr --output VGA1 --primary

Some people think it is a disadvantage that this only works for one user, other people think this is an advantage. If you want to be able to use this just copy it over to your profile folder.

Important Note Be careful with your X if you copy from a website like what you see below otherwise you will get this nice message. xrandr: cannot find mode 1024×768

http://www.ubuntugeek.com/how-to-adjust-screen-resolution-on-ubuntu.html

This website uses some kind of mini x which does not work.

Correct

  $ xrandr --output VGA1 --mode 1024x768 --rate 60
  $ xrandr --output VGA1 --mode 1024x768 --rate 60

Incorrect

Take a look at the sizes of the the ×x on the second line.

  $ xrandr --output VGA1 --mode 1024×768 --rate 60
  $ xrandr --output VGA1 --mode 1024×x768 --rate 60

Dynamically setup with xrandr

Xrandr can be used to change outputs' mode, rotation direction, position, etc. In this guide, we only introduce options related with dual head setting.

You can see the outputs' status with option '-q'. Below is an example:

  $ xrandr -q
  Screen 0: minimum 320 x 200, current 2048 x 768, maximum 4096 x 4096
  VGA1 connected 1024x768+1024+0 (normal left inverted right x axis y axis) 338mm x 270mm
   1280x1024      60.0 +   75.0  
   1280x960       75.0     70.0     60.0  
   1152x864       75.0     70.0     60.0  
   1024x768       75.1     70.1     66.0     60.0* 
   832x624        74.6  
   800x600        72.2     75.0     60.3     56.2  
   640x480        72.8     75.0     66.7     60.0  
   720x400        70.1  
  LVDS1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 304mm x 228mm
   1024x768       60.0*+
   800x600        60.3  
   640x480        59.9  
  DVI1 disconnected (normal left inverted right x axis y axis)
  TV1 disconnected (normal left inverted right x axis y axis)

In above example, two outputs (VGA1 and LVDS1) are connected, the resolution of both is 1024x768@60, output VGA's viewport is at (1024, 0) and output LVDS's viewport is at (0, 0), i.e. LVDS1 is located at left of VGA. The size of occupied area by both outputs is 2048x768. The virtual screen size (maximum framebuffer) is 4096 x 4096 which is statically set in xorg.conf (see next section). You can decrease the maximum with '--fb' option but can not increase it. You need make sure your screen size fall into the maximum framebuffer, otherwise you should increase the value in xorg.conf. There are five xrandr options that can be used to set Dual Monitor:

  $ xrandr --pos <x>x<y>
  $ xrandr --left-of <output>
  $ xrandr --right-of <output>
  $ xrandr --above <output>
  $ xrandr --below <output>

The last four will set the output's relative position to another output, for example:

  $ xrandr --output VGA1 --left-of LVDS1

Option '-pos' is more flexible which can place output to anywhere, for example:

  $ xrandr --output VGA1 --pos 200x200
  $ xrandr --output LVDS1 --pos 400x500

statically setup in xorg.conf

RandR1.2 configuration in xorg.conf is based on per monitor. So you need write a 'Monitor' section for each output and specify these monitors in 'Device' section.

Below is a example snippet in xorg.conf.

Section "Device"
        Identifier      "Intel 945G "
        Driver         "intel"

        # Using the name of the output defined by the video driver plus the identifier of a
        #     monitor section, one associates a monitor section with an output by adding an
        #     option to the Device section in the following format:
        #     Option "Monitor-outputname" "monitor ID"

        Option          "monitor-VGA" "foo"
        Option          "monitor-LVDS" "bar"
        #Option         "monitor-TMDS-1" "dvi"
EndSection

Section "Monitor"
        Identifier      "foo"

        # specifies a mode to be marked as the preferred initial mode of the monitor
        # Option "PreferredMode"  "800x600"
        # This optional entry specifies the position of the monitor within the X screen.
        #Option        "Position" "1024 0"
        #This optional entry specifies that the monitor should be ignored
        #     entirely, and not reported through RandR.  This is useful if the
        #     hardware reports  the  presence  of  outputs  that do not exist.
        #Option "Ignore"  "true"
EndSection

Section "Monitor"
        Identifier      "bar"

        #Options LeftOf, RightOf, Above, Below specify monitors' relative position

        Option "LeftOf"  "foo"

        # This optional entry specifies  whether  the  monitor  should  be
        #     turned  on  at  startup.  By default, the server will attempt to
        #     enable all connected monitors.
        #Option "Enable"  "true"       

        #This optional entry specifies the initial rotation of the given monitor.
        #     Valid values for rotation are "normal", "left", "right", and "inverted".
        # Option "Rotate"  "left"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Device        "Intel Corporation 945G Integrated Graphics Controller"
        Monitor       "foo"
        DefaultDepth  24
        SubSection "Display"
                Depth          24
                Modes         "1280x1024"  "1024x768"   "640x480"
        EndSubSection
EndSection

Xrandr Graphical Front End GUI

Adding undetected resolutions

Due to buggy hardware or drivers, your monitor's correct resolutions may not always be detected. For example, the EDID data block queried from your monitor may be incorrect.

If the mode already exists, but just isn't associated for the particular output, you can add it like this:

  $ xrandr --addmode S-video 800x600

If the mode doesn't yet exist, you'll need to create it first by specifying a modeline:

  $ xrandr --newmode <Mode``Line>

You may create a modeline using the gtf or cvt utility. For example, if you want to add a mode with resolution 800x600, you can enter the following command: (The output is shown following.)

  $ cvt 800 600
  # 800x600 59.86 Hz (CVT 0.48M3) hsync: 37.35 kHz; pclk: 38.25 MHz
  Modeline "800x600_60.00"   38.25  800 832 912 1024  600 603 607 624 -hsync +vsync

Then copy the information after the word "Modeline" into the xrandr command:

  $ xrandr --newmode "800x600_60.00"   38.25  800 832 912 1024  600 603 607 624 -hsync +vsync

After the mode is entered, it needs to be added to the output using the --addmode command as explained above.

Setting xrandr changes persistently

There are several ways to make xrandr customizations permanent from session to session: a) .xprofile, b) kdm/gdm, c) xorg.conf. Each of these mechanisms will be discussed in turn.

Setting xrandr commands in .xprofile

A user's ~/.xprofile file is executed on Xorg startup if it exists and is executable. You can copy and paste xrandr command line strings into this file so they're executed when you log in. For example:

  $ xrandr --output VGA-0 --mode 800x600

There are two disadvantages to using .xprofile for xrandr settings. First, it occurs fairly late in the startup process, so you'll see some resolution resizing during the initial screen draw; in some cases panel windows may resize improperly as a result. Second, as this is a per-user setting, it won't affect the resolutions of other users, nor will it alter the resolution on the login screen.

Setting xrandr commands in kdm/gdm startup scripts

Both KDM and GDM have startup scripts that are executed when X is initiated. For GDM, these are in /etc/gdm/ , while for KDM this is done at /etc/kde4/kdm/Xsetup. In either case, you can paste in an xrandr command line string into one of these scripts. For GDM, try putting them right before initctl -q emit login-session-start DISPLAY_MANAGER=gdm in /etc/gdm/Init/Default

This process requires root access and mucking around in system config files, but will take effect earlier in the startup process than using .xprofile, and will apply to all users including the login screen.

Setting resolution changes in xorg.conf

While xorg.conf is largely empty these days, it can still be used for setting up resolutions. For example:

Section "Monitor"
    Identifier      "External DVI"
    Modeline        "1280x1024_60.00"  108.88  1280 1360 1496 1712  1024 1025 1028 1060  -HSync +Vsync
    Option          "PreferredMode" "1280x1024_60.00"
EndSection
Section "Device"
    Identifier      "ATI Technologies, Inc. M22 [Radeon Mobility M300]"
    Driver          "ati"
    Option          "Monitor-DVI-0" "External DVI"
EndSection
Section "Screen"
    Identifier      "Primary Screen"
    Device          "ATI Technologies, Inc. M22 [Radeon Mobility M300]"
    DefaultDepth    24
    SubSection "Display"
        Depth           24
        Modes   "1280x1024" "1024x768" "640x480"
    EndSubSection
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Primary Screen"
EndSection

See man xorg.conf for full details on how to craft an xorg.conf file.

Setting resolution changes in xorg.conf -- resolution lower than expected

Try this first

If you video card is recognized but the resolution is lower than you expect, you may try this.

Background: I use Ubuntu 9.0.4 x86, ATI X1550 based video card and two LCD monitors DELL 2408(up to 1920x1200) and Samsung 206BW(up to 1680x1050). Upon first login after installation, the resolution default to 1152x864. xrandr does not list any resolution higher than 1152x864. You may want to try editing /etc/X11/xorg.conf, add a section about virtual screen, logout, login and see if this helps. If not then read on.

Change the default xorg.conf

Section "Device"
        Identifier      "Configured Video Device"
EndSection

Section "Monitor"
        Identifier      "Configured Monitor"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
EndSection

To

Section "Monitor"
        Identifier      "Configured Monitor"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
->        SubSection "Display"
->                Virtual 3600 1200
->        EndSubSection
EndSection

Section "Device"
        Identifier      "Configured Video Device"
EndSection

About the numbers: I put DELL on the left and Samsung on the right. So the virtual width is of sum of both LCD width 3600=1920+1680; Height then is figured as the max of them, which is max(1200,1050)=1200. If you put one LCD above the other, use this calculation instead: (max(width1, width2), height1+height2).

If that does not help, here's what I did:

Use cvt/xrandr tool to add the highest mode the LCD can do

The actual order was different, as I tried to add new mode to one LCD at a time. Below is the combined/all-in-one quote

aa@aa-desktop:/$ cvt 1920 1200 60
# 1920x1200 59.88 Hz (CVT 2.30MA) hsync: 74.56 kHz; pclk: 193.25 MHz
Modeline "1920x1200_60.00"  193.25  1920 2056 2256 2592  1200 1203 1209 1245 -hsync +vsync
aa@aa-desktop:/$ cvt 1680 1050 60
# 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
aa@aa-desktop:/$ xrandr --newmode "1920x1200_60.00"  193.25  1920 2056 2256 2592  1200 1203 1209 1245 -hsync +vsync
aa@aa-desktop:/$ xrandr --newmode "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
aa@aa-desktop:/$ xrandr --addmode DVI-1 "1920x1200_60.00"
aa@aa-desktop:/$ xrandr --addmode DVI-0 "1680x1050_60.00"

Goto Ubuntu Menu: System -> Preference -> Display

Change one of the LCD's resolution to a lower one, e.g. 800x600. Apply change, then (I don't remember the exact order/wording here:) hopefully the GUI will give you a prompt saying something like "the resolution can be improved but virtual screen has to be enabled, you need to however logout and log back in". I did it and on 2nd login, I am able to find the higher resolution listed for that LCD. After that I follow suite and make similar change to 2nd LCD and am able to get both of them working.

Obtaining modelines from Windows program PowerStrip

X.Org Wiki has an article about this.

X/Config/Resolution (last edited 2013-02-01 14:19:52 by 91-157-220-54)