Page 1 of 1

Computer freezes after screens turn off

Posted: Tue Jul 24, 2018 2:37 pm
by Mutex

I have an issue with Linux Mint 19. If my screens turn off after a period of inactivity, I cannot wake up the screens after the screens turn off, and the computer appears to be completely frozen.

Whether it happens via:
1. Setting "Turn off the screen when inactive for" setting in Power Management
2. Doing it via DPMS eg: "xset dpms 0 0 60"

The screens turn off after the correct amount of time. Then, if I try pressing a key or moving the mouse, nothing happens, the screens stay off. My key presses are not being interpreted by the computer, I tried typing a command and it was not done. Even pressing ctrl+alt+f1 does nothing. I have to hard reboot.

Turning the screens off and on manually (physically pressing the buttons) causes no issue.

This occurred today, it was working last night and I woke up my screens fine [EDIT: Since this issue doesn't happen *everytime* the display blanks, but usually on the second time, this might not be true]. It happened after an update, it was basically all systemd stuff that was updated. The following modules were updated from 237-3ubuntu10.2 to 237-3ubuntu10.3:
systemd, systemd-sysv, libudev1 (this appears twice for some reason), udev, libnss-systemd, libsystemd0, libnss-myhostname, libpam-systemd

These were also updated from 2.7.6-3 to 2.7.6-3ubuntu0.1:
udisks2, libudisks2-0, gir1.2-udisks-2.0

Anyone else have this issue?

My specs:
NVidia GTX 980Ti (proprietary driver 390)
Two 4k monitors using display port 1.2
16GB ram
Intel 5820k CPU.

Re: Computer freezes after screens turn off

Posted: Wed Jul 25, 2018 5:31 am
by Meeshka
I had a similar issue with Mint 18. I never discovered what the cause was, but what worked for me was making sure the screen did not shut down at the same time as the screensaver started. In other words, setting a delay of at least 15 mins between the two. I don't use suspend, so I don't know if that makes a difference.

Re: Computer freezes after screens turn off

Posted: Wed Jul 25, 2018 6:50 am
by Mutex
Thanks for your response. I have the screensaver disabled, and suspend disabled. I can reproduce this with all power management disabled, and just typing "xset dpms force off".

I forgot to mention in my first post, I'm connected to my monitors via DisplayPort 1.2.

Also, searching for this issue online, it appears to affect people using the NVidia binary driver. Most people are also using DisplayPort 1.2, but that could just be because it's a very popular way to connect to a high res display. Someone said it's affecting them and they're using HDMI.

I should also mention, the issue didn't affect me in Kubuntu 18.04. So, possibly related to LightDM.

Re: Computer freezes after screens turn off

Posted: Wed Jul 25, 2018 10:48 am
by Mutex
If I switch both monitors to DisplayPort 1.1, this fixes the problem. I put the monitors to sleep 6 times in a row, and they came back every time. Switching back to DP 1.2, and the issue reoccurred on the 2nd time I put them to sleep.

DP 1.1 doesn't support 4k@60Hz, so it's not a viable solution. But it does mean the issue is specific to DP 1.2.

Edit to add:
I've tried a number of different kernels:
4.14.57 - didn't boot
4.15.18 - didn't fix the problem
4.16.18 - didn't fix the problem, also had visual glitches
4.17.9 - didn't boot

I've also added the graphics drivers PPA and upgraded Nvidia driver to 396, this has also not fixed the issue. I've tried downgrading to 384 but this doesn't appear to be possible on the 18.04 base, even with the PPA.

Re: Computer freezes after screens turn off

Posted: Thu Jul 26, 2018 7:26 am
by Mutex
Another workaround:

After my screens turn off (testing with xset dpms force off), if I:
1. Physically turn off the monitors
2. Move mouse or press key
2. Turn my monitors back on

This reliably avoids the issue and my desktop comes back fine, everytime. So the issue is when dpms tries to interact with the monitors.

I wonder if it's possible to just disable the GPU output, and reenable when needed to turn the screens off/on. They'll automatically go into power saving mode with no input.

EDIT: Apparently so. If I run this script:

Code: Select all

xrandr --output DP-4 --off
xrandr --output DP-2 --off
sleep 20
xrandr --output DP-4 --auto
xrandr --output DP-2 --auto
It turns the output off, the screens go into power saving mode. Then they switch back on and the desktop is restoring fine. All the open windows end up on DP-4, the screen that switches on first, but that's a relatively minor issue. Also, Chrome has crashed a couple of times, although if it's non-maximised that seems to stop it crashing. So, considering coding my own util to handle automatic power saving since there doesn't seem to be any fix for this on the horizon.

EDIT2: Yep, just finished my own Power Saving script. It restores the windows to their correct locations of screen to fix the window placement issues. Seems to work pretty solidly.

Re: Computer freezes after screens turn off

Posted: Thu Aug 09, 2018 7:39 am
by Mutex
So, this suddenly started working again. I can now do "xset dpms force off" and it'll wake up again when I move the mouse or do a "force on".

What changed? There was recently a kernel upgrade (.29 to .31) and NVIDIA driver upgrade (396.45 to .51). Neither of these fixed it, as I tested after updating them and rebooting.

Today I installed the XFCE desktop to see if it worked better than Cinnamon, so installed "xfce4" then "mint-meta-xfce4". I then uninstalled them because xfce seemed to have a missing or broken WM when installed on the Cinnamon flavour... anyway, after this, it's now working. I don't know if that installation installed something that was missing (I removed them with autoremove though) or fixed some config or what. But yeah, it's 100% working now. And the windows are still in the same place they were when it comes back on too!