Browsing library slow or unresponsive in Kodi on Pi3

  • Hello Everyone,

    I've been using Kodi for a few years now with no problems until recently. I upgraded my Kodi Installs from 17.6 to 18.9 and have been having all kinds of issues on both of my Pi3's since the upgrade. I am using a MariaDB docker to keep a centralized database on my Unraid servers SSD Cache Drive. I currently have two windows machines (connected via ethernet to the same switch the server is connected to) and two Pi3's connected via Wifi. Neither Windows install has issues with Kodi or the SQL database.

    The main issue I seem to run into is that kodi is slow or sometimes unresponsive when trying to browse my collection on the Pi's. Sometimes when trying to navigate to my TV shows I might have to wait a minute of more for it to load the TV show library. Other times it loads right away. I've had instances when trying to select a show that it will just freeze trying to load the season or episode view. I will get a spinning icon sometimes but at other times everything just becomes unresponsive for several minutes. At other times I can I can navigate fine around my TV library but when I got to browse my movie collection I will have to wait a couple of minutes for it to load. I have times where none of this happens and everything works as it should.

    At this point I'm not sure where to start with troubleshooting this issue. I've tried the wait for network setting and have tried 10, 30 and 60 but it doesn't seem to fix the problem. I'm not sure if this is a Kodi problem, a MariaDB problem or a network problem. I've read about changing cache values in MariaDB but haven't done anything yet as I'm not sure what I would need to change. Any suggestions on things to troubleshoot would be great. I want to add a few more devices to my setup (Firestick 4K and possibly another Pi3) but it's kind of pointless if I can't get the others to work.

    Pi1 Log w DB enabled

    Pi2 Log W DB enabled

    MariaDB custom.cnf config settings

  • Whenever RPi users mention "slow", I don't know what to make of it. Unresponsive is something else, but otherwise... A RPi3 still doesn't have the same horse power as a fullblown PC, and people sometimes may get the wrong impression. A RPi4's CPU is already 25% faster over a RPi3, gigabit and USB3.0 help too of course.

    Just, which part or parts are slow? Is everything going in slow motion, or is it only certain sections? From your setup I can tell you're not a beginner. I've used a MySQL database from the beginnings of XBMC Dharma onwards, and it has never been a part that creates slowness.

    One thing perhaps is the Aeon Nox Skin that has been installed. It's "heavier" than the default Estuary skin, and could be some sort of roadblock.

  • I am using a MariaDB docker to keep a centralized database on my Unraid servers SSD Cache Drive.

    I think it's a DB issue:

    Code: Pi1 Log
    2021-01-07 18:36:09.664 T:1675469696   DEBUG: RunQuery took 22 ms for 106 items query: select * from episode_view  WHERE (episode_view.idShow = 223) AND (((episode_view.playCount IS NULL OR episode_view.playCount < 1)))
    2021-01-07 18:36:09.665 T:1675469696   DEBUG: DatabaseUtils::GetSortFieldList: unknown field 31

    Try a different MariaDB version on LE.

  • Klojum, Thank you for the reply. When I mention Kodi is slow, it's mostly accessing my library. For instance, last night after a fresh reboot I went to my TV Shows. It was 5-10 seconds before my TV Show library loaded. After browsing through I went back to the home screen. I then went to my movies library and it was at least 45 seconds if not longer to access on one of my Pi's. I repeated the steps on my second Pi. I waited for at least 2 minutes before I could access my movie library after view my TV show library.

    I've had other times when trying to get to season view of a show and it will take a couple of minutes and just hang there. Sometimes stopping a file during playback will make Kodi become unresponsive going back to episode view. When talking about slow operation it's always accessing the library initially. Once the library is loaded I can browse through it just fine. If I exit back to the home screen and try and access it again I can have issues with it being slow to load the library again.

    This doesn't happen all the time though. I've had multiple days where everything runs just as smooth as it did on my previous 17.6 install. Playback of a video is never affected other than waiting for a drive on the server to spin up to play the file. Other than upgrading to 18.9 my setup is exactly like it was prior to the upgrade.

  • I've had multiple days where everything runs just as smooth as it did on my previous 17.6 install.

    That sounds like a network problem to me. Also since your Pi's are connected via Wifi, which do not have the most of excellent antennas. Especially for high-bitrate video streaming. Whenever you can install cabled connections, do so.

    For database stuff, you could enable the Database component in Kodi's debugging section, and see if you have hiccups there. Also, with the newer Kodi versions come newer Linux kernels. And sometimes hardware drivers are reacting worse/differently for some unknown reason.

  • So I was reading back through what I posted yesterday and wanted to try and be a little more concise with the issues I'm experiencing. I was in a rush most of yesterday and haven't used Kodi on the pi's much it the last few weeks with the issues I've been having. Last night I had some time to mess around with it and think about all of the issues I've seen pop up.

    I guess I have two issues, one is slow accessing of library's and the other is Kodi becomes unresponsive. I'm not sure if these are related issues or two separate issues. First on the slow accessing of the library's. When selecting a library from my home screen it could take a while for it to load. Last night I timed accessing my Movies library. It ranged anywhere from 14 seconds to 58 seconds to load into library. The TV library which is quite smaller was between 5 seconds and 25 seconds. In the past few weeks I have had either take a few minutes to load. When in the TV library, accessing the season view and episode view can take awhile also. I've seen it take up to a few minutes to load either one.

    The major issue is Kodi will just sometimes become unresponsive. Last night for example, I was watching a TV Show. The episode ended and Kodi became unresponsive. I was left with nothing but a black screen for at least 5 minutes. I went to my computer to try and reboot via SSH commands but it finally loaded back to the episode view of the Show. So I played another episode and the same thing happened. I'm not sure if it would have eventually loaded as I rebooted via SSH. I've had times where Kodi will just go to a black screen loading into a library and I will have to reboot. Sometimes I get a spinning icon as if its working but most of the time I either get a blank screen or it freezes on the current screen. I've had this happen while loading a library, going to season or episode view or when playback stops.

    During playback I never seem to have an issue. Even when I play my highest bitrate files there is no buffering issues that I remember seeing.

    Try a different MariaDB version on LE.

    So I gave this a try. I rolled back the docker on Unraid (linuxserver/mariadb) from 10.4.17 to 10.3.18. It's about a year old but the newest version that was 10.3. As you can see from above it still had the same issues as before. Things seemed to be going good right after the rollback as far as Kodi becoming unresponsive. The loading of the library's were still slow but I can deal with that. Eventually though I did have unresponsive issues as I posted above. I might try another version later this weekend after I try a few things.

    That sounds like a network problem to me. Also since your Pi's are connected via Wifi, which do not have the most of excellent antennas. Especially for high-bitrate video streaming. Whenever you can install cabled connections, do so.

    For database stuff, you could enable the Database component in Kodi's debugging section, and see if you have hiccups there. Also, with the newer Kodi versions come newer Linux kernels. And sometimes hardware drivers are reacting worse/differently for some unknown reason.

    I unfortunately can not hard wire either of these pi's. I rent and do not have a way to really get an ethernet cable to either without them being in the way. I am going to see if I can temporarily run a cable over the next couple of days and test that out though.

    Both logs I posted above had the database component enabled. I'm not sure what to really look for in the logs.beside error messages. I did see this in the pi1 log from the first post and have seen it before in a few logs after the upgrade

    Code
    ERROR: Unable to open database: MyVideos116 [2013](Lost connection to MySQL server at 'reading authorization packet', system error: 104)

    I'm going to try to backup one of my Pi's and do a new install from scratch. I will try and set it up exactly as I have now but use a local database. Not sure if this will help rule out network issues but I will also test the ethernet option also. If you have any other suggestions of things to test then please let me know.

  • @ghostofsparta Those quick freeze annoyances have nothing to do with wireless or wired connection, but with holding the storage folder on a network share per se: I can observe them as well as soon as I create the storage disk on a nfs share. I connect the rpi3b with gigabit wired lan.

    Try it for yourself if you happen to own a sata to usb converter and connect it with a usb 2.0 port of your rpi3b: put the same storage content into a ext4 partition and switch cmdline.txt with disk=/dev/sdaX to the drive. Symptoms should go away already by now, if not switch boot=/dev/sdaY as well to a 2nd drive partition: it needs to hold just the squash file called SYSTEM, it can be ext4 as well.

    Interestingly enough this only affects the rpi2 images and not x86_64 Generic which I'm completely (PXE-) booting from my NAS. I purchased the rpi4b for Christmas. It works quick and flawless on a usb 3.0 connected drive. I' will test it as well with the same storage folder put on nfs, maybe those freeze ups when I change to Home will reappear again. Will keep you posted.

    Edited once, last by TuxOhOlic (January 11, 2021 at 9:42 AM).

  • Trying to install ASUS AC-56 USB WiFi drivers. Have downloaded Linux drivers from ASUS and they are sitting on the USB thumb drive installed on my Raspberry PI 4. Unzipped. LibreElec 9.26. Kodi 18.9

    BRGS,

  • So over the last week or so I've done quite a bit of testing. I've tried different versions of MariaDB, rebuilt my library from scratch on one of my Pi's and ran an ethernet cord directly to one. Different version of MariaDB didn't seem to make any real difference at all. The rebuild of a non MariaDB library helped with the slow browsing but introduced buffering issues on higher bitrate files. The one pi I tested over ethernet had no issues at all with playback or file browsing I was seeing.

    Klojum was right about this being a network issue. I've since ordered some long ethernet cords that I should be able to route around and hide well enough. Thank you everyone for you help.