Linux Screen goes to sleep in middle of showing TV
#1
I am using Kodi 15.2 as the front end to MythTV 0.27.6 on Ubuntu Linux 14.04.3 LTS. Both on same m/c.

I have the 'screensaver' set to dim after 3 minutes, then 'put display to sleep when idle' after 15 minutes.

The problem is, the display goes to black after 15 minutes in the middle of watching a TV program (full screen).

Why is it doing this? Kodi is clearly not idle in that circumstance - it is showing TV.
Reply
#2
I dunno, try turning off the 'put display to sleep' setting and see if it still does it. It might be an operating system blanking, or it might be kodi doing it.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#3
Just realised I'm wrong, it's xscreensaver that is cutting in, not Kodi's. Need to kill it when Kodi starts, or poke it regularly.
Reply
#4
(2016-02-11, 21:54)nmw01223 Wrote: Just realised I'm wrong, it's xscreensaver that is cutting in, not Kodi's. Need to kill it when Kodi starts, or poke it regularly.

Install an app called Caffeine it will prevent screensaver from invoking while any full screen app is being used.
Reply
#5
Thanks, I will look into that. In the meanwhile I've created a script which is detailed below. It seems to work so might be of use to someone.

Firstly I run Kodi from a script in /usr/local/bin as I need to do some X settings changes either side of running Kodi. so this script is actually the first executable line in that script (with an & at the line end so it forks and runs in the background). The script contains the following:

Code:
#!/bin/bash
#inhibit screen saver while kodi running

# LOGFILE="/var/log/mythtv/kodi-iss.log"
# LOGFILE="/dev/stdout"
LOGFILE="/dev/null"

let "count = 0"
while [ $(pidof -x mythtv-runkodi) ] ; do
    let "count = $count + 1"
    echo "Kodi running ($count)" >> $LOGFILE
    if [ $count -ge 25 ] ; then
        let "count = 0"
        if [ $(pidof -x xscreensaver) ] ; then
            echo "Ping screen saver" >> $LOGFILE
            xscreensaver-command -deactivate >> $LOGFILE

        else
            echo "No screensaver running"  >> $LOGFILE

        fi

    fi

    sleep 2
done

echo "Kodi not running - exiting" >> $LOGFILE
exit 0

Basically what it does is pretty simple. The script that runs Kodi (and this) is called 'mythtv-runkodi'. This script sits in a loop checking every 2 seconds that 'mythtv-runkodi' is still active (which of course it is while Kodi is running). Every 25x (or 50 seconds) through it pokes the screensaver (if it is running). As soon as Kodi exits, the main script ends as well, and this script detects that and also ends by dropping out of the loop.
Reply

Logout Mark Read Team Forum Stats Members Help
Screen goes to sleep in middle of showing TV0