•   
  • 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 11
  •   
XBMC on Pi: Add TV/monitor Power Save support when idle?
This is amazing,
Thanks a lot Milhouse. My only problem with RPi+openelec is now solved as when hdmi goes off , all my systems goes off.

a small issue,
I am using kodi with several profiles, one for me and wife, one for kids and ...
I have had my kodi set to start on login screen so we can chose,
and your script cant find a JSON RPC, if we dont pick a profile in time, and after we login it wont start any more,
so I had to change the setting to load the last used profile and keep logging off and on ...
I checked logs and your script will stop when I log off from one profile and it start again when we log in to other, but it wont start from log in screen when it couldnt find the JSON RPC.

is it possible that your script wait for JSON RPC so that the second it finds the JSON RPC it starts, instead of raising 20 sec sleep time or ... ?
Reply
Just put the call to the script in a loop.

Edit: Actually you can increase the number of retry attempts by specifying a value for @rpc.retry - the default is 12 retry attempts, so just specify something like @rpc.retry=99999. There is a 5 second wait between each retry attempt (the wait period is not configurable) which will give you some idea how long the script will keep retrying before giving up completely (the default, 12, is obviously 1 minute before the script dies).
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
Awesome, Milhouse.
Thnx a lot
Reply
Hello Milhouse, thanks a lot for all your contributions and this script. I actually haven't tried it yet as what I'm attempting to do is simpler (I think).

I have a RPi hooked to a monitor (so no cec) and a pair of speakers (analog). I control the RPi with a IR remote or with my phone; the whole setup is placed above a door frame so the monitor power button is hard to reach. Half of the time I use the setup just for music and the other half I watch TV.

Until now I have been using Openelec 4.97.2 which is the latest version to include the suspend mode that allow me to turn off (standby) my monitor without using a chair Rofl I would very much like to update to 5.0.8

Ideally I would like to set the power button of my remote as a "vcgencmd display_power" toggle. My question is: If the monitor is off and I launch some music with my phone, will it be awaken?

I've found this script: https://discourse.osmc.tv/t/solved-error...-press/665 and I tried it but it doesnt work for me, I think paths are wrong since SteveM uses it for Raspbmc

Thanks in advance, I hope I was clear

EDIT: I just send the command vcgencmd display_power 0 and then launch music from the phone and it works! it doesn't wake up the monitor.. I have to make this works.. please help!
Reply
Milhouse, I asked on OSMC forums already but can you please give instructions on how to install this on OSMC please? Thanks very much!

****EDIT****
My solution, which seems to be working: Use systemd to start the service at boot (but waiting for Kodi to load!)

Install texturecache.py:
Code:
wget -q http://is.gd/XGXbTG -O ~/texturecache.py
chmod +x ~/texturecache.py

You can run this to test and see if it's working: (Add amount of seconds and/or & at the end of the line will tell it how many seconds to wait and send it in the background, respectively.)
Code:
~/texturecache.py @logfile= @xbmc.host=localhost @bin.tvservice=/opt/vc/bin/tvservice rbphdmi

Example 30 minutes:
~/texturecache.py @logfile= @xbmc.host=localhost @bin.tvservice=/opt/vc/bin/tvservice rbphdmi 1800

Example 30 minute and send to background:
~/texturecache.py @logfile= @xbmc.host=localhost @bin.tvservice=/opt/vc/bin/tvservice rbphdmi 1800 &

Create systemd timer & service files:
Code:
[email protected]:/etc/systemd/system$ cat texturecache.timer
[Timer]
OnBootSec=60

[Install]
WantedBy=multi-user.target
Code:
[email protected]:/etc/systemd/system$ cat texturecache.service
[Unit]
Description=Texturecache Daemon
After=mediacenter.service texturecache.timer

[Service]
User=osmc
Group=osmc

