-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Entering fullscreen with Vulkan freezes window content on AMD #8008
Comments
I don't know if this is specific to AMD nor Windows given I've seen the same thing in Linux and NVIDIA? Vulkan can bring X to it's knees with a poorly encoded video |
Almost certainly a NVIDIA driver issue. |
Might not be related but I'm also using AMD (RX570) on Windows 1909 using Vulkan and fullscreen causes my monitor to switch from 75hz to 60hz (the process causes a black screen for ~5secs) and is very laggy afterwards but I don't recall it freezing completely. |
Yep, switching into fullscreen on Windows worked fine with the Nvidia card that was installed before and Linux Xorg issues should be unrelated.
I waited like 10 seconds or so and it didn't recover. I'm also using single refresh rate EDID, so it can't change it. |
What happens when you don't? Seems like it's forcing to run at 60hz for some reason like it's hardcoded, maybe since it can't it ends up failing? |
It happens also with my default EDID that features only 60Hz. |
My RX570 with a 60HZ display experience no issue. Same Windows 10 2004 & Vulkan are being used. When switching to fullscreen, the screen will turn black for about 2 seconds then enter exclusive mode, playback will then be resumed. Did you turn AMD FreeSync on? or flip it on and try again? |
My display is not VRR capable. I also think that a 2s transition wouldn't be acceptable either. While this is certainly AMD's fault, it would still be nice to have a workaround (if possible). |
What makes you think it's AMD's fault? I haven't noticed anything like this in any other Vulkan app? |
It works with Intel & Nvidia (without weird transition slowness) and fullscreen behavior can also be bad in other Vulkan fullscreen applications with AMD. E.g. it doesn't seem to "unredirect" DWM compositing when I alt + tab out and again into some games with DXVK on Windows when there are other windows at the same time, so ironically what would be more desirable for media players. |
Comparing to freeze after switching to fullscreen, I think a short latency is totally acceptable! But it certainly could be better. I use the "pro" version of the AMD's Radeon Software. afaik, the "pro" version is proprietary and the normal one is open source(at least for Linux), there might be some difference between them, you could probably give it a try. |
Oh, I just realised MPV allows changing the swapchain mode, I can't really test it now but have you tried changing those settings? I have a feeling choosing another mode may solve this but it's just a theory. EDIT: Actually tested fullscreen again and something has changed recently. It no longer changes my screen's refresh rate or blackscreens and instead doesn't open to fullscreen at all and trying to interact with the window is pretty much impossible but it's not frozen, the video will still play smoothly in the background if you try to alt-tab or press the window key but stops when you try to open that window or close the start/alt-tab menu. vulkan-swap-mode=immediate is the only option that works properly with fullscreen but that means no vsync so probably not ideal for some. With no shaders and video-sync=display-resample I was getting 322fps without shaders and I wasn't seeing tearing but the reported vsync jitter was around 0.7. I'm not sure running without vsync and video-sync=audio does but it seemed to play fine (I think that's meant to disable interpolation but I couldn't really notice). Also, using the default swapchain and "ontop" I can get fullscreen to show after alt-tabbing to it but interacting with the window will cause the image to freeze but audio continues playing and alt-tabbing again returns it to focus while continuing to play the video. Another thing I noticed is running window-maximized with no-borders replicates the same issue. |
Yes, that's what I meant ("freezes window content"). |
Yes, it works fine with DXVK and not only that but it has the lowest Vsync jitter I've seen. That said, the Anime4k shaders I'm trying to run give a green screen under DX11 and the same thing happens when using DXVK. |
Same thing here...works with any other API, but just freezes on Vulkan when i use fullscreen. That's pretty sad, since vulkan don't even stress the GPU (RX 5700 XT in my case). And for some weird reason, this just started some days ago, before that i was able to use without a single freeze, even with 4K or astonishing overkill 8K videos. |
I don't think there's anything we can do to work around this, unfortunately. Until there's some sort of vulkan extension to control what happens when going into fullscreen. It's possible you can find some driver setting to disable it. |
Only freezes on my non main monitors, fullscreening works fine on the main monitor. |
What about when you only have 1 monitor connected? |
RX 580 |
!FIXED!: Run with mpvnet.exe instead of mpv.exe! |
no thanks |
I've found this in the nvidia driver's readme, could it be related?
|
Unlikely. We respect those events. |
This is partially fixed in the latest Shinchiro build with libplacebo v3.120.0. It is now able to play a file in fullscreen with working controls BUT it's dropping and delaying a tonne of frames, it's syncing to ~66hz instead of my monitor's 75hz... When launching the file it goes in and out of fullscreen 3 times in the first few seconds. It still does the same as thing as previous libplacebo versions when launching just the program without a video file. Log (with current settings, haven't tested default): EDIT: Tried without shaders/extra vulkan settings and same issue. Runs full speed in DX11/OGL fullscreen and Vulkan in window-maximized. |
Just to rule this out, try with |
Update: On Sep 19, 2020, I mentioned that it was impossible to use Vulkan API in full screen, since that day I never used Vulkan again, but a few months ago (Dec 29, 2020) I bought another GPU and managed to use Vulkan without major issues. I am not sure if it was an update that fixed it or just a type of incompatibility with my previous GPU or driver, but although it is apparently functional it is impossible to share the media through Discord or record it with programs like OBS, in both cases the video appears to be frozen in the recording with the audio playing, while the media itself still plays normally. My previous GPU was a RX 5700 XT, i'm currently using a RTX 3070. |
Previously I tested that without any luck, will try it again in a bit but I'm on Windows using the latest driver so might be a separate issue. EDIT: No change, still extremely laggy. |
And how exactly do you want me to test performance without a video playing? https://drive.google.com/file/d/18CONx9MiA0AwoTScZZmDuzVbPl8oUDwU |
@haasn @adisib |
I wasn't talking about performance... It's probably easier to show you what I mean: https://www.youtube.com/watch?v=Puj_3k9oN3w EDIT: Oh right, you attempted to try it but you weren't opening in fullscreen, this bug is ONLY about fullscreen, there's nothing wrong when I open in windowed. That said, you aren't getting the performance issues I'm experiencing it seems. I just tested at 60hz and the performance issue isn't there but vsync jitter is fairly high at 0.3. Setting my monitor to 60hz actually disables my monitor's Freesync so not sure if the jitter is just from that. |
Well, there we go. I finally see the issue you are talking about. When I use the following settings:
And open MPV with no file, my Samsung TV loses signal and gives a "Mode not Supported" error. From tinkering with my EDID via CRU I know this happens only in exclusive fullscreen applications that do not respect the set desktop resolution, but instead try to force another resolution (which does not exist in my case, since I've deleted it with CRU) So yeah #8008 (comment) is the issue here. AMD vulkan driver bug. |
doitsujin/dxvk#1928 (comment) |
Come to think about it I don't think anyone has reported seeing this bug on Linux (except for a guy using Nvidia). I'm installing a preview cumulative update right now that has a few fixes that could be related so here goes :P I don't recall DXVK capping to 60fps though, whatever they are doing it's working around this issue. I have had problems in the past with Vulkan apps being limited to 60fps though in fullscreen so that's not new. EDIT: AHAHAHA KB5000842 actually fixed the lagg issue I was getting at 75hz. I never would have imagined it would be a Windows issue.... If you are wondering which issues they fixed that I suspected:
I only have a single monitor though :/ The videos also start up faster now and only do 1-2 flashes instead of 3x when launching to fullscreen. Opening the exe without content is worse than before, I can't even alt-tab to it now. Vsync jitter is pretty high though in Vulkan, 0.270 vs 0.017 in DX11. No idea if that's really enough to cause issues though. |
I remember having the 60Hz issue in almost all exclusive fullscreen games, which is exactly why I've deleted all but 2 resolutions from my EDID. |
By CRU, you mean this CRU? -> |
@Hrxn |
@haasn Dolphin just merged a workaround for the bug (linked above), what's your opinion on that if you don't mind? |
@Jules-A I'm not entirely sure what the work-around is doing here. Do they just treat that result as if it were Overall I'm more inclined to work around it by explicitly disabling exclusive full screen support, since I'm not sure why full screen exclusive mode makes any sense in the context of mpv/libplacebo. (If anything, disabling full screen exclusive mode ought to make going in and out of fullscreen smoother) That said, though, full screen exclusive might be required for HDR output? |
I didn't quite understand what it did from the comments which is why I was asking about it in-case something similar could be done for MPV.
I'm not sure of the advantages but I was hoping maybe it would offer better Vsync timing (currently it's really poor in comparison to DX). I can imagine there are quite a few people using dedicated media PCs who don't care much about leaving the app. If there is some advantages then an option to run in exclusive could be useful but I don't think it should be default. I don't have a HDR monitor to test unfortunately. |
Lack of vsync timing is awell-known vulkan issue that is still unresolved 5 years after Vulkan's release. Fullscreen exclusive mode does not help here. |
Oh thanks but wow... is it still not solved with 1.2.175 which implemented VK_KHR_video_queue (I haven't looked at it and I don't think AMD supports that yet anyway) ? |
@haasn can mpv have similar to d3d11 option(d3d11-exclusive-fs) for vulkan? |
VK_EXT_full_screen_exclusive seems to be the right extension to poke at for this. |
My amd gpu: pro 5600m Only set |
@aufkrawall @hooke007 can you help test https://code.videolan.org/videolan/libplacebo/-/merge_requests/308 please? |
I unfortunately don't have a test system with Radeon at my disposal. I'd test Nvidia and Intel though if there were a test build. |
@haasn Would it be possible to get an option to force enable it? |
What do you need it for? Can you explain the use case? |
I don't have a "need" for it but as you suggested earlier it might be needed for HDR. It might provide some benefits now or in the future but without the option for users to even test it without compiling themselves I have a feeling we'll never know. |
From testing it appears that this is not the case, and from discussion with other developers it seems that fullscreen exclusive mode in general is something that's on its way out / considered deprecated. |
Important Information
-mpv-x86_64-20200816-git-7f67c52
-Windows 10 2004
-shinchiro SF repo
Reproduction steps
Play any video with
--gpu-api=vulkan
and enter fullscreenExpected behavior
Playback should continue normally in fullscreen
Actual behavior
Playback freezes and shows the last frame from before entering fullscreen (playback returns normally after switching back into windowed mode). mpv fullscreen has always been rather problematic on AMD Windows, i.e. slow switching. But of course it always freezing makes it unusable. The AMD driver seems to treat it as "exclusive" fullscreen, and unfortunately no mpv config option seems to help to avoid that.
Log file
output.txt
Sample files
Can be any video.
The text was updated successfully, but these errors were encountered: