Configuring a dual screen setup - XBMCbuntu (Ubuntu 11.10 LXDE)

Hello folks, not quite a re-post but more of a consolidation of two other threads.

The Request (for anyone new to this thread)
I have built a HTPC/Media Centre PC and have it plumbed into a 42" HD LED Telly via HDMI and a 21.5" LED Monitor via DVI, both directly from the motherboard.
I want to configure the XBMC media program to auto-launch through the HDMI port to the telly on start up.
At the moment I am just getting duplicate displays on both screens. The display on the telly is over size and just the very edge of the task bar is visible. The display to the monitor through DVI is fine.

The story so far
So far the great Mark Greaves (my hero) has been providing much patient help and the latest work through the terminal in ‘recovery’ mode is shown below:

root@Awesome1:/home/smiler# Xorg -configure

Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.

Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.

ddxSigGiveUp: Closing log

root@Awesome1:/home/smiler# sudo mv -v /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
mv: cannot sttat `/etc/X11/xorg.conf’: No such file or directory

root@Awesome1:/home/smiler# sudo cp -v ~/xorg.conf.new /etc/X11/xorg.conf
cp: cannot stat `/root/xorg.conf.new: No such file or directory

I’m guessing that the machine already beleives it is working correctly in the first instance and the OS doesn’t have the xorg program it is looking for in the rest.
Does this make any sense to you Mark?

Regards,

Smiler.

P.S. Yes I did really name the computer Awesome1!

OK, the X server was obviously still running … lets do it another way …

As before, do this with BOTH monitors attached and powered ON.

BE AWARE … You are going to be working from the command line with no GUI for part of this, so write this down, or better yet print it off.
(and remember Linux commands ARE case sensitive)

You’re going to want to create an xorg.conf file whilst both monitors are attached and switched on

Hit Ctrl+Alt+F3 which will drop you to a console (no GUI here, so I hope you wrote this down)

You should now be asked to log on … enter your username and hit enter.
enter your password and hit enter. ← be aware when typing your password the keys repeat very quickly in the console (as in eeee) so only press them briefly.
You should now be at a normal $ prompt.

Run:

sudo /etc/init.d/lxdm stop

then

sudo X -configure

then

sudo mv -v /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

(the above command may fail, but just carry on with the next command)
then

sudo cp -v ~/xorg.conf.new /etc/X11/xorg.conf

When that finishes, run:

sudo /etc/init.d/lxdm start

With a bit of luck, you are now back at your normal desktop and both monitors will be available in Preference>Monitors

If not, try a reboot.


If your system refuses to boot …

Reboot and hold the Shift key as soon as you BIOS POST screen disappears till you are at the GRUB boot screen.

Select “Recovery Mode”, and hit enter.

When you are offered a load of options, use the Tab key to select “Cancel”

You should now be asked to log on … enter your username and hit enter.
enter your password and hit enter.
You should now be at a normal $ prompt.

Run:

sudo mv -v /etc/X11/xorg.conf /etc/X11/xorg.conf.broken

Then reboot with:

sudo reboot

hanks very much, I shall print it off and have a go tomorrow. Of to bed now, it’s a school night. :wink:

Cheers.

Right, I have try’d that.

At the first command I got the response:

do not recognise (or it could have been ‘unable to find’) command: /etc/init.d/lxdm

It’s obviously stumbling at the first hurdle each time.

A quick check on the ubuntu software centre shows the following xorg type program as beig presently installed.

X.Org X Window System

I don’t know if that’s at all relevant, but it doesn’t have a very good rating. Should I remove it and try again?

I presently have no option for Monitors in Preference, should I have one there at the moment?

Many thanks (again),

Smiler.

Just to make sure you have lxdm (with lowercase L) please post the output from:

cat /etc/init.d/lxdm

If that fails then try:

ls /etc/init.d/

Thanks for the reply.

First response:

cat: /etc/innit.d/lxdm: no such file or directory

Second Response,:
lots, in blue and green. It won’t let me cut and paste in the usual manner with the mouse, anything I should look for?

