How I fixed buffering/stuttering issues while playing files from my NAS
#1
So after a few years of using XBMC/Kodi, I started getting frustrated at the fact that Kodi cannot play HD video files from my NFS server without constant stuttering and pausing to buffer, while on the same system, the videos play in Media Player Classic just fine. In fact, I was able to get 6 videos playing simultaneously, all ~20GB, from the same file server before I ran into any noticeable performance issues.

Why is it with the exact same hardware, network, and files, Kodi can't keep up with a single video? I have no idea, but the issue appears that Kodi is not properly mounting NFS sources, or at least it is not doing so with parameters that are sufficient for it's intended task. Here's what I was able to do to fix it:

Manually created mount points.

Since I'm using OpenELEC as my main HTPC, I created the file: /storage/.config/autostart.sh with the following contents:
Code:
#!/bin/sh
sleep 15
mount -t nfs 192.168.42.10:/mnt/vpool0/Shared /storage/mnt/Shared -o udp,noatime,rsize=32768,wsize=32768,nolock,nfsvers=3

Then I edited /storage/.kodi/userdata/sources.xml with the new paths.

Finally, I used sqlite to update the paths in /storage/.kodi/userdata/Database/MyVideos90.db.

Now, all my video files are playing without pausing, they are seeking nearly instantly, and I don't get that annoying bug where Openelec reboots after unpausing the video after 10 minutes.

I expect that this solution is going to come with it's own issues since Kodi is not going to see these files as being on a network drive, but at this point, I don't care, the files just don't play properly otherwise.

Note, Kodi's implementation appears to be the root cause of this issue as it is not platform specific in anyway. I was able to reproduce this issue perfectly on the newest OpenELEC build, as well as the latest windows build for Kodi. Also, all testing was done with a brand new Kodi installation/profile.

My question is why is this happening, and why don't I see more people complaining about this? I have been fighting with this issue ever since I started to appreciate higher quality files. Am I the only one playing large files over the network? Have the majority of users accepted the fact that with the default configuration Kodi is incapable of playing large video files over the network? Or does everyone already know that NFS sources should be manually mounted?
Reply
#2
What kind of NAS unit are you using (Synology, QNAP, etc)?

And just to be clear, your solution (both in OpenElec and Windows), was to map your NAS as a drive?
Reply
#3
Here's the specs for my NAS, I can saturate a 1GB connection with large files, it's a bit overkill...
NAS4Free v9.2.0.1
Intel i7 920
12GB DDR3 @ 1600MHz
LSI 9211-8i
7 x 3TB WD Red (RAID Z2 +1 hot spare)
1GB Intel NIC

To answer your second question, in both Windows and OpenELEC, I get the stuttering/pausing to buffer/slow seeking issues with video files that are added via an NFS source through Kodi's GUI. However, if I mount the share through the operating system (NFS or SMB), and then point Kodi to that, even the largest files play fluidly and seek instantly.

I'm not sure why I didn't test this before, but on both systems, adding a source via the SMB protocol will also play the largest videos without issue.

So basically the issue is only with NFS shares that are added in Kodi's GUI. If the NFS share is added at the OS level, at least with the parameters specified above, videos play fine.
Reply
#4
known issue - https://github.com/sahlberg/libnfs/issues/108
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#5
@Blazemonkey

This is also an issue with Kodi's implementation of SMB. It seems to work better having the OS handle the share than Kodi.

Doing a similar process to you fixed my issue here.

http://forum.kodi.tv/showthread.php?tid=...pid1963567
Reply
#6
I have a synology NAS that is mapped to my HTPC as a network drive. I watched a movie on it for the first time last night. It paused on its own several times during playback.
Reply
#7
today I created an advancedsettings xml file and modified to buffer local movies and then increased buffer size to 50mb. Hopefully that will fix the stuttering/pausing.
Reply
#8
(2015-05-05, 04:14)nebrunner Wrote: today I created an advancedsettings xml file and modified to buffer local movies and then increased buffer size to 50mb. Hopefully that will fix the stuttering/pausing.

Can you or somebody walk me through the fix for this? I just built a 26TB server using 13 hard drives mounted in a Throne case. These were all drives that worked perfectly in individual machines before, but since moving them to a single server system I've had buffering and pausing using both KODI's built in player and my default MPC-BE player. Never had this before and now I'm looking for a cure. Will pause an hour long show every 5 minutes or so for 15-20 seconds. All hardwired gigabit ethernet connection just like before. Thanks.
Reply
#9
If you are having buffering issues with external players besides Kodi, it does not sound like this will fix it. Here is the guide to the cache settings in Kodi. You should not need to change anything since you are wired gigabit. Hell I stream 1080p over wired 100mb so you have other issues going on outside of Kodi

HOW-TO:Modify_the_video_cache (wiki)
Reply
#10
Hey @Blazemonkey
I'm using the rasberry pii. Can I do what you explained at the top with that? And do I need an external drive to store cache as well? And lastly, if I can do what was explained above with the pii is there a video that will walk dumb ppl like me through it..... Cuz I don't really understand all that, I don't even know what a NAS is Sad .....
Reply
#11
Hi @Kamakazi103,

I see no reason why you couldn't mount drives at the OS level on a pii. Are you having the stuttering/buffering issue that was mentioned in the op? How are your video files connected to your kodi system? (ie. network, external, internal) Also, what OS are you using? openelec assume..
Reply
#12
Just a note on this issue....make sure your NIC speed settings (1000TX, 100TX FULL/Half,etc) match on both your NAS and your Kodi box. This can lead to major buffering issues.
Reply
#13
(2016-03-16, 16:15)emailcraigs Wrote: Just a note on this issue....make sure your NIC speed settings (1000TX, 100TX FULL/Half,etc) match on both your NAS and your Kodi box. This can lead to major buffering issues.

Why would you say this? Could you explain? My kodibox runs on 100mbps and my server on 1gbps..and i'm experiencing video stuttering..
Reply
 
Thread Rating:
  • 1 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
How I fixed buffering/stuttering issues while playing files from my NAS51