How to Fix Kodi Buffering with Hidden Cache Settings

In this tutorial, I will show you how to adjust some hidden cache settings in Kodi to possibly help fix issues with buffering of your video streaming.

In this tutorial, I will show you how to adjust some hidden cache settings in Kodi to possibly help fix issues with buffering of your video streaming.

First of all, I need to preface this with a disclaimer. This solution may not help with your buffering issues if your Internet connection is too slow, or if the server you are streaming from is limited in bandwidth or reaching its traffic capacity. There are lots of other possible causes for streams buffering which I covered in my post on Troubleshooting Kodi Streaming Issues, but this is just one of those tips.

What these cache settings (which I’m about to show you) do is fine tune Kodi’s cache buffer behavior to work best with the resources available on your hardware whether it be a high-powered media server, or a little Amazon Fire Stick.

Alright, let’s get into it…

Cache Settings in advancedsettings.xml

These settings will go in the advancedsettings.xml file that should be in your Kodi userdata folder.

The screenshot below is for the manual install of Kodi on Windows.  If you have the Windows 10 Store edition, click the above link for the path for that.

By default, this file will probably not exist, so you will need to create it.

If you have easy access to the file system like using Windows, or having a file manager on Android, then this should be pretty straightforward.  If you’re using a Fire TV or Stick and can’t figure out how to access this folder to create a new file, scroll down for my instructions on pushing a file using ADBLink.

Now, edit this file in Notepad, Notepad++, or some other text/code editor (NOT Microsoft Word or Wordpad since those editors will add extra hidden code).  In my case, I’m using my favorite code editor, Visual Studio Code.

If you’re not sure how to create this file and want to download mine, just right-click on the following link and then click “Save link as…”

Here’s my advancedsettings.xml file in .txt format

Then, you will need to rename the file to change the .txt to .xml and place it in your Kodi userdata folder for it to work.  If you don’t see any .txt extension at the end of the file that you download, then you need to configure your computer to show file extensions (a.k.a turn off “Hide extensions for known file types”).

What Do These Kodi Cache Settings Do?

Don’t just copy the settings I’m using because this is NOT a “one size fits all” setting.  You should adjust these to work best for your device’s available resources, specifically free RAM and hard drive storage.

<memorysize>

This is number of bytes you want to allow Kodi to use for buffering your streams.

Now, please keep in mind that Kodi needs 3x the amount of RAM to be free.  So, take a look at how much free memory or RAM you have available on your device, and divide that number by 3, and use that in the setting (converted to bytes).

Be careful not to set this too high, or you risk Kodi crashing if it can’t get enough RAM.

If you have a device with a very low amount of RAM like a Raspberry Pi and you have more than 16GB of storage, you might consider setting this to 0 (zero).  What that will do is make Kodi use your hard drive or storage to cache videos instead of using your RAM.

Please be aware that using your hard drive for buffer caching will cause a lot of extra wear and tear.  Hard drives have limited life before they start slowing down and becoming corrupt, and even SSDs (solid state drives) have a limit to the number of writes they can take in their lifetime.

<buffermode>

This setting defines what types of content should get buffered.  You should consider if you have local storage collection of media that you watch (consider mode 1), or if you only stream videos using add-ons (consider mode 0 or 2).

  • 0: Buffer all internet filesystems (like “2” but additionally also ftp, webdav, etc.) (default)
  • 1: Buffer all filesystems, both internet and local
  • 2: Only buffer true internet filesystems (streams) (http, etc.)
  • 3: No buffer

<readfactor>

This is where you set the fill-rate of the cache.  It defines how fast Kodi will try to read a video file.

It is a multiplier with a basis of 1 matching the bitrate of a video file.  So, if a video file has a bitrate of 36 Mbps, then a readfactor setting of 1 will read the video at the exact pace that the video plays, at 36 Mbps.  Setting the readfactor to 2 will try to read the video file twice as fast, at a rate to 72 Mbps which will result in the buffer filling up with 1 second of video for every second that you watch the video, until it fills up your limit define in .

With this setting, you don’t need to worry about crashing Kodi, so you can set it as high as you want.  Just be aware of more CPU usage spikes and bandwidth being used up faster as you start a video.

Quick note on add-ons to manage advancedsettings.xml

There are some Kodi add-ons that have an interface to make these changes and write to this XML file for you, like the Easy Advanced Settings add-on in the tvaddons.ag repository.

 

However, according to the official Kodi Wiki, the names of the XML tags have been renamed in Kodi 17.

In Kodi v17, the following tags are removed from and placed under a new tag. Also, is renamed to and is renamed to

Unfortunately, the Easy Advanced Settings add-on still hasn’t updated to the newly renamed XML tags used in Kodi 17.

If you’re still using Kodi 16, then go ahead and use this add-on since it makes the process of changing these settings much easier.

If you have an Amazon Fire TV or Fire Stick, and can’t easily edit your advancedsettings.xml file, you can use adbLink to push the file from your computer to your Fire TV / Stick.

If you installed Kodi on your Fire TV / Stick using my tutorial, then you already have adbLink installed on your computer.  If not, get it here. (Windows / Mac OS X 10.7+ / Linux)

