thexeno
Posts: 73
Joined: Thu Jan 03, 2013 1:23 am

(again) Raspberry Pi sleep/standby modes software support

Wed Jun 26, 2019 2:44 pm

Hi,

I read about the lack of support for the sleep mode. One may say that does not matter and dismiss the question like that, like many from the forum, but please don't do that. Not only is useless, but is like spam. So to me it does matter, or at least I am curious about, as first thing today is a power save mode, in any computational platform.

So we know, is not possible. But I wonder, why?
I truly don't care if non open-source is used to handle this power save mode, it is not an open source board anyhow, in some parts, whether is HW or FW/SW.

These BCM SoC I guessed are not only used in the Raspberry Pi, so I guess Broadcom have software support for them, for their customers. So I believe some kind of (closed) software may be distributed to be integrated into the Raspbian. Am I right?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23079
Joined: Sat Jul 30, 2011 7:41 pm

Re: (again) Raspberry Pi sleep/standby modes software support

Wed Jun 26, 2019 2:59 pm

If adding sleep mode was fairly easy it would have been done years ago. It's very much a non-trivial problem, it may even be unsolvable. There's nothing from Brcm, they are not interested, so any support would have to be done by us, and at present we have no plans for any advanced sleep support - there is much more important stuff to do.

I counted the number of SW engineers we have to support the Pi, 8 full time, 2 contractors. To do FKMS, Kernel support, Chromium optimisations, video drivers, camera and other peripheral support, Raspbian development, bug fixes and all the associated background tasks that go with all those. Now take a look at our bug backlog (350ish 'bugs' over the kernel and the firmware). So taking a good proportion of those engineers off what they are doing and putting them on some sort of sleep mode isn't a great use of engineering capability.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: (again) Raspberry Pi sleep/standby modes software support

Wed Jun 26, 2019 3:35 pm

Some more info in this thread:
https://www.raspberrypi.org/forums/view ... 3&t=243421
but although the pi4 is better than previous models - it shuts down to 20 mA - there is no standby/sleep as yet.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

thexeno
Posts: 73
Joined: Thu Jan 03, 2013 1:23 am

Re: (again) Raspberry Pi sleep/standby modes software support

Thu Jun 27, 2019 12:09 pm

jamesh wrote:
Wed Jun 26, 2019 2:59 pm
If adding sleep mode was fairly easy it would have been done years ago. It's very much a non-trivial problem, it may even be unsolvable. There's nothing from Brcm, they are not interested, so any support would have to be done by us, and at present we have no plans for any advanced sleep support - there is much more important stuff to do.

I counted the number of SW engineers we have to support the Pi, 8 full time, 2 contractors. To do FKMS, Kernel support, Chromium optimisations, video drivers, camera and other peripheral support, Raspbian development, bug fixes and all the associated background tasks that go with all those. Now take a look at our bug backlog (350ish 'bugs' over the kernel and the firmware). So taking a good proportion of those engineers off what they are doing and putting them on some sort of sleep mode isn't a great use of engineering capability.
Are these processors used also for other customers? I guess there are big customers who drive the development of the Broadcom SoCs, so they defined the sleep capability or not. Hence, if there is no SoC sleep functionality implemented in silicon, not even a big workforce can achieve that. General remark: if the ARM provides sleep functions, they need to be tightly correlated within the other analog&digital hardware/state machines in the silicon.
If is there is instead some proprietary support, then with the given APIs the community can work on that. And if that is the case and no (even proprietary) support is there, I would like to know the official answer, please :D . Unless a suspend-to-disk would already work, then removing power can be done from an external device or any engineering trick would work.

And if Broadcom is not interested, but the RPF does not focus on that because is not a priority, does that means that a silicon implementation of the sleep exists? (but with Broadcom not caring of providing support...) Because I wonder how a switch in priorities can make this happen if is not implemented the support in the silicon.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: (again) Raspberry Pi sleep/standby modes software support

Thu Jun 27, 2019 12:11 pm

It seems to me that it should be fairly simple to make a "standby HAT".

At the worst this would involve a microcontroller and a relay. The Pi would have to boot from standby mode, but that is fairly fast and programming could get it back to where it needed to be.

So the Raspi programs the HAT "wake me up when <event> happens" and then shuts down. The HAT might even wait a few seconds and then drop all power to the PI. It then goes into power-save itself. When the programmed event occurs, it restores power to the Pi. The Pi boots and a run-on-boot program restores whatever applications you want to run, which restore their state from files.

Does Debian ARM support Hibernate? Because that might work even better.

fanoush
Posts: 460
Joined: Mon Feb 27, 2012 2:37 pm

Re: (again) Raspberry Pi sleep/standby modes software support

Thu Jun 27, 2019 12:32 pm

jamesh wrote:
Wed Jun 26, 2019 2:59 pm
I counted the number of SW engineers we have to support the Pi, 8 full time, 2 contractors. To do FKMS, Kernel support, Chromium optimisations, video drivers, camera and other peripheral support, Raspbian development, bug fixes and all the associated background tasks that go with all those. Now take a look at our bug backlog (350ish 'bugs' over the kernel and the firmware). So taking a good proportion of those engineers off what they are doing and putting them on some sort of sleep mode isn't a great use of engineering capability.
This can be done gradually by community if datasheets/TRMs are available. First in baremetal projects like Ultibo or Circle, then in linux kernel for specific use cases and only then possibly in raspbian with X and stuff running (which is indeed hard). I would personally try this provided there is documentation but my life is too short for reverse engineering such stuff.

What I fear is that the board itself cannot do low power (even if SoC can sleep and wake up) because you even don't consider this when designing the board. Then of course this is all pointless.

thexeno
Posts: 73
Joined: Thu Jan 03, 2013 1:23 am

Re: (again) Raspberry Pi sleep/standby modes software support

Thu Jun 27, 2019 12:58 pm

fanoush wrote:
Thu Jun 27, 2019 12:32 pm
What I fear is that the board itself cannot do low power (even if SoC can sleep and wake up) because you even don't consider this when designing the board. Then of course this is all pointless.
Not necessarily. With a HAT or something in between on the power USB, with a full hibernation all can be turned off by removing power. But even then, would be beneficial also a hibernation for manual setups (putting removing cables with hands), just for commodity. I use that all the time (not on RPi of course).
fanoush wrote:
Thu Jun 27, 2019 12:32 pm
This can be done gradually by community if datasheets/TRMs are available.
So you assume the BCM chips have the functionality implemented. Would be nice to know if that is the case, even just out of curiosity and also if no support is provided (again, nice to know the why at least), to appreciate a bit more the complexity of the chip itself.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23079
Joined: Sat Jul 30, 2011 7:41 pm

Re: (again) Raspberry Pi sleep/standby modes software support

Thu Jun 27, 2019 1:06 pm

thexeno wrote:
Thu Jun 27, 2019 12:09 pm
jamesh wrote:
Wed Jun 26, 2019 2:59 pm
If adding sleep mode was fairly easy it would have been done years ago. It's very much a non-trivial problem, it may even be unsolvable. There's nothing from Brcm, they are not interested, so any support would have to be done by us, and at present we have no plans for any advanced sleep support - there is much more important stuff to do.

I counted the number of SW engineers we have to support the Pi, 8 full time, 2 contractors. To do FKMS, Kernel support, Chromium optimisations, video drivers, camera and other peripheral support, Raspbian development, bug fixes and all the associated background tasks that go with all those. Now take a look at our bug backlog (350ish 'bugs' over the kernel and the firmware). So taking a good proportion of those engineers off what they are doing and putting them on some sort of sleep mode isn't a great use of engineering capability.
Are these processors used also for other customers?
Not the Bcm2711.
thexeno wrote:
Thu Jun 27, 2019 12:09 pm
I guess there are big customers who drive the development of the Broadcom SoCs, so they defined the sleep capability or not. Hence, if there is no SoC sleep functionality implemented in silicon, not even a big workforce can achieve that. General remark: if the ARM provides sleep functions, they need to be tightly correlated within the other analog&digital hardware/state machines in the silicon.
If is there is instead some proprietary support, then with the given APIs the community can work on that. And if that is the case and no (even proprietary) support is there, I would like to know the official answer, please :D . Unless a suspend-to-disk would already work, then removing power can be done from an external device or any engineering trick would work.

And if Broadcom is not interested, but the RPF does not focus on that because is not a priority, does that means that a silicon implementation of the sleep exists? (but with Broadcom not caring of providing support...) Because I wonder how a switch in priorities can make this happen if is not implemented the support in the silicon.
I am not sure what features are built in to the silicon for sleep. I'm a software guy so look on it from that direction, and there is a considerable amount of work required to get the Videocore to be sleepable, in synchronisation with the Linux side. And the VC code is closed, so not possible for third parties to do the work (not that there is anyone outside of us who would know what to do).

There's a reason why laptops still sometimes have problems with sleep, even after 20 years of working on it - it's damn difficult to do.

As more and more code is moved to the ARM side, sleep becomes easier to do, but still not easy.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

PiGraham
Posts: 3568
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: (again) Raspberry Pi sleep/standby modes software support

Thu Jun 27, 2019 1:10 pm

If you can stand the boot time, and there are ways to get that pretty fast (ultibo, BuildRoot...) then there are various add-ons for power management and wakeup.

E.g. Witty Pi, Sleepy Pi.

Return to “General discussion”