JR70386 0 Posted January 15, 2015 Share Posted January 15, 2015 Hello, I've recently migrated my library from XBMC to MediaBrowser and set up Kodi and XBMB3C through a FireTV. I've got my keymaps and playback working perfectly, but I can't seem to get my library load times to a reasonable level. I only have ~250 movies in my library and it takes up to 20 seconds to load them. Right now I'm using the Titan BETA skin, and have experimented with different views (i.e. Poster/Wall/List) but none of those seem to make a difference. I also tested with 1080XF and found the load times were not any different. I've set up my library with path substitution to UNC paths. I'm sure there's something obvious I'm missing, but I just can't seem to figure it out. I haven't pulled XBMC logs from the device yet, but I do notice a lot of of hits to my MB server every time I open my Movies or TV library, but I'm not sure if this is just normal behavior. I've attached a small snippet. I'm using Mediabrowser 9770 on Kodi Helix and XBMB3C build 1.0.2. Anyone have a similar experience? MB Log Snip.txt Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 15, 2015 Share Posted January 15, 2015 I assume you have 'Enable Fast Processing' turned on in the settings? Link to comment Share on other sites More sharing options...
nuahsocramid 3 Posted January 20, 2015 Share Posted January 20, 2015 i too am having a similar experience...using the same setup you have going. I checked my settings and i do have 'Enable Fast Processing' turned on. Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 21, 2015 Share Posted January 21, 2015 Could be the FireTV is just not powerful enough to run Python fast. If you want to send in a profile (turn on profiling in addon settings, result will be in user_data) we can see if there is anything to see. xnappo Link to comment Share on other sites More sharing options...
nuahsocramid 3 Posted January 21, 2015 Share Posted January 21, 2015 thank you for the prompt response. i hope i've attached whats needed...first time pulling this type of request/data. thanks profile_(2015-01-20 21-25-14).txt Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 21, 2015 Share Posted January 21, 2015 (edited) I am not an expert at reading these (@ - can you have a look?). But to me, it looks like the FireTV is taking a long time to parse the data from the server. Looks like it is 17.5 seconds just to dump the data from the server into an object, then 5 seconds to add it. Have you tried the 'Netflix view' in XF1080? That pre-loads all the data and may provide a better experience. [EDIT] This is interesting: http://stackoverflow.com/a/14513180 Maybe we should try simplejson again... I can't believe they didn't force at least Python 2.7 with Kodi. [EDIT2] After further review - it looks like FireTV is probably running a reasonable Python version @@nuahsocramid - thanks for the profile - can you also post your xbmc.log? Edited January 21, 2015 by xnappo Link to comment Share on other sites More sharing options...
Luke 38108 Posted January 21, 2015 Share Posted January 21, 2015 in the above chart what is the % of time spent parsing json? there are still ways to trim the api output even more. fields like IsPlaceHolder and PlayAccess are 99% of the time the same value. another thing i was thinking of was image priorities. for example, say you need one 16*9 image of an episode, so you ask the server for primary, thumb and backdrop, then decide client-side which one to use. But if the server knew that priority, it could stop after the first matching one. Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 21, 2015 Share Posted January 21, 2015 In fastItem, I am not even using most of that data anymore, so @@Luke providing an even more stripped down call is another option. Or just brute forcing just the data we need out of the raw JSON. Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 21, 2015 Share Posted January 21, 2015 (edited) All we need for a real time call is id and userdata. Actually might not even need userdata with the recent changes to update the in memory db, just a list of ids. Edited January 21, 2015 by xnappo Link to comment Share on other sites More sharing options...
nuahsocramid 3 Posted January 21, 2015 Share Posted January 21, 2015 @@xnappo hope the attached file is what you were looking for. If not, please let me know. appreciate all of your efforts. kodi.log Link to comment Share on other sites More sharing options...
nuahsocramid 3 Posted January 21, 2015 Share Posted January 21, 2015 ...also i wasnt able to download/install the 1080FX MB3 Skin. when i clicked on the install function i'd get a 0% Downloading and then it would stop. thanks Link to comment Share on other sites More sharing options...
Morphello 2 Posted January 21, 2015 Share Posted January 21, 2015 So my understanding, from reading through this thread and comparing one from mid last year, is that because XBMB3C is a python Kodi script running through JSON, there is essentially no way to eliminate the latency experienced while traversing menus? I have a very similar setup as most of the other posters, Media Browser server running on the local windows based HTPC, talking to Kodi via the plugin. I have Fast Processing enabled, stream info, people and overview disabled and everything is on an SSD. Unlike the rest, I'm running it on a 4690k at 4.8ghz and I'm still experiencing delays while browsing around. My media collection isnt that large, but I'm finding anywhere from about 700ms to 3000ms to navigate between subfolders in a TV show, and a weird 5-7 second delay after selecting an item to play, and it actually playing. This of course is only experienced within XBMC. I get less of a delay loading up an episode or movie via http with transcoding. So is there ever a possibility that the plugin can even approach the same sort've minimal latency as the inbuilt SQL database, or is that a pipe dream? Link to comment Share on other sites More sharing options...
marcelveldt 736 Posted January 21, 2015 Share Posted January 21, 2015 ...also i wasnt able to download/install the 1080FX MB3 Skin. when i clicked on the install function i'd get a 0% Downloading and then it would stop. thanks In that case the skin probably has just updated on the repo. Just try again later and it will work 1 Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 21, 2015 Share Posted January 21, 2015 (edited) So is there ever a possibility that the plugin can even approach the same sort've minimal latency as the inbuilt SQL database, or is that a pipe dream? With this addon- a pipedream. There is an inherent delay to: 1. Using a non-XBMC data format, (we have to parse the MB3 API into the XBMC API) 2. Hitting the network (even if on the local machine) and querying the server. 3. Running Python vs. native C Please *do* try the XF1080 Netflix mode though - it preloads all your collections, so you have a delay at startup, but then everything is at your fingertips. The other option is for someone to start a project to background sync the MB3 database to the local SQL database - but that is a totally different project. Now ... given we are trying to attack a 25 second problem on the FireTV - you may end up seeing some improvement, but it will never be the speed of the local SQL database. xnappo Edited January 21, 2015 by xnappo Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 21, 2015 Share Posted January 21, 2015 (edited) To explain a little bit about JSON. JSON is the format of the data that is sent by the sever. It looks like this: [{"Name":"12 Years a Slave","ServerId":"58f3fd5606c9465cacb4f204be2d72e3","Id":"672584bc98ce35d77ba6a483a527a6df","PremiereDate":"2013-10-30T05:00:00.0000000Z","OfficialRating":"R","CommunityRating":8.2,"RunTimeTicks":80500910000,"PlayAccess":"Full","AspectRatio":"","ProductionYear":2013,"IsPlaceHolder":false,"IsHD":true,"IsFolder":false,"Type":"Movie","LocalTrailerCount":0,"UserData":{"PlaybackPositionTicks":0,"PlayCount":5,"IsFavorite":true,"LastPlayedDate":"2014-12-24T20:06:08.2937421Z","Played":true,"Key":"76203"},"VideoType":"VideoFile","SupportsPlaylists":true,"ImageTags":{},"LocationType":"FileSystem","MediaType":"Video"} Python has a module that then takes that string and builds up an object in memory for us to reference. Even when running from the local cache, we still have to do that. We are seeing that process take a long time on the FireTV. According to that link I posted earlier, the JSON processing code in Python 2.6 is not compiled in C, whereas 2.7+ it is. This could make a big difference. From @@nuahsocramid's last log, it DOES look to me like the FIreTV XBMC comes with an old version of Python. The other thing we were talking about with @@Luke is that though the above is the minimum we can ask the server for, we are not really using any of that data when we browse movies, as what the whole 'Fast Data' thing does is pre-loads all the movie details into memory at startup, and then update every time an event happens (playback stop etc) and on a time interval. So if we could just get a list of ids from the server, there would be a whole lot less to process when browsing around. I am sure that is more info than most of you wanted xnappo Edited January 21, 2015 by xnappo Link to comment Share on other sites More sharing options...
nuahsocramid 3 Posted January 21, 2015 Share Posted January 21, 2015 although i have not a clue to how this stuff is built/coded...i find it rather interesting and appreciate everyone's time and efforts. I'll try to install the 1080FX MB3 Skin later tonight and post an update. I came across this forum topic late last night and wondering if it could potentially apply towards the FireTV: http://mediabrowser.tv/community/index.php?/topic/13839-roku-stalls-and-gets-stuck-in-mb3/ "...someone posted elsewhere in the forum that reducing image size helped their "lag" issues with their roku. I tried this, and noticed an improvement. The network traces were much cleaner. Much of the TCP receive window zero issues were gone. I guess it makes sense. I then used Media Center Master to re-size all my images (max poster/cover width = 320 pixels, max backdrop = 1280 pixels). navigating between objects became much more fluid" I'm not an avid user of Media Center Master...so before i try to scale that wall...is there a way to resize the metadata within MediaBrowser? Thanks Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 21, 2015 Share Posted January 21, 2015 There is a switch you can try to make images slightly more compressed: 'Compress Artwork' in settings. However - from your profile the main speed issue is crunching the text data. xnappo Link to comment Share on other sites More sharing options...
Morphello 2 Posted January 21, 2015 Share Posted January 21, 2015 Thanks for the reply xnappo. I just tried a fresh install of Kodi, portable mode, with XBMB3C and 1080XF running Netflix mode. There didn't seem to be a loading delay at the start of the program, but after a few seconds a bunch of movies were populated on the main page. Cycling through movies seemed quite quick, although i didn't really have an issue before. The delays when traversing shows (Futurama > Season 3 > episode 5) all seem to be about the same. I used all the same previous settings. Overall that skin did feel quite a bit faster, but the inter folder delay and the delay playing movies still persisted. I'm not too knowledgable on the topic, but I've noticed that none of the delay occurs outside of xbmc, meaning that, as you said, its almost entirely the python/json parsing. Would a binary addon eliminate this delay? If my understanding of what a binary addon is. Running something native to then push to Kodi while avoiding python and the json rpc (if at all possible). Frankly I'd like to move on from kodi, but the alternatives now don't provide the right features or arent stable enough for my needs. MBT is just a bit too young to use as an all in one solution. Link to comment Share on other sites More sharing options...
dark_slayer 103 Posted January 24, 2015 Share Posted January 24, 2015 Maybe jumped the gun a little on the blog post http://mediabrowser.tv/community/index.php?/blog/1/entry-169-media-browser-pairs-perfectly-with-kodi-helix/ Optimized for low power devices like the Fire TV? Not completely cracked this nut just yet I'd say. My experiences even with the Nexus Player's quad intel atom are similar to when I was testing the fire. Running a scraped library for now on the Player. MediaBrowser for Kodi is still best with an intel htpc at the moment Sorry @@xnappo, never got to log everything on the fire like these guys did (holiday time showed up too soon) One thing I noticed was that Titan took a little longer to load, but as it didn't rely on server indicators as much as 1080XF does (at least by default when you run it your settings will get flipped to use server indicators for the skin) the Series to Season to Episode transitions were much better but still in the 3-5 (minimum) second range. Can't say if the nexus is running Python 2.6, where would I identify that? Link to comment Share on other sites More sharing options...
dark_slayer 103 Posted January 24, 2015 Share Posted January 24, 2015 Also I think Android's aggressive memory reallocation may be playing a role here when I switch over to limelight or the music app Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 24, 2015 Share Posted January 24, 2015 (edited) The optimization is in enabling the Netflix view in 1080. Have you tried it? Post a log and I can check the version of Python. The rest has also been optimized - it is twice as fast as before - that is a lot of optimization Edited January 24, 2015 by xnappo 1 Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 24, 2015 Share Posted January 24, 2015 (edited) @@nuahsocramid @@dark_slayer I am looking into processing less JSON - but I found a bug with user collections where the new 'fast' code was not actually requesting the small data version from the server. @@nuahsocramid - was that profile from a user collection? The only thing the 'fast' was working for was the 'All Movies' node. 0.9.778 has been released to fix this. Please test! Edited January 24, 2015 by xnappo Link to comment Share on other sites More sharing options...
xnappo 1596 Posted January 24, 2015 Share Posted January 24, 2015 @@im85288 @@marcelveldt - I have changed this back and forth a few times, please confirm this doesn't break skin helper. I have no idea why I reverted it in this commit: https://github.com/MediaBrowser/MediaBrowser.Kodi/commit/cbc185c6988ab96b84b8c09cc0ff64a4e686cac3 It needs to be as it is now. If it presents a skin helper issue, we need a different work-around. Link to comment Share on other sites More sharing options...
dark_slayer 103 Posted January 24, 2015 Share Posted January 24, 2015 Okay, the only improvement I notice in Netflix mode is for the little filmstrips at the bottom, but the loading times in the categories are the same After about a minute my nexus player either thermally throttles, whines about memory, or something unknown . . . it definitely starts acting wonky and I have to do a reset to get normal function back One noticeable improvement for me with XF was ticking the compress artwork box, but still sluggish overall Link to comment Share on other sites More sharing options...
dark_slayer 103 Posted January 24, 2015 Share Posted January 24, 2015 Log, restart Kodi just navigating into and out of TV Show and Movie directories kodi.log Link to comment Share on other sites More sharing options...
Recommended Posts