Discussion:
system won't suspend automatically
(too old to reply)
Eben King
2024-06-10 19:10:01 UTC
Permalink
Hi, I have a Debian 12 (Bookworm?) installation with XFCE as my DE. I have
three monitors, the left one is rotated CW so it's tall, and because lightdm
can't seem to get that or the monitor positions correct I wrote a script
that calls xrandr to set things up.

I thought the errors from the monitor setup script (before I fixed it) were
what was keeping the system from suspending. But now I've fixed the errors
and it still doesn't suspend over night. Suspend works just fine when I go
to log out and hit the suspend button. I don't see any obvious errors in
journalctl. Where can I go to debug suspend? Thanks.

--
Thou shalt keep thine tongue prosperous, and thy mind numb. -Lusers 4:9
And if thy head doth leave thine own arse, thou shalt shove it back in.
For in such a way does it keep thy minimal knowledge from leaving thine
own head. -- Lusers 4:10-11 (ItsDragoniteBitches and mephron on Reddit)
David Wright
2024-06-10 21:00:02 UTC
Permalink
Post by Eben King
Hi, I have a Debian 12 (Bookworm?) installation with XFCE as my DE. I have
three monitors, the left one is rotated CW so it's tall, and because lightdm
can't seem to get that or the monitor positions correct I wrote a script
that calls xrandr to set things up.
I thought the errors from the monitor setup script (before I fixed it) were
what was keeping the system from suspending. But now I've fixed the errors
and it still doesn't suspend over night. Suspend works just fine when I go
to log out and hit the suspend button. I don't see any obvious errors in
journalctl. Where can I go to debug suspend? Thanks.
Does xset -q show you anything like below?

$ xset -q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000000
XKB indicators:
00: Caps Lock: off 01: Num Lock: off 02: Scroll Lock: off
03: Compose: off 04: Kana: off 05: Sleep: off
06: Suspend: off 07: Mute: off 08: Misc: off
09: Mail: off 10: Charging: off 11: Shift Lock: off
12: Group 2: off 13: Mouse Keys: off
auto repeat delay: 660 repeat rate: 25
auto repeating keys: 00ffffffdffffbbf
fedfffefffedffff
9fffffffffffffff
fff7ffffffffffff
bell percent: 50 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 2/1 threshold: 4
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 1000 cycle: 1000
Colors:
default colormap: 0x20 BlackPixel: 0x0 WhitePixel: 0xffffff
Font Path:
/usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins
DPMS (Energy Star):
Standby: 1000 Suspend: 1000 Off: 1000
DPMS is Enabled
Monitor is On
$
Post by Eben King
Thou shalt keep thine tongue prosperous, and thy mind numb. -Lusers 4:9
Thy tongue.

Cheers,
David.
e***@gmx.us
2024-06-10 21:30:01 UTC
Permalink
Post by David Wright
Post by Eben King
Hi, I have a Debian 12 (Bookworm?) installation with XFCE as my DE. I have
three monitors, the left one is rotated CW so it's tall, and because lightdm
can't seem to get that or the monitor positions correct I wrote a script
that calls xrandr to set things up.
I thought the errors from the monitor setup script (before I fixed it) were
what was keeping the system from suspending. But now I've fixed the errors
and it still doesn't suspend over night. Suspend works just fine when I go
to log out and hit the suspend button. I don't see any obvious errors in
journalctl. Where can I go to debug suspend? Thanks.
Does xset -q show you anything like below?
$ xset -q
Keyboard Control:...
***@cerberus:~$ xset -q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00002002
XKB indicators:
00: Caps Lock: off 01: Num Lock: on 02: Scroll Lock: off
03: Compose: off 04: Kana: off 05: Sleep: off
06: Suspend: off 07: Mute: off 08: Misc: off
09: Mail: off 10: Charging: off 11: Shift Lock: off
12: Group 2: off 13: Mouse Keys: on
auto repeat delay: 500 repeat rate: 20
auto repeating keys: 00ffffffdffffbbf
fadfffefffedffff
9fffffffffffffff
fff7ffffffffffff
bell percent: 50 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 2/1 threshold: 4
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 600
Colors:
default colormap: 0x20 BlackPixel: 0x0 WhitePixel: 0xffffff
Font Path:

/usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins
DPMS (Energy Star):
Standby: 1200 Suspend: 0 Off: 1800
DPMS is Enabled
Monitor is On

Like that, yes. What am I looking for? The DPMS stuff is just for
monitors, correct?
Post by David Wright
Post by Eben King
Thou shalt keep thine tongue prosperous, and thy mind numb. -Lusers 4:9
Thy tongue.
This is correct. I'll change it, and note the change.

Dang, it's too easy to just do ^R and not hit "reply list". Maybe there's a
key command. I'll look into that.

