falahati/NvAPIWrapper

Virtual custom resolution: reported and real refresh rate don't match

FoLLgoTT opened this issue · 4 comments

I create virtual custom resolutions on trial which should only shrink the active desktop, but should use the current timing. This works fine with the following code:

NvAPIWrapper.Display.DisplayDevice display = NvAPIWrapper.Display.Display.GetDisplays().First().DisplayDevice; // use first display
NvAPIWrapper.Display.CustomResolution customResolution = new NvAPIWrapper.Display.CustomResolution((uint)width, (uint)height, 32, display.CurrentTiming);
display.TrialCustomResolution(customResolution);

The problem is that for refresh rates which are very near to each other (e.g. 59,94 Hz and 60 Hz) the nearest integer is reported from Windows and in NVIDIA control panel. In this case 60 Hz is selected in the combo box although 59 Hz should be selected. The real refresh rate is 59,94 Hz. I measured it with several applications (e.g. https://www.testufo.com/refreshrate).

I found out that "display.CurrentTiming" contains 60 Hz which is wrong. Any idea?

use FrequencyInMillihertz

if it is also 60Hz, I suppose NVAPI just returns this value for the frequency. what do you see in the NVIDIA Control Panel?

FrequencyInMillihertz is also wrong. It shows 60 Hz instead of 59,94 Hz. Only the PixelClock seems to make the difference and so the real refresh rate is correct.

NVIDIA control panel shows 60 Hz in the combo box.

if NVIDIA CP shows as 60hz, so will we. this is just a wrapper around the nvidia's API which is also used by other tools.

regardless, it is possible that the card in fact outputs 60hz or something but is then limited by some other thing in the pipeline, like the monitor or a compatibility layer for old displays which might depend on how this monitor is connected.

in any case, I don't really think we can do much about this. if pixel clock gives you the correct info you can try figuring out the actual refresh rate from that. should be straightforward.

Ok, I suspected that the cause is more inside Windows/drivers. Thank you for the answer.