linuxmint / cinnamon-settings-daemon

The settings daemon for the Cinnamon desktop
GNU General Public License v2.0
58 stars 59 forks source link

csd-power seems to be preventing laptop from suspending after using external monitor #224

Open TheShed412 opened 6 years ago

TheShed412 commented 6 years ago
OS: Mint 18.2 sonya
Kernel: x86_64 Linux 4.10.0-041000-generic
DE: Cinnamon 3.4.6
WM: Muffin
WM Theme: Vivaldi (Numix Daily)
Theme: Mint-Y-Dark [GTK2/3]
Icon Theme: Numix-Circle
Font: Noto Sans 9
CPU: Intel Core i5-7200U CPU @ 3.1GHz
GPU: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) 
RAM: 1098MiB / 7620MiB

Issue After unplugging an external monitor multiple days ago, csd seems to be preventing my laptop from sleeping on lid close.

Steps to reproduce

Expected behaviour

Actual Behavior

Other information List of blocking inhibitors. This was printed while the laptop was unplugged from the monitor after multiple reboots.

╰─$ systemd-inhibit --list --mode=block
     Who: tyler (UID 1000/tyler, PID 1598/csd-media-keys)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: Cinnamon handling keypresses
    Mode: block

     Who: tyler (UID 1000/tyler, PID 1596/csd-power)
    What: handle-lid-switch
     Why: Multiple displays attached
    Mode: block

2 inhibitors listed.

I have attempted to use logind.conf to try to remedy this but it never recognizes my changes even after multiple reboots. I have set the session manager to default to logind, but that doesn't work.

org.cinnamon.desktop.session session-manager-uses-logind true
org.cinnamon.desktop.session session-name 'cinnamon'
org.cinnamon.desktop.session settings-daemon-uses-logind true
org.cinnamon.desktop.session idle-delay uint32 600
org.cinnamon.desktop.session screensaver-uses-logind false

logind.conf:

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
InhibitDelayMaxSec=5
HandlePowerKey=ignore
HandleSuspendKey=suspend
HandleHibernateKey=suspend
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
LidSwitchIgnoreInhibited=no

This does seem to be a problem with Cinnamon/csd-power. I have AWM and Mate install beside Cinnamon and neither have this issue. Here is a related post on the systemd github: https://github.com/systemd/systemd/issues/7137

I have also installed Mint 18.3 with cinnamon on a live usb and tried sleeping on lid close, and it works fine. It even lists all the same inhibitors as my main install. Currently all of my power settings are to suspend on lid close regardless of if AC or External monitor is plugged in.

I have tried both LidSwitchIgnoreInhibited=no and LidSwitchIgnoreInhibited=yes in my logind.conf file and neither has worked. When this first started happening a week or so ago, it would sporadically suspend correctly but it hasn't at all recently.

slano commented 4 years ago
 * csd version 4.2.2
 * Distribution - Mint 19.2 Tina
 * Graphics:  Device-1: Intel Haswell-ULT Integrated Graphics driver: i915
 * 64 bit

My issue is exactly opposite, but I guess there is a connection.

My laptop is set to do nothing on lid close while on A/C power and not to perform lid close action with external monitor attached. However, csd-power removes lid switch inhibitor after I detach my monitor, and once I close the lid (while still on the A/C) my laptop suspends.

(csd-power:7274): power-plugin-DEBUG: 23:29:43.619: no external monitors for a while; uninhibiting lid close
(csd-power:7274): power-plugin-DEBUG: 23:29:43.619: Removing lid switch system inhibitor

DEBUG run of csd-power https://pastebin.com/raw/4Pkn6YZG with NOTEd actions performed

inhibitors before attaching monitor:

     Who: slano (UID 1000/slano, PID 3069/csd-media-keys)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: Cinnamon handling keypresses
    Mode: block

     Who: slano (UID 1000/slano, PID 3140/csd-power)
    What: handle-lid-switch
     Why: Multiple displays attached
    Mode: block

inhibitors after detaching monitor:

     Who: slano (UID 1000/slano, PID 3069/csd-media-keys)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: Cinnamon handling keypresses
    Mode: block
TheShed412 commented 4 years ago

What happens when you repeat that, but with no AC power? This was a long time ago so I don't remember whether I had power in when I unplugged my laptop or not.

It took reinstalling Mint to fix this issue.

icarter09 commented 4 years ago

@TheShed412 are you still experiencing this issue?

TheShed412 commented 4 years ago

I will have to try again and see. I haven't used this particular computer with Cinnamon in a couple years.

It took a reinstall of Mint and Cinnamon to fix it when I was experiencing it.

icarter09 commented 4 years ago

@TheShed412 thanks for the update. If you can update the ticket or close it out if you feel it's corrected, whenever you find the time to test it out would be great. Thanks.

TheShed412 commented 4 years ago

I'm installing on an old drive and going to boot to it from my current laptop and see if I can reproduce it. If not I can close it out.

Someone else had a similar issue that commented a few months ago, so it may still be a thing.