Kodi Community Forum
Req Cache network streams - why is Kodi so bad at it? - 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: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Req Cache network streams - why is Kodi so bad at it? (/showthread.php?tid=355163)



Cache network streams - why is Kodi so bad at it? - _novalis - 2020-06-14

Now with wireguard all over the place I thought it'd be fun to test the streaming capabilities of Kodi through the tunnel.
I have two options: Windows on Notebook and Libreelec on Raspi4
Now, the results are rather disappointing. A lot of caching, every ten seconds or so. Actually unusable unless stream has almost sd quality.

At first I thought the caching problem results from low bandwidth, but I have 30 Mbit on the download side and 50 Mbit on the upload side. Tested with a normal download.
Kodi (Windows) only uses half of it while streaming, max around 15 Mbit.

I tried to play around with the chache settings in advancedsettings.xml
For the Windows installation it made things better, not great but better. I could watch streams that I couldn't watch before. A file for example that had a filesize of 5GB for one hour of playback
On the Raspberry with Libreelec it didn't do anything for the better.
Interesting that use of RAM was almost not increased. CPU usage was around 65% and 450MB of Mem were unused.

So the big question is: why are all those resources not used to their full potential - while playback is stuttering/caching like hell.
I understand that Kodi does not want to overcharge,
but in this state it is completely failing to download/playback a stream that should be doable with the available resources. Even with a Raspberry that has only 2GB of RAM. It does so in a local network, so the only parameter that's different is network speed. And here is - as I said above - only 50% used.
The cache settings in advsettings.xml are not doing very much, so at least this should work, if the user decides he wants full power on caching. It is his choice ultimately.
So is this something you see space for improvement or do you consider it ok as it is?


RE: Cache network streams - why is Kodi so bad at it? - Klojum - 2020-06-14

My simple opinion: Kodi doesn't need additional caching.

If it does, then either your local network or your internet connection is simply crap. The stream flow can fluctuate constantly. Your 30/50Mbit speeds only indicate top speeds from/to your ISP. If the remote server, where the stream comes from, cannot upload the video at full speed for whatever reason, or any other network point in between that source and your internet connection is having hiccups, your download speed from your ISP doesn't matter. That video will still come in (too) slow.

Buffer settings can accommodate for some fluctuations, but not for 100% all the time.


RE: Cache network streams - why is Kodi so bad at it? - _novalis - 2020-06-14

(2020-06-14, 08:36)Klojum Wrote: My simple opinion: Kodi doesn't need additional caching.
That's just ignorant, sorry.

(2020-06-14, 08:36)Klojum Wrote: Buffer settings can accommodate for some fluctuations, but not for 100% all the time.

I tried to make it clear that the bandwith is not the problem. That's why I compared two different platforms. One working better than the other.
Maybe you also didn't get that bit: If I download the file outside of Kodi I have twice the speed of Kodi. 30 vs 15 Mbit.
Kodi handles the stream as it doesn't know that playback is crap as hell. There are resources available that it just doesn't use. Here is a screenshot that shows how much mem is still available for caching and remains free all the time.
In my opinion buffer settings are ignored mostly.
So probably it's more the programming than anything else.

Image


RE: Cache network streams - why is Kodi so bad at it? - Klojum - 2020-06-14

If Kodi works okay in Windows, but not in LibreELEC/RPi4, perhaps there is something to look at in LibreELEC. Kodi as a whole is not directly to blame.

Mind you, the RPi4B is still considered a new device. It took quite a few years to perfect the setups for the earlier RPI models, which had largely the same GPU.
The RPi4B is a completely different animal.


RE: Cache network streams - why is Kodi so bad at it? - _novalis - 2020-06-14

I agree. The difference between the the systems is of course a factor. But I am still wondering why the resources on the Raspi wont be fully used. Look the is so much unused RAM that should be used by buff/cache.
Also Kodi could download much faster/use more bandwith than it actually does.


RE: Cache network streams - why is Kodi so bad at it? - Klojum - 2020-06-14

(2020-06-14, 15:53)_novalis Wrote: But I am still wondering why the resources on the Raspi wont be fully used. Look the is so much unused RAM that should be used by buff/cache.

I'm not a developer, and why free internal memory isn't used I cannot tell you.
For specific questions you can also ask around on the LibreELEC forum.


RE: Cache network streams - why is Kodi so bad at it? - _novalis - 2020-06-25

Don't think this is an issue for the Libreelec department. More for the Kodi developers.