![]() |
[Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - Printable Version Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52) ---- Thread: [Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen (/showthread.php?tid=100806) Pages:
1
2
|
[Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - mossroy - 2011-05-05 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/2010/09/09/intel-core-i3-h264-gpu-acceleration-using-ubuntu-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/tools/EventClients/Clients/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 Code: #! /bin/bash Update April 2012 : For those who would be interested, I updated the script for Ubuntu 12.04 and Unity, on XBMC 11 Eden. See post #8 below - phofman - 2011-06-06 Hi, I have very similar requirements and ended up with almost the same setup. Minor differences of mine: * I disabled compiz only on the second screen (TV), running openbox there instead. * To prevent mouse incidentally moving to the TV and toggling the OSD, the two screens are a few pixels apart. Switching via switchscreen mapped to a multimedia key on my keyboard I followed the description at http://forums.boxee.tv/showthread.php?t=16249 - mossroy - 2011-06-07 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? - phofman - 2011-06-09 mossroy Wrote:Regarding compiz, do you mean that you managed to keep compiz running on the primary screen.Yes, this worked fine: http://forum.xbmc.org/showthread.php?tid=50500&page=2 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 Quote:What do you mean by switching between screens?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. - mossroy - 2011-06-17 Thanks phofman for your answer. 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 : Code: /usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display 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. Maybe it's because I don't have a xorg.conf? - phofman - 2011-07-01 Hi mossroy, 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. - mossroy - 2011-07-01 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... RE: [Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - mossroy - 2012-04-15 I updated the script for Ubuntu 12.04 and Unity, on XBMC 11 Eden. I switch from Unity-3D to Unity-2D (see https://answers.launchpad.net/unity-2d/+question/189486 ) Code: #! /bin/bash It also needs the following disable_screensaver_and_wait_for_xbmc_exit.py Python script : Code: #!/usr/bin/env python This works pretty well, but I still have some tearing problems under Unity 2D. See https://bugs.launchpad.net/ubuntu/+source/unity-2d/+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 RE: [Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - zalaam - 2012-12-29 Hi mossroy & phofman! 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. Some specs info: HDMI1: Samsung SyncMaster245B connected with DVI (1920x1200) HDMI2: LG plasma TV (1280x768) Intel HD Graphic card (Core i3-530) Arch Linux 12.01 with XBMC Eden I don't use compiz, wiiremote etc. so all I need the script to do is to load on the TV. which seems to be impossible (I spent the last 2 days trying to figure it out). Here's the script: Code: #! /bin/bash Code: [ove@arch ~]$ xrandr -q I hope you guys can help, it seems like wmctrl don't move xbmc at all ... RE: [Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - mossroy - 2012-12-30 Hi zalaam, Inside XBMC, did you configure it to window mode (instead of fullscreen, which is the default) ? This is necessary for the script to work RE: [Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - FernetMenta - 2012-12-31 Try this: http://forum.xbmc.org/showthread.php?tid=116996 We have fixed multi-head setups post-Frodo. RE: [Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - zalaam - 2013-01-02 Thanx for the fast reply guys! (2012-12-30, 20:42)mossroy Wrote: Hi zalaam, Yes it's configured to window mode. (2012-12-31, 10:12)FernetMenta Wrote: Try this: http://forum.xbmc.org/showthread.php?tid=116996 Are you sure you posted the correct link FernetMenta? I don't even have AMD ... RE: [Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - FernetMenta - 2013-01-02 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 RE: [Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - zalaam - 2013-01-03 (2012-12-31, 10:12)FernetMenta Wrote: We have fixed multi-head setups post-Frodo. 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. RE: [Linux] Dualscreen : XBMC on secondary screen AND normal Ubuntu on primary screen - fritsch - 2013-01-03 @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 :-) |