Anyone using Kodi will have encountered buffering at some point, and been hit with a myriad of buffering fixes, most of which are nonsense (clear cache, packages and thumbnails are the most common buffering advice cures!). You can read more about kodi buffering here and we cover some cache myths too!
Kodi has a mass of hidden settings to allow custom configuration to suit a particular device, or install as required. If you willing to learn there are some clever things you can make it do, however, this article will focus on changing settings for “on demand” or VoD content, e.g. Movies and TV box sets. dont worry if this looks technical and sounds even more mind boggling confusing, there is a simple process to follow to get your streaming device set up perfectly!
Advanced Settings, Easy?
This article relies on using the add on “Easy Advanced Settings” addon, found in kinkins repo for easy editing of the xml file. If you’re experienced you can do this manually via ES File Explorer or an editor of your choice.
NB: If you read this and are confused or unsure, or simply wary about editing these settings, the Ares Wizard has a 3 click Cache Setup system – Ares Wizard Guide
If you require detailed explanations of the settings and how they work please visit the Kodi wiki for further reading material; Kodi Advanced Settings
Why Change Kodi Default Settings?
We're going to use as much free ram as possible to cache our video stream into, this will smooth out any dropped or missed packets as well as when the server is too busy to give us our data.
Kodi stores the video stream in a small buffer, 20mb by default, which consumes 60mb of RAM – 20 “in” buffer, 20 “out” buffer . We want to use as much as our device will let us, then we're going to get Kodi to fill it as fast as possible to smooth out our stream and hopefully avoid any “buffering” stoppages.
The Settings Used
- Curl – commands to test our source response speeds
- Buffer Mode – what we will cache
- Read Buffer Factor – how fast to read
- Cache Mem Buffer Size – how big to set the buffer
We need to be careful with the buffer size, you've been warned, making it too big will crash Kodi. You must observe the method given here, simply copying in numbers you find or that get posted up on Facebook etc could leave you more frustrated than the original buffering problem!
Kodi Advanced Settings XML
The settings we are going to be using have been extensively tested, but if I posted endless images it would get rather boring and pointless.
So lets run through each setting;
curl ; (Client URL Library)
These two commands basically allow us to test a host to see how fast it is and how long to test it for (both values or in seconds), this appears to make autoplay function quicker and more accurately, but its not perfect by any means. It does help with manual selection and reduced “working” or “loading” waits on slow or bad sources.
I've set mine to 10 for both as you can see in the image further down the page, but if your internet is slow then you might need to start with 15 or even 20 or you may just get lots of timeouts when selecting links.
buffer mode – has four settings and we're really concerned with only 2;
- buffer mode 1 – local and internet files buffered
- buffer mode 2 – internet files only (may stop MP3 addons – so use 1 if you have issues)
readbufferfactor – variable setting, too high and your device might get sluggish, so increase with caution. This number determines how fast we download the stream. The value x avgbitrate, 4-10 is ok. I have run with 100 in testing, but not much gain as a lot of sites limit the max stream rate per connection.
cachemembuffersize – I save this till last as it seems to cause such confusion. There is no ideal setting, as this is dictated by your free RAM (not storage) with Kodi loaded and waiting to go. You can find your free memory in System, system info, summary or hardware. This number is given in MB so we need to use 1/3rd of it and convert it to bytes;
From the Kodi Home screen;
- Hover over System
- Click System Info
- Note the Free Memory amount
Improved Buffering Setup: Easy Advanced Settings
Now we will change a few things ;
- Click Edit Settings
- Click Network settings
- Click Network
NOTE: some options have numeric options for you to click and change the number others have DISABLED in already – you must delete the ‘disabled' word first before adding your setting.
NOTE: “some” pvr users may find that curl 10 is too fast – use the slower 20 option if you have problems pvr issues on paid subs etc.
- Click curlclienttimeout – Key in 10 (if you have slow internet use 20)
- Click done
- Click curlowspeedtime – Key 10 (if you have slow internet use 20)
- Click done
- Click buffermode – Key in 2 (this may affect the MP3 addon so use 1 instead)
- Click done
- Click readbufferfactor – Key in 5 (you can enter almost any value – kodi wont crash)
- Click done
IMPORTANT I haven’t shown the cachemembuffersize in the image to avoid people just copying it blindly. You MUST check your free memory with Kodi loaded. Once you have that number you can calculate the bytes value as follows;
- 100MB /3 = 33 MB – put YOUR free memory into this equation
- x 1024 = 33,792 KB
- x 1024 = 34,603,008 Bytes
We write the final number in the file without any commas, therefore 34603008 – or what yours works out to be! It is important YOU make this calculation.
- Click cachemembuffersize
- Delete the word “DISABLED”
- Key in your “Bytes” from above – no commas
- Click done
Do not use some random numbers that exceed your device free memory. Kodi could hang, freeze or just crash and kick you out to your home screen. Don't say I didn't warn you!
Now back out 3 times to this screen
- Click Write XML File
DONT FORGET TO HIT WRITE FILE BEFORE EXITING!
That's it for the VoD modifications, this should ease or if you're lucky eliminate any buffering problems. If your movie buffers you can pause, you'll see the grey line extending from the blue video line to show how much is buffered.