Cache filled before reaching required amount
#1
I am playing pictures and short HD videos (~40MB) from the SD card, 24 hours a day with OpenELEC installed on Raspberry Pi. Everything was fine until the second day. Now when trying to play video it keeps alerting this: "Cache filled before reaching required amount."

I've already had set Cache settings, reading here, and I thought it would be fine. What can I do now?

This is my advancedsettings.xml in Raspberry Pi B+,

Code:
<advancedsettings>
  <network>
    <buffermode>1</buffermode> <!--Buffer all filesystems, both internet and local-->
    <cachemembuffersize>25971520</cachemembuffersize> <!-- 25MB -->
    <readbufferfactor>2.0</readbufferfactor>
  </network>
</advancedsettings>

is it fine to increase "readbufferfactor" in this case? I really need to optimize it because it is running on a local store and it shouldn't show cache alerts neither "Loading..." stuff
Reply
#2
Might be worth adding to this thread: http://forum.kodi.tv/showthread.php?tid=...id=1910532
Reply
#3
It happened something strange. Videos encoded in h.264 (I think is the best codec for Raspberry, from what I read) says "Loading..." before playing 30mb HD videos, whereas those same videos enconded in Xvid had no problem (no Loading alert) even in larger videos.
Reply
#4
How Kodi works if there's no advancedsettings.xml? I mean, it should be buffering somewhere before playback from SD card... however default buffermode is set to 0 (only network stuff)
Reply
#5
advancedsettings.xml is just a way to override other settings. When the file doesn't exist, that just means that Kodi uses the default settings. You shouldn't require any advancedsettings.xml file if you are playing videos from the SD card, so the issue is probably not cache-related.

Can you get us a debug log (wiki) when you playback a video? Maybe also run mediainfo (wiki) on one of your videos and tell us what it says?
Reply
#6
Hello! I am experiencing similar issues as the OP and get extremely stuttery video on certain files. I've tried with and without the advancedsettings.xml and played with the numbers then rebooted. I had no luck. I find it interesting that my $30 android phone running mxplayer is a lot better than the pi 2 at decoding files that I access on a remote server. This somewhat eliminates any possible networking issues. This leaves the differences in how each devices handles the files.

MX Player is able to give hardware acceleration with zero stutter. On the same files Kodi slowly chokes with cache full/buffering issues over the same network. Here is an example file media info in case someone can figure out why its stuttery. I can play a lot of other files perfectly fine with Kodi but far too many others just choke a slow death until I get too frustrated.

Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 350 MiB
Duration : 15mn 38s
Overall bit rate : 3 131 Kbps
Writing application : Lavf53.6.0

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 15mn 38s
Bit rate : 3 000 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.109
Stream size : 335 MiB (96%)
Writing library : x264 core 116
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language : English

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 15mn 38s
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 14.3 MiB (4%)
Language : English

Hopefully the Kodi team can sort out how its decoding differently than apps like MX Player which imo plays everything I throw at it while Kodi struggles. I think being able to choose which decoder to use for individual files may help similar to how MX Player allows different SW/HW decoding for each file. I can't really tell what Kodi is doing and even less sure if its using hardware decoding at all. The phone has same amount of RAM as the Pi so I think it's coming down to how they both handle remote files (home internet to server). I hope this gets looked into further and really is just an easy bug that can be fixed.
Reply
#7
(2015-03-16, 04:17)Blueness Wrote: Hello! I am experiencing similar issues as the OP and get extremely stuttery video on certain files. I've tried with and without the advancedsettings.xml and played with the numbers then rebooted. I had no luck. I find it interesting that my $30 android phone running mxplayer is a lot better than the pi 2 at decoding files that I access on a remote server. This somewhat eliminates any possible networking issues. This leaves the differences in how each devices handles the files.

