[SOLVED] Fill the buffer completely at the start of a video
#1
Kodi version: 17.5

Hello,

Is it possible to increase the amount of data buffered when a video is started? It seems Kodi fills around 7% of the buffer (at least for the audio, I have 0% for the video) when the video is started, but it is a bit too little for my case (Raspberry Pi 1 B+) with some specific files. So within ten seconds, the video stops (= audio buffer 0%) to fill the audio buffer to 15%, and no more problem. So, 25% should be totally safe for my case.

I read the following page, I tried “<readfactor>20</readfactor>”, it does not change anything, but it is not the behaviour of this setting if I understood:
http://kodi.wiki/view/HOW-TO%3AModify_the_video_cache


Thank you for your understanding.


PS: I did not put this topic in the Raspberry Pi section because the question is not related to one specific hardware—Raspberry Pi is just an example, it can be useful for other hardware too.
Reply
#2
What's the source of the media? Note that the default <buffermode> value only buffers internet filesystems, according to that page. <readfactor> is the rate it fills the buffer, did you change <memorysize> too?
Reply
#3
External HDD.

I tried a bit with <memorysize> but nothing changed. I cannot believe it is not possible to change the amount of data that the first fill does?
Reply
#4
It is possible, as I use it. As the external drive would be a local filesource, I would assume unless you also set <buffermode> to 1, that is why it is not having any effect as it will currently only buffer internet sources. Try:

<advancedsettings>
   <cache>
      <buffermode>1</buffermode>
      <memorysize>xxx</memorysize>
      <readfactor>20</readfactor>
  </cache>
</advancedsettings>

Where xxx is whatever 25% is in bytes you want to use from your pi memory (Note: For the memory size set here, Kodi will require 3x the amount of RAM to be free. Setting this too high might cause Kodi to crash if it can't get enough RAM. 20971520 is the default, which is 20MB, which requires 60MB of free RAM )
Reply
#5
Ahahahaha, it was <buffermode> yes! Thank you very much!


But I have another problem now. Every time I start/reboot the Raspberry Pi (I use OSMC), <buffermode> is not taken into account until the small filling of the buffer has failed 3 or 4 times.

To simplify—in my case:
– play video file
– audio buffer 7% / video buffer 0%, the video is playing
– audio buffer 0% / video buffer 0%, the video stops, buffer is filling a little
– audio buffer 14% / video buffer 0%, the video is playing
– audio buffer 0% / video buffer 0%, the video stops, buffer is filling a little
– audio buffer 30% / video buffer 0%, the video is playing
– audio buffer 0% / video buffer 0%, the video stops, buffer audio + video are filling fully

In a second test, at each failure I restarted the file. So once I restarted for the second time, it is the last failure before I can get full buffers. Once I got the failure, it fully filled the buffer audio + video. I restarted, so for the third time, and now the starting was fully buffered. I am nearly sure there is a “failure counter” before <buffermode> is enabled.
Reply
#6
(2018-01-12, 06:06)Kdmeizk Wrote: Ahahahaha, it was <buffermode> yes! Thank you very much!
Glad you got that bit sorted, happy to help.

Unfortunately I can't add much on the following issue; it may be a platform-specific issue/bug? I'm using Libreelec on x64 so can't test. Hopefully someone with more knowledge than me will see this post and have some input for you.
Reply
#7
Really,  on an external harddrive, buffering should not be needed, so something else is wrong. Debug log (wiki) may assist.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#8
EDIT:

Hum, forget, I found a first way which helps, but I need to experiment more. I will give details in some hours.
Reply
#9
I found. The files concerned have a sound in “DTS-HD MA 5.1”. I have no material which can process the DTS, so I have to enable the conversion from the Raspberry (without this conversion, I have no problem). With the preset “Turbo” for overclocking (“1000MHz ARM, 500MHz core, 500MHz SDRAM, 6 overvolt”), from Raspbian, it works—600MHz SDRAM may be necessary.

And I changed the filesystem NTFS to ext4, it definitively uses less CPU (http://kodi.wiki/view/Raspberry_Pi#Maxim...erformance). I have also tested different block size of the filesystem, but it seems there is no difference. So I leave it in auto mode—4096 bytes has been chosen for my case.


I changed the title of the thread because it better corresponds to the solution that @jznine brought to solve my problem.

I added “[SOLVED]” to the title of the thread.
Thank you for helping me!
Reply

Logout Mark Read Team Forum Stats Members Help
[SOLVED] Fill the buffer completely at the start of a video0