Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window display change/regression in GUI mode with no-osc #3301

Closed
Hrxn opened this issue Jul 2, 2016 · 5 comments
Closed

Window display change/regression in GUI mode with no-osc #3301

Hrxn opened this issue Jul 2, 2016 · 5 comments
Labels

Comments

@Hrxn
Copy link
Contributor

Hrxn commented Jul 2, 2016

mpv version and platform affected

Windows 10 Pro x64:
mpv 'release' v0.18.0
mpv git-c57304a
(Tested on two machines)

Windows 10 Pro x32:
mpv 'release' v0.18.0

Reproduction steps

Put in mpv.conf:
no-osc

(Can be completely empty otherwise)

Expected behavior

Earlier versions of mpv showed an window (same size, same position) as with OSC enabled, only the window content was empty, i.e. completely black. That is, no mpv logo and 'Drop files to play here'

Standard display, launched via shortcut, taskbar, etc. and without no-osc:
standard
(Yes, I'm aware the text looks not as usual, but this is an older screenshot with changed text setting in the config, i.e. osd-color.. etc.)

With 'no-osc':
As stated, not working as before. Imagine the screenshot above but just black inside the window.

Actual behavior

no-osc
no-osc

no-osc and no-border
no-border

I think this should be labeled as ms-windows and probably as low priority as well..

@rossy rossy added the os:win label Jul 2, 2016
@rossy
Copy link
Member

rossy commented Jul 2, 2016

Yep, I can reproduce this. I think it's to do with ANGLE becoming the new default OpenGL backend. ANGLE doesn't currently receive any notification when the window is resized. Instead, it checks for changes in the window size in eglSwapBuffers after IDXGISwapChain::Present is called. This means that the size of the backbuffer will be wrong on the first call to eglSwapBuffers after the window is resized. mpv resizes the window on startup, so the backbuffer size will be wrong there too.

You should find that this issue doesn't show up with the other OpenGL backends, so mpv --no-osc --vo=opengl:backend=dxinterop and mpv --no-osc --vo=opengl:backend=win should still work. Also, with the ANGLE backend, there should be visual corruption if the OSC is disabled and you quickly change the window size (for example by snapping the window to the side of the monitor with Win+Left.)

The reason why this is only reproducible with the OSC disabled is because the OSC seems to redraw the screen an extra time, so the backbuffer size will be correct.

@rossy
Copy link
Member

rossy commented Jul 3, 2016

I'm not sure how this can be solved, but I reported it to the ANGLE project in http://anglebug.com/1438

@Hrxn
Copy link
Contributor Author

Hrxn commented Jul 3, 2016

Yes, you're right. Can confirm that, for example, adding
vo=opengl-hq:backend=dxinterop to the .conf
results in the old behaviour.

I wasn't aware that Angle became the new default backend for OpenGL. But I see that there were some updates in the commit log, so I guess these enhancements earned Angle the promotion as new default ;-)

Otherwise, according to the manual, dxinterop is still marked as 'experimental', so I guess I'll try the win backend for a while.

@Hrxn
Copy link
Contributor Author

Hrxn commented Jul 4, 2016

A suggestion, for a possible workaround, maybe:

When starting mpv in GUI mode as described above, always display some kind of splash screen, regardless of the OSC setting. Might turn out useful in the future if that is decoupled.

Just something simple, like with OSC on, some text and maybe the mpv logo.

rossy added a commit to rossy/mpv that referenced this issue Jul 4, 2016
This uses eglPostSubBufferNV to trigger ANGLE to check the window size
and update the size of the swapchain to match, which is recommended
here: https://groups.google.com/d/msg/angleproject/RvyVkjRCQGU/gfKfT64IAgAJ

With the D3D11 backend, using eglPostSubBufferNV with a 0-sized update
region will even skip the Present() call, meaning it won't block for a
vsync period. Also, as far as I can tell, eglPostSubBufferNV will update
the swapchain size even when the EGL display does not expose the
EGL_NV_post_sub_buffer extension, so there is no need to check for it.

Hopefully ANGLE will have a less hacky way of doing this in future. See
the relevant ANGLE issue: http://anglebug.com/1438

Fixes mpv-player#3301
rossy added a commit to rossy/mpv that referenced this issue Jul 4, 2016
This uses eglPostSubBufferNV to trigger ANGLE to check the window size
and update the size of the swapchain to match, which is recommended
here: https://groups.google.com/d/msg/angleproject/RvyVkjRCQGU/gfKfT64IAgAJ

With the D3D11 backend, using eglPostSubBufferNV with a 0-sized update
region will even skip the Present() call, meaning it won't block for a
vsync period. Also, as far as I can tell, eglPostSubBufferNV will update
the swapchain size even when the EGL display does not expose the
EGL_NV_post_sub_buffer extension, so there is no need to check for it.

Hopefully ANGLE will have a less hacky way of doing this in future. See
the relevant ANGLE issue: http://anglebug.com/1438

Fixes mpv-player#3301
@rossy
Copy link
Member

rossy commented Jul 4, 2016

Hopefully that won't be necessary. Even then, mpv could probably present a black frame twice instead of a splash screen. The above PR should fix this without an additional Present().

rossy added a commit to rossy/mpv that referenced this issue Jul 4, 2016
This uses eglPostSubBufferNV to trigger ANGLE to check the window size
and update the size of the swapchain to match, which is recommended
here: https://groups.google.com/d/msg/angleproject/RvyVkjRCQGU/gfKfT64IAgAJ

With the D3D11 backend, using eglPostSubBufferNV with a 0-sized update
region will even skip the Present() call, meaning it won't block for a
vsync period. Also, as far as I can tell, eglPostSubBufferNV will update
the swapchain size even when the EGL display does not expose the
EGL_NV_post_sub_buffer extension, so there is no need to check for it.

Hopefully ANGLE will have a less hacky way of doing this in future. See
the relevant ANGLE issue: http://anglebug.com/1438

Fixes mpv-player#3301
rossy added a commit to rossy/mpv that referenced this issue Jul 4, 2016
This uses eglPostSubBufferNV to trigger ANGLE to check the window size
and update the size of the swapchain to match, which is recommended
here: https://groups.google.com/d/msg/angleproject/RvyVkjRCQGU/gfKfT64IAgAJ

With the D3D11 backend, using eglPostSubBufferNV with a 0-sized update
region will even skip the Present() call, meaning it won't block for a
vsync period. Also, as far as I can tell, eglPostSubBufferNV will update
the swapchain size even when the EGL display does not expose the
EGL_NV_post_sub_buffer extension, so there is no need to check for it.

Hopefully ANGLE will have a less hacky way of doing this in future. See
the relevant ANGLE issue: http://anglebug.com/1438

Fixes mpv-player#3301
@rossy rossy closed this as completed in 6a3da43 Jul 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants