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

30FPS frame pacing issues #12460

Closed
kristianity77 opened this issue Nov 2, 2019 · 20 comments
Closed

30FPS frame pacing issues #12460

kristianity77 opened this issue Nov 2, 2019 · 20 comments
Labels
GE emulation Backend-independent GPU issues
Milestone

Comments

@kristianity77
Copy link

kristianity77 commented Nov 2, 2019

Am using the latest version of ppsspp for Android across multiple devices and am having frame pacing issues with games that run at 30fps. Any game that is 60fps (like ridge racer etc) all run perfectly fine.

I'm playing on a black shark 2, Nvidia shield tv etc so I know the devices are powerful enough. Plus my frame and speed counters never drop. It's purely a frame pacing issue. It happens across all games to some degree (daxter, brave story to name a couple). This doesn't happen on a real psp and I'm certain it didn't happen in older versions of ppsspp so I'm not sure when it was introduced.

Like I said it's only on 30fps titles, all 60fps titles run flawlessly. Doesn't matter is the games are iso or cso it's the same problem.

There is no audio hitching or anything when this drops occur.

Long story short, any game that is 60/60 on the frame counter is fine, any that are 30/30 have issues.

Is this a known issue?

Just to add, this also happens in the retroarch core

@LunaMoo
Copy link
Collaborator

LunaMoo commented Nov 2, 2019

Closing as a duplicate of #9736, read especially this summarize post #9736 (comment) as your issue might be caused or improved by some settings as that problem is not affecting everyone. You could also try different backend as even on android you should have a choice between vulkan and OGL which behave differently.

@LunaMoo LunaMoo closed this as completed Nov 2, 2019
@kristianity77
Copy link
Author

kristianity77 commented Nov 2, 2019

That's simply not correct but whatever. It's an issue and it's nothing to do with settings. It's a frame pacing issue and I can see it across multiple Android devices on games that run at 30fps. 60fps titles not affected.

Try daxter on Android latest release. Spin the camera round. Frame pacing issue. Not a frame drop, frame pacing. That's not there on a real psp.

Check brave story, obscure, Sega rally, cladun, dead head Fred etc.

How can it be my setup when everything that is 60/60 runs flawlessly without hiccup but 30/30 doesn't?

I don't know what version I last used but previous versions of ppsspp didn't have this issue

I tried vulkan, opengl. I messed with pretty much every setting possible but nothing changed it.

This is across multiple devices such as Nvidia shield tv, black shark 2, Asus rog phone 2 and also now a Samsung Galaxy tablet s5. Same issues with the same games ( multiple downloads to check iso issues)

It's a problem with frame pacing on 30/30 games

@LunaMoo
Copy link
Collaborator

LunaMoo commented Nov 2, 2019

Nothing is going to change those two facts:

  1. This is an duplicate, we track this issue already elsewhere as linked above, if you don't search around before opening new issues, don't be surprised they're closed as duplicates.
  2. It doesn't happen to everyone, in fact it happened to very few people as of now, you're just another of those few.

Here's an example video from "Daxter" with camera just moving around and some frame profiling running recorded on PC:
https://www.mediafire.com/file/53wo7ltzq96829e/NPUG80329_2019-11-02_18-52-55.avi/file

It's perfectly smooth, well as smooth as 30 fps can be and I see it exactly same way in-game, so it's not just recording working better, recording if anything makes it worse as it does introduce quite a bit of work to frame time as can be seen on the start of this video as without it it really never goes above 10% of it's budget. Budget is actually 2 times higher than the 1/60s shown there since it's a 30fps game, so even the recording spikes doesn't effect the smoothness, but that's on a reasonably powerful pc with power supply and cooling providing as much as it needs to to run at max speed without any problems. Granted I do have freesync display, but I could not experience that "issue" even on old lcd that had none of the modern features.

On android however you're in completely different situation, power management sucks for emulators, especially for PPSSPP, 60fps might run smoother because your device requires more power from the cpu to run them, while 30 fps titles might be running at some awful power saving mode and struggle on ocassion causing the issue, you could as well run some cpu heavy software in the background and it could potentially improve, there was at least one case like that in the past.
Same for the existing issue about frame pacing where most affected people were on PC's with Nvidia cards and similar issue for different emulator for them was to disable zoom which could as well be affecting some graphic driver optimization or other driver hack they could be using as we have many more options on pc's. PPSSPP by default uses zoom on most standard displays without even telling the user as sacrificing 2 lines of pixels for integer scaling filling full screen is worth it, hence it could be happening same way as in the other emu.

I know it's easier to say "your software is broken - fix it" then lay back and wait for results, but when other people can't even reproduce the problem and the only work you're willing to do yourself is to quarrel with them about free open source software not working perfectly on all of the possible hardware, you might as well wait for an eternity until something accidently solves it or someone else affected happens to do more as in such situation where you can reproduce the problem you also have the most power to solve it. Yet can't be bothered to check when it started happening for you... a pity.

@kristianity77
Copy link
Author

For what it's worth these issues do not appear in 1.7.3 , but they do on anything released after that.

I tried the same isos on PC obviously and didn't have the issue, that's why I thought the issue lay with the Android port.

I know what you mean about power saving etc but I had already ruled that out. Two of the devices are snapdragon 855 chipsets and are gaming phones so do not throttle. They have dedicated gaming modes which shuts off everything phone related. The Nvidia shield maxes out without throttling also.

I'm not demanding a fix I'm merely pointing it out but seems that it the issue is being laid at my doorstep rather than it potentially being an issue.

The problem is there, it's plain to see (to the trained eye) but if issues just get rubbished as user errors then so be it. I'm only trying to advise of issues.

But to try and be more helpful, is there anything I can run in the background that might produce a log file when this is happening that can maybe pinpoint what's going on?

@hrydgard
Copy link
Owner

hrydgard commented Nov 2, 2019

30fps frame pacing is a legitimate issue (though it's mentioned in #9736 indeed), these framerates probably got a bit more inconsistent with the introduction of threaded rendering (though also faster, in most cases, but if you aren't CPU-limited you might not even notice).

At the cost of a bit more buffer-flipping (and thus power consumption on mobile) we can probably provide near-"perfect" 30fps frame pacing by simply presenting every frame twice instead of avoiding present if the PSP's buffer wasn't flipped. Buffered rendering mode only, of course.

Might also be possible to do other clever things but it risks becoming device-specific or flaky.

@hrydgard hrydgard reopened this Nov 2, 2019
@hrydgard hrydgard changed the title Frame pacing issues 30FPS frame pacing issues Nov 2, 2019
@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Nov 2, 2019
@hrydgard hrydgard added this to the v1.10.0 milestone Nov 2, 2019
@LunaMoo
Copy link
Collaborator

LunaMoo commented Nov 2, 2019

If you want it separate, shouldn't it be also marked as android specific? On PC's it looks fine.

Edit: also I wonder if a post process shader enforcing 60fps flipping could be affecting it, the only one we have right now is CRT Scanlines, but it's just a flag that can be added to any effect or without effect.

@kristianity77
Copy link
Author

If you want it separate, shouldn't it be also marked as android specific? On PC's it looks fine.

Edit: also I wonder if a post process shader enforcing 60fps flipping could be affecting it, the only one we have right now is CRT Scanlines, but it's just a flag that can be added to any effect or without effect.

I've just selected the crt scanlines option in post processing and whilst it makes the graphics look a bit odd, it takes the frame pacing issue away, on everything I was having trouble with.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Nov 3, 2019

Well if you want I made an empty shader with that flag:

AndroidFramePacingWorkaroundTest.zip
To use create "Shaders" folder inside your existing PSP folder on sdcard(location can vary on android), then extract 3 files included(ini/fsh/vsh) into that folder, then restart PPSSPP and it should detect it and create a new entry inside post processing shaders selection menu.

So I guess it's only about deciding whenever we always want to flip in buffered rendering, or provide an option, if it affects mobiles battery life.
Edit: oh and #12325 could also affects android, so it might need to be fixed first.

@kristianity77
Copy link
Author

Can confirm that this new shader works perfectly across all devices. Frame pacing issues totally gone. No side effects that I can see in about an hour of testing so all working good! ☺️

@JetSetter1984
Copy link

Hi Kristianity. So you have tested android and windows? And you are using a 60hz monitor or tv with vsync?

@unknownbrackets
Copy link
Collaborator

Is this working for everyone now with the new "Render duplicate frames to 60hz" setting enabled, with or without any shader? You also need buffered rendering enabled (see #12724 for why that's necessary.)

-[Unknown]

@hrydgard hrydgard removed this from the v1.10.0 milestone Apr 28, 2020
@BParks21
Copy link

Yes fixes 30fps frame pacing issues for me.

@Anuskuss
Copy link
Contributor

I'm assuming 30fps games actually run at 29.97 Hz internally. That would make it run at 59.94 Hz with duplicate frames, right? @BParks21 you said in #9736 that every game you've tried has micro stuttering but somehow running this 30 fps game at 59.94 Hz fixes the problem for you. Does that mean that this issue as a whole is fixed now?

@BParks21
Copy link

BParks21 commented Jun 28, 2020

@Anuskuss That was actually not true. I initially only tested 30fps games and wrongly assumed 60fps games did the same. From the get go i was only able to reproduce this on 30fps games. So it solves all the stuttering in 30fps games.

@hrydgard
Copy link
Owner

The little difference between 29.97Hz and 30Hz we paper over by stretching the audio if necessary.

@unknownbrackets
Copy link
Collaborator

I'm going to say this is fixed then, we've still got a microstutter megaissue that might actually be the same thing too.

-[Unknown]

@Anuskuss
Copy link
Contributor

I'm glad that this was fixed (even though it didn't affect me). I would even go as a far as to suggest to always enable this (maybe detect beforehand if the display is even capable of >30 Hz). I wanted to see what would happen when setting the display to 30 Hz and duplicate frames on and for whatever reason that halves the frame rate (math = magic). I know that it has a tiny bit of overhead but if that fixes an issue that has almost 200 comments and probably affects many more people that just don't notice or care I'd say go for it.

@BParks21
Copy link

@hrydgard Is this feature gonna be added to the libretro port? It needs it more so than upstream.

@ghost
Copy link

ghost commented Aug 26, 2021

Renderer Duplicate Frames causing lag on Brave Story New Traveller #14762

@hrydgard
Copy link
Owner

No need to post in this old issue, it's enough to link it from the new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

No branches or pull requests

7 participants