I wanted to use see if XBMC could be powered by my PC, while letting me use it normally. Most PCs have enough power for video decoding and web surfing at the same time... My PC is most often on when I want to watch a movie, and it is close enough to the TV to plug it with HDMI.

So I investigated on making it work on dualscreen : XBMC running on secondary screen (through HDMI), and Ubuntu still usable on primary screen (through DVI or VGA).
My PC has an Intel HD Graphic card (Core i5 650), and runs Ubuntu 10.04 (64-bit). I use XBMC 10.1 (Dharma).

I now have something useable and wanted to share my little experience :

XBMC on secondary screen (with Intel graphics card)
I read some posts talking of DISPLAY=:0.1 commands, but it does not seem to work this way on a single Intel Graphic card.
I had to configure XBMC to run in windowed mode (that must configured inside the GUI of XBMC), and make a script to move it to secondary screen.
It uses xrandr to activate HDMI2 (this is the name of my HDMI output. HDMI1 is in fact the DVI output that I use for my main screen).
My TV only handles 720p, so I also chose this resolution instead of 1080p
You might adjust all these settings depending on your hardware/configuration (run xrandr on command-line to see which outputs you have)
After activating HDMI2, the script launches xbmc in the background, wait for its window to appear, then moves it to the secondary screen (my main screen has a resolution of 1600x1200, that's why I need to move it with 1600 pixels on the right). I also resize it to 800x600 so that it fits inside the TV screen.
Then I change it to fullscreen. These window movements are made with wmctrl, which should be installed first :

Code:

sudo apt-get install wmctrl

Use HDMI sound
The HDMI sound does not work with the standard kernel of ubuntu 10.04 (2.6.32.x), but it works with the one of ubuntu 10.10 (2.6.35.x). I installed a version backported for lucid : 2.6.35-25.44~lucid1
For more info, see http://doityourselfhtpc.wordpress.com/20...-and-xbmc/
I did not try to make hardware acceleration work on 10.04 : I'll wait until my next ubuntu upgrade.
For XBMC to use the HDMI output for sound, I had to set the following values :
sound output : HDMI
custom hardware : plughw:0,3
passthrough : hdmi
This way, the sound from XBMC goes to the TV (except for the navigation sounds, but it's not a big problem), and all the other sound of the system goes to the standard sound output of the PC.

Use XBMC and Ubuntu at the same time
With only one X session, the keyboard and mouse are shared between the two screens.
My solution was to use a wiimote to control XBMC : it does not emulate keyboard keys but directly XBMC events. This way, it does not interact with the main screen, and it still works if the XBMC window does not have the focus.
Unfortunately, the xbmc-wiiremote tool currently has issues on a 64-bit (multiple deconnections, and events sent too fast). So I had to recompile it from git : running make in that directory https://github.com/xbmc/xbmc/tree/master.../WiiRemote should give you an executable called "WiiUse_WiiRemote" that you can use instead of xbmc-wiiremote

Disable Compiz
XBMC works with Compiz (at least for my config), but I noticed that it slows down XBMC videos. Even on my Core i5, it makes them jerky : it's really annoying. So the script disables it before launching XBMC

Disable screensaver/powersaving/standby mode
The script tries to disable all the things that can disturb XBMC.
For that to work, it has to save the values of these settings, change them while XBMC is running, and put it back after XBMC is stopped.
For that to work, I also use wmctrl to check if XBMC is still running or not. I poll it every second.
There is a drawback of this method : in some cases (if the computer hangs, in particular), the values will not be put back and the powersaving parameters will be kept disabled. So you should keep these values somewhere in case of you have to set them manually

Put BOINC in standby mode
The script tests if BOINC is installed, and put in standby mode if it is. After XBMC is shut down, it makes it compute again.
That saves some CPU for XBMC

I'm pretty sure this script can be improved : suggestions are welcome.
It is really customized to my context (hardware & software) : you'll probably want to modify it to suit your own needs (consider it as GPL if you want to improve it)
I did not test it on any version of ubuntu, and on any other computer : please give your feedback if necessary

echo "Prepare wiimote connexion"
killall xbmc-wiiremote
xbmc-wiiremote &
# If you use 64-bit version of Ubuntu, you need to use a recompiled version from git because of a bug in amd64 version
#killall -q WiiUse_WiiRemote
#cd ~/dev/xbmc_wiimote/xbmc/tools/EventClients/Clients/WiiRemote/
#./WiiUse_WiiRemote &
#cd ~

That's interesting : could you explain a bit further what you did?
Regarding compiz, do you mean that you managed to keep compiz running on the primary screen.
What do you mean by switching between screens?

If you look at that script for running xbmc, it is am using wmctrl to put xbmc to fullscreen (while it is configured in windowed mode, no borders itself, windows size 1920x1080). wmctrl needs a window manager running. If you disable compiz, you have to run some other WM on the second screen. I chose openbox for its simplicity.

This is my modified script (I am using the xbmc-pvr branch, thus the waiting for tvheadend):

Code:

#! /bin/bash
# Launch XBMC in windowed mode, then use wmctrl to remove the titlebar

If you "jail" your mouse (and thus keyboard) by setting the two screens a few pixels apart in xorg.conf, you cannot move the mouse to the second screen anymore. To do that I am running the switchscreen utility, mapped to one of multimedia keys on my keyboard. I push the key, mouse/keyboard get switched to TV with xbmc. Upon pushing again the mouse/keyboard return to the primary LCD monitor.

Which graphic card do you use? Does it use the open-source Intel driver (included in the kernel) or another one?

In my case, it's an Intel HD Graphics (integrated in my Core i5 650), with the kernel driver.
At least on my config (Ubuntu 10.04, 64 bits), it does not seem to handle the secondary screen as another display (accessible with DISPLAY environment variable).
If I install openbox and run your script, xbmc fails to launch with the following error message :

Maybe I did something wrong, but I can't manage to have 2 different window-managers on the 2 screens.
That also prevents from using your switchscreen utility (I suppose you're talking about http://sampo.kapsi.fi/switchscreen/ ?), because it's also based on different displays.
I also can't have a space between primary and secondary screens when I use the screen preferences of Ubuntu : they have to be stuck to each other.

sorry for the delay. For the script to work you have to have two separate screens configured so that DISPLAY=:0.1 makes sense. I would be surprised if the dual-head intel graphics did not support this standard mode. There is ubuntu gui tool for monitor setup, or you can set it up in xorg.conf, or using the xrandr tool.

Well, it surprised me too. Maybe I did not find the right way to do it.
I used the gui and xrandr, but not xorg.conf (because I don't want the dual-screen to be permanent : I want to easily switch the secondary screen on and off)

Using the DISPLAY=:0.1 feature would make things much more simple for me. If anyone has a hint to make this work on an intel graphic card...

# Inhibit SessionManager
# NB : this can't be done from a shell because the inhibition is "hold" by the
# process that asked for it. In shell, a dbus-send exits just after the inhibition
# So it would uninhibit automatically.
# See http://www.lucidelectricdreams.com/2011/06/disabling-screensaverlock-screen-on.html
print "Inhibit SessionManager"
bus = dbus.SessionBus()
proxy = bus.get_object('org.gnome.SessionManager', '/org/gnome/SessionManager')
screenSaverCookie = proxy.Inhibit("XBMC",dbus.UInt32(0),"XBMC temporarily inhibits the screen saver",dbus.UInt32(8))

This works pretty well, but I still have some tearing problems under Unity 2D. See https://bugs.launchpad.net/ubuntu/+sourc...bug/792315
If I keep Compiz, the videos stutter
If I switch to metacity (including Ubuntu-2D) without Compiz, the videos do not stutter any more, but I have tearing...

In the end, I gave up trying to do everything on the same computer. I found an old notebook (Dell Inspiron 1525 : Intel graphics with HDMI output) and installed it with XBMC on Xubuntu 12.04 : after disabling compositing in xfce, no stuttering and no tearing

I have almost the same setup as you guys, but whatever I do i can't get xbmc to load in full screen on my TV. When I'm running the script it now loads xbmc in full screen on HDMI1, without the script it stretches across the two screens.

wsnipex created the repo originally for AMD but I thought for a test it should do. Reading this thread more carefully I noticed that your distr is Arch and an Ubuntu ppa won't help anyway. In case you want to compile from source:https://github.com/FernetMenta/xbmc

Fresh install of Frodo RC2 and it still doesn't work. I can only choose between windowed and fullscreen #1 (which bring back the same old center across both screens)
Everything else works perfectly in Frodo.

Tried your script mossroy (my modified version) and still no luck.

Hope someone can help on this. I'm considering buying an new dedicated HTPC just to fix this, but I'm hoping that's unnecessary step.

@zalaam:
You can install it freshly as often as you want. This functionality is not in the xbmc version of xbmc.org - use the git tree fernetmenta gave you. As it contains a whole rewrite of those sections responsible for multi monitor output.

You don't have to buy a new htpc, but you should read more carefully :-)