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

Open
#224 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
linux

Research direction

Start with the csd-power handling that creates the handle-lid-switch inhibitor, using the reported systemd-inhibit output and the monitor plug/unplug reproduction steps. Compare the inhibitor state before and after the external monitor is removed, and verify that closing the lid suspends again without requiring logind.conf changes.

Written by the indexing model from the issue text.

Description

Gathering Info
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

  • Make sure that your laptop can properly suspend when closing the lid
  • Keep it powered on when plugging it in to a monitor.
  • Close lid.
  • Open lid and unplug from monitor

Expected behaviour

  • The suspend function will operate as it did before using the monitor

Actual Behavior

  • Suspend only makes the computer idle, as if a monitor is still plugged in.

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.

Dominant language
C
Stars
70
Forks
78
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linuxmint/cinnamon-settings-daemon

All issues in linuxmint/cinnamon-settings-daemon

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.