PINE64
Questions about deep sleep (crust) - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+--- Thread: Questions about deep sleep (crust) (/showthread.php?tid=12245)



Questions about deep sleep (crust) - rgybmc - 11-21-2020

I've got some questions about the pinephone's deep sleep (using crust) that I'm struggling to find answers to.

Firstly, how can I tell when/if the device goes into deep sleep, or if a distro even uses it?

Secondly, how is it activated? Is it done automatically as part of normal suspend-to-ram, or is it its own thing?

Last, are there any notable differences in how the device can be woken up from deep sleep compared to normal sleep? Mostly thinking of timers/alarms, but I can test those myself if I know the answers to the earlier questions.

Any information/documentation is appreciated Smile


RE: Questions about deep sleep (crust) - rgybmc - 11-22-2020

Ok, as often happens after asking a question, I've finally managed to find some useful information myself.



SXMO has a screenlock program[0] that their documentation specifies enters crust suspend/deep sleep. Looking through the source code provides some answers (assuming I've not somehow misinterpreted something).




It appears that the crust suspend is equivalent to a normal suspend-to-ram, which is activated when the string 'mem' is written to /sys/power/state while the file /sys/power/mem_sleep contains the string 'deep' (as opposed to 's2idle' or 'shallow').[1] Presumably if the crust firmware is present nothing else is needed.




The sxmo_screenlock code also strongly implies to me that all the usual methods of wakeup from suspend apply as well, since they make sure only the ones they're interested in are enabled.




I've not tested any of this, but it definitely looks like I may have been under the impression that the situation was much more complicated than it is Rolleyes




Posting this in case anyone else was wondering and is as unfamiliar with how this sort of stuff works as me.



[0] https://git.sr.ht/~mil/sxmo-docs/tree/master/USERGUIDE.md#strongscreen-lockstrong

[1] https://www.kernel.org/doc/html/v4.18/admin-guide/pm/sleep-states.html


RE: Questions about deep sleep (crust) - hex - 02-02-2021

Seems 100% identical to how it is handled on laptops, so I assume all standard userspace interfaces apply to PP too.