New issue
Advanced search Search tips

Issue 900738 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocking:
issue 900445



Sign in to add a comment

Windows multi-monitor refresh rate fixes for video playback

Project Member Reported by sunn...@chromium.org, Oct 31

Issue description

We 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.)
 
Thanks for tackling this!
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 :(
Status: Available (was: Untriaged)

Sign in to add a comment