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) |
RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2014-03-07 (2014-03-07, 23:21)vbat99 Wrote: Seems it doesn't like calling my script if run from rc.local It's calling your script OK, but the problem is that the PATH variable hasn't been set correctly now that its being called by rc.local, so cec-client can't be found when called from within your script. Either set and export PATH in your startup script as it is defined for the user pi ("echo $PATH" to view it, then add "export PATH=<paths>" to you startup script, before the sleep), or alternatively specify the full path when calling cec-client in your /home/pi/mythtv.sh script - run "which cec-client" to see the full path and then use that full path when calling cec-client, ie. change: Code: echo "standby 0" | cec-client -s >/dev/nul Code: echo "standby 0" | /usr/bin/cec-client -s >/dev/nul My choice would be to fix the PATH variable to avoid future problems, and running texturecache.py as the pi user (not root) would also avoid other problems (file ownership etc.) - maybe prefixing the call to texturecache.py with "su pi -c" will work, eg. "su pi -c /home/pi/texturecache.py @logfile=/home/pi/t3.txt etc." RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - vbat99 - 2014-03-08 Had to find where cec-client was located and for Raspbmc its in a couple of locations: Code: pi@raspbmc:/$ find . -name cec-client The .upgrade path isn't viable, so made changes and set as Code: #!/bin/bash But still have Code: 2014-03-08 12:53:20.065752:Thread-1 : bin.tvservice (checking if TV is powered on) calling subprocess [/home/pi/mytv.sh --status] Now, rc.local is Code: # By default this script does nothing. Code: sleep 20 && su pi -c /home/pi/texturecache.py @logfile=/home/pi/t4.txt @debug=yes @xbmc.host=localhost @bin.tvservice=/home/pi/mytv.sh rbphdmi 420 (Changed to 420 seconds so didn't have to wait as long) RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2014-03-08 (2014-03-08, 02:15)vbat99 Wrote: Had to find where cec-client was located and for Raspbmc its in a couple of locations: You've got a typo in the path for cec-client - it should be: Code: /opt/xbmc-bcm/xbmc-bin/bin/cec-client Code: /opt/xbmc-bmc/xbmc-bin/bin/cec-client (2014-03-08, 02:15)vbat99 Wrote: And I shoud change this to Actually, you may need to wrap the command being executed in quotes so that it's treated as one argument and not several: Code: sleep 20 && su pi -c '/home/pi/texturecache.py @logfile=/home/pi/t4.txt @debug=yes @xbmc.host=localhost @bin.tvservice=/home/pi/mytv.sh rbphdmi 420' & Code: (sleep 20 && su pi -c '/home/pi/texturecache.py @logfile=/home/pi/t4.txt @debug=yes @xbmc.host=localhost @bin.tvservice=/home/pi/mytv.sh rbphdmi 420') & RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - vbat99 - 2014-03-08 YES!!! Yes yes yes!!! It's A-Live!! Thank you Sooooo much for persevering with me. Don't know why I missed bmc suppose to be bcm I checked and re-checked before I posted. Dang it. One Happy Chappy here! (now to document it so I can remember it later.) RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2014-03-08 Glad you got there in the end! RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - vbat99 - 2014-03-17 So I got slammed at home the other night, when the wife switch from the Pi (HDMI1) to Freeview TV (HDMI3), and after 15 minutes, the Pi switched off the TV. LOL. Took me like 5 seconds to realize what had happened, while I was getting dirty looks from the other end of the room. So, a question
Little bit of googling looks like I have to figure out cec-client. If this is Off topic for this thread, let me know. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2014-03-17 (2014-03-17, 00:08)vbat99 Wrote: So, a question I would expect it is, the CEC-O-MATIC might provide some clues. (2014-03-17, 00:08)vbat99 Wrote: If this is Off topic for this thread, let me know. I'd say it has become OT as your remaining issues now concern generic CEC control rather than anything specific to enabling/disabling HDMI on the Pi when idle. A new thread with more appropriate title (and in the general section) may also get more eyes-on. Include a link here to any new thread as it may prove useful to anyone with the same problem. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - vbat99 - 2014-03-17 Thanks MilhouseVH You've been a great help. Will post any relevant info here for future reference to other users. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - schumi2004 - 2014-04-11 (2014-03-17, 00:28)vbat99 Wrote: Thanks MilhouseVH Nevermind. I'm running OpenELEC and this is for Raspbmc, right? RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2014-04-11 (2014-04-11, 17:10)schumi2004 Wrote: Nevermind. I'm running OpenELEC and this is for Raspbmc, right? No, it should work with any Raspberry Pi distribution. It's thoroughly tested on OpenELEC, but also works on Raspbmc with a bit of tweaking (basically just specify the location of the tvservice binary, and remove the unecessary delay that Raspbmc introduces before xbmc is restarted). No reason why it shouldn't also work with Xbian and Raspbian. For OpenELEC, just follow the original instructions in post #12. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - tkoorn - 2014-05-09 I am running raspbmc and using texturecache.py I can indeed get the display to go to sleep and wakeup. It would be fine except for those nasty ¨relax raspbmc will restart" messages. I have gotten rid of the one in xbmc-watchdog.sh but that doesn really seem to have any effect. Does anybody know where and how I can get rid of the "relax" dialog? RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - vbat99 - 2014-05-09 (2014-05-09, 01:33)tkoorn Wrote: I am running raspbmc and using texturecache.py I can indeed get the display to go to sleep and wakeup. It would be fine except for those nasty ¨relax raspbmc will restart" messages. I have gotten rid of the one in xbmc-watchdog.sh but that doesn really seem to have any effect. So you did this? Quote:You can eliminate the 10 second delay by commenting out the following line in /scripts/xbmc-watchdog.sh: I've got the restart to approx 20 seconds, but it's still a lengthy delay, specially as it is an actual restart of XBMC. Hopeful that popcornmix can fix the "virtual suspend" code for XBMC Helix.... RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - tkoorn - 2014-05-09 (2014-05-09, 03:26)vbat99 Wrote: So you did this? Yes I did comment out that line but it had no effect. I still get the relax dialog andrestart takes about 40 sec. Maybe I am editing the wrong file. there is also a file called console.py which looks like it also makes a relax dialog but I can't figure out where it is called from. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - vbat99 - 2014-05-09 Sorry, can't help any more than that. I'd almost say that relax dialogue is in Rasmbmc...Thought I'm still on miappa's build and haven't gotten to Sam's Gotham release yet. RE: XBMC on Pi: Add TV/monitor Power Save support when idle? - Milhouse - 2014-05-24 Good news, with the latest Raspberry Pi firmware (23 May 2014 onwards) and texturecache.py v1.6.1, it is no longer necessary to restart xbmc.bin when re-enabling HDMI. With the new firmware, "vcgencmd display_power 0" and "vcgencmd display_power 1" can be used to disable/enable HDMI. This method is less disruptive than "tvservice -o" or "tvservice -p", meaning that xbmc.bin doesn't need to be restarted. The path to the vcgencmd binary will try to be determined automatically, defaulting to /usr/bin/vcgencmd (OpenELEC default) and then using "which" to determine alternative locations if required. When this binary cannot be located (or the disable_power command is not supported) then existing xbmc.bin restart behaviour will be used. Specify the path to vcgencmd with @bin.vcgencmd if it cannot be found automatically. Now that @bin.tvservice will no longer be called to disable/enable HDMI whenever vcgencmd is used instead, I've added "@bin.ceccontrol" which can be set to the path of a script that will be called with "on" and "off" arguments whenever HDMI is enabled or disabled (either with tvservice or vcgencmd). Note that @bin.tvservice is still be used to check initial HDMI status, so continue to specify @bin.tvservice if you're using a non-default path (/usr/bin/tvservice) value for this binary. Specify @bin.ceccontrol if you were using @bin.tvservice to implement additional CEC functionality whenever tvservice is called. |