Kodi Community Forum

Full Version: SMB/NFS buffering after 10-15minutes on FireTV 4k
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Heya fellas - never thought I'd need to ask for help analyzing a problem but right now I am completely at a loss and want to catch as many advices as I can by going down that road.
To start with the (most likely) most important thing - debug.log:
uwuvufowew.kodi (paste)

My problem (the whole story):
I can't exactly tell you since when this happened - I think when I installed a new TV (Sony KD-65A8) replacing my old Panasonic Plasma and tried to stream 4K movies the first time (though not as high bitrate as can be).
After that attempt and having problems with buffering on my FireTV 4K 2020 stick on the 4K-TV I decided to check my advancedsettings.xml to see if buffer is having any sort of problems. Realizing I haven't touched that file in a while and still using old schema (pre-KODI-17) for the caching-settings I corrected them (going buffermode 1, readfactor 20, memorysize 139460608 - just like Example 4 on the WIKI-page). Playback was fine for like 10-20minutes and went bonkers after without ever filling buffer again (instantly dropping down when it was filled up).
As the 4K-sticks had pretty decent WiFi and no ethernet-port whatsoever I decided to optimize my WiFi and put a repeater right next to the device that's going to play those high-bitrate movies later on. AVM (I know, I know) page told me both devices had 866MBit/s connections and iperf3 to my NAS (see below) was telling me I was at 280MBit/s average. Also copying a file within Kodi was okay with like 120MBit/s. As my usual videofiles are between 9MBit/s and peak out at like 30MBit/s I thought I'd be fine now. Before it was pretty close to 50MBit/s (w/o repeater).
As the problems went on I decided to change filesystem-network-access from SMB to NFS as I was running a UNIX-system anyway and NFS was it's homeland.
The connection went up on iperf3 another 5-10MBit/s and I was happy with that. Close to 300MBit/s looked decent.
Buffer was still running out after 20-30minutes and never ever went stable again like when starting playback for the first time. Only solution to watch another 20-30minutes was to stop Kodi (18.9) and start it up again, start the movie anew - buffer was constant and speed on ethernet on my server with solely Kodi accessing it at that moment was as high as the bitrates of audio+video. Kodi had no reason to run out of buffer - data going in was as high as data going out.
I thought that I'd best try my luck with Kodi 19 but the problems persisted.
In a moment of resilience I decided to remove everything network- or cache-related from advancedsettings.xml. And finally the 4K movie played fine on one TV. Doing all those changes to my other FireTV 4K, too (using the same as.xml, same options, same AddOns, Kodi 19 b2 - and everything after factory-resetting the TV stick), I was happy with the result. I was able to use the 120mbps jellyfish-file on both TVs. 
As problems came back on the 4K TV I bought an ethernet adapter to circumvent problems with WiFi. iperf3 says I dropped speed by 20MBit/s but that was okay for me as long as files play nicely and consistently (I am able to play 100 MBit/s files without any hassle now for sure - HEVC, x265, HDR, 4K ... kein Problem!).
As wifey and me started watching TV shows from our local server again (good old ones) the same problem was seen on the other FireTV stick. Nearly same datarates (at least now as I decided to position the WiFi repeater away from the now cabled-FireTV and closer to the wireless one). I can copy files from the NFS share to the stick with an average of 130MBit/s at 1.6GB size. 256k sized 60 seconds iperf3 says I am at around 240MBit/s.
But after watching even smaller files (around 2GB shows with a maximum aq+vq bitrate of 20MBit/s, mostly 720p x264) gave problems I had to go back to the problem.
The files play okay for 10-15minutes (2GB+) and start buffering again! (no forward cache visible in the info, percentage drops start after 13minutes, take 2minutes to go to 0% and buffer)
Files of around 750MB with same codec play okay - maybe because they tend to be much shorter.
Files with a twice as high bitrate (40MBit/s) play for the same time as the 2GB+ ones though being more than double in size.
I googled around to check if it's a general NFS problem (though file copy said it's able to get up over 100MBit/s+), an ethernet problem (delta of 10MBit/s max. when doing the 60sec iperf3), a filesystem failure (checked my hdds status).
I can't come up with any solution.
Going buffermode=1 just pushes the problem further away (amount = size of buffer). In the end I end up having endless buffer - 1min playtime - buffer cycles with all files that play more than 25minutes.

