pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

[BUG]: monitor refresh rate is constantly jumping causing crazy flickering when 'skip duplicated frame' is off on VRR monitor

Open soredake opened this issue 1 year ago • 37 comments

Describe the Bug

When I play persona 3 fes, on certain parts of the game (in school for example) my monitor starts flickering because of constant refresh rate change, if I move my camera flickering getting worse, flickering happens only in fullscreen (if I leave fullscreen flickering stops), my emulator settings in almost untouched, only setting that I changed is resolution, I set it to 1080p. If I enable 'skip duplicated frames' setting flickering is gone because refresh is stable (30 triple with LFC to 90), if I disable VRR for emulator but leave duplicated frames on flickering does not happen too.

My videocard is RX 560.

Video showing refresh rate jumping https://www.youtube.com/watch?v=3YaCYaExvKc and flickering on my monitor https://youtu.be/nsRbgPuyCD0

Reproduction Steps

  1. Own a monitor with VRR and LFC (basically any monitor with freesync premium, for example) which is affected by freesync flickering problem (i own HP X24ih)
  2. Enabled refresh rate counter in monitor settings (if your monitor have such option)
  3. Start persona 3 fes USA version.
  4. Go to specific location in school: Option 1) You can load my save made on 06.03.2024 persona 3 fes usa vrr flicker bug save states.zip Option 2) Or you can load save in game (use default selected) pcsx2 memcards with p3fes flicker save.zip, then go to specific location, switch emulator fullscreen and start moving camera fast (video example of what needs to be done: https://www.youtube.com/watch?v=LZpy-jwccgg) Option 3) Just launch the game, it will flicker after some time of playing intro videos.
  5. Monitor will start to flicker (if your monitor is affected by this problem).

Expected Behavior

Monitor refresh rate shouldn't jump that much when emulator/game frame rate is stable ~29.97

PCSX2 Revision

v1.7.3082 (qt build)

Operating System

Windows 11

If Linux - Specify Distro

No response

soredake avatar Jul 16 '22 14:07 soredake

What graphics api are you using? Are you using QT or WX?

ps1freak26 avatar Jul 16 '22 16:07 ps1freak26

It also happened to me (on both WX and Qt) but in God Hand (30 fps game).

When I used software mode I had no flickering, but in hardware mode with Vulkan ( on borderless windows as it doesn't have an exclusive full screen mode) I did have flickering. I also tested D3D11 in exclusive fullscreen mode but it didn't help. Only enabling 'skip duplicated frame' (or disabling VRR altogether) fixed it.

I'm on Windows 10 and using RTX 3080, driver version 512.95 (though it happened across multiple driver versions). Monitor is Odyssey G7.

GiladN1 avatar Jul 16 '22 16:07 GiladN1

For WX vrr likes to work when vsyncwindowflag is enabled but the setting is in the PCSX2_ui.ini file and it works for all renderers. As for QT there is no such option and DX11 and DX12 are the most stable with vrr. For opengl and vulkan going to the nvidia control panel and adding the qt version of pcsx2 then setting monitor technology to fixed refresh should get rid of flickering but vrr still won't work.

ps1freak26 avatar Jul 16 '22 16:07 ps1freak26

What graphics api are you using? Are you using QT or WX?

It set to auto, but i tried ALL graphic api available, i have RX 560 if that matters.

soredake avatar Jul 16 '22 16:07 soredake

When PCSX2 was still using WX I actually went tried setting vsyncwindowflag to both enabled and disabled, but it didn't change anything. Software mode is the only renderer I could use with VRR without suffering from flickering.

I also followed your suggestion to add PCSX2-QT exe to Nvidia CP and use fixed refresh, it works but of course VRR is no longer enabled. Only 'skip presenting duplicated frames' gets rid of flickering when VRR is enabled, but the setting description says it might add input lag.

GiladN1 avatar Jul 16 '22 17:07 GiladN1

For amd you can add the program then set freesync to off to get rid of flickering. QT and WX react differently to vrr the WX version should look like this. image

ps1freak26 avatar Jul 16 '22 17:07 ps1freak26

@ps1freak26 i know about this, thanks anyway

soredake avatar Jul 16 '22 17:07 soredake

Wx is going away eventually, can you reproduce this on Qt or no?

MrCK1 avatar Jul 16 '22 18:07 MrCK1

Not the OP, but I had identical results across both Wx and Qt. enablevsyncwindowflag in Wx didn't change anything, and in both Qt and Wx all hardware backends had flickering with VRR enabled. Only software mode (both Wx and Qt) was devoid of flickering, with the monitor refresh rate counter also being more stable.

GiladN1 avatar Jul 16 '22 18:07 GiladN1

Wx is going away eventually, can you reproduce this on Qt or no?

I'm using qt build.

soredake avatar Jul 16 '22 18:07 soredake

Have you tried MTVU on Vs off? The default changed to on recently but it always gives me more inconsistent frame times which results in micro stutter. Visible as flicker with a VRR display.

BreakPoints avatar Jul 25 '22 01:07 BreakPoints

@BreakPoints tried on/off with latest qt builds, still flickering.

soredake avatar Jul 25 '22 09:07 soredake

How do you mean "flickering" do you mean the brightness changing or the monitor flickers off?

if the brightness is changing: This is common with VA panel monitors, VRR really sucks on them (I had it on mine, replaced it with IPS panels, no longer an issue) if the monitor is flickering off, it's likely going outside the VRR rate and it's unhappy. If you have a a 144hz monitor (or something) you might find by default VRR is limited to like 100-144hz, but there might be an "ultra" mode or something in the monitor settings, which allows it to do 35-144hz. Idk why this isn't on by default, but it's a thing.

refractionpcsx2 avatar Jul 25 '22 09:07 refractionpcsx2

That's exactly what I'm talking about in my case, got a VA with 48-144Hz freesync range but wild changes create brightness flicker. It's not limited to VAs, probably just more noticeable due to the higher native contrast, this has been reported on LG OLEDs with VRR mode engaged.

It's worst at inconsistent low framerates, likely repeatedly engaging and disengaging frame doubling/tripling to stay within VRR range, exacerbating the large refresh changes even more. MTVU creating said stutter is a separate issue but it's surprising that it's now the default, I'm unable to get consistent performance on it with an i7 9700k.

BreakPoints avatar Jul 25 '22 14:07 BreakPoints

One thing maybe worth checking, is set your windows performance plan to high performance. There was a period recently that intel CPU's kept powering down causing really inconsistent performance. Not sure if that is the issue you're experiencing, but worth checking, but I know the frametimes on PCSX2 are pretty consistent, generally speaking (if the framelimiter is on)

refractionpcsx2 avatar Jul 25 '22 15:07 refractionpcsx2

can you give any data that leads you to believe that MTVU creating said stutter ?

Mrlinkwii avatar Jul 25 '22 15:07 Mrlinkwii

One thing maybe worth checking, is set your windows performance plan to high performance.

I'll give that a try, thanks

can you give any data that leads you to believe that MTVU creating said stutter ?

Happy to provide data, will have to be later in the day (UK time) when I'm off work

BreakPoints avatar Jul 25 '22 15:07 BreakPoints

How do you mean "flickering" do you mean the brightness changing or the monitor flickers off?

I don't really know how to describe it, but i think it's brightness changing, somewhat similar i found on youtube https://youtu.be/xmBpaDXidpo

if the brightness is changing: This is common with VA panel monitors, VRR really sucks on them (I had it on mine, replaced it with IPS panels, no longer an issue)

My monitor is IPS.

if the monitor is flickering off, it's likely going outside the VRR rate and it's unhappy.

My VRR range is 38-144.

soredake avatar Jul 25 '22 15:07 soredake

My VRR range is 38-144

I would double check your monitors mode on that. Mine was advertised as that also, but by default only did 100-144hz, I found out after searching the web wondering why I was getting flickering problems.

refractionpcsx2 avatar Jul 25 '22 15:07 refractionpcsx2

My VRR range is 38-144

I would double check your monitors mode on that. Mine was advertised as that also, but by default only did 100-144hz, I found out after searching the web wondering why I was getting flickering problems.

I checked with CRU, it's 38-144, and as i said earlier, when i enable 'skip duplicated frames' refresh rate is tripled from 30.

soredake avatar Jul 25 '22 15:07 soredake

Forgot to said, my monitor is FreeSync Premium, i have LFC.

soredake avatar Jul 25 '22 15:07 soredake

Currently on Nvidia 516.19, VRR as a concept is nothing short of tragic on my end. Using it on windowed applications, with a Gsync (not FreeSync) certified, IPS monitor, results in one of two outcomes:

  1. Seizure-inducing brightness flicker in all scenarios, regardless of refresh rates
  2. Framerate artificially plummets to ~5-10 FPS when the window is in focus

Maybe there is something insidious hiding in PCSX2 that needs rooted out but this smells a lot more like Nvidia just blew up their own drivers. Again.

RedPanda4552 avatar Jul 25 '22 15:07 RedPanda4552

Currently on Nvidia 516.19, VRR as a concept is nothing short of tragic on my end.

I'm on 516.59 (RTX 2080) and don't have those issues, I don't have g-sync set to windowed applications, though, only fullscreen. Still works for most borderless fullscreen programs.

BreakPoints avatar Jul 25 '22 15:07 BreakPoints

Currently on Nvidia 516.19, VRR as a concept is nothing short of tragic on my end.

I'm on 516.59 (RTX 2080) and don't have those issues, I don't have g-sync set to windowed applications, though, only fullscreen. Still works for most borderless fullscreen programs.

Perhaps a 3000 series issue then - I have a 3080 Ti. Nvidia's been having a kind of rough go at it, not quite to the level of AMD who have been getting BTFO'd in the driver wars for an uncountable number of years now, but the 3000 series cards have had a few incidents now where for one or two driver releases something is just inexplicably busted.

RedPanda4552 avatar Jul 25 '22 15:07 RedPanda4552

can you give any data that leads you to believe that MTVU creating said stutter ?

So I think I've narrowed it down to thread contention/scheduling. I'm only able to reproduce using the SW renderer with 2 or more threads. DaH2 shows it pretty bad but I'm also able to reproduce in Midnight Club 3 DUB Edition Remix with 3 SW threads.

3 SW Threads + No MTVU: 3 Thread + No MTVU

3 SW Threads + MTVU: 3 Thread + MTVU

2 SW Threads + No MTVU: 2 Thread + No MTVU

2 SW Threads + MTVU: 2 Thread + MTVU

BreakPoints avatar Jul 25 '22 16:07 BreakPoints

Setting the minimum processor state to 100% in the Windows power settings fixes the issue, which is what the high performance power profile is doing. Looks like Intel really likes to aggressively clock down during these workloads.

This also fixes unstable frametimes in HW renderers across the board for me. Go figure.

BreakPoints avatar Jul 25 '22 16:07 BreakPoints

I've tested "max performance" mode with my ryzen, no changes, and frametimes is pretty stable for me (no more than 1ms difference)

soredake avatar Jul 25 '22 17:07 soredake

Ryzens aren't really affected by that problem, it's only intel CPU's from like 6000-9000 series, afaik.

refractionpcsx2 avatar Jul 25 '22 19:07 refractionpcsx2

Does anyone know how monitor decide what refresh rate to choose? Cause this flickering can happen in other games/emulators, media player, browser, even on desktop sometimes all while msi afterburner overlay shows pretty consistent framerate (30/60/144), but monitoring stats in MPV shows that timings are jumping constantly (maybe that's what drivers/monitor uses to switch framerate?)

soredake avatar Oct 30 '22 12:10 soredake

I had this same issue with Persona 3 FES. The monitor's reported refresh rate starts jumping up and down from 46 Hz to 98 Hz. It's inside VRR range but the fast/big changes causes the flicker. The only thing that seems to fix it is checking the "Skip Presenting Duplicate Frames" option in the Graphics/Advanced tab.

Changing to software doesn't stop issue, but the jumps in refresh rate are less drastic (49Hz-71Hz) so it doesn't flicker as much.

I tested other games I own (WEPES 2007, Klonoa 2, NBA Street 2) using default settings, but they sit comfortably at 59-60 Hz. So no flickering.

KawaiiDinosaur avatar Jan 29 '23 22:01 KawaiiDinosaur