Kodi 14 cache does not fill fast enough
#1
Hello,

as I couldn't google a solution for my problem, I hope you can help.

My computer in living room is connected via a wifi bridge. If I try to watch 1080p/720p material from my smb-share of my Windows server this results in heavy buffering sometimes, although I can get a throughput of 11 MB/s.

I solved this in Frodo by raising the cache to 512 MB. Cache was filled quickly (around 50 seconds) and then there was always engouh in cache I could watch a 1080p movie with no buffering in between.

With Helix this does not work anymore. While buffering it only reads at speeds of around 500 kB/s to 1 MB/s. My advancedsettings.xml looks like this:

Code:
<network>
    <buffermode>1</buffermode>
    <cachemembuffersize>536870912</cachemembuffersize>
    <readbufferfactor>5.0</readbufferfactor>
  </network>

Changeing readbufferfactor does not have any affect. Tried values from 4-20 or 4.0-20.5.

Debug.log while starting initial buffering of a 1080p movie:
https://dl.dropboxusercontent.com/u/7246851/kodi.log

Hope you have an idea why he does not read as fast as he could.
Reply
#2
Still no ideas? Sad Cannot watch HD-movies currently. Very annoying.
Reply
#3
Looking at the wiki <cachemembuffersize>20971520</cachemembuffersize> is max, (20971520 is the default, which is 20MB, which requires 60MB of free RAM). XBMC will not buffer ahead more than this. Or use the value '0' this can use the local disk memory (typically your hard drive), which will not put any limit on the size (outside of the size of your drive). Try example example 4 and see how that flies... also hit keyboard 'o' when watching looking for bottle necks.
Reply
#4
Hi PatK,

I couldn't find a max cachemembuffersize. Just saying you need 3 times the amount of free RAM. And I have always 1,5 GB of free RAM (machine has 8 GB). I also tried example 4. There I set cachemembuffersize to 150 MB and it still fills too slow. Always at around 500 kb/s to 1 MB/s max. But the wifi bridge is capable of delivering 10 MB/s stable to 11,5 MB/s max.

So my problem is: Kodi does not read fast enough from my smb share although there is enough bandwith to use. Sad I'm thinking this might be a bug.
Reply
#5
It's been a known issue for quite a bit of time that wifi and 1080p have bandwidth limitations, I didn't think you were streaming wifi. For the limits catch the wiki... it's all there, I was merely quoting from the wiki. If you can get more favourable results with another player then by all means use it inside Kodi as your default player.

Time and time again I see messages regarding streaming HD with bandwidth issues, I wouldn't go by theoretical throughput of hardware when the practical usage indicates a lot less. I doubt the fetch & pull algorithms that Kodi uses is much different from other programs. Cut & paste example 4 as set, and see if there is any improvement.
Reply
#6
I had the same issues (WiFi AP front of house, HTPC back of house Sad ) and have found that these settings work for me:

Code:
    <network>
        <buffermode>1</buffermode>
        <cachemembuffersize>157286400</cachemembuffersize>
        <readbufferfactor>2</readbufferfactor>
    </network>
4x R-Pi4b LibreELEC v10 | Aeon Nox: SiLVO | Flirc cases
Storage Synology DS411 | 4 x WD RED 6TB
Software MariaDB 10.4.19 | Filebot | Ember Media Manager
wiki (wiki) | First time user (wiki) | Debug_Log (wiki) | mysql (wiki) | artwork (wiki)
Reply
#7
What kind of wireless mode are you connecting at? B? G? N?
You might want to do some wireless tests. Get a bandwidth meter, like DU Meter, then you can see your bandwidth usage in real time while transferring a test file.
I have 2 wireless routers flashed with Tomato in bridge mode for the same function, connecting Kodi to my main file system. They're supposedly connecting in N mode dual channel. But at their distance, the max bandwidth I can get is about 30-51 Mbit, fluctuates a lot. If the routers were in the same room my max bandwidth is only around 80-90 Mbit anyway.

I can stream 1080p movies just fine. It all depends on the video bit rate. Sometimes I can get away with watching Avatar with a total bit rate of 32 Mbit. But after a while the buffer catches up then I gotta play the buffering game.

Some settings that seem to work good for me:
<buffermode>1</buffermode>
<cachemembuffersize>314572800</cachemembuffersize>
<readbufferfactor>4</readbufferfactor>

Definitely use the 'O' key to check your buffering status. You'll see when the buffer is full or depleting. Try to play something really compressed at first as a test.

