XBMC on Pi: Add TV/monitor Power Save support when idle?

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Dec64 Offline
Senior Member
Posts: 171
Joined: Jan 2013
Reputation: 1
Post: #121
(2015-05-14 20:47)vbat99 Wrote:  
(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.

Weird i forced hotplug on and it seems to have fixed it for now..but will have to watch it.
find quote
bmac88 Offline
Junior Member
Posts: 16
Joined: Mar 2013
Reputation: 0
Post: #122
(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

I must be missing something here. I downloaded the zip and installed the pimon screensaver. It's active, but it doesn't have any configuration options, and just shows this rainbow cat character once it's activated. Is this supposed to be a joke, or what did I do wrong?
find quote
vbat99 Offline
Posting Freak
Posts: 1,213
Joined: Aug 2009
Reputation: 27
Location: New Zealand
Post: #123
It does work. On livingroom Pi and Samsung TV, the display goes black, and Sammy tv goes to standby after 5 minutes.

On daughter's Pi and LG TV, she see's the rainbow Cat, but I believe the display goes blank after some time....actually, I'll have to check myself tonight to be sure.

But it does work, think it depends if your paused video, or at a menu.

Media Companion Dev.
Media Companion - Kodi / XBMC - Media Companion
find quote
timker Offline
Junior Member
Posts: 4
Joined: May 2015
Reputation: 2
Post: #124
So the reason it shows the Nyan Cat, is because i used the Nyan Cat screensaver as base
For some reason your system doesn't support the method i used to disable hdmi, so it will show that cat instead!
Pretty much the exact opposite of what you want.


Maybe your os version doesn't support it? what are you running?



(Yesterday 05:57)bmac88 Wrote:  I must be missing something here. I downloaded the zip and installed the pimon screensaver. It's active, but it doesn't have any configuration options, and just shows this rainbow cat character once it's activated. Is this supposed to be a joke, or what did I do wrong?
find quote
vbat99 Offline
Posting Freak
Posts: 1,213
Joined: Aug 2009
Reputation: 27
Location: New Zealand
Post: #125
(Yesterday 09:38)timker Wrote:  So the reason it shows the Nyan Cat, is because i used the Nyan Cat screensaver as base
For some reason your system doesn't support the method i used to disable hdmi, so it will show that cat instead!
Pretty much the exact opposite of what you want.


Maybe your os version doesn't support it? what are you running?

Raspbmc - Working
OSMC RC3 - Not working.

Hmmm....Thanks for the info, was wondering why. I'll see if can get a log of the OSMC Pi sometime soon.

Media Companion Dev.
Media Companion - Kodi / XBMC - Media Companion
find quote
bmac88 Offline
Junior Member
Posts: 16
Joined: Mar 2013
Reputation: 0
Post: #126
(Yesterday 20:01)vbat99 Wrote:  
(Yesterday 09:38)timker Wrote:  So the reason it shows the Nyan Cat, is because i used the Nyan Cat screensaver as base
For some reason your system doesn't support the method i used to disable hdmi, so it will show that cat instead!
Pretty much the exact opposite of what you want.


Maybe your os version doesn't support it? what are you running?

Raspbmc - Working
OSMC RC3 - Not working.

Hmmm....Thanks for the info, was wondering why. I'll see if can get a log of the OSMC Pi sometime soon.

Yes, I am using OSMC RC3. I am sad that this does not work for this OS. Sad
(This post was last modified: Yesterday 20:32 by bmac88.)
find quote
Milhouse Offline
Team-Kodi Member
Posts: 6,086
Joined: Jan 2011
Reputation: 167
Post: #127
The screensaver is relying on the PATH variable to resolve the location of vcgencmd - see lines 43 and 49.

If the path for vcgencmd isn't already in the PATH variable then calls to vcgencmd will fail. Maybe the PATH variable for Raspbmc includes vcgencmd, while OSMC does not.

The addon could either search for vcgencmd and use the full path when calling vcgencmd or it can add the extra locations to the PATH variable during initialisation:

Code:
import os
...
os.environ["PATH"] += os.pathsep + '/opt/vc/bin'
in which case the existing calls should then work more reliably.

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.
find quote
bmac88 Offline
Junior Member
Posts: 16
Joined: Mar 2013
Reputation: 0
Post: #128
where would I put this line in the screensaver.py file to make it work?
(Yesterday 20:33)Milhouse Wrote:  os.environ["PATH"] += os.pathsep + '/opt/vc/bin'
find quote
Milhouse Offline
Team-Kodi Member
Posts: 6,086
Joined: Jan 2011
Reputation: 167
Post: #129
(Yesterday 21:02)bmac88 Wrote:  where would I put this line in the screensaver.py file to make it work?

Just make sure os.environ["PATH"] is updated once, before the first subprocess.call().

Adding it at line 58 before you create the Screensaver() object should be OK. Or alternatively, at line 43, inside the Screensaver.Init() method, before the call to subprocess.call().

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.
(This post was last modified: Yesterday 21:29 by Milhouse.)
find quote
bmac88 Offline
Junior Member
Posts: 16
Joined: Mar 2013
Reputation: 0
Post: #130
(Yesterday 21:26)Milhouse Wrote:  
(Yesterday 21:02)bmac88 Wrote:  where would I put this line in the screensaver.py file to make it work?

Just make sure os.environ["PATH"] is updated once, before the first subprocess.call().

Adding it at line 58 before you create the Screensaver() object should be OK. Or alternatively, at line 43, inside the Screensaver.Init() method, before the call to subprocess.call().

I tried line 43 and it did not work adding just the quote above (I did not add the import os and ...) and it failed.
I reverted that change and simply changed both instances of vcgencmd to use the absolute path of /opt/vc/bin/vcgencmd (line 43 and 49) and it worked! It is now turning off HDMI after the specified time and it wakes up when pressing a key on the remote.

For anyone using OSMC RC3, this seems to be the simplest fix.
find quote
Milhouse Offline
Team-Kodi Member
Posts: 6,086
Joined: Jan 2011
Reputation: 167
Post: #131
It's not going to work without the "import os" - you need to add both lines, the "import" at the top (line 25) and the second line at either line 43 or line 58.

However if you've got it working using an absolute path, timker should be able to fix it properly so that the addon works on all distributions (OpenELEC, Raspbmc, OSMC, Xbian, Raspbian etc.)

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.
find quote
Post Reply