Prepare Your Fire TV / Stick Before Using adbLink

  • On your Fire TV Stick, navigate to Settings > System > Developer Options and turn ON both options (Apps from Unknown Sources and ADB Debugging).
  • Find and take note of your Fire Stick’s IP address by going to Settings > System > About > Network.

Using adbLink to push advancedsettings.xml to Fire TV / Stick

  • Open adbLink on your computer (which you downloaded and installed earlier)
  • Click the New button
  • In Description, give your Fire TV / Stick a name.
  • In Address, type the IP address of your Fire TV / Stick that you took note of earlier.
  • Click the Save button.
  • Click the Connect button, and you should see your Fire TV / Stick’s IP show in the Connected Devices box.
  • Under Preset directories, select userdata
  • Click the Push button
  • Browse to and select your advancedsettings.xml file that you prepared
  • Confirm the prompt by clicking Yes
  • You should get a popup saying “File Pushed.
  • Close and reopen Kodi on your Fire TV / Stick

Let’s Chat

Do you have any feedback for me?  After you try it out, let me know if it worked for you.  Was this helpful?

Or are you having issues?  If so, please give me some specific details about the issue you’re having and I’ll see if I can help.  Thanks!

24 thoughts on “How to Fix Kodi Buffering with Hidden Cache Settings

    1. There’s not a whole lot of detail to this question, but I’ll take a shot and ask what version of Kodi are you running? You might also want to uninstall any unused add-ons which might be causing the issue. You can check the log and it might give you a hint as to what was causing a problem that led to Kodi crashing.

    2. I can promise you no matter what version of Kodi you are using it’s still going to shut down. Here’s what you need to do. First go into your “my addons and go to repositories and uninstall any and all repositories your not using, they will be self explanatory once you get in there. Next you want to sign up for real-debrid account and believe me it’s very cheap (like $20 buck every six months) Make sure your using Kodi 16.3 or newer. (I’m using Krypton 17.6) there is a newer version of Kodi which is Kodi 18 but I’m not sure if it’s finalized or still in developer stage. That should take care of Kodi shutting down, if it’s not and it keeps doing it, go back and make sure you have google play store installed.

  1. This worked amazing. I am using an acer laptop and tested my internet before trying this and my speeds should have been sufficient. But my movies and tv shows would buffer and skip seconds and do many other annoying things. After following your guide I watched a 40minute episode fully load after 5minutes of runtime. And play the whole thing without one issue. Thankyou very much. I only sujest you explain further how to create xml documents. I had to download xml word and write the data then save it to my desktop and drag and drop the file into the proper folder as it cannot be searched for or found in the save window. Anyways thankyou very much this turned out better then expected

    1. Thank you so much for letting me know how well it this worked for you. That makes me happy. Also, thank you for the suggestion on how to improve the post. I’ve updated the post to include some more details around the process of creating the file and even included a download link so someone can start with my template.

  2. I have a Raspberry Pi 3, originally running Exodus, updated to Covenant, everything worked great for a while. Since November, having big issues with buffering, no stream available, stopping play in the middle of viewing. Now we are at the point of not being able to view any TV show. Any suggestions of how to reinstall KODI/Covenant or operating system – currently running OSMC. Tried Libre Elec – but we seem to be doing something wrong.

    1. I’m also having these issues using the Fire Stick – lots of buffering, no stream available msg and stopping play in the middle of video. Any suggestions on correcting this issue will be greatly appreciated.

    2. I’m not sure where I could possibly start. Regardless of hardware, I would just say make sure you’re running the latest Kodi 17 and then use an add-on like Covenant that is still operational using my installation tutorial.

  3. Using Kodi on elitedesk PC running win 10 with i7 CPU with 4 gig ram. Usually sources don’t play continuous so I tend to pause and let it build up. Thing is even with cache ramped up to 1gig a hour episode will only ever fill up about 75% ? Is there some setting that limits amount of buffering saved apart from cache size?
    Always stops building up about 3/4 through but if I jump forward to where it stops it starts filling up again to the end? If I click back to the start I lose all the buffer I had?

    1. Ya, skipping around in Kodi isn’t handled very well. Instead of going to that part of your cached video, I’ve seen that it often wipes the cache and starts downloading from there. About the 75%… I’m not sure, but there might be a max limit. But, it sounds like you’re not having any trouble watching videos if you can get 75% cached up front.

  4. I’m wondering if there is a way to add advanced settings xml scripting to force KODI on my Fire Stick to send buffering cache to my connected SD memory card; by default. I wouldnt mind letting my streaming content selection load for 5 or so minutes to stream from my cache off the SD card that I’ve connected via the mini USB port with a splitter.

    1. I thought I responded to this, but I’m not seeing it. Maybe it was just in my head? LOL

      I’m not aware of any way to change the memory location to an external source using the advancedsettings file. But, if you find a way, I would love to know how.

  5. I followed your instructions adding the addvancedsettings.xml on my laptop and it works GREAT! Now I want to do the same on my TV box. I’m not able to find the correct folder to insert the file in using the file browser. Any suggestions?

          1. Actually I found the addon “Easy Advanced Settings” for Kodi 17 Krypton” and it worked great. You could pass this on to other Android users.

Leave a Reply

Your email address will not be published. Required fields are marked *