You are not logged in.

#1 2019-08-12 11:44:27

alexsim2004
Member
Registered: 2017-01-10
Posts: 5

Black screen when disconnecting HDMI monitor

Hi all, I've been having this issue for a while and not quite sure how to categorise it.

I'm running Arch + Cinnamon on an Acer Aspire E1-571 Laptop (Core i5-3230M Ivy Bridge)
Driver: i915, set via KMS
I use multi-monitor setup with my 'main' display connected via HDMI, and my Laptop's built-in display as the secondary display.

I can boot fine with my main monitor connected. The problem comes when I go to disconnect the HDMI cable to the monitor.
What should happen is that the primary display should shift to the Laptop's built in display (so I can take the Laptop elsewhere and still work).
However, 8 times out of 10 I will just get a black screen (on the Laptop display) when disconnecting the HDMI cable.

I cannot get around it, apart from switching to another tty, then rebooting.
On some occasions, this procedure works fine and the primary display shifts over to the Laptop display successfully.
Other times, I won't get the black screen, but the Laptop display will stay as the secondary display and I have to restart Cinnamon before it becomes the primary display again.
It seems completely random.

This only started happening around 1 year ago, so I'm not sure if some update to the kernel/intel driver/cinnamon DE has caused it.

Any guidance or pointers on where to look would be much appreciated!

Thanks

Last edited by alexsim2004 (2019-08-12 11:45:36)

Offline

#2 2019-08-12 15:39:45

Ropid
Member
Registered: 2015-03-09
Posts: 595

Re: Black screen when disconnecting HDMI monitor

I guess something goes wrong with Cinnamon's automatic detection of changes to the monitor setup? There should be a command to fix this. Maybe simply running "xrandr --auto" would be enough to fix things?

Perhaps try to put this "xrandr --auto" command onto a keybind and then press the key when you run into the problem.

You can experiment with xrandr commands from a tty. You would switch to the tty and log into your account, then run commands like:

DISPLAY=:0 xrandr

That "DISPLAY=:0" is an environment variable to make the xrandr tool connect to the X server where your desktop is running. You might need to customize this ":0" number, so check the DISPLAY variable in a terminal window on your desktop:

echo $DISPLAY

Something that might be interesting if "xrandr --auto" is a too simple command to fix the setup: on other desktop environments that do not have any auto-detection for changes to the monitor setup, people use a script "autorandr" (there is an Arch package for autorandr):

https://github.com/phillipberndt/autorandr

What you do is first set up your two configurations, then second create a keybind for the "autorandr --change" command. I'm guessing you could use this autorandr tool to work around Cinnamon's problem.

Last edited by Ropid (2019-08-12 15:41:03)

Offline

#3 2019-08-15 09:15:14

alexsim2004
Member
Registered: 2017-01-10
Posts: 5

Re: Black screen when disconnecting HDMI monitor

Very useful, thank you!
I'll give that a try when it next happens. Luckily it hasn't reoccurred in a few days now.

Offline

Board footer

Powered by FluxBB