Possible to disconnect from server on idle?
#1
(cross-posted on Tvheadend board)

Setup
  • A few Kodi clients run on Raspberry Pis. The clients are always on.
  • Tvheadend is running on a x86 server offering DVB-S. The server is shutdown when it's idle (e.g. no current subscriptions, no scheduled recordings in the next few minutes). I wrote an autosuspend script that checks Tvheadend's activity for this. As long as a connection on the control port (default: 9981) exists, the server is considered busy.
Problem

The Kodi HTSP plugin does not release the connection to the server, thus the server does never shutdown.

I found a workaround, though. I created two profiles in Kodi, one for TV with the HTSP (and WOL) plugin enabled, and a second one having the plugins disabled. When the user stops watching TV, (s)he switches to the non-tv profile. The HTSP plugin is disabled and the server shuts down properly.

What's wrong with the workaround?
  1. After logoff, when the profile selection screen is shown, the HTSP plugin is still running. The user has to switch to the non-tv profile to disable the plugin.
  2. I'd prefer an automatic disconnect, or a configuration option to disconnect from the server on idle (whatever 'idle' may mean).
Is anyone else suffering from this issue? Is there a better solution than my workaround?
Reply
#2
(2019-04-12, 05:45)-chris- Wrote: (cross-posted on Tvheadend board)Setup
  • A few Kodi clients run on Raspberry Pis. The clients are always on.
  • Tvheadend is running on a x86 server offering DVB-S. The server is shutdown when it's idle (e.g. no current subscriptions, no scheduled recordings in the next few minutes). I wrote an autosuspend script that checks Tvheadend's activity for this. As long as a connection on the control port (default: 9981) exists, the server is considered busy.
Problem

The Kodi HTSP plugin does not release the connection to the server, thus the server does never shutdown.

I found a workaround, though. I created two profiles in Kodi, one for TV with the HTSP (and WOL) plugin enabled, and a second one having the plugins disabled. When the user stops watching TV, (s)he switches to the non-tv profile. The HTSP plugin is disabled and the server shuts down properly.

What's wrong with the workaround?
  1. After logoff, when the profile selection screen is shown, the HTSP plugin is still running. The user has to switch to the non-tv profile to disable the plugin.
  2. I'd prefer an automatic disconnect, or a configuration option to disconnect from the server on idle (whatever 'idle' may mean).
Is anyone else suffering from this issue? Is there a better solution than my workaround? 
I've got the same problem. Workarounds like the one described above or autosuspending anyway (if kodi is idle despite of tvheadend connection) and triggering wakeup by screen events are not completely satisfying.
Reply



Logout Mark Read Team Forum Stats Members Help
Possible to disconnect from server on idle?0
This forum uses Lukasz Tkacz MyBB addons.