Kodi Community Forum

Full Version: Takes a lot of time when i try to open a TV SHOW.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Good morning/afternoon,

I have an issue with my kodi, when i try to open a tv show it takes a lot of time to open it (between 8 and 9 seconds everytime).
I though first it was because of the addon PlexKodiConnect but i show the log to the dev and he said nothing is wrong by the addon side and such a long loading time is not "normal".

So i'm here now and hope you can help me.

Windows 10
Kodi 18.8
I use PlexKodiConnect to connect it to Plex

PC Specs:
I7 9700k
GTX 1070
16 GO DDR4 3200 MHZ
SSD samsung

I have made a video so you can see my issue: https://streamable.com/8agptg
My kodi logfile: https://paste.kodi.tv/ejivutetoc.kodi

Do you have an idea why is it so slow to open a tv show ? 

Thank you for your help !
I timed my access to local videos (prepared with at stopwatch!) and it was basically faster than I could move my thumb... maybe 1 sec tops.. (appeared to be instant) before the video played. I have the 1060 Nvidia card with an i7 so we're in similar hardware territory. Looking at the log these things seemed to be at issue. "Plex-Version=2.12.2 (Caused by ConnectTimeoutErro" and "PLEX.download: HTTPConnectionPool(host='myserver.com', port=80): Max retries exceeded" The log is ~50% plexconnect notices and some networking issues.

Suggestion: let's see if Kodi is the source of the issue.... Make a local folder on your SSD and make it a source in Kodi, using filemode load it up.... how long did it take? Disable Plexconnect, reboot and play the same file, any speed issues?
hello, thank you for your answer !
So from my ssd it is indeed instant.
By the way if i disable PlexKodiConnect, it is still slow browsing in tv show (the ones from the plex server, not on my ssd), doesn't look strange ?

The role of PlexKodiConnect is to create an item in the local database which is a direct play link to the plex server (instead of having the actual movie file inside the local server).
So the browsing is done in the local library so i don't understand why it is slow... do you understand what i mean ? 

Best Regards, Noustaa
Also, i have tried something else, reset my local library then synced again but i synced like 1/4 of all my tv shows. Here the browsing was smooth (like less than 1 sec to open the tv show)!
Then i synced the rest of the tv show and here slow again (8-9 seconds)!
Is it possible that the problem is because of a too big database ? 
If so, is the issue from Kodi or from the Addon ?
I have never used Plex and PlexKodiConnect, but just a quick look in your log shows you have a very large library. I noticed this line...

xml:
DEBUG: PLEX.sync.full_sync: Put section in queue with 235569 items: {'index': 3, 'name': 'TV Shows', 'section_id': 2, 'section_type': 'show', 'sync_to_kodi': True,
..
PLEX.plex_functions: Waiting for download to finish
235,569 items is a lot to load each time, and I am not clear what it is loading and why it needs to load it each time you browse. This is run numrous times in your log and takes anywhere between 7 and 11 seconds to complete each time.

As I said, I have never used plex and don't know how it is supposed to work, so I think the addon developers should be able to help and answer why this happens each time you browse your library.

Can you bypass Plex and add your media sources directly to Kodi and scan into the library then test how responsive it is. PatK asked you to do a similar thing, but from your response it is not clear if this is what you actually did.- "So from my ssd it is indeed instant."
PlexKodiConnect developer here, chiming in. There's also a GitHub issue for this: https://github.com/croneter/PlexKodiConnect/issues/1209

To summarize the bug: it takes >7-8 seconds for all episodes of a tv show to show up/appear if the user navigates to it. The user's Kodi database is huge: >235'000 items/videos. 

I suspect that for some reason, access to the Kodi database is blocked/delayed. It could be the sheer size of the DB...

The issue occurs between the "Window Init (DialogBusy.xml)" and "Window Deinit (DialogBusy.xml)". It took approximately 8 seconds to load/the the episodes of the tv series he navigated to.
Code:

2020-08-10 17:06:38.780 T:16548   DEBUG: ------ Window Init (DialogBusy.xml) ------
...

2020-08-10 17:06:39.905 T:14084   DEBUG: Thread FileCache start, auto delete: false
2020-08-10 17:06:39.944 T:14084    INFO: CFileCache:Tonguerocess - Source read didn't return any data! Hit eof(?)
2020-08-10 17:06:39.997 T:14084   DEBUG: Thread FileCache 14084 terminating
2020-08-10 17:06:39.997 T:20308   DEBUG: Caching image 'http://myserver.com:80/photo/:/transcode?width=1920&height=1920&minSize=1&upscale=0&url=/library/metadata/1160/thumb/1576306558&X-Plex-Token=aagfazegagagagagaga' to '4/4e2af5ba.jpg':
2020-08-10 17:06:40.003 T:20308   DEBUG: cached image 'special://masterprofile/Thumbnails/4/4e2af5ba.jpg' size 480x720
2020-08-10 17:06:40.016 T:3920   DEBUG: CWebServer[8080]: request received for /image/image://http%253A%252F%252Fmyserver.com%253A80%252Fphoto%252F%253A%252Ftranscode%253Fwidth%253D1920%2526height%253D1920%2526minSize%253D1%2526upscale%253D0%2526url%253D%252Flibrary%252Fmetadata%252F1159%252Fthumb%252F1576306554%2526X-Plex-Token%253Daagfazegagagagagaga
2020-08-10 17:06:40.124 T:3920   DEBUG: CCurlFile::GetMimeType - http://myserver.com:80/photo/:/transcode...gagagagaga -> image/jpeg
2020-08-10 17:06:40.124 T:3920   DEBUG: CFileCache::Open - opening <photo/:/transcode> using cache
2020-08-10 17:06:40.124 T:3920   DEBUG: CurlFile::Open(0x1efcbd3da20) http://myserver.com:80/photo/:/transcode...gagagagaga
2020-08-10 17:06:40.157 T:3672   DEBUG: Thread FileCache start, auto delete: false
2020-08-10 17:06:40.215 T:3672    INFO: CFileCache:Tonguerocess - Source read didn't return any data! Hit eof(?)
2020-08-10 17:06:40.270 T:3672   DEBUG: Thread FileCache 3672 terminating
...

2020-08-10 17:06:46.872 T:16548   DEBUG: ------ Window Deinit (DialogBusy.xml) ------
At this point, PlexKodiConnect has done it's job. There are no more log entries between these 2 log entries mentioned. What I DO see is Kodi caching many images in the background. Is it possible that this blocks database access while he's browsing into the tv show?
Hi @Croneter

Thanks for the link, I was previously unaware of the conversation.

As mentioned above I have never used Plex or your add-on, so have no familiarity with how they work. Actually, it was my understanding (probably wrong) that Kodi was just a front end and the database/library functions were handled by Plex.
These entries in the log indicated to me that a Plex database was being used...
xml:
2020-08-10 17:03:51.513 T:1272 NOTICE: PLEX.service: Db version: 2.12.2
2020-08-10 17:03:51.513 T:1272 NOTICE: PLEX.service: Kodi video database version: 116
2020-08-10 17:03:51.513 T:1272 NOTICE: PLEX.service: Kodi music database version: 72
2020-08-10 17:03:51.513 T:1272 NOTICE: PLEX.service: Kodi texture database version: 13

I spotted those large number of items repeatedly being downloaded and thought that is a problem as that does not happen on a clean Kodi install. So I will have to bow out of this issue as I don't have enough of an understanding of how Kodi/Plex/PKC are meant to interact.

But I will be interested on the outcome if Plex and PKC are bypassed and only Kodi is used with a freshly scraped library.

Thanks.
@Karellen
From the PKC side, the number of items does not seem to be an issue. The Plex Media Server is not super fast in providing the metadata, but overall it "only" takes roughly 2 minutes to sync the playstates to the Kodi database:
Code:

DEBUG: PLEX.sync.full_sync: Processing 235569 playstates for library section {'index': 3, 'name': 'TV Shows', 'section_id': 2, 'section_type': 'show', 'sync_to_kodi': True, 'last_sync': 1597068900}
...
NOTICE: PLEX.utils: It took 0:01:54.739000 to run the function processing_loop_playstates
So that process is done when @Noustaa experiences a lag when navigating. Who could help from a Kodi database development perspective from the Kodi team?


@Noustaa I'm also interested if Kodi works well if you add your giant library "normally" to Kodi. Also, what happens if you deactivate "image caching" in the PKC settings in the Sync tab, then restart Kodi. Does that help?
(2020-08-11, 07:40)Karellen Wrote: [ -> ]As mentioned above I have never used Plex or your add-on, so have no familiarity with how they work. Actually, it was my understanding (probably wrong) that Kodi was just a front end and the database/library functions were handled by Plex.
These entries in the log indicated to me that a Plex database was being used...

Yes, PKC adds entries to the Kodi database. The log entries "Waiting for download to finish" mean that the Plex Media Server is not too fast in serving up its metadata. But this has no impact on the bug at hand.
(2020-08-11, 08:02)Croneter Wrote: [ -> ]Yes, PKC adds entries to the Kodi database.
How is PKC adding to the Kodi database?

(2020-08-11, 08:02)Croneter Wrote: [ -> ]But this has no impact on the bug at hand.
I thought this is the exact bug at hand. All this downloading, and Kodi waiting for the download to complete. If this is not the bug, then what do you believe the bug to be.
(2020-08-11, 08:23)Karellen Wrote: [ -> ]
(2020-08-11, 08:02)Croneter Wrote: [ -> ]Yes, PKC adds entries to the Kodi database.
How is PKC adding to the Kodi database?
(2020-08-11, 08:02)Croneter Wrote: [ -> ]But this has no impact on the bug at hand.
I thought this is the exact bug at hand. All this downloading, and Kodi waiting for the download to complete. If this is not the bug, then what do you believe the bug to be.
PKC directly writes to the Kodi database (using Python's sqlite3 library). Yes, I know, this is a VERY unsupported configuration. Nevertheless it's working fine for thousands of PKC users


Looking at the log file, PKC is done syncing when the lag in navigation occurs - and PKC is also done writing to the Kodi db. I suspect it's the image caching. Let's see what @Noustaa experiences once he deactivated caching.
Hi Croneter and Kodi team, sorry i didnt receive email notification so wasnt aware of your messages ! 
Should i disable image caching from PKC settings ? 

So i reset my local DB, disable the caching and make a complete new sync ?
(2020-08-11, 10:17)Croneter Wrote: [ -> ]I suspect it's the image caching.
(2020-08-11, 10:24)Noustaa Wrote: [ -> ]Should i disable image caching from PKC settings ?
Yes, that is what @sualfred also concluded, that it is image caching delaying the processes and you should disable image caching. It was also suggested your use of a http webserver may be causing issues depending on how you have set it up, especially if you are using a reverse proxy.
(2020-08-11, 10:37)Karellen Wrote: [ -> ]Yes, that is what @sualfred also concluded, that it is image caching delaying the processes and you should disable image caching. It was also suggested your use of a http webserver may be causing issues depending on how you have set it up, especially if you are using a reverse proxy.
Well i will try without image caching and let you know !
Hey before to reset i have just noticed something new !
From there C:\Users\Noustaa\AppData\Roaming\Kodi\userdata\Thumbnails
I can see all the folders (1, 2, 3 ... D, E, F)
And in fact when i launched kodi it is still actively caching in background ! 
So the Last modified date on the folder is being update every minutes and it is adding images !
While the database is so big i assume the caching won't finish before a very looooooooong time.
I will try right now without caching and send the logs.
Pages: 1 2 3