Kodi Community Forum
My solution to deal with the "no input detected" / "graceperiod expired" issue - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: PVR & Live TV Support (https://forum.kodi.tv/forumdisplay.php?fid=167)
+---- Forum: Tvheadend (https://forum.kodi.tv/forumdisplay.php?fid=168)
---- Thread: My solution to deal with the "no input detected" / "graceperiod expired" issue (/showthread.php?tid=156918)



My solution to deal with the "no input detected" / "graceperiod expired" issue - jaapp - 2013-02-20

I just wanted to share with you how I made Tvheadend usable. The issue I was experiencing is that tvheadend would at random stop serving any streams and throw a "No input detected"-message. Restarting the tvheadend service was enough to fix this issue, but since the HTPC is used by my family there needed to be a hassle-free hands-off solution. Since the causes of these "graceperiod expired"-issues are widespread and probably driver related issues you shouldn't expect a official fix soon.

In my case tvheadend was running on a Ubuntu server, so this solution is based on this distro. The core of the solution is having Tvheadend log debug information to a file, and monitor this file for the "Graceperiod expired" message. If detected kick tvheadend in the nuts. It's not the best solution, but it works and it's pretty easy to set up!

1. Enable tvheadend debug logging. Edit /etc/default/tvheadend and add the -s switch to the arguments.
Code:
# TVH_ARGS
#   add any other arguments
TVH_ARGS="-s"

2. Save the following script somewhere. Mine was stored under /home/hts/monitor_tvheadend.sh
Code:
#!/bin/bash
tail -F /var/log/syslog | grep --line-buffered "Graceperiod expired" | while read line
do
  service tvheadend restart
done
Make it executable. Run:
Code:
chmod +x /home/hts/monitor_tvheadend.sh

3. Make the script run on boot. Add this line to /etc/rc.local at the bottom, but above "exit 0"
Code:
/home/hts/monitor_tvheadend.sh &
Mind the ampersand. It's there for a reason.

The best thing about this script is that it is based on "tail" instead of polling the file. This means it's resource efficient and responds immediately.


RE: My solution to deal with the "no input detected" / "graceperiod expired" issue - opdenkamp - 2013-02-20

eeh. sounds like a problem with one of the things we can't discuss on this forum rather than a problem with tvh Smile


RE: My solution to deal with the "no input detected" / "graceperiod expired" issue - jaapp - 2013-02-20

Yeah, I understood that lonelycoder is a better suit for issues regarding the backend. But the "READ BEFORE POSTING" thread made it sound like it wasn't mandatory, and I was to lazy to make yet another account to post over there.

I did believe it was relevant to XBMC, as it is the HTPC setup that makes it important to have a hands-off solution. Just trying to help.


RE: My solution to deal with the "no input detected" / "graceperiod expired" issue - dave10au - 2013-07-10

I have this exact issue with free to air channels. Worked fine for about a year now, no.


RE: My solution to deal with the "no input detected" / "graceperiod exp... - DappereDodo - 2014-04-22

I have a similar issue, but with the error "Transport Error Indicator". I think it's got something to do with an error in the dvb-c card driver (Terratic Cinergy HD). This error message pops up in syslog, so I have created the script automantis.sh:

Code:
#!/bin/bash

tail -F /var/log/syslog | grep --line-buffered "Transport error indicator" | while read line
do
  service tvheadend stop
  sudo modprobe -r mantis
  sudo modprobe -r tda10021
  sudo modprobe tda10021
  sudo modprobe mantis
  service tvheadend start
  mail -s "Mantis driver restarted" [email protected]
done

/etc/rc.local shows this:

Code:
/root/automantis.sh &

exit 0

and ps aux | grep mantis shows this, so I think the script is running

Code:
root      3448  0.0  0.0   3356   524 ?        S    Apr19   0:00 /bin/bash /root/automantis.sh
root      3456  0.0  0.0   3356   460 ?        S    Apr19   0:00 /bin/bash /root/automantis.sh
root     32688  0.0  0.1   4400  1896 pts/0    S+   21:11   0:00 grep --color=auto mantis

However, as you may have guessed, nothing happens when the error appears in syslog. If I run the command manually by ~/automantis.sh &, it works fine...


RE: My solution to deal with the "no input detected" / "graceperiod expired" issue - negge - 2014-04-24

@jaapp: "Graceperiod expired" pretty much means something's wrong with your hardware or the drivers

@opdenkamp: I don't think this is related to what you're referring to

@DappereDodo: I've got quite a lot of experience with Terratec Cinergy cards. What I've discovered is that the white cards work perfectly while the green ones don't (I have one of the latter). The issues I have are exactly the same as yours, in the end I didn't like restarting tvheadend everytime the issue cropped up so I wrote https://github.com/Jalle19/enable-disable-tvheadend-adapter, which you can use to disable/enable the adapter. That way you can perform the modprobe without restarting tvheadend. I do this in a cron job every morning at 6 AM.


This forum uses Lukasz Tkacz MyBB addons.