Laptop not suspending on lid close after external monitors disconnected

Bug #1883292 reported by Vadym Abramchuck
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdm3 (Ubuntu)
Expired
Low
Unassigned

Bug Description

I have a Dell XPS 13 9380 laptop with Type-C dock. There are two external monitors (DisplayPort) and USB mouse attached to the doc.

Normally I disconnect the dock cable from the laptop, close the laptop lid and laptop suspends.
However, sometimes it doesn't suspend.
I can see the 'Lid closed.' message in systemd-logind log which is normally followed by a sleep.
Once this happens, laptop no longer suspends on lid close until I restart Gnome session.
Also, if I lock it, the screen goes black but the backlight does not turn off.

I can put computer to a sleep from Gnome menu.

I'm not sure if it's issue is specific to Type-C dock though. It happens rarely, maybe 1 of 20 times.

It appears like gsd does not detect monitors disconnect event in some cases:

abram@abram-laptop:~$ systemd-inhibit --list --mode=block
WHO UID USER PID COMM WHAT WHY MODE
gdm 123 gdm 1977595 gsd-power handle-lid-switch External monitor attached or configuration changed recently block
gdm 123 gdm 1977593 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block
abram 1000 abram 779130 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block

3 inhibitors listed.

I've also seen a similar issue mentioned at askubuntu: https://askubuntu.com/questions/1196871/gnome-supend-on-laptop-lid-close-no-longer-works-since-19-10-upgrade
The accepted answer involves killing gsd-power but that's more like a workaround than a fix; the same presumably happens when Gnome session is restarted.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: gnome-settings-daemon 3.36.1-0ubuntu1
ProcVersionSignature: Ubuntu 5.4.0-33.37-generic 5.4.34
Uname: Linux 5.4.0-33-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.2
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: GNOME
Date: Fri Jun 12 19:19:35 2020
InstallationDate: Installed on 2019-04-17 (421 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Alpha amd64 (20190326.2)
SourcePackage: gnome-settings-daemon
UpgradeStatus: Upgraded to focal on 2020-04-02 (70 days ago)

Revision history for this message
Vadym Abramchuck (abramzzz) wrote :
Revision history for this message
Vadym Abramchuck (abramzzz) wrote :

I'll try to keep my laptop in this state for few days in case I could provide any further info.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report. Could you add your 'journalctl -b 0' for the session having the issue?

> gdm 123 gdm 1977595 gsd-power handle-lid-switch External monitor attached or configuration changed recently block

that's a process from the gdm user, when did you enter that command exactly? in your user session unlocked? it's weird that there is a greeter process around, they should be stopped once the user is logged in

Changed in gnome-settings-daemon (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Vadym Abramchuck (abramzzz) wrote :
Download full text (3.4 KiB)

Hi Sebastien, thank you for your response!
I've attached the log file obtained via:

journalctl -b 0 > ~/1883292-journalctl-b.log

> that's a process from the gdm user, when did you enter that command exactly? in your user session unlocked?

Yes, the session was unlocked and my dock station was disconnected.

I haven't restarted Gnome session since I reported the issue; that's what I'm currently getting with dock *connected*:

$ systemd-inhibit --list --mode=block
WHO UID USER PID COMM WHAT WHY MODE
gdm 123 gdm 1977595 gsd-power handle-lid-switch External monitor attached or configuration changed recently block
gdm 123 gdm 1977593 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block
abram 1000 abram 779132 gsd-power handle-lid-switch External monitor attached or configuration changed recently block
abram 1000 abram 779130 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block
abram 1000 abram 778915 gnome-session-b shutdown:sleep user session inhibited block

5 inhibitors listed.

I've just disconnected the dock, waited for a few seconds before laptop screen lights up and ran the same command again; now there are only 3 inhibitors:

$ systemd-inhibit --list --mode=block
WHO UID USER PID COMM WHAT WHY MODE
gdm 123 gdm 1977595 gsd-power handle-lid-switch External monitor attached or configuration changed recently block
gdm 123 gdm 1977593 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block
abram 1000 abram 779130 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block

3 inhibitors listed.

As you can see, the remaining one is the same 1977595 PID as before.

> did you enter that command exactly? in your user session unlocked? it's weird that there is a greeter process around, they should be stopped once the user is logged in

Hmm, I have a different issue which I didn't report yet which I thought isn't related. Sometimes when I connect the dock OR change one of displays settings (like orientation) via Gnome UI the laptop screen goes black. Displays settings UI still shows it as available and I can move mouse, windows etc where it's supposed to be but it's not showing anything. I found that switching to greeter via ctrl+alt+f1 (or f2?) and then back to Gnome session (ctrl+alt+f1/2) fixes this. I believe this is happening since 19.04; I never reported it since I thought it could be one of intel GPU driver bugs and it would be fix...

Read more...

Changed in gnome-settings-daemon (Ubuntu):
status: Incomplete → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

The gdm processes should be stopped when switching to the session, there is a bug there...

affects: gnome-settings-daemon (Ubuntu) → gdm3 (Ubuntu)
Revision history for this message
Vadym Abramchuck (abramzzz) wrote :

It seems like this issue might have been fixed in groovy.
I can still see gdm in inhibitors list immediately after switching to the session but it seems to disappear after 10-15 seconds.

I'll keep an eye on it.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the status update, I'm marking the bug as incomplete for now, feel free to reopen if you see the issue again, otherwise it will auto expire

Changed in gdm3 (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gdm3 (Ubuntu) because there has been no activity for 60 days.]

Changed in gdm3 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.