Default Samba protocol with LibreElec

  • I had a question with regard to how Samba is configured specifically to LibreElec as opposed to an alternate Kodi-integrated OS or Kodi installed on anything else.

    I have a file transfer bottleneck issue within my LAN I’ve been trying to solve for weeks, and through process of elimination I’m pretty sure it has to do with Samba configurations between client devices and my server host machine. I have a client LibreElec Chromebox and a Vero4K running OSMC. My backend consists of a WD MyCloud network drive, WD EasyStore plugged into the My CloudC and both are available as network Samba shares. I also have a host Mac Mini running Lubuntu that hosts a Jellyfin server, but also has a separate internal HDD drive and WD MyBook drive connected via USB 3.0 drive that is used for media storage and those are also available as samba shares and on the network. The LibreElec Chromebox can play any file of any size from any location on my network with no problems whatsoever. The OSMC Vero 4K likewise has no problems with files on the dedicated NAS devices, but struggles with files served via Samba from the drives locally mounted on the Lubuntu Mac Mini. It’s pretty universal. Larger more high definition files stall and stutter faster, but even DVD rips get there eventually as well. This same problem also occurred just trying to stream files on my iOS devices with VLC as well as the native Jellyfin player app, Swiftfin. The problem went away in VLC when i went into settings and unchecked the box “Prefer Samba 1” and now everything plays flawlessly the way LibreElec does, but Swiftfin still stutters and stalls. Is there something specific about the way Samba protocols are configured as a default in LibreElec that would allow for faster transfer speeds that I should try and duplicate in the other places where the Samba protocol seems to be a transfer speed restriction? I don’t remember changing anything special on the Chromebox or there being any kind of choice to be made on the server host device when I was editing the Samba config file there either. Like I said, the only problems occurs with files on the drives locally mounted on the Lubuntu Mac Mini. The other standalone NAS devices all work great regardless of what client is used.

  • Kodi in LE has been compiled with an internal SMB client (libsmbclient) which is independent and separately configurable to the 'smbclient' binary derived from Samba which is also embedded in the OS. Both follow the default 'Samba' behaviour of SMBv2 min and SMBv3 max, meaning clients connect at SMBv2 and (re)negotiate to SMBv3 if the server supports it, unless manually forced to use min/max SMBv3 or min/max SMBv1 only. If users set min SMBv1 and max SMBv3 the client still tries to connect at SMBv2, and this has been the Samba default for at least a decade now (as SMBv1 has long been considered wildly insecure).

    The Kodi smb client can be configured with different read/write cache sizes. LE uses the Kodi defaults which can be overriden (with mostly negative effects). In older Kodi versions this is done from advancedsettings.xml. From Kodi 21 (LE12) the default SMB read chunk size was changed and can now be configured from the Kodi GUI which helps with some scenarios. Are all the Kodi clients running the same Kodi version?

    I have zero knowledge on Jellyfin clients, but they may work in a similar fashion to Kodi with different caching and protocol support in different OS and app versions. If you want to test for SMBv1 or SMBv2/v3 use, you should be able to disable SMBv1 support on the Lubuntu server (and you should do this anyway) and if things break, it was using SMBv1 (which is slower) to connect.

    The only other thing which normally impacts SMB transfer speeds is the filesystem driver on the server; the main problem being that users have NTFS drives which are poorly supported in the host OS. These days LE uses in-kernel NTFSv3 drivers. In the past we used NTFS-3G which are userspace (and thus much slower) drivers - and this is still the default in most distros. However that's a server side restriction so it would limit transfter speeds to all SMB clients, so that's unlikely to be the reason.

    /shrug

  • Thanks for the explanation. Yeah, it doesn’t seem to be a Jellyfin-related issue at all, I was just wanting to include as much relevant info on my particular setup as possible. A lot of this stuff is super unfamiliar territory and I’ve never messed with Samba settings in the past. I intended to do the whole setup with NFS, but I didn’t know what I was doing and I just happened to find an easier to understand guide for configuring the fstab file using Samba and went with it. I may just remount everything and share everything with NFS. Looks like the OSMC version on my other client is using Kodi 20.5. The next one is supposed to use v 21. I just upgraded LE yesterday so they were using similar versions of Kodi at the time I was having issues.