I have a single HDTV attached to a single video card by two connections - VGA and HDMI through a receiver. HDMI is preferential for convenience. I only need VGA occasionally as it matches the native resolution.
Both outputs work, and HDMI (rather, what Displays sees as 'Onkyo') is set to primary with VGA ('Samsung TV') off. This works correctly at boot and most of the time.
However, if Ubuntu locks/turns off the display after turning off the tuner and TV, the login screen and post-login output will go over VGA instead of HDMI. If the display/screen lock does not kick-in then this does not happen. The problem appears to be independent of the order in which they are switched on again. Simply running xrandr without arguments appears to fix the issue, as if the HDMI connection is not properly detected.
I am running 13.04 with an ATI Radeon HD 4850, open source drivers. How can I make sure the HDMI connection is selected as primary again all the time?