-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Micro Stuttering/Frame Pacing issue #9736
Comments
Just to note a few things that could be slightly related:
I haven't carefully studied the pcsx2 issue, but it sounds like the assumption is that this is related to the DWM. Do you have access to Windows 7 or lower (i.e. dual boot), or know someone who is able to detect this issue accurately on Windows 7? It seems like disabling DWM would be a simple way to validate that assumption. Unfortunately, although I am using Windows 7, I'm probably not very able to notice microstutter - or else it's not happening to me. I did just try rotating the camera around. It seemed smooth, but then I don't really mind that much when games are an even 30 FPS so you probably don't want to listen to me on that. You can also enable "frame drop" logging in the settings, and keep the log open. This will make PPSSPP log whenever a frame takes longer than expected from its perspective. It shouldn't happen when just spinning the camera (unless maybe you have crazy texture scaling settings or something.) You can also enable real clock sync, which will try to sync PSP time and real time more closely (without it, we only sync on the frame, but with it, we sync about every 2ms.) Can't say if this will help or hurt, but if it alters it, it may be interesting. -[Unknown] |
I kind of can reproduce it, definitely not bothersome even on my slower system, drops are rare and tiny I can see frames being dropped only by looking in the log when moving camera around fast for example:
Worth noting it never drops frames with unthrottle so it probably is something related to frame limiter, maybe limiting to 60 as an option instead of 59.94 would work around it. Edit: NVM I think that's just me being unlucky grabbing first game under hand to test - wolfenstein 3D which yeah is a homebrew and might be buggy;p, I can't reproduce it in any commercial games tested soo far despite still seeing it in Wolf, but that one runs at weird fps by design and this might cause it's problems:]. Maybe the problem here is nvidia specific like with some driver settings/hack. I have only amd, but tested on two windows - 7 and 10 neither had any problems. |
I think you can use PresentMon or GPUView to nail just about any problem that may hit the display chain. Anyway, the problem we are having there now is the insanely retard nvidia driver when going fullscreen. |
PCSX2 forum base is pretty retard
Can you try these samples to see if any of them presents tearing (press SPACE to start the animation)? |
Have the same exact problem, followed the GIT builds too and experience the same stutter in any 3d games as the OP, I am on windows 7 and a Nvidia video card. Have free time to test anything as long as I can get rid of this problem. Also I am interested if Unknown Brackets can show us how to sync to 60Hz just to test if this help with this problem, thank you and sorry for the bump... |
I want this issue fixed so badly. The only thing that prevents ppsspp from being enjoyable for me. Glad to see another person who can confirm the problem. |
If you are on windows 7, try to start the emulator with "disable desktop composition" compatibility property checked. As for the pcsx2 issue, final consensus was that fix is making sure rendering window has WS_POPUP style. |
I tested both with WDC on and off, same thing, I followed this issue by years and the oldest revision I remember that haven't this (yeah at some point PPSSPP wasn't suffering from this) was version ppsspp-v0.9.1-2005-gdea4668-windows-x86. This version hasn't the microstutter every few seconds BUT has a constant stutter once it gets desynced with the audio, back then Atract3 plugin was new and the core was adapting to it... One thing that got rid of the microstutter for good was an option called "Atomic Audio Locks" with this you will always get smooth video syncing at the cost of jerky audio... |
Well, if you are that into the issue, and you have a "stable" version, then bisecting really is what you could do in the meantime devs check if the window is "properly configured". |
That's why I am interested in testing Unknown Brackets suggestion, but I don't know where in the source I can set the video to 60Hz... |
You can create a custom resolution with custom refresh rate if really any. As for the audio.. Can't you just "null" it like on pcsx2? |
I think I found a way to get rid of the stutter, please test the following build https://drive.google.com/open?id=16-jJjtM3bPAZuxt2Ix_zKZ4Ze6forJzM and report any problems. At least on my end I have butter smooth frame pacing, you need to enable the "Audio Sync (Resampling)" for it to work correctly... |
@Marcelo20XX Yeah this definitely fixed it. Tested Daxter, Valkyrie Profile Lenneth and Crisis Core. No hitching no stutter no frame pacing issues at all. |
@Marcelo20XX What have you changed in that build? |
Basically this: diff --git a/Core/CoreTiming.cpp b/Core/CoreTiming.cpp
|
Well here is the complete diff: https://pastebin.com/taWSHJZs if you are interested. There is a problem though, at least on my end there is constant stuttering after some time of playing (similar to the one I found on the revision 0.9.1) that only goes away after you make the game load a new area or zone or whatever it makes to update it, it can be only in my rig so I need others confirm if they are suffering from the same thing... |
How long did you play before it happened? |
I am testing this on FF3 and did the intro cave part until Luneth goes to the open world...15 mins or so UPDATE: I tested this build like one hour straight running around the town of "Ur" in FF3, entering and exiting buildings and here are my findings: You will get heavy stuttering after entering and exiting a building a number of times or by triggering the game to load data, the stuttering seem tied to the load data routine as I only encounter this problem while zoning...No amount of tweaks or configurations can fix this issue on Windows 7 on my rig BUT... After battling another hour or so with this stuttering I rebooted this time on Windows XP and as you can guess I got finally no stuttering at all in the OpenGL backend (on the Direct3D it stutters briefly every now and then)... Well that concludes my testings, I used the following rig: Windows XP SP3 32bits, Windows7 64 bits on a Core 2 Duo Q9660 with a Nvidia 9600GT and 2 GB of RDRAM, I want to point out that the issue may be only on my side as I currently don't have access to a more powerful rig... I will update if I encounter any remaining issues... |
I will do some more testing later and get back with you. |
You're not using the timer hack, right? One of those changes for it, so just want to confirm. -[Unknown] |
No, I am not using that hack and about the heavy stuttering I was suffering is maybe only on my system because it only happens when there is too much action or there is data that is being loaded from my HD ( which is mechanical BTW) because it doesn't happen in all games, for example I can play Project Diva and the Megamans game without a single hitch from start to finish... [Unknown] the microstuttering is because as you said before the emu is syncing at 59.94 instead of the common 60hz that most desktop PCs uses, I had the same problem in other emus, for example in DesMume i got the same stuttering every few seconds disregarding if the game ran at full speed or not, but after using the same emu on the retroarch frontend I got smooth scrolling mainly because RA forced the emu to sync at 60hz and resample the audio to not have any issue, like PPSSPP is now doing after the changes I made... I know the correct refresh is the currently used but there could be an option to force PPSSPP to sync at 60Hz for the people who plays on a desktop PC, just saying... |
I also get the same stuttering in the standalone Desmume and not the RetroArch version. |
@Marcelo20XX So far your fix for ppsspp has worked perfectly. I've had no stutter in Valkyrie Profile and I've played for over an hour in one session and my game is running off a mechanical drive. Also i switched to another monitor with the game running and still no stutter at all. I'm gonna play a few other games for roughly an hour. So far so good. |
@Marcelo20XX After playing Daxter and Kingdom Hearts Birth By Sleep for an extended period of time i did see stutter return. I wonder why it didn't return in Valkyrie Profile. Maybe because VP is 60 fps and the other two are 30 fps? |
I reduced the issue by checking IO on thread and IO timing method "host" on games that are 30 FPS, 60FPS games doesn't have any visible issues... |
Doesn't that have potential negative side effects? |
One piece of this puzzle is that some PSP games will internally time themselves based on 59.94, instead of relying on the hardware timing. Since the hardware was 59.94 anyway, it was fine even if you assumed it would never change. This is why we time based on 59.94, mainly. Also, if changing IO timing has impact on this, then you've got something else going on than FPS timing. Possibly your disk going to sleep. The "Fast" IO timing is the same for everyone: you will always get the same bugs. The "Host" IO timing is different depending on your hardware, and other applications running on your system - but definitely won't stutter as much. It's known to (possibly inconsistently) both fix and introduce bugs in various games. It might work 10 times you do something, and then bug out the 11th, only because that 11th time, the timing was vastly different from what real PSP hardware would've had. Maybe instead of changing all those places, try changing these in sceDisplay.cpp.. float scaledTimestep = timestep; Change to: float scaledTimestep = timestep * 1.001f; And also: float scaledVblank = timePerVblank; Change to: float scaledVblank = timePerVblank * 1.001f; That would keep the internal game time running at 59.94, but time the "outside world" at 60fps. Make sure you have real clock sync disabled, or adjust that one too. (not tested.) -[Unknown] |
I haven't tested the IO timing but i have this issue even when games are running on my standalone ssd or my m.2 raid config. |
[Unknown] That could be very possible the cause why I am having smooth scrolling in some games and a little stuttering in others, I saw the same issue in SNES emulation, for example with Super Mario World, no matter the amount of tweaks/hacks on the core emulators it wont give you a perfect smooth scrolling on a LCD monitor, you will get stuttering every few seconds BUT on the other side you could play Donkey Kong Country without any scrolling issues. Seems that Super Mario syncs to the internal 59.97Hz while DKC being a RARE game doesn't care... One of the games that its stubborn and still give me little stutters from time to time is Dracula X the main game... Will test your suggestion asap, thanks! |
What snes emulator, all the snes cores i use in RetroArch are stutter free. Emulators like PCSX2, epsxe, DeSmuME and vba-m give me stutter. Standalone higan gives me a ton of stutter with snes emulation but absolutely zero with the new libretro core. I know that Super Mario World stutter you're talking about. It happens on real hardware too, usually happens when you start running full speed. Thats just how the game is. |
Cool. I'll fix it soon: #12720 |
When "Render duplicate frames to 60hz" and "Vsync" are enabled in the emulator If I enter Fullscreen with alt+enter or F11 the game keeps running but keyboard/mouse doesn't respond. |
Does alt-enter work to exit out of it, or are you stuck at that point? What graphics card are you using, and do you have the latest drivers? I don't experience this on NVIDIA. That said, I have a multi-monitor setup (the only way to live), which sometimes makes fullscreen behave differently. -[Unknown] |
Stuck in fullscreen, RTX 2080, Nvidia Drivers 442.74, PPSSPP v1.9.3-554-gc6948561f Edit: I changed to drivers 445.75 and It's still the same. |
Okay, that sounds like a separate issue and maybe it's somehow AMD only. Doesn't really belong here, though. It sounds like for some people, the vsync improvements (which haven't really changed) helped, and for others the duplicate frames option helped. That said, apparently vsync has not (consistently) helped, possibly for driver heuristics/updates reasons. This issue has become very long, but I've updated the notes in #9736 (comment) to account for the duplicate frames option. -[Unknown] |
But I have a Nvidia card not an AMD card. Edit: It happens with vulkan, Directx 11 works normal. |
Please open a new issue about that, I'll try to take a look soon. |
I don't have that issue. Mouse and keyboard work fine with all backends with fullscreen and duplicate frames on. |
In the end the vsync changes work now on Vulkan too and i get consistent performance and FPS now. |
I got my vita out yesterday to play some of my psp games and what I found was interesting. Games which are running at 60fps seem to use adaptive vsync. When they are maintaining 60fps there is no tearing. When they drop below they allow tearing. 30fps games lock to 30 with vsync. Thought I'd just add this here it might explain tearing in some situations. |
Unless the psp had a vrr screen |
It didn't, some PSP games indeed tear on the real hardware. That behavior is not easy to emulate, and I'm not sure it would even be very meaningful. |
I found a solution to remove at 100% micro stuttering in games like Castlevania X Chronicles, Ao no Kiseki, Ys: The Oath in Felghana and many many others (often XSEED games). I tested only on PC Windows, using "Retroarch" and its PPSSPP core. Retroarch is here important, because one of its settings eliminates micro stuttering in games above: in video setting (Retroarch), at sync option, I indicate '2' to half refresh rate screen by 2. |
What is the name of the parameter that halves the refresh rate, I don't have the sync option on the Video options? |
It's called vsync swap interval, and you must also enable vsync for it to work |
This was a long but interesting read but I still don't understand the gist of it. It started with people claiming to notice micro stuttering but shifted to "only on 30 fps games" in the middle. Is the latter fixed with duplicate frames (#12460 is still open)? I've done my own tests and I don't see any micro stutters. I've tested Daxter (30fps) and rotated the camera and although it looks pretty bad (I guess that's a 30 fps thing though) I can't see any stutters (maybe some small slowdowns/speedups but that could be the game). Duplicate frame doesn't do anything to change that, so either my eyes are bad or it just doesn't happen to me. Edit: According to this Refresh Rate test setting it to 59 Hz does indeed result in 59.940 Hz. I mainly play retro games on my machine, would it be recommended to set the display to 59 Hz? Vsync should work fine either way (right?) but are there any compatibility problems? |
Just tested:
The stuttering only happens in PPSSPP 1.10.1. Not sure how to interpret that information. |
Tearing is back with Vulkan on the latest PPSSPP git version :X . |
What's the first git build seeing it again, and the last one where it worked? If you can't find one where it works, testing again now, it makes it much more likely this is caused by a driver update. -[Unknown] |
If tearing is back, it's the driver, not PPSSPP. |
literally 1 build away from tearing. |
Wait what, 474 tears but 473 doesn't? That would make it caused by this, which seems utterly bizarre: @mojojojodojo Please mention what GPU and platform you are on. |
@hrydgard So what's the verdict is this good to close? |
How about this now after #16104 |
I don't think those will solve microstutter, rather bigger stutters that happen when new shaders are compiled. |
NOTE: If you are experiencing this issue, it may have multiple causes. See this comment:
#9736 (comment)
Using any API there is in every game a micro stutter or frame pacing issue that occurs randomly. This may be exclusive to windows. I've tested windows 7-10 and many different systems with the same results. It is more prevalent using a monitor at 60hz. The issue is almost gone using a 120hz display. Currently that is the only way to resolve the issue in all my testing. The easiest way to test this is to play a game with complete 360 camera control stand in place and slowly spin the camera around. You will see random stutters or inconsistent frame pacing. This occurs with games running at full speed at all times, vsync on, and frame skipping off. I believe ppsspp is suffering from the same issue the PCSX2 team is trying to resolve here.
PCSX2/pcsx2#1437
It would be worth looking into. This is my biggest issue with ppsspp and is very noticeable and unpleasant imo. I've been trying to find a solution to this for years and it is driving me mad. I think the pcsx2 team has pinned it down though. Thanks for your time i really hope you guys look into this and hope it is resolved. I love ppsspp except for this :)
System Specs:
Operating System: Windows 10 Pro 64-bit
MOBO: Asus Maximus IX Code
Processor/CPU: Intel(R) Core(TM) i7-7700k @5ghz
Video Card/GPU: MSI GTX 980
Memory/RAM: 32GB DDR4 @3000MHZ
The text was updated successfully, but these errors were encountered: