all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Behaviour change when closing laptop lid: it no longer suspends
@ 2020-12-18 13:28 Pierre Neidhardt
  2020-12-18 14:02 ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 13+ messages in thread
From: Pierre Neidhardt @ 2020-12-18 13:28 UTC (permalink / raw)
  To: help-guix

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2020-12-18 13:28 Behaviour change when closing laptop lid: it no longer suspends Pierre Neidhardt
@ 2020-12-18 14:02 ` Tobias Geerinckx-Rice
  2020-12-18 15:25   ` Pierre Neidhardt
  0 siblings, 1 reply; 13+ messages in thread
From: Tobias Geerinckx-Rice @ 2020-12-18 14:02 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: help-guix

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2020-12-18 14:02 ` Tobias Geerinckx-Rice
@ 2020-12-18 15:25   ` Pierre Neidhardt
  2020-12-18 15:44     ` Pierre Neidhardt
  0 siblings, 1 reply; 13+ messages in thread
From: Pierre Neidhardt @ 2020-12-18 15:25 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2020-12-18 15:25   ` Pierre Neidhardt
@ 2020-12-18 15:44     ` Pierre Neidhardt
  2020-12-18 19:38       ` Tobias Geerinckx-Rice
  2020-12-18 20:33       ` Maxim Cournoyer
  0 siblings, 2 replies; 13+ messages in thread
From: Pierre Neidhardt @ 2020-12-18 15:44 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2020-12-18 15:44     ` Pierre Neidhardt
@ 2020-12-18 19:38       ` Tobias Geerinckx-Rice
  2020-12-19 13:36         ` Tobias Geerinckx-Rice via
  2020-12-18 20:33       ` Maxim Cournoyer
  1 sibling, 1 reply; 13+ messages in thread
From: Tobias Geerinckx-Rice @ 2020-12-18 19:38 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: help-guix

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2020-12-18 15:44     ` Pierre Neidhardt
  2020-12-18 19:38       ` Tobias Geerinckx-Rice
@ 2020-12-18 20:33       ` Maxim Cournoyer
  1 sibling, 0 replies; 13+ messages in thread
From: Maxim Cournoyer @ 2020-12-18 20:33 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: help-guix

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2020-12-18 19:38       ` Tobias Geerinckx-Rice
@ 2020-12-19 13:36         ` Tobias Geerinckx-Rice via
  2020-12-20 13:57           ` Pierre Neidhardt
  2021-01-14 16:27           ` Maxim Cournoyer
  0 siblings, 2 replies; 13+ messages in thread
From: Tobias Geerinckx-Rice via @ 2020-12-19 13:36 UTC (permalink / raw)
  Cc: help-guix

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2020-12-19 13:36         ` Tobias Geerinckx-Rice via
@ 2020-12-20 13:57           ` Pierre Neidhardt
  2020-12-20 14:08             ` Pierre Neidhardt
  2021-01-14 16:27           ` Maxim Cournoyer
  1 sibling, 1 reply; 13+ messages in thread
From: Pierre Neidhardt @ 2020-12-20 13:57 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2020-12-20 13:57           ` Pierre Neidhardt
@ 2020-12-20 14:08             ` Pierre Neidhardt
  0 siblings, 0 replies; 13+ messages in thread
From: Pierre Neidhardt @ 2020-12-20 14:08 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2020-12-19 13:36         ` Tobias Geerinckx-Rice via
  2020-12-20 13:57           ` Pierre Neidhardt
@ 2021-01-14 16:27           ` Maxim Cournoyer
  2021-01-14 17:44             ` Tobias Geerinckx-Rice
  1 sibling, 1 reply; 13+ messages in thread
From: Maxim Cournoyer @ 2021-01-14 16:27 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice via

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2021-01-14 16:27           ` Maxim Cournoyer
@ 2021-01-14 17:44             ` Tobias Geerinckx-Rice
  2021-01-14 17:54               ` Maxim Cournoyer
  0 siblings, 1 reply; 13+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-01-14 17:44 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: Tobias Geerinckx-Rice via

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2021-01-14 17:44             ` Tobias Geerinckx-Rice
@ 2021-01-14 17:54               ` Maxim Cournoyer
  2021-01-18 17:37                 ` Pierre Neidhardt
  0 siblings, 1 reply; 13+ messages in thread
From: Maxim Cournoyer @ 2021-01-14 17:54 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: Tobias Geerinckx-Rice via

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Behaviour change when closing laptop lid: it no longer suspends
  2021-01-14 17:54               ` Maxim Cournoyer
@ 2021-01-18 17:37                 ` Pierre Neidhardt
  0 siblings, 0 replies; 13+ messages in thread
From: Pierre Neidhardt @ 2021-01-18 17:37 UTC (permalink / raw)
  To: Maxim Cournoyer, Tobias Geerinckx-Rice; +Cc: Tobias Geerinckx-Rice via

[-- 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 --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-01-18 17:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-18 13:28 Behaviour change when closing laptop lid: it no longer suspends Pierre Neidhardt
2020-12-18 14:02 ` Tobias Geerinckx-Rice
2020-12-18 15:25   ` Pierre Neidhardt
2020-12-18 15:44     ` Pierre Neidhardt
2020-12-18 19:38       ` Tobias Geerinckx-Rice
2020-12-19 13:36         ` Tobias Geerinckx-Rice via
2020-12-20 13:57           ` Pierre Neidhardt
2020-12-20 14:08             ` Pierre Neidhardt
2021-01-14 16:27           ` Maxim Cournoyer
2021-01-14 17:44             ` Tobias Geerinckx-Rice
2021-01-14 17:54               ` Maxim Cournoyer
2021-01-18 17:37                 ` Pierre Neidhardt
2020-12-18 20:33       ` Maxim Cournoyer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.