Laptop crashes when plugging in HDMI cable

Hi all :wave:

I installed EndeavourOS with KDE Plasma on my Medion E4253 (Intel N5000) laptop.

When plugging in the HDMI cable, the laptop screen goes black and the laptop seems to have crashed. It does not react to key strokes (e.g. change volume, ctrl+alt+F2, etc) and stays unresponsive when unplugging the HDMI cable. The external screen stays black as well. Everything works under Windows though.

I don’t even know where to start with the debugging, could you help me?

PS: My problem is similar to reply #5 on this bbs.archlinux thread, but I could not fix everything by reverting to linux-lts 5.10 or 5.4.

You could give more information about your system with these commands:

sudo journalctl --since "10 minutes ago" > /tmp/log
inxi -Fxxxzc >> /tmp/log
cat /tmp/log | eos-sendlog

I did not realize that HDMI was hot plugable. This will be interesting to follow this topic.

Pudge

Hey @manuel, this is the log, shortened to the last two boots: http://ix.io/3roS. It includes:

  • Clean boot, login to KDE plasma
  • Plug in HDMI cable, both screens go black (backlight is activated on both)
  • (Push some buttons on seemingly dead laptop, nothing happens)
  • Unplug HDMI cable, laptop stays unresponsive
  • Force shutdown the laptop (5 seconds on/off button)
  • Reboot, login to KDE Plasma, run the commands.

@Pudge, I’m using a laptop, HDMI should definitely be hot plugable there. You see it on conferences all the time: Speaker comes on, plugs in the laptop, starts presenting. :wink:

PS: I think the laptop would even crash if I had no KDE or Xorg loaded, because it fails when I plug in the cable while being in TTY2. How can I kill KDE and Xorg on TTY1 though?

1 Like

According to the online manual for the laptop:


15.2.Connecting an External Monitor
The Notebook has a miniHDMI port for an external monitor.
` Shut down your Notebook correctly.
` Plug the external monitor’s signal cable (not included) into the miniHDMI socket
on the Notebook.
You can connect another monitor via the USB 3.1 port (type C) with DisplayPort
function. Please note that you will need an appropriate adapter for this (not
supplied).
` Connect the external monitor to the wall outlet and switch it on.
` Now switch your Notebook on.

Which would suggest that there is something weird with this one, and it is not hot-pluggable, as HDMI should be.

Another thing you can try, is get on another machine on the same network, and ssh into the laptop, hot-plug the hdmi whilst checking the laptop with sudo dmesg -T. Let me know if you need more details on how to make that happen.

They say a person learns something new every day. That’s my quota for the day, I can go to sleep now.

Pudge

@onyxnz Good catch with the manual! Indeed, when connecting HDMI before booting, the external (and internal) screen works (although there’s no sound on the external display, and flickering/artefacts on the login screen). But still, dis- and reconnecting the HDMI cable crashes the computer, while hot-plugging works without problems under Windows. I’m sure there’s something wrong with my Linux config.

I’ll try the ssh-thing later and write a second reply. Good idea!

1 Like

Thanks for the logs!

I’m no expert on the the graphics, so the following is just guessing.

If I’m not wrong, looks like at 20:29:15 you plugged the HDMI in.
The system looks like recognizing the event and the new display, but some display parameters might be a little off. Maybe setting up a suitable small config file into /etc/X11/xorg.conf.d for the HDMI display could solve this?

Also some ideas:

  • Update BIOS if not already done?
  • Either install or uninstall the Intel video driver (xf86-video-intel)? Be sure to have the USB installer available before trying this!
  • Try other kernels: linux-lts, linux-zen, linux-hardend?

These may also be worth checking:

@onyxnz Indeed, I can still log into the laptop via SSH while it’s stuck. I ran “sudo dmesg -T” before connecting the HDMI cable (laptop works) and after connecting the HDMI cable (laptop is stuck). The new entries seem meaningless:

[Mi Jun 30 20:47:00 2021] audit: type=1101 audit(1625078820.936:103): pid=1667 uid=1000 auid=1000 ses=4 msg='op=PAM:accounting grantors=pam_unix,pam_permit,pam_time acct="sebastian" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[Mi Jun 30 20:47:00 2021] audit: type=1110 audit(1625078820.936:104): pid=1667 uid=1000 auid=1000 ses=4 msg='op=PAM:setcred grantors=pam_faillock,pam_permit,pam_env,pam_faillock acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[Mi Jun 30 20:47:00 2021] audit: type=1105 audit(1625078820.936:105): pid=1667 uid=1000 auid=1000 ses=4 msg='op=PAM:session_open grantors=pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[Mi Jun 30 20:47:00 2021] audit: type=1106 audit(1625078820.952:106): pid=1667 uid=1000 auid=1000 ses=4 msg='op=PAM:session_close grantors=pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[Mi Jun 30 20:47:00 2021] audit: type=1104 audit(1625078820.952:107): pid=1667 uid=1000 auid=1000 ses=4 msg='op=PAM:setcred grantors=pam_faillock,pam_permit,pam_env,pam_faillock acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[Mi Jun 30 20:47:47 2021] audit: type=1101 audit(1625078868.346:108): pid=1672 uid=1000 auid=1000 ses=4 msg='op=PAM:accounting grantors=pam_unix,pam_permit,pam_time acct="sebastian" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[Mi Jun 30 20:47:47 2021] audit: type=1110 audit(1625078868.346:109): pid=1672 uid=1000 auid=1000 ses=4 msg='op=PAM:setcred grantors=pam_faillock,pam_permit,pam_env,pam_faillock acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[Mi Jun 30 20:47:47 2021] audit: type=1105 audit(1625078868.346:110): pid=1672 uid=1000 auid=1000 ses=4 msg='op=PAM:session_open grantors=pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'

@manuel Some things I tried:

  • BIOS is up to date
  • linux-lts and linux-zen didn’t change anything
  • After uninstalling xf86-video-intel my laptop didn’t boot properly, I had to chroot back in from a live USB to reinstall the package

Maybe setting up a suitable small config file into /etc/X11/xorg.conf.d for the HDMI display could solve this?

@manuel I have no clue how to go about the config file, do you have an example file?

As I mentioned, I’m no expert on graphics settings. But the links I added in the previous post should show something about them. You could also search for more Arch wiki articles about the problem.

One more idea is to try another display manager, because it looks like a graphics problem.

I hope someone more knowledgeable can help you further.

I’m not an expert either but i agree with @manuel that maybe you need to set up something like this. You would get the ouputs first using xrandr and use those in the file to have the proper identifiers. :man_shrugging:

/etc/X11/xorg.conf.d/10-monitor.conf

Section "Monitor"
    Identifier  "VGA1"
    Option      "Primary" "true"
EndSection

Section "Monitor"
    Identifier  "HDMI1"
    Option      "LeftOf" "VGA1"
EndSection
1 Like

Thanks a lot, I tried using the config posted by @ricklinux. Replaced “VGA1” with “eDP1” because according to xrandr, this is how the internal display is called. Anyway, the new config didn’t seem to make any difference. :man_shrugging:

I’m thinking I sould dig deeper than just configuring the X-server. If I start the laptop without GUI (how would that work?), then attach the HDMI, would that give some information?

Alternatively, I connect HDMI to freeze my laptop, then login via SSH - what kind of debugging can I do? I think xrandr doesn’t work in that state anymore.

With ssh you have a display, so xrandr might work. Haven’t tried that though.
A simple TTY xrandr complains about a missing display.

Anyway, the Xorg log /var/log/Xorg.0.log would be interesting to see. In the same folder there are also other interesting related logs, might be worth a look.

Edit: you could install autorandr. It might not help, or not.
See https://github.com/phillipberndt/autorandr.
Also mons from AUR could be useful. See https://github.com/Ventto/mons.

And this looks quite useful too: https://man.archlinux.org/man/intel.4

By the way, how do you connect the HDMI cable? Is the monitor on or off when plugging?

1 Like

Problem (partially) solved

I think I figured out that the problem lies with KDE’s screen management tool kscreen. If I deactivate the kscreen background service in the system preferences, hot-plugging the screen works well, and no crashes occur. The disadvantage is that I lost the GUI to manage the screens, and have to work with xrandr now.

I figured out that the problem is with the KDE Plasma Desktop by closely observing the boot process (with HDMI already plugged in). During boot, the external display correclty showed signals from BIOS, startup messages, and the SDDM login screen. Only after login, the laptop crashed. Apparently, kscreen takes priority over Xorg, so even when X managed the displays correctly initially, it still broke after login.

The question remains: How can I fix the kscreen issue? I’d love to use the kscreen service, as it’s integrated with the Desktop GUI. Command line tools like xrandr are clunky. :slight_smile: Thanks! :+1:

\edit after 1 hour: I found some remaining problems with hot-plugging, I’ll investigate further. At least now the X config file, and xrandr, really make a difference, because kscreen doesn’t interfere anymore.

There’s gui tools for xrandr, for example.

disclaimer I’ve never used this or any others

1 Like

@wateryoga

Just F.Y.I the config file for kscreen is in ~/.local/share/kscreen/
The relevant config is found here ~/.config/plasmashellrc

I’m not sure how it all ties together but something you can look into.

I have used this in the past, as it was scriptable so if you had dodgy monitor detection, such as on old AOC monitors, you could create the script once you had set the screens up nicely, and running the script once the monitor was connected would put everything right.