Kodi Community Forum
Detecting XBMC in sleep mode to help identify when machine can power down for HTPC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: Detecting XBMC in sleep mode to help identify when machine can power down for HTPC (/showthread.php?tid=42435)



Detecting XBMC in sleep mode to help identify when machine can power down for HTPC - dteirney - 2008-12-21

I'm setting up my Linux HTPC to have both XBMC and Myth TV on it.

I want to be a good eco-citizen and have the machine power down if it's not being used and Myth TV isn't recording something.

Myth TV provides a hook to allow a script to be run to see if the machine can be powered down (which subsequently sets the wake time in the BIOS when it does shut down).

What would the best way to tell if the HTPC is being "used"? XBMC will be the only application running.

On my other desktop Myth TV system I have a script to tell if a user is logged in. If so, don't shut down. However, since I'm hoping to run a completely keyboard and mouse free system, the system automatically logs in and launches XBMC. Someone will always be logged in.

Options:
1) Make sure we "quit" XBMC when we are finished. The shut down script could then check to see if the XBMC process is running. If so, don't shut down. Has the side affect that we have to remember to do stuff. Also means I need something to start up XBMC via the remote if we want to use it again. Since I'm hoping to use a Wii Remote, I can't use LIRC to start an application.
2) Configure XBMC to go into sleep mode after X minutes and then have the shutdown script see if XBMC is in sleep mode (or gone for some reason). Is this possible? With this solution we'd never shutdown XBMC, just turn off the TV. Nice and easy.
3) Something someone else more Linux savvy than me can come up with!

What's the best way to deal with thisHuh


- topfs2 - 2008-12-21

if you choose "default shutdown action" in settings to suspend, and set the idle timer for shutdown to an arbitrary number it should suspend if it can after said time.

If a user is logged on through ssh XBMC will fail to suspend in anycase. Im unsure though if the current code does try to suspend again after a while if it fails but if it doesnt (with idle timer that is) then its a bug

Cheers,
Tobias


- dteirney - 2008-12-22

I think that suspending the machine would mean that Myth TV would stop recording if it was.

Looks like having XBMC quit after the idle timeout and some mechanism to somehow fire up XBMC using the Wii Remote might be the best optionHuh