--
"The reason that the American Army does so well, is that war is chaos,
and the American Army practices chaos on a daily basis."
-Nazi German Officer
David Wright
2024-06-11 04:00:01 UTC
Permalink
Entire attribution and quote removed to avoid the mailing list
treating this post as spam.

Yes, but I don't know enough about modern monitor connections to know
whether the monitor being on will inhibit the system from suspending.

The docs for XFCE talk about preventing inconsistent configuration
timings of the several modes, but I don't know (not using XFCE)
how far this is carried between display management and system power
management, or between the kernel's, X's, and XFCE's controls.

Sorry not to be more help.

Cheers,
David.
Ralph Katz
2024-06-11 01:30:02 UTC
Permalink
Post by Eben King
Hi, I have a Debian 12 (Bookworm?) installation with XFCE as my DE.
[...]
Post by Eben King
and it still doesn't suspend over night.  Suspend works just fine when I go
to log out and hit the suspend button.   I don't see any obvious errors in
journalctl.  Where can I go to debug suspend?  Thanks.
I also have bookworm, XFCE and a suspend issue. Dell laptop suspends on
lid close, but with an attached monitor, it does not suspend on lid close.

As a workaround, I use a keyboard shortcut to suspend. Closing then
opening the lid wakes it up.

I'm eager to see how you resolve this. If you file a bug, please post
the number so I can add my case.

Regards,
Ralph
e***@gmx.us
2024-06-11 14:50:01 UTC
Permalink
Post by Eben King
Hi, I have a Debian 12 (Bookworm?) installation with XFCE as my DE.
[...]
Post by Eben King
and it still doesn't suspend over night.  Suspend works just fine when I go
to log out and hit the suspend button.   I don't see any obvious errors in
journalctl.  Where can I go to debug suspend?  Thanks.
I also have bookworm, XFCE and a suspend issue.  Dell laptop suspends on lid
close, but with an attached monitor, it does not suspend on lid close.
As a workaround, I use a keyboard shortcut to suspend.  Closing then opening
the lid wakes it up.
I'm eager to see how you resolve this.  If you file a bug, please post the
number so I can add my case.
Well, that is not encouraging. Does anyone know how to get the monitor
state programmatically? I'll write my own script based on that. DFMS
works. I mean if the computer won't do it for you, roll your own.

--
The best answer when anybody asks you
if you're any good with explosives
is to hold up two open hands
and simply say "Ten". -- Anthony DeBoer on ASR
Charles Curley
2024-06-11 16:40:01 UTC
Permalink
On Tue, 11 Jun 2024 10:44:12 -0400
Post by e***@gmx.us
Well, that is not encouraging. Does anyone know how to get the
monitor state programmatically? I'll write my own script based on
that. DFMS works. I mean if the computer won't do it for you, roll
your own.
Install arandr, use it to set things up the way you want them. Then
have it emit a suitable script. Call that from XFCE's session manager
on startup.
--
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/
e***@gmx.us
2024-06-11 17:10:01 UTC
Permalink
Post by Charles Curley
On Tue, 11 Jun 2024 10:44:12 -0400
Post by e***@gmx.us
Well, that is not encouraging. Does anyone know how to get the
monitor state programmatically? I'll write my own script based on
that. DFMS works. I mean if the computer won't do it for you, roll
your own.
Install arandr, use it to set things up the way you want them. Then
have it emit a suitable script.
OK, no problem. The script I wrote uses xrandr to do that exact thing.
Post by Charles Curley
Call that from XFCE's session manager on startup.
How exactly do I do that, and why would it re-enable suspension?

--
"Cheating is the gift man gives himself." - Mr. Burns, The Simpsons.
Max Nikulin
2024-06-11 16:40:01 UTC
Permalink
Post by e***@gmx.us
Does anyone know how to get the monitor
state programmatically?
ddccontrol

However I am lost if you need to put your monitor to standby state (or
to turn it off) or you expect suspend to RAM after some period of
inactivity or when lid is closed. In the latter case check power and
display settings in your DE configuration.
e***@gmx.us
2024-06-11 17:00:02 UTC
Permalink
Post by Max Nikulin
Post by e***@gmx.us
Does anyone know how to get the monitor
state programmatically?
ddccontrol
Thanks.
Post by Max Nikulin
However I am lost if you need to put your monitor to standby state (or to
turn it off) or you expect suspend to RAM after some period of inactivity or
when lid is closed. In the latter case check power and display settings in
your DE configuration.
I'll probably watch ddcontrol, and if the monitors go into <some state> and
stay there for 30m or an hour, suspend. Maybe even have it
user-configurable if I feel frisky. Maybe even do what it's _supposed_ to
do, but you gotta pay extra for that.
e***@gmx.us
2024-06-13 14:50:01 UTC
Permalink
Post by Eben King
Post by Max Nikulin
Post by e***@gmx.us
Does anyone know how to get the monitor
state programmatically?
ddccontrol
Thanks.
Post by Max Nikulin
However I am lost if you need to put your monitor to standby state (or to
turn it off) or you expect suspend to RAM after some period of inactivity or
when lid is closed. In the latter case check power and display settings in
your DE configuration.
I'll probably watch ddcontrol, and if the monitors go into <some state> and
stay there for 30m or an hour, suspend.
Well that's a no-go, because when you de-power the monitors, ddccontrol
gives you no info about what sleep state they're in. Reasonable, I guess.

