mpv icon indicating copy to clipboard operation
mpv copied to clipboard

multi plane overlay / MPO causing stutter in fullscreen

Open aufkrawall opened this issue 3 years ago • 0 comments

Important Information

Provide following Information:

  • mpv-x86_64-v3-20220904-git-d433c5d by shinchiro
  • Windows 11 22H2

Reproduction steps

We need:

  • a recent Windows 10 or 11 version that supports MPO
  • an Nvidia Turing or Ampere card, Pascal and older don't support MPO
  • situation with other graphics vendors or drivers is unknown to me
  • a relatively recent (i.e. non-ancient) Nvidia graphics driver
  • display output set to 8 bit. Recent Nvidia drivers might support MPO also with 10 bit, but I haven't tested it.
  • New Nvidia driver upscaling resolutions + sharpen disabled, as this disables MPO too (or limits it to 1 plane, which effectively is the same?)
  • probably not more than one display connected
  • dxdiag log output should mention MPO MaxPlanes: 4

Config:

video-sync=display-resample
ytdl-format="bestvideo[height<1440][vcodec=vp9]"

Run mpv https://youtu.be/_gBBz7IMz1Y , enable stats with shift + i and switch to fullscreen.

Expected behavior

There should be no delayed frames reported (I'd recommend to set maximum performance for mpv.exe in the Nvidia driver).

Actual behavior

Usually there is one delayed frame reported with visible stutter every 10-30 seconds.

The issue is gone when disabling MPO via DWM debug option as described here: https://nvidia.custhelp.com/app/answers/detail/a_id/5157

There is also no stutter with MPO on in windowed mode. It doesn't matter whether --vo=gpu or gpu-next are used. D3D11 is affected, as is Vulkan. Also not related to hardware decoding.

Log file

Log with MPO on with stutter: mpoon.txt

Log with MPO disabled without stutter: mpooff.txt

Now the question is if mpv can do anything about it. Chromium is/was affected by a similar or even the same issue: https://bugs.chromium.org/p/chromium/issues/detail?id=1132392&q=mpo&can=2&sort=-modified

I wonder what would happen with some kind of fake fullscreen that covers the whole screen, but is not treated as fullscreen by DWM? No idea if this is possible. Perhaps with a hack where one pixel only has 99% opacity?

The issue is not a recent development. As the Chromium issue shows, this has been going on for ages and is the default for many users. So, it probably won't just disappear by itself.

As strange as it sounds, It might be that you need to try different video resolutions to trigger the issue. The above example works with my 1440p screen. It also doesn't matter if 144Hz or 60Hz are used.

Ping @rossy @jeeb

aufkrawall avatar Sep 09 '22 02:09 aufkrawall