On The Road with Vicky Lamburn

The murmurings of another voice in the congregation

Ecstatic: XrandR 1.2 means decent Linux Screen Management at Last

with 44 comments

Let me sum it up in about three words:

It just works.

Let me kid you not this is huge news. The only downside is that the GUI is not there yet but any one with a basic idea about the terminal and the command line can see this working now in its full glory; in my case I’ve tested it with Ubuntu 7.10 Gusty Gibbon (release candidate.)

Easy Radeon TV Out and Linux

Ok, I’m not sure how well this works on other Radeon GPUs but on my T40 which has a basic Mobility Radeon 7500. A popular chip that has been in many machines from Apple, Dell, other IBMs and many more. But hasn’t it been a complete stupdity basically; no ill meaning meant for those who have made solutions and worked on previous code. Here’s what you need on the command line to enable S-video output:

xrandr --addmode S-video 800x600
xrandr --output S-video --mode 800x600

That’s it. It works.

Only downside is PAL does not seem to work at present (scrambled display) but NTSC works fine. Only downside is many CRT PAL TVs will show NTSC in black and white. However some PAL TVs can cope with 60Hz NTSC signals fine. It works great here!

VGA Output

Ok I have a VGA output on my T40 but it could easily be a DVI output if need be. To mirror generally all you need to do is plug in the display and it works. To see what xrandr has detected as such; type in xrandr at the prompt and ‘magically’ it’s found the resolutions it believes the screen can display though sometimes these can be lies. But mostly it’s correct.

So if I had a 1024×768 main display and wanted to mirror at that resolution, I’d enter:

xrandr --output VGA-0 --mode 1024x768

That’s it.

Turn off Display

Say I wanted to turn off my laptop display:

xrandr --output LVDS --off

Or if I wanted to turn off the DVI output:

xrandr --output DVI-0 --off

Extend Desktop over two displays

(Say my laptop display is 1024×768 and my external display to the right is 1600×1200.)

This requires in my case one tweak to the xorg.conf file on a Radeon 7500 using the ‘radeon’ driver. In the Screen section by default you should see something like:

Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies Inc Radeon..."
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Modes "1024x768"
Virtual 2624 1200
EndSubSection
EndSection

The addition is the Virtual line where the size is the maximum width of the displays added together by the height of the biggest resolution height. So in this case the width is 1024+1600 = 2624. Between my laptop and external screen, the latter has the highest vertical resolution so that’s 1200 (instead of 768.)As another example I have a 1400×1050 laptop screen and a 1440×900 external screen so:

  • Width: 1400 + 1440 = 2840
  • Height: (1050 is larger than 900 so…) = 1050
  • So the line to insert is: Virtual 2840×1050

After sorting out the xorg.conf file from the command line after restarting the X Server (Ctrl+Alt+Backspace, Log Out or Reboot) enter:

xrandr --output VGA-0 --right-of LVDS
xrandr --output VGA-0 --mode 1600x1200

That’s it. Not quite as straight forward but still bloody simple. All we need now is a robust GUI and we’re laughing!

Conclusion

This is such a big improvement it’s not funny. This almost brings Linux up to speed with Windows and Mac OS X with regards to screen management. All it needs is a decent robust GUI and I may step up to this challenge…

I believe the radeon, nv and intel drivers support xrandr 1.2. Please let me know if others do. Certainly the radeon driver does.

Written by lilserenity

October 15, 2007 at 9:05 pm

44 Responses

Subscribe to comments with RSS.

  1. Hi,

    I found your help on the ubuntuforums.org site. Massively helpful, thank you, especially as I had given up on this idea and was trying to configure JUST my external monitor.

    You’re right, this is a great advancement!

    ~ Graham

    Graham Allan

    October 22, 2007 at 10:44 pm

  2. Hi

    Thanks for having figured this out! I sure had heard about xrandr but I really didn’t know what it was.

    Works for me. I have Ubuntu 7.10 and Mobility Radeon 9700 (Acer Ferrari 3400), and TV-out works, too! I was quote astonished when I saw the picture pop to screen. And disabling LVDS (in my case) I can get overlay and OpenGL out of VGA-0.

    External display has been the very last reason that kept me even having Windows really installed (StepMania and LCD-TV). After this I can freely get rid of it.

    Matti Viljanen

    October 24, 2007 at 12:03 pm

  3. Graham,

    Glad this was helpful. I prefer to steer clear from rampant Linux ‘fanboism’ or any OS for that matter and try to be helpful, at least it appears Linux screen management isn’t going to suck now for all eternity! I know plenty of people have defended the previous mess but this is 2007, not 1993 :)

    Vicky

    lilserenity

    October 26, 2007 at 10:40 pm

  4. Matti,

    Well that’s great that this has helped. Check out the script I wrote here (http://lilserenity.wordpress.com/2007/10/21/output-switcher-easy-linux-screen-management/) as this may really help. The Radeon 9700 will work fine as I think that was the high end Radeon in the Radeon 9000 era.

    Like you I was really pleased when xrandr just worked because I was so used to hacks and sweat that this just worked, unreal, hence the ecstatic part!

    Now for me to work hard on a GUI when I get some time! :)

    Vicky

    lilserenity

    October 26, 2007 at 10:43 pm

  5. I couldn’t make extended desktop work, I am using intel driver: one screen is copy of another; not much sense to use them use different resolution as the desktop is cropped in the smaller resolution display. Tried it in Xfce 4.4.1 desktop environment. But I could use one display at time well, for that the Virtual line is not needed in xorg.conf.

    Jarno Suni

    October 27, 2007 at 2:27 pm

  6. Jano,

    On Integrated Intel Graphics found in the i945/GMA 950 chipsets, it only supports a maximum of 2048×2048 as the Virtual setting, so you can do 2 x 1024×768 screens but that’s the maximum. This is a limitation in the chipset rather than the driver; this might be the issue you are having.

    As you say, Virtual is only needed if you’re extending the desktop.

    Vicky

    lilserenity

    October 27, 2007 at 2:57 pm

  7. All else is just fine except that the list of resolutions tops at 1600×1200. My Samsung wants 1920×1200 so I’m still missing a few pixels..

    Kari Vaisanen

    October 27, 2007 at 3:04 pm

  8. Kari,

    Obviously that shouldn’t be like that, it should detect the widescreen resolutions too. Sometimes a bad or not fully wired VGA cable can tell any operating system the wrong specifications of what resolutions it can handle. The only thing I can immediately think of suggesting is that you look at the output of typing xrandr into a terminal and secondly if you’ve customised your xorg.conf file considerably (by hand or by something like Screen & Graphics preferences in Ubuntu) is that it is reset with a call to:

    sudo dpkg-reconfigure -phigh xserver-xorg

    On the command line. Then log out and back in and run just xrandr alone and see what it says or alternatively even post the output of xrandr –verbose here. I can’t say I can solve it as if xrandr is being lied to, it makes it a bit tricky to resolve possibly.

    Vicky

    lilserenity

    October 27, 2007 at 3:17 pm

  9. lilserenity,

    I have Mobile Intel 910GML Express chipset with GMA 900 and in MS-Windows I can have the extended desktop using resolution 1280×800 in laptop’s display extended by 1280×1024 in external display, so I don’t buy that.

    Jarno Suni

    October 27, 2007 at 4:08 pm

  10. Vicky,

    It worked! Thanks a million!

    Kari

    Kari Vaisanen

    October 27, 2007 at 4:22 pm

  11. Jarno,

    Hmmm, having read more it seems the 2048×2048 restriction is surpassable but going higher disables DRI; rather than it not being supported; which I think would rule out Compiz/3D acceleration. So yes you should be able to get it to work, have you tried what I advised Kari to do? What does your xrandr output say when you pop it into the command line with the external display plugged in. That’d be the first thing I’d do if you’re to diagnose the problem. I don’t mind you pasting the output of xrandr –verbose for me to look at here if it helps.

    lilserenity

    October 27, 2007 at 4:46 pm

  12. Kari,

    Glad to hear that it’s worked :) I’m noticing a trend that this step tends to cure the very problem you and others have had so I think I’ll fix that in place for any further developments I make on my screen switcher; bearing in mind progress will be slow as I’m by no means a Linux guru!

    lilserenity

    October 27, 2007 at 4:47 pm

  13. I could make extended desktop work with intel driver, if I order “xrandr –output VGA –right-of LVDS” _after_ I chose a mode for the VGA display.

    Jarno Suni

    October 28, 2007 at 10:47 pm

  14. I’m trying to configure my dual-monitor setup.

    Quote:
    $ xrandr –output DVI-0 –left-of DVI-1
    xrandr: screen cannot be larger than 1600×1200 (desired size 2880×1200)
    How come xrandr says the above, and how can xrandr fix it? I prefer it if I don’t have to mess around with xorg.conf.

    Thank you.

    hanz

    November 3, 2007 at 5:51 pm

  15. Hanz,

    You have to edit xorg.conf in this case in one small way. If you read this post’s ‘Extended Desktop over Two Displays’ section you will see instructions for adding a ‘Virtual’ line to xorg.conf — that’s all you have to do.

    There is a good reason; but to keep it simple it’s kind of because the video card just sees two displays as one; the two screens as such aren’t as distinct as they physically appear to be on the internal side of things.

    What you need to add then is a Virtual line as per that section that says:

    Virtual 2880 1200

    Then log out and back in and you should be able to play with xrandr exactly as you need to.

    Vicky

    lilserenity

    November 3, 2007 at 6:42 pm

  16. Vicky,
    Thanks! It works.
    Now is there a way to have the dual-monitor setup automatically load every time one logs on? Whenever I log out and log-in again, I have to do the xrandr command.

    Thanks.

    hanz

    November 12, 2007 at 7:01 am

  17. Hanz,
    There is a way but I haven’t got around to it yet. You can configure xrandr in the xorg.conf. There are other ways which might be a bit easier to configure but that aren’t as ‘clean.’ I’ll be writing about it soon so hopefully if you hang on you’ll read all about it soon.

    Subscribe to my RSS feed if you haven’t already and you’ll be able to keep tabs on when I update the necessary info!

    Thanks,
    Vicky

    lilserenity

    November 12, 2007 at 7:44 pm

  18. Dear Vicky,
    I’m already subscribed to the comments-feed for this post. Thanks for having that! Looking forward to hearing from you again. In the meantime, I’ll manually run that xrandr command in terminal/CLI.

    (This may be off-topic, but it seems that Restricted Drivers (my ATI driver) cannot work in Ubuntu 7.10, with or without xrandr enabled.)

    hanz

    November 13, 2007 at 6:05 am

  19. Hanz,

    Cool. No it’s not off topic, a very valid point to raise. ATI’s current proprietary drivers do not support Xrandr 1.2 yet; although they will eventually. As such only the open source ATI Radeon and Intel drivers support Xrandr 1.2 (ATI is almost fully supported, Intel driver lacks TV and DVI output at the moment), and Nv (Nvidia 2D driver open source) does but only the GeForce 8xxx series.

    Also Nouveau I believe is a reverse engineer effort for an open source Nvidia 2D/3D driver and whilst very much beta, that also works with Xrandr 1.2; but the closed source Nvidia driver should support Xrandr 1.2 itself at some point.

    I would imagine in a years time all the main drivers will support the combination of Xorg 7.3 and Xrandr 1.2.

    lilserenity

    November 13, 2007 at 12:27 pm

  20. Thank youuuu!!
    This guide helped me set dual head on an ati radeon mobility 9000, I have been trying to set dual head with xinerama…etc……since gusty came out!!! :D thank you thank you :)
    Youre my hero for the week :D (or should be heroine? hehe)

    P.S.:btw… I put a link to this blog in this thread http://ubuntuforums.org/showthread.php?p=3780414#post3780414
    in ubuntu forums, hope you dont mind :)

    bit_racer

    November 16, 2007 at 3:54 am

  21. Bit Racer,

    Glad this helped you out and yeah of course linking is fine :) *blushes* Heroine eh, well I’ve done something right this week hehe. Just glad it helped you out. I have a better version coming out soon that will allow you to get Fn+F7 working as you would expect but time is so short with work consuming a lot of my energy (I get in after eight hours in front of a computer and I don’t feel like doing much after all day in front of one!)

    Thanks again!
    Vicky

    lilserenity

    November 17, 2007 at 12:44 pm

  22. Vicky,
    An interesting thing happened when I did “Full-Screen” of Totem Movie Player: the dual screen setup was undone. One monitor gave the message that the power was not working for it.

    I tried running the xrandr command that gives me dual-screen support ( xrandr –output DVI-1 –left-of DVI-0 ) but that doesn’t help.

    The way I put back dual-screen is by restarting the desktop (alt-shift-backspace).

    hanz

    November 18, 2007 at 2:11 am

  23. Hanz,

    That is odd and shouldn’t happen. I’ll try it at home later. Have you checked on launchpad or Gnome’s website to see if bugs are assigned to Totem with the same issue you have reported? If not it could be really worth doing so as it would see there is something Totem does that disables Xrandr.

    It might also be a direct rendering issue as if the virtual screen size is larger than the card can render to (I think 2048×2048 on a Radeon 7500) then this could also affect things, but this is a hunch more than a definite cause.

    I’ll try it out later and if necessary write up a bug report. (Although two filed recently in Launchpad seem to have been ignored completely, it’s been about a month now…)

    Vicky

    lilserenity

    November 19, 2007 at 1:30 pm

  24. Hello, Vicky.
    I tried running an mpeg in Full Screen in Totem, and everything worked fine this time.

    hanz

    November 27, 2007 at 5:49 am

  25. Brilliant!

    I got fed up with the brittleness of WinXP and the days of effort it takes to restore every time something goes wrong on my laptop.

    So I virtualized my WinXP environment (using VMWare Capture) and installed Gutsy.

    Only thing I had to figure out was how to switch into presentation mode where the output VGA port mirrors the internal screen, so I can use a projector. Your post made that a snap. Many thanks for steering me in the right direction.

    xrandr rocks!

    Andrzej

    December 29, 2007 at 2:45 am

  26. Thanks !
    I had tried for a while to set up my Gateway MX6931 with Ubuntu Gusty and an external Dell 2000FP used as extended monitor. Thanks to you, it works!

    Marzia

    January 9, 2008 at 9:42 pm

  27. I followed a link from ars to here.

    I finally have this working! Thank you.
    I do have the Mobile Intel 910GML Express chipset with GMA 900 on my pavilion dv5000. The only issue left is a little sliver of pixels in the right middle of the screen. It moves from one screen to the other whenever I’m clicking on any windows. Definitely an eye sore. Don’t know how to approach this. Ideas?

    rppp01

    January 26, 2008 at 5:36 am

  28. I find, when I add the virtual line, that X won’t start properly (replaces the original xorg.conf with a minimalistic lo graphics one). This is a recurrent problem for me with many of the standard techniques for doing dual monitors; I wonder if it might not be quirk of the Radeon 9600 PRO card + IBM EV74 monitors. (but xinerama with flgrx drivers does work).

    Avery

    January 29, 2008 at 10:46 pm

  29. Fantastic, this makes my switch from windows complete. Had it installed as a dual boot so I could use extended desktop for presentations via projector.

    With this I don’t need that.

    Pete

    February 13, 2008 at 1:36 pm

  30. > Only downside is PAL does not seem to work at present (scrambled display) but NTSC
    > works fine. Only downside is many CRT PAL TVs will show NTSC in black and white.
    > However some PAL TVs can cope with 60Hz NTSC signals fine. It works great here!

    This should solve it:

    xrandr –output TV –set TV_FORMAT PAL;
    xrandr –output TV –auto;

    Source: http://ubuntuforums.org/showthread.php?t=679059

    Cheers,

    Fredrik

    Motin

    February 13, 2008 at 5:16 pm

  31. Thanks so much for posting this! I was getting really frustrated with my thinkpad. Now it works!

    Daniel

    February 28, 2008 at 1:22 am

  32. Thank you…thank you…thank you.
    Got here from http://ubuntuforums.org/showpost.php?p=4003194&postcount=584
    You’ve brought my sanity back :-)

    Bryan

    February 29, 2008 at 7:32 am

  33. Working on a Toshiba U300-130. Tried a lot of xorg configs, tried 915resolution, but nothing worked (got both screens but with messy resolution). This post and this link – http://www.intellinuxgraphics.org/dualhead.html – solved the problem.

    Thanks a bunch!

    metator

    March 4, 2008 at 10:32 pm

  34. hello!
    i finded this thing “xrandr” on IRC, and i’m interested if it would work on ati radeon x700 se

    knezan

    March 5, 2008 at 5:10 pm

  35. On Xubuntu 8.04, is this still the best way of doing things? Or have things in 8.04 been made more userfriendly?

    hanz

    April 9, 2008 at 10:19 pm

  36. hi vicky, was wondering if you could help me with my problems. i have an acer travelmate 4001 using ubuntu 7.10 (newly installed). the video card is ati radeon 9600. i have tried many ways of trying to connect my hdtv to my laptop to no avail. i want to be able to play my video files full screen on the hdtv using vlc player on my laptop. i tried following a few guides online to install the driver but still no use. i have installed and uninstalled the driver countless times trying to follow the different guides. i am at a complete loss as to what to do. i really hope you will be able to help. thanks very much!

    rock

    April 14, 2008 at 10:03 am

  37. When I have the graphics driver enabled, running “xrandr” in terminal gives the following printout:
    jeff@jc-desktop:~$ xrandr -q
    Screen 0: minimum 320 x 200, current 1600 x 1200, maximum 1600 x 1200
    default connected 1600×1200+0+0 0mm x 0mm
    1600×1200 85.0* 75.0 60.0 100.0
    1440×900 60.0
    1400×1050 60.0
    1280×1024 85.0 75.0 70.0 60.0 47.0 43.0 120.0 100.0 90.0
    1280×960 60.0
    1280×768 60.0
    1280×720 60.0
    1152×864 85.0 75.0 70.0 60.0 47.0 43.0 100.0
    1024×768 85.0 75.0 72.0 70.0 60.0 160.0 150.0 120.0 100.0 90.0
    1024×480 60.0
    960×720 60.0
    864×648 60.0
    856×480 60.0
    848×480 60.0
    800×600 85.0 75.0 72.0 70.0 60.0 56.0 160.0 120.0 100.0 90.0
    720×576 60.0
    720×480 60.0
    704×480 60.0
    640×480 85.0 75.0 72.0 60.0 160.0 120.0 100.0 90.0
    640×400 75.0 60.0
    512×384 60.0
    400×300 75.0 60.0
    320×240 75.0 60.0
    320×200 75.0 60.0
    ———————————————

    How can I still make extended desktop work?

    I have an ATI Radeon X850XT.
    I’m running Xubuntu 8.04 beta.

    jc

    April 21, 2008 at 5:57 am

  38. I’m not sure about Xubuntu, but in Ubuntu there is a very nice “Screen Resolution” preference item that is basically an excellent XRandR gui. I’m using it with an intel X3100 card to much success

    astromme

    April 24, 2008 at 1:25 am

  39. Hi. I was propertly setup dual screen on my laptop HP Compaq 6710b + Ubuntu 8.04
    LVDS – 1280×800
    VGA – 1440×900

    xrandr –output VGA –mode 1440×900 –pos 1024×0 –right-of LVDS

    But! Then i start VGA, my KDE panels moved to VGA screen. And I want all KDE panels on my laptop. How to setup LVDS be my main screen?

    fenidik

    July 24, 2008 at 9:01 am

  40. I have wrote a while ago (and still in development) a GUI for xrandr 1.2.
    It’s called Python-RandR. See http://python-randr.dvdmeer.nl. Unfortunately at the moment only in Dutch.

    Has been tested with intel, opensource radeon and opensource radeonHD. At the moment radeonHD doesn’t support TV- out. The others do.

    With this program you can easily manage your screens. Change resolutions, change tv-format (like PAL and NTSC-M). In a few weeks version 0.7.0 should be released, and is even better. Let me hear if it works for you.

    Greetings from Holland.

    dvdmeer

    October 26, 2008 at 2:55 pm

  41. Very cool. Thanks for the hint about how to get the right numbers for the virtual entry in xorg.conf.

    Now, I can extend my dual monitoring to the TV set :)

    someone

    January 18, 2009 at 11:55 pm

  42. Thanks!

    Tim

    April 30, 2009 at 6:08 pm

  43. I’ve tried al xrandr options mentioned above, but alas!
    As soon as I change the position of one output, the other changes too.
    I have a Radeon X1300 with a DVI and VGA output.
    I’ve just finished a fresh install of jaunty.

    Roald

    May 6, 2009 at 7:46 pm


Leave a Reply