HOW-TO:Modify dirty regions: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
Line 48: Line 48:


* -1: disabled
* -1: disabled
* 0 or higher: timeout in milliseconds (0 is default)
* 0 or higher: timeout in milliseconds '''(Default)'''


|-
|-
Line 57: Line 57:
Enable dirty-region visualization. Paints a rectangle over marked controls.
Enable dirty-region visualization. Paints a rectangle over marked controls.


* True: on
* true: on
* False: off (Default)
* false: off '''(Default)'''


{{note|This is only for development mode and isn't of use to normal users.}}
{{note|This is only for development mode and isn't of use to normal users.}}

Revision as of 23:33, 24 May 2014

Home icon grey.png   ▶ advancedsettings.xml ▶ HOW-TO:Modify dirty regions

Dirty regions is an advanced setting and interface rendering method that can help speed up the GUI in XBMC and decrease the demand on your CPU and GPU. Dirty regions has no effect during video playback unless there are GUI elements (on screen buttons) visible. Using dirty regions requires XBMC v11 (Eden) or higher.

Steps

If you don't already have an advancedsettings.xml file, it's very simple to make. XBMC 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.

1 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:
<advancedsettings>
  <gui>
    <algorithmdirtyregions>1</algorithmdirtyregions>
    <nofliptimeout>1000</nofliptimeout>
  </gui>
</advancedsettings>
3 Change the values between the tags to fit your situation. See #Settings explained for details.
4 Save this file in your userdata folder:

The Userdata folder is a subfolder of the Kodi Data Folder and is located as shown in the table below.

Operating system Userdata Folder
Android Android/data/org.xbmc.kodi/files/.kodi/userdata/ (see note)
iOS /private/var/mobile/Library/Preferences/Kodi/userdata/
LibreELEC /storage/.kodi/userdata/
Linux ~/.kodi/userdata/
macOS /Users/<your_user_name>/Library/Application Support/Kodi/userdata/
Nvidia Shield (SMB) smb://<nvidiashieldurl>/internal/Android/data/org.xbmc.kodi/files/.kodi/userdata
OSMC /home/osmc/.kodi/userdata/
tvOS /private/var/mobile/Library/Preferences/Kodi/userdata/
Windows %APPDATA%\Kodi\userdata
Windows Portable <Install location chosen by you>\portable_data\userdata\
Windows via Microsoft Store %LOCALAPPDATA%\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\
Windows Xbox %LOCALAPPDATA%\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\
Note: In some Android setups the path may be slightly different to the one stated above.

Note: If you have an existing advancedsettings.xml file, make sure the <gui></gui> tags, and settings we'll add between them, are between the main <advancedsettings></advancedsettings> tags.


Settings explained

advancedsettings.xml tag what it does
<algorithmdirtyregions>3</algorithmdirtyregions> Dirty regions mode

Note: Some GPU/hardware configurations will have some minor issues (such as a visual "flicker"). For those situations try mode 2 or use the default (mode 3, which requires no advancedsetting). Almost all ARM-based devices (such as Android) willl likely have flickering issues.

Note: Some GPU/hardware configurations will have some minor issues (such as a visual "flicker"). For those situations try mode 2 or use the default (mode 3, which requires no advancedsetting). Almost all ARM-based devices (such as Android) willl likely have flickering issues.

Enable dirty-region processing. Dirty regions are any parts of the screen that have changed since the last frame. By not re-rendering what hasn't changed the GUI can be sped up. Because all GPUs work differently, only Mode 3 is guaranteed to work for everyone without flickering issues. This mode will reduce CPU/GPU usage, but will not increase GUI speed.

value result description
0 Off The entire viewport is always rendered.
1 Union All dirty regions are grouped into the smallest possible rectangle. This is typically the fastest mode for slower GPUs due to only making one pass.
2 Cost reduction Each dirty region is presented separately, in as many passes as there are regions.
3 Whole Screen The entire screen is rendered if there are any dirty regions. This is a safe default for drivers that clear buffer contents (manifests as blinking or vibrating images). Default
<nofliptimeout>0</nofliptimeout> No flip timeout

Specifies the timeout in milliseconds after which XBMC will not flip the graphics buffers anymore when nothing has been rendered, this lowers both CPU and GPU usage. Sometimes adjusting this value can help prevent flickering.

  • -1: disabled
  • 0 or higher: timeout in milliseconds (Default)
<visualizedirtyregions>false</visualizedirtyregions> Visualized dirty regions

Enable dirty-region visualization. Paints a rectangle over marked controls.

  • true: on
  • false: off (Default)

Note: This is only for development mode and isn't of use to normal users.

Examples

Example 1

advancedsettings.xml
<advancedsettings>
  <gui>
    <algorithmdirtyregions>1</algorithmdirtyregions>
    <nofliptimeout>1000</nofliptimeout>
  </gui>
</advancedsettings>

History

XBMC started as a project for the original XBOX where things were very different. After the move to desktops and embedded environments, many of the legacy procedures remained. One of these procedures, and a long-time thorn in XBMC’s side has long been its rendering model in which where every frame is rendered by the GPU in its entirety, typically at 60fps. As you can imagine, this is incredibly intensive and very unfriendly to low-power platforms. This is where dirty-region rendering comes in. Thanks to the work of Tobias and Jonathan (jmarshall), XBMC now has the ability to only render what has changed.

For more information see: Working with dirty regions