Menu

two screens problem

Help
Tomas J
2007-10-19
2013-04-23
  • Tomas J

    Tomas J - 2007-10-19

    Hello,

    I created 599-LIRC-Marmitek-Default.py to control gnome, but I wanted to leave LIRC control over mplayer so I created 511-LIRC-Marmitek-Mplayer.py where all the matching events are processed with "return True" and it works, all the events are ignored when mplayer is running (and are instead processed using .lircrc).

    However I have my X11 configured with two screens (one for tvout) and I can control gnome perfectly as on the first screen, but when I run mplayer on second screen the events don't appear to get to 511-LIRC-Marmitek-Mplayer.py to be processed out and I control gnome and mplayer at the same time.

    How could this be solved?

    Thank you very much.

    PS.: Anyway great work! I just switched to Ubuntu from windows two days ago and didn't even hope that my remote is going work. So thanks for that.

     
    • Tomas J

      Tomas J - 2007-10-19

      To save you some debugging I found out, that Gizmod.CurrentFocus.WindowName on main screen gives "MPlayer" when mplayer focused, while on tvout it gives "Krusader" (where I ran it from) even though mplayer is in focus.

      Thanks again.

       
      • Tim Burrell

        Tim Burrell - 2007-10-20

        Hey Tomas,

        Are you using Xinerama, or separate X screens?  Ie can you drag windows from one screen to the other?

        Thanks,

        Tim.

         
    • Tomas J

      Tomas J - 2007-10-20

      Hello,

      I don't really know what Xinerama is, but in the manual they were calling the set up I have separate X screens (I cannot drag windows from one screen to the other and to run app on second screen I have to use DISPLAY=:0.1). Anyway just to be sure here is the interesting part of my xorg.conf:

      Section "Device"
          Identifier    "Device[0]" #"nVidia Corporation NV34 [GeForce FX 5200]"
          Driver        "nvidia"
          BusID        "PCI:3:0:0"
          Option        "NoLogo" "1"
          Screen 0
      EndSection

      Section "Device"
          Identifier     "Device[1]"
          Driver        "nvidia"
          BusID        "PCI:3:0:0"
          Option        "TVOutFormat" "Composite"
          Option        "TVStandard" "PAL-B"
          Option        "ConnectedMonitor" "Monitor[1]"
          Screen 1
      EndSection

      Section "Monitor"
          Identifier    "Monitor[0]" #CRT
          Option        "DPMS"
          HorizSync    28-95
          VertRefresh    43-95
          # 1024x768 @ 85.00 Hz
          #Modeline "1024x768_85.00" 97.41  1024 1072 1192 1416  768 768 771 809 -HSync +VSync
      EndSection

      Section "Monitor"
          Identifier    "Monitor[1]" #TV
          HorizSync 30-50
          VertRefresh 60
      EndSection

      Section "Screen"
          Identifier    "Screen[0]"
          Device        "Device[0]" #"nVidia Corporation NV34 [GeForce FX 5200]"
          Monitor        "Monitor[0]"
          DefaultDepth    24       
          SubSection "Display"
              Depth        24
              Modes        "1600x1400" "1280x1024_85" "1152x900" "1152x864" "1024x768" "832x624" "800x600" "720x400" "640x480"
          EndSubSection
      EndSection

      Section "Screen"
          Identifier     "Screen[1]"
          Device         "Device[1]"
          Monitor        "Monitor[1]"
          DefaultDepth    24
          Subsection "Display"
              Depth 24
              Modes "640x480_60"
          EndSubSection
      EndSection

      Section "ServerLayout"
          Identifier    "Default Layout"
          Screen 0 "Screen[0]"
          Screen 1 "Screen[1]" RightOf "Screen[0]"
          InputDevice    "Generic Keyboard"
          InputDevice    "Configured Mouse"
          InputDevice    "LIRC-Mouse"
          InputDevice     "stylus"    "SendCoreEvents"
          InputDevice     "cursor"    "SendCoreEvents"
          InputDevice     "eraser"    "SendCoreEvents"
      EndSection

      Thanks for a quick reply,

      Tomas.

       
      • Tim Burrell

        Tim Burrell - 2007-10-20

        Okay in order for gizmod to do what you want you'll need to use Xinerama.  Which honestly is way better anyway.  Two separate screens is a bit annoying.

        Basically if you want to run gizmod with your setup you'd need to run two instances of gizmod, and neither of them will know about apps on the difference screens.  I could modify gizmod to work like this, but I personally won't be going that route.  I don't think it's the right direction to go.

        I have a feeling that you'd be a lot happier with a xinerama setup.  Since I notice you have an nvidia card, it should be simple as pie.  Nvidia has something called "twinview" which is their hardware version of xinerama (twinview actually provides xinerama extensions).

        Your distro likely has a built in GUI configuration tool for setting up your monitors, and it will undoubtedly use twinview if you have an nvidia card.  If you're using a distro that doesn't have such a tool (like Gentoo), there is the nvidia provided nvidia-settings application that will actually create a nice xorg.conf for you with the appropriate settings.

        Or if you want to do it manually just google "nvidia twinview howto" or something like that.

        Once you get your dual monitor setup working with twinview gizmod will work like a charm.  I have a dual monitor setup and this is the method I use, so I can guarantee it'll work :).

        Keep me posted on how it goes!

        Thanks,

        Tim.

         
    • Tomas J

      Tomas J - 2007-10-20

      Well first of all, thanks a lot for such a great support!

      The thing is, I tried twinview (didn't know about xinerama though) but since my TV is in the living room, I don't have a possibility to see both screens at the same time to be able to move mplayer (or something else) from the first screen to the second one every time I launch it (unless there is a simple way how to ensure that the application will appear on the screen I want it to be, like DISPLAY=:0.1) :(. Therefore I find two separate screens much more easily manageable for me.

      On windows (twinview) I was solving it by installing totalcommander and mplayer twice as they would remember on which screen to appear (mplayer did this automatically, for totalcommander I needed to use different config file). This could be a solution as well, but didn't try how the twinview in linux behaves yet and first of all I don't really know how I would install mplayer and krusader twice (or run them with different config files - but it must be possible if they the store info about the window position).

      If you would know how to make it work like this in twinview, I would be really happy to use twinview. Otherwise could you please explain how could I make it work with two instances of gizmod? But if there is a need to modify gizmod just for this purpose, then maybe it is too much trouble just for my whimsical convenience :).

      Thanks again,

      Tomas.

       
      • Tim Burrell

        Tim Burrell - 2007-10-20

        Hey Tomas,

        This is definitely possible with twinview.  First of all, you can use a window manager that remembers window positions like enlightenment, fluxbox, or compiz-fusion.  I think kde and gnome might have options for this but I can't remember.

        I use compiz, and it's got a great window rules plugin that lets you specify every little detail about where you want windows to open up should you desire to do this.

        But, even without changing window managers it's still possible.  Mplayer has the -xineramascreen option that lets you specify which screen you want it to start on.

        After thinking about it I decided it's not possible to run two instances of gizmod at once.  The program itself can do this, but it's not practical.  Think about the situation where you're using a remote control.  If both instances are reading the remote each keypress is basically going to do one action per running instance of gizmod.  Definitely not what you want :).

        So ultimately -- if you want to use gizmod you'll need to find a way to make twinview work (and I do believe it's not only possible, but not difficult at all).

        If you do decide to go back to twinview, feel free to post again if you run into any issues.  I may be able to help, as I've got a similar setup -- dual monitor system where I use one screen for MythTV and movie watching, plus remote control use, and so forth.

        Tim.

         

Log in to post a comment.