PI4 with OSMC to read folder/files on Windows10 via NFS

I have managed to get a samba share up and working on my Pi4 that I can stream movies that reside on my windows 10 pc shared drive.

However I would like to get this sharing of files using NFS share. There are quite a few articles out there and all talk about things differently. I have downloaded on my WIN10 PC winnfsd.exe and successfully ran:
.\WinNFSd.exe j:\nfs\my_shared_folder2\ /my_shared_folder2

I have also made sure everything is updated on my Pi4 and then ran this to get what i think i need:
sudo apt install nfs-common

So my question is, is there a guide that can step me through on what files I need to modify and what to add?
Looks like, i think, i need to add stuff to:
/etc/fstab
/etc/exportfs
etc ??

Hi,

Or

Can I please ask why? Although it is true with Linux NFS has notable better throughput, than samba. IMHO the same is not true with a Windows Server. I would stick with samba.

Thanks Tom.

3 Likes

That’s interesting last statement. I actually thought the throughput was much better than Samba hence why i was looking at NFS share.
I have noticed on occasion when playing 4K material (not all) that there is quite a bit of lag/stutter/buffering.
My Pi4 has got a hard wire connection to the router and my PC is connected wirelessly in the same room - in fact it can’t be any closer!
So I just thought NFS share might solve that issue…unless there is some other kind of tweak I can make elsewhere.
I’m guessing a faster read/write SD card would not make the difference?
I suppose I could try putting one of those 4K films on a memory stick and try to play from there to see if it behaves in the same way…although not sure what that will tell me if it plays ok or not…

Hi,

How are you currently mounting the the samba shares? Kodi soft mounts or kernel hard mounts (autofs or fstab)?

Thanks Tom.

Are you sure that your actually connected with a gigabit connection and/or that your issue isn’t actually something that needs to be changed like refresh rate switching or the GUI being set to 2160 instead of 1080 as it should be. You could post some logs to bring some insight. I only have regular Kodi paths on my RPi 4’s and so far have not run into a situation where switching to a more optimal mount was necessary.

1 Like

Using autofs to connect to an SMB share, one can easily pull data at a speed that is limited by gigabit Ethernet speed rather than by anything else. You might want to try that before investigating NFS.

If you still want to experiment with NFS on Windows anyway, you might downloading something called Hanewin NFS Server (to install on your Windows box) - it works quite nicely. But I would definitely try an OS-level mount of an SMB share first. (And if that doesn’t fix things, there may well be something else going on!)

1 Like

Closer is not always better. For WiFi there is also a “too close” but depending on how crowded your WiFi is and/or band steering being enable you always can get patchy connections. Do you have your 5Ghz and 2.4Ghz WiFi on separate SSIDs?

Also check

1 Like

“How are you currently mounting the the samba shares? Kodi soft mounts or kernel hard mounts (autofs or fstab)?”

I only have the one samba share and I believe it must be kernel hard mounts as its not in any config file, such as autofs or fstab

OK, so i moved away from winfsdd.exe from my windows pc as it was not displaying the filename characters properly when they were not in english. I am now with “hanewin”. It appears its much more user friendly with a GUI, rather than running powershell cmds for the other. Plus hanewin does show proper filename whatever language!.
So I manage to create the share on my pi4 via the front end gui, basically by going into addons and adding nfs:\ipaaddress\ my_shared_folder2

Having gone through the trouble of all that to get nfs share working , its actually a lot worse! I will stick with samba drive.
My win pc is about 12 feet away from the router (Virgin’s) running on 5G wifi (although may have to double check that as I am not at home atm). I do have separate SIDS for 2 and 5ghz.

Also additional quick question, how do i remove some of my previous saved entries in the moves/addon list. Even though my previous connections attempts were failing, I still said YES to saving them and now I cannot see how to get rid of some of them. In fact one of my attempts I named the share with the same as an existing name and it added it again, but with (2) at the end of it.
If its not clear what I am talking about I can take a picture of my TV screen to show you.

I have to also add, the majority of 4K films do play fine - they are in the 10+GB and 20GB+ in size. Its just I was having issues playing “7 Worlds 1 planet - series 1 Ep5 -Europe”. It plays some of the others ones OK which all show to be in the same format. Plus that one plays fine on my pc directly.

not sure about gigabit connection?
All I know is i’m going from my PI4 box to Virgin router hardwired on one of the 4 ports. How do i check if its gigabit or not?

If you’re not sure what the raw network speed is, then you should use iperf3 to measure it. Run iperf3 server on the Windows box, and the client on your OSMC device.

See here:

And you’ll make it much easier for people to help you if you post some debug logs.

Go into Settings/System/Logging and enable debug logging; reboot twice; play a video that is giving you trouble (for a minute or so); then go into Settings/My OSMC, find the Log Uploader (clipboard icon) and manually upload logs; then turn logging off again. When you upload the logs it will give you a URL; post that URL here and the OSMC guys can have a look at the state of your system, and what it’s doing while playing that video.

You might also try installing MediaInfo on your Windows box and posting the MediaInfo data for a problematic video, just to see if there’s anything odd about the file.

You can ssh into your RPi and run ifconfig which will show if your connected at 100 or 1000. Logs will show the same. As already mentioned you can run iperf which will actually test the transfer rate.