It does have x11-common (in green with lower case x)

Many thanks,

Smiler.

My apologies … it seems (from a quick Google) that XBMCbuntu uses lightdm and not lxdm as the desktop display manager in its LDXE desktop environment.

Try these instead:

Run:

sudo service lightdm stop

then

sudo X -configure

then

sudo mv -v /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

(the above command may fail, but just carry on with the next command)
then

sudo cp -v ~/xorg.conf.new /etc/X11/xorg.conf

When that finishes, run:

sudo service lightdm start

Have done the above. It seemed to accept everything, though failed with the third line as you suspected it might.

However, I cannot see any changes anywhere. No Monitor in Preferences or anywhere else.

I am trying to expand my knowledge but am a bit out of my depth with this.

Regards,

Smiler

What are the contents of your xorg.conf file:

gedit /etc/X11/xorg.conf

??

Results:

Section “ServerLayout”
Identifier “X.org Configured”
Screen 0 “Screen0” 0 0
Screen 1 “Screen1” RightOf “Screen0”
InputDevice “Mouse0” “CorePointer”
InputDevice “Keyboard0” “CoreKeyboard”
EndSection

Section “Files”
ModulePath “/usr/lib/xorg/modules”
FontPath “/usr/share/fonts/X11/misc”
FontPath “/usr/share/fonts/X11/cyrillic”
FontPath “/usr/share/fonts/X11/100dpi/:unscaled”
FontPath “/usr/share/fonts/X11/75dpi/:unscaled”
FontPath “/usr/share/fonts/X11/Type1”
FontPath “/usr/share/fonts/X11/100dpi”
FontPath “/usr/share/fonts/X11/75dpi”
FontPath “/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”
FontPath “built-ins”
EndSection

Section “Module”
Load “dbe”
Load “glx”
Load “dri”
Load “extmod”
Load “dri2”
Load “record”
EndSection

Section “InputDevice”
Identifier “Keyboard0”
Driver “kbd”
EndSection

Section “InputDevice”
Identifier “Mouse0”
Driver “mouse”
Option “Protocol” “auto”
Option “Device” “/dev/input/mice”
Option “ZAxisMapping” “4 5 6 7”
EndSection

Section “Monitor”
Identifier “Monitor0”
VendorName “Monitor Vendor”
ModelName “Monitor Model”
EndSection

Section “Monitor”
Identifier “Monitor1”
VendorName “Monitor Vendor”
ModelName “Monitor Model”
EndSection

Section “Device”
### Available Driver options are:-
### Values: : integer, : float, : “True”/“False”,
### : “String”, : “ Hz/kHz/MHz”,
### : “%”
### [arg]: arg optional
#Option “DRI” # []
#Option “ColorKey” #
#Option “VideoKey” #
#Option “FallbackDebug” # []
#Option “Tiling” # []
#Option “LinearFramebuffer” # []
#Option “Shadow” # []
#Option “SwapbuffersWait” # []
#Option “TripleBuffer” # []
#Option “XvMC” # []
#Option “XvPreferOverlay” # []
#Option “DebugFlushBatches” # []
#Option “DebugFlushCaches” # []
#Option “DebugWait” # []
#Option “HotPlug” # []
#Option “RelaxedFencing” # []
Identifier “Card0”
Driver “intel”
BusID “PCI:0:2:0”
EndSection

Section “Device”
### Available Driver options are:-
### Values: : integer, : float, : “True”/“False”,
### : “String”, : “ Hz/kHz/MHz”,
### : “%”
### [arg]: arg optional
#Option “ShadowFB” # []
#Option “DefaultRefresh” # []
#Option “ModeSetClearScreen” # []
Identifier “Card1”
Driver “vesa”
BusID “PCI:0:2:0”
EndSection

Section “Screen”
Identifier “Screen0”
Device “Card0”
Monitor “Monitor0”
SubSection “Display”
Viewport 0 0
Depth 1
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 4
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 8
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 15
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 16
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 24
EndSubSection
EndSection

