You are not logged in.

#1 2015-04-04 13:58:28

linduxed
Member
Registered: 2008-10-12
Posts: 72
Website

Can't figure how to write Xorg configuration for second screen

Basically I've got the main monitor going as it should, but I can't configure the secondary monitor.

The monitors:

  • Main monitor: 2560x1440, 144Hz, normal rotation, placed to the left.

  • Secondary monitor: 1920x1080, 60Hz, rotated clockwise, placed to the right.

An important detail is that the main screen has a broken EDID (/var/log/Xorg.0.log has errors and warnings about it). Without the lines currently present in my Xorg configuration, X won't start.
This is important to note because I can't rely on Xorg figuring out the monitors on its own (as I've done on most setups the last decade or so).

Here's the current version of /etc/X11/xorg.conf.d/10-monitor.conf:

Section "Monitor"
    Identifier   "DP-0"
    Option       "Primary" "true"
    Modeline     "2560x1440@144" 3322.15 2560 2592 15216 15248 1440 1460 1493 1513
EndSection

Section "Monitor"
    Identifier   "HDMI-0"
    Option       "Rotate" "Left"
    Option       "RightOf" "DP-0"
EndSection

Section "Device"
    Identifier   "Device0"
    Driver       "nvidia"
    Option       "NoLogo"
EndSection

Section "Screen"
    Identifier   "Screen0"
    Device       "Device0"
    Monitor      "DP-0"
    DefaultDepth 24

    SubSection "Display"
        Modes    "2560x1440_144"
    EndSubSection
EndSection

The second "Monitor" section seems to be non-working at the moment, that monitor stays black.
I've tried adding plenty of different things to that, but i can't ever get the secondary monitor going (the main one works).

The following command gets it working, but it's not in the configuration file and I don't how to translate the command:

xrandr --output HDMI-0 --mode 1920x1080 --right-of DP-0 --rotate left

Here's the output from xrandr before running the above command:

Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected (normal left inverted right x axis y axis)
   1920x1080     59.93 +  60.00    59.94    50.00    60.05    60.00    50.04
   1680x1050     59.95
   1280x1024     60.02
   1280x960      60.00
   1280x720      60.00    59.94    50.00
   1024x768      60.00
   800x600       60.32
   720x576       50.00
   720x480       59.94
   640x480       59.94    59.93
DP-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   2560x1440     59.95 + 144.00*  120.00    99.95    84.98    23.97
DP-1 disconnected (normal left inverted right x axis y axis)
DVI-D-0 disconnected (normal left inverted right x axis y axis)
Unknown-0 disconnected (normal left inverted right x axis y axis)

Here's the output from xrandr after running the command above:

Screen 0: minimum 8 x 8, current 3640 x 1920, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1080x1920+2560+0 left (normal left inverted right x axis y axis) 530mm x 300mm
   1920x1080     59.93*+  60.00    59.94    50.00    60.05    60.00    50.04
   1680x1050     59.95
   1280x1024     60.02
   1280x960      60.00
   1280x720      60.00    59.94    50.00
   1024x768      60.00
   800x600       60.32
   720x576       50.00
   720x480       59.94
   640x480       59.94    59.93
DP-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   2560x1440     59.95 + 144.00*  120.00    99.95    84.98    23.97
DP-1 disconnected (normal left inverted right x axis y axis)
DVI-D-0 disconnected (normal left inverted right x axis y axis)
Unknown-0 disconnected (normal left inverted right x axis y axis)

This suggests to me that in my Xorg configuration I should configure the "Screen" section differently, since in the second "xrandr" output, the first line (that starts with "Screen0") contains the resolution "3640 x 1920".
However, when I tried to replace the line "Modes    "2560x1440_144"" with "Modes    "3640x1920"", X didn't start.

Any ideas on how to solve this?

EDIT: Added more information.

Last edited by linduxed (2015-04-05 08:27:11)

Offline

#2 2015-04-04 14:04:39

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Can't figure how to write Xorg configuration for second screen

Drop the Device and Screen sections, the two Monitor sections are enough.

Offline

#3 2015-04-04 14:18:06

linduxed
Member
Registered: 2008-10-12
Posts: 72
Website

Re: Can't figure how to write Xorg configuration for second screen

Oh, forgot to mention that those lines are necessary since the main screen has a broken EDID; the screen won't start without all of the lines written in the OP.

I'll update the OP to reflect this.

Offline

#4 2015-04-04 14:20:11

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Can't figure how to write Xorg configuration for second screen

I kinda doubt that. The Screen section is the one screwing things up I'd say. Instead, add this to the first Monitor section

   Option "PreferredMode" "2560x1440@144"

Offline

#5 2015-04-04 14:25:05

linduxed
Member
Registered: 2008-10-12
Posts: 72
Website

Re: Can't figure how to write Xorg configuration for second screen

If I add that line and comment out all but the two Monitor sections, Xorg won't start.

Offline

#6 2015-04-05 08:27:21

linduxed
Member
Registered: 2008-10-12
Posts: 72
Website

Re: Can't figure how to write Xorg configuration for second screen

Updated OP with more information.

Offline

#7 2015-04-05 08:30:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Can't figure how to write Xorg configuration for second screen

Not an Installation issue, moving to Multimedia...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2015-04-05 09:35:11

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Can't figure how to write Xorg configuration for second screen

I still say you should dump the screen section. Let's go step by step: First, use just one Monitor section and nothing else. It should contain your custom modeline for DP-0 and the PreferredMode option. If X doesn't start, look at the X log and also post it here. We'll go from there. It's possible the Nvidia driver doesn't accept PreferredMode, but it has other options we could use.

Offline

#9 2015-04-05 11:06:08

linduxed
Member
Registered: 2008-10-12
Posts: 72
Website

Re: Can't figure how to write Xorg configuration for second screen

When I have nothing but the following in my configuration:

Section "Monitor"
    Identifier   "DP-0"
    Option       "Primary" "true"
    Modeline     "2560x1440@144" 3322.15 2560 2592 15216 15248 1440 1460 1493 1513
    Option       "PreferredMode" "2560x1440_144"
EndSection

I get the following /var/log/Xorg.0.log.

I also noticed I could drop the "Device" section completely from the original setup and still have it run (when I use the configuration from OP).

Offline

#10 2015-04-05 11:29:14

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Can't figure how to write Xorg configuration for second screen

Your PreferredMode line is wrong, it should be 2560x1440@144, not 2560x1440_144. You see, the numbers are meaningless, what you provide with Modeline is a name. And then everywhere else, you refer to that name. To demonstrate, if the Nvidia driver supports PreferredMode, this will work

Section "Monitor"
    Identifier   "DP-0"
    Option       "Primary" "true"
    Modeline     "ugabuga" 3322.15 2560 2592 15216 15248 1440 1460 1493 1513
    Option       "PreferredMode" "ugabuga"
EndSection

If this doesn't work, we'll try Nvidia's MetaModes option instead of PreferredMode.

About the Device section, you don't need it because selecting the nvidia driver is taken care of by /usr/share/X11/xorg.conf.d/nvidia-drm-outputclass.conf

Last edited by Gusar (2015-04-05 11:31:02)

Offline

#11 2015-04-05 11:41:17

linduxed
Member
Registered: 2008-10-12
Posts: 72
Website

Re: Can't figure how to write Xorg configuration for second screen

Still didn't work. With the following xorg.conf:

Section "Monitor"
    Identifier   "DP-0"
    Option       "Primary" "true"
    Modeline     "2560x1440@144" 3322.15 2560 2592 15216 15248 1440 1460 1493 1513
    Option       "PreferredMode" "2560x1440@144"
EndSection

I get the the following /var/log/Xorg.0.log.

Offline

#12 2015-04-07 23:52:42

linduxed
Member
Registered: 2008-10-12
Posts: 72
Website

Re: Can't figure how to write Xorg configuration for second screen

After looking around some more I've given up on this cause. I've settled for adding an xrandr line to my .xinitrc.

It works good enough, so until I find a compelling reason to investigate this further, this thread won't be getting any updates from me.

Offline

Board footer

Powered by FluxBB