The hardware:
Dorm TV (Philips) <- FireTV 4K 2020 <- 5G WiFi (ac 866MBit/s) <- Switch [1] 1GBit <- NAS -> Switch [1] 1GBit -> Switch [2] 1GBit -> ETH(480MBit) to USB2 adapter -> FireTV 4K 2020 -> 4K TV (Sony)

NAS: 1GBit Ethernet, Ubuntu 20.04, NFS shares, ZFS filesystem (rebinded mounts for nfs-exports)

5G WiFi == Repeater LAN-bridge to Switch [1]

The software:
Kodi 19 Nightly (202101100-d5c31b9d)
Ubuntu server 20.04
NFS v3 shares (media-files)
SMB shares (config-files and thumbnails)

I tried:
Changing advancedsettings to use buffermode=1
Factoryreset FireTV Sticks
Updated Kodi 18.9 to Kodi 19
Changed share from SMB to NFS
Rebuilt complete library (MySQL)

Please push me into the direction I might have missed looking at.
I am at a total loss of ideas.
Is there a way to stresstest the WiFi connection over a longer time?
Why does buffering (without buffermode=1) come up after the same time all the way? Why doesn't it play constantly after buffering again but keeps emptying the cache directly after?
Transfer rates seem constant (nload) all the time - there are no drops in speed visible during all playtime.
And I know most reliant solution would be to wire that stick up as well - but there is no way I am getting an ethernet cable there (yet).

If I forgot anything ... forgive me as I didn't know better (I guess). Tongue

Thanks for your help in advance!
check your arp table entries on the host, it seems like kodi doesn't refresh the arp request so the connection expires after 20 min or so. You can add an arp static entrie on the table.
What has kodi to do with the ARP? Kodi works on tcp / ip level. ARP is even below ipv4 ...
(2021-01-13, 20:20)mogno Wrote: [ -> ]Heya fellas - never thought I'd need to ask for help analyzing a problem but right now I am completely at a loss and want to catch as many advices as I can by going down that road.
To start with the (most likely) most important thing - debug.log:
uwuvufowew.kodi (paste)

My problem (the whole story):
I can't exactly tell you since when this happened - I think when I installed a new TV (Sony KD-65A8) replacing my old Panasonic Plasma and tried to stream 4K movies the first time (though not as high bitrate as can be).
After that attempt and having problems with buffering on my FireTV 4K 2020 stick on the 4K-TV I decided to check my advancedsettings.xml to see if buffer is having any sort of problems. Realizing I haven't touched that file in a while and still using old schema (pre-KODI-17) for the caching-settings I corrected them (going buffermode 1, readfactor 20, memorysize 139460608 - just like Example 4 on the WIKI-page). Playback was fine for like 10-20minutes and went bonkers after without ever filling buffer again (instantly dropping down when it was filled up).
As the 4K-sticks had pretty decent WiFi and no ethernet-port whatsoever I decided to optimize my WiFi and put a repeater right next to the device that's going to play those high-bitrate movies later on. AVM (I know, I know) page told me both devices had 866MBit/s connections and iperf3 to my NAS (see below) was telling me I was at 280MBit/s average. Also copying a file within Kodi was okay with like 120MBit/s. As my usual videofiles are between 9MBit/s and peak out at like 30MBit/s I thought I'd be fine now. Before it was pretty close to 50MBit/s (w/o repeater).
As the problems went on I decided to change filesystem-network-access from SMB to NFS as I was running a UNIX-system anyway and NFS was it's homeland.
The connection went up on iperf3 another 5-10MBit/s and I was happy with that. Close to 300MBit/s looked decent.
Buffer was still running out after 20-30minutes and never ever went stable again like when starting playback for the first time. Only solution to watch another 20-30minutes was to stop Kodi (18.9) and start it up again, start the movie anew - buffer was constant and speed on ethernet on my server with solely Kodi accessing it at that moment was as high as the bitrates of audio+video. Kodi had no reason to run out of buffer - data going in was as high as data going out.
I thought that I'd best try my luck with Kodi 19 but the problems persisted.
In a moment of resilience I decided to remove everything network- or cache-related from advancedsettings.xml. And finally the 4K movie played fine on one TV. Doing all those changes to my other FireTV 4K, too (using the same as.xml, same options, same AddOns, Kodi 19 b2 - and everything after factory-resetting the TV stick), I was happy with the result. I was able to use the 120mbps jellyfish-file on both TVs. 
As problems came back on the 4K TV I bought an ethernet adapter to circumvent problems with WiFi. iperf3 says I dropped speed by 20MBit/s but that was okay for me as long as files play nicely and consistently (I am able to play 100 MBit/s files without any hassle now for sure - HEVC, x265, HDR, 4K ... kein Problem!).
As wifey and me started watching TV shows from our local server again (good old ones) the same problem was seen on the other FireTV stick. Nearly same datarates (at least now as I decided to position the WiFi repeater away from the now cabled-FireTV and closer to the wireless one). I can copy files from the NFS share to the stick with an average of 130MBit/s at 1.6GB size. 256k sized 60 seconds iperf3 says I am at around 240MBit/s.
But after watching even smaller files (around 2GB shows with a maximum aq+vq bitrate of 20MBit/s, mostly 720p x264) gave problems I had to go back to the problem.
The files play okay for 10-15minutes (2GB+) and start buffering again! (no forward cache visible in the info, percentage drops start after 13minutes, take 2minutes to go to 0% and buffer)
Files of around 750MB with same codec play okay - maybe because they tend to be much shorter.
Files with a twice as high bitrate (40MBit/s) play for the same time as the 2GB+ ones though being more than double in size.
I googled around to check if it's a general NFS problem (though file copy said it's able to get up over 100MBit/s+), an ethernet problem (delta of 10MBit/s max. when doing the 60sec iperf3), a filesystem failure (checked my hdds status).
I can't come up with any solution.
Going buffermode=1 just pushes the problem further away (amount = size of buffer). In the end I end up having endless buffer - 1min playtime - buffer cycles with all files that play more than 25minutes.

The hardware:
Dorm TV (Philips) <- FireTV 4K 2020 <- 5G WiFi (ac 866MBit/s) <- Switch [1] 1GBit <- NAS -> Switch [1] 1GBit -> Switch [2] 1GBit -> ETH(480MBit) to USB2 adapter -> FireTV 4K 2020 -> 4K TV (Sony)

NAS: 1GBit Ethernet, Ubuntu 20.04, NFS shares, ZFS filesystem (rebinded mounts for nfs-exports)

5G WiFi == Repeater LAN-bridge to Switch [1]

The software:
Kodi 19 Nightly (202101100-d5c31b9d)
Ubuntu server 20.04
NFS v3 shares (media-files)
SMB shares (config-files and thumbnails)

I tried:
Changing advancedsettings to use buffermode=1
Factoryreset FireTV Sticks
Updated Kodi 18.9 to Kodi 19
Changed share from SMB to NFS
Rebuilt complete library (MySQL)

Please push me into the direction I might have missed looking at.
I am at a total loss of ideas.
Is there a way to stresstest the WiFi connection over a longer time?
Why does buffering (without buffermode=1) come up after the same time all the way? Why doesn't it play constantly after buffering again but keeps emptying the cache directly after?
Transfer rates seem constant (nload) all the time - there are no drops in speed visible during all playtime.
And I know most reliant solution would be to wire that stick up as well - but there is no way I am getting an ethernet cable there (yet).

If I forgot anything ... forgive me as I didn't know better (I guess). Tongue

Thanks for your help in advance!

I had a problem recently, which sounds similar to yours.  For me the sound would start going out of sync and the picture would start freeze framing.  What I did was turn on  logging to monitor the free memory on the fire stick.  All looked good at the start but over time the fire stick would run low on memory so that it had less than the buffer that was being used.  This is when the audio and video problems started.  I eventually lowered the buffer size until this was no longer an issue.

https://kodi.wiki/view/HOW-TO:Modify_the_video_cache
<memorysize>20971520</memorysize> is the default setting