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
Closed

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

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

Comments

@RAZORXKHARA33
Copy link

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
Copy link
Contributor

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

@RAZORXKHARA33
Copy link
Author

RAZORXKHARA33 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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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

@RAZORXKHARA33
Copy link
Author

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

@gregory38
Copy link
Contributor

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

@RAZORXKHARA33
Copy link
Author

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
Copy link
Contributor

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

@RAZORXKHARA33
Copy link
Author

RAZORXKHARA33 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
Copy link

tabnk commented Jun 30, 2016

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

Good finding.

@tabnk
Copy link

tabnk commented Jul 1, 2016

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

@RAZORXKHARA33
Copy link
Author

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
Copy link

tabnk 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
Copy link
Contributor

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
Copy link
Author

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
This reverts commit 610bf8a.

In order to bisect issue #1437
gregory38 added a commit that referenced this issue Jul 1, 2016
This reverts commit 5a84a0d.

Bisect #1437
@gregory38
Copy link
Contributor

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

@RAZORXKHARA33
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

gregory38 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
Copy link
Author

RAZORXKHARA33 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.

@somedude5001
Copy link

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
Copy link

mirh 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?

@somedude5001
Copy link

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
Copy link

mirh 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
Copy link
Author

RAZORXKHARA33 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
Copy link

mirh 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
Copy link
Author

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
Copy link

mirh 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
Copy link
Contributor

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
Copy link
Author

@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.

@somedude5001
Copy link

@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
Copy link

mirh 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
Copy link
Contributor

@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
Copy link

mirh 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
Copy link
Author

@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
Copy link
Author

RAZORXKHARA33 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
Copy link

mirh 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
Copy link

Why is this closed?

@mirh
Copy link

mirh commented Sep 11, 2017

... the last post?

@BParks21
Copy link

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

@gregory38
Copy link
Contributor

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

@RAZORXKHARA33
Copy link
Author

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

@mirh
Copy link

mirh commented Sep 12, 2017

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

@mirh
Copy link

mirh 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
Copy link

BParks21 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
Copy link

@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
Projects
None yet
Development

No branches or pull requests