Linux Need to increase cache - experiencing buffering
#1
Hi all, so I recently converted my HTPC from Windows 7 to Linux (same hardware) running Frodo 12.2. Since the switch I've noticed a lot of buffering issues when watching movies stored on my unRaid server over a wired 100mb ethernet network.

I never had any buffering issues in Windows. Nothing has changed except the move from W7 to Linux. Same hardware, same unRaid server, same ethernet network, etc.

During playback I bring up the codec info overlay ('o' key). Keep in mind I'm using an Nvidia GT 430 GPU. I've enabled hardware acceleration and I can confirm that my GPU is processing the video and not my CPU. During 1080p playback my CPU never spikes over 10%. I've also ruled out any network issues as well.

I'm 100% confident that the issue has to do with the cache. I can clearly see the cache dropping down then immediately movies begin to buffer while the cache get's built-up again.

I've done some research and I came across some articles that talks about forcing caching via advancedsettings.xml but that this feature is not available on Frodo 12.2.

What are my options? Do I need to run one of the v13 nightlies in order to correct this? Anything else I can do to fix the cache issue other than upgrading?

I also copied a movie over to the local drive and I never have any buffering issues, which would make sense. Network is clean I just need to build a little buffer to account for movie scenes where the video bit rate spikes. The buffering issue is more common on 1080p movies vs 720p, again likely due to higher video bit rate.

I also know a thing or two about networks as well, I've reviewed switchport stats on both ports where my HTPC and unRaid server are plugged into. No erros, fragments, CRC erros, collisions, etc. Both ports running at 100mb/full duplex.

The only other difference between my HTPC running Windows/Linux is that in Windows I shared my media via SMB and when I switched to Linux I'm now using NFS. Again, I don't think the problem is related to SMB/NFS, they should both be able to handle a typical 1080p stream over a wired network connection.

PS. does the Windows version of Frodo provide any caching by default? I wonder why I never had this issue before but only now since I switched to Linux.

Thx in advance for your help/feedback.
Reply
#2
a proper 100Mbit network would never need buffering. In case you use the xbmc built-in NFS: Try mounting the shares on the OS level(via fstab) and set a high rsize and wsize. see http://nfs.sourceforge.net/nfs-howto/ar01s05.html
Reply
#3
So I switched to SMB on my Linux HTPC and results are much better. So I think it prob does have something to do with how NFS handles streaming vs SMB. On some very high bit-rate 1080p content with DTS-HD audio I do occasionally get slight buffering. Keep in mind that when the buffering happens it's very short, typically less than a second or two but just long enough to be annoying. You can generally predict when it will happen when a fast action scene in the movie picks up and I can clearly see the video & audio bit-rate spiking.

So for the fun of it I added my media share via FTP and ran the same tests again. As predicted Frodo 12.2 cache's FTP streams even for local area network but not for SMB/NFS. With FTP I never encountered a single buffer, you can also clearly see a healthy cache being built-up during movie playback so even when there is a change to a fast action scene it can easily handle it. During regular scenes with low bit-rates the Cache is around 40-50MB, and when a fast action scene kicks in the cache drops to 25-30MB. The only downside with FTP is that XBMC cannot write to a FTP share so Artwork Downloader doesn't work in this instance. I like to keep a polished look with my HTPC setup so I like to have the ability to download additional fanarts, posters, banners, etc. So back to SMB.

So on to the next experiment. I placed my unRaid server and HTPC on the same gig switch and ran all these tests over again. Results were much better due to the pure fact that my network connection increased 10x. NFS is generally good over gig connection but occasionally and i mean very occasionally it would have a hard time handling 1080p/DTS-HD content. Again, this would only be noticeable during a fast action scene transition. I'm convinced that NFS isn't ideal for streaming high bit rate content with fast moving action scenes and DTS-HD audio. NFS is perfectly fine for 720p content in my experiments and most of the times for 1080p content with low bit rate and non DTS-HD audio tracks. I find that DTS-HD audio tracks does add more load to the network, AC3 typically uses around 650kbps, DTS around 1,500kbps but DTS-HD can go as high as 4-6mb.

I should add one more observation during my tests. While playing back a 1080p/DTS-HD movie I would monitor my bandwidth usage on my unRaid server and I was amazed how much the bandwidth spikes during a fast action scene transfer. Under normal load I would see a constant bandwidth of around 16-20mb which is more than adequate for a 100mb network. However, during those fast action scene transitions I would see the bandwidth spike to 140mb or even at times greater than 200mb. Obviously a gig network can easily handle that kind of spike but it makes much more sense now why I noticed more buffering over a 100mb connection via NFS.

I'm glad that the developers are working on enabling caching capabilities on NFS/SMB as it will alleviate all these issues that I'm encountering. For the hardcore who want to test this out they can download v13 nightlies but I prefer a much more stable stable HTPC.

I'm a bit of an audiophile so I like to download blockbuster movies in all their glories, 1080p high bit-rate video and DTS-HD audio tracks. I certainly don't download all movies in this format but for the big action ones I definitely prefer to do so.

So in my conclusion:
1. NFS should be fine for low bit-rate movies (i.e. 720p) for a 100mb network (keep in mind Frodo does not cache NFS streams)
2. If you download high bit-rate movies with DTS-HD sound either use SMB over gig network or FTP over 100mb. The fact that Frodo caches FTP streams you don't need to have a gig network.

None of this will matter of course once XMBC v13 is released and we can all benefit from NFS/SMB caching over local networks, at that point I suspect we wouldn't even be debating between SMB or NFS. In my conclusion I think having the ability to cache high quality streaming videos via NFS/SMB is a great benefit.

PS wsnipex, I like your suggestion of mounting NFS shares at the OS level and modifying the rsize and wsize. I think that would certainly help but unfortunately in my setup I'm using a shared MySQL database so I can't add local shares. My shares will have to be available over the network in order to use a centralized MySQL database.
Reply
#4
hello guys,

i have intel nuc with xbmcbuntu which causes buffer issues when i play hd movies, i tried about all the suggestions i could find on all the forums google could display on his results and the only one thing made the difference, it was mounting the nfs share on the fstab and telling xbmc to search for movies from a mapped directory on the local storage.

now because i have multiple devices with shared mysql db i had to make sure the mapped folder is exactly the same on each device ,for example /storage/mymovies
Reply

Logout Mark Read Team Forum Stats Members Help
Need to increase cache - experiencing buffering0