Kodi Community Forum
Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Android (https://forum.kodi.tv/forumdisplay.php?fid=164)
+---- Thread: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? (/showthread.php?tid=365878)

Pages: 1 2 3 4 5


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - blunden - 2023-08-27

(2023-07-19, 20:36)jbinkley60 Wrote:
(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
Yeah, I guess settings up an HTTP server for it could be an option. Presumably any reasonably performant HTTP server would work. I don't want to install anything that requires separate plugins in Kodi with separate media handling when Kodi can already handle HTTP sources.

Overall, while SMB might have some protocol overhead that causes issues, I would've expected more agressive caching to smooth over those but perhaps it would simply require more RAM in order to get the cache big enough.


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - kkkk_system - 2023-08-28

To optimize SAMBA for more throughput add these 2 options into your /etc/samba/smb.conf:

Code:

[global]
client min protocol = SMB2 ; force SAMBA to use SMB2 at the minimum as the protocol
socket options = TCP_NODELAY IPTOS_LOWDELAY

Also in kodi you can try using different Samba minimum protocol - it should increase the throughput as more recent protocol is working better, even maybe try SMBv3.

I'm using SMBv2 just fine.


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - jbinkley60 - 2023-08-28

(2023-08-27, 11:32)blunden Wrote:
(2023-07-19, 20:36)jbinkley60 Wrote:
(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
Yeah, I guess settings up an HTTP server for it could be an option. Presumably any reasonably performant HTTP server would work. I don't want to install anything that requires separate plugins in Kodi with separate media handling when Kodi can already handle HTTP sources.

Overall, while SMB might have some protocol overhead that causes issues, I would've expected more agressive caching to smooth over those but perhaps it would simply require more RAM in order to get the cache big enough.

An HTTP server might work but you'd have to handle the alternative naming structure for the Kodi library to match the metadata.  Large caches aren't always a good answer because they need to be flushed or the pointer moved when you fast forward / rewind.  Ring buffer caches tend to work best but they have limitations.    The Mezzmo solution I use allows you to select the connection speed to each device to optimize HTTP and allows setting of the cache size. 

I've hit well over 700mb/s over gigabit Ethernet and 300 mb/s over wireless.  Here's a stress test I ran earlier this year.  I am not saying this solution is for everyone.  I am just saying there are HTTP based solutions which have very high performance.


Thanks,

Jeff


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - blunden - 2023-10-05

(2023-08-28, 16:45)kkkk_system Wrote: To optimize SAMBA for more throughput add these 2 options into your /etc/samba/smb.conf:

Code:

[global]
client min protocol = SMB2 ; force SAMBA to use SMB2 at the minimum as the protocol
socket options = TCP_NODELAY IPTOS_LOWDELAY

Also in kodi you can try using different Samba minimum protocol - it should increase the throughput as more recent protocol is working better, even maybe try SMBv3.

I'm using SMBv2 just fine.
They are pulling the files from a Windows computer/server using SMB3, which works noticeably better than SMB2. The client is an Nvidia Shield TV using Kodi's built-in Samba. I therefore probably can't set the suggested socket options.

(2023-08-28, 17:00)jbinkley60 Wrote: An HTTP server might work but you'd have to handle the alternative naming structure for the Kodi library to match the metadata.  Large caches aren't always a good answer because they need to be flushed or the pointer moved when you fast forward / rewind.  Ring buffer caches tend to work best but they have limitations.    The Mezzmo solution I use allows you to select the connection speed to each device to optimize HTTP and allows setting of the cache size. 

I've hit well over 700mb/s over gigabit Ethernet and 300 mb/s over wireless.  Here's a stress test I ran earlier this year.  I am not saying this solution is for everyone.  I am just saying there are HTTP based solutions which have very high performance.
As long as I can play the content without hitches, slow fast forwarding etc. matters less to me. It's always good to know about other options, but I would prefer not to have to redo my entire library. Still, thank you for providing the benchmarks to show that it should be totally doable over Wi-Fi. Smile


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - izprtxqkft - 2023-10-05

there is a consensus forming that i have noticed where shield users are having better results using SMB when mounting within the built-in shield functionality rather than within Kodi

just something i have noticed when reading comments recently


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - blunden - 2023-10-05

(2023-10-05, 15:14)jepsizofye Wrote: there is a consensus forming that i have noticed where shield users are having better results using SMB when mounting within the built-in shield functionality rather than within Kodi

just something i have noticed when reading comments recently
Interesting. I wonder why that might be. Different Samba configuration perhaps?


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - izprtxqkft - 2023-10-05

(2023-10-05, 21:43)blunden Wrote: Interesting. I wonder why that might be. Different Samba configuration perhaps?

i could only speculate as i do not own one but it keeps coming up in threads and may be worth a comparison


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - kkkk_system - 2023-11-17

So I've tried to update to latest kodi 20.2 and again had lags while trying to play 80GB+ BDrip.

Researched a bit and found this thread - https://github.com/xbmc/xbmc/issues/24001 apparently there is 64K hardcoded buffer for SMB streaming.

I've installed build on my TV from this post https://github.com/xbmc/xbmc/issues/24001#issuecomment-1783249605 and so far no lags at all.

NOTE, I'm also using advancedsettings.xml on kodi with these values:
advancedsettings.xml:
<advancedsettings>
  <cache>
    <buffermode>4</buffermode>
    <memorysize>209715200</memorysize>
    <readfactor>5</readfactor>
    <chunksize>1048576</chunksize>
  </cache>
</advancedsettings>



RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - fritsch - 2023-11-18

Kodi's current nightly does have a gui setting for cache chunks. For NFS, SMB, etc. https://github.com/xbmc/xbmc/pull/24049


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - Foe-hammer - 2023-11-22

(2023-11-18, 08:38)fritsch Wrote: Kodi's current nightly does have a gui setting for cache chunks. For NFS, SMB, etc. https://github.com/xbmc/xbmc/pull/24049

You are a godsend!! Editing the advancedsetting.xml did nothing for my 4k video wifi streaming from PC issues (4k video wired ethernet worked fine) but downloading the most recent Kodi nightly build and changing the new GUI settings fixed 4k video wifi PC streaming issues! Thank you!!!!!


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - fritsch - 2023-11-22

Nice, nice. For the record, which settings did you choose for SMB / NFS and the other one?


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - Foe-hammer - 2023-11-22

(2023-11-22, 19:59)fritsch Wrote: Nice, nice. For the record, which settings did you choose for SMB / NFS and the other one?

512MB for SMB on both the firestick 4K and Shield Pro


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - fritsch - 2023-11-22

(2023-11-22, 21:33)Foe-hammer Wrote:
(2023-11-22, 19:59)fritsch Wrote: Nice, nice. For the record, which settings did you choose for SMB / NFS and the other one?

512MB for SMB on both the firestick 4K and Shield Pro
And chunksizes? You kept them at defaults?


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - Zuikkis - 2023-11-23

(2023-10-05, 15:14)izprtxqkft Wrote: there is a consensus forming that i have noticed where shield users are having better results using SMB when mounting within the built-in shield functionality rather than within Kodi

just something i have noticed when reading comments recently

I can confirm this. There's also the added benefit that the mounted drive is easily available in other Android apps.

Haven't tested with latest nightly with different buffer sizes. It's entirely possible that Shield internal mounting uses bigger buffers by default and that makes the difference.


RE: Advanced settings to optimize 4K SMB or NFS streaming over Wi-Fi? - Foe-hammer - 2023-11-23

(2023-11-22, 21:44)fritsch Wrote:
(2023-11-22, 21:33)Foe-hammer Wrote:
(2023-11-22, 19:59)fritsch Wrote: Nice, nice. For the record, which settings did you choose for SMB / NFS and the other one?
And chunksizes? You kept them at defaults?

I changed the memory size from default 20MB to 512MB. Read factor from default 4x to 10x. Chunk size from default 128KB to 512KB.

Works great on both my Ffrestick 4K and my shield pro.