Type=simple
ExecStart=/usr/bin/python /home/osmc/texturecache.py @bin.vcgencmd=/opt/vc/bin/vcgencmd @logfile=/home/osmc/texturecache.systemd.log @xbmc.host=localhost @bin.tvservice=/opt/vc/bin/tvservice rbphdmi 1800 &
TimeoutStopSec=20

[Install]
WantedBy=multi-user.target

Both timer and service need to be enabled:
Code:
sudo systemctl enable texturecache.service
sudo systemctl enable texturecache.timer

If everything works right, the texturecache.timer waits 60 seconds after boot, then starts texturecache.service, which runs texturecache.py! This is my first time working with systemd so if you see something that needs fixing, please post it so I can fix mine.
Reply
Hi, I've created a screen saver addon which turns hdmi off and on for the raspberrypi

https://github.com/timker/kodi.screensaver.pimon


the zip is in the repo
Reply
(2015-05-03, 14:24)timker Wrote: Hi, I've created a screen saver addon which turns hdmi off and on for the raspberrypi

https://github.com/timker/kodi.screensaver.pimon


the zip is in the repo

Works a treat, thank you very much!
Reply
(2015-05-03, 14:24)timker Wrote: Hi, I've created a screen saver addon which turns hdmi off and on for the raspberrypi

https://github.com/timker/kodi.screensaver.pimon


the zip is in the repo

What method does it use to turn screen off & on?

Does kodi have to restart when waking the screen?
Reply
it uses the vcgencmd method described at the bottom on page 5

(2014-05-24, 00:53)Milhouse Wrote: 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.

So yeah, it doesn't need to be restarted Smile

FYI: I'm running a Pi2 with kodi on top of Raspbian (wheezy), with a Benq monitor
Reply
(2015-05-03, 14:24)timker Wrote: Hi, I've created a screen saver addon which turns hdmi off and on for the raspberrypi

https://github.com/timker/kodi.screensaver.pimon


the zip is in the repo

Thanks for the screen-saver. This works very well. Now the Pi switches off the HDMI, and for about 5 minutes the TV shows No Input message, then it goes to standby. And press a remote key, Pi and TV come back to life.

Cheers.
Reply
(2015-05-03, 14:24)timker Wrote: Hi, I've created a screen saver addon which turns hdmi off and on for the raspberrypi

https://github.com/timker/kodi.screensaver.pimon


the zip is in the repo

Very awesome. You should think about submitting this to the official Kodi.tv add-on repository.
Reply
@timker
Thanks for the addon, does it work if kodi is logged off and its on login page?
I have multiple profiles on my kodis ( kids profile, family profile, ...) and I wanted to use the new logoff addon so it log off and goes to login screen and in the mean time it turns off the screen.
is it possible ?
Reply
Hi papampi

I'm not really sure, as I don't have much experience with kodi... and i only use one profile... so i have never been on the login page

I guess it should be easy to turn the screen off, but i think the trick is turning is back on again

but maybe modify the logoff addon so it triggers the screen saver when logging off
List_of_built-in_functions (wiki) -> ActivateScreensaver

I'm not sure if screensavers are per profile?
Reply
Weird problem, my rpi2 wont come back on. As in HDMI. All i get is a black screen when, even after full reboots. If via SSH i type "vcgencmd display_power 1" it just returns display_power=0, seems it's stuck with HDMI disabled, anyway to fix this?
Reply
(2015-05-14, 20:28)Dec64 Wrote: Weird problem, my rpi2 wont come back on. As in HDMI. All i get is a black screen when, even after full reboots. If via SSH i type "vcgencmd display_power 1" it just returns display_power=0, seems it's stuck with HDMI disabled, anyway to fix this?

Had this myself on a Pi B twice, suppose you'd need logs to id what's going on....but the fault may not happen for a couple of days.
Reply
  •   
  • 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 11
  •   
 
Thread Rating:
  • 1 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
XBMC on Pi: Add TV/monitor Power Save support when idle?51