HOW-TO:Modify the video cache: Difference between revisions
m (Text replacement - "userdata folder" to "userdata folder") |
|||
(19 intermediate revisions by 7 users not shown) | |||
Line 4: | Line 4: | ||
{{note|Even if you change the cache settings in Kodi, that won't change how fast the video file data comes in over the network. For example, it won't make a slow server load the video any faster.}} | {{note|Even if you change the cache settings in Kodi, that won't change how fast the video file data comes in over the network. For example, it won't make a slow server load the video any faster.}} | ||
Line 18: | Line 15: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
<advancedsettings> | <advancedsettings> | ||
< | <cache> | ||
<!--- The three settings will go in this space, between the two | <!--- The three settings will go in this space, between the two cache tags. ---> | ||
</ | </cache> | ||
</advancedsettings> | </advancedsettings> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 26: | Line 23: | ||
| Step3 = Add some or all of the settings tags from the '''[[#Cache settings|next section]]'''. | | Step3 = Add some or all of the settings tags from the '''[[#Cache settings|next section]]'''. | ||
| Step4 = Save this file in your [[userdata folder]]: | | Step4 = Save this file in your [[Userdata|userdata folder]]: | ||
{{note|If you have an existing file, make sure the < | {{note|If you have an existing file, make sure the <code><cache></cache></code> tags, and settings we'll add between them, are between the main <code><advancedsettings></advancedsettings></code> tags.}} | ||
::{{#lst:userdata|location all}} | ::{{#lst:userdata|location all}} | ||
}} | }} | ||
Line 50: | Line 47: | ||
|- | |- | ||
| 3 || No buffer | | 3 || No buffer | ||
|- | |||
| 4 || All network filesystems (incl. smb, nfs, etc.) | |||
|} | |} | ||
|- | |- | ||
| <code>< | | <code><memorysize>'''20971520'''</memorysize></code> | ||
| {{big|'''Increasing the cache'''}} | | {{big|'''Increasing the cache'''}} | ||
Line 64: | Line 63: | ||
:{{note|Do not use the 0 (zero) setting if you have a device with a low amount of local storage, such as 8GB on a Fire TV. As a general rule of thumb, only use this setting if you have at least 16 GB of local drive space that is currently free on the device. Otherwise, Kodi will stall and stop playing the video, or might even crash.}} | :{{note|Do not use the 0 (zero) setting if you have a device with a low amount of local storage, such as 8GB on a Fire TV. As a general rule of thumb, only use this setting if you have at least 16 GB of local drive space that is currently free on the device. Otherwise, Kodi will stall and stop playing the video, or might even crash.}} | ||
|- | |- | ||
| <code>< | | <code><readfactor>'''10'''</readfactor></code> | ||
| {{big|'''Increase the fill-rate of the cache'''}} | | {{big|'''Increase the fill-rate of the cache'''}} | ||
By default '''(value: | By default '''(value: 4)''', Kodi will only fill the cache a little above what is needed to play it back. It does this as to not max out your network and possibly max out some hardware. For most users and hardware, this setting shouldn't cause any issues, but be aware of it if you have unusual CPU spikes in your HTPC. | ||
Line 75: | Line 74: | ||
== Kodi v17 changes == | == Kodi v17 changes == | ||
In Kodi v17, the cache-related tags were removed from <code><network></code> and placed under a '''new''' <code><cache></code> tag. In addition, the following tags were renamed: | |||
* <code><cachemembuffersize></code> was renamed to <code><memorysize></code> | |||
* <code><readbufferfactor></code> is renamed to <code><readfactor></code> | |||
==Examples== | ==Examples== | ||
{{Notice|These are just examples to explain how the feature works. '''Most users will just want to use example 4'''.}} | |||
===Example 1=== | ===Example 1=== | ||
Line 97: | Line 86: | ||
{{warning|Do not use this for flash-based memory devices.}} | {{warning|Do not use this for flash-based memory devices.}} | ||
;advancedsettings.xml | ;advancedsettings.xml | ||
<syntaxhighlight lang="xml" enclose="div"> | <syntaxhighlight lang="xml" enclose="div"> | ||
<advancedsettings> | <advancedsettings> | ||
< | <cache> | ||
<buffermode>1</buffermode> | <buffermode>1</buffermode> | ||
< | <memorysize>0</memorysize> | ||
< | <readfactor>30</readfactor> | ||
</ | </cache> | ||
</advancedsettings> | </advancedsettings> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 115: | Line 103: | ||
<syntaxhighlight lang="xml" enclose="div"> | <syntaxhighlight lang="xml" enclose="div"> | ||
<advancedsettings> | <advancedsettings> | ||
< | <cache> | ||
< | <memorysize>104857600</memorysize> | ||
</ | </cache> | ||
</advancedsettings> | </advancedsettings> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 127: | Line 115: | ||
<syntaxhighlight lang="xml" enclose="div"> | <syntaxhighlight lang="xml" enclose="div"> | ||
<advancedsettings> | <advancedsettings> | ||
< | <cache> | ||
<buffermode>1</buffermode> | <buffermode>1</buffermode> | ||
< | <memorysize>52428800</memorysize> | ||
</ | </cache> | ||
</advancedsettings> | </advancedsettings> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 140: | Line 128: | ||
<syntaxhighlight lang="xml" enclose="div"> | <syntaxhighlight lang="xml" enclose="div"> | ||
<advancedsettings> | <advancedsettings> | ||
< | <cache> | ||
<buffermode>1</buffermode> | <buffermode>1</buffermode> | ||
< | <memorysize>139460608</memorysize> | ||
< | <readfactor>20</readfactor> | ||
</ | </cache> | ||
</advancedsettings> | </advancedsettings> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 150: | Line 138: | ||
== See also == | == See also == | ||
* [[Caches explained]] | * [[Caches explained]] | ||
{{Updated| | {{Updated|18}} | ||
[[Category:Advanced topics]] | [[Category:Advanced topics]] | ||
[[Category:How-to]] | [[Category:How-to]] | ||
[[Category:Video library]] | [[Category:Video library]] |
Revision as of 10:19, 19 July 2020
advancedsettings.xml Video library |
HOW-TO:Modify the video cache |
This page describes three advancedsettings.xml settings that can be used to maximize the video playback cache. You can use all or just a couple of these settings to see significant improvements in cache performance, should you require it (most users will not require these modifications). This can help with intermittent network issues, buffering, reduce how long the network is tied up, and sometimes improve battery life.
Note: Even if you change the cache settings in Kodi, that won't change how fast the video file data comes in over the network. For example, it won't make a slow server load the video any faster.
Steps
If you don't already have an advancedsettings.xml file, it's very simple to make. Kodi uses this file for advanced settings and features that normal users shouldn't modify without first knowing what they do, as well as for experimental features, etc.
1 | Since you can use all or just some of the following settings, let's start out with the basic file. Create a plain text file (no rich text formatting, don't use .doc, etc) and save it as advancedsettings.xml. Make sure that the file extension is ".xml" and not ".txt" or ".xml.txt". | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | Cut and paste this into your new plain text file:
| ||||||||||||||||||||||||||||
3 | Add some or all of the settings tags from the next section. | ||||||||||||||||||||||||||||
4 | Save this file in your userdata folder:
Note: If you have an existing file, make sure the The Userdata folder is a subfolder of the Kodi Data Folder and is located as shown in the table below.
|
Cache settings
advancedsettings.xml tag | what it does | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
<buffermode>1</buffermode>
|
Choose what to buffer
This setting will force Kodi to use a cache for all video files, including local network, internet, and even the local hard drive. Default value is 0 and will only cache videos that use internet file paths/sources.
| ||||||||||
<memorysize>20971520</memorysize>
|
Increasing the cache
Here we can do two things:
or
| ||||||||||
<readfactor>10</readfactor>
|
Increase the fill-rate of the cache
By default (value: 4), Kodi will only fill the cache a little above what is needed to play it back. It does this as to not max out your network and possibly max out some hardware. For most users and hardware, this setting shouldn't cause any issues, but be aware of it if you have unusual CPU spikes in your HTPC.
|
Kodi v17 changes
In Kodi v17, the cache-related tags were removed from <network>
and placed under a new <cache>
tag. In addition, the following tags were renamed:
<cachemembuffersize>
was renamed to<memorysize>
<readbufferfactor>
is renamed to<readfactor>
Examples
NOTICE: These are just examples to explain how the feature works. Most users will just want to use example 4. |
Example 1
All three options enabled, using local hard drive for cache.
Do not use this for flash-based memory devices. |
- advancedsettings.xml
<advancedsettings> <cache> <buffermode>1</buffermode> <memorysize>0</memorysize> <readfactor>30</readfactor> </cache> </advancedsettings>
Example 2
Only cache size changed, using 100MB of RAM for cache (which requires 300MB of free RAM).
- advancedsettings.xml
<advancedsettings> <cache> <memorysize>104857600</memorysize> </cache> </advancedsettings>
Example 3
Two options enabled, using 50MB of RAM for cache (which requires 150MB of free RAM), and cache both internet, LAN, and local content.
- advancedsettings.xml
<advancedsettings> <cache> <buffermode>1</buffermode> <memorysize>52428800</memorysize> </cache> </advancedsettings>
Example 4
A safe setting for most devices with 1GB of RAM that should help most users "on the edge". All protocols get cached, cache rate fills up pretty much as fast as possible, and cache size is about 133MB, using about 400MB of ram total.
- advancedsettings.xml
<advancedsettings> <cache> <buffermode>1</buffermode> <memorysize>139460608</memorysize> <readfactor>20</readfactor> </cache> </advancedsettings>