Kodi on libreelec keeps connection to tvheadend open
#1
Sorry to start into the forum by a beginners question. Could not find a solution.

I have libreelec (devel-20180212221729-#0212-g760c839) running on a raspberry with tvheadend (4.2.5) on a separate server (ubuntu) with several dvb cards for pvr/livetv. Everything runs quite good.

There is only one problem. The process kodi.bin on the libreelec system keeps an active connection to my tvheadend server at port 9982 even if libreelec/kodi is idle/not in use. My tvheadend machine therefore is being kept from getting into suspend2ram mode. If I ignore the connection on my tvheadend system there are problems after remote wake, with epg updates, live tv and so on...

Is there a way to put kodi in "sleep mode" on the rpi (without turning it off)? Is there a recommended or best practice setup for the scenario?
Reply
#2
I have the same problem.

Client: Raspberry Pi 3, OSMC 2018-02 (4.14.15-5-osmc)
Server: x86 PC, Ubuntu 16, Tvheadend 4.2.5

My kodi installation has multiple profiles; only one of them, named tv, has a valid tvheadend configuration. Even after logging off this profile, a connection between the Pi and the Tvheadend server persists on port 9982. This prevents the server machine from suspend.

I remember that this didn't happen in a different environment (older versions of Tvheadend and Kodi on a different box running Windows).
Reply
#3
There's no nice way to do this in my experience.  You can try disabling pvr.hts on idle, but I find when you re-enable it after idle (using a json thingybob) kodi crashes.  You can disable the network adaptor on the pi on idle and re-enable it after idle, but this causes crashes too.  I don't know if running a script which stops kodi on idle then restarts it on resume would work with an ir remote.  It might do.
Reply
#4
I found a workaround:
 
  • the tv profile has separate media databases (so that add-ons are configured independently)
  • the Tvheadend plugin is enabled in tv
  • the Tvheadend plugin is disabled in the master profile

When I'm finished using the tv profile, I change to the master profile. This disables the Tvheadend plugin and the connection is closed, without crash.

I also tried to just log off the tv profile and stay in the profile selection screen, but this does not disable the Tvheadend plugin so that the connection stays opened.
Reply
#5
That sounds ingenious - will give it a go later and report back.

edit.  I've set it up with Kodi Callbacks so that when the screensaver is active it executes the builtin function XBMC.LoadProfile(profile_with_no_tv_client).  For that profile I've set the keymap for every key on the remote to XBMC.RestartApp.  I've set the default login to the Master profile which has the TV client active.  I did try using XBMC.LoadProfile(Master) instead of restarting Kodi but it was crashing.  This is a decent compromise.  Thanks -chris- !
Reply
#6
(2018-04-10, 06:23)lokum Wrote: That sounds ingenious - will give it a go later and report back.

edit.  I've set it up with Kodi Callbacks so that when the screensaver is active it executes the builtin function XBMC.LoadProfile(profile_with_no_tv_client).  For that profile I've set the keymap for every key on the remote to XBMC.RestartApp.  I've set the default login to the Master profile which has the TV client active.  I did try using XBMC.LoadProfile(Master) instead of restarting Kodi but it was crashing.  This is a decent compromise.  Thanks -chris- !
I found a way to switch back to master profile without restarting kodi. The callback XBMC.LoadProfile(Master user) works for my setup. It is activated by kodi callbacks on event onScreenSaverDeactivated (instead of remapping keys). The exact line in settings.xml is
<setting id="T1.builtin">XBMC.LoadProfile(&quot;Master user&quot; )</setting>
Switching to profile "Dummy", that does not have tvheadend configured (actually has no media at all), is done by kodi callbacks event onIdle:
<setting id="T1.builtin">XBMC.LoadProfile(&quot;Dummy&quot; )</setting>
This seems to work quite good.
Thanks for the idea with profiles!
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi on libreelec keeps connection to tvheadend open0