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

Stuttering in all games in GIT builds (HW and SW affected) #1437

Closed
RAZORXKHARA33 opened this issue Jun 29, 2016 · 271 comments

Comments

Projects
None yet
@RAZORXKHARA33
Copy link

commented Jun 29, 2016

I've been following the GIT builds for PCSX2 for roughly a year now (since accurate blending was introduced in GSOGL), and every GIT build after the 1.4.0 stable release that I have used has had problems with stuttering. The emulator reports 100% speed and 60 FPS and the game timers and physics run at full speed, but the video is very choppy. Normally, this would only happen when I'm recording with Nvidia Shadowplay or playing in windowed mode, but now it happens in fullscreen mode and windowed mode. Switching to software rendering does not fix the issue. Because of this, I'm stuck on 1.4.0 stable (which works pretty well but lacks fast accurate blending and some other fixes that are very useful, especially in the Gran Turismo series). Also, in the most recent builds with the large framebuffer option included, Gran Turismo 3 and 4 both cause massive slowdowns during races and replays at anything higher than 2x native resolution. This never happened in stable release 1.4.0 nor any of the GIT builds leading to it. My settings are as follows:

EE Round: Chop/Zero
EE Clamping: Full
VU Round: Chop/Zero
VU Clamp: Extra+Preserve Sign
Vsync is disabled in Core GS options, enabling does not fix visual stutter.
All speedhacks enabled except for Fast CD/DVD access, EE cyclerate and VU cycle stealing
No manual gamefixes enabled
--GS Plugin settings:
Adapter: Nvidia GeForce GTX 1080
Renderer: OpenGL (Hardware)
Interlacing (F5): Auto
Allow 8-bit textures: ON
Large Framebuffer: ON
Internal Resolution: 3x Native
Texture Filtering: Bilinear (PS2)
CRC Hack Level: Partial (OpenGL Recommended)
HW Hacks: None (tried safe accurate blending, only caused slowdowns)
Accurate Date: ON
Blending Unit Accuracy: High (Recommended high-end PC)

PC Specs:
MoBo: Gigabyte GA-Z97X-Gaming 7
CPU: Intel Core i7 4790K
RAM: 32GB 1600 MHz
GPU: Nvidia GeForce GTX 1080 FE
Drive where PCSX2 and OS load from: Samsung 950 PRO 256GB NVMe M.2 SSD
Drive where .ISO files load from: WD Caviar Blue 1TB 7200 RPM HDD

As I said before, this has only started happening in GIT builds for 1.5.0. This does not affect stable 1.4.0 or any GIT builds that led to that stable release.

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2016

Try to find the first build that got the issue http://buildbot.orphis.net/pcsx2/index.php?m=fulllist

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jun 29, 2016

Last build that didn't exhibit the issue was compiled on 2-28-2016. The build is v1.5.0-dev-385-gdb379ad. The next 2 available builds (v1.5.0-dev-401-ge57a75a AND v1.5.0-dev-403-g4b00ec9) will not even boot, and the next build after 403 (v1.5.0-dev-405-g8839632) is the first available build that exhibits the issue, and it was compiled on 2-29-2016. Hope this helps!

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2016

MTVU on/off ? The issue seems related to atomic ! Is hyperthreading enabled on your CPU?

Do you have the issue in VS2013 build ? https://ci.appveyor.com/project/gregory38/pcsx2/branch/master/job/owyu3dhusr0hcbgx/artifacts

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jun 29, 2016

MTVU on/off made no difference, and hyperthreading is enabled on my CPU. I will test the VS 2013 as soon as a replay finishes recording.

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2016

Ok. Could you do a test with HT disabled too ?

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jun 29, 2016

Tested the VS 2013 build, still very bad stuttering, and disabling HT made no difference.

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jun 30, 2016

Hum, do you have the issue if you take an old GSdx with a new PCSX2 binary ?

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jun 30, 2016

Latest build gets rid of the bad slowdowns that I described when Large Framebuffer is enabled, but the stuttering is still there, even with GS plugins from build 385 (which was the last build without the visual stutter). Still stuttering even with GS plugins from stable 1.4.0.

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jun 30, 2016

Ok. Would you able to compile the plugin on your side with some patches ?

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jun 30, 2016

I'm not experienced with that kind of thing, unless I'm just overthinking something. Are you saying that you have everything necessary for the plugin (including the patches) and all I have to do is compile it? I'm bad with this kind of thing unless it's something simpler than I think it is.

@tabnk

This comment has been minimized.

Copy link

commented Jun 30, 2016

Interesting :). Was wondering what cause the stuttering in GT4.

Good finding.

@tabnk

This comment has been minimized.

Copy link

commented Jul 1, 2016

Btw GTX 1080 FE can easily go 5x native for GT4 :)

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jul 1, 2016

Wrong. I use GSOGL and can only get to 3x native (1080p) before I get slowdowns. Maybe it can in GSDX11/10, but not OGL. I use high accuracy blending so that takes a lot of GPU time (the accuracy is much greater than GSDX11/10 has ever achieved, so it's more demanding from a graphical emulation standpoint.

@tabnk

This comment has been minimized.

Copy link

commented Jul 1, 2016

Unexpected. A GTX 1080 still cannot get above 3x native. Even high accuracy blending should not affect much. Somethings wrong here.

@gregory38 gregory38 self-assigned this Jul 1, 2016

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2016

It isn't a forum ;) Blending is very costly on the CPU and it also bypass the ROP to do the blending in shader so yeah it could be heavy. Anyway, there are various optimization available to reduce GPU load (I spent most of my time on the CPU side).

Back on the issue, I'm currently thinking what is the best solution to fix the bug. I will try to create a branch with partial atomic support. I need to find which atomic impact the perf. And then see if relaxed atomic can improve the perf. I will ping you when the branch is ready.

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jul 1, 2016

Sounds great! I did let this start to become a forum-esque thread by responding to tabnk the way that I did, so my b.

gregory38 added a commit that referenced this issue Jul 1, 2016

Revert "Common: delete most of the deprecated atomic API"
This reverts commit 610bf8a.

In order to bisect issue #1437

gregory38 added a commit that referenced this issue Jul 1, 2016

Revert "MTGS: port to std::atomic"
This reverts commit 5a84a0d.

Bisect #1437
@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2016

Could you test this version (MTVU on/off)
pcsx2-v1.5.0-dev-927-gd525573-windows-x86.7z.zip

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jul 1, 2016

Just tried, still stuttering. An easy way to tell if there will be stuttering is to set interlacing to bob-tff and look at the PlayStation 2 logo that appears during startup. Normally it will bob up and down at a constant pace. However, if there is stuttering, then it will bob up and down sometimes sticking to the top or bottom of its range of movement. It's a bit hard to explain, but if you do this in stable 1.4.0 and the latest GIT builds, you should be able to deduce what I mean. I will note that the stuttering isn't quite as bad as before, but it's still very noticeable.

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2016

Could you test this one, it contains half of the atomic stuff (but it ought to be good)
https://ci.appveyor.com/project/gregory38/pcsx2/build/1.1296-atomic-regression-test-v2/job/5j4bvj9v70nky6f6/artifacts

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jul 1, 2016

Stuttering is gone with this build. I think there needs to be a lot of graphical optimization in general, though. I tested with Gran Turismo 3: A-Spec in the Polyphony Digital Cup Round 9 (Grand Valley Speedway II) and the slowdowns were horrendous. It was always a tough track to render (especially with high-accuracy blending), but the slowdowns were especially bad, even with fast accurate blending. Something must be up with the way that GSdx handles the rendering of light sources in the GT series (even worse in GT4 with texture cache issues and such). Anyways, mini-rant over, this build does not have the stuttering. So the issue was related to atomic?

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2016

Actually it is an old build but with only half of the atomic update. So it remains at least 1 bad commits on the ~5 remaining atomic change. It reduces a bit the scope. I will try to revert 2 commits on the previous branch tomorrow.

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jul 1, 2016

Ok. Sounds great! I was actually getting worse slowdowns with this build but that was because I had MTVU disabled. Re-enabling it didn't reintroduce stutter and brought speed back up to what it was in stable 1.4.0.

gregory38 added a commit that referenced this issue Jul 2, 2016

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2016

Ok, one more please (available in 10-15 minutes)
https://ci.appveyor.com/project/gregory38/pcsx2/build/job/f0w0w2cta761u3c9/artifacts

Again could you test the stuttering with both MTVU enabled and disabled. Thanks you.

Edit: by the way, I hope you have some free time available because I will need various test to check the fix implementation ;)

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Jul 2, 2016

I should be free for a while today. I can't get a hold of the build you just posted, though.

@P8M3

This comment has been minimized.

Copy link

commented Aug 11, 2017

I'm not sure about everything that has been said in this thread (its is very long) but if I'm not wrong the cause of the stuttering is being pinned on Nvidia drivers and GL. Well I am using AMD and also getting intermittent stuttering in Gran Turismo 4 using DX11HW.

Specs:
4790k
16GB
FuryX
pcsx2-v1.5.0-dev-2162-g8c37418e4-windows-x86

I use a 21:9 monitor so I play the game with aspect ratio set to "Fit to screen" and use hor fov hacks.

Here's what happens, I start a race and 75% of the time it starts off smoothly and stutter free. After 3 or 4 laps (6 mins) stuttering slowly starts creeping in. When this happens if I just go look at the GSDX settings (which freezes emulation) and just press OK, emulation resumes smoothly again without stutter. In fact I have just noticed that you dont have to be in a race for this to happen as it also happens on the menu screen in Gran Turismo mode.

It is as if the game slowly starts to fall out of sync. Vram does not exceed 2gb when the stuttering happens. Not sure how relevant this information is but thought I'd throw it in there.

@P8M3

This comment has been minimized.

Copy link

commented Aug 11, 2017

Just to add more on the post above, it would seem that this happens in many games not just GT4. I can alter when it starts to stutter by changing the NTSC refresh rate. For example if I set it to 60.00 it would no longer stutter after a few minutes. Instead it would stutter every 20 seconds for about 1 second. So it seems that I can just not set the correct refresh rate in PCSX2_vm without it eventually falling out of sync. Tried 3 different monitors and vsync still the same.

@mirh

This comment has been minimized.

Copy link

commented Aug 11, 2017

facepalms
Putting aside I'm not sure even a Fury is enough to get playable framerates in GL on Windows for AMD..
Could you try the supposed workaround fix above?

@P8M3

This comment has been minimized.

Copy link

commented Aug 13, 2017

GL is not even worth considering with AMD so it is DX11 only unfortunately until pcsx2 follows rpcs3's route and implements Vulkan.

So I tried the the plugin that was mentioned in the fix and it's still the same problem. Can only play for around 5 or 6 minutes before I have to pause and resume emulation due to stuttering/sync issues. At least that is the case in GT4.

@mirh

This comment has been minimized.

Copy link

commented Aug 13, 2017

Can only play for around 5 or 6 minutes before I have to pause and resume emulation due to stuttering/sync issues.

This has nothing to do with this issue then.
EDIT: you can open another one, if really any

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Aug 14, 2017

As I said before, the issue that started this thread appears to have been fixed in v1.5.0-dev-2155-g41bfb6e80, as it is now behaving the same as stable 1.4.0. Both are now exhibiting tearing after roughly 5 minutes of gameplay regardless of vsync setting, and it seems to be caused by the latest Nvidia driver, as I am not experiencing it with the previous driver. What @P8M3 is experiencing sounds exactly like what I am getting, though he should test stable 1.4.0 as well and see if it exhibits the same behaviour. If it does, then it's safe to say that the remaining issue is driver-related and that AMD and Nvidia both need to get their shit together and fix their god-damned drivers!

@mirh

This comment has been minimized.

Copy link

commented Aug 14, 2017

