You are not logged in.

#1 2022-01-19 21:13:54

manos00
Member
Registered: 2022-01-19
Posts: 4

[SOLVED] Second monitor disabled on boot

So I tried to figure out how to use a second monitor, and got read the arch wiki page on Multihead.
I got it to work after a few minutes using the following command:

xrandr --output DVI-D-0 --mode 1680x1050 --output HDMI-0 --mode 1920x1080 --right-of DVI-D-0

As you might have guessed from the command above I use and older monitor, connected via DVI-D and another one, connected via HDMI, which I want to use as my primary.
I run awesomewm as a window manager and lightdm as a login manager (which doesn't really matter, I think).
The Problem is that whenever I start an X server (I hope that's right terminology) using lightdm or startx, my configuration is gone.

What I've tried:
- creating a configuration at /etc/X11/xorg.conf.d/20-monitor.conf
contents:

Section "Monitor"
        Identifier  "DVI-D-0"
        Option      "PreferredMode" "1680x1050_60"
EndSection

Section "Monitor"
        Identifier  "HDMI-0"
        Option "PreferredMode" "1920x1080_60.00"
        Option      "RightOf" "DVI-D-0"
        Option      "primary" "true"
EndSection

- moving/copying the config from /etc/X11/xorg.conf.d/20-monitor.conf to /usr/share/X11/xorg.conf.d/20-monitor.conf
- first running the command mentioned at the beginning, then running nvidia-xconfig (also tried deleting /etc/X11/xorg.conf and generating a new one instead of merging)
- disabling my login manager (as mentioned earlier) and start X server manually

I'm not sure if I should try to edit /etc/X11/xorg.conf and I also dont know how.
What I know is that nvidia-xconfig edits/creaters /etc/X11/xorg.conf. Also, even if I generate the xorg config while both monitors are working, only one monitor is listed in the file.
/etc/X11/xorg.conf for context:
http://ix.io/3MPh

Additional info:
- login manager appears on the DVI-D connected screen, while the other one stays black (still gets a signal though, i think)
- when i boot without GUI both monitors show the same terminal, then starting the x server disables the hdmi one

I hope someone can help me with the info I've given. Also I'm from Germany so please excuse my English if I'm grammatically wrong.

Kind regards

Manos

Last edited by manos00 (2022-01-20 16:05:50)

Offline

#2 2022-01-20 06:40:35

boban_dj
Member
Registered: 2015-03-17
Posts: 150

Re: [SOLVED] Second monitor disabled on boot

I use xfce session manager and put the xrandr command there on autostart.

Screenshot-2022-01-20-07-28-20.png

xrandr --output DVI-I-0 --mode 1600x1200 --pos 0x0 --rotate normal --output DP-4 --primary --mode 1920x1080 --pos 1600x0 --rotate normal --output DP-6 --mode 1920x1080 --pos 3520x0 --rotate normal

My setup is 2 windowmanagers, no display manager.
i3,xfce4 and start X11 from .bash_profile with

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

and in .xinit I have

exec startxfce4

and from session manager xfce4 again I just start i3.

Last edited by boban_dj (2022-01-21 07:39:35)

Offline

#3 2022-01-20 08:41:57

seth
Member
Registered: 2012-09-03
Posts: 51,011

Re: [SOLVED] Second monitor disabled on boot

The /etc/X11/xorg.conf will render your monitor configlets irrelevant. Since you're not encouranged to use a static server layout, let alone the garbage that nvidia-settings generates, start by removing that file and don't re-create it.
/etc/X11/xorg.conf.d/20-monitor.conf is fine, the "PreferredMode" options are likely ignored and while it's supposed to be default you could add

Option	"Enable"	"True"

to either section.

You can inspect the xorg log on whether it worked.
Do you lose the second output in lightdm or only when starting the session?

@boban_dj, please replace the oversized image w/ a link (250x250 max) and also your xinitrc is broken (see the last link below, 2nd blue note)

Online

#4 2022-01-20 14:16:52

manos00
Member
Registered: 2022-01-19
Posts: 4

Re: [SOLVED] Second monitor disabled on boot

seth wrote:

The /etc/X11/xorg.conf will render your monitor configlets irrelevant.
Since you're not encouranged to use a static server layout, let alone the garbage
that nvidia-settings generates, start by removing that file and don't re-create i
t.
/etc/X11/xorg.conf.d/20-monitor.conf is fine, the "PreferredMode" options are like
ly ignored and while it's supposed to be default you could add

Option    "Enable"        "True"

to either section.

I deleted the nvidia generated config and added the "enable" option you mentioned, however it's still not working. I've found something pretty interesting though:
In the xorg x server log I found this:

[     3.811] (==) Using config directory: "/etc/X11/xorg.conf.d"
[     3.811] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     3.812] (==) No Layout section.  Using the first Screen section.
[     3.812] (==) No screen section available. Using defaults.
[     3.812] (**) |-->Screen "Default Screen Section" (0)
[     3.812] (**) |   |-->Monitor "<default monitor>"
[     3.812] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.

Full log here
I again copied my custom config to /usr/share/X11/xorg.conf.d but this didn't change anything either.
I thought i needed to append a Layout and a screen section to my config, so I tried by generating a new xorg.conf using nvidia-xconfig as reference, but still with no success (here's the config; I have no idea what I'm doing at this point, which is why it didn't work I guess)

seth wrote:

You can inspect the xorg log on whether it worked.
Do you lose the second output in lightdm or only when starting the session?
(see the last link below, 2nd blue note)

I don't know why but after I disabled and enabled lightm.service, it magically showed my wallpaper on both monitors and, what to me was the most confusing, the login box on my primary monitor. I don't know what happened but I guess "turning it off and back on again" worked like a charm. smile

Thanks for the tips though!

Offline

#5 2022-01-20 14:23:25

manos00
Member
Registered: 2022-01-19
Posts: 4

Re: [SOLVED] Second monitor disabled on boot

boban_dj wrote:

I use xfce session manager and put the xrandr command there on autostart.

https://i.ibb.co/7pJfwC8/Screenshot-202 … -28-20.png

xrandr --output DVI-I-0 --mode 1600x1200 --pos 0x0 --rotate normal --output DP-4 --primary --mode 1920x1080 --pos 1600x0 --rotate normal --output DP-6 --mode 1920x1080 --pos 3520x0 --rotate normal

My setup is 2 windowmanagers, no display manager.
i3,xfce4 and start X11 from .bash_profile with

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

and in .xinit I have

exec startxfce4

and from session manager xfce4 again I just start i3.

First of all thanks for the reply!
I have also thought about running the command at startup, but decided to try and find a cleaner solution, as there are several problems with this solution:
1. The login manager will still be on the wrong screen (edit: login manager fixed itself either way)
2. I would have to delay other autostart programs I use, such as polybar and nitrogen, so that they use the right monitor too

Still thanks for helping! I may use this as a temporary solution as I try to find a "better" one. smile

Offline

#6 2022-01-20 14:31:11

seth
Member
Registered: 2012-09-03
Posts: 51,011

Re: [SOLVED] Second monitor disabled on boot

The xorg log wrote:

[     4.866] (**) NVIDIA(0): Option "Enable" "true"
[     4.866] (**) NVIDIA(0): Option "Primary" "true"

http://ix.io/3MTY wrote:

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "HDMI-0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

You're only referencing one monitor in the output - that's not gonna help.

Section "Monitor"
	Identifier	"DVI-D-0"
	Option		"Enable" "true"
	Option		"PreferredMode" "1680x1050"
EndSection

Section "Monitor"
	Identifier	"HDMI-0"
	Option		"Enable" "true"
	Option		"PreferredMode" "1920x1080"
	Option		"RightOf" "DVI-D-0"
	Option		"Primary" "true"
EndSection

shouls suffice in any event.

https://wiki.archlinux.org/title/LightD … ng_monitor
Might be an outcome of lightdm getting ahead of itself, you could try https://wiki.archlinux.org/title/LightD … TTY_output

Online

#7 2022-01-20 16:05:29

manos00
Member
Registered: 2022-01-19
Posts: 4

Re: [SOLVED] Second monitor disabled on boot

seth wrote:
Section "Monitor"
	Identifier	"DVI-D-0"
	Option		"Enable" "true"
	Option		"PreferredMode" "1680x1050"
EndSection

Section "Monitor"
	Identifier	"HDMI-0"
	Option		"Enable" "true"
	Option		"PreferredMode" "1920x1080"
	Option		"RightOf" "DVI-D-0"
	Option		"Primary" "true"
EndSection

should suffice in any event.

You were right. My config should suffice in any event. Turns out I'm incredibly stupid.
I was looking into logs further and noticed an error in my .xinitrc. The funny thing is, that  the cause of this error wasn't even the problem.  I forgot, that I had a copy-pasted line of code at the bottom of the file which reads

[nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeli
ne = On }"

to reduce screen tearing. Obviously it contains the phrase

nvidia-auto-select

, which was constantly overwriting my config, as it was on the very bottom of .xinitrc right before my window manager is launched.
I'm sorry that I wasted your time, but thankful for the things I've learned through your help.
That being said my warm thanks goes to you for helping me solve my problem!
Kind regards
Manos

Offline

#8 2022-01-21 07:44:14

boban_dj
Member
Registered: 2015-03-17
Posts: 150

Re: [SOLVED] Second monitor disabled on boot

@seth,adjusted the image,and thanks for the tip on the .xinitrc. You mean the if block yes?
@manos00, you never waste time when making mistakes,learning or asking questions

Offline

#9 2022-01-21 08:24:18

seth
Member
Registered: 2012-09-03
Posts: 51,011

Re: [SOLVED] Second monitor disabled on boot

boban_dj wrote:

You mean the if block yes?

Yup.
You should now also be able to mount external partitions using udisks and shutdown the system w/o root privileges.

Online

#10 2022-03-09 06:57:26

leshyleshy
Member
Registered: 2020-02-04
Posts: 15

Re: [SOLVED] Second monitor disabled on boot

Hey guys,

Sorry for reposting here on a solved thread but I thought this would be better than making a new post since my problem is pretty much identical, updated recently and nvidia redid my x configs now my other  VGA screen wont show up when x launches, not sure what changed, but I know its not broken because my BIOS splash screen shows up on the VGA when my computer is booting. Anyway I am not really sure what changed, so any advice would be appreciated.

xrandr : https://dpaste.com/HCVZE3G3M
Xorg.log.0: https://dpaste.com/B4BDEKFSE
xorg.conf: https://dpaste.com/BA3GDP3U2

Offline

#11 2022-03-09 07:11:59

seth
Member
Registered: 2012-09-03
Posts: 51,011

Re: [SOLVED] Second monitor disabled on boot

I thought this would be better than making a new post

You thought wrong.

nvidia redid my x configs

No, it didn't.

now my other  VGA screen wont show up when x launches

The driver doesn't deal in "VGA", you'd have to say which monitor that actually is.
However

[     3.703] (==) Using config file: "/etc/X11/xorg.conf"
…
[     4.758] (II) NVIDIA(G0): NVIDIA GeForce GTX 1070 Ti (GPU-0) already has an X screen
[     4.758] (II) NVIDIA(G0):     assigned; skipping this GPU screen
[     4.758] (EE) NVIDIA(G0): Failing initialization of X screen

Get rid of the /etc/X11/xorg.conf, you're not encouraged to use a static server setup anyway.
If that doesn't help, open a new thread for *your* configuration problem rather than jumping onto someones elses.

Online

Board footer

Powered by FluxBB