[LINUX] Dual-Monitor Setup? Start XBMC on the second screen?
#14
htpcero Wrote: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


For those brave souls that installed XBMC on Ubuntu Lucid/10.04 fresh-install in a dual-screen desktop+TV install, and were wondering what happened with the olden-times /usr/bin/compiz "shell script" that ubuntu used to use - that script does not exist any more in Lucid.

The nicest way I found to add the "--only-current-screen" startup option to compiz (without resorting to ugly ad-hoc scripts) in 10.04+ is as follows:

sudo gedit /usr/share/applications/compiz.desktop

replace the exec line ("Exec=compiz") with:
Code:
Exec=compiz --only-current-screen

The rest of the stuff is still working fine in Lucid - including screenswitcher and of course XBMC. Currently running Compiz on my LCD/Desktop, and Openbox on my TV hdmi output. Initially I just ran the default compiz in both LCD/desktop and TV however I noticed that all video (VDPAU and non-VDPAU) was showing a strange "tear" line in the middle of the TV display. Problem solved by running openbox on the TV screen.
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