Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi?
#1
Recently I've been tweaking the cache settings in advancedsettings.xml in the hopes of optimizing buffering behavior, in order to hopefully allow smooth playback of high bitrate HEVC content over SMB v3 (or NFS if needed). While I know that most people tend to give up and just use a wired ethernet connection, I'm trying to understand why that would technically be needed?

My setup consists of an Nvidia Shield TV 2015 running Kodi 19.3 (technically the latest of the stuttering fix builds from here) that attempts to play content from a Windows machine. The test files are stored on an SSD, simply to rule out performance issues on that end. The source has a wired connection to the router so the Shield is the only wireless part of the chain. The file that most consistently fail is a 4K bluray remux with an average bitrate of roughly 55-65 Mbit/s.

Even the highest bitrate blurays should be well within the limits of what a modern Wi-Fi network can deliver under reasonably good conditions, so it can't strictly be the raw throughput that is the limiting factor. My first guess was that it could be due to the less consistent througput performance or the higher latency, which more aggressive buffering might alleviate. While tweaking memorysize and readfactor improved the situation a lot to the point where some of my test content work mostly fine now (was essentially unplayable before), it's still not perfect. Looking at the network usage of my Shield, it's still only slightly faster than the bitrate of the content at best, despite a readfactor (30) that I thought would be enough to effectively make Kodi fill up the buffer at whatever speed the network allows but this does not appear to be the case. It could be that my buffer size of 267 MB (supposedly requires roughly 801 MB ram according to the wiki) is simply too small for me to notice the thoughput peaks when the buffer is refilled, but I'm not sure and I'll need to do more testing after enabling the appropriate debug overlay in order to monitor that.

While digging around in the source code for other hints of how to use these settings, I found that there is also an undocumented chunksize value that can be tweaked. Increasing that from 128 KB to 1 MB seemingly improved SMB v3 performance a bit further, making it surpass NFS (haneWin NFS Server with increased thread count and transfer size) by quite a bit. I still enountered playback problems a few minutes in though.

What should I be tweaking next? Is there a specific bottleneck I haven't thought of?

My advancedsettings.xml:
xml:

<advancedsettings>
  <cache>
    <buffermode>4</buffermode>
    <memorysize>279969792</memorysize>
    <readfactor>30</readfactor>
    <chunksize>1048576</chunksize>
  </cache>
</advancedsettings>

Some relevant discussion:

https://github.com/xbmc/xbmc/pull/9681

https://github.com/xbmc/xbmc/pull/17042

https://github.com/xbmc/xbmc/issues/16975

https://github.com/xbmc/xbmc/pull/2901
Reply
#2
Just registered to reply to this thread.

I was having similar issue playing BluRay rips (over 50 GBs) with bitrates around 76 mbit/sec over 802.11ac WLAN (866 mbit/sec link) over SMB with Kodi 20.2 (latest stable).

I had to:
1) make sure to update your samba and remove/or comment any 
smb.conf:
socket options
from smb.conf
2) turn minimum SMB version in Kodi's Services to v3
3) downgrade Kodi to 18.9 version from this link - https://www.apkmirror.com/apk/xbmc-found...9-release/
4) add advancedsettings.xml into your Kodi's profile by using 'Folders' functionality with these settings (200Mb memory buffer, buffermode = 4 and readfactor 5):
advancedsettings.xml:
- <advancedsettings>
- <cache>
  <buffermode>4</buffermode>
  <memorysize>209715200</memorysize>
  <readfactor>5</readfactor>
  </cache>
  </advancedsettings>

With these settings I get much better continuous playback and no stutter on huge BluRay rips compared to what I had with Kodi 20.2.
Reply
#3
(2023-07-19, 16:24)kkkk_system Wrote: downgrade Kodi to 18.9 version

So you want to recommend an outdated Kodi version where certain scraping add-ons no longer work..? Classy.

Responding to a 1.5 yr old forum thread is already questionable to say the least. Technology and its solutions moves fast.
Reply
#4
seems kind of rude to suggest that all the work that the kodi devs have done between 18.9 and the current 21 ALPHA has been for nothing because 18.9 was better without all of it

(i dont share this opinion)
Reply
#5
(2023-07-19, 18:58)jepsizofye Wrote: seems kind of rude to suggest that all the work that the kodi devs have done between 18.9 and the current 21 ALPHA has been for nothing because 18.9 was better without all of it

(i dont share this opinion)

well I'm speaking from experience, I've tried many combinations of advancedsettings.xml with 20.2 kodi, but nothing helped until I reverted kodi altogether back to 18.9.
Reply
#6
(2023-07-19, 17:43)Klojum Wrote:
(2023-07-19, 16:24)kkkk_system Wrote: downgrade Kodi to 18.9 version

