DeutscheMark / homebridge-kodi

Kodi plugin for Homebridge
MIT License
28 stars 4 forks source link

Connection Loss When Switching Kodi Profiles #11

Open Lock-Robster opened 4 years ago

Lock-Robster commented 4 years ago

This plug-in is fantastic, it allows my lights to turn on and off when playing/pausing.

However, I have a few people in my house with seperate Kodi profiles. If I start up homebridge while profile 1 is logged in, then all automations work fine. But as soon as I log into profile 2, the plug-in loses the connection to Kodi and automatons don’t work, Homebridge logs don’t show any activity from the plug-in.

If I restart Homebridge while profile 2 is logged in, it works perfectly fine, but switch to profile 1 or 3 etc, then it stops working again.

The plug-in only works for the profile logged in at the time of Homebridge startup.

The HTTP control settings in Kodi are the same on all profiles, as Kodi doesn’t save those settings individually. If you change one of those parameters, then all profiles show that change.

Lock-Robster commented 4 years ago

Hi there,

Just wondering if there is any update to this bug? And if so, will there be an update soon?

Looking forward to the next release, keep up the good work!

DeutscheMark commented 4 years ago

Hi IchabodFletchman. Sorry to reply so late to you on that matter. I tried to reproduce the problem but couldn't find an issue with the connection after changing to another profile for my testing with version 0.4.0. I'm using Kodi 19 test versions already and changed my profiles there. The connection stayed active even on the login screen. I also tried closing Kodi completely and starting it with the other profile via the login screen, also no problem. So could you help me out on this here? Which Kodi version are you using and what exactly did you do when the plugin loses the connection? On which platform are you running Kodi? Thanks in advance.

Edit: Do you have "debug" : true set in your config? This should give you console output that could help here as well.

mk01 commented 3 years ago

@IchabodFletchman

although it looks like everything stays the same, Kodi actually drops all settings and reloads them on profile change. Background services are stopped/started, userhome(profile) reloaded - which can mean gigabytes of data/pictures/thumbs, caches reloaded, addons, ... events are regenerated based on new state and spread through the whole ecosystem.

on "testing(empty)" profile it can be no time, on others it can take long time - and because stuff is being unloaded/stopped first, than load and start again, the setup can be same but definitelly there can be discontinuity.

pure btw - I got stuck with Kodi 17, so can't tell for 18 (and it looks 19 is ok), but back in the Krypton times the internal TCPServer implementation was binding sockets without SO REUSEPORT. As a consequence, fast flip on service state (on/off, setting change, stop start) could render it dead - as it couldn't use that configured port again (until next reload).