-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lid-close suspend: blank screen when switching to user session #108
Comments
The patch hasn't fully cured the issue so I need to dig deeper. Any suggestions of how to debug this gratefully received. It only happens when suspend is triggered by lid-close, and with this patch, not every time. |
Further testing including adding 5 gs_debug() statements to track the lid_close handling seems to point to this being a timing/race issue. Adding the debug statements and executing with --debug redirecting stdout to a file and I could not reproduce the problem. I then selectively backed off each debug action until I'd switched back to using the Ubuntu system binary and the problem will not reproduce! It feels as if some option somewhere has been set and that makes things work. Tomorrow I'm going to do a reboot test in case a clean reboot with no previous successful suspend/resume cycles will continue to trigger the issue. Another datapoint. I discovered that when the screen is blank, if I do "systemctl suspend" from a console tty, wait for the PC to enter sleep, then close the lid and re-open it so the system resumes, the user session is again visible! |
Issue occurs with a fresh boot and with full debugging from my custom build. Seems to indicate a definite issue with timing although I'm not sure where. I left the greeter authentication screen for a couple of minutes before unlocking and the issue still occurred. Could be something in the timing of switching from vt8 to vt7. |
I've just made a significant discovery. From tty1 I was monitoring the backlight brightness after noticing the console would dim after a certain time but switching to tty7 and back to tty1 it would be brighter again. This made me think the power-manager in the tty7 session was doing an idle dim. $ while /bin/true; do sleep 1; cat /sys/class/backlight/intel_backlight/actual_brightness ; done Alt+F70 Ctrl+Alt+F1140 This seems to prove the problem is that the monitor brightness is being set to 0 on lid-close and not returned to it's previous value on resume. The fact it only affects the user session, and seems time sensitive, suggests there is a race condition where - most likely - the session-internal value is not being set or being reset after being set. It also would explain why other consoles are fine. |
I don't think lightdm or light-locker interact with that part of the user session/settings. In Xfce it's probably both xfce4-power-manager and xfsettingsd that react to upower's lid signals. |
light-locker has a dbus listener for lid_closed and does a lot of reconfiguration as a result. |
Tbh I haven't looked at the code in a longer while, but if three daemons try to configure the backlight that sounds like race conditions would be the most likely outcome (especially since the three don't talk to each other). |
Just so that it's documented, here are the two code pieces I referred to earlier: Both are usually part of Xfce sessions. And then ofc there's logind - not sure if that one interacts with the display's DPMS status or anything too. |
Having the same issue on Linux Mint 19 Xfce (based on Xubuntu 18.04, HP Probook 470 G2):
I will try to investigate to see if it's the brightness problem. |
What seems to work is to set the action to Lock screen when the laptop lid is closed in the Xfce Power Manager settings, I think in this way xfce locks the screen when you close the lid, so it should work properly when you are back from suspend, at least it works for me. http://i.imgur.com/BATGHtU.png Update: I set it to suspend and it seems to work properly. |
purplesrl: Changing XFCE Power Manager > General > Laptop Lid > On Battery = Lock Screen doesn't help because the laptop is not being suspended when that is set. I confirmed this by checking kern.log and/or syslog - the kernel doesn't freeze and suspend to S3 when the lid is closed. The expected kernel messages would be: ACPI: Preparing to enter system sleep state S3 |
Yes, I noticed that also, this is why I updated my answer, I set it to "Suspend" and it works properly now: http://i.imgur.com/CFuWg7J.png This was my initial goal, to not suspend the laptop when the lid is closed so I set "When lid is closed" to "Switch off display", but the laptop still suspends (I guess that is the bug, as it should just turn off the display) and If I set it like that, then when it comes back, the display will remain blank after I login, but if I set it to "Lock screen" or "Suspend" it works. |
I hit this again on upgrading several laptops to Xubuntu 19.04. Discovered it is a fight between xfce4-power-manager and systemd-logind. Solution is:
|
Seems to be caused by this xfce4-power-manager commit:
|
Any update on this issue? I could reproduce it on ThinkPad t480s/t470s |
Please help! I have the same symptoms in my Asus X555q with xubuntu 19.04 |
@iam-TJ, you are an absolute HERO. Thank you so much for putting in the work on this issue. (Your workaround happened to work for me, but the greater point is that) you've taken a crack at nailing down this years-old, UXP-destroying bug as efficiently as possible. That's awesome. I can finally use Linux for school now, without having to decide "hmm do I feel like risking being that guy if I slip up and break the OS while an important project is ongoing" the sheer amount of eyes that have been on this problem (mostly in a context of sadness -- the paper trail on Launchpad is quite disheartening), before you came in and simply debugged it and found the problem, is just staggering and really an example of The Process at its worst. Thanks a lot for this; I hope this thread comes completely to fruition and makes XFCE+systemd usable on laptops OOTB again. |
Dear Developers I have exactly the same problem - after opening the lid - notebook wakes up - Could you please comment if there is a progress! The first attempt is always unsuccessful. The trick: Just now I had several successful open/close/open cycles by setting My hardware is Samsung N145P Software: lightdm, xfce4.12.4, latest Linux Mint 19 64bit (all updates installed) Best regards, Dmitry |
I can reproduce the issue with xubuntu 18.04 in a Lenovo B590. |
I'm currently testing Xubuntu 18.04 after a do-release-upgrade from 16.04.
I discovered a very weird issue. When doing S3 sleep via closing the lid, on resume the lock screen appears, I authenticate, but as soon as it switches to the user session the screen goes blank - not even a backlight.
Switching to other ttys works and they display correctly but the GUI user session remains blank.
If the system is manually suspended (not using the lid), then resumed either by opening the lid or pressing the power button, the GUI user session is fine.
I narrowed it down to xfce4-power-manager and discovered disabling the lock-screen cured the issue.
I cloned the repository and reviewed commits between 1.7 and 1.8. Fortunately there aren't many. Looking at 6365683 "Proper exit status for light-locker-command" I suspected the change in the SetActive return value, and reverted it.
After a build/install cycle I've found the system now behaves correctly so I think the change should be reverted. This is the commit I'm using:
The text was updated successfully, but these errors were encountered: