{"id":336,"date":"2009-02-09T22:04:02","date_gmt":"2009-02-10T05:04:02","guid":{"rendered":"http:\/\/www.graphics-muse.org\/wp\/?p=336"},"modified":"2009-02-09T22:04:02","modified_gmt":"2009-02-10T05:04:02","slug":"using-xrandr-with-external-display-ports","status":"publish","type":"post","link":"https:\/\/www.graphics-muse.org\/wp\/?p=336","title":{"rendered":"Using xrandr with external display ports"},"content":{"rendered":"<p>I&#8217;ve noticed a lot of searches on <em>xrandr<\/em> in my blog stats and have been wondering what the problem is.\u00a0 Xrandr is a command line tool for enabling or disabling multiple display ports on your system as well as setting display resolution and even rotation.\u00a0 You would use it, for example, to enable TV-Out or an external monitor while also setting its relative position from the current display and the resolution to use.\u00a0 The tool is the user end point for the <a href=\"http:\/\/en.wikipedia.org\/wiki\/XRandR\">RandR extension to the X.org server<\/a>.<\/p>\n<p>On my systems I set up a few simple shell scripts to enable specific modes and then disable them when I&#8217;m done with that mode.\u00a0 My Acer Aspire laptop, which uses an <a href=\"http:\/\/intellinuxgraphics.org\/dualhead.html\">Intel i915GM chipset<\/a>, has external VGA and TV-Out ports.\u00a0 The VGA output is used for two purposes.\u00a0 At home I have an external LCD that I use side by side with the laptop monitor to give me extra screen space to work with.\u00a0 At work or when I give presentations at local user group meetings or conferences I use the external VGA port to connect to a projector.<\/p>\n<h3>Finding available ports<\/h3>\n<p>If you aren&#8217;t sure what ports are available you can run xrandr to query the system:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #003366;\"><span style=\"font-family: verdana,geneva;\"><span style=\"font-size: small;\">xrandr -q<\/span><\/span><\/span><\/p>\n<p>This will show you the display ports that the X server knows about. You must run this and all other xrandr commands from the desktop.\u00a0 You can&#8217;t, for example, login through ssh from another machine to view the available ports.\u00a0 This violates X authentication (you can do it if you run ssh -X, possibly, but I&#8217;m not going to get into X authentication issues at this point).\u00a0 The output from this command will look something like this:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #003366;\"><span style=\"font-family: verdana,geneva;\"><span style=\"font-size: small;\">$ xrandr -q<br \/>\nScreen 0: minimum 320 x 200, current 2560 x 800, maximum 2560 x 2048<br \/>\nVGA connected 1280&#215;768+1280+0 (normal left inverted right x axis y axis) 370mm x 222mm<br \/>\n1280&#215;768\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 59.9*+<br \/>\n1280&#215;960\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 60.0<br \/>\n1280&#215;720\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 75.0\u00a0\u00a0\u00a0\u00a0 60.0<br \/>\n1024&#215;768\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 75.0\u00a0\u00a0\u00a0\u00a0 72.0\u00a0\u00a0\u00a0\u00a0 70.1\u00a0\u00a0\u00a0\u00a0 60.0<br \/>\n832&#215;624\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 74.6<br \/>\n800&#215;600\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 72.2\u00a0\u00a0\u00a0\u00a0 75.0\u00a0\u00a0\u00a0\u00a0 60.3\u00a0\u00a0\u00a0\u00a0 56.2<br \/>\n640&#215;480\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 75.0\u00a0\u00a0\u00a0\u00a0 72.8\u00a0\u00a0\u00a0\u00a0 75.0\u00a0\u00a0\u00a0\u00a0 66.7\u00a0\u00a0\u00a0\u00a0 59.9<br \/>\n720&#215;400\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 70.1<br \/>\nLVDS connected 1280&#215;800+0+0 (normal left inverted right x axis y axis) 331mm x 207mm<br \/>\n1280&#215;800\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 60.0*+<br \/>\n1024&#215;768\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 60.0<br \/>\n800&#215;600\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 60.3<br \/>\n640&#215;480\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 59.9<br \/>\nTV disconnected (normal left inverted right x axis y axis)<\/span><\/span><\/span><\/p>\n<p>This tells me that the X server knows about the external VGA port, the laptop&#8217;s LCD (LVDS) and a TV-out port.\u00a0 It even knows the TV port has nothing connected to it at the moment.\u00a0\u00a0 In this output the settings for the VGA port and laptop LCD screen are known because I&#8217;m using them right now, meaning I&#8217;ve already gone through the process I&#8217;m about to describe.<\/p>\n<h3>External VGA<\/h3>\n<p>The external LCD configuration is static.\u00a0 The display is made by Westinghouse and has a maximum resolution of 1280&#215;768.\u00a0 The laptop has a maximum display of 1280&#215;800.\u00a0 To enable both displays at their maximum resolution and configured them side by side (so the mouse moves from the laptop on the left to the external LCD on the right:\n<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #003366;\"><span style=\"font-family: verdana,geneva;\"><span style=\"font-size: small;\">xrandr &#8211;output LVDS &#8211;mode 1280&#215;800 &#8211;output VGA &#8211;mode 1280&#215;768 &#8211;right-of LVDS<\/span><\/span><\/span><\/p>\n<p><em>LVDS<\/em> is the laptop screen.\u00a0 It gets set first so that the <em>&#8211;right-of<\/em> option will apply to the last <em>&#8211;output<\/em> defined (re: the <em>VGA<\/em> output).\u00a0 That&#8217;s all there is to it.\u00a0 To get back to normal, I disable the external monitor:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #003366;\"><span style=\"font-family: verdana,geneva;\"><span style=\"font-size: small;\">xrandr &#8211;output VGA &#8211;off<br \/>\nxrandr &#8211;output LVDS &#8211;mode 1280&#215;800 &#8211;rotate normal<\/span><\/span><\/span><\/p>\n<p>The <em>rotate<\/em> option in the second line is there because somtimes I rotate the laptop monitor manually and forget to put it back when I reset the configuration, which leaves me with a single monitor rotated 90 degrees.\u00a0 It&#8217;s kinda hard to work that way.<\/p>\n<p>Note that this configuration only works with my Intel-based chipset if I&#8217;ve <a href=\"https:\/\/www.graphics-muse.org\/source\/xorg.conf.f10\">configured the X server properly<\/a>.\u00a0 You can see <a href=\"https:\/\/www.graphics-muse.org\/wp\/index.php?s=intel&amp;submit=Search+the+Blog\">plenty of discussion of this issue<\/a> in other posts in my blog.<\/p>\n<p>The laptop hardware is interesting in that if the external VGA is plugged in when the laptop boots then only the external monitor displays anything &#8211; at least during the boot.\u00a0 Once X gets started then I have a cloned display on both LCDs showing the same thing.\u00a0 This is what I get up to the gdm login screen.\u00a0 Once I login the laptop display becomes the master and the external VGA is not on.\u00a0\u00a0 To get it back on I run my little script with the above command.<\/p>\n<p>The fact that the external monitor is on to start with but then off once I logged in used to confuse me a little.\u00a0 I used to think I would have to unplug the external monitor every time I rebooted, but that really isn&#8217;t the case.\u00a0 Everything is how it should be once I&#8217;m logged in through gdm.<\/p>\n<h3>External projector<\/h3>\n<p>Connecting to an external projector is a little different.\u00a0 Many of these will auto-configure using standard resolutions of 800&#215;600, 1024&#215;768 or even higher.\u00a0 Some are smart enough to handle odd resolutions as well.\u00a0 But just because they handle that resolution doesn&#8217;t mean they display it very well.\u00a0 My experience has been that 1024&#215;768 is about the best you&#8217;ll get without having lots of time to fiddle with the projector &#8211; something you don&#8217;t often have when giving a presentation.<\/p>\n<p>For most of my presentations I like to create a new user and run the presentation from that user.\u00a0 The reason for this is to avoid accidently falling back to my well tuned desktop or shell configurations when explaining how to do something.\u00a0 From this new users desktop I configure panel launchers under GNOME to run xrandr scripts to enable the external projector.\u00a0 The commands are essentially the same but I fall back to smaller screen sizes on the projector:\n<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #003366;\"><span style=\"font-family: verdana,geneva;\"><span style=\"font-size: small;\">xrandr &#8211;output LVDS &#8211;mode 1280&#215;800 &#8211;output VGA &#8211;mode 1024&#215;768 &#8211;right-of LVDS<\/span><\/span><\/span><\/p>\n<p>The caveat to this one &#8211; which unfortunately I stumbled upon right as I was about to give my last presentation &#8211; is that OpenOffice didn&#8217;t see this as two screens but rather one big screen.\u00a0 Under my own login OpenOffice saw this as two screens.\u00a0 I have yet to determine why this happened.\u00a0\u00a0 Why this is important comes from how you handle your OpenOffice presentation.\u00a0 With OpenOffice 3 (which comes with Fedora 10) you can have one screen (the external projector) showing the slides while the other screen shows the notes you prepared for each slide.\u00a0 It&#8217;s quite slick.\u00a0 It just didn&#8217;t work when I gave the presentation, but it worked at home when I rehearsed it.<\/p>\n<p style=\"padding-left: 30px;\"><em>Note that this may have been that I didn&#8217;t have OpenOffice configured properly for the new user to use both screens as independent screens.\u00a0 See what you discover when you don&#8217;t depend on your regular login?<\/em><\/p>\n<h3>External TV<\/h3>\n<p>The external TV port is an <a href=\"http:\/\/en.wikipedia.org\/wiki\/S-video\">S-Video port<\/a>.\u00a0 This port is outbound only, meaning that you can use your laptop to display to a TV but you can&#8217;t use your TV to display on your laptop.\u00a0 That would be nice, since our big screen TV projector pooped out at christmas.\u00a0 But that&#8217;s a story for another time.<\/p>\n<p>Most TVs display video quite well at 640&#215;480 and maybe 800&#215;600. Newer TVs might display higher resolutions, but don&#8217;t count it.\u00a0 Higher resolutions are often required to get decent text output on the TV such as on screen displays like in MythTV, but the only way to know what works best is to try it out on your TV.\u00a0 MythTV offers a number of options for setting the size and quality of the text you see in the on-screen guides.<\/p>\n<p>I haven&#8217;t used the TV-out port in some time and don&#8217;t want to disable the external VGA, drag the laptop downstairs and hook up the S-Video to test it again.\u00a0 If I get around to that sometime soon I&#8217;ll post an update on how it&#8217;s working.<\/p>\n<h3>Left, Right, Top, Bottom<\/h3>\n<p>One set of options to xrandr that is important are the options that position a second display relative to the first.\u00a0 You can specify positions left, right, above and below (as opposed to top and bottom) for the second display.\u00a0 This becomes important for configurations like mine.\u00a0 I currently have the external VGA set left-of the laptop LCD so I can drag my mouse side to side.\u00a0 The two screens function as one large screen for me.<\/p>\n<p>However, this configuration also forces me to disable acceleration features in the X.org intel driver because the combined width of the two displays is large than 2048, and 2048 is the maximum I can use and still utilize acceleration features of the driver.\u00a0 I&#8217;ve opted to disable those features in order to get the full 2560 width (1280 for the LCD, 1280 for the external VGA) in a virtual space.\u00a0 Virtual is meaningful to the driver but to the end user it&#8217;s still one big screen spread across two monitors.<\/p>\n<p>How you configure your monitors (left, right, etc.) may also determine some of the features you&#8217;ll be able to use.\u00a0 This is known to be an issue on Intel chips prior to the i945GM, I believe.\u00a0 Newer model chips (higher version number) are not limited by this and can still provide acceleration at the size screens I&#8217;m using.<\/p>\n<h3>Summary<\/h3>\n<p>There are a lot of other things you can do with xrandr but this covers the basic use most home users will require.\u00a0\u00a0 If you have questions on the other options, post a comment.\u00a0 I&#8217;ll see what I can find out for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve noticed a lot of searches on xrandr in my blog stats and have been wondering what the problem is.\u00a0 Xrandr is a command line tool for enabling or disabling multiple display ports on your system as well as setting display resolution and even rotation.\u00a0 You would use it, for example, to enable TV-Out or [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[14,35,1,8,113,5,10],"tags":[64,65,102,634,60,48,43,88,619,621,91,625,95,47],"class_list":{"0":"post-336","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-acer-aspire-1690i","7":"category-fedora","8":"category-general","9":"category-hardware","10":"category-intel-driver-x11-linux","11":"category-linux","12":"category-x11","13":"tag-acer","14":"tag-aspire","15":"tag-f10","16":"tag-fedora","17":"tag-gdm","18":"tag-gnome","19":"tag-intel","20":"tag-intel-driver","21":"tag-linux","22":"tag-mythtv","23":"tag-vga-port","24":"tag-video","25":"tag-xorg","26":"tag-xrandr","27":"czr-hentry"},"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pe9t8-5q","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=336"}],"version-history":[{"count":10,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/336\/revisions"}],"predecessor-version":[{"id":423,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/336\/revisions\/423"}],"wp:attachment":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}