HD Video: NAS causes stutter but not flashdrive

I’ve read thru many posts related to my issue yet none has solved my problem.

I have a PI3b that I have tried an older 2016 version as will as current version of OSMC with same results. Namely, WD MyCloud 4TB NAS stored videos of 1080P(usually H264 in mp4 or mkv) about 8GB or larger stutter and the sound goes mute. Previously, when my videos were smaller, 1080p at 4~6GB, the freezing/stuttering didn’t happen. At first I thought it was Pi3’s limit but, I was able to play the same video without stutter thru the USB by flashcard so the Pi3’s speed is not the problem.

My home uses two Gigabit switches(Netgear and Linksys) and a router(Timewarner) connected by cat6 cables. The switches are unmanaged, I can transfer files between NAS and computer at 25MB/s or faster, and OSMC connects to NAS using SMB. It seems my NAS has NFS also because OSMC list the NAS there but clicking on the IP offered has no effect.

I’ve tried applying some of the things that worked for others like editing the boot file or advanced settings file but it didn’t work for me or I’m not implementing the changes in a way that applies to my setup. I’m fairly new to linux systems so I’d appreciate the help.

You’ll not see such a rate to the Pi because it’s only on 100 Mbit/sec ethernet interface - and that’s just its theoretical max at the ethernet level.

Is the samba share mounted locally, eg using /etc/fstab? If so, you can test the network performance using dd, eg dd if=<large shared file> of=/dev/null bs=1M.

If you want to try NFS, you might need to configure the NAS to allow the Pi’s IP address to use NFS…

Edit:typo

Hi Chiuchimu,

First off have you considered video caching

I would recommend these settings for pi3:

<cache>
	<memorysize>157286400</memorysize>
	<buffermode>1</buffermode>
	<readfactor>4.0</readfactor>
</cache>

You will probably get better transfer rates with your nas using kernel mounted NFS, here is over view for setting up wd cloud.

Then on osmc, via ssh.

sudo mkdir mnt/SHAREDFOLDER

sudo nano /etc/fstab (add the line below at the bottom of the file:)

IP of nas:/nfs/SHAREDFOLDER /mnt/SHAREDFOLDER/ nfs x-systemd.automount,noauto,ro

ctrl-x and yes to save, to save and exit nano.

Reboot osmc.

Then add the video source in osmc:

browse

root file system

mnt

SHAREDFOLDER

Thanks Tom.

This small mistake should actually be sudo nano /etc/fstab

Hi ActionA,

Thanks for the spot, I’ve edited my post.

Regards Tom.

1 Like

Thanks everyone for your response. I’ll try your suggestions tonight then bring you an update.

I mounted Samba on the pi3 and took speed test using:

dd bs=1M count=256 if=/dev/zero of=test conv=fdatasync

the result was 10.8 MB/s
Isn’t that fast enough for 1080P?

Sure is. You’re getting 10.8 M bytes /sec and 1080p will probably need closer to 10 M bits /sec streaming - How much bandwith is required to stream 1080p? - Super User

The problem with your test is it seems to be measuring the write speed of your SD card, not of the network. :grinning:

You might also want to take a look at Tom Doyle’s post above about caching. Many people have had success with this small tweak. You’ll need to enclose Tom’s XML within a further label:

<advancedsettings>
  <cache>
   	<memorysize>157286400</memorysize>
	<buffermode>1</buffermode>
	<readfactor>4.0</readfactor>
  </cache>
</advancedsettings>

The official Kodi documentation is here.

I SSH to my NAS and added to /etc/exports:
/Tv 192.168.0.0/24(rw,subtree_check,secure)

where /Tv contains the movies.

I added

157286400 1 4.0

to advancedsettings.xml
(I cant get < > to show on post)
Then
sudo mkdir /home/osmc/Tv

sudo nano /etc/fstab (add the line below at the bottom of the file:)
192.168.0.7:/Tv /Home/osmc/Tv/ nfs x-systemd.automount,noauto,ro

Then I try sudo mount -a
I get the error
“Denied by server.”[details=Summary]This text will be hidden[/details]

Is the fat marked text the full qualified path in your WD NAS?

Hi Chiuchimu,

In fstab tab try:

192.168.0.7:/Tv /Home/osmc/Tv/ nfs x-systemd.automount,nouser,noauto,ro

Apologies I’m using a different NAS and my export settings are slightly differently.

@Syncro20VTurbo has just set this up on WD cloud. Synco20VTurbo may you please advise on the settings you used to get this to work?

Thanks Tom.

Well Tom, of course I will.

So I followed the steps here to setup the nfs share on the WD MyCloud. It is very simple and easy to do.
The only thing to do is editing the “exports” file in an editor as exmaple by entering this “sudo nano /etc/exports” after enabeling SSH on your NAS and logging in. The MyCloud will set a password for the root user and give it to you while enabeling SSH if I remeber right.
Than add this “/nfs/SHAREDFOLDER 192.168.0.0/24(rw,subtree_check,secure)” of course by changing the IP address to your NAS’s one and the SHAREFOLDER to the path your folder is located on the NAS.
For now I use the standard configuration from OSMC and did not add a advancedsettings.xml as it does not give any benefit to me.
Even I did not mount the shared folders from the NAS to a local folder via the fstab, I just added them in the OSMC gui and it worked fine. While playing a 13Gig x264 1080p DTS-HD Movie I just have two stutters, but I’m not shure why. Maybe huge network traffic or some other devices got access to the NAS.
Just one hint: a lot users have those or similar problems and I found a post on another forum who solved his issue by using a USB Gigabit Network device, as the possible Networkspeed is much better with that solution as you can read here. I use one from Edimax and it could not get easyer to install, as you just have to plug it in and it works. Additionally it’s not an expensive one.
One additional thing that I do not undestand completely is the following: To figure out if the Networkadapter change would help, is to use the PI3 in an 100 MBit Network, by pluggin it into a 100 mbit switch if you have one. It sounds a bit strange, but it seems that the PI has problems by playing vids above 8Gig in a gigabit network with it’s 100MBit Network device. That’s a thing noone I have talked to could explain by now, but it worked with my PI as well.

That’s the setup I run OSMC on the PI3 with a WD MyCloud NAS in a Gigabit Network.

Hopefully that helps a bit. If you have further questions do not hesitate to ask.

Kind regards Mathias

1 Like

Hi,

I’ve just reread your post, I think the following may work for nfs.

exports on wd cloud:
/nfs/Tv 192.168.0.0/24(rw,subtree_check,secure)

Now you can do as Syncro20VTurbo has suggested and browse to the share via kodi nfs or you can do a kernel mount using fstab and I think this should be:

192.168.0.7:/nfs/Tv /Home/osmc/Tv/ nfs x-systemd.automount,noauto,ro

or

192.168.0.7:/nfs/Tv /Home/osmc/Tv/ nfs x-systemd.automount,nouser,noauto,ro

Thanks Tom.

My folder structure on WD cloud is //cloud/Tv. inside Tv is a lot of files and subfolders, 4TB. I do not have a folder nfs, should I create one so that I can write 192.168.0.7:/nfs/Tv? Or is /nfs/ serving a different function that’s not a folder?

It seems I’m running into uid problems since I am not able to click the folder in osmc although I can navagate to it. I’ll read up on uid and try some more.

Two other options seem to be:

  1. USB2.0 Gigabit adaptor. If that works I could simply use SMB. I can get this in two days from Amazon.
  2. Move my NAS to the switch(livingroom) that the Pi3 is on - it is currently on the switch in my room with my computer. If this stops the stutterer then it could mean my cable to livingroom from the router is bad. Also with a NAS there, I can speed test both switches and living room cable since my computer is on a different line. Then I’ll know the true speed and can plan from there.

Man, doing this after I get home from work is tiring. I’ll post back once I try some of this stuff out.

Hi,

wd nas put nfs shares in a sub directory of a folder called nfs, thats why you have /nfs/ at the beginning of the share. I hope that makes sense?

Thanks Tom

^I don’t think I can move all the videos to a new folder.

On the positive side I think I am isolating the problem. When Pi3 and NAS are on the same switch it plays fine but, same video now stutters on my Computer which is on a different switch. So I ran NAS Performance Tester and sure enough speed thru the living room cat6 cable was only 0.84 MB/s. Tried copying a 100MB file from my Computer to NAS using TeraCopy and that gave me only 512 Kb/s. I think I found the bottle neck - I think my cat6 cable is bad so I ordered a replacement cat6a cable and also a usb3.0 gigabit adapter with one day shipping. I’ll install them tomorrow night and update this thread after. Maybe it will run fine on SMB.

Hi chiuchimu,

you don’t have to move the files. Leave them where they are, and add the Path behind the /nfs/ and it will work. I think it’s something “virtually” needed for the nfs share system in the WD MyCloud.

So simply change the SHAREFOLDER with the path you got access to your Files and it will work.

As an example:
a path you got access may look like: “\\WDMYCLOUD\media\movies”
then you have to add the line “/nfs/media/movies IPfromyourMyCloud/24(rw,subtree_check,secure)” to your export file.

Looking forward to your update, but even 0.84MB/s is way to low even if you use a 100Mbit Network.
A good transfer rate for 100Mbit is about 8MB/s, Gigabit is somewhere around 100MB/s, dependent on a lot things which can slow that down. But 0,84 MB/s is completely out of range.
As an exemaple, copying files to my NAS’s intern HDD is around 70MB/s copying to the USB drive plugged to the NAS is at 30MB/s.

Mathias

[Solved] I got the cat6 cable today and test ran it. I get 78MB/s so it was clearly the cable. I ran the new cable in the attic and reconnected everything. Now it plays fine!

Examining the old cable showed that it got damaged somehow. There were several places were the plastic cover was scrapped/gnawed off exposing metal wire. It might have been a mouse nibbling at the cable or it was scrapped against something rough.

Anyway, thanks to everyone who helped out. I am really happy with how helpful everyone here is.

Glad to hear you got it sorted.

Tom.