So I'm back to doing it manually, until I figure out what's wrong.

Something came to mind: A while back when automatic suspension worked, I got
an error that it failed because the swap partition ran out of room. I guess
it was doing hybrid sleep and there was too much stuff in swap already? The
old partition was the same size as RAM, and the new one is 1.5x. I did
these steps to upgrade:

Make a new swap partition
swapon the new one
swapoff the old one
remove the old swap partition

There wasn't room on the hard drive to just enlarge the old one without
spending a lot of time moving partitions around. Some time then or after,
automatic suspension stopped working. Do I have to tell something the UUID
of the new swap partition, or does it figure it out?

--
Information is more dangerous than cannon to a society ruled by lies.
--James M Dakin (from RT, S)
Max Nikulin
2024-06-13 16:00:02 UTC
Permalink
Post by e***@gmx.us
Well that's a no-go, because when you de-power the monitors, ddccontrol
gives you no info about what sleep state they're in.  Reasonable, I guess.
Perhaps there is a command to put the monitor in standby state instead
of power off. Maybe it is possible detect switched off state by reading
some file in /sys.

You still mix monitor and system issues. E.g. a media player may inhibit
power saving for monitors. I have seen that sometimes suspend to disk
(hibernate) is blocked, but I do not know details. An obvious reason is
full swap, so RAM can not be saved there. Perhaps suspend to RAM may be
blocked as well.
Post by e***@gmx.us
There wasn't room on the hard drive to just enlarge the old one without
spending a lot of time moving partitions around.  Some time then or after,
automatic suspension stopped working.  Do I have to tell something the UUID
of the new swap partition, or does it figure it out?
Update grub and initramfs configuration.
e***@gmx.us
2024-06-13 16:30:01 UTC
Permalink
Post by e***@gmx.us
Well that's a no-go, because when you de-power the monitors,
ddccontrol gives you no info about what sleep state they're in.
Reasonable, I guess.
Perhaps there is a command to put the monitor in standby state instead of
power off. Maybe it is possible detect switched off state by reading some
file in /sys.
You still mix monitor and system issues. E.g. a media player may inhibit
power saving for monitors. I have seen that sometimes suspend to disk
(hibernate) is blocked, but I do not know details.
It's blocked by something, to be sure. I don't think it's a failing monitor
config script, since it doesn't get errors any more.
An obvious reason is full swap, so RAM can not be saved there. Perhaps
suspend to RAM may be blocked as well.
Swap is nearly empty, all the time. Right now, for example:

***@cerberus:~$ free
total used free shared buff/cache available
Mem: 32294664 26585308 3050572 5360560 8486244 5709356
Swap: 0 0 0

***@cerberus:~$ uptime
12:14:13 up 4 days, 22:00, 2 users, load average: 1.14, 1.19, 1.34

So it's not a "just booted" situation.
Post by e***@gmx.us
Do I have to tell something the UUID of the new swap partition, or does
it figure it out?
Update grub and initramfs configuration.
Right, I found this page

https://wiki.debian.org/Hibernation#Changing_or_moving_the_swap_partition

edited /etc/initramfs-tools/conf.d/resume to say

RESUME=PARTLABEL=swap

and ran "sudo update-initramfs -u". It exited successfully, with no errors
or warnings. That won't take effect until I boot on Saturday, and I won't
know if it worked until Sunday morning. If I change my swap partition
again, I'll also name the new one "swap" so this might keep working.


--
Actually, we have scientifically determined
that Heisenberg did indeed sleep exactly here.
However, we have no idea whatsoever just how fast asleep he was.
-- Dave Aronson on ASR
David Wright
2024-06-13 20:00:01 UTC
Permalink
Post by e***@gmx.us
Swap: 0 0 0
You have no swap.

Cheers,
David.
e***@gmx.us
2024-06-13 20:10:01 UTC
Permalink
Post by David Wright
Post by e***@gmx.us
Swap: 0 0 0
You have no swap.
Well, that's another good reason it won't work.

1. Fix /etc/fstab so it has
PARTLABEL=swap none swap sw 0
0

2. Run "sudo swapon PARTLABEL=swap"

***@cerberus:~$ free
total used free shared buff/cache available
Mem: 32294664 27093456 2039172 5259032 8887968 52012
Swap: 50331644 0 50331644

Thanks.

--
They that can give up essential liberty to
obtain a little temporary safety deserve
neither liberty nor safety. -- Ben Franklin

Loading...