xbmc-send, AllowIdleShutdown and InhibitIdleShutdown
#1
I have one pc which runs xbmc (openelec) and I want it to stay as long as another client pc in my house is on for tv reasons. So I have a cron job to run every minute (see script below) to check if that client pc is on, and if it is not the first pc will suspend (set to suspend after 5 minutes in xbmc settings).

This is the script I am using but currently it seems to be just ihibiting idle shutdown whether the client is off or on. I suppose i dont know enough about InhibitIdleShutdown and AllowIdleShutdown. Is this just some setting and when i send this "xbmc-send --action=XBMC.InhibitIdleShutdown", this setting will change to InhibitIdleShutdown and the pc will not be able to shutdown/suspend until that setting is changed to AllowIdleShutdown?


Any idea's/suggestion as to why this might not be working properly. Would love to get it working!


ping -c 2 192.168.1.33 > /dev/null
if [ "$?" = "0" ];
then
xbmc-send --action=XBMC.InhibitIdleShutdown
else
xbmc-send --action=XBMC.AllowIdleShutdown
fi
Reply
#2
The functions invoked by your xbmc-send commands are incorrectly expressed or invalid. The function you desire is InhibitIdleShutdown() with a "true" or "false" parameter:
Code:
ping -c 2 192.168.1.33 > /dev/null
if [ "$?" = "0" ];
then
xbmc-send --action="XBMC.InhibitIdleShutdown(true)"
else
xbmc-send --action="XBMC.InhibitIdleShutdown(false)"
fi
Reply
#3
thank you, much appreciated!
Reply
#4
Unfortunately it doesn't seem to allow idle shutdown even though the client is suspended.


edit: there seems to be some issue with openelec reverting back to the openelec splash screen when their is no hdmi source on, but that looks unrelated to the above as the pc still wont suspend even with a projector connected to it and on.
Reply
#5
You might want to verify your OpenElec system is able to suspend after 5 minutes of idleness *without* the cron job script running. Be sure you don't have InhibitIdleShutdown set to "true" (i.e., you should see the option "Inhibit Idle Shutdown" listed on your XBMC shutdown menu). If auto-suspend doesn't work, then try selecting "Suspend" from the XBMC shutdown menu and see if this suspends the system.
Reply
#6
If i stop the cron job running my script it will suspend after 5 minutes idle. The shutdown menu displays "Inhibit Idle Shutdown" under "Reboot" on the Confluence skin. The client pc is off and tvheadend is not recording anything.
Reply
#7
Try re-enabling your cron job script and leaving the client system up. Verify XBMC shutdown menu shows "Allow idle shutdown". Turn off your client system and verify the XBMC shutdown menu now shows "Inhibit idle shutdown". This verifies the script actually works as far as toggling the InhibitIdleShutdown setting. Whether or not the mere presence of this running cron job script is somehow preventing idle auto-suspend is separate matter.
Reply
#8
Good idea. It toggled the setting from "Allow idle shutdown" to "InhibitIdleShutdown". I set the cron job to run every 8 minutes and the pc did suspend so it looks it is the cron job running every minute that is causing the issue. Every minute it runs and the client pc is off, it must be reseting the 5 minute idle time and so the pc never gets a chance to suspend.

edit: pc woke immediately though for some reason the first time, second time it stayed asleep......


Now to find a happy medium!
Reply
#9
Dont think this is going to work executing the script on the same pc that i want to suspend. I somehow need the client to execute/send this command to the master pc and if the client falls asleep the the master pc will be able to go to sleep 5 minutes afterwards.
Reply
#10
I don't use the Live TV/PVR function, so I may be all wet, but I thought there was something already built into PVR support that inhibits auto-shutdown when the backend system is recording something. Maybe others who know/use the PVR function can chime in here.
Reply
#11
I'm getting the client to send the command, testing right now, touch wood it works.

Example below, will report back it if it works.

xbmc-send --host=192.168.1.4 --port=80 --action="XBMC.InhibitIdleShutdown(true)"



I basically want the pvr pc to stay on as long as client pc's are on, no matter if they are streaming from the pvr or not. Probably would be a lot easier to keep the pvr pc running 24/7, but 1) its noisy at the moment and 2) its probably only used a third of the day max so no point in my opinion having it running 24/7.
Reply
#12
What was the issue with the inhibit shutdown service that does it based on connected ports? Thats working fine for me doing exactly as you want ie keeping openelec which includes tvheadend server awake while any clients are connected.
Reply
#13
(2013-08-20, 19:47)moontan77 Wrote: ... so it looks it is the cron job running every minute that is causing the issue. Every minute it runs and the client pc is off, it must be reseting the 5 minute idle time and so the pc never gets a chance to suspend

I had the same problem and found a solution using a additional variable in the shell script:
http://forum.xbmc.org/showthread.php?tid...pid1500080
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc-send, AllowIdleShutdown and InhibitIdleShutdown0