Pi: Put display to sleep?
Chris Mahoney (1684) 2165 posts |
In Configure/Screen, there is a “DPMS” screen saver which currently does nothing more than turning the screen black. Presumably it’s supposed to put the display to sleep, but I also assume that there have historically been complications with the Pi’s odd graphics architecture. CVS was updated a few days ago with an implementation of VCGenCmd. It’s now possible to enter *VCGenCmd display_power 0 to put the screen to sleep, and *VCGenCmd display_power 1 to wake it up again. This works on my Pi 1, at least. The graphics driver is supposed to enable/disable the display in response to GraphicsV 4. I haven’t looked at the source, but presumably the DPMS screen saver uses this vector. How practical is it to update BCMVideo to effectively issue a VCGenCmd display_power command in response to GraphicsV 4? If everything works the way that I think/hope it does, then that should be enough to get proper display sleep working. And that means I’ll probably stop turning the machine off every night :) Thoughts? Do any experts know how much work this would be? |
John Williams (567) 768 posts |
I just turn the monitor off! But it’s a good point! |
Jeffrey Lee (213) 6048 posts |
There’s an undocumented hdmi_blanking config.txt option which will control whether DPMS is used when the screen is blanked. Setting it to 1 should do the trick. Apparently they can’t enable that option by default because it causes problems with software which doesn’t use the standard framebuffer: https://github.com/raspberrypi/linux/issues/487 I’ll have a think about whether there’s an easy way of making the OS use display_power – possibly this issue needs fixing first (GraphicsV_SetBlank needs to support being called from an interrupt handler, but *vcgencmd is a bit heavyweight for that, so delaying the blank/unblank until a callback or RTSupport routine would be required – for which we’d also need to make sure no interrupt handlers can get stuck waiting for VSync) |
John Williams (567) 768 posts |
That doesn’t seem to make any difference – the screen just blanks the same as before – that is, it’s still working. |
Jeffrey Lee (213) 6048 posts |
It worked when I tried it – perhaps your firmware is too old? (over 1 year old?) I’m not sure when the option was first introduced. |
Chris Mahoney (1684) 2165 posts |
Thanks. I’ll give that a go tomorrow.
Nothing is ever simple! :) Don’t worry about it; if there’s already a functional solution then there’s no reason to “hack around” in VCGenCmd. |
Steve Pampling (1551) 8172 posts |
Speaking from memory of use of screen blanking on older machines and older displays then perhaps what you describe is a reflection of the capabilities of the display? Some units seem to power down the display when blanked while others simply blank (blackout) the screen. |
David Pitt (102) 743 posts |
Works here on an RPi3 with the following firmware :- bootcode.bin 31May16 fixup.dat 11Oct16 start.elf 13Oct16 Thanks for the tip, a welcome feature. |
John Williams (567) 768 posts |
Where may I find the latest firmware? |
John Williams (567) 768 posts |
Belay that! |
Chris Mahoney (1684) 2165 posts |
hdmi_blanking=1 confirmed working on my system. Thanks for the tip. As far as I’m concerned, this “wish” can now be cancelled :) |
John Williams (567) 768 posts |
OK, having upgraded to firmware 9th Dec 16, I find that adding the Config line hdmi_blanking=1 makes no difference here. I already had a screenblanker set in Config>Screen of DPMS blank delay 10 min. This, when operational, blanked the screen on my PL2409HD (Iyama) monitor¹ to give a slightly illuminated dark grey screen – the monitor was already displaying what, I assume, the RPi was sending as “black”. I had hoped that the Config line would make this even blacker by either sending nothing at all, or actually switching the monitor to a sleep mode – but, apparently, not so. So – what am I missing here? Is my monitor incapable of receiving a sleep mode command, are the other respondents mistaking a previously-untried DPMS setting for a miracle – or what? I am, to be completely transparent, using the AnyMode module to achieve my preferred screen mode. Could this make a difference? ¹I think of it as quite modern – but then I remember the Coronation! |
Chris Mahoney (1684) 2165 posts |
It’s definitely going into full sleep for me, with a Philips of some description (I don’t have the exact model number handy). I’m using an HDMI cable, connected via an adapter to the DVI port. I do not currently have AnyMode installed. |
John Williams (567) 768 posts |
Well I guess I’m just a bit unlucky then – nice to have it clarified! Thanks! |
John Williams (567) 768 posts |
This works now! The reason was that I had somehow switched the active boot partition to another location on the boot disc, and I was updating files in a ghost DOS image within Boot! This also caused other problems as well! My apologies! |