KODI 19.0 Matrix HDR Windows API - AVS Forum | Home Theater Discussions And Reviews
Forum Jump: 
 3Likes
  • 1 Post By jogal
  • 1 Post By jogal
  • 1 Post By jogal
 
Thread Tools
post #1 of 16 Old 01-26-2020, 12:38 PM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Arrow KODI 19.0 Matrix HDR Windows API

This is a fork of Kodi 19.0 "Matrix" version that adds full HDR support with maximum image quality and HDR10 metadata passthrough in Windows 10 and UWP.

Because we are in January 2020 and Kodi does not have (yet) an official version that supports playing 4K HDR content for Windows 10, I created this fork, as a personal initiative to cover this important lack in the official version.

The source code is publicly available and has also been sent to "Kodi Team" to be merged (if they want).




KEY FEATURES

  • Maximum 4K image quality with passthrough of HDR10 metadata perfectly (independently verified with HDMI analyzer).
  • Perfect adjustment of the display refresh rate to match with content: 23,976 fps, 24,000 fps, etc.
  • NEW: Auto switch HDR mode and color space. Enable this feature from "Settings > Player > Use HDR display capabilities" = ON.
  • No need to install external programs or addons. MadVR, MPC-HC, LAV filters, DSPlayer are not needed.
  • Can activate the "Windows HDR switch" of the display settings from the Kodi power menu with the remote control.
  • Play the SDR content correctly with the Windows HDR switch ON, although it is recommended for maximum quality to play the SDR content with the Windows HDR switch OFF.
  • On systems that do not have an HDR display, it playback HDR content using tone mapping in both DXVA and pixel shaders (HDR to SDR conversion).
  • Fixed important bugs in the tone mapping function present in the official versions of Kodi 18.5 and 19.0: very dark image or washed colors.
  • It supports the HLG (Hybrid Log-Gamma) format used for HDR in Live TV broadcasts. Compatible with the "IPTV PVR Simple client" addon but in the future more addons can be created / updated supporting it.
  • All HDR functionality has been implemented using only the standard Microsoft Windows API. It does not use pre-compiled external libraries or proprietary APIs from Intel or Nvidia. It does not use hacks that only work for a specific type of HW, therefore, it is highly compatible with most Intel, Nvidia, AMD or Ryzen HDMI 2.0 graphics cards.
  • Improved swapchain performance using some new DX12 / Windows 10 features.
  • Fixed NVIDIA only related stuttering/tearing issues. These are also common for 1080p SDR content but it's less obvious (still present in 18.5 / 19 master and can affect some users).
  • Toggle HDR keymap, default assigned to F11 key, to toggle HDR on/off from keyboard/remote.


Tested on Intel NUC 8i3BEK + Denon AVX-1600H + Sony TV KD-55AG9 OLED.

and

Asus Maximus XI Hero + Asus Nvidia GTX1650 + Denon AVX-1600H + Sony TV KD-55AG9 OLED



DOWNLOAD

https://github.com/thexai/xbmc/releases



CHANGE LOG

Code:
Version 3.0.0
Updated at 21-02-2020 (forked from Kodi 19 alpha master).

Auto switch HDR mode and color space.
Only toggles HDR in screen currently used by Kodi (if system has various HDR screens).
Changed behavior of setting "Use display HDR capabilities": now enables HDR auto switch mode.
Updated with latest master branch commits. Includes ffmpeg 4.2.2.


Version 2.2.2
Updated at 14-02-2020 (forked from Kodi 19 alpha master).

Updated with latest master branch commits.
Minor improvements in HDR code.


Version 2.2.1
Updated at 07-02-2020 (forked from Kodi 19 alpha master).

In Windows 10 is used swapchain with 6 backbuffers for all content HDR / SDR / 3D.
Updated with latest master branch commits. Includes libaacs decryption fix.
Simplified code to turn HDR on/off when Kodi starts/exits.
HDR display detection code refactored.


Version 2.2.0
Updated at 04-02-2020 (forked from Kodi 19 alpha master).

'F11' keymap to toggle HDR on/off
Restores original Windows HDR config when Kodi exits
Refactor HDR display detection code
Removed unneeded code


Version 2.1.0
Updated at 02-02-2020 (forked from Kodi 19 alpha master).

Updated with latest master branch commits. Includes UHD BD improvements.
Fix for 4K HDR 60 fps content (Gemini Man).
Disabled Nvidia sharing textures (stuttering fix).
SetMaximumFrameLatency to 1 again.
Discrete decoding can use D3D_FEATURE_LEVEL_12_0.


Version 2.0.0
Updated at 01-02-2020 (forked from Kodi 19 alpha master).

Improved swapchain with some DX12/Windows 10 exclusive features.
Improved NVIDIA stability keeping low latency.
Reduced video memory usage in HDR rendering (all graphics cards).


Version 1.9.2
Updated at 31-01-2020 (forked from Kodi 19 alpha master).

Definitive cure for NVIDIA stuttering/tearing issues. (thanks bentom)
NVIDIA Control Panel 3D profile (power management) may be no longer necessary but leave it in 'Adaptive' may be a good practice.


Version 1.9.1
Updated at 28-01-2020 (forked from Kodi 19 alpha master).

Updated with latest master branch commits. Fix some crashes related to Live TV / EPG.
No changes in HDR code.


Version 1.9.0
Updated at 25-01-2020 (forked from Kodi 19 alpha master).

Removed specific NVIDIA code to workaround tearing/stuttering issues. These are due to the power saving functionality in the drivers. It is solved by
creating a maximum performance profile in NVIDIA control panel > 3D settings.
Removed 'autoHDR' option in advancedsettings.xml. Now is used GUI setting in Settings > Player > Use HDR display capabilities.


Version 1.8.1
Updated at 23-01-2020 (forked from Kodi 19 alpha master).

Fix NVIDIA HDR refresh rate match (tearing).
Updated with latest master branch commits.


Version 1.8.0
Updated at 18-01-2020 (forked from Kodi 19 alpha master).

Improves stability in NVIDIA HDR full screen switching.
Improves detection of HDR display in some multi-screen escenarios.


Version 1.7.5
Updated at 14-01-2020 (forked from Kodi 19 alpha master).

Updated with latest master branch commits. Fix some crashes due recent libraries updates.
No changes in HDR code.


Version 1.7.4
Updated at 10-01-2020 (forked from Kodi 19 alpha master).

New advancedsettings option 'autoHDR' to turn on display HDR when Kodi starts.

(Copy or create text file advancedsettings.xml and place in Kodi 'userdata' folder)


Version 1.7.3
Updated at 07-01-2020 (forked from Kodi 19 alpha master).

Rebased to latest master. Now includes libbluray 1.1.2


Version 1.7.2
Updated at 06-01-2020 (forked from Kodi 19 alpha master).

Eliminate rounding errors when handling HDR metadata.
Updated with latest master branch commits.


Version 1.7.1
Updated at 05-01-2020 (forked from Kodi 19 alpha master).

Power options menu closes dialog when toggle HDR is done.
Code cleanup.


Version 1.7.0
Updated at 04-01-2020 (forked from Kodi 19 alpha master).

Toggle display HDR on/off without restart.
Internal code improvements.
Fixed: small incorrectness DXVA HW tone mapping (clipped high luminance values).


Version 1.6.1
Updated at 31-12-2019 (forked from Kodi 19 alpha master).

Some performance improvements.
Internal code changes and refactorings.


Version 1.6.0
Updated at 27-12-2019 (forked from Kodi 19 alpha master).

Fixed: bad image when is used pixel shaders render method in HDR source to SDR render.
Several internal changes that do not affect functionality but are necessary to merge with Kodi master branch.


Version 1.5.1
Updated at 26-12-2019 (forked from Kodi 19 alpha master).

Fixed: bad image when is used pixel shaders render method in HDR mode.
Improved: prevents use tone mapping when HDR is active (regardless of settings).


Version 1.5.0
Updated at 24-12-2019 (forked from Kodi 19 alpha master).

NEW: Toggles Windows HDR On/Off from power options menu.


Version 1.4.1
Updated at 19-12-2019 (forked from Kodi 19 alpha master).

Fixed: very dark image in HDR10 to SRD conversion using DXVA HW tone mapping.


Version 1.4.0
Updated at 19-12-2019 (forked from Kodi 19 alpha master).

Added support for HLG (Hybrid Log-Gamma) and Rec.2020 for Live TV


Version 1.3.0
Updated at 14-12-2019 (forked from Kodi 19 alpha master).

Improved the detection of some HDR10 streams (The Mandalorian).
Improved handle of changes in metadata at middle of stream.


Version 1.2.0
Updated at 11-12-2019 (forked from Kodi 19 alpha master).

Fixed: Some streams 4K BT.2020 are incorrect detected as HDR resulting in bad image (live IPTV).
Various improvements.


Version 1.1.0
Updated at 08-12-2019 (forked from Kodi 19 alpha master).

New: Handle changes in static HDR metadata.
New: Python 2 & Python 3 compatible versions.   


Version 1.0.0:
Updated at 06-12-2019 (forked from Kodi 19 alpha master).

First release.
brazen1 likes this.

Last edited by jogal; Today at 03:59 AM. Reason: new version
jogal is offline  
Sponsored Links
Advertisement
 
post #2 of 16 Old 01-31-2020, 03:29 AM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Version 1.9.2
Updated at 31-01-2020 (forked from Kodi 19 alpha master).
  • Definitive cure for NVIDIA stuttering/tearing issues. (thanks bentom)
  • NVIDIA Control Panel 3D profile (power management) may be no longer necessary but leave it in 'Adaptive' may be a good practice.

DOWNLOAD => https://github.com/thexai/xbmc/releases

Last edited by jogal; 01-31-2020 at 03:32 AM.
jogal is offline  
post #3 of 16 Old 01-31-2020, 09:23 AM
Senior Member
 
ruggercb's Avatar
 
Join Date: Apr 2013
Posts: 238
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 128 Post(s)
Liked: 68
I tried to install this the other day and the installer wouldn’t start. I’ll give it another go tonight.

Windows 10
Xeon 5650
Gtx 1060
ruggercb is offline  
Sponsored Links
Advertisement
 
post #4 of 16 Old 01-31-2020, 10:16 AM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Does an error message appear?

Can you take a screenshot?
jogal is offline  
post #5 of 16 Old 01-31-2020, 11:29 AM
Senior Member
 
ruggercb's Avatar
 
Join Date: Apr 2013
Posts: 238
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 128 Post(s)
Liked: 68
Quote:
Originally Posted by jogal View Post
Does an error message appear?



Can you take a screenshot?


Actually nothing happened. I didn’t do anything but double click and that was it. Let me give it another go this evening. I’ll post my results.
ruggercb is offline  
post #6 of 16 Old 01-31-2020, 11:51 AM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
It's strange. The only thing I can think of is that the antivirus software blocks the installation because the version is very recent.

Try with v1.9.1 which is onile from a few days.
jogal is offline  
post #7 of 16 Old 01-31-2020, 06:48 PM
Senior Member
 
ruggercb's Avatar
 
Join Date: Apr 2013
Posts: 238
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 128 Post(s)
Liked: 68
It installed just fine, and it works well! It’s nice not toggling anything between HDR and SDR. Nice work!
ruggercb is offline  
post #8 of 16 Old 02-01-2020, 02:12 PM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Version 2.0.0

Updated at 01-02-2020 (forked from Kodi 19 alpha master).

Improved swapchain with some DX12/Windows 10 exclusive features.
Improved NVIDIA stability keeping low latency.
Reduced video memory usage in HDR rendering (all graphics cards).

https://github.com/thexai/xbmc/releases

Last edited by jogal; 02-02-2020 at 07:17 AM.
jogal is offline  
post #9 of 16 Old 02-02-2020, 07:17 AM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Version 2.1.0

Updated at 02-02-2020 (forked from Kodi 19 alpha master).

Updated with latest master branch commits. Includes UHD BD improvements.
Fix for 4K HDR 60 fps content (Gemini Man).
Disabled Nvidia sharing textures (stuttering fix).
SetMaximumFrameLatency to 1 again.
Discrete decoding can use D3D_FEATURE_LEVEL_12_0.

https://github.com/thexai/xbmc/releases
ruggercb likes this.
jogal is offline  
post #10 of 16 Old 02-05-2020, 02:55 AM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Version 2.2.0
Updated at 04-02-2020 (forked from Kodi 19 alpha master).

'F11' keymap to toggle HDR on/off
Restores original Windows HDR config when Kodi exits
Refactor HDR display detection code
Removed unneeded code

https://github.com/thexai/xbmc/releases
jogal is offline  
post #11 of 16 Old 02-05-2020, 03:06 AM
AVS Forum Special Member
 
dfa973's Avatar
 
Join Date: Dec 2017
Location: EU
Posts: 1,480
Mentioned: 32 Post(s)
Tagged: 0 Thread(s)
Quoted: 1004 Post(s)
Liked: 1009
@jogal - with your fork practically you need to manually switch HDR to ON in the Kodi Power Options Menu before you watch HDR content, right?

There is no automatic ON-playHDR-OFF switch when HDR content is played, as one would expect.
dfa973 is offline  
post #12 of 16 Old 02-06-2020, 02:59 AM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Right.

For now it has priority:
  • Maximum quality.
  • Maximum compatibility with different graphics cards: NVIDIA / Intel / AMD / Ryzen.
  • Stability.
  • Get almost bug free code.

Once this is achieved, new features may come.

However, nothing prevents seeing SDR content with HDR always on. It's how Microsoft thinks it should work, the colors and brightness are correct but SDR => HDR tone mapping is done. Some even prefer it because 8bit banding is reduced.

With NVIDIA it works differently and the driver does the SDR/HDR switching automatically. It can always be left Windows HDR ON and the SDR content is viewed natively.

Last edited by jogal; 02-06-2020 at 03:02 AM.
jogal is offline  
post #13 of 16 Old 02-07-2020, 01:08 AM
AVS Forum Special Member
 
dfa973's Avatar
 
Join Date: Dec 2017
Location: EU
Posts: 1,480
Mentioned: 32 Post(s)
Tagged: 0 Thread(s)
Quoted: 1004 Post(s)
Liked: 1009
Quote:
Originally Posted by jogal View Post
However, nothing prevents seeing SDR content with HDR always on. It's how Microsoft thinks it should work, the colors and brightness are correct but SDR => HDR tone mapping is done. Some even prefer it because 8bit banding is reduced.
It would be hard to add automatic switch to HDR when HDR content is played and revert back to SDR when HDR content is stopped?
dfa973 is offline  
post #14 of 16 Old 02-07-2020, 03:02 AM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Version 2.2.1
Updated at 07-02-2020 (forked from Kodi 19 alpha master).

In Windows 10 is used swapchain with 6 backbuffers for all content HDR / SDR / 3D.
Updated with latest master branch commits. Includes libaacs decryption fix.
Simplified code to turn HDR on/off when Kodi starts/exits.
HDR display detection code refactored.

https://github.com/thexai/xbmc/releases
jogal is offline  
post #15 of 16 Old 02-15-2020, 05:53 AM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Version 2.2.2
Updated at 14-02-2020 (forked from Kodi 19 alpha master).

Updated with latest master branch commits.
Minor improvements in HDR code.

https://github.com/thexai/xbmc/releases
ruggercb likes this.
jogal is offline  
post #16 of 16 Old Today, 04:02 AM - Thread Starter
Newbie
 
Join Date: Jan 2015
Posts: 13
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 4 Post(s)
Liked: 3
Version 3.0.0
Updated at 21-02-2020 (forked from Kodi 19 alpha master).

Auto switch HDR mode and color space.
Only toggles HDR in screen currently used by Kodi (if system has various HDR screens).
Changed behavior of setting "Use display HDR capabilities": now enables HDR auto switch mode.
Updated with latest master branch commits. Includes ffmpeg 4.2.2.

https://github.com/thexai/xbmc/releases


Enable auto switch HDR from "Settings > Player > Use HDR display capabilities" = ON
jogal is offline  
Sponsored Links
Advertisement
 
Reply Home Theater Computers

Tags
hdr passthrough , hdr player , hdr10 , hlg , kodi

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off