Kodi Community Forum
WIP Media importing and library integration (UPnP, Emby, Plex, ...) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: WIP Media importing and library integration (UPnP, Emby, Plex, ...) (/showthread.php?tid=224794)



Media importing and library integration (UPnP, Emby, Plex, ...) - enen92 - 2021-10-02

Can someone share what the blocking issue in Kodi/python3 is referred on above comments? I might be living under a rock Smile


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - Montellese - 2021-10-02

(2021-10-02, 16:05)enen92 Wrote: Can someone share what the blocking issue in Kodi/python3 is referred on above comments? I might be living under a rock Smile
TBH I don't know that much about it either. At first I thought it was a media import related problem. But @sualfred mentioned to me that the same happens with his skins which use a lot of add-ons in Kodi Matrix. The problem seems to be that if too many Python sub-interpreters are running at the same type Python is unable to properly handle catching exceptions with a specific type. So if some code tries to catch a TimeoutError it will not be caught. If the same code would try to catch any exception it would work even though the thrown exception is of type TimeoutError. See e.g. this workaround which solves the issue but obviously is very ugly: https://github.com/Montellese/mediaimporter.plex/commit/07edca203118abf6b32469a5f30114d15fa6a9d3. And a Python add-on cannot control every exception being thrown / caught because lots of libraries / modules depend on proper exception handling.

I did some debugging on Windows with media import and noticed that the problem only appears if the number of sub-interpreters running concurrently is greater than 4 and even. Each media importer add-on runs two service scripts and at least one on-demand script. If I only have one media importer add-on active everything is peachy but if I run two media importer add-ons I run into these issues all the time. If I run an additional add-on which uses a service everything is fine again because most of the time the number of concurrently running sub-interpreters is odd (2 + 2 + 1).

I thought it might have something to do with the locking in our PythonInterpreter and tried to improve it but it didn't help.


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - TurbanUp - 2021-10-08

Downloads links are down, any chance to get a rebuild before the next rebase. Looking for the windows build, thanks


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - Montellese - 2021-10-09

(2021-10-08, 16:55)TurbanUp Wrote: Downloads links are down, any chance to get a rebuild before the next rebase. Looking for the windows build, thanks
Links should work again (except for OSX which is still building).


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - LongMan - 2021-10-10

@Montellese,
When you do rebase for 19.2. Could you please take a look at the clean up section of the import process. That's the section which is taking most time.

Cheers,


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - Montellese - 2021-10-10

(2021-10-10, 19:16)LongMan Wrote: @Montellese,
When you do rebase for 19.2. Could you please take a look at the clean up section of the import process. That the section which is taking most time.

Cheers,
I already rebased, I just didn't create any builds yet.

Yeah I know that the cleanup part is now the slowest part. The problem is that it is very complex especially for tvshows because we have to consider a lot of different cases (e.g. if a tvshow consists of episodes from multiple media providers). That's why it can take very long and is hard to improve. But I'll take a look when I find some time.


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - LongMan - 2021-10-11

@Rijs43,
Based on 19.2 and LibreELEC 10.0 + subsequent fixes.

Cheers

Generic
Raspberry Pi 4

Edit : RockPro64


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - alsc - 2021-10-14

(2021-10-11, 19:16)LongMan Wrote: @Rijs43,
Based on 19.2 and LibreELEC 10.0 + subsequent fixes.

Cheers

Generic
Raspberry Pi 4
Hello @LongMan ,

Are you still building those RockPro64 specific versions? If so, would you please provide me the url? Thank you very much!


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - LongMan - 2021-10-14

(2021-10-14, 15:56)alsc Wrote:
(2021-10-11, 19:16)LongMan Wrote: @Rijs43,
Based on 19.2 and LibreELEC 10.0 + subsequent fixes.

Cheers

Generic
Raspberry Pi 4
Hello @LongMan ,

Are you still building those RockPro64 specific versions? If so, would you please provide me the url? Thank you very much!

Added to the post above.

Cheers


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - alsc - 2021-10-14

(2021-10-14, 17:14)LongMan Wrote: Added to the post above.

Cheers
@LongMan 

Thanks for your prompt reply but I noticed the post above has two links, a generic x86_64 and a Raspbery Pi4 build, neither of which would work on a RockPro64 (which is a RK3399 based ARM device).


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - Montellese - 2021-10-14

Please check again, there are now three (originally two) links in the post.


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - alsc - 2021-10-14

(2021-10-14, 19:32)Montellese Wrote: Please check again, there are now three (originally two) links in the post.

Thanks, @Montellese!

And now I feel like an idiot... Smile


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - LongMan - 2021-11-07

@alsc, @Rijs43 updated builds based on 19.3 and LibreELEC 10.01

Generic
Raspberry Pi 4 
RockPro64

Cheers

NB There is a small problem when both HDMI port are connected. I will post another build when a fixed is out


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - alsc - 2021-11-08

(2021-11-07, 12:17)LongMan Wrote: @alsc, @Rijs43 updated builds based on 19.3 and LibreELEC 10.01

Generic
Raspberry Pi 4 
RockPro64

Cheers

NB There is a small problem when both HDMI port are connected. I will post another build when a fixed is out
@LongMan, @Montellese, and the other developers envolved, thank you all very much for the excellent work you've been doing with this project!


RE: Media importing and library integration (UPnP, Emby, Plex, ...) - Montellese - 2021-11-10

I've rebased my media import work onto the latest Kodi Matrix 19.3 and updated the download links at https://github.com/Montellese/xbmc/wiki/Downloads#downloads. @LongMan sorry for not letting you know sooner but I prepared everything and then I got sick for a few days.