Automatically clone video output when plugging a VGA cable into a laptop. An "It Just Works" presentation mode.

Bug #306735 reported by Nick Jenkins on 2008-12-10
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
xorg-server (Ubuntu)
Wishlist
Unassigned

Bug Description

Summary:
This is a feature request, requesting that when a VGA cable is plugged into a laptop, that it automatically produces a clone of the laptop screen on the external monitor when the cable is plugged in, without having to do anything / detect anything / change any settings / run any commands, besides physically plugging in the cable.

Background:
I attended an Open Source conference recently (OSDC2008au), and one repeated problem for people giving presentations or lighting-talks on their Linux (generally Ubuntu, typically release 8.10) laptops, was when connecting their laptop to the VGA projector, that the external display required some action to get working. This was usually either through the menus (System -> Preferences -> Screen resolution), or mucking about on the command line ("xrandr --ridiculously --long --list --of --obtuse --command-line --arguments"), or they had to reboot (and have the projector connected when rebooting). It was, frankly, kind of embarrassing. The worst were the lighting talks - you've only got 3 or 4 minutes from when you step up to the podium, and only about 65% of people were able to get their laptops to work in that time, the rest just had to wing it after giving up, and talk but not show their presentation. This is not a satisfactory situation, and it reflects poorly on Ubuntu specifically and on Linux in general, in a very public and humiliating way.

Disclaimers:
* I don't know if there's some way to automatically detect when a VGA cable is plugged in. Obviously this is required. (e.g. on my laptop "xrandr" shows different outputs when the cable is plugged in, and when it's not, but I don't know if there's an event or something that gets generated when this situation changes - hopefully there is, or one could be added).
* The Ubuntu 8.10 feature list / release notes included this line: "X.Org 7.4 brings in hot-plug support for multi-monitor setup - plug-in the external monitor and resolution etc are automatically detected and set". I had (probably mistakenly) assumed that this would mean that in Ubuntu 8.10 I would be able to plug in a VGA cable after booting, and that it would "just work", but I can only report that on my laptop (a Thinkpad T40, with ATI Mobility Radeon 7500 chipset) that it does not work. Also running "xrandr --output LVDS --auto --output VGA --auto --same-as LVDS" or "xrandr --output LVDS --mode 1024x768 --output VGA --mode 1024x768" does not do anything either. Also doing things in System -> Preferences -> Screen resolution does not work either. Pressing Fn-F7 doesn't seem to do anything either. The only thing that I have found that works is to reboot, with the VGA cable plugged in, and that's the only way I have found to get output on the external monitor to work (from memory, I think I can then unplug it and then plug it back in and it will still work, as long as I have not rebooted).
* I don't know if this should be logged upstream somewhere, or if this is a meta bug (number of smaller updates required to achieve a larger objective), or is a bug in specific driver (and everyone else already has this feature - but from observing the conference, I highly doubt it). So I don't know where to log this, but the fact remains that the current situation sucks, so it needs to be logged somewhere, and hopefully it can be improved. If this is in the wrong place, then I apologize, and please direct me to where it should be located, and I'll log it there instead.

Dual desktop setups:
There should be some way to configure this for people that want dual desktop set-ups (i.e. different outputs on laptop screen & the VGA out), but IMHO 95% of the time a VGA cable is plugged into a laptop, it's because a person wants a clone of the desktop, to give a presentation / show somebody something / use a larger monitor. Furthermore, if you want a dual screen setup, then you are typically not under the same time-pressure to get it working (i.e. there is not a room of people sitting there waiting for you), so it's usually less of a problem if it takes longer to configure a dual desktop. But automatically cloning the laptop screen onto the VGA out, as soon as the cable is plugged in, is going to the correct default action around 95% of the time.

Bryce Harrington (bryce) on 2009-02-23
Changed in xorg:
importance: Undecided → Wishlist
Bryce Harrington (bryce) on 2009-03-05
Changed in xorg:
status: New → Confirmed
Bryce Harrington (bryce) wrote :

This has been suggested and attempted several times already.

The problem is that, as I understand it, the way monitors work, they don't send an "I'm here!" signal to the computer that a handler can be attached to.

So, the alternate approach is to have some bit of code periodically poll the video card's outputs to see if anything is connected. And several people have had this idea independently, in X, KDE, GNOME, and elsewhere. Unfortunately, the BIOS call to do this generates a tiny lag in the system, which users note as a "flicker". The way this is typically implemented using xrandr calls also produces xrandr output in Xorg.0.log's, which bloats the file fairly quickly. So needless to say, each of those attempts ended up being reverted.

So that's why automatic detection on plug-in hasn't been possible so far. It is a very, very well known issue. Maybe someone will come up with a more clever solution some day, but it's not a trivial problem.

As far as the other various issues when plugging in monitors, yeah. Lots of known issues. See http://en.opensuse.org/GNOME/Multiscreen as one list I happen to have open in another window right now. Binary drivers seem to show the breakages more frequently than open source drivers, but I don't think there is any configuration that could be considered perfect. A few other issues I'm tracking:

* Need way to add new modes when they're not listed #283986

* Secondary monitor's max resolutions limited to LVDS's maximum 310366

* If disconnect while suspended, X doesn't realize the external monitor is gone. 217968

Anyway, as you can see, while the problem seems like a pretty obvious issue, it is actually a whole amalgam of different hard-to-fix issues. I do appreciate the time you've taken to write up this well written summary of the problem in general; trust me just about all of us X guys wince with you when seeing all the problems people have with projectors.

What I would suggest is instead of a wishlist bug, that you file a blueprint on projector support, and link to relevant bug reports for the specific problems that need solved. The reason I suggest this is not because I don't like wishlist bugs, but because there are many different individual bugs and blueprints provide a superior mechanism for tracking that. Thanks ahead of time.

Changed in xorg:
status: Confirmed → Invalid
Anton Keks (anton-azib) wrote :

Very interesting is that MS Vista somehow manages to detect external monitors without flicker/etc. There is a so-called Transient Multimon Manager (TMM), which polls analog outputs every second. If Vista does that, so could we! I don't get why this is still not a priority to resolve these issues!

Nick Jenkins (nickpj) wrote :

Thank you! The TMM overview document was very interesting and highly relevant to this discussion: http://www.microsoft.com/whdc/system/platform/mobilepc/tmm.mspx
I had never heard of TMM, and have never used Vista, but they have basically captured exactly what I was trying to express in the hypothetical use cases - they even use the phrase "it just works!" :-)

To summarise: they say it works fine with DVI and that for DVI that it works without polling using interruptible HPD. For VGA, they say there are known problems with autodetection, but that they're using periodic DCC polling using the I2C bus, and that it only works for analog displays with EDID support, and that they use non-destructive polling unless requested to detect something by the user, and that non-destructive polling does not cause any visual artefacts or flashing, and that the specific implementation for polling is up to the hardware vendor (maybe it's part of the Windows driver supplied by the hardware vendor?). For VGA polling, it happens once per second or less. There is no polling of TV outputs, and TV-out is not really covered very much, and is doesn't sound like it gets any of the benefits of auto-detection. Hardware must work with TMM in order to get the top level of Vista certification.

Bottom line: It is possible to do this, especially for hardware that already works with this TMM thing. However there would almost certainly be some older or cheaper display adapters that do not work (if there wasn't, Microsoft would have no need for a certification requirement), so there would have to be a white-list of known supported cards, or in X the driver would have to say if the hardware was capable of this. And frankly, that's fine - if the hardware can't do it in a non-obtrusive way, then the hardware can't do it, and that's just the way it is. But, it is definitely do-able, for at least some hardware, and TMM serves as a "proof-by-existence" of this.

Anton Keks (anton-azib) wrote :

Then, it seems that we need to file a proposal to the X guys for making a TMM-like interface that driver developers will need to implement? It seems that it will take lots of time considering the frequency of xorg releases, but at least this is what almost any Linux notebook user needs a lot.

As for a quicker workaround, it should be possible to use xrandr in custom scripts in Ubuntu (possibly having some white list of adapters/monitors), but it would produce crazy growing of the Xorg log, as was mentioned above. I am not sure how is it possible to avoid this logging, can Xorg/drivers be easily patched in order to skip logging in case of such polling?

Or maybe at least we could add a simple panel applet in Ubuntu that will detect connected outputs and set up cloning/change to the sane resolution via xrandr when clicked manually? At least this would simplify life of most users trying to set this up themselves each time they hook to a projector. Or this feature could be added to the existing tray icon that can be enabled from the gnome-display-properties.

The third variant seems pretty doable in very short time.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers