Seamless Monitor Hotplugging with X Windows
There are times when you want to track the bleeding edge of a particular project, and having a new laptop is often one of those moments... I've recently bought an HP Compaq nx6320 and while most of it is working, one of the reasons I got it was because of Keith Packard's work on the RandR extensions for X.
Well, I was definitely seeing this bug but with a small patch I can get the latest (experimental) packages for xserver-xorg-video-intel to work, and now with a few magic tweaks to my xorg.conf I can make my desktop expand to another monitor when I unsuspend at work, and contract back to just the laptop screen when I resume somewhere else.
The Magic Expanding X Config
First of all, when I got the driver to actually work, xrandr explained to me that my maximum resolution was 1400x1400:
Screen 0: minimum 320 x 200, current 1400 x 1050, maximum 1400 x 1400 VGA disconnected (normal left inverted right) LVDS connected 1400x1050+0+0 (normal left inverted right) 305mm x 228mm 1400x1050 60.0*+ 1280x800 60.0 1280x768 60.0 1024x768 60.0 800x600 60.3 640x480 59.9 TV disconnected (normal left inverted right)
Using a few clues from Ross Burton I managed to get that "maximum 1400x1400" to increase. The trick is to add a "Virtual" setting for screen size into your "Screen" Section, like so:
Section "Screen"
Identifier "Default Screen"
Device "Intel 945GM/GMS/940GML"
Monitor "Laptop Panel"
DefaultDepth 24
SubSection "Display"
Depth 24
Virtual 2680 1050
EndSubSection
EndSection
The downside of this is that if you set the width greater than 2048 (as I have here) then DRI won't work, so you won't get 3d stuff. I guess I can manage without ice-cream, just so long as I get my cake!
Once I have the "Virtual" setting, when I resume at the office I can:
xrandr --output VGA --mode 1280x1024 --pos 1400x0
And then when I resume somewhere without the external monitor, I can:
xrandr --output VGA --off
Quibbles
All of these features are kind of under development, but Xorg 7.3 will support this stuff, and then Gnome and suchlike will have to start thinking about how to deal with it. The dynamic screen changing is not something these environments are completely ready for.
One example is that while I know that monitor is always on the RHS of my docking station, X wants it to be the primary monitor and Gnome moves both panels onto that screen. Perhaps that's not a choice that can be made automatically. Someone who had an external keyboard plugged into their docking station might want the opposite behaviour, and there is certainly no way the environment can magically know whether that monitor is left or right of my laptop screen. Eventually I expect that Gnome will recognise this monitor, and will make the panels and location automatically set the RandR environment to match the way I set it last time.
It is also somewhat annoying that I have to actually choose the virtual size. No doubt this configuration will disappear in due course and it is not really surprising to see it for something which is admittedly quite bleeding edge!
I noticed at LCA that Keith had his own screen set for a Virtual size of 2048x2048, and now I know why: that's the maximum size that is supported for DRI, so if I expand my desktop onto a 1280x1024 screen I'm going to have some overlap. In fact I could almost configure my external monitor to be above my normal screen and use it that way, but it would feel pretty weird I think. In the meantime I've gone back to "blank screen" for my screen saver which admittedly is currently the only application for 3d acceleration on my desktop.
Remaining Problems with this Laptop
The only outstanding issues for me with this laptop are:
- Suspend/Resume to RAM does not work (I use suspend to disk)
- Fingerprint Sensor does not work (AuthenTec say Linux support will be available later this year)
That's about the best Linux compatibility I have had for any of my last five laptops within a month of buying it. Most of them have had much more significant stuff less supported even after three years of use!
Suspend to RAM issues.
Could you give me an e-mail and let me know the symptoms of your suspend to RAM issues? Specifically, is it a keyboard / mouse input issue or something else?
s/X Windows/X Window System/
"It is a window system named X, not a system named X Windows." :)
dual monitors
Andrew I stumbled onto your blog via a Google search. I love the work you are doing. Thanks for helping us all out like this. I lived in New Zealand for a few years and then returned home to Kenya after I found I missed home too much but I enjoyed my stay in NZ and earned a much-needed rest there.
My question:
I've just bought an Acer 19" LCD external monitor and hooked it up to my Toshiba T7100 laptop. I've got the monitors sharing screen resources fine with xrandr but my laptop used to be 1280x800 before the setup and now only has the 3 standard VGA resolutions and no matter what I do I cannot seem to get the monitor out of 1024x768 back to 1280x800 even with editing my xorg.conf by hand. Is this a limitation of the OS (mine is Intrepid) or can something be done?
Any help will be greatly appreciated.
Neal
External monitor resolutions
Hi,
I'd love to visit Kenya... Maybe in a year or three - certainly one continent I haven't seen yet. Maybe I'll be able to see it when I visit the south of Spain in July, but it would be great to get there.
When you run xrandr you should be able to see all of the resolutions that are supported by your monitor. For example I recently bought a cheap external 1920x1080 monitor and I use this with a 3m DVI cable so I can run an external (so-called "full hd") 1920x1080 screen for watching movies and stuff with the kids.
To enable the external monitor in 1920x1080 resolution I need to do:
xrandr --output DVI-0 --mode 1920x1080 --right-of LVDS
Of course your mileage may vary...
The only change I had to do to my xorg.conf was to set up the Virtuals line to a resolution larger than the horizontal and vertical total resolution of the desktop when spread across both monitors.
If you are having problems with this the issue may be with your video card. I've done this with Intel video cards, and also using the non-proprietary drivers for AMD / ATI video cards. I'm not sure if it works with the proprietary drivers for these or other cards yet, however.
Regards,
Andrew.