I think some of my settings above are a bit off right now. I just tried to use those settings again with Avatar 32 Mbit and I get an error that 'the buffer filled before the required amount'. It says I have 145MB of buffer, but to the right it says it's only 1%. It hits 0% rather quickly then buffers again to 1%. It also just sat there doing nothing for about 3 minutes after I hit play just buffering. It does seem like something ain't working right in Helix.

EDIT: Did some more testing. Set the mem to 999999999. It filled my buffer to about 550MB 4%. It played for a bit, then started buffering at around 460MB. The P(aq:##) diagnostic value at the top-left near the audio values started at 99%, but then quickly went down to 0% at which point it started buffering again even though the cache was 460MB. Anyone know what the P(aq:##) value is? I checked the Codecinfo Wiki and that stands for 'Audio queue saturation ', whatever that's for. Maybe the audio is depleting quicker than the video?
Reply
#8
My wireless bridge is at 5 GHz and complies to 802.11n. 5 GHz is completly free and only one wall has to be crossed from wifi base to wifi bridge. There would be a direct line of sight between both, if there weren't a wall in between.

As I mentioned I always get 10 Megabyte per second through it when I copy something. Enough bandwith to watch 1080p over it. But as we know, wifi behaves sometimes strange. So I needed a slight buffer, to compensate short impacts on bandwith. 512 MB worked with Frodo perfectly. Buffer was filled quickly and any short decrease of bandwith was compensated without any "Buffering"-message while watching a movie (just the short one at the beginning).

Issue now is, Kodi does not read at maximum available network bandwith capacity. It only uses 500 Kilobyte per second up to 1 Megabyte per second (4-8 MBit/s) of it. So it take ages until buffer is filled enough to play. And as Kodi does not read fast enough while playing, buffer underrun occurs and it buffers again until buffer is filled.
Reply
#9
It does appear Kodi 14.0 has a caching bug. Hopefully it can be fixed in the next release.

I've noticed my AQ and VQ seem to deplete before the CACHE does causing which seems to be unnecessary buffering.
Reply
#10
WiFi is very variable regarding streaming - I'm not sure, if you really have a constant 11 MBit line.
I would recommend, to use Powerline, if a LAN wire is not possible.

Certain MKV Files with 1080 have peaks until 70 MBits...
For me, 1080 streaming over Wifi is a no go - for Music it's ok.
My Equipment:
HTPC (i7-8700K 3.7 GHz, 32 GB RAM, 256 GB SSD) Windows 10 with Kodi 18.6 & Central SQL DB (Maria DB)
AVR Emotiva RMC-1 & AMP Emotiva XPA9-Gen3, TV LG OLED 65 E6, BD oppo UDP-203, Speaker Revel Performa3 F208 / F206 / C208 / Nubert WS-14 for Atmos/DTS.x)
NAS Synology DS1817+ / DX-517/DX513 (4x8 TB RAID5 + 2 x 5x6TB in RAID5)
Reply
#11
I've also noticed that Helix doesn't seem to be caching properly. Same advancedsettings as with Gotham, and all the rest of my setup has not changed, but I've gone from never buffering at all to buffering constantly.
Reply
#12
Anyone post a bug tracker yet? I tried to search but didn't find anything.
Reply
#13
(2015-01-03, 07:52)Skram0 Wrote: Anyone post a bug tracker yet? I tried to search but didn't find anything.

Anyone cares to try Kodi v14.1 testing?
This would be a nice place to post this if it's really a regression from Gotham anyway Wink
Bye,
Fry
Kodi v17.6 with shared MariaDB v10.3 | HTS Tvheadend 4.2.6 on RPi2 | running on:
Windows 10x64 | Nvidia Shield | FireTV4k | FireTVStick4 | Android 5 | RPi3 with OSMC
Reply
#14
Maybe it's a Windows thing? The cache fills up fast on my Ubuntu and iOS devices with v14.0.
Reply
#15
(2015-01-03, 10:13)Fry7 Wrote:
(2015-01-03, 07:52)Skram0 Wrote: Anyone post a bug tracker yet? I tried to search but didn't find anything.

Anyone cares to try Kodi v14.1 testing?
This would be a nice place to post this if it's really a regression from Gotham anyway Wink

It looks like that thread is only to report things that worked in 14.0 and now don't work in 14.1. They said if it's something that didn't work in 14.0 in the first place, it's not the place for it.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi 14 cache does not fill fast enough0