XBMC on Pi: Add TV/monitor Power Save support when idle? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166) +---- Thread: XBMC on Pi: Add TV/monitor Power Save support when idle? (/showthread.php?tid=163016) |
XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2013-04-22 Just wondering why XBMC on the Pi never allows the TV/monitor screen to switch off when XBMC is idle - at least, it's not happening for me with OpenELEC and an LG monitor which supports power save. I'm using the "Dim" screensaver, set to 3 minutes, and it forever remains on dim when I would expect it to eventually switch off the monitor after the screen has been dimmed for several minutes - this is how it works on x86 builds of OpenELEC, so why not the Pi? Re: XBMC on Pi: Add TV/monitor Power Save support when idle? - rikardo1979 - 2013-04-23 cec settings? RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2013-04-23 Its a monitor - it has no CEC support,, though CEC shouldn't be a pre-requisite for power saving, this has been a standard for 15+ years. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Ned Scott - 2013-04-23 I've seen it discussed before. IIRC, the PI can't reliably cut power to just HDMI on-the-fly without going into a kind of suspend mode that requires a reboot to get out of. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2013-04-23 (2013-04-23, 19:57)Ned Scott Wrote: I've seen it discussed before. IIRC, the PI can't reliably cut power to just HDMI on-the-fly without going into a kind of suspend mode that requires a reboot to get out of. There certainly seems to be some truth to this, as you can turn off the HDMI with Code: tvservice -o but turning HDMI back on with: Code: tvservice -p So is this just a firmware issue? It would be really nice if power save could be implemented successfully. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - popcornmix - 2013-04-23 (2013-04-23, 19:57)Ned Scott Wrote: I've seen it discussed before. IIRC, the PI can't reliably cut power to just HDMI on-the-fly without going into a kind of suspend mode that requires a reboot to get out of. Sure it can. "tvservice -o" will power off hdmi. "tvservice -p" will power it back on. Try it. Then re-launch xbmc and it will be fine. One issue is once it's powered back on the EGL context need to be recreated (hence the need to relaunch xbmc). But, I'm not aware of xbmc having any infrastructure for this - does it? RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2013-04-23 (2013-04-23, 20:09)popcornmix Wrote: One issue is once it's powered back on the EGL context need to be recreated (hence the need to relaunch xbmc). Ah right, yes that works... Code: rpi512:~ # tvservice -o and when XBMC restarts it is displayed correctly. (2013-04-23, 20:09)popcornmix Wrote: But, I'm not aware of xbmc having any infrastructure for this - does it? I'm guessing a lot of work will be needed to get it implemented, is there any way to preserve the EGL context (no idea what this means btw!) Or maybe we need a "special" Raspberry Pi screensaver that handles all of this, including re-creating the EGL context (preferably without restarting XBMC). RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - topfs2 - 2013-04-24 EGL Context i the window and what creates the GLES context (what we use for rendering). The current code isn't really written to handle a restart of just that subsystem afaik. But it might not be extremely hard to abstract it so that it can. Generally game engine uses handle based abstraction for this. Something which should be very doable to add to current code afaik. The code for general GUI rendering is semi localized to a few classes. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2013-04-24 That sounds promising, maybe something can be added in future updates to help the Pi. Assuming the Pi becomes extremely popular as an XBMC target (which seems fairly likely), enabling power saving features would be most beneficial (for the environment blah blah). RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - LStranger - 2013-05-01 I vote to make this possible as well, my relatives require this functionality because they go asleep fairly often while they watch movies and letting TV be always on is very bad for both environment and our electricity bills. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Boushard - 2013-10-27 Any development about this Add-On!?!? Just installed my Pi on a tv that have a shuntdown timer when no signal is detected!! RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2013-11-25 If anyone is desperate for a power saving feature - no matter how clunky - you might want to give the following script a go. It's been tested on the latest OpenELEC Gotham and Raspbmc builds. Does work with OpenELEC Frodo 3.x.x builds, however requires an extra hack to work around a couple of problems with OpenELEC Frodo. Installation SSH into your OpenELEC Pi as root, then run the following commands: Code: curl -Ls http://is.gd/XGXbTG -o /storage/texturecache.py And for Raspbmc owners: Code: wget -q http://is.gd/XGXbTG -O ~/texturecache.py The script is normally silent, but if you add @debug=yes to the command line it will generate some output, eg.: Code: Nov 26 10:01:39 rpi512 sh[1429]: [rbphdmi] Connecting to XBMC... To view these lines, use the following commands: OpenELEC Gotham: Code: journalctl --follow | grep rbphdmi Code: tail -f /var/log/messages | grep rbphdmi Remember there is a 20 second delay before the script starts (when using OpenELEC), as it needs to wait until the JSON RPC server is enabled. Increase this "sleep" value if your system is slower to start. You'll also need to enable the following two options in Settings -> Services -> Remote control: Code: Allow programs on this system to control XBMC If you also want CEC control whenever HDMI is disabled or enabled, see the instructions in post #17. This is not an addon or a screensaver, it's a script (daemon) that monitors JSON notifications and when it sees that the screensaver has been activated it starts a timer that will, when it elapses (default 900 seconds), remove HDMI power with a call to "tvservice --off". If the screensaver is deactivated before the timer has elapsed, the timer is cancelled and the system continues normally. When the screensaver is deactivated through user activity and HDMI power is off, the HDMI power will be restored (tvservice --preferred) followed by a JSON call to Application.Quit() so that XBMC terminates and is automatically restarted - not rebooted - and the EGL context restored. This takes about 15 seconds from deactivating the screensaver to the menu re-appearing on a 1GHz Pi running a nightly build of OpenELEC Gotham. Update: When using Raspberry Pi firmware from 23 May 2014 onwards (check with vcgencmd version), "vcgencmd display_power 0" and "vcgencmd display_power 1" will be used to disable/enable HDMI as this method does NOT require xbmc.bin to be restarted. See this post for further details. Configure the delay between the screensaver starting and HDMI power being terminated by specifying a value (in seconds) in /storage/.config/autostart.sh, for instance if you want a delay of 30 minutes (1800 seconds) change the line to: Code: (sleep 20 && /storage/texturecache.py @logfile= @xbmc.host=localhost rbphdmi 1800) & Yes, it's a clunky solution but hey, it does at least work and until there's a proper solution, it's all there is! RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2013-11-26 Updated previous post to reflect the fact that Raspberry Pi HDMI power management is now an integrated function of texturecache.py (it's got all the JSON and auto-update plumbing, so the extra code isn't significant even if it doesn't seem like the obvious choice). This makes it a much more efficient and lighter weight process, plus it's a bit smarter as it now won't disable HDMI while a player or library scan is active - it will wait until both the player and library are inactive. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - doveman2 - 2013-12-14 Does this confer any significant power savings on the RPi itself or is it only for the display, so that if I'm turning off the TV when not watching it, it's not worth doing? RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2013-12-14 Correct, not worth doing if you normally turn off the display. Its primary purpose is to save TV power consumption if you have a tendency to leave the display on while the Pi is not being used. You could still use this script even if you normally turn off your display, as it will not do anything if it can detect when the display has been powered off, and will only kick in whenever you actually leave the display on. However not all displays will indicate if they are on or off, check if "tvservice --status" returns a different status when your display is on and then when powered off. If the status is the same then the script will not be able to detect when the display is off, and will always power off the HDMI (requiring an XBMC restart) even if you power off the display, in which case you'll have to decide if this script is useful for you or not (minor inconvenience and only a small power saving). For those that leave their display on often, they should see a minor inconvenience (xbmc restart) but fairly significant power saving. |