[IDEA] Keep backlight on while playing then turn off - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8) +--- Thread: [IDEA] Keep backlight on while playing then turn off (/showthread.php?tid=2401) |
Keep backlight on while playing then turn off - smartroad - 04-21-2020 Hi all! At the moment the backlight for the screen (I'm using the RPi 7") turns off after a set time when the screen is pressed and again after something has been played (if that option is turned on) Is there a way to keep the screen on WHILE the player plays? Only turning off the screen when the unit has not been touched or played for the set time? Cheers for the time and effort for this, awesome bit of software!!! RE: Keep backlight on while playing then turn off - Tim Curtis - 04-21-2020 Good idea. It's prolly doable and I'll add to the TODO list :-) RE: Keep backlight on while playing then turn off - smartroad - 04-21-2020 Cool, glad it wasn't a stupid idea!! RE: Keep backlight on while playing then turn off - smartroad - 04-23-2020 (04-21-2020, 12:51 PM)Tim Curtis Wrote: Good idea. It's prolly doable and I'll add to the TODO list :-) I hope you don't mind, but I made a quick and dirty python script in the meantime that monitors the state of MPD and adjusts the screen brightness accordingly. For anyone who wants the same while waiting an official way here is my script. Firstly you need to install mpd and rpi_backlight: Code: sudo pip3 install python-mpd2 those must be installed using sudo for it to work on boot. Next create the script: Code: nano monitor.py and copy script code: Code: from mpd import MPDClient save the file and quit nano. It is worth running "python3 monitor.py" to check script is working you can changed SCREENONTIME to be 5 so the screen will turn off in 5 seconds for testing (remember to change it back to the time you want it to have! default is 5*60). Now we need to make the script work at boot time. Code: sudo nano /etc/rc.local and add before "exit 0" Code: python3 "/home/pi/monitor.py" & and the reboot the machine. Hopefully the script will be running and as long as it isn't playing the screen should turn off after the time set and turn on when playing again. RE: Keep backlight on while playing then turn off - Tim Curtis - 04-23-2020 I was looking at this yesterday and there might be a simpler approach. Try the modification below. It should keep the display from blanking while any audio is playing (MPD, Airplay, etc). When audio is not playing the configured screen blank setting is honored. sudo killall watchdog.sh sudo nano /var/www/command/watchdog.sh Comment out the outermost if statement and its corresponding fi. sudo /var/www/command/watchdog.sh & Code: # Audio output -Tim RE: Keep backlight on while playing then turn off - smartroad - 04-24-2020 (04-23-2020, 01:47 PM)Tim Curtis Wrote: I was looking at this yesterday and there might be a simpler approach. Try the modification below. It should keep the display from blanking while any audio is playing (MPD, Airplay, etc). When audio is not playing the configured screen blank setting is honored. That seems to be working! Thanks RE: Keep backlight on while playing then turn off - Tim Curtis - 04-24-2020 Nice :-) I'll include in upcoming 6.5.0 release. It makes sense for this to be the default behavior. RE: Keep backlight on while playing then turn off - new_bloke - 05-28-2020 (04-24-2020, 12:35 PM)Tim Curtis Wrote: Nice :-) I'll include in upcoming 6.5.0 release. It makes sense for this to be the default behavior. This doesn't seem to be working for me on 6.5.2. Are there any particular settings that I need to make here? The screen is definitely blanking during playback... RE: Keep backlight on while playing then turn off - Tim Curtis - 05-28-2020 Look in System Config under the Local Display section. |