How to (try to) suspend and how to tell if it was suspended?
#1
There are quite a few threads around about the ability to use the battery-saving "suspend" feature — whether it works, what distros, what bootloaders, whether eMMC or SD etc.

I am currently playing with different distros/configurations and would like to know/undestand how to actually try to suspend before I can even see if it works. A number of questions here:
  • Where is the "Suspend" button in various GUIs (Phosh, Plasma etc.)?
  • Is it the same as screen lock?
  • When the phone has its screen dark/seemingly off, how to tell if it is actually suspended?
  • Is "suspend" the same feature as "sleep" and "standby", or are there nuances/differences?
  • How to try to suspend from command line? `systemctl suspend`?
  • Given that suspend is fully supported/enabled, when is the phone supposed to suspend automatically?
  • What about hibernation?

Thanks in advance  Rolleyes .
  Reply
#2
The questions you strikethrough, did you find the answers? why not posting answers to your own question? so anyone searching for the same answers they can read them here....

e.g.:
> Is it the same as screen lock?
no its not, screenlock just locks the screen, while the ppp can still be fully running without screen, for example while ssh into the phone.
  Reply
#3
(08-01-2022, 03:46 PM)magdesign Wrote: did you find the answers?

Yes.

(08-01-2022, 03:46 PM)magdesign Wrote: why not posting answers to your own question? so anyone searching for the same answers they can read them here....

There's no evidence yet that anyone needs those answers. I was perhaps too quick to post the questions as finding the answers wasn't too difficult then.
But if anyone really doesn't know the answers and needs them, I can supply them.
  Reply
#4
Please supply the answers in the original post. If we visit the post you can assume we would like to see the answer.
  Reply
#5
In case someone else is wondering, suspend is done automatically after 5 minutes to save battery (at least on Mobian with Phosh on the PinePhone).
Before going to suspend, the led should be blinking blue.

Note that it is recommended to disable suspend when upgrading the system and it can be done by adding the following in .bashrc (https://wiki.debian.org/Mobian/Tweaks#Suspend.2FSleep):
Code:
alias sudo='gnome-session-inhibit --inhibit suspend sudo'

To see if the alias works, you can use a command like "sudo journalctl -f" and check if the device is not going to sleep after 5 minutes with a command like "while true; do date; sleep 1; done" that should execute the command every seconds even when the device is locked.

The default alarm app gnome-clocks does not wake up from suspend but there is another one (currently limited to one alarm): https://gitlab.gnome.org/kailueke/wake-mobile
If you want to use gnome-clocks, someone also made a script to run after setting a new alarm so it will wake the phone from suspend (https://gitlab.com/mobian1/issues/-/issu..._547667815):
https://git.launchpad.net/debinst/tree/mobian/clks.sh (which depends on https://git.launchpad.net/debinst/tree/mobian/clks.py)
  Reply
#6
(08-20-2022, 08:55 PM)robocone Wrote: Please supply the answers in the original post. If we visit the post you can assume we would like to see the answer.

All answers below are for Phosh:
Where is the "Suspend" button in Phosh? - There is not one. Make your own desktop file. see below.
Is it the same as screen lock? - No. Lock screen and suspend are different.
When the phone has its screen dark/seemingly off, how to tell if it is actually suspended? - Suspend will turn off the notification LED.
Is "suspend" the same feature as "sleep" and "standby", or are there nuances/differences? - I will assume there is only suspend.
How to try to suspend from command line? `systemctl suspend`? 'systemctl suspend'
Given that suspend is fully supported/enabled, when is the phone supposed to suspend automatically? - Can change in settings. Default is 1 minute to lock and another minute to suspend.
What about hibernation? - I do not think this is an option.

My Desktop file:
cd /home/alarm/.local/share/applications
nano suspend.desktop

[Desktop Entry]
Name=Suspend
Type=Application
Icon=system-log-out
Exec=systemctl suspend
Categories=Utility;

'save and exit nano'
  Reply
#7
Hibernation requires physical swap at least as large as the RAM. The problem is, SSDs are prone to wearout when used for swap, and of course the PinePhone or PinePhone Pro (like all smartphones) does not have a magnetic hard drive, only SSD (FlashROM) storage (internal eMMC and optionally microSD; the PinePhone Pro also has SPI, used for booting only). So using a physical swap partition is not that great an idea, even if it may sound like one at first (allows hibernating, can help with the low amount of RAM). Which is why, as far as I know, all the distros use zram (compressed RAM as "swap") or no swap at all.

In addition, hibernation means the CPU is completely turned off, so it will likely not respond to wakeup requests from the modem, i.e., no incoming phone calls for you.

Those are the reasons why suspend (to RAM) is what everyone uses, not hibernate (suspend to disk).
  Reply
#8
(07-03-2024, 08:28 PM)Kevin Kofler Wrote: In addition, hibernation means the CPU is completely turned off, so it will likely not respond to wakeup requests from the modem, i.e., no incoming phone calls for you.

In Hibernation the phone is completely powered off - which includes the modem. As such, this state is useless for a phone. The only way to wake it up is the user pressing the power button.
Hibernation is only usefull for starting the device up faster than a normal boot; but as Kevin said, this has a had impact on the storage (SD/emmc) so should be avoided on a phone.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Camera stops working after resume from suspend jchw 3 1,579 07-30-2024, 05:52 AM
Last Post: DrYak
  Distro with suspend Frost1776 6 5,305 03-10-2022, 04:42 PM
Last Post: dukla2000

Forum Jump:


Users browsing this thread: 1 Guest(s)