Forum
Quit XBMC when TV is off - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Kodi (/forum-18.html)
+--- Thread: Quit XBMC when TV is off (/thread-885.html)

Pages: 1 2 3


RE: Quit XBMC when TV is off - peibol16 - 19th Nov, 2013 06:50 AM

Yes, I had not realized of this point.

Is include this feature in the last beta2 release?


RE: Quit XBMC when TV is off - Alex2108 - 25th Dec, 2013 11:45 PM

I got a very simple script for closing/starting xbmc with the TV. The only requirement is that the TV has a network connnection and answers to a ping. Just replace the IP with that of your TV (configure your router to assign always the same IP to the TV or set a static IP on the TV).

Code:
#!/bin/sh

if ping -c 1 -W 1 192.168.1.55 > /dev/null; then #tv on?
    if !(pidof xbmc.bin > /dev/null); then #xbmc running?
       /etc/init.d/xbmc start
    fi
else
    if (pidof xbmc.bin > /dev/null); then
       /etc/init.d/xbmc stop
    fi
fi

exit 0
I call this script every minute with cron so i get a maximum delay of one minute until xbmc will get the signal to start, which is ok for me.
NOTE: i'm using raspbian, but it should probably work with xbian too.


RE: Quit XBMC when TV is off - IriDium - 26th Dec, 2013 12:51 AM

(25th Dec, 2013 11:45 PM)Alex2108 Wrote:  I got a very simple script for closing/starting xbmc with the TV. The only requirement is that the TV has a network connnection and answers to a ping. Just replace the IP with that of your TV (configure your router to assign always the same IP to the TV or set a static IP on the TV).

Code:
#!/bin/sh

if ping -c 1 -W 1 192.168.1.55 > /dev/null; then #tv on?
    if !(pidof xbmc.bin > /dev/null); then #xbmc running?
       /etc/init.d/xbmc start
    fi
else
    if (pidof xbmc.bin > /dev/null); then
       /etc/init.d/xbmc stop
    fi
fi

exit 0
I call this script every minute with cron so i get a maximum delay of one minute until xbmc will get the signal to start, which is ok for me.
NOTE: i'm using raspbian, but it should probably work with xbian too.

Or if it is HDMI - you can do it via System -> System -> Input Devices -> Periperals -> CEC Adapter -> When TV is switched off and Devices to switch on


RE: Quit XBMC when TV is off - LeoSum - 14th Mar, 2014 04:47 AM

(10th May, 2013 03:17 PM)mihailescu2m Wrote:  modify the XBMC init.d script such that when XBMC exits it will start a libCEC program that monitors HDMI commands.

Wouldn't it be possible to have such a program running in the background all the time to handle the starting and stoping ob xbmc "externally" by just issuing "start xbmc" and "stop xbmc" commands? For users who don't use xmbc as a music renderer this would totally do the job. But what are the steps to do so? Smile


RE: Quit XBMC when TV is off - mk01 - 16th Mar, 2014 02:42 PM

I just included this feature into XBian, it will come to devel repo after a bit more testing tomorrow .

Currently without GUI configuring interface, just /etc/default/xbmc

keywords FOLLOWTV =yes/no

TVSCREENOFF needs to be set to yes as well. normlaly TV would go OFF on screensaver, FOLLOWTV=yes will extend the workflow as follows:

XBMC hits screensaver - this turns off tv and triggers XBMC quit
next time TV will go ON. trigger will start XBMC

is this as expected ?

(16th Nov, 2013 06:32 AM)rikardo1979 Wrote:  not really. Like me listening music from local server or online radios or streams. so for this I dont need TV ON but I need XBMC running. so imagine you listen to music and than your XBMC goes OFF cos the TV is OFF Wink

this was a bug with first release of this functionality but then we added two layer testing for XBMC being idle on screensaver as

screensaver and idle
screensaver + playing

in 2nd case TV is not turned off with screensaver.


RE: Quit XBMC when TV is off - LeoSum - 22nd Mar, 2014 01:48 AM

(16th Mar, 2014 02:42 PM)mk01 Wrote:  I just included this feature into XBian, it will come to devel repo after a bit more testing tomorrow .

So should this feature show up in my existing xbian automagically after running updates now?


RE: Quit XBMC when TV is off - mk01 - 24th Mar, 2014 07:00 AM

(22nd Mar, 2014 01:48 AM)LeoSum Wrote:  So should this feature show up in my existing xbian automagically after running updates now?

not "now". but with next updates. today, tomorrow, day after tomorrow.


RE: Quit XBMC when TV is off - mk01 - 4th Apr, 2014 11:08 AM

@LeoSum

I posted xbian-package-xbmc-scripts in version 1.0.5 to devel repo.

there is new parameter in /etc/default/xbmc called XBMCOFF. by default is set to "no". set it to "yes" together with SCREENOFF=yes.

(SCREENOFF no/yes will not change any behaviour in that case but =yes is needed for some related processes to being able to operate on XBMC according to TV status).

for debugging, there should be file created /run/TV.log with logging message on TVoff and TVon. at the same time "start/stop xbmc" is issued.


RE: Quit XBMC when TV is off - LeoSum - 13th Apr, 2014 07:57 PM

Thanks for the effort! Will try and report back. Sounds like exactly what I was looking for.