You are not logged in.
I'm trying to figure out a good setup for my media centre computer, used mainly for playing videos via Kodi/XBMC or via Youtube or other online video services. I would like the computer to suspend (or hibernate), but *not* when someone's watching a video (and YouTube videos are not always played full screen). The ideal solution to me seems to be not to suspend if there is audio output. Is there a good way of setting this up? (Possibly using systemd)
Offline
Have a look here
Andrew
Offline
In Kodi: Settings > System > Power saving > Shutdown function
It will only shut down if nothing is playing and no key/button is pressed for the duration of the timer. Kodi has a YouTube add-on as well that should obey Kodi's settings.
Personally, I don't see the point of this except as a "sleep" timer. If you have the time and presence of mind to stop playback before leaving the room/apartment/house, you can spare the three extra seconds to manually suspend the system. The resources consumed between when you leave and when the system finally suspends are just wasted.
Offline
The thing is I don't want only to do this Kodi, or even just with YouTube - users will be playing videos from other sites too.
In Kodi: Settings > System > Power saving > Shutdown function
....Personally, I don't see the point of this except as a "sleep" timer. If you have the time and presence of mind to stop playback before leaving the room/apartment/house, you can spare the three extra seconds to manually suspend the system. The resources consumed between when you leave and when the system finally suspends are just wasted.
There are multiple users using it, who are distracted/called away suddenly so if makes sense to automate it.
Here: http://unix.stackexchange.com/questions … -in-silent I found a good lead - to check PulseAudio:
pacmd list-sink-inputs | grep -c 'state: RUNNING'
Presumably I can figure out a way to have a sleep/suspend timer that only starts if PulseAudio isn't receiving input.
Offline