Fixing buffering problem with system mount on SMB

  • Previously, my raspberry pi 3 was running xbian which never had any hiccups (buffering issues) when playing files with a high bitrate via LAN over SMB (like an hour = 6 GB), but with libreelec installed instead on the same raspberry and connected in the same way, I get buffering issues once a minute or more.

    I tried playing the files over NFS which made the buffering less, but certainly still happening. Then I added advancedsettings.xml using the 4th example at HOW-TO:Modify the video cache - Official Kodi Wiki, and bingo: Buffering only occurs in the beginning!

    SMB buffering still is as bad as before though, and I would like to also be able to watch videos with no glitches using this protocol.

    So in this thread (where I have also reported my progress, but thread seems so old that nobody reads it) Advance settings for expanding cache not working.. I saw an advise about using system mounts instead. Not a big operation I thought:

    Code
    # The share we want mount
    What=//192.168.178.10/Film6
    # Where we want mount this share
    Where=/storage/film

    I amended the login and password as well, but I get this when checking status after enabling the mount:

    And I´m also wondering exactly how to make the share pop up in the Kodi menu.. If I add it manually from Kodi like smb://192.168.178.18/storage/film or smb://192.168.178.18/film it tells me that share is not available. What am I doing wrong? I also tried browsing from the server, where under WORKGROUP there´s libreelec which is then the same as 192.168.178.18, but it does not show me the storage folder.

    Edited once, last by jazzlpunk (April 28, 2019 at 8:52 PM).

  • I think I got it right now. Somehow I had done alterations to a copy of the file that I put in the storage folder, so anything I had changed, such as the password was not changed in the mount file that the system uses.

    So I confirmed this to work by in SSH typing ls and it let me view the shares content.

    But I am unsure still of how to add it in kodi. If I set it up as smb://192.168.178.18/storage/film it tells me still that the share does not exist - also if I remove the /storage part.

    Edited once, last by jazzlpunk (April 27, 2019 at 7:31 PM).

  • Code
            <source>
                <name>MEDIA</name>
                <path pathversion="1">smb://user:pass@NAS/MEDIA/</path>
                <allowsharing>true</allowsharing>
            </source>

    I edit /storage/.kodi/userdata/sources.xml directly (not via the GUI) as I find it easier/faster than spelling stuff on a remote with no keyboard and the format is pretty simple to follow ^

    If you're sharing from a machine that uses DHCP make sure you use the hostname (NAS in the example above) else the DB will break when the host changes IP address.

  • Code
            <source>
                <name>MEDIA</name>
                <path pathversion="1">smb://user:pass@NAS/MEDIA/</path>
                <allowsharing>true</allowsharing>
            </source>

    I edit /storage/.kodi/userdata/sources.xml directly (not via the GUI) as I find it easier/faster than spelling stuff on a remote with no keyboard and the format is pretty simple to follow ^

    If you're sharing from a machine that uses DHCP make sure you use the hostname (NAS in the example above) else the DB will break when the host changes IP address.

    Cheers, good idea! But since this is a symlink from the raspberry to a shared folder on my windows computer, where login and password is already set, I assume that its the symlink I will be sharing to and this is where I will need a bit of advise. The raspberrys ip on the network is 192.168.178.18, and its hostname is libreelec.

    So am I right that I should not set login and pw since theyre already in the mount, and should I indicate the storage folder or not, and should I use 192.168.178.18, 127.0.0.1 or libreelec (the hostname) in the xml file?

    EDIT: Nevermind, I found out what had to be done: Instead of trying to add the mount the way I previously attempted, I needed to click on "Home folder" and there storage was visible, inside which was the subfolder representing the symlink. Bingo!

    For anyone interested, this looks as follows in the sources.xml file:

    Code
    <source>
                <name>film</name>
                <path pathversion="1">/storage/film6/</path>
                <allowsharing>true</allowsharing>
            </source>

    Not even mentioning smb nor credentials because it´s already setup in the mount file, and neither the raspberrys hostname nor ip are mentioned because of the mount scripts local installation.

    .. and using this technique is even better than NFS with regards to buffering - its not even showing any buffering taking place in the 1st minute as I experienced it with NFS! I guess the buffer settings in my first post helps with that though, not sure what it would be like with the defaults.

    Edited 6 times, last by jazzlpunk (April 29, 2019 at 7:24 PM).