REQ: display settings - toggle HDR mode (nvidia)

Got a good idea? You can suggest new features here.
Post Reply
gibman
Posts: 9
Joined: Thu Aug 08, 2019 5:55 pm

REQ: display settings - toggle HDR mode (nvidia)

Post by gibman » Tue Dec 10, 2019 1:16 pm

It would be nice to have builtin support in E.G for turning HDR on/off.

The HDR button inside windows 10 display settings does not have an API associated with it and clicking it using autoit3 is not very reliable.

Nvidia to the rescue.
Nvidia has the nvapi which exposes a way to to turn HDR on/off. I dont think AMD has anything similar :(

I have a code example in C# if interested that does exactly this using nvapi.
Also madVR automatically toggles the HDR mode (using nvapi) based on meta data of the video file rendered.
http://madvr.com/

My usecase would be the native netflix windows app, which does NOT support auto toggling HDR mode. One have to do this manually.. sigh.

I could hook up my remote control to trigger this functionality within E.G.

regards
gibman

User avatar
kgschlosser
Site Admin
Posts: 5120
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: REQ: display settings - toggle HDR mode (nvidia)

Post by kgschlosser » Wed Dec 11, 2019 9:26 pm

give this a go and see if it switches to HDR mode for you. if it does then I can modify the thing in order to have it compile as a DLL file and we will be able to access it from EG.

Or you can use it as is if you want. You can launch the console program using EG that should switch the mode to HDR. and in order to exit HDR use the Find Window action and locate the console windo running the application then use the Send Key action and end the {Enter} key. this should turn HDR off.
Attachments
HDRSwitcher.zip
(19.98 KiB) Downloaded 12 times
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5120
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: REQ: display settings - toggle HDR mode (nvidia)

Post by kgschlosser » Mon Dec 16, 2019 7:18 am

any word on if this thing works or not.. I see it has been downloaded 4 times.
If you like the work I have been doing then feel free to Image

gibman
Posts: 9
Joined: Thu Aug 08, 2019 5:55 pm

Re: REQ: display settings - toggle HDR mode (nvidia)

Post by gibman » Mon Dec 16, 2019 10:30 am

yes.. it seems to work just fine :)

thanks alot !!

regards
gibman

gibman
Posts: 9
Joined: Thu Aug 08, 2019 5:55 pm

Re: REQ: display settings - toggle HDR mode (nvidia)

Post by gibman » Mon Dec 23, 2019 12:22 am

any way to also change ...

colorformat : YCbCr422, YCbCr420, YCbCr444, RGB
dynamic range: full, limited
color depth : 8, 10 12 bpc

as seen in the nvidia control panel.

these values constantly revert themselves. probably when installing new drivers or OS updates.
would be nice to be able to set them once in something like E.G and be done with it :)

mabe NVapi has a means of doing it ?

regards
gibman

User avatar
kgschlosser
Site Admin
Posts: 5120
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: REQ: display settings - toggle HDR mode (nvidia)

Post by kgschlosser » Mon Dec 23, 2019 2:11 am

yeah I can set something up like that. I will port the whole NVDIA API/SDK to python so that you will be able to pretty much make any of the changes you see in the NVDIA control panel from EG.

I will also be able to kick out some events for things like resolution changes, refresh rate changes, the HDR switching.... etc...
If you like the work I have been doing then feel free to Image

gibman
Posts: 9
Joined: Thu Aug 08, 2019 5:55 pm

Re: REQ: display settings - toggle HDR mode (nvidia)

Post by gibman » Mon Dec 23, 2019 10:05 am

Ahhh man .. that would be so cool.

I guess santa do exist😇

Id be happy to test.

Merry christmas.

Gibman

User avatar
kgschlosser
Site Admin
Posts: 5120
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: REQ: display settings - toggle HDR mode (nvidia)

Post by kgschlosser » Tue Jan 07, 2020 10:00 pm

I wanted top let you know that I started working on this.. However..

I did not start with Nvidia. I figured if I was going to expose this kind of functionality I would do it for Nvidia and ATI at the same time and in a single plugin.. I personally own an ATI video card so I am able to test it.. I am going to go to purchase an Nvidia card to test with.. because of the nature of this I do not feel comfortable with having it debugged by someone else. I do not want to cause an issue with your computer.. I do hope you can understand my concern there. These types of APIs are interfacing directly with the driver which in turn is going to tell the hardware.. If something goes wrong it could cause a problem. Not saying that it will blow up your hardware or anything. Or maybe it will. IDK. I really do not want to find out on anything other then a test computer. Video cards are extremely fickle, these API's provide access to things I have never heard of and are hard to even find information about.

Intel users well... or rather "oh well"... looks like it's time to upgrade.
If you like the work I have been doing then feel free to Image

gibman
Posts: 9
Joined: Thu Aug 08, 2019 5:55 pm

Re: REQ: display settings - toggle HDR mode (nvidia)

Post by gibman » Wed Jan 08, 2020 8:07 pm

uhh that's sounds like really great news to me.
I'd be happy to test it - just throw it after me :)

exposing the entire API of either ATI/NVidia in the first release would probably be overkill.
I would just start out with the most basic stuff first and then see where it goes from there.

afaik no python wrapper exists for nvapi. There is one for dotnet c# though.
https://github.com/falahati/NvAPIWrapper

I extended this specific wrapper with a way to turn of /off HDR.
It doesnt do the other colorspace related things I mentioned.. yet.
Let me know if you want a copy for reference.

btw my gfx card is : nvidia gtx 1060 6gb vers.

looking forward for more info from you.

regards
gibman

User avatar
kgschlosser
Site Admin
Posts: 5120
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: REQ: display settings - toggle HDR mode (nvidia)

Post by kgschlosser » Thu Jan 09, 2020 12:25 am

It's not hard in the terms of writing it... well errr... I didn't write it :shock:
I wrote a program that reads the h, cpp, c, and idl files and it spits out the python equivalent. If there are any dll's that may be associated I can take the dll and assign it to my program and it will read all of the public functions inside of the dll and if there is a reference in the source code that I am converting to any function contained in the dll it will write the code needed to acess that function

So it took all of about 20 seconds to port whole thing to python. all 28089 lines of it.

But I have to go through and fix any possible conversion errors. and then write wrapper functions/classes around the new code to make it "user friendly"
If you like the work I have been doing then feel free to Image

Post Reply