-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling Kodi Sync Queue in jf4k causes adverse video playback performance #830
Comments
Your terminology is confusing, but I can understand what the issue is at least. First off
This is really not a supported use case. The docs explicitly state
Because of how the addon is currently designed, trying to do this is far more likely to encounter issues than other situations. That's (probably) not directly related to what's happening here, but it's worth pointing out you're playing with fire. Just so everybody is on the same page, the Sync Queue is not a client side thing. It's a plugin that lives in the server and has exactly 0 effect on the Kodi client except when Kodi first starts. The addon installed into Kodi is named jellyfin-kodi, or Jellyfin for Kodi. We sometimes abbreviate this to jf4k if we're feeling lazy. It's not a huge deal, but it greatly helps if everybody is using the same terminology to avoid confusion. The actual issue, the settings stuff, and this is where things get fun. None of those are actual settings. This is a side effect of previous developers of this addon using the in-memory settings storage of Kodi as a temporary variable store. Kinda gross, but it is what it is right now. I also have significant doubts that this is what's causing your performance issues. imo, it's annoying but harmless, which is why I haven't redesigned that part of it yet. Those log messages aren't even coming from our code directly. If I had to guess, it's more likely the addon trying to do processing in the background and send playback status to the server, while failing miserably because you're playing files that aren't on jellyfin (again, not really a supported use case currently). Without checking the code, I suspect it's just trying to ship playback progress for everything instead of properly trying to scope itself to only things that's playing from jellyfin. Previous design decisions have led to the assumption that the jellyfin-kodi addon is your only real source of media on this playback device. Disabling the "sync during playback" probably means that it's not retrieving new data from the server during that time period (new episodes/movies, updated watch status, etc), but I doubt it disabled all current status reporting. |
Hey @mcarlton00 thanks again for looking at this, and sorry about the confusion.
The setting in jf4k calls itself "Enable Kodi Sync Queue," which is to what I was referring. Of course, this requires having the plugin installed on the server as well.
For the record, the problem occurs also when playing the same video, indexed by Jellyfin, with no change in the symptomology. I was simply trying to show that when interacting with a file that is not in the Kodi DB - just by browsing to it with the file browser, the same problem occurs. I guess I should have left it at "it doesn't matter if the video is being served to Kodi by Jellyfin or not."
Ugh.
Sorry for misleading you. This problem occurs even when the file is indexed by Jellyfin, with the exact same symptoms and results. And, again, disabling the jf4k "Enable Kodi Sync Queue" setting restores Kodi performance to normal levels for the system in question. Let me know what more I can do to help. |
Describe the bug
It seems that having the Jellyfin plugin loaded with the Sync Queue activated leads to extremely poor performance in certain situations, especially where the platform on which Kodi runs is nearing its performance limits without Jellyfin loaded. Note that this is for locally stored media, not indexed by Jellyfin, browsed to via the Files menu.
In marginal cases this issue results in skipped frames every so often. In more extreme ones, it results in only half the frame rate - and not even on extremely taxing files (in one extreme case: NVidia Shield Pro 2019, 1080p H.264 24fps with AAC 2.0 audio played back at under 11fps.)
In debugging and isolating this issue, the "trying to load setting definitions from the old format" logging seen by @TrueTechy in #116 appeared to be spamming the logs during playback. That issue was closed by @mcarlton00 because Kodi upstream stopped logging that info except when debug logging was activated. However, I believe this may have wallpapered over the issue, and now that the transition to the new format is done, the underlying point should be revisited.
As the video being played in this test case was not being played thru Jellyfin, the Sync queue plugin had run once and had found no changes, and no other Jellyfin activity should have been ongoing, the spammed logging suggests that whatever is going on with setting definition loading is preventing the Sync Queue plugin from being suspended -- even when it has been disabled during playback!
To Reproduce
On a system with limited resources (or with a video file that's taxing for the system under test):
Expected behaviour
Performance with the Jellyfin plugin loaded and the Sync Queue enabled should be roughly equivalent to the performance without it loaded.
Logs
These 5 lines appear roughly every 2s during playback. Video stuttering continues to occur immediately.
System (please complete the following information):
Additional context
Perhaps it is time to revisit https://kodi.wiki/view/Add-on_settings_conversion ? At the very least, figure out why CAddonSettings / CSettingsManager continues to spin during video playback.
The text was updated successfully, but these errors were encountered: