04-24-2020, 07:44 AM
(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.
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
CARD_NUM=$(sqlite3 $SQL_DB "SELECT value FROM cfg_mpd WHERE param='device'")
HW_PARAMS=$(cat /proc/asound/card$CARD_NUM/pcm0p/sub0/hw_params)
#if [[ $HW_PARAMS != $HW_PARAMS_LAST ]]; then
TIME_STAMP=$(date +'%Y%m%d %H%M%S')
if [[ $HW_PARAMS = "closed" ]]; then
LOG_MSG=" watchdog: Info: Audio output is (closed)"
else
TIME_STAMP=$(date +'%Y%m%d %H%M%S')
LOG_MSG=" watchdog: Info: Audio output is (in use)"
# Wake display on play
WAKE_DISPLAY=$(sqlite3 $SQL_DB "SELECT value FROM cfg_system WHERE param='wake_display'")
if [[ $WAKE_DISPLAY = "1" ]]; then
export DISPLAY=:0
xset s reset > /dev/null 2>&1
fi
fi
#echo $TIME_STAMP$LOG_MSG >> /var/log/moode.log
#fi
-Tim
That seems to be working! Thanks
![Big Grin Big Grin](https://moodeaudio.org/forum/images/smilies/biggrin.png)