Thread Rating:
  • 1 Vote(s) - 5 Average
Work in Progress - Screensaver Disable RPI Backlight
#1
Hello,

I use a Raspberry Pi 3 together width the official 7" Display and Kodi as an audio player. At the beginning I use the screensaver "Black". But there are two problems width this:

1. The display isn't really black because the backlight is always on. So, you can see the display glowing in a dark room.
2. Touching the Display stops the screensaver and, in addition, starts the action on the screen behind the screensaver. Because of this I often switch to another song when I touch the display.

To get a better solution I wrote a new Screensaver: The Disable RPI Backlight Screensaver

This Screensaver only supports Kodi, installed on a Linux distribution (i.E. LibreElec), running on a Raspberry Pi connected to the official 7" Display. When somebody is out there with such a set-up, please test it and tell me your opinion. Thanks.


The plugin can downloaded from Github: https://github.com/sebastiansIT/RPI-Disp...sabler.zip

The source code is under GPLv3 also on Github: https://github.com/sebastiansIT/RPI-Disp...t-disabler
Reply
#2
Thanks for this - just what I was looking for, although I've adapted it slightly so that it works with a "standard" external HDMI EnergyStar-compliant monitor. To do this replace two lines in screensaver.py:

Code:
shellCommand = 'echo 1 > /sys/class/backlight/rpi_backlight/bl_power'
and
Code:
shellCommand = 'echo 0 > /sys/class/backlight/rpi_backlight/bl_power'

with...

Code:
shellCommand = 'vcgencmd display_power 0'
and
Code:
shellCommand = 'vcgencmd display_power 1'

which toggles the HDMI monitor powersaving / standby on & off from my Slice (RPi-based player)

Also - the current downloadable ZIP packaging won't allow the Addon to be manually installed, at least under Kodi 17. Needs to be structured as per here: http://stackoverflow.com/questions/28286...-incorrect with all files in a top-level folder within the ZIP named as per the Addon.

Thanks for a VERY useful addon,
Brgds Phil
Reply
#3
To support the package structure of Kodi 17.0, I have released an update to version 0.1.1. It's functional the same as the version 0.1.0, only changed the addon.xml and the packaging.
Reply
#4
Hello, to get yr screen saver works on OpenElec, OSMC, LibreElec you need to be root to send the command

i propose this

Code:
def onInit(self):
        self.log('Start Screensaver')
        self.exit_monitor = self.ExitMonitor(self.exit)
        shellCommand = 'echo 1 > /sys/class/backlight/rpi_backlight/bl_power'
    if os.geteuid() != 0:
        shellCommand = 'sudo bash -c \'' + shellCommand + '\''      
    os.system(shellCommand)

    def exit(self):
        self.exit_monitor = None
        shellCommand = 'echo 0 > /sys/class/backlight/rpi_backlight/bl_power'
    if os.geteuid() != 0:    
        shellCommand = 'sudo bash -c \'' + shellCommand + '\''
    os.system(shellCommand)
        self.close()
        self.log('Stop Screensaver')

inspired by https://github.com/marklam/PiTsOff/blob/...ensaver.py

Working on my OSMC box !

@+
Reply
#5
Hi airvb,

thanks for your tip. Can you tell me in which distribution Kodi isn't run with the root account? I use LibreElec at the moment and it works well without sudo.
Reply
#6
(2017-03-27, 19:11)SebastiansIT Wrote: Hi airvb,

thanks for your tip. Can you tell me in which distribution Kodi isn't run with the root account? I use LibreElec at the moment and it works well without sudo.

I try again with OSMC fresh install without sudo tip , not working

Ok with sudo !
Reply
#7
(2016-09-04, 12:34)SebastiansIT Wrote: Hello,

I use a Raspberry Pi 3 together width the official 7" Display and Kodi as an audio player. At the beginning I use the screensaver "Black". But there are two problems width this:

1. The display isn't really black because the backlight is always on. So, you can see the display glowing in a dark room.
2. Touching the Display stops the screensaver and, in addition, starts the action on the screen behind the screensaver. Because of this I often switch to another song when I touch the display.

To get a better solution I wrote a new Screensaver: The Disable RPI Backlight Screensaver

This Screensaver only supports Kodi, installed on a Linux distribution (i.E. LibreElec), running on a Raspberry Pi connected to the official 7" Display. When somebody is out there with such a set-up, please test it and tell me your opinion. Thanks.


The plugin can downloaded from Github: https://github.com/sebastiansIT/RPI-Disp...sabler.zip

The source code is under GPLv3 also on Github: https://github.com/sebastiansIT/RPI-Disp...t-disabler

I just tried your Addon with "OpenELEC-RPi2.arm-8.0.4.img" (Krypton) and its working just fine.
(Raspberry Pi 3 + 7" Pi touchscreen)

Thank you!
Reply
#8
Is there a way to integrate this method into the Shutdown-script?
(Openelec 8.0.4 / Kodi Krypton)

btw.
Your screensaver is working perfectly...Thank you again.
It would be really nice to have an option within your Screensaver to select a "starting screensaver")

This way you could start the selected "starting Screensaver" first, and after XY-Min. your Screensaver starts-up to disable the Screen.
Just a small idea because i like to display different informations as Screensaver like Weather, Time, Date ...

greetings from Germany
Danke nochmal Wink
Reply
#9
Hi Doerek,

which method to you wish to integrate on shut down? Disabling the Display is a natural feature of power less devices Smile

I don't know if a screensaver can control another screensaver. I think the other way is much easier to implement: Look for your favourite screensaver and ask the author to integrate a function to dim the display after x minutes.

Thanks (also from Germany) for your feedback.
Reply
#10
(2017-08-03, 19:32)SebastiansIT Wrote: Hi Doerek,

which method to you wish to integrate on shut down? Disabling the Display is a natural feature of power less devices Smile

Hi,

I thought perhaps there could be a quick'n dirty (easy) way to disable the Touchscreens' Backlight right before the Pi shuts down completly. (Openelec 17; Krypton)
Because...if you power down the Pi and leave it connected to the power supply, you get a non-stopping white/Black flicker on the Screen.
(for example: integrate parts of your code into the shutdown process, or something like that)

Up-to-date Raspbian handles the shutdown perfectly...as far i remember
On the other Hand, i think this is actually the work of the "Openelec guys". Smile
Nevermind...

(2017-08-03, 19:32)SebastiansIT Wrote: I don't know if a screensaver can control another screensaver. I think the other way is much easier to implement: Look for your favourite screensaver and ask the author to integrate a function to dim the display after x minutes.
Yeah...i know what you mean.
It was just a quick thought on how you could keep using any Screensaver (e.g. your favorite, that displays information) and still have the Screen turn off after some Time.
no matter which one one is your Favorite

btw.
There should be a Repo where we can download your screensaver, just for good measures, Smile
I've tested countless Kodi builds in the last Year(s) and your addon is the key to actually use any of them with the 7" Touchscreen as a dedicaded Mediacenter, because none of them offerd an option to turn off the Screen.
Reply
#11
(2017-08-21, 14:09)doerek Wrote: I thought perhaps there could be a quick'n dirty (easy) way to disable the Touchscreens' Backlight right before the Pi shuts down completly. (Openelec 17; Krypton)
Because...if you power down the Pi and leave it connected to the power supply, you get a non-stopping white/Black flicker on the Screen.
(for example: integrate parts of your code into the shutdown process, or something like that)

I have write you a shut-down script for LibreELEC (OpenELEC should also work). This Script disables the backlight. Copy the Script to /storage/.config and it would work. For more Information about shut-down scripts see "Kodi 17 - Script when kodi shutdown"
Reply



Screensaver Disable RPI Backlight51