Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

disconnect / reconnect confusion on powerdown / up #113

Open
darmbrust opened this issue Jul 13, 2020 · 8 comments
Open

disconnect / reconnect confusion on powerdown / up #113

darmbrust opened this issue Jul 13, 2020 · 8 comments

Comments

@darmbrust
Copy link

Running the current version of Kodi, on Android (Sony TV), and also have it linked to my MythTV server.

Any time you push the power button for the TV, while Kodi is running - upon turning the TV back on, the screen starts flashing the MythTV Disconnected error message, followed by the MythTV Reconnected error message.

This loop repeats, for upward of 5 minutes, before it (apparently) has time to get through its entire backlog of disconnect / reconnect message, which each sit on the screen for ~ 5 seconds. Even when you are trying to watch something else, that isn't even coming from MythTV. There must be something on the order of 60 of these disconnect / reconnect message pairs in the queue for display.

The only way to stop this loop, is to exit Kodi, and relaunch it. Or, always exit Kodi before you turn off the TV.

Note that MythTV functions work perfectly fine, even while these silly error messages continue to flash on screen.

While, I think the handling of the messages on the Kodi side is buggy xbmc/xbmc#18163 they don't seem to agree - but do believe that the initiator for the messages is coming from the addon.

The addon seems to be getting confused about the state of the MythTV connection upon a power down / up.

Not sure if the addon needs some different logic to properly handle what happens when the TV turns off - I'm guessing some sort of sleep mode is triggered? Or perhaps, a delay in the disconnect / reconnect logic?

I can get logs from the addon when this happens, if that would help - if someone can tell me how to fetch the logs you need off of the Sony/Android tv.

@janbar
Copy link
Member

janbar commented Jul 14, 2020

The root cause is your device (Sony TV) which disconnect/reconnect the network many times probably during sleep.
You have to know that MythTV client requires a connected network connection to listen update events about recordings, backend status, recording rules etc... At every disconnection the client (addon) needs to reload all metadata which is a big work, and it signals that by a warn message.
I guess this behavior is on Android. On this platform the power management as soon as possible shutdowns the network and app, causing the defects.
You should configure the Kodi App in the Android settings, to not be sleeping and to run on the background with a network up.

@darmbrust
Copy link
Author

Not sure I've seen that option before, I'll look for it and try it.
What about an option to not surface these warnings, especially if the add on isn't in direct use?
The Kodi TV is just an additional front end to the MythTV server in my case, I really don't need to know about any status info on the MythTV server. I'm perfectly happy with it simply telling me MythTV is disconnected if I try to click on something that requires it, rather than having messages flash up about the status or connection issues, when it just doesn't matter at the time.

@darmbrust
Copy link
Author

I can't find any option in the android settings to allow Kodi to run in the background. Any idea where it would be hiding?

@janbar
Copy link
Member

janbar commented Jul 15, 2020

That depends of Android version and vendor. Often you could find it in "Battery" or "Power saving" etc. It is often difficult to find the right flag in Android settings.
I made a change in the code to no longer send the notification when kodi is in power saving mode (screen off). That could help. The change is included in the release 5.10.19 for Leia, and 7.0.5 for Matrix. I guess you use Leia.

@darmbrust
Copy link
Author

darmbrust commented Jul 16, 2020

I couldn't find any options in power saving. Nor anything related to the app in the app info. But they probably remove it on the TVs. I know I've seen it before on my phone, usually hidden under something like battery optimization.
I'll grab the update and test it out - looks like I'm still on 5.10.18 right now - but I'll get it as soon as its in the repo.

@darmbrust
Copy link
Author

Even when running 5.10.19, I still see this issue.
Can we just get an option to disable overlays of messages about mythtv backend actions? In my use cases on my Android / Samsung TVs, I really don't care what the MythTV server is doing, or not doing.
If something doesn't play that requires the MythTV connection to be up when its not, well, then I'll know because it isn't playing :)

@janbar
Copy link
Member

janbar commented Oct 19, 2020

That's possible. I will make that change.

@darmbrust
Copy link
Author

That would be awesome - thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants