Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Keep backlight on while playing then turn off
#5
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
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
RE: Keep backlight on while playing then turn off - by Tim Curtis - 04-23-2020, 01:47 PM

Forum Jump: