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

[BUG]: Stutter/Frame pacing issues in multiple games #7485

Closed
ANK-dev opened this issue Nov 26, 2022 · 27 comments
Closed

[BUG]: Stutter/Frame pacing issues in multiple games #7485

ANK-dev opened this issue Nov 26, 2022 · 27 comments

Comments

@ANK-dev
Copy link

ANK-dev commented Nov 26, 2022

Describe the Bug

When playing pretty much any game I suffer from constant frame pacing issues.

System specs:


  • CPU: AMD Ryzen 7 5700G @ 3.8GHz
  • RAM: 32GB DDR4-3200
  • GPU: AMD Radeon RX 570 8GB

image


This issue is a lot more prominent when running in full screen (borderless) with the Vulkan renderer but can happen with any other (OGL, D3D12, D3D11). I've verified my findings using MSI Afterburner with RTSS.

Reproduction Steps

I've recorded footage from two games to show as an example.

  • Klonoa 2 - Lunatea's Veil:
2022-11-26.00-09-31.mp4

The most consistent setup for this example was to go to the "Chamber o'Horrors" stage and go in and out
of the first door. After some tries, the frametime graph begins to show spikes and the movement becomes choppy indicating a frame pacing issue. Toggling the software renderer with the <F9> key on-and-off seems to clear the issue [1:40-1:50, 2:05-2:27, and many more].

At [6:00] I show that if I unlock my framerate cap when the frame pacing issue is occurring my max FPS is very low (~80 FPS). Soon after, I toggle the software renderer on-and-off, which clears the inconsistent frame pacing, followed by uncapping my framerate. This yields much better performance (~287 FPS).

  • Dragon Ball Z - Budokai Tenkaichi 3:
2022-11-26.16-18-25.mp4

Booting the game and starting a training match is enough to result in plenty of stutter, as shown by the frametime graph [0:55]. Exiting full screen seems to clear the issue [1:28]. Toggling "Spin GPU During Readbacks" in the "Graphics" > "Rendering" section then going into full screen relieves the issue somewhat [1:35]. At [2:15] I show that toggling off "Spin GPU During Readbacks" and going back into full screen results in increased stutter. Soon after [2:25], I toggle the software renderer on-and-off which clears all issues, resulting in a perfectuly flat frametime graph and very smooth gameplay.


Sometimes when testing, simply toggling the software renderer on-and-off once might not be enough to result in smooth frame pacing. A combination of several toggles of the software renderer, framerate limiter and graphics settings might be needed to get the desired result. I have not found the cause for this or any way to consistently reproduce.

Expected Behavior

The games should run smoothly without any frame pacing issues given my system specs are much higher than the recommended ones.

PCSX2 Revision

v.1.7.3634

Operating System

Windows 11

If Linux - Specify Distro

No response

CPU

AMD Ryzen 7 5700G

GPU

AMD Radeon RX570 8GB

GS Settings

Graphics:

  • Enable Widescreen Patches: ON
  • VSync: ON
  • Enable No-Interlacing Patches: ON
  • Show Overscan: ON
  • Renderer: Automatic -> Vulkan
  • Internal Resolution: 3x Native (~1080p)
  • Anisotropic Filtering: 16x
  • Post Processing - FXAA: ON

Emulation Settings

Emulation:

  • Optimal Frame Pacing: ON
  • Scale to Host Refresh Rate: ON

GS Window Screenshots

No response

Logs & Dumps

No response

@ANK-dev ANK-dev added the Bug label Nov 26, 2022
@MrCK1
Copy link
Member

MrCK1 commented Nov 26, 2022

Based on the Klonoa video, you are bouncing over the framelimiter (59.94) which could be causing your uneven frame pacing. Can you try without Optimal Frame Pacing and Scale to Host Refresh Rate options?

Please post your settings from the Emulation and Graphics tabs as well
image

@ANK-dev
Copy link
Author

ANK-dev commented Nov 26, 2022

Sure. These are my settings as I had then in my original videos.
image
image
image
image
image
image


I've disabled the "Optimal Frame Pacing" and "Scale to Host Refresh Rate" as asked and recorded a new video.

2022-11-26.18-35-27.mp4

As you can see the problem is still present and appears quite nondeterministic in nature, only triggering after several tries [2:44].

@ghost
Copy link

ghost commented Nov 26, 2022

I Can confirm this issue.

@KawaiiDinosaur
Copy link

Same on Linux

Screenshot_20221127_185646

@mirh
Copy link

mirh commented Dec 13, 2022

Shouldn't you disable vsync and use the way lighter native resolution to test all these things?

@ANK-dev
Copy link
Author

ANK-dev commented Dec 13, 2022

Still happens at native resolution and vsync off.
Screenshot (44)

@ps1freak26
Copy link

@ANK-dev Try disabling the speed limiter and setting 60 framerate limit in rivatuner with vsync on.

@ANK-dev
Copy link
Author

ANK-dev commented Dec 14, 2022

Did the rivatuner thing; as usual it follows the same pattern: weird frame pacing -> turn on software renderer -> turn off software renderer -> frame pacing is fixed.

Funny enough, in attempting to record footage of this with OBS, as soon as I hit the record hotkey, the frame pacing issue gets fixed. Don't know if this could be a GPU power saving mode issue or what else.

2022-12-13.22-02-35.mp4

Happens right at the start of the video. This is with the speed limiter disabled and rivatuner set to 60fps

@mirh
Copy link

mirh commented Dec 14, 2022

Try a diagnostic boot from msconfig (please take note it's gonna disrupt your windows password settings)
Try the high performance power plan
And I guess you could try to disable your dGPU and just run on the integrated for the lulz

@ANK-dev
Copy link
Author

ANK-dev commented Dec 15, 2022

Two findings:

  • Locking the GPU Core and Memory frequencies for PCSX2 seems to have solved the random slowdowns I was experiencing as well as most of the incorrect frame pacing occurrences.

image
image

  • There's something funky going on with the FXAA option... Take a look at the frametime graph on the top right as I toggle it.
2022-12-15.20-15-29.mp4

Also, incorrect frame pacing seems to occur in the software renderer occasionally, maybe it's related to the CPU frequency?

@ps1freak26
Copy link

I don't have frame pacing issues with opengl and vulkan on wx there should be a qt banner. I have wait for vsync on refresh disabled and EnableVsyncWindowFlag enabled on the pcsx2_ui.ini file. Gsync is enabled and qt doesn't like my monitor reporting 60hz it always reports 75hz on qt with opengl and vulkan in the monitor information section which makes games stutter alot.

@ANK-dev
Copy link
Author

ANK-dev commented Dec 21, 2022

@ps1freak26 wxWidgets is going away soon. Do you have problems on the latest build of Qt?

@ps1freak26
Copy link

Yes I still have frame pacing issues with PCSX2 QT. I use WX if I need to use the vulkan render. I use QT if I need to use software and dx12 hardware. I tested dolphin with qt6 and it didn't have any of the issues expect vulkan borderless working with gsync but opengl exclusive and borderless have perfect frame pacing and gsync compatibility. Vulkan with exclusive mode has perfect frame pacing and gsync compatibility.

@Context6016
Copy link

I think I managed to fix the issue by adding pcsx2 to nvidia CP and changing "vulkan/openGL present method" to "prefer layered on DXGI swapchain" no idea what the AMD equivalent option is though.

@ps1freak26
Copy link

DXGI swapchain on is smooth when the frame limiter is off and it's stuck at 75 instead of 150 (250% fast forward speed) but when I turn it on the frame limiter still stutters alot. It gets unstuck when it's minimized or the window is not in focus. Rivatuner capped at 60 still stutters.

@Context6016
Copy link

@ps1freak26 I'm not using a VRR display so I can't comment on that, but on my end I run PCSX2 in windowed mode with speed limiter and vsync enabled (no RTSS).
From an hour or so gameplay testing with vulkan renderer I haven't had any issues with frame pacing anymore after I changed that setting.

@refractionpcsx2
Copy link
Member

refractionpcsx2 commented Jan 5, 2023

I was just looking in to this with Dragonball Z BT 3 and I do kinda see some frame jitter, but not as bad as described in this thread, and disabling hardware readbacks got rid of it almost completely.

If that is your issue, then there's not a lot we can do about it, you can adjust that setting in the per game graphics->advanced settings.

@refractionpcsx2
Copy link
Member

Can you also try setting your renderer to OpenGL to see if that helps in the other games? DBZ I'm pretty confident is mostly a GS Download problem, but the others don't suffer from that, iirc.

@Context6016
Copy link

I'm 99% positive it's either a windows or driver issue, because it also happened to me on RPCS3 with vulkan renderer.
Changing the setting I mentioned above also fixed it for RPCS3.

@JordanTheToaster
Copy link
Member

It's fine for me even with VK at 8x with high blending and readbacks going.

image

@refractionpcsx2
Copy link
Member

refractionpcsx2 commented Jan 10, 2023

This is only since recent changes merged, this hasn't always been the case.

Edit: The changes have been in there for a while, but nobody really knew about it, and it wasn't on :P But It was improved and made default on recently.

@ps1freak26
Copy link

ps1freak26 commented Jan 12, 2023

#7807 Fixed the frame pacing in vulkan and setting power management mode in the nvidia graphics control panel to prefer maximum performance fixes Gsync with Vulkan. When fast forward is set to 250% I still can't get 150 fps at 75hz it's locked to 73-75 with vulkan.

@ANK-dev
Copy link
Author

ANK-dev commented Feb 7, 2023

Closing this issue. It seems like the #7807 + manually setting the GPU and VRAM clock speed (to fix AMD's buggy Vulkan drivers) have solved the problem.

@ANK-dev ANK-dev closed this as completed Feb 7, 2023
@ps1freak26
Copy link

Clean install of the Nvidia drivers fixed frame rate locked at the refresh rate when fast forward is on.

@mirh
Copy link

mirh commented May 5, 2023

I wonder if it couldn't be that you had windowed G-sync enabled...

@ps1freak26
Copy link

I had enabled for windowed and full screen mode selected.

@mirh
Copy link

mirh commented May 7, 2023

Then you being limited is pretty much to be expected... Ironically enough, if the game window loses active focus, it would get unlocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants