Announcement

Collapse
No announcement yet.

Separate screens with xrandr

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Separate screens with xrandr

    I have a TFT monitor (VGA-0) and an LCD TV (DVI-0) connected to my Radeon X800 card.

    I would like to work on my TFT monitor while showing movies on the TV. So I want a "full-screen" 1280x1024 resolution on the monitor, and a different screen (is this the correct term under X?) with a "full-screen" 1360x768 resolution on DVI-0, where mplayer can run in full-screen mode. (I don't want dual-head/two keyboards and mice, but the same keyboard input for both, and I don't necessarily need mouse input for the TV screen at all.)

    How do I set this up?

    I run (gentoo packages) xf86-video-ati-6.12.1-r1, xorg-server-1.5.3-r6 (RandR version 1.2).

    Neither man radeon nor man xrandr mentions this setup, as far as I can see. And googling for this is almost pointless given how much these things have changed during the last year or so - there's just too much obsolete info to sort through. (The info I have managed to find only covers using a large virtual desktop with the different monitors displaying different parts of it.)

    xrandr --help shows options -display and --screen, but with no indications on how to use them.

    The situation I have right now is both monitors display the same screen, which presents some problems. I can get mplayer to overlay on the TV using -adapter 1, but full screen mode centers the picture as if the resolution was 1280x1024, not 1360x768 (so the picture appears much too low on the TV). Also, since the monintors display the same thing I cannot do other things on the monitor while running the movie on the TV.

    Help, please?

  • #2
    See this page for how to configure dualhead with xrandr:
    http://wiki.debian.org/XStrikeForce/HowToRandR12

    Note, you will probably need to add a Virtual line to your xorg.conf to configure a large enough desktop for dualhead. The gui display tools in most recent distros will also work.

    Comment


    • #3
      Yes, I've seen those instructions, and by following them I get the effect I don't want, with a desktop that's too large for any of the monitors:

      xrandr --output DVI-0 --mode 1360x768
      xrandr --output DVI-0 --below VGA-0

      works, but then I lose the menu bar on my desktop on VGA-0. With DVI-0 --leftof VGA-0 the TV screen instead gets too large vertically, which makes e.g. mplayer fullscreen centering not work.

      How do I get each monitor to display its own fullscreen desktops? (Or the first monitor displaying a desktop and the second one just being empty?) The important thing is that both monitors must display a desktop that is correctly sized for that monitor's resolution.

      (This must be one of the most common usage scenarios, right?)

      Comment


      • #4
        I think that is what's called zaphod mode, not sure what the current level of support is.

        Comment


        • #5
          Originally posted by bitnick View Post
          (This must be one of the most common usage scenarios, right?)
          works for me(tm) with the gui thingy which comes with Ubuntu.(Gnome)
          dont know what you have to hack into the console in order to get the same effect. You could probably look at the source...

          Comment


          • #6
            Part of the problem may be in the player program. On my ubuntu 9.04 laptop I have 1400x1050 on my LCD; first I have to use xrandr set load-detection on to enable the S-Video output. Then I can use the Gnome Display tool to enable the S-Video and put it to the right of the main screen. If I run ffplay in fullscreen mode, it tries to use both screens, half of the image appears on the LCD and a corner appears on the S-Video. If I use totem, it uses the screen where its window was running. So if I had it started on the LCD, it uses just the LCD. If I start it from the S-Video, it only uses that. Which is pretty much the behavior I want it to have. Too bad totem's codecs are slower and drop frames compared to ffplay.

            Something else that's kinda puzzling, xrandr only enables 800x600 mode on my S-Video port. I'm pretty sure in much older distros I was able to use 1024x768 on it, but I can't add-mode for that now, it always fails. I haven't tried 640x480 on it yet, would expect that to have no problems...

            Comment


            • #7
              Originally posted by bitnick View Post
              (Or the first monitor displaying a desktop and the second one just being empty?)
              I use this all the times I watch a movie.
              part of my script:

              Code:
              EXTERNAL_OUTPUT="VGA-0"
              INTERNAL_OUTPUT="LVDS"
              EXTERNAL_LOCATION="left"
              "xrandr --output $INTERNAL_OUTPUT --auto"
              "xrandr --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION"
              laptop is 1280x800, external is 1920x1080, both work at full res.

              Comment


              • #8
                Originally posted by bridgman View Post
                I think that is what's called zaphod mode, not sure what the current level of support is.
                Yes your right. This is the configuration that I use my monitors in, and right now xrandr doesnt support it.

                To setup a zaphod style configuration you have to do it in your xorg.conf. Here is an example.....

                Code:
                Section "ServerLayout"
                	Identifier   "X.org Configured"
                	Screen    0  "Screen0" 0 0
                        Screen    1  "Screen1" Leftof "Screen0"
                	InputDevice  "Mouse0" 		"CorePointer"
                	InputDevice  "Keyboard0" 	"CoreKeyboard"
                EndSection
                
                Section "Files"
                	ModulePath   "/usr/lib64/xorg/modules"
                	FontPath     "/usr/share/fonts/misc/"
                	FontPath     "/usr/share/fonts/TTF/"
                	FontPath     "/usr/share/fonts/OTF"
                	FontPath     "/usr/share/fonts/Type1/"
                	FontPath     "/usr/share/fonts/100dpi/"
                	FontPath     "/usr/share/fonts/75dpi/"
                EndSection
                
                Section "Module"
                	Load         "ddc"
                	Load         "vbe"
                	Load         "GLcore"
                	Load         "bitmap"
                	Load         "dri"
                	Load         "xtrap"
                	Load         "extmod"
                	Load         "record"
                	Load         "glx"
                	Load         "dbe"
                	Load         "freetype"
                EndSection
                
                Section "InputDevice"
                	Identifier   "Keyboard0"
                	Driver       "kbd"
                EndSection
                
                Section "InputDevice"
                	Identifier   "Mouse0"
                	Driver       "mouse"
                	Option	     "Protocol" 	"auto"
                	Option	     "Device" 		"/dev/input/mice"
                	Option	     "ZAxisMapping" "4 5 6 7"
                EndSection
                
                Section "ServerFlags"
                #	Option	     "AIGLX"		"true"
                	Option 	     "AllowEmptyInput"  "false"
                EndSection
                
                Section "Extensions"
                #	Option	     "Composite" 	"true"
                #	Option	     "DAMAGE" 		"true"
                #	Option	     "RENDER" 		"true"
                EndSection
                
                Section "Monitor"
                	Identifier   "Monitor0"
                	Option	     "DPMS"
                	Option       "Monitor-DVI-0" "Monitor0"
                    	Option 	     "PreferredMode" 	"1280x800@75"
                EndSection
                
                Section "Monitor"
                	Identifier   "Monitor1"
                	Option	     "DPMS"
                        Option       "Monitor-DVI-1" "Monitor1"
                    	Option 	     "PreferredMode" 	"1360x768@60"
                EndSection
                
                Section "Device"
                	Identifier   "Card0"
                	Driver       "radeon"
                	Option	     "AccelMethod"	"EXA"
                	Option	     "EnablePageFlip"	"true
                	Option	     "TripleBuffer"	"true"
                	Option	     "DMAForXv"		"true"
                #	Option	     "DynamicClocks"	"on"
                	Option	     "EXAVSync"		"on"
                        BusID        "PCI:1:0:0"
                EndSection
                
                Section "Device"
                	Identifier   "Card1"
                	Driver       "radeon"
                	Option	     "AccelMethod"	"EXA"
                	Option	     "EnablePageFlip"	"true"
                	Option	     "TripleBuffer"	"true"
                	Option	     "DMAForXv"		"true"
                #	Option	     "DynamicClocks"	"on"
                	Option	     "EXAVSync"		"on"
                        BusID        "PCI:2:0:0"
                EndSection
                
                Section "Screen"
                	Identifier   "Screen0"
                	Device       "Card0"
                	Monitor      "Monitor0"
                	SubSection   "Display"
                		Viewport   0 0
                		Depth     24
                	EndSubSection
                EndSection
                
                Section "Screen"
                	Identifier   "Screen1"
                	Device       "Card1"
                	Monitor      "Monitor1"
                	SubSection   "Display"
                		Viewport   0 0
                		Depth     24
                	EndSubSection
                EndSection
                
                Section "DRI"
                	Mode	     0666
                EndSection
                I've commented somethings out that work perfectly fine with one monitor, but dont work with two. You'll have to modify it a bit to make it work with your system

                1: The BusID in the device sections, that'll need to be changed to match your system.
                2: Under the monitor sections, if one of your outputs is on VGA-0 then that'll need to be updated..
                3: The resolutions set in the monitor sections. Make those what you want them to be.
                4: Then you ma not need all the modules that I have set to load. So if you see any modules that you dont need you can remove some. Also this goes for fonts. If you see some fonts you wont use then you get remove them too
                5: And then lastly in the ServerLayout section you'll notice that I have Screen1 LeftOf Screen0. You can also make that RightOf TopOf or BottomOf

                Comment


                • #9
                  Originally posted by highlandsun View Post
                  Something else that's kinda puzzling, xrandr only enables 800x600 mode on my S-Video port. I'm pretty sure in much older distros I was able to use 1024x768 on it, but I can't add-mode for that now, it always fails. I haven't tried 640x480 on it yet, would expect that to have no problems...
                  800x600 is all that has ever been supported for tv-out on r1xx-r3xx cards. No other modes have been implemented yet.

                  Comment


                  • #10
                    The problem seems to be with my window manager (xfce4-4.6). Its display settings applet only recognises one screen. I took a peek at the code and randr-1.2 functionality seems not to be implemented (a lot of code is there but it is ifdef'ed out). So my guess is the WM reports the wrong screen size to mplayer/other applications.

                    duby229> I'll try your setup as soon as I can. Right now I have some trouble with DRM not recognising my card after a kernel upgrade...

                    Comment


                    • #11
                      Yep, I can get Zaphod mode with this setup:

                      Code:
                      Section "ServerLayout"
                      	Identifier     "X.org Configured"
                      	Screen      0  "Screen0" 0 0
                      	Screen      1  "Screen1" Rightof "Screen0"
                      EndSection
                      
                      Section "ServerFlags"
                      	Option "AutoAddDevices" "true"
                      	Option "AutoEnableDevices" "true"
                      	Option "AllowEmptyInput" "true"
                      EndSection
                      
                      Section "Files"
                      	ModulePath   "/usr/lib64/xorg/modules"
                      	FontPath     "/usr/share/fonts/misc/"
                      	FontPath     "/usr/share/fonts/TTF/"
                      	FontPath     "/usr/share/fonts/OTF"
                      	FontPath     "/usr/share/fonts/Type1/"
                      	FontPath     "/usr/share/fonts/100dpi/"
                      	FontPath     "/usr/share/fonts/75dpi/"
                      EndSection
                      
                      Section "Module"
                      	Load  "extmod"
                      	Load  "xtrap"
                      	Load  "glx"
                      	Load  "dri"
                      	Load  "record"
                      	Load  "dbe"
                      EndSection
                      
                      Section "Monitor"
                      	#DisplaySize	  540   350	# mm
                      	Identifier   "Monitor0"
                      	VendorName   "HWP"
                      	ModelName    "HP LP2475w"
                      	HorizSync    30.0 - 94.0
                      	VertRefresh  48.0 - 85.0
                      	Option	    "DPMS"
                      EndSection
                      
                      Section "Monitor"
                      	Identifier   "Monitor1"
                      	VendorName   "PHL"
                      	ModelName    "200WP"
                      	Option	    "DPMS"
                      EndSection
                      
                      Section "Device"
                              ### Available Driver options are:-
                              ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
                              ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
                              ### [arg]: arg optional
                              #Option     "NoAccel"            	# [<bool>]
                              #Option     "SWcursor"           	# [<bool>]
                              #Option     "Dac6Bit"            	# [<bool>]
                              #Option     "Dac8Bit"            	# [<bool>]
                              #Option     "BusType"            	# [<str>]
                              #Option     "CPPIOMode"          	# [<bool>]
                              #Option     "CPusecTimeout"      	# <i>
                              #Option     "AGPMode"            	# <i>
                              #Option     "AGPFastWrite"       	# [<bool>]
                              #Option     "AGPSize"            	# <i>
                              #Option     "GARTSize"           	# <i>
                              #Option     "RingSize"           	# <i>
                              #Option     "BufferSize"         	# <i>
                              #Option     "EnableDepthMoves"   	# [<bool>]
                              #Option     "EnablePageFlip"     	# [<bool>]
                              #Option     "NoBackBuffer"       	# [<bool>]
                              #Option     "DMAForXv"           	# [<bool>]
                              #Option     "FBTexPercent"       	# <i>
                              #Option     "DepthBits"          	# <i>
                              #Option     "PCIAPERSize"        	# <i>
                              #Option     "AccelDFS"           	# [<bool>]
                              #Option     "IgnoreEDID"         	# [<bool>]
                              #Option     "DisplayPriority"    	# [<str>]
                              #Option     "PanelSize"          	# [<str>]
                              #Option     "ForceMinDotClock"   	# <freq>
                              #Option     "ColorTiling"        	# [<bool>]
                              #Option     "VideoKey"           	# <i>
                              #Option     "RageTheatreCrystal" 	# <i>
                              #Option     "RageTheatreTunerPort" 	# <i>
                              #Option     "RageTheatreCompositePort" 	# <i>
                              #Option     "RageTheatreSVideoPort" 	# <i>
                              #Option     "TunerType"          	# <i>
                              #Option     "RageTheatreMicrocPath" 	# <str>
                              #Option     "RageTheatreMicrocType" 	# <str>
                              #Option     "ScalerWidth"        	# <i>
                              #Option     "RenderAccel"        	# [<bool>]
                              #Option     "SubPixelOrder"      	# [<str>]
                              #Option     "ShowCache"          	# [<bool>]
                              Option     "DynamicClocks"	"true"
                              #Option     "VGAAccess"          	# [<bool>]
                              #Option     "ReverseDDC"         	# [<bool>]
                              #Option     "LVDSProbePLL"       	# [<bool>]
                              Option     "AccelMethod"	"EXA"
                              #Option     "DRI"                	# [<bool>]
                              #Option     "ConnectorTable"     	# <str>
                              #Option     "DefaultConnectorTable" 	# [<bool>]
                              #Option     "DefaultTMDSPLL"     	# [<bool>]
                              #Option     "TVDACLoadDetect"    	# [<bool>]
                              #Option     "ForceTVOut"         	# [<bool>]
                              #Option     "TVStandard"         	# <str>
                              #Option     "IgnoreLidStatus"    	# [<bool>]
                              #Option     "DefaultTVDACAdj"    	# [<bool>]
                              #Option     "Int10"              	# [<bool>]
                              #Option     "EXAVSync"           	# [<bool>]
                              #Option     "ATOMTVOut"          	# [<bool>]
                              #Option     "R4xxATOM"           	# [<bool>]
                      	Identifier  "Card0"
                      	Driver      "radeon"
                      	VendorName  "ATI Technologies Inc"
                      	BoardName   "Radeon HD 3870"
                      	BusID       "PCI:1:0:0"
                      	Screen	0
                      EndSection
                      
                      Section "Device"
                      	Identifier  "Card1"
                      	Driver      "radeon"
                      	VendorName  "ATI Technologies Inc"
                      	BoardName   "Radeon HD 3870"
                      	BusID       "PCI:1:0:0"
                      	Screen	1
                      EndSection
                      
                      Section "Screen"
                      	Identifier "Screen0"
                      	Device     "Card0"
                      	Monitor    "Monitor0"
                      	SubSection "Display"
                      		Viewport   0 0
                      		Depth     1
                      	EndSubSection
                      	SubSection "Display"
                      		Viewport   0 0
                      		Depth     4
                      	EndSubSection
                      	SubSection "Display"
                      		Viewport   0 0
                      		Depth     8
                      	EndSubSection
                      	SubSection "Display"
                      		Viewport   0 0
                      		Depth     15
                      	EndSubSection
                      	SubSection "Display"
                      		Viewport   0 0
                      		Depth     16
                      	EndSubSection
                      	SubSection "Display"
                      		Viewport   0 0
                      		Depth     24
                      	EndSubSection
                      EndSection
                      
                      Section "Screen"
                      	Identifier "Screen1"
                      	Device     "Card1"
                      	Monitor    "Monitor1"
                      	SubSection "Display"
                      		Viewport   0 0
                      		Depth     24
                      	EndSubSection
                      EndSection
                      mplayer output is controlled by setting the DISPLAY environment variable. 'DISPLAY=:0.1 mplayer ...' gives output on the second screen.

                      However, DRI is not supported in this mode - from Xorg.0.log: "(WW) RADEON(0): Direct Rendering Disabled -- Zaphod Dual-head configuration is not working with DRI at present. Please use the xrandr 1.2 if you want Dual-head with DRI."

                      This means I also got no xv adaptors, which means no HW scaling of video (there's no overlay on R600). And even my Core2 Duo chokes on full-screen video without HW scaling.

                      So I guess the only option is to make xfce4/wait for xfce4 to become aware of randr type dual-screen? Or is there any hope of getting full support for multiple X Screens with the radeon driver, incl DRI? After all, the "multiple separate screen" approach is what I really want.

                      Edit: Actually, it seems xrandr-1.2 dual screen mode is equivalent to Zaphod mode if only the WM handles it correctly. So perhaps Zaphod support should not be a priority after all. Is Zaphod mode "officially" deprecated? What says the radeon developers?
                      Last edited by bitnick; 07-15-2009, 03:45 PM.

                      Comment


                      • #12
                        Originally posted by bitnick View Post
                        Edit: Actually, it seems xrandr-1.2 dual screen mode is equivalent to Zaphod mode if only the WM handles it correctly. So perhaps Zaphod support should not be a priority after all. Is Zaphod mode "officially" deprecated? What says the radeon developers?
                        It's not well maintained at the moment. It's tested every now and then, but the xserver side breaks more often than the driver side since it's not used much. zaphod should be possible with kms and will be much easier to implement.

                        Comment


                        • #13
                          What would be the benefits of Zaphod mode compared to xrandr multi-screen? I guess what I'm asking is: why support several different ways to do the same thing?

                          Comment


                          • #14
                            Originally posted by bitnick View Post
                            What would be the benefits of Zaphod mode compared to xrandr multi-screen? I guess what I'm asking is: why support several different ways to do the same thing?
                            I don't personally have much use for zaphod, but some people like it. The difference is that with zaphod each head is and independent screen (:0.0 and :0.1). It only becomes one big desktop spanning multiple displays if you run xinerama. In that case it's just like xrandr, but inferior.

                            Comment


                            • #15
                              Originally posted by agd5f View Post
                              The difference is that with zaphod each head is and independent screen (:0.0 and :0.1).
                              ..and as such each screen can run a different colour depth and each screen's applications can vsync to the correct output.

                              mostly useful when your outputs aren't next to each other, i.e. running a monitor and a tv/projector.

                              Comment

                              Working...
                              X