Windows multi-monitor refresh rate fixes for video playback |
||
Issue descriptionWe have a few issues with video janking on Windows when multiple monitors with different refresh rates are used. We use DwmGetCompositionTimingInfo function to get DWM's composition rate. This is global across all monitors, and only represents the rate at which DWM ticks, which is usually the primary monitor's refresh rate. However, this isn't an optimal value to use since DWM can tick at a higher rate than the monitor that Chrome is on. For example, if primary monitor is 144Hz, and Chrome is on secondary 60Hz monitor, all Chrome renderers will tick at 144Hz which is wasteful, and cause jank due to alternating slow and fast Present calls. It also doesn't seem to work well with our video rendering algorithm. We also have a legacy path that uses MonitorFromWindow to get an HMONITOR for a Chrome window, and then gets the display frequency for that monitor. This isn't accurate, and probably doesn't work when the monitor is set to a non-default frequency. I propose we do the following. Without direct composition: 1) Expose ANGLE's swap chain via an extension to EGL_ANGLE_query_surface_pointer. This should be quite simple. 2) Use IDXGISwapChain::GetContainingOutput to get the IDXGIOutput associated with the swap chain. 3) Use IDXGIOutput1::FindClosestMatchingMode1 with an empty DXGI_MODE_DESC1 struct to find the default (desktop) display mode for that output. 4) Get vsync interval from the DXGI_MODE_DESC1 above, and maybe use the same timebase as DwmGetCompositionTimingInfo? (The technically correct thing to do would be call WaitForVblank, but it probably doesn't matter much in practice.) With direct composition: Use IDCompositionDevice::GetFrameStatistics to get the lastFrameTime (timebase) and currentCompositionRate (interval). (We don't have high refresh rate monitors for testing this in house.)
,
Oct 31
FWIW according to issue 900445 comment #8, at least some part of this is fixed on Canary since we disabled direct composition on non-overlay supporting hardware for real, unlike before when disabling it via flags would only fake disable it, and ANGLE would still use a composition swap chain :(
,
Nov 2
|
||
►
Sign in to add a comment |
||
Comment 1 by danakj@chromium.org
, Oct 31