Keep in mind here that it is not only the RPi operating in isolation. Is that PC where the files live connected via wifi? If so, then maybe that is the bottleneck. If you ran out of ports on your router and that is why your not hardwired all the way round for devices that are sitting in the same room I would highly recommend picking up a small networking switch. They can be had very inexpensively and will give the most reliable connection with the most consistent speed.

My System with a Win10 normal SMB shares connected to a RPi 4 using just Kodi mounts, both hardwired, can play a 55GB 90 min movie without breaking a sweat. This device is capable of running some pretty big files with no special consideration.

Since you had changed sources like this keeping the source name then just a simple settings>media>library>video library>clean library may not get you where you want to be. You could try it and see how it goes, but ideal may be to work out your issue and then just completely remove your video database and thumbnails and scan from scratch just so you know you don’t have any extra cruft from this process.





So I have attached the results (over 2 pages) of mediainfo of that file
and the results of the iperf3 from both osmc and windows - you can see i have run the cmd oin osmc with -R option and then without. Do they look ok?
and ifconfig…
ifconfig

I tried the iperf with and without VPN connection - made no difference. I cant really connect my PC to router wired because although in the same room its unsightly to have a cable - will not really be able to hide it.

They look like you found your bottlekneck. You may be able to play that file if you switch over to a system mount. Just for reference if I run on my hardwired server…

osmc@LivingRoom:~$ iperf3 -R -c 192.168.254.201
Connecting to host 192.168.254.201, port 5201
Reverse mode, remote host 192.168.254.201 is sending
[  5] local 192.168.254.221 port 60958 connected to 192.168.254.201 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   112 MBytes   942 Mbits/sec
[  5]   1.00-2.00   sec   111 MBytes   930 Mbits/sec
[  5]   2.00-3.00   sec   112 MBytes   942 Mbits/sec
[  5]   3.00-4.00   sec   112 MBytes   942 Mbits/sec
[  5]   4.00-5.00   sec   112 MBytes   939 Mbits/sec
[  5]   5.00-6.00   sec   112 MBytes   942 Mbits/sec
[  5]   6.00-7.00   sec   112 MBytes   942 Mbits/sec
[  5]   7.00-8.00   sec   112 MBytes   942 Mbits/sec
[  5]   8.00-9.00   sec   112 MBytes   942 Mbits/sec
[  5]   9.00-10.00  sec   112 MBytes   942 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  1.10 GBytes   941 Mbits/sec                  sender
[  5]   0.00-10.00  sec  1.09 GBytes   941 Mbits/sec                  receiver

And just for reference the same from my laptop I’m typing at via 5ghz wifi…


osmc@LivingRoom:~$ iperf3 -R -c 192.168.254.144
Connecting to host 192.168.254.144, port 5201
Reverse mode, remote host 192.168.254.144 is sending
[  5] local 192.168.254.221 port 38750 connected to 192.168.254.144 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  32.5 MBytes   272 Mbits/sec
[  5]   1.00-2.00   sec  32.7 MBytes   275 Mbits/sec
[  5]   2.00-3.00   sec  36.8 MBytes   308 Mbits/sec
[  5]   3.00-4.00   sec  34.4 MBytes   289 Mbits/sec
[  5]   4.00-5.00   sec  34.8 MBytes   292 Mbits/sec
[  5]   5.00-6.00   sec  37.7 MBytes   316 Mbits/sec
[  5]   6.00-7.00   sec  36.9 MBytes   310 Mbits/sec
[  5]   7.00-8.00   sec  37.6 MBytes   316 Mbits/sec
[  5]   8.00-9.00   sec  37.5 MBytes   315 Mbits/sec
[  5]   9.00-10.00  sec  37.5 MBytes   314 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   359 MBytes   301 Mbits/sec                  sender
[  5]   0.00-10.00  sec   358 MBytes   301 Mbits/sec                  receiver

I sympathise, but I’m not sure you’re going to get adequate network performance any other way. The iperf3 numbers give you the raw network data speed; actual transfer of video data will likely be a shade slower. To play a UHD blu ray remux and guarantee smooth playback, you need to be able to sustain a steady 120Mb/s from server to OSMC device, and your PC’s (wireless) network connection is limiting you to a raw speed of around 140Mb/s - occasionally less. No matter what you do at the OSMC end, you’re likely to be (at best) right on the edge of it being too slow for smooth playback.

Having said that, you should probably try mounting the server’s share using autofs or fstab - you might squeeze enough speed out of that. (Just).

When you say fstab, is that the same as what was previously mentioned i.e a system mount?

Correct. What you have been doing up to this point is just having Kodi directly connect to your PC. This is fine if you have plenty of headroom but it is not as fast as letting the operating system handle the task. You can mount (make a folder in the Linux file system point to your network share on your PC) your media via the OS and then point Kodi to that mount. So instead of Kodi opening something like smb://PC/movies it would point to /mnt/movies.

One way to do this is by editing a fstab file which will make this mount when you boot up and it will stay there. Another is with something called audofs. That one works similar to fstab, but it will disconnect and reconnect as needed. This makes it more reliable if your network share isn’t always available (like your wifi cuts out on your PC). I would just stick with SMB/samba and forget about nfs. A guide is found here…

OK. I will try that.
Although I am having difficulty finding out how to exactly remove all the entries (media sources) in my VIDEO section.

I tried what you mentioned, but nothing worked and your suggestion then was to remove the VIDEO database - how do you do that?

scrap that - figured it out c/o other helpful posts on this forum
modified
vi /home/osmc/.kodi/userdata/sources.xml

and removed them!. all good. i will look into fstab