How do I debug hibernation on the pinebook pro and what is the state of it?

I've had my pinebook pro about a month and every single time I want to put it on hold for more than a few minutes I just shut down the entire session. This is not ideal.

I've heard a little bit about differing success with different kernels and that suspend doesn't seem to affect the battery life, but not much about whether there's been any progress on hibernating.

I tested writing to the file /sys/power/state which contains "freeze mem disk", and the "freeze" (s2idle) state seems to be the only one that both goes through and resumes. It also appears going through systemd and using systemctl suspend might have fewer problems than using that file directly.

I tried making a swapfile (as this machine is not so much designed for partitions), and have verified it turns on at boot:

$ swapon --show
/swapfile  file        3G   0B   -2
/dev/zram0 partition 5.6G   0B  100

but I'm unsure how to tell if it's actually being used for hibernate or how to configure it as the "resume" device.
I have been searching around everywhere for information on uboot and how to change its parameters like every single page out there on hibernation tells you to do for grub but I haven't been able to find a single tutorial on that.
I also tried looking for errors in journalctl -xe -b but I couldn't find a single line about systemctl hibernate.

What happens when I run that is the screen turns off briefly, then turns back on for a bit, and then the machine turns all the way off but does not resume when it boots up. This seems like what my previous laptop did when hibernating correctly with the debian hibernate program, except it always had a TTY output explaining what was going on and this never seems to even if I run it on a TTY.

You might notice the swap file is a bit small versus the swap in RAM (zram), and that's because I tend to frequently get close to filling up the storage and only had 4.1 GiB left before making it.
I was hoping that maybe if I'm only using ~30% of RAM when I hibernate (as I usually am) the amount of data that has to go to the swapfile would be smaller, though I have absolutely no idea if that's how swap files actually work.
(I do understand that probably if I did get it working and had the RAM usage too high hibernation would fail, but if I knew it worked "sometimes" I could just clean my /home and expand the swapfile at that point)

inxi output:

The current kernel I tested systemctl hibernate with is "5.7.0-2-MANJARO-ARM aarch64" and I'm using the default KDE image with i3-wm installed.

The main issue is that the open source trustzone (TF-A) does not yet support suspend on the rk3399 platform, but it is being worked on by a couple of TF-A developers.
When that lands, regular suspend/hibernation should work, but we can't really test it.

When it arrives, we will mention it in the update post, for sure. :slight_smile:

1 Like

I'm not sure why sleep 3 is not good enough? ~7%/d (just sleeping)
/etc/systemd/sleep.conf,, SuspendState=mem ,,
and in systemsettings pwr button = ask (don't know for xfce)
But this is with mrfixit's uboot on emmc, manjaro on SD

Yes. It's using BSP uboot/Trustzone to do the sleep function. Not mainline. :slight_smile:

Forum kindly sponsored by