[LINUX] Dual-Monitor Setup? Start XBMC on the second screen?
#9
Gamogo Wrote:Hi htpcero.

I too am having some frustrating problems with XBMC on a dual-head setup. My situation is similar, whereby I'd like to have XBMC running (in fullscreen) on one monitor (a large LCD television) and my regular desktop running as usual on my other, primary display - my desktop LCD panel.

The catch for me is that both devices have different resolutions - my television is 1920x1080, and my desktop LCD is 1650x1050. I run these through a dualhead PCI-E nVidia graphics card.

I appreciate the solution you have posted though I do have some questions:

1.) What is your graphics hardware?
2.) Do each of your screens have different resolutions?
3.) When XBMC runs at full screen on one screen, does it not 'center' itself between the two?

One issue I have currently is that when XBMC runs fullscreen (started from my second screen) it straddles the 'middle' of the two screens, rendering the second screen essentially unusable and the output split between BOTH monitors. Think dragging an application window to the middle of both your desktops where both screen intersect, with the remaining screen real estate remaining blank and black. Very odd.

Any feedback from yourself (or others) would be appreciated. I am typing this from work so I'm yet to try your solution, but figured I'd ask my questions anyway Smile

After trying different things for a couple of weeks I found a setup I can live with. I'll describe it below, my recommendation is -only try it if you are ready to spend time tuning your config, and you feel you are a somewhat skilled linux geek

1.) What is your graphics hardware?
nvidia 8600

2.) Do each of your screens have different resolutions?
yes, lcd 1920x1200, tv 1920x1080

3.) When XBMC runs at full screen on one screen, does it not 'center' itself between the two?
no

I'm using ubuntu 9.04. Assume this is for 32-bits. I'm actually using 64-bits and that was another source of pain, but that is not relevant in this thread.

What I did is: I configured manually in xorg.conf two different screens, without using twinview (which I used in the past for several years).

Here's my xorg.conf:

Code:
# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
EndSection

# commented out by update-manager, HAL is now used
#Section "InputDevice"
#    Identifier    "Generic Keyboard"
#    Driver        "kbd"
#    Option        "CoreKeyboard"
#    Option        "XkbRules"    "xorg"
#    Option        "XkbModel"    "pc105"
#    Option        "XkbLayout"    "us"
#EndSection

# commented out by update-manager, HAL is now used
#Section "InputDevice"
#    Identifier    "Configured Mouse"        
#    Option "Protocol" "Auto"
#    Driver "mouse"        #OJO: evdev ya no se usa en Hardy
#    Option "Name" "Logitech USB Gaming Mouse"
#    Option "CorePointer"
#    Option "SendCoreEvents"
#    Option "Buttons" "8"
#    Option "ZAxisMapping" "4 5 7 8"
#    Option "Emulate3Buttons" "false"
#EndSection

Section "Device"
    Identifier     "nvidia0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8600 GT"
    BusID          "PCI:1:0:0"
    Screen          0
    Option         "AddARGBGLXVisuals" "True"
    Option         "AllowGLXWithComposite" "true"
    Option         "RenderAccel"
    Option         "NoLogo" "True"
EndSection

Section "Device"
    Identifier     "nvidia1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8600 GT"
    BusID          "PCI:1:0:0"
    Screen          1
    Option         "AddARGBGLXVisuals" "True"
    Option         "AllowGLXWithComposite" "true"
    Option         "RenderAccel"
    Option         "NoLogo" "True"
EndSection



Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "BenQ G2400W"
    HorizSync       31.0 - 94.0
    VertRefresh     50.0 - 85.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "SHARP HDMI"
    HorizSync       15.0 - 75.0
    VertRefresh     23.0 - 76.0
    Option         "DPMS"
EndSection



Section "Screen"
    Identifier     "Screen0"
    Device         "nvidia0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "metamodes" "DFP-0: 1920x1200 +0+0"
    SubSection     "Display"
        Modes      "1920x1200"
    EndSubSection
EndSection


Section "Screen"
    Identifier     "Screen1"
    Device         "nvidia1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "metamodes" "DFP-1: 1920x1080 +0+0"
    SubSection     "Display"
        Modes      "1920x1080"
    EndSubSection
EndSection


Section "ServerLayout"
    Identifier     "Default Layout"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
EndSection


Section "Module"
    Load           "i2c"
    Load           "bitmap"
    Load           "ddc"
    Load           "extmod"
    Load           "freetype"
    Load           "glx"
    Load           "int10"
    Load           "type1"
    Load           "vbe"
EndSection

Section "Extensions"
    Option        "Composite"    "Enable"
EndSection


The I tweaked compiz so that I doesn't load on the TV screen. I still run compiz in the LCD monitor, but I run openbox (a simpler, faster, window manager), xbmc had problems with compiz 3d effects (and xbmc doesn't need compiz effects, it has its own).

Code:
sudo apt-get install openbox

Code:
sudo gedit /usr/bin/compiz

modify the line that reads:

          COMPIZ_OPTIONS="--ignore-desktop-hints --replace"

and make it look like this:

COMPIZ_OPTIONS="--ignore-desktop-hints --replace --only-current-screen"

After a reboot, execute this in a terminal:
Code:
DISPLAY=:0.1 openbox --replace &

Compiz should be working fine in your computer minitor (assumed to be DISPLAY=:0.0) and you should have openbox in your TV (DISPLAY=:0.1). To get from one screen to another, you can use the mouse. You can not move windows across though.

You can have openbox auto-executed when you log in by adding the line above to System > Preferences > Startup Applications

Next, you can remove the bottom gnome-panel from your TV screen, and the top one you can make either transparent and auto-hide, or you can try removing it too (I had problems, I couldn't remove it)

Now, try launching XBMC like this:

DISPLAY=":0.1" xbmc -fs


If you still want to use your desktop mouse and keyboard on the computer monitor, simultaneously with xbmc, you can use the "wmctrl" hack described in this thread, and for some reason I also had to use the "switchscreen" utility. Here's my launch script:

Code:
#! /bin/bash
# runs xbmc in a normal window, in Screen 1 (TV)
# then it brings it up to full screen
# this is to avoid xbmc trapping the mouse



STATUS=0
WINCLASS=xbmc.bin.xbmc.bin
DISPLAY=:0.1
SLEEPDELAY=1


# disable screensaver
gnome-screensaver-command -i &


/usr/bin/xbmc &

using togglescreen
while [ $STATUS -eq 0 ]
do
  sleep $SLEEPDELAY
  STATUS=`wmctrl -x -l | grep $WINCLASS | wc -l | awk '{print $1}'`
done



wmctrl -x -r $WINCLASS -b toggle,fullscreen &


#displace mouse pointer to the edge before switching screens
/home/htpcero/Desktop/htpcero/Linux/Switchscreen/switchscreen -c 0,1079 1

sleep 3
DISPLAY=:0.0 /home/htpcero/Desktop/htpcero/Linux/Switchscreen/switchscreen -c 0,0 0
sleep 3
DISPLAY=:0.0 /home/htpcero/Desktop/htpcero/Linux/Switchscreen/switchscreen -c 0,0 0


Good luck Smile
Reply


Messages In This Thread
[No subject] - by PureLoneWolf - 2009-05-10, 00:25
[No subject] - by Maxim - 2009-05-10, 00:32
[No subject] - by PureLoneWolf - 2009-05-10, 17:32
[No subject] - by htpcero - 2009-06-10, 06:34
[No subject] - by PureLoneWolf - 2009-06-10, 08:29
[No subject] - by htpcero - 2009-06-13, 17:27
[No subject] - by Gamogo - 2009-06-25, 03:57
[No subject] - by htpcero - 2009-06-25, 07:17
[No subject] - by derek7 - 2009-06-30, 13:08
[No subject] - by Gamogo - 2009-07-08, 05:36
[No subject] - by hieppo - 2009-08-30, 20:44
[No subject] - by htpcero - 2009-08-30, 21:14
[No subject] - by htpcero - 2010-06-17, 04:40
[No subject] - by odt_x - 2010-06-17, 09:36
[No subject] - by htpcero - 2010-06-17, 16:14
[No subject] - by fab31 - 2010-07-12, 14:24
Logout Mark Read Team Forum Stats Members Help
[LINUX] Dual-Monitor Setup? Start XBMC on the second screen?0