Your file is 3Mbit/s which is nothing. The Pi1 can play 40Mbit/s BluRay files. I think the problem is certainly the network.
Are you using wired or wireless? Describe the server, and how it and the Pi are connected to other network equipment, and what protocols are used (e.g. nfs/smb).
A debug enabled log file may help.
Reply
#8
Sorry I have no longer access to that Pi B+ I talked about.
My problem is somewhat different than Blueness. I read media from the sdcard (I'm not sure if it would reduce its life quickly), so not network here. That's why I set buffermode to 1, to consider local files. However, my advacedsettings.xml didn't seem to take any effect.

In my case, I happened to see a "Loading..." alert before playing the video, and then it would run fine.
This happened on a Pi B+, while those same videos on Pi 2 didn't show alerts.

I solved it converting the h.264 encoded ones to the default .mp4 Xvid settings using FormatFactory. Not the best way, because I haven't got the original video, and still a strange solution.
I wish I have those files to debug their media info.
Reply
#9
(2015-03-16, 14:09)popcornmix Wrote:
(2015-03-16, 04:17)Blueness Wrote: Hello! I am experiencing similar issues as the OP and get extremely stuttery video on certain files. I've tried with and without the advancedsettings.xml and played with the numbers then rebooted. I had no luck. I find it interesting that my $30 android phone running mxplayer is a lot better than the pi 2 at decoding files that I access on a remote server. This somewhat eliminates any possible networking issues. This leaves the differences in how each devices handles the files.

Your file is 3Mbit/s which is nothing. The Pi1 can play 40Mbit/s BluRay files. I think the problem is certainly the network.
Are you using wired or wireless? Describe the server, and how it and the Pi are connected to other network equipment, and what protocols are used (e.g. nfs/smb).
A debug enabled log file may help.

My pi 2 is connected to a gigabit switch connected to a gigabit router connected to 50/5 cable internet connection. I think the Pi only supports 10/100 but it shouldn't matter in this case. The gigabit vps server I am streaming off of uses https off a lighttpd webserver. I can't explain why it would take so long to cache this file. My phone is on an 802.11n connection over the same network and streams the same file perfectly fine at the same time the pi couldn't play it properly. I can't really figure out where the bottleneck would be but I think its not likely my connection or the streaming server. I have a feeling it is some setting somewhere in kodi but I could be wrong. I'll try to experiment with a wifi connection on the pi to see if it helps. I personally think it is the way Kodi caches files based on formats or possibly the way it handles https served files in my case. Hopefully this pinpoints the problem somewhat on the issue.

Edit: I should mention the cache issue is format/encoding dependent like in redraw's case. I can watch other 4GB files with higher bitrates flawlessly off the same server that can't play many other files that are a less friendly format. I really think it comes down to the way Kodi treats certain formats/encoding. Maybe I should check out what the logs say once I figure out how.
Reply
#10
I have to confirm strange behaviour of the cache.
My HTPC (Win10; i3-5010U, 8GB RAM, m2 SSD) is connected through 5GHz 802.11n WiFi. Pretty stable signal, RX/TX rate 270Mbps, HTPC able to steadily receive 17-19MBps when copying file from the same SMB network location. Yet when tried to play ~104Mbps (avg rate) 4k video I encountered stuttering in some parts of the movie.

So I set-up .xml as per guide with size ~100MB, caching everything and factor 2. When started playback the bar goes in few seconds to 1% and I immediately see the "Cache filled before reaching required amount." error mesage. Playback starts but the more data intensive parts of the movie are still stuttering - and when I look at wifi transfer speed during the playback it's more-or-less matching complexity of the scene (e.g. more changes/movements increases bitrate and also wifi speed goes up). Therefore it seems the cache is virtually nonexisting because it's not able to cover anything.

PS : it's not by CPU or other HW limit - when connected over ethernet it works like charm.

Video details :
-------------
File size : 35.1 GiB
Duration : 48mn 22s
Overall bit rate : 104 Mbps
...
Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 48mn 22s
Bit rate : 101 Mbps
Width : 4 096 pixels
Height : 2 304 pixels
-------------
Reply

Logout Mark Read Team Forum Stats Members Help
Cache filled before reaching required amount0