So you want to recommend an outdated Kodi version where certain scraping add-ons no longer work..? Classy.

Responding to a 1.5 yr old forum thread is already questionable to say the least. Technology and its solutions moves fast.
Unfortunately at the moment yes, until there is a fix with 4K HEVC rips streaming over SMB over Wi-Fi.

I don't have much time at the moment to reproduce the bug with 20.2. When I have I will certainly create a github issue with detailed description.
Reply
#7
(2023-07-19, 20:25)kkkk_system Wrote:
(2023-07-19, 17:43)Klojum Wrote:
(2023-07-19, 16:24)kkkk_system Wrote: downgrade Kodi to 18.9 version

So you want to recommend an outdated Kodi version where certain scraping add-ons no longer work..? Classy.

Responding to a 1.5 yr old forum thread is already questionable to say the least. Technology and its solutions moves fast.
Unfortunately at the moment yes, until there is a fix with 4K HEVC rips streaming over SMB over Wi-Fi.

I don't have much time at the moment to reproduce the bug with 20.2. When I have I will certainly create a github issue with detailed description.

4K UHD REMUX up to 90Mbps HEVC profile 10 work great for me on Wifi 6 as well as 250Mbit ethernet via a usb->ethernet adapter, only has trouble if i try to use 100Mbit ethernet, so it must not be kodi
Reply
#8
(2021-12-08, 04:38)blunden Wrote: My setup consists of an Nvidia Shield TV 2015 running Kodi 19.3 (technically the latest of the stuttering fix builds from here) that attempts to play content from a Windows machine. The test files are stored on an SSD, simply to rule out performance issues on that end. The source has a wired connection to the router so the Shield is the only wireless part of the chain. The file that most consistently fail is a 4K bluray remux with an average bitrate of roughly 55-65 Mbit/s.

I can't speak for your setup, optimizing SMB etc. and similar  but I can tell you there are solutions with Windows as a server and Nvida Shields as clients which utilize HTTP and have no problems running 4K over Wi-Fi with zero stuttering.  I have Raspberry Pi 4s, Vero 4K+ devices, and even Roku boxes (not running Kodi) that can all easily stream 4K over Wi-Fi with no issues.  Here's an example.  I realize this is a bit different than your setup but I know a few nVdia Shield Kodi users not having issues with this approach.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#9
(2023-07-19, 20:29)jepsizofye Wrote:
(2023-07-19, 20:25)kkkk_system Wrote:
(2023-07-19, 17:43)Klojum Wrote: So you want to recommend an outdated Kodi version where certain scraping add-ons no longer work..? Classy.

Responding to a 1.5 yr old forum thread is already questionable to say the least. Technology and its solutions moves fast.
Unfortunately at the moment yes, until there is a fix with 4K HEVC rips streaming over SMB over Wi-Fi.

I don't have much time at the moment to reproduce the bug with 20.2. When I have I will certainly create a github issue with detailed description.

4K UHD REMUX up to 90Mbps HEVC profile 10 work great for me on Wifi 6 as well as 250Mbit ethernet via a usb->ethernet adapter, only has trouble if i try to use 100Mbit ethernet, so it must not be kodi
Do you use SMB?
Reply
#10
(2023-07-19, 20:41)kkkk_system Wrote:
(2023-07-19, 20:29)jepsizofye Wrote:
(2023-07-19, 20:25)kkkk_system Wrote: Unfortunately at the moment yes, until there is a fix with 4K HEVC rips streaming over SMB over Wi-Fi.

I don't have much time at the moment to reproduce the bug with 20.2. When I have I will certainly create a github issue with detailed description.

4K UHD REMUX up to 90Mbps HEVC profile 10 work great for me on Wifi 6 as well as 250Mbit ethernet via a usb->ethernet adapter, only has trouble if i try to use 100Mbit ethernet, so it must not be kodi
Do you use SMB?

works over SMB, NFS, Jellyfin and Local disks - as a matter of fact the only thing i havent tried is uPNP/DLNA
Reply
#11
(2023-07-19, 20:23)kkkk_system Wrote:
(2023-07-19, 18:58)jepsizofye Wrote: seems kind of rude to suggest that all the work that the kodi devs have done between 18.9 and the current 21 ALPHA has been for nothing because 18.9 was better without all of it

(i dont share this opinion)

well I'm speaking from experience, I've tried many combinations of advancedsettings.xml with 20.2 kodi, but nothing helped until I reverted kodi altogether back to 18.9.
I completely understand man.  I haven't had any luck beyond 17.6 myself and while I can't speak for other people, Kodi 20.2 performed horribly on my droid player (Amlogic S912 8 core 1.5Ghz, 3gb RAM).  Stopping a video cause a 5-10s "hang", when I hit play, audio wouldn't kick in for another 5-10s and I don't own a video higher than 1080p running on 1Gbps cat6 so it isn't like my hardware was being taxed, but to the point, newer is not always better for everybody for any myriad of reasons.

I am not suggesting that I or anybody else is unappreciative of the efforts put into supporting a product like this that is free.  I am very appreciative and I did give 18, 19 and 20 a chance but it caused me a lot of issues that I just couldn't resolve or work out.  I work 2 full-time jobs at about 90 hours a week and I just want things to work smoothly the way it always did and I don't see that I should have to keep buying new hardware to try to keep a newer version running smoother, if it even would.

I don't understand the vitriol that comes out to people that post here not wanting or maybe not being able to run the latest, but it does prove that trying to be part of or participate in a community project isn't as nice as it would appear on paper.  I guess in that same breath, I should scoff at my friends that have issues because they still own a 4th generation i7 laptop or use an iPhone 8, but I wouldn't do that, if I can think of something to help, I'd give it everything I have to assist somebody in need.

Steve
Reply
#12
(2023-07-20, 02:44)sdemiere Wrote: I don't understand the vitriol that comes out to people that post here not wanting or maybe not being able to run the latest, but it does prove that trying to be part of or participate in a community project isn't as nice as it would appear on paper.  I guess in that same breath, I should scoff at my friends that have issues because they still own a 4th generation i7 laptop or use an iPhone 8, but I wouldn't do that, if I can think of something to help, I'd give it everything I have to assist somebody in need.

its not a matter of not wanting to help people with older versions, it is a waste of time (that is donated freely) to go back a rehash issues that are likely a result of it being an old version and in some cases already brought up 2-3 years ago and code was already written to resolve

not to mention, people helping are usually not running the old version and are not even experiencing the issues - because they only exist in the old version, i dont see any reason to track down an old release and install it just to help someone else who wont or cant update

i cant even remember the problems had or fixes i came up with for DOS back in the early 90s and if someone asked me today to find out why something didnt work in windows XP i would laugh and walk away
Reply
#13
(2023-07-19, 20:43)jepsizofye Wrote:
(2023-07-19, 20:41)kkkk_system Wrote: Do you use SMB?

works over SMB, NFS, Jellyfin and Local disks - as a matter of fact the only thing i havent tried is uPNP/DLNA

So I am curious about this statement.  I thought Jellyfin was a UPNP/DLNA server or does it handle other transports / connection methods ?


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#14
(2023-07-21, 00:58)jbinkley60 Wrote:
(2023-07-19, 20:43)jepsizofye Wrote:
(2023-07-19, 20:41)kkkk_system Wrote: Do you use SMB?

works over SMB, NFS, Jellyfin and Local disks - as a matter of fact the only thing i havent tried is uPNP/DLNA

So I am curious about this statement.  I thought Jellyfin was a UPNP/DLNA server or does it handle other transports / connection methods ?


Jeff

for my setup its using https streaming to its native clients, the kodi addon will use https in addon mode or smb in direct mode

for my settings i have "Force HTTP Playback" enabled on the addon but im not sure what transport it uses when that is off, i believe its still https

might be possible to do dlna as it has the dlna server but i havent used it yet
Reply
#15
(2023-07-21, 01:04)jepsizofye Wrote:
(2023-07-21, 00:58)jbinkley60 Wrote:
(2023-07-19, 20:43)jepsizofye Wrote: works over SMB, NFS, Jellyfin and Local disks - as a matter of fact the only thing i havent tried is uPNP/DLNA

So I am curious about this statement.  I thought Jellyfin was a UPNP/DLNA server or does it handle other transports / connection methods ?


Jeff

for my setup its using https streaming to its native clients, the kodi addon will use https in addon mode or smb in direct mode

for my settings i have "Force HTTP Playback" enabled on the addon but im not sure what transport it uses when that is off, i believe its still https

might be possible to do dlna as it has the dlna server but i havent used it yet

DLNA/UPnP  is just the service advertisement / discovery portion.  Almost all modern DLNA/UPnP serves use HTTP(s) for the underlying streaming transport.  There are a handful of really old ones out there that don't but they are few and far between.  I didn't realize Jellyfin offered non-HTTP(s) modes. 

The real differences are often up the stack where the DLNA/UPnP clients / servers leverage proprietary stuff to extend features.  Plex is a good example where it has its Plex native and DLNA modes.  I've had to contend with some of this in the Mezzmo Kodi addon generic UPnP mode where some of the XML usage varies a bit across different servers.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi?0