Advance settings for expanding cache not working..


  • <cache>
    <memorysize></memorysize> <!-- number of bytes used for buffering streams in memory
    <buffermode></buffermode> <!-- Choose what to buffer:
    <readfactor></readfactor>
    </cache>

    That is the correct syntax for Krypton, but you need the <advancedsettings> / </advancedsettings> tags around the block.


  • @antonsn
    Use <network> for Kodi 16 and before
    Use <cache> for Kodi 17 and above.
    <memorysize> is "xxxMB cache" so convert to bytes, so 200MB is 209715200

    Also read the header - The RPi3 may have 1G ram but only about 480MB of that is available.

    [Conclusion]
    For high bit rate over Ethernet a memorysize of 314572800 and a readfactor of 20 should suffice - as long as no other processes are running and using memory, transmission/SQL etc.

    However, if multiple videos are watched, the system may still run out of memory - keep an eye on the memory usage and if it drops to less than 50MB decrease the memorysize by 50MB.

    Hello,

    I looked in logs I have:
    16:49:12.182 T:1962029056 NOTICE: Starting Kodi (17.0 Git:a10c504). Platform: Linux ARM 32-bit
    .....
    16:49:12.465 T:1962029056 NOTICE: Contents of special://profile/advancedsettings.xml are...
    <advancedsettings>
    <cache>
    <buffermode>1</buffermode>
    <memorysize>314572800</memorysize>
    <readfactor>20</readfactor>
    </cache>
    </advancedsettings>

    ...
    16:49:12.849 T:1962029056 NOTICE: cache.memorysize: 300MB libass.cache: 0MB

    It looks values are used. But when I start playing file I can not see buffering and memory stays the same round 100MB

    LibreELEC:~ # free
    total used free shared buffers cached
    Mem: 753340 281448 471892 5600 40508 129736
    -/+ buffers/cache: 111204 642136

    I also tried <advancedsettings>
    <cache>
    <buffermode>1</buffermode>
    <memorysize>814572800</memorysize>
    <readfactor>40</readfactor>
    </cache>
    </advancedsettings>

    Cannot see any changes :(

    Edited once, last by antonsn (February 16, 2017 at 6:50 PM).

  • I had to replace my RPI firmware to fix a CEC issue.. I might be dreaming but to me the buffer appears to be bigger than what it was before after applying it.

    This firmware was provided to me by popcornmix so it would be interesting to see if this makes a difference or not.

    backup your existing files, replace this on your SDCard and test.

    start.elf?raw=true
    fixup.dat?raw=true

  • Don't know what you are expecting to happen with a cache size of 800MB (Apart from a total system freeze) as you only have 470MB free memory.

    Use "nmon" from LE repository - system-tools, to monitor the memory usage. It won't happen all at once but over time depending on the speed of data transfer.

    You can also see how much is buffered when playing a video by pressing the "i" key. Blue is played, light grey is buffered dark grey unbuffered.

    You don't say how the video is being read. NAS/HDD/SD card/Flash Drive/Stream or the size of the file being transfered - nmon will help with that also.

  • I also believe that "expanding cache" is no longer functioning. In a previous release(many releases back) I could see buffing occur while I watched a video that was playing from my hard drive. If I paused playback, I could watch the amount of the video loading into the buffer, to the point where the whole video was in the buffer. This was nice because my hard drive is a little noisy, so after the entire show was loaded into memory cache, I could watch the show without any background noise, and no blinking light from hard drive. This is no longer working, it only seems to pre-load a very small amount and the hard drive is active throughout video playback.

  • I played around with advancedsettings.xml extensively and wasn't able to solve the buffering issues at all. I then stumbled across a thread that suggested using system mounts rather than what Kodi uses (which I think is libsmb). This has fixed the problem! No buffering at all.

    To set this up, SSH into your box and make a copy of /storage/.config/system.d/cifs.mount.sample (in the same directory) and then follow the instructions contained within it.

    cifs.mount.sample

    Sorry to hijack such an old thread, but I am trying to do what is being suggested here. Amending the sample file was pretty straight forward so I have:

    Code
    # The share we want mount
    What=//192.168.178.10/Film6
    
    # Where we want mount this share
    Where=/storage/film

    I also set the loginname and password for the windows smb share.

    Then I named the file storage-film.mount, and put it in the storage directory, then ran enable storage-film.mount which it said was succesful.
    But how do I then make it visible in Kodi? It does not show up when I go to add a location, and I actually also tried there to add an SMB share there by enterting the pi´s network IP address and then the folder named film, but it does not manage to connect to it..

    I never had issues with buffering on xbian, so theres either a larger buffer there or they mount in the background in the way I´ve just done it, dunno. It plays fine from a USB stick and the pi is on cable to my router where it gets a 100 mbit speed.
    I should also add that its not all content giving me this problem. Stuff where an hour is 2 GB works fine, but a movie I just wanted to watch which is 100 mins long and 9 GB in size would stop and buffer every 10 secs..

    Edit: I checked the status of the mount and got the following. Maybe someone can provide an explanation based on that:

    EDIT (again): Went off to try doing this via NFS instead. This seems a bit more stable, less buffering occurs but is still there..

    Another edit: I did as suggested in the beginning although I was under the impression that it would not work and took the 4th example from:

    HOW-TO:Modify the video cache - Official Kodi Wiki

    That didnt do nothing for SMB indeed, but seems to now have cured the buffering under NFS!

    Still would like to know how to get things working with SMB though.

    Edited 4 times, last by jazzlpunk (April 22, 2019 at 9:27 PM).