You are not logged in.

#1 2014-07-03 17:20:04

jugg
Member
Registered: 2014-07-03
Posts: 14

How to configure external monitor on boot not to be in clone mode?

When booting my laptop (Samsung Series 9 - intel video) without an external monitor plugged in, xrandr shows:

$ xrandr
Screen 0: minimum 8 x 8, current 1600 x 900, maximum 32767 x 32767
eDP1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 293mm x 165mm
   1600x900      60.11*+
   <snip>
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)

That is fine.

I then plug in my external monitor and run:

$ xrandr --output HDMI1 --auto --right-of eDP1

xrandr shows:

$ xrandr
Screen 0: minimum 8 x 8, current 3520 x 1200, maximum 32767 x 32767
eDP1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 293mm x 165mm
   1600x900      60.11*+
   <snip>
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1200+1600+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   <snip>

That is also fine.

When booting with an external monitor plugged in, xrandr shows:

$ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 32767 x 32767
eDP1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 293mm x 165mm
   1600x900      60.11*+
   <snip>
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   <snip>

Not so fine.

The issue is the Screen 0 size being set to "1920 x 1200" when booting with the external monitor plugged in.  ie - the same thing as booting with the external monitor disconnected then plugging it in and executing

$ xrandr --output HDMI1 --auto

without --right-of eDP1.

Ok, so I create /etc/X11/xorg.conf.d/30-monitor.conf

Section "Monitor"
  Identifier "HDMI1"
  Option "RightOf" "eDP1"
EndSection

And I reboot. Now xrandr shows:

$ xrandr
Screen 0: minimum 8 x 8, current 3040 x 900, maximum 32767 x 32767
eDP1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 293mm x 165mm
   1600x900      60.11*+
   <snip>
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1440x900+1600+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95 +
   <snip>
   1440x900      59.90* 
   <snip>

Not so fine.  It didn't auto select the native resolution, but instead set the external monitor resolution to the same as the internal laptop display.

At this point if I execute xrandr with or without --right-of eDP1:

$ xrandr --output HDMI1 --auto

the resolution for the external monitor is set properly, and stays in the proper position at right-of eDP1.

$ xrandr
Screen 0: minimum 8 x 8, current 3520 x 1200, maximum 32767 x 32767
eDP1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 293mm x 165mm
   1600x900      60.11*+
   <snip>
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1200+1600+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   <snip>

So, how to have both displays come up in their native resolutions with the external monitor being set to right-of the internal display?  ie the Screen 0 size be either "1600 x 900" or "3520 x 1200" when booting depending on whether or not the external monitor is plugged in when booting?

UPDATE:

I've submitted a related bug report here: https://bugs.freedesktop.org/show_bug.cgi?id=82205

Last edited by jugg (2014-08-06 22:21:30)

Offline

#2 2014-07-03 17:25:24

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: How to configure external monitor on boot not to be in clone mode?

I have xrandr commands in my "~/.xinitrc" file that force my monitors to be configured the way I want them to be. Would that work in your scenario?

Offline

#3 2014-07-03 17:37:48

jugg
Member
Registered: 2014-07-03
Posts: 14

Re: How to configure external monitor on boot not to be in clone mode?

drcouzelis wrote:

I have xrandr commands in my "~/.xinitrc" file that force my monitors to be configured the way I want them to be. Would that work in your scenario?

Thanks, but that has been my current approach.  I'm now looking for a way to not have the monitor(s) switch resolutions during startup/login.

I fiddled with setting a "Screen" section in the xorg configuration, but that seemed to rabbit trail down to having too much manual configuration of settings that already are auto detected/configured.

Offline

#4 2014-07-03 18:14:54

jugg
Member
Registered: 2014-07-03
Posts: 14

Re: How to configure external monitor on boot not to be in clone mode?

Ok, I've updated my 30-monitor.conf with

Section "Monitor"
  Identifier "HDMI1"
  Option "RightOf" "eDP1"
  Option "PreferredMode" "1920x1200"
EndSection

and that solves the problem for this specific monitor.  However, I often plug my laptop into a TV or other HDMI displays, and want it to use the native resolution of whatever display device is being plugged in.  So a Option "PreferredMode" "native" type of thing would be great...

I'd still like to find a generic solution to this problem  - "How to configure external monitor on boot not to be in clone mode" with the caveat that the monitors also are in their native resolutions.

I guess I don't quite understand why what resolution is selected at boot is any different than what $ xrandr --output HDMI1 --auto produces with the applied options from the xorg configuration.

Offline

#5 2014-07-05 17:35:18

jugg
Member
Registered: 2014-07-03
Posts: 14

Re: How to configure external monitor on boot not to be in clone mode?

I made further progress here by setting the external monitor as the primary and then positioning the monitors manually.  And since the positioning is based off the laptop display, it is independent of what external display is plugged in.

The drawback is the side affects on the window manager of setting the external monitor as primary, but for my use case, not too big of a deal.

So for whatever reason when the HDMI1 monitor is not the primary but the Monitor Section contains any positioning options, according to the Xorg log, the intel driver kicks off a probing of all connected monitors which results in the wrong resolution set for HDMI1, although all of the modelines it spits out are seemingly proper.  It just chooses the wrong one.  Setting the external display as the primary somehow corrects this.

Section "Monitor"
  Identifier "eDP1"
  Option "Position" "0 0"
EndSection

Section "Monitor"
  Identifier "HDMI1"
  Option "Primary" "true"
  Option "Position" "1600 0"
#  Option "RightOf" "eDP1"
EndSection

So, at this point I think a bug report is the next step, unless someone has any further input here.  Although I don't know if it should be against the intel driver or if the issue is in common code. Thanks.

Offline

Board footer

Powered by FluxBB