Here's a difficult one. I am having display issue on a Lenovo laptop with a Lenovo External Monitor. I am running Artix (and Artix LTS) with runit with the following behavior:
Boot with HDMI cable attached - built-in laptop screen is blank
Boot without HDMI cable attached - laptop screen works, external not connected.
Boot and attach the HDMI Cable after Runit triggered - both sceens work! During boot, they are mirrored, after boot - they are extended.
I have 70 pages of notes, over at least four months, of all the behavior and recording changes and additional packages installed, even installed Arch and it behaved the same as above. I've tried i3, bspwm, and currently have AwesomeWM installed - same behavior except I had trouble with bspwm working and lack of recent development pushed me to go to AwesomeWM.
I have a Lenovo B570 (yes, it's old, but it's a workhorse-beast). GPU is intel, not nvidia.
I won't go into how many permutations of modes set with or without drivers (fbdev, vesa, intel etc.) because I want to learn how someone else would walk through diagnosing this. I can tell you that I have read dozens of posts on similar scenarios (I do not have nvidia gpu, but I followed those posts as far as I could, of course.) [Ok, I have a small complaint, the difficulty of figuring out how to copy and past from linux to firefox is just plain stupid levels of obscurity and dancing. rant over. Copy-pasta problem still exists tho]
Here are the relevant files: (once I get a working process to copy to pastebin, these will be here.update: gedit for the win)
HDMI/External monitor attached AFTER boot beginslspci -v https://pastebin.com/Km17Jt7Y
dmesg https://pastebin.com/g7NYH91f
lsusb https://pastebin.com/1aZAD5LA
lsmod https://pastebin.com/fL4HYWgd
inxi -Fxxxrz https://pastebin.com/AwADSvU2
Thank you in advance for your help, I've really tried to use this forum as a very last resort. I've researched (and learned a lot!) trying to solve this issue. Again thank you for your help and the work you do for Artix.
edit: additional results before any changes
(Both monitors in use, same setup as above)
results of ls /sys/class/drm/
total 0
drwxr-xr-x 2 root root 0 Feb 7 12:13 .
drwxr-xr-x 67 root root 0 Feb 7 12:13 ..
lrwxrwxrwx 1 root root 0 Feb 7 12:13 card1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card1
lrwxrwxrwx 1 root root 0 Feb 7 12:13 card1-DP-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card1/card1-DP-1
lrwxrwxrwx 1 root root 0 Feb 7 12:13 card1-HDMI-A-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card1/card1-HDMI-A-1
lrwxrwxrwx 1 root root 0 Feb 7 12:13 card1-LVDS-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card1/card1-LVDS-1
lrwxrwxrwx 1 root root 0 Feb 7 12:13 card1-VGA-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card1/card1-VGA-1
lrwxrwxrwx 1 root root 0 Feb 7 12:13 renderD128 -> ../../devices/pci0000:00/0000:00:02.0/drm/renderD128
-r--r--r-- 1 root root 4096 Feb 7 12:13 version
edevadm-HDMI https://pastebin.com/pZ6HNhpk
edevadm-LVDS https://pastebin.com/2MQ1dvkb
HDMI/External monitor attached BEFORE boot begins, i.e. Both screens SHOULD be available, but the built-in is blank.edit:(I've compiled these with the monitor HDMI attached at boot but will post here in the morning.)
edit(2025-02-09) Suspecting boot as mentioned above. Have been digging into Runit Stages, Udev (sort of, since this is Artix), reading through the documentation on how to see into .mod files - still reseraching. Also, I've chased down something to do with backlights using ddcutil and i2c-tools, just installed them. Will post here an update.
edit(2025-02-15) Thanks so much for the helpful advice, I've been able to go down some good rabbit holes and learned alot about the boot process - good stuff! I'm 99.9% convinced it's the boot of my Lenovo laptop, it happens even before the kernel launches, so I'll put my future efforts there. Again thank you to those that helped. MArkign Boot Issue in title)
Have you looked in the UEFI / Bios to see if this behaviour can be controlled there ?
The Bios is very old. The options there are extremely limited to any options.
I have looked at the eDID and I touched the EFI files just to look but I didn't want to muck up anything before thoroughly researching - hence the four months and 70 pages of notes lol. I am familiar, a little, with eDID but the only adjustments I could find involved nvidia. I edited my Grub file, removed the splash, and changed the linux command line to variations of these commands: acpi_backlight=native and acpi_backlight=video.
edited: for spelling
Just from what you are saying "Boot and attach the HDMI Cable after Runit triggered " works makes me think it the BIOS doing this, possibly Grub as you've guessed yourself.
So as another thing to try maybe create a rEFInd (https://rodsbooks.com/refind/) boot usb and boot from that. If you have the same issue then I'd think it's pointing heavily towards the BIOS.
Another avenue to look at might be udev.
udevadm trigger --subsystem-match=drm
Maybe with extra and alternative udev commands. AFAIK the display drivers get their info about attached displays and gpu's from udev
I'm guessing here but maybe that in a custom service, or rc.local if you have it enabled ,might help.
Also you can 'talk' to the gpu and the displays directly using sysfs.
Look in /sys/class/drm/ and you'll see folders for the gpu and the displays. According to the internet you can echo 'detect' at the file 'status' in each folder.
➜ /sys/class/drm/card0-DP-1
# echo "detect" > status
# cd .. [16:31:17]
➜ /sys/class/drm
# cd card0-HDMI-A-1 [16:31:41]
➜ /sys/class/drm/card0-HDMI-A-1
# echo "detect" > status
Another option might be an xrandr script once X has started ?
It would be interesting to see if the external monitor shows up under /sys/class/drm/ at all when booted connected ?
Thanks for this! More paths to investigate.
I've responded to the drm directory question in the original post to reflect consistent system.
Give me a couple of hours, re: these new vectors. Thanks!!
Whether that's with two screens after replugging or vice verse show a listing of the other state and label both if they differ.
I'm curious to see if they are the same or different.
If the same it must (famous last words) be possible to trigger the external monitor via linux commands of some sort.
Has this ever worked as you want it on this laptop, using any OS? You don't say if this is new behaviour or it has always done this since you owned it. I'm sure I've had laptops where plugging in an external display disabled the built in one, the BIOS does hw detection at startup so it might assume you want to use that instead of the main one and not both. I tested something recently by attaching an external USB drive with Windows on a drive that had come with a used machine and set the BIOS to boot from that, and/or you could try live isos of other distros and old versions, to find out if this is normal for that model or not.
That aside, if you tried lsmod in the working and non working situations and diffed the output you could try modprobing any missing ones which might be at least a step towards the working state.
There are various solutions for this:
https://wiki.archlinux.org/title/Multihead
https://wiki.gentoo.org/wiki/Xorg/Multiple_monitors
https://ruedigergad.com/2012/01/28/hotplug-an-external-screen-to-your-laptop-on-linux/
https://github.com/codingtony/udev-monitor-hotplug
If you can't find the kernel commands directly, I would imagine the source code for mate-power-manager or mate-screensaver would lead you to them, possibly via other packages and libs. Look at the file titles and use something like ripgrep to search the code, it would help if you understand a bit of C though. See the equivalent packages for other desktops. With the internal screen disabled at boot, you could try putting your laptop to sleep or suspending it, or shutting down the screen with a screensaver, then bringing it back, just to see if both get switched on then.
There's also a possible hardware solution, if a bit clunky. You can buy a 2 way HDMI switch cheaply that switches between 2 inputs/outputs. Leave one socket disconnected then it works as an on off switch, and use that to connect the monitor after booting, a bit easier than plugging the cable. Also you can get a computer operated USB smart switch with a relay, but an HDMI cable has 19 wires inside so it might take a while to make a circuit to switch them all from the relay signal, unless you can find another device closer to the desired result
The behavior (external only monitor) is not new. I have seen this happen with my prior linux installs (Debian, Gnome, Parrot, and I can't remember the other one). It was the primary reason for starting to dig into things and then installing Arch, now Artix. I know from experience that plugging an external monitor into MSWindows will switch the screens, and yes there's a Fn-F3 that used to work for Windows.
Yes, I have, see above in OP.
I can almost quote the Multihead page from memory. As well as the drivers pages from Arch :) I've been to the Gentoo page, deeply perused this actual page.
However, I am becoming convinced I may need to write a rule sin hte udev to see if that works. It's similar to what ####### (https://forum.artixlinux.org/index.php?action=profile;u=97) was suggesting with the laptop closed/hot plugging.
I was set on thinking there was a configuration issue, hoping for a simply flag-throw to fix it. But I'm thinking something like the link that codington says was the inspiratino for theirs. I'm running Artix, so the journalctl and service commands that codington is referring to are cloase but I need to find their alternatives. Anyway enough staring at the sky, waxing on about what could be, time to get to work on these links. Thank you! 'udev' and whatever Rsyslog is, I'm gunning for you! See you in a few hours.
Thanks again for the links, these are new ones to dive into!
rsyslog is in the AUR, but you need to change "enable" in the imjournal and omjournal lines in the PKGBUILD to "disable" or it won't build without systemd, then it's fine. Those build options are just for systemd things so don't matter here. There are other logging utilities in the repos too.
I am convinced that you firmly believe this, but your inxi output (lines 35 and 39) suggests otherwise.
Imho, the built-in screen must always remain PRIMARY, regardless of whether the external screen is connected or not.
I think I should ignore the cheap-shot.
As for whether the external monitor is primary, or not, I can't seem to find the reference to that on that page. I understand that VGA is the serial port? My built-in monitor is named LVDS which I assume means LenoVo DiSplay. I will set the LVDS to PRIMARY, and see if that solves it.
edit: ran xrandr --output LVDS-1 --primary. Ran inxi -Fxxxrz and saw that the primary was indeed the laptop built-in. Rebooted with HDMI cable connected. Built-in screen still blank. Checked the inxi again, the external was set to primary. /shrug. It is deciding on its own to make the external primary.
Appended OP above with my current direction.
https://en.wikipedia.org/wiki/Low-voltage_differential_signaling
lol,
how about instead of writing here in the forum you create a
monitor.conf (two would be better) that enforces the functionality you want?
This may be off topic, but...
the debug on this is
sudo journalctl -f
How would we debug this?
Thank you, I will consider this. I will spend less time on the forum looking for solutions. Thank you, you are saving me hundreds of hours.
Seriously, why do people need to put someone else down before they try to help? Have I said something to offend someone?
As the internal display is not enabled when booting with the hdmi display attached, try to force enable it by adding kernel parameter:
video=LVDS:e
The ':e' part means 'enabled'.
artist
If you spent more time on the forum you'd know that lq often provides good advice but phrases replies in a minimal manner, don't worry about it.
And journalctl is the systemd equivalent to looking in /var/log/syslog, except they record the logs in binary not text format so you can't simply read the log and have to use journalctl to convert it to text, after spending half the day reading the lengthy journalctl related manpages to get the correct options. :D
thank you for your less terse reply.
What would be the Artix equivalent to journalctl -s?
Would it be funny to implement an
artix journalctl <switch>
that implements the journalctl functionality for our non binary logs with a configurable log reader? So users can use the journalctl commands?
Use systemd, and please stop asking systemd questions offtopic in threads asking for help.