NFS and Samba Mounts - Stream Stalls

  • I am switching my network file server to new hardware and upgrading to a recent Linux and OpenMediaVault version. I use LibreElec on several Raspberry Pi 3's model B to access the file server. Version 8.25 and also tested with the current 9.x version, 9.01 I think.

    I tried playing a video file from the new server and after a couple of minutes and when skipping around the video wildly...for testing purposes...the stream would stall and I would get various errors in the Kodi debug log. Kodi was still responding to key presses, but it hung waiting for the NFS mount.

    In any case, while going through trying to identify the issue and then trying to test/view the NFS traffic between the client and server, I was setting up an external mount before starting Kodi so I could test different NFS options/configuration. Well, with the first thing i tried, specifying NFS version 3, it worked without issues. Only when using the built-in NFS and the Samba mounts did the issue occur. On my system/environment, it always happens with the built-in mapping.

    The workaround is fine for me. I'm not sure if this is a specific LibreElec issue or a Kodi issue or may only specific to my environment. FYI, I tried this with the Krypton and Leia versions of LibreElec and also with an older Krypton version that was not LibreElec I had previously tested on a Linux Debian Jessie distribution on a Raspberry Pi. The issue happened on all of the versions.

    Debug logs attached. One where it's using the NFS mount within Kodi, the other where it's mounted before Kodi starts and so you see /storage/nfs/SSD path references where the NFS drive is mounted to..

    Another note, when using my old network file server, this issue does not occur.

  • hmmmm strange did you change anything except new hardware? I had always problems with NFS under Linux, NFS only worked at windows in my network (no idea why).

  • With the new hardware, I've also upgraded to Linux Debian Stretch and to a more current version of OMV, 4.1.22, I believe.

    In any case, as the problem does not happen when the drive is mounted before LibreElec Kodi starts and only happens if I use the drive/network browser to map the drive within LibreElec Kodi, I think that should be sufficient to identify where the issue exists. So, it may be newer versions of NFS have caused issues or specific options being used may have caused issues or it just may be something odd in my set up.

    I've not had an issue with NFS before.

  • Just to add a few more details that I've come across and to note that I believe this is not an issue with LibreElec and most likely not addressable by Kodi either.

    I've found other information that indicates the libnfs libraries used by Kodi may be causing issues. These are not Kodi libraries so they can't do anything about them. If that's the case, the best way to handle that is to pre-mount instead of using the built in Kodi mapping.

    Additionally, I've determined that the Raspberry Pi is not helping this issue. I've also been trying to handle what I thought was a configuration issue with the MySQL database I set up. In the end it looks like Kodi is sending very large amounts of data, and that's another topic, and the slow Raspberry Pi wireless speeds are not helping. I'm going to be changing to PowerLine adapters, which I'm not currently using, that should help significantly.

    • Official Post

    If you want stability/reliability on a connection always use Ethernet. If you use WiFi "all bets are off" because there are so many extra variables added to the process. Pi 3B is also known for being "okay" and not "great" with wireless performance (3B+ is evolutionarily better but not revolutionary). If you are stuck with wireless the best approach is a wireless router/bridge device that provides Ethernet to the Pi. I'm regularly working with devices that don't have working wifi drivers so I have an Apple A1rport Express for that purpose .. small, good reception on the last generations of them, and usually quite cheap on eBay - I go for the ones without a box, no cable, and look filthy - as they clean-up fine, I have cables, and they're the cheapest.

  • I know this is an old thread, but I thought I'd come back and post a solution that I eventually found to help others that may have similar issues.

    I added the following to the Samba config file / extra options:

    oplocks = no

    level2 oplocks = no

    aio read size = 1

    I'm not sure if all options are required. I think the aio read size is the important one and may be the only option needed. In my case, it's a single server-client setup and the oplocks wouldn't make that much of a difference.