Section “Screen”
Identifier “Screen1”
Device “Card1”
Monitor “Monitor1”
SubSection “Display”
Viewport 0 0
Depth 1
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 4
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 8
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 15
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 16
EndSubSection
SubSection “Display”
Viewport 0 0
Depth 24
EndSubSection
EndSection

So is the second monitor working ?

According to that it should now be an extension of the desktop to the right of your normal monitor … isn’t that what you wanted ?

That is what I was after, unfortunately the soaps have started so I can’t check the telly until she’s finished with it. I’ll get back to you when I find out.

Commercial break!

The TV is still just showing a duplicate of the monitor.

I’m wondering if the HDMI output isn’t the one it’s classing as screen 1. The motherboard also has a display port output so maybe that’s presently screen 1? It’s a pity the bios doesn’t give any help.

Try installing ARandR

sudo apt-get install arandr

You’ll the find it in the menu’s at menu>Preferences>ARandR

ARandR is supposed to help in multi-monitor configuration by letting you move the monitors around graphically.

ARandR Screenshot

http://linuxforums.org.uk/MGalleryItem.php?id=1526


You could also try grandr

sudo apt-get install grandr

but you’ll have to start that from the command line with:

grandr

Right, had a play with ARandR with some success, though it’s claiming I have two hdmi ports connected.

I’ll now have a play with the other.

Thanks a lot.

Progress
With ARandR I have been able to set up two screens with the telly acting as an extension of the monitor.

The image on the telly is still over size with the task bar barely visible and I can find no option to correct this. The task bar is extended across both screens but with a bit of fiddling with the task bar settings I’ve managed to get everything to fit into the monitors half of the task bar.

I have opened XBMC in a window, dragged it to the telly and selected full screen. XBMC has a built in callibrator allowing me to adjust the size to fit.

All I need to do now is get XBMC to auto-launch in that position on start up. Within XBMCs settings I have found an option for launching in either a window or to full screen but it will only let me select ‘full screen 1’ which is the monitor. This would appear to be an XBMC issue.

But…
On switching the machine on this morning I was presented with just a single desktop environment again but with half the taks bar missing and nothing on the task bar will respond so I cannot do anything with it (I’m typing this on the wifes laptop). I suspect that installing GRandR when I already had ARandR installed has caused a conflict. Any ideas on how to remove it? I’m suspecting there’ll be a standard terminal command involved.

Thanks
This is deffinately a big step in the right direction though and I owe you a huge debt of gratitude Mark, without you I would have floundered a long time ago. Thankyou for your continued patience and support. I am doing my best to spread the good word of Linux at work and I suspect some of them are thinking if I can get it to work they should be laughing! ;D

Smiler.

Task bar problem now fixed. :slight_smile:

Hopefully removal of GRandR will fix the screens.

Edit: I have discovered that ARandR has simply reverted back to standard setting on boot up. So I need to find a way of changing the setting as I want it and making that the default setting. Or do I need to make ARandR auto-launch with the selected settings on boot up?

Getting there…

You can uninstall GRandR with

sudo apt-get remove --purge grandr

Which will also get rid of any grandr config files.

[EDIT]

I’ll have a look at the arandr and xrandr man pages in a bit … I’m pretty sure their will be a way of saving the config file, and launching it from a command at system startup.

I’ll get back when I’ve found something.

GRandR successfully remove, thanks.

I am trying to dig around the net to learn some of this too, but I’m stuck at home with a poorly son today so busy playing nurse maid (without the outfit) and child minder today.

Wish your son the best, and I hope he recovers quickly.

Anyway … can you run ARandR … set up the monitor/TV combo the way you’d like it … then (still in ARandR) select Layout>Save As

Save it as a file called arandr.sh in your Home directory.

Now I’d like to see the contents of that file, so can you run:

gedit ~/arandr.sh

and post the contents back here.

Because once we/you are happy with the contents of that shell script … it will be pretty easy to run it at system startup.

But I’m also hoping we can tweak the TV screen size in that shell script too.