libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.22k stars 1.82k forks source link

Swap Interval Not Working In Fullscreen On Nvidia Drivers (Windows 10) #2193

Closed Awakened0 closed 6 years ago

Awakened0 commented 9 years ago

I upgraded my video drivers today and found that setting my swap interval to 2 no longer fixes video stuttering on my 120hz monitor. On my 60hz TV, setting it to 2 doesn't make it run at half speed anymore either. It acts as if it was still set at 1.

In my console log I see a few cases of: RetroArch [INFO] :: [WGL]: wglSwapInterval(2) RetroArch [WARN] :: [WGL]: wglSwapInterval() failed.

Full log here: http://hastebin.com/oduvasajoz.tex

Not sure if this problem can only be fixed on Nvidia's end or not. I made sure there weren't any forced vsync or triple buffer settings enabled in my driver control panel. I was using the 353.62 drivers before, where it worked.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27079284-swap-interval-not-working-in-fullscreen-on-nvidia-drivers-windows-10?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github).
Awakened0 commented 9 years ago

I found out it still works in window mode, but not windowed fullscreen or true fullscreen. If I force vsync on from the Nvidia control panel, it stops working in windowed mode too. Maybe the driver is forcing it's own vsync method in fullscreen modes...

inactive123 commented 9 years ago

Unfortunately I have no Windows 10 box setup, and none of my laptops have any kind of Nvidia GPU in them.

Awakened0 commented 9 years ago

fr500, you don't happen to have a machine with an Nvidia card and Win10 to try it on, do you? The drivers are the latest WHQL.

Awakened0 commented 9 years ago

:P

I'm not sure if it's related, but I also get a crash if I try launching with the d3d driver selected in my cfg. Same result in both the 1.2.2 point release and the nightly. Log here: http://hastebin.com/akefahuzab.tex

Both gl and sdl modes don't crash like that. I'm pretty sure d3d worked on the 353.62 drivers. Dolphin's d3d driver still works fine, so it's not like everything that uses d3d is broken. I'll probably wait for the next driver and see if swap interval is fixed and if not roll back to 353.62.

Awakened0 commented 9 years ago

In dxdiag all tabs say "No Problems Found" and all Direct X Features under Display are enabled.

Awakened0 commented 9 years ago

I installed the 355.82 drivers to see if swap interval worked there, but no. Then I installed the 353.62 ones again and it does indeed work again. I noticed they have 355.98 drivers available for Win7 if fr500 feels like testing it on his Nvidia machine.

Awakened0 commented 9 years ago

Comparing logs, it looks like on 353.62 swap interval fails at first, but then Vsync switches off and on a few times until it works vs. just failing on 355.98:

353.62 (http://hastebin.com/exaxumujay.tex): RetroArch [INFO] :: [GL]: VSync => on RetroArch [INFO] :: [WGL]: wglSwapInterval(2) RetroArch [WARN] :: [WGL]: wglSwapInterval() failed. RetroArch [INFO] :: [GL]: VSync => off RetroArch [INFO] :: [WGL]: wglSwapInterval(0) RetroArch [INFO] :: [GL]: VSync => on RetroArch [INFO] :: [WGL]: wglSwapInterval(2) RetroArch [INFO] :: [GL]: VSync => off RetroArch [INFO] :: [WGL]: wglSwapInterval(0) RetroArch [INFO] :: [GL]: VSync => on RetroArch [INFO] :: [WGL]: wglSwapInterval(2) RetroArch [INFO] :: [GL]: VSync => off RetroArch [INFO] :: [WGL]: wglSwapInterval(0) RetroArch [INFO] :: [GL]: VSync => on RetroArch [INFO] :: [WGL]: wglSwapInterval(2)

355.98 (http://hastebin.com/oduvasajoz.tex): RetroArch [INFO] :: [GL]: VSync => on RetroArch [INFO] :: [WGL]: wglSwapInterval(2) RetroArch [WARN] :: [WGL]: wglSwapInterval() failed.

Awakened0 commented 9 years ago

Nvidia released 358.50 drivers today and it fixed swap interval. No yelling required :)

Awakened0 commented 8 years ago

I've been having this problem again lately. Interestingly, when swap interval isn't working in windowed fullscreen and true fullscreen, I can get it to work again if I restart. Shutting down and starting up again doesn't work; it has to be a restart.

After some testing, what breaks it is fullscreening a Youtube or other site's video in a web browser. Both Chrome and Edge will do it. I thought it was only HTML5 videos (Youtube or Twitch), but I got it to happen with a Giantbomb flash video as well. It doesn't always break after the first time I fullscreen a vid, but after two or three times, the next time I run RetroArch swap interval won't be working in fullscreen. It won't work again until I restart. I tried fullscreening a locally stored .mkv with mpv video player a few times and that wouldn't break it.

It didn't start happening after a video driver update. I had been on Nvidia's 362.00 drivers for awhile and I only noticed the problem after updating from a RetroArch 2016-04-05 nightly to one from 2016-05-06. But I don't know how that could have caused it; I tested going back to the older nightly and the same behavior of having to restart to fix swap interval after fullscreening a web video happens. I didn't change any video settings from before I had the problem either.

I'm on the 365.10 video drivers now, but they didn't fix anything. I checked and found the drivers have a setting entry for retroarch.exe. They only thing it does by default is turn off threaded optimization. I tried turning it on, but it didn't help.

I made some verbose debug logs from when it works after a restart and after it breaks, but they look pretty much identical:

After restart: http://hastebin.com/goqesumuhu.tex After breaking it with a fullscreened web video: http://hastebin.com/rewipudege.tex

I know this is probably a problem with Nvidia's driver or Windows 10, but maybe if someone else can reproduce it they can figure out a workaround. It's strange to me that it always works fine in windowed mode, but not windowed fullscreen. Usually there's not much of a difference between them.

Awakened0 commented 8 years ago

Yeah, as of the latest nightly this still happens. Drives me nuts. I'm on the 372.54 Nvidia drivers, which is two updates behind, so it's possible one of those fixes it. But I'm not getting my hopes up.

Vulkan doesn't have this issue with it's implementation of swap interval. Too bad I get forced refresh rate changes and no fast forward when using that.

Awakened0 commented 7 years ago

A workaround for this I found is to go into Chrome's settings and turn off "Use hardware acceleration when available". It's not great though since the scrolling is choppy in Chrome with that off. Turning off video decoding acceleration in chrome://flags while leaving the other setting on still causes the bug.

Awakened0 commented 6 years ago

I've worked around this by getting a Gsync monitor, but even on a fixed 120hz display I could also work around it by using the Vulkan driver. No one else could reproduce this with GL like I could, so I'll close this.