...
So you are telling me, that all the stuttering people reported here with no time lag.. is 5 minutes delayed for you?
Fuck me

Also, I'm not understanding how you could have "latest nvidia driver" like a year ago.

If it does, then it's safe to say that the remaining issue is driver-related and that AMD and Nvidia both need to get their shit together and fix their god-damned drivers!

Or microsoft, you know probably.

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Aug 14, 2017

What I am saying is that the original issue I reported to start this thread a year ago is no longer happening for me on the build I mentioned in my most recent comment, so it is behaving like 1.4.0 now.
The issue I am having now is tearing (not the stuttering that I reported a year ago) because it seems that vsync is not being enforced correctly on this latest Nvidia driver, so all is well until about 5 minutes into gameplay (though not sure why it's delayed by 5 min.). Who knows what kind of black magic is falling apart to cause this on the latest driver...
I also agree and wouldn't rule out MS, either.

@mirh

This comment has been minimized.

Copy link

commented Aug 14, 2017

What I am saying is that the original issue I reported to start this thread a year ago is no longer happening for me on the build I mentioned in my most recent comment

Ooooh.
Cool. So I guess we could close this issue F I N A L L Y.
(And if somebody still have stuttering, we can open another one - focused perhaps just on DWM issues)
(also valid for tearing problems ofc)

Could you please try to bissect where this got fixed?

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2017

Please let's remain calm & cool.

@P8M3
Could you test the behavior with frame limiter disabled and both Vsync & adaptive Vsync ?

@RAZORXKHARA33
It is quite strange. Are you sure that you didn't enabled the hidden vsync option EnableVsyncWindowFlag ? What happen if you disable the frame limiter.

Note: if you update the option, presses F9 two times. (we have some internal bugs that don't apply vsync properly)

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Aug 14, 2017

@gregory38 I just tried the build I mentioned above both with the hidden option enabled and disabled and forcing vsync on in the Nvidia Control Panel. With the option disabled, I get the 5 min of smooth gameplay, and then stuttering, but no tearing. With the option enabled, I get perfectly smooth gameplay indefinitely. Again, this is with vsync forced on in the Nvidia Control Panel. If I set it to "Use 3D Application Setting," then I get tearing after about 5 min., no matter what vsync option I use in the PCSX2 config (standard or Adaptive). I also get that result if I force vsync to Adaptive in the NVCP. Again, this is on build v1.5.0-dev-2155-g41bfb6e80.

@P8M3

This comment has been minimized.

Copy link

commented Aug 14, 2017

@gregory38 Tested with build v1.5.0-dev-2155-g41bfb6e80. Frame limiter disabled and Vsync on in PCSX2 seems to have resolved the issue (been on the same track for 20 mins and no stutter, will continue testing). Vsync is "off unless application specifies" in AMD settings. I swear I tried that already but obviously not. I tried a lot of things and got overwhelmed I guess. Feeling a little foolish. I noticed before that the fps would randomly jump up to 64fps for a split second but now it is very stable.
Thank you very much.

@RAZORXKHARA33 Hope you can fix your issue quickly and fulfill mirh's dream of closing this thread.

@mirh Peace.

Thank you all.

@mirh

This comment has been minimized.

Copy link

commented Aug 14, 2017

Tbh I think I'm one of the few people that has read the latest 200 messages and I don't mind for even another half of that.
Given the original issue reported by the original reporter is claimed by him to be fixed with WS_POPUP, it seems only obvious for *that* to be considered solved (once we bring it back).

That likely has no effect at all in the first place on AMD, so to the very least you should already report in another issue.
Also, IIRC all of this was just about an opengl-only problem originally.

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2017

@RAZORXKHARA33

If I set it to "Use 3D Application Setting," then I get tearing after about 5 min., no matter what vsync option I use in the PCSX2 config (standard or Adaptive).

Fwiw, Adaptive Vsync does't remove tearing if you're PC can't manage the 60fps. Anyway, in this situation, what happen if you disable the frame limiter ? Does it goes above 60 fps, which mean no sync at all or does it cap at 60 fps which means there is another kinds of Vsync enable somewhere.

@P8M3
Interesting. @ramapcsx2 told me that PCSX2 limiter is rather suboptimal. I don't know how Dx manage but it likely suffers of a similar issue. In my opinion, adaptive vsync (OpenGL) should replace the frame limiter.

@mirh

This comment has been minimized.

Copy link

commented Aug 14, 2017

Fwiw, Adaptive Vsync does't remove tearing if you're PC can't manage the 60fps.

I'd propose to open a "what do you think of adaptive v-sync" thread on the forums.

In my opinion, adaptive vsync (OpenGL) should replace the frame limiter.

PS2 refresh rate and player monitor should really, really have nothing to do.

--- Nevertheless, I don't think frame limiter code (for as much possibly subpar) was ever touched in the last years or so, especially so much to cause any "explode after handful of minutes" problem.

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Aug 14, 2017

@gregory38 I've had the frame limiter disabled all of this time. Also, DX suffers from the same issue I mentioned in the OP, but that happens in stable 1.4.0 as well. It's been an issue for longer, but since I've been using OpenGL ever since the plugin was updated sometime in 2015, I haven't bothered with DX 11. It's been less accurate and worse performing in every game I've played, so I see no reason to use it over OpenGL. This is on a GTX 1080 BTW.

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Aug 15, 2017

Did some futher testing and am now getting consistently good behaviour in GT3. Now I either need more powerful hardware or some performance optimizations need to be made, as I get a lot of slowdown-stutter at tracks like Laguna Seca and the Special Stage Routes. However, the stutter I'm now talking about is one that I've experienced ever since I started using PCSX2 and is a result of the game slowing down--completely unrelated to what this thread is about. FTR, it happens whenever the sun comes in/out of view. That's for a separate issue, though. Unless anyone thinks otherwise, I think we can close this thread now.

@mirh

This comment has been minimized.

Copy link

commented Aug 15, 2017

I think we should first get WS_POPUP on.
(either because we drop the .ini toggle altogether because we are confident it shouldn't be needed anymore, or at least by making it enabled by default)

and is a result of the game slowing down

Then I usually call it "lag". Stuttering is more about framerate "inconsistently variable"
You can open another issue for GT3 specifically

EDIT: @RAZORXKHARA33 you can close, see below

@BParks21

This comment has been minimized.

Copy link

commented Sep 11, 2017

Why is this closed?

@mirh

This comment has been minimized.

Copy link

commented Sep 11, 2017

... the last post?

@BParks21

This comment has been minimized.

Copy link

commented Sep 11, 2017

Oops yeah don't know how i missed that -_-

@gregory38

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2017

To be honest, I'm completely lost at my side. So what setup @RAZORXKHARA33 did you use ? With or without the vsync option.

@RAZORXKHARA33

This comment has been minimized.

Copy link
Author

commented Sep 12, 2017

@gregory38 EnableVsyncWindowFlag enabled, vsync option in pcsx2 set to adaptive, vsync in NVCP set to On.

@mirh

This comment has been minimized.

Copy link

commented Sep 12, 2017

#1437 (comment), as I posted in the follow-up thread.

@mirh

This comment has been minimized.

Copy link

commented Jan 15, 2018

@WizLizard Try EnableVsyncWindowFlag=enabled, with adaptive v-sync in pcsx2... And just whatever might do it in nvidia control panel.

@BParks21

This comment has been minimized.

Copy link

commented Jan 16, 2018

@mirh Sorry same results, still frame pacing issues very noticeable immediately upon spinning the camera around in any game with 360 camera control.
The only thing that ever worked was that custom gsdx plugin you linked a while back with a tweak you made. Unfortunately it caused a weird performance issue. At least i think it was you.

@BParks21

This comment has been minimized.

Copy link

commented Jan 16, 2018

@mirh Ok it is fixed. I didn't realize in the GS Window tab i had zoom level set to 100.83, setting it back to 100 got rid of the stutter. Sorry, i was messing with that a while back and forgot to set it back to normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.