Detecting XBMC in sleep mode to help identify when machine can power down for HTPC
#1
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
Reply
#2
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
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#3
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
Reply

Logout Mark Read Team Forum Stats Members Help
Detecting XBMC in sleep mode to help identify when machine can power down for HTPC0