[-- Attachment #1: Type: text/plain, Size: 340 bytes --] Since I've reconfigured my system some weeks ago, I've noticed a change with my laptop: when the power cable is in, closing the lid no longer suspends the machine. I'd like to get the old behaviour back. Any idea? I'm on cebfb29abb151ede95696181d2446c63504593d7 with Linux 5.9.12. -- Pierre Neidhardt https://ambrevar.xyz/ [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 511 bytes --]
[-- Attachment #1: Type: text/plain, Size: 574 bytes --] Pierre, Pierre Neidhardt 写道: > Since I've reconfigured my system some weeks ago, I've noticed a > change > with my laptop: when the power cable is in, closing the lid no > longer > suspends the machine. Interesting that it ever did: according to the manual (and AFAIK) the default ‘handle-lid-switch-external-power’ action is ‘ignore’. Do you change it to ‘suspend’ in your system configuration? Were/are you using some fancy desktop environment or power management scripts that might override the default? Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 243 bytes --]
[-- Attachment #1: Type: text/plain, Size: 763 bytes --] Hi Tobias! Tobias Geerinckx-Rice <me@tobias.gr> writes: > Interesting that it ever did: according to the manual (and AFAIK) > the default ‘handle-lid-switch-external-power’ action is ‘ignore’. > Do you change it to ‘suspend’ in your system configuration? I was not aware of these settings, thanks for pointing them out! So my guess is that previously "external-power" was not recognized and elogind thought it was always on battery. I'll try setting handle-lid-switch-external-power to `suspend'. > Were/are you using some fancy desktop environment or power > management scripts that might override the default? I'm on EXWM and I use "xss-lock slock", not much beyond that. -- Pierre Neidhardt https://ambrevar.xyz/ [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 511 bytes --]
[-- Attachment #1: Type: text/plain, Size: 588 bytes --] I think I have a different problem. Now even when the cable is plugged out, it only rarely suspends. I tried --8<---------------cut here---------------start------------->8--- (elogind-service-type config => (elogind-configuration (inherit config) (handle-lid-switch-external-power 'suspend))) --8<---------------cut here---------------end--------------->8--- and rebooted, but it does not seem to make a difference. Something's fishy... -- Pierre Neidhardt https://ambrevar.xyz/ [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 511 bytes --]
[-- Attachment #1: Type: text/plain, Size: 698 bytes --] Pierre, Pierre Neidhardt 写道: > I tried > > --8<---------------cut > here---------------start------------->8--- > (elogind-service-type config => > (elogind-configuration > (inherit config) > (handle-lid-switch-external-power > 'suspend))) > --8<---------------cut > here---------------end--------------->8--- > > and rebooted, but it does not seem to make a difference. > > Something's fishy... It would seem so... I'll add the above to my next reconfiguration (tonight or tomorrow) and will let you know what happens here. Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 247 bytes --]
Hi Pierre, I just wanted to share that I've experienced the same on an x200 laptop (closing the lid no longer puts it into suspend mode). It seems a regression; we should try to bisect which commit introduced it. elogind? kernel? All bets are off! Maxim
[-- Attachment #1: Type: text/plain, Size: 688 bytes --] Pierre, Tobias Geerinckx-Rice 写道: > I'll add the above to my next reconfiguration (tonight or > tomorrow) > and will let you know what happens here. I hoped to gleefully report failure (especially after Maxime's message), but my X230T suspends fine on mains power with the following snippet: (service elogind-service-type (elogind-configuration (handle-lid-switch-external-power 'suspend) (handle-power-key 'hibernate))) The machine instantly falls asleep (crescent moon light) and my display is swaylocked when it resumes. This is on guix 4ea2e1a9ebfd92a6ce79c631a4c2230ed5825c04, kernel based on upstream 5.10. Hm. T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 247 bytes --]
[-- Attachment #1: Type: text/plain, Size: 121 bytes --] Thanks for reporting, Tobias. I'll try linux 5.10 in a couple of days. -- Pierre Neidhardt https://ambrevar.xyz/ [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 511 bytes --]
[-- Attachment #1: Type: text/plain, Size: 333 bytes --] I went back in time as far as 2020-09-27 on Linux 5.8.11: I can reproduce the issue, even though back then I'm confident I didn't have it! O.o Looks like some stateful power management setting was changed. Any idea how to inspect the currently active power management settings? -- Pierre Neidhardt https://ambrevar.xyz/ [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 511 bytes --]
Hi Tobias,
Tobias Geerinckx-Rice via <help-guix@gnu.org> writes:
> Pierre,
>
> Tobias Geerinckx-Rice 写道:
>> I'll add the above to my next reconfiguration (tonight or tomorrow)
>> and will let you know what happens here.
>
> I hoped to gleefully report failure (especially after Maxime's
> message), but my X230T suspends fine on mains power with the
> following snippet:
>
> (service elogind-service-type
> (elogind-configuration
> (handle-lid-switch-external-power 'suspend)
> (handle-power-key 'hibernate)))
I haven't tried that yet, but I'm confident it'll fix the 'problem'.
Shouldn't that be the default behavior though? Closing the lid of a
running laptop can discolor the screen it if overheats.
Like Pierre, I'm also certain that the default behavior was changed at
some point.
Thanks!
Maxim
[-- Attachment #1: Type: text/plain, Size: 1480 bytes --] Maxim, Maxim Cournoyer 写道: > Shouldn't that be the default behavior though? That's subjective. I don't think we should ever editorialise if that's what you mean: Guix service configuration wrappers should strictly wrap, not tweak defaults on a (majority) whim. However, here our wrapping is wrong. Thanks for making me look into it. From upstream's change log: The action that elogind takes when the lid is closed and the machine is connected to external power can now be configured using HandleLidSwitchExternalPower= in logind.conf. Previously, this action was determined by HandleLidSwitch=, and, for backwards compatibility, is still is, if HandleLidSwitchExternalPower= is not explicitly set. Whilst we: ("HandleLidSwitchExternalPower" (handle-action elogind-handle-lid-switch-external-power)) always ‘explicitly set’ HandleLidSwitchExternalPower, by default to ‘ignore’, breaking that intention. elogind-handle-lid-switch-external-power should not emit a directive if unset. In fact, all directives and all services should do that by default, *not* hard-code upstream's default at an arbitrary point in time. Unfortunately most do, making subtle bugs like these more likely. > Like Pierre, I'm also certain that the default behavior was > changed at > some point. I didn't find any evidence for this in the commit log but didn't search exhaustively. Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 247 bytes --]
Hi Tobias, Tobias Geerinckx-Rice <me@tobias.gr> writes: > Maxim, > > Maxim Cournoyer 写道: >> Shouldn't that be the default behavior though? > > That's subjective. I don't think we should ever editorialise if > that's what you mean: Guix service configuration wrappers should > strictly wrap, not tweak defaults on a (majority) whim. Agreed. > However, here our wrapping is wrong. Thanks for making me look into > it. > > From upstream's change log: > > The action that elogind takes when the lid is closed and the > machine is connected to external power can now be configured > using HandleLidSwitchExternalPower= in logind.conf. Previously, > this action was determined by HandleLidSwitch=, and, for > backwards compatibility, is still is, if > HandleLidSwitchExternalPower= is not explicitly set. > > Whilst we: > > ("HandleLidSwitchExternalPower" > (handle-action elogind-handle-lid-switch-external-power)) > > always ‘explicitly set’ HandleLidSwitchExternalPower, by default to > ‘ignore’, breaking that intention. > > elogind-handle-lid-switch-external-power should not emit a directive > if unset. In fact, all directives and all services should do that by > default, *not* hard-code upstream's default at an arbitrary point in > time. Oh, nice find! So we have something to fix. > Unfortunately most do, making subtle bugs like these more likely. > >> Like Pierre, I'm also certain that the default behavior was changed >> at >> some point. > > I didn't find any evidence for this in the commit log but didn't > search exhaustively. I'm guessing if nothing changed in our side, the behavior of elogind itself must have changed. Thank you, Maxim
[-- Attachment #1: Type: text/plain, Size: 1275 bytes --] Maxim Cournoyer <maxim.cournoyer@gmail.com> writes: > Hi Tobias, > > Tobias Geerinckx-Rice <me@tobias.gr> writes: > >> However, here our wrapping is wrong. Thanks for making me look into >> it. >> >> From upstream's change log: >> >> The action that elogind takes when the lid is closed and the >> machine is connected to external power can now be configured >> using HandleLidSwitchExternalPower= in logind.conf. Previously, >> this action was determined by HandleLidSwitch=, and, for >> backwards compatibility, is still is, if >> HandleLidSwitchExternalPower= is not explicitly set. >> >> Whilst we: >> >> ("HandleLidSwitchExternalPower" >> (handle-action elogind-handle-lid-switch-external-power)) >> >> always ‘explicitly set’ HandleLidSwitchExternalPower, by default to >> ‘ignore’, breaking that intention. >> >> elogind-handle-lid-switch-external-power should not emit a directive >> if unset. In fact, all directives and all services should do that by >> default, *not* hard-code upstream's default at an arbitrary point in >> time. > > Oh, nice find! So we have something to fix. Thanks for digging this out, Tobias! Anyone in the mood to work on a patch? :) -- Pierre Neidhardt https://ambrevar.xyz/ [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 511 bytes --]