Announcement

Collapse
No announcement yet.

Separate screens with xrandr

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

  • #16
    Does anyone run anything other than 24 bit colour depth today?

    Different xrandr outputs can already have different vertical refresh rates. How is application vsync to different xrandr outputs implemented today?

    Comment


    • #17
      Originally posted by bitnick View Post
      Does anyone run anything other than 24 bit colour depth today?

      Different xrandr outputs can already have different vertical refresh rates. How is application vsync to different xrandr outputs implemented today?
      For textured Xv we sync to whichever head more of the video is on, for clone modes, we choose the first crtc. The anti-tearing stuff only works when the dri is enabled, so it won't work with zaphod mode.

      Comment


      • #18
        Originally posted by bitnick View Post
        So I guess the only option is to make xfce4/wait for xfce4 to become aware of randr type dual-screen?

        xfce4 already does, and has for quite a while.

        Adam

        Comment


        • #19
          Ehm... no?

          It handles zaphod mode correctly: the display-settings dialog, accessible through Xfce Menu->Settings->Display, shows two screens and lists their resoutions and frequency correctly. The menu bars are the correct size on Screen 0, and no menu is visible on Screen 1. Apps fullscreen to the correct resolution and position on the different screens.

          Running xrandr dual-screen however, menu bars stretch over the full virtual desktop (so are partly invisible if the monitors are different resolutions). The display-settings dialog shows only one screen, and its resolution seem to be set to the same as the resolution of smallest of the connected monitors. Apps full-screen to the wrong resolution and position.

          Looking at the code (xfce4-settings-4.6.1):

          main.c:
          Code:
          /* not available yet */
          #undef HAS_RANDR_ONE_POINT_TWO

          xfce-randr.c:
          Code:
                  /* TODO: load defaults */
                  randr->mode[n] = 0;
                  randr->rotation[n] = 0;
                  randr->status[n] = XFCE_OUTPUT_STATUS_NONE;
          (this is in xfce_randr_new() which is responsible for filling in data structures that keep info on screens, their modes etc, if I understand the code correctly.)

          Much randr-aware code seems to be in place, but it is not finished, and it does not work correctly today using the functions and structures in "xfce-randr-legacy".

          Comment


          • #20
            Ehm... Yes.

            You can't configure separate xrandr controlled monitors using the xfce4 settings manager (which is fine with me, I configure it statically in xorg.conf), but xfce4 definitely handles window position, panel position, and window maximization properly when using xrandr (at least if you configure the xfwm4 source with the --enable-xinerama option).

            http://68.45.151.98/xfce-xrandr.png

            Notice how the panels extend across the top and bottom of only the first monitor (and I can move it to another monitor by right clicking on the panel and selecting "Customize"). Maximizing a window maximizes it to just the monitor it was on.

            This, of course, assumes that Xorg conveys the correct monitor information via the XINERAMA extension.

            Code:
            [ adamk@sorrow - ~ ]: xdpyinfo -ext XINERAMA | grep head
              head #0: 1280x1024 @ 0,0
              head #1: 1280x1024 @ 1280,0
            EDIT:

            Here's another screenshot, with different resolutions, one panel on one monitor, the other panel on the other monitor:

            http://68.45.151.98/xfce-xrandr2.jpg

            Code:
            [ adamk@sorrow - ~ ]: xdpyinfo -ext XINERAMA | grep head
              head #0: 1280x1024 @ 0,0
              head #1: 1600x1200 @ 1280,0
            xfce4 handles window placement and maximization flawlessly, just as gnome and KDE do.
            Last edited by adamk; 07-16-2009, 09:01 PM.

            Comment


            • #21
              Are you involved in xfce4 development? I'm wondering if anybody's working on the "todo" parts concerning xrandr-1.2 in xfce4, and/or what the plans are for direct, non-XINERAMA support for xrandr multi-head in xfce4.

              If I understood agd5f correctly, XINERAMA was really meant to be used to get an extended desktop with zaphod mode, but some googling tells me it is also used on top of xrandr to report desktop size and configuration to the WM. But it is meant to be replaced completely by the xrandr API?

              Anyway, with only one monitor attached:
              Code:
              $ xdpyinfo -ext XINERAMA
              XINERAMA extension not supported by xdpyinfo
              ...
              number of extensions:    30
              ...
                  XINERAMA
              Code:
              $ xdpyinfo -ext XINERAMA | grep head
              returns nothing.

              So that might be the problem. How do I get the x server to report monitor info via XINERAMA?

              (BTW, I'm happy using the xrandr tool to configure the outputs, i.e. I don't really need to use the xfce4 settings manager, but xfce4 still need to be aware of the current setup, of course.)

              Comment


              • #22
                There's two parts to xinerama, one is the muxer that allows you to use multiple heads as one big screen, the other is the screen geometry hints (how big heads are and how they are oriented). xrandr uses the second to expose the output topology so window managers and desktop environments will do the right thing WRT window placement.

                Comment


                • #23
                  Well, after recompiling xdpyinfo, mplayer, gtk+ and xscreensaver with the xinerama use flag set - things work differently, at least.

                  Xfce4 now insist that my main monitor is the smallest one, the one connected on DVI-1. As long as I use this monitor --right-of DVI-0, everything actually works, except that the menu bars end up on the wrong monitor (the smaller DVI-1 one).

                  If I run xrandr --output DVI-1 --left-of DVI-0, I get the menu on the bigger monitor, but the sizes of the different monitors get mixed up, so that the menu hangs in the air on the bigger monitor, and the background and apps that are fullscreened on the smaller monitor is scaled to the bigger monitor's resolution.

                  Code:
                  $ xrandr --output DVI-1 --right-of DVI-0
                  $ xdpyinfo -ext XINERAMA | grep head
                    head #0: 1680x1050 @ 1920,0
                    head #1: 1920x1200 @ 0,0
                  $ xrandr --output DVI-1 --left-of DVI-0
                  $ xdpyinfo -ext XINERAMA | grep head
                    head #0: 1680x1050 @ 0,0
                    head #1: 1920x1200 @ 1680,0
                  Any ideas? I guess I'd like xdpyinfo to report:
                  head #0: 1920x1200 @ 0,0
                  head #1: 1680x1050 @ 1920,0

                  i.e. the head numbers should be switched.

                  Comment


                  • #24
                    If you want the headas switched then I think all you'll have to do is swap where they plug in.

                    Comment


                    • #25
                      That would work on the computer I've been testing this on - it's got two DVI outputs - but the computer to which I want to connect the TV has one DVI and one VGA connector, which makes switching the connectors more of a problem...

                      Comment


                      • #26
                        I was told that I'd need KMS for Zaphod to work. I have a Radeon 4670. I just gave it try with linux-next, xorg-server 1.6.4 and the git versions of mesa, libdrm and xf86-video-ati. I tried tinkering with the config (and checked against various examples on the web) but one of the monitors always gets no signal. After reading around a bit, I decided to see if I could do without Zaphod. I encountered several problems.

                        First of all, it seems that xf86-video-ati swaps the DVI outputs on my card from how fglrx does it. I don't really care and maybe this is well known but I thought I should mention it.

                        Secondly, nomatter how I tried to swap things around in various parts of the config, the monitor defined as "LeftOf" would always act as the primary one. By this, I mean the gdm login and my main XFCE desktop appears on that monitor. I want it to be the other way round.

                        Fullscreen apps like Neverball always appear on the primary monitor, regardless of which monitor I start them from. I guess this doesn't surprise me but I want to be able to run fullscreen apps on the other one. Is there actually any way to do this without Zaphod, short of messing around with Xephyr?

                        MythTV stretches itself across both monitors! It's supposed to support Xinerama and it actually seems to be aware of two different screens in the config but it still stretches itself across both regardless. When it starts, it actually says something like "Total desktop dim: 3200x1080, with 1 screen[s]". It seems to be as confused as I am.

                        I'd really appreciate some help with this. Tell me what configs to try and what logs to attach. Or maybe I should be looking at xorg 7.5 and/or xorg-server 1.7?

                        Comment


                        • #27
                          There are few caveats, so I have some clarify questions to ask first.

                          1) Do you want to have windows move between the two outputs? (This indicates dual-head or randr based setup).

                          2) How particular are you on the use of a particular player? (This indicates if you are willing to put up with quirks or issues or just want to find something that works).

                          Fundamentally, there are *many* *many* caveats with the software and multiple screens at the moment. And so you need put up with some quirks.

                          Comment


                          • #28
                            1) Not really. I didn't have this with fglrx and I don't really need it. It would be nice to have though.

                            2) MythTV is very important to me, I record and watch almost all my TV with it.

                            I'm having another go now. Will try Xephyr shortly. There's another issue that I forgot to mention. My second monitor is actually a TV capable of 1920x1080. My primary monitor is only capable of 1280x1024. When I set a virtual desktop size of 3200x1080, my bottom XFCE panel does correctly sit at the bottom of the screen (it's not cut off) but auto-hide is broken because when I move my mouse to the bottom, it doesn't appear. I have to make it always show. Maybe this is an XFCE bug but this is another reason why I'd prefer proper Zaphod mode.

                            Comment


                            • #29
                              I see this in the Xorg.0.log when I try Zaphod mode. Does this mean it's confusing my analogue TV out port (which isn't connected) with my two DVI ports? What can I do about that?

                              Code:
                              (EE) RADEON(1):  reusing fd for second head
                              (II) RADEON(1): Output DIN using monitor section DVI-0
                              (II) RADEON(1): Output DIN disconnected
                              (WW) RADEON(1): No outputs definitely connected, trying again...
                              (II) RADEON(1): Output DIN disconnected
                              (WW) RADEON(1): Unable to find initial modes

                              Comment


                              • #30
                                Okay I created a monitor section called DIN, which it's now picking up for that. I've told it to ignore it. Still getting one monitor blank though. If I try to set a mode on the blank monitor, xrandr tells me "cannot find crtc for output DVI-0". Interestingly, the DIN output shows up in xrandr when I'm not trying Zaphod but not when I am trying it, regardless of whether I've set "Ignore" or not.

                                Comment

                                Working...
                                X