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

phantasy star portable 2 infinity - strange framerate drops #13914

Open
Davidcard22 opened this issue Jan 13, 2021 · 37 comments
Open

phantasy star portable 2 infinity - strange framerate drops #13914

Davidcard22 opened this issue Jan 13, 2021 · 37 comments
Labels
Performance Unexpected slow performance issues
Milestone

Comments

@Davidcard22
Copy link

What happens?

frame drops in specific parts of the game, the game runs at 60 FPS or 30 depending on the configuration I do but at both speeds it has strangely French drops.

What should happen?

In my opinion you should do an optimization just like you did in the game gundam vs gundam next plus
That would be enough to remove these problems from falling frames

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

Android 10 snapdragon 636 2.2 GHz overclocked 4Gb Ram backend OpenGl

@hrydgard hrydgard added the Performance Unexpected slow performance issues label Jan 13, 2021
@hrydgard
Copy link
Owner

does render resolution matter?

@hrydgard hrydgard added this to the Future milestone Jan 13, 2021
@Davidcard22
Copy link
Author

even lowering the rendering resolution, the game is not stable at 30fps, I tried to increase it and decrease the CPU speed, but I still have the same thing. it happened the same in the game gundam vs gundam next plus, but after he received that improvement in performance he is running at 60fps even in Full HD

@kage2051
Copy link

kage2051 commented Jan 14, 2021

it happened the same in the game gundam vs gundam next plus, but after he received that improvement in performance he is running at 60fps even in Full HD

That's the 'disable slow effects' speedhack. If you enable that for PSP2i, you might get some FPS, especially if you play on OGL backend.

As for the optimization thing for Gundam Next, I only see Adhoc-related work from a few months ago, unless you mean the Block Transfer on virtual framebuffer hack. I don't think PSP2i needs it to run on lower end hardware, maybe you should try by adding it to the compat.ini file (no need to wait for a new build to test).

@Davidcard22
Copy link
Author

UPDATE: 1.7.1 includes some minor crash fixes and a savedata fix. 1.7.2-1.7.4 are just additional crashfixes. 1.7.5 fixes an Android issue.

Fix for insta-crash on Galaxy Note 9, some Xiaomi devices, and the new nVidia Shield (#11441)
Vertex range culling on most platforms, fixes DTM: Race Driver and similar (#11393)
Major speed boost in some Gundam and Earth Defense Force games (#10973)
Fix for issues with post processing shaders in GL 3+ (#11182)
Fixes to sound output switching on Windows (WASAPI) (#11438)
Detects DirectInput devices when running (#11461)
Simple Discord integration (#11307)
New debugging APIs (#10909)
Task switching made a lot more robust (fixes GPD XD problems) (#11447)
Texture decoding optimizations (#11350)
Tons and tons of miscellaneous bugfixes and compatibility fixes

@Davidcard22
Copy link
Author

PPSSPP 1.7.1 ~ 1.7.5 Best performance.. This was referenced on 10 Jun 2018
Android : Extreme slow on battle Scene in Gundam vs Gundam Next Plus #1319
Closed
earh defense force portable 2 laggy on android #6958
Closed
Vulkan Performance Regression in Earth Defence Force 2 #10597

@anr2me
Copy link
Collaborator

anr2me commented Jan 15, 2021

Well you can't compare different games like that, because one game might be using a lot more polygons or visual effects than the other.
What you should compare is how the game runs on real PSP vs Emulator.

Btw is there any GPU tools that can be used to monitor how many tri/quad/polygons being rendered in real-time on PPSSPP?

@unknownbrackets
Copy link
Collaborator

You can enable show debug statistics - we list the # of vertices being drawn.

Comparing performance is tricky, because performance can really depend on how games were implemented. The PSP GPU is much slower than a modern GPU in a lot of ways, but it had neat little tricks built into it. Modern GPUs are more "general" - they can do amazing shadows much faster, but they aren't as good at some of these really specific cheap tricks the PSP GPU had.

So many PSP games used these features that were really fast on the GPU as much as possible. Sometimes, they used them even when doing it another way would've been just as fast, because they were essentially "free". There was no performance penalty to these features at all.

Modern GPUs though don't have these fast tricks - so even though they do everything 10 times as fast, these "cheap tricks" are much slower because they're no longer free. Your 370 Mhz Adreno 509 isn't actually a lot faster than the PSP's 166 Mhz GPU, so it can't overcome the loss of free fast tricks.

Where we can, we detect when games are using these unnecessarily, and get rid of them. In other cases, we translate these tricks into something else that can run faster on modern GPUs. But sometimes there's just no way to translate it without drawing graphics wrong.

There's a feature to log "frame drops" in developer settings, if you can provide a log of what that's showing we can confirm what might be possible to improve. Make sure you're not using texture scaling.

-[Unknown]

@ghost
Copy link

ghost commented Jun 12, 2021

I have a stable 30/30 fps on this game using ppsspp github apk v1.11.779 and ppsspp gold version also your phone is a little bit powerful compare to my redmi note 9 🤔
Screenshot_2021-06-12-20-05-44-568_org ppsspp ppssppgold

@hrydgard hrydgard changed the title phantasy star portable 2 infinity phantasy star portable 2 infinity - strange framerate drops Jun 12, 2021
@ghost
Copy link

ghost commented Apr 25, 2022

@Davidcard22 no feedback outdated?

@8bitp1xelz
Copy link

Any more info about this? I have been seeking a fix as well. It seemed odd to me that even at 1x and no enhancements at all that I still get these FPS drops. I've changed every setting around I can messing with it and nothing seems to affect it.

@8bitp1xelz
Copy link

8bitp1xelz commented Aug 14, 2022

You can enable show debug statistics - we list the # of vertices being drawn.

Comparing performance is tricky, because performance can really depend on how games were implemented. The PSP GPU is much slower than a modern GPU in a lot of ways, but it had neat little tricks built into it. Modern GPUs are more "general" - they can do amazing shadows much faster, but they aren't as good at some of these really specific cheap tricks the PSP GPU had.

So many PSP games used these features that were really fast on the GPU as much as possible. Sometimes, they used them even when doing it another way would've been just as fast, because they were essentially "free". There was no performance penalty to these features at all.

Modern GPUs though don't have these fast tricks - so even though they do everything 10 times as fast, these "cheap tricks" are much slower because they're no longer free. Your 370 Mhz Adreno 509 isn't actually a lot faster than the PSP's 166 Mhz GPU, so it can't overcome the loss of free fast tricks.

Where we can, we detect when games are using these unnecessarily, and get rid of them. In other cases, we translate these tricks into something else that can run faster on modern GPUs. But sometimes there's just no way to translate it without drawing graphics wrong.

There's a feature to log "frame drops" in developer settings, if you can provide a log of what that's showing we can confirm what might be possible to improve. Make sure you're not using texture scaling.

-[Unknown]

Hey Unknownbrackets, it didn't look like anyone had provided you with the info you asked for, so here's a shot of mine. Running on Vulkan, facing the center of the 'city' area where the lag gets particularly bad. This slowdown also occurs in some other areas in the game, mostly in larger rooms & when there's lots of spell effects. If I can provide any more info to help, please let me know!

Screenshot_20220814-090903

Edit: I also tried to do the dropped frame log, but I'm not sure where it is saved on Android?

@unknownbrackets
Copy link
Collaborator

The framedrops are streamed to the log, if you have a PC you can use adb logcat to read them:
https://github.com/hrydgard/ppsspp/wiki/How-to-get-an-adb-logcat-from-a-PC

This specific screenshot is helpful, it shows a lot of pipelines and multiple FBOs, which could be related to the performance. That said, this particular frame was pretty fast (1.9ms - if each frame was that fast, 60 FPS wouldn't be a problem.) That's also helpful, because it probably means some frames are slower than others, which might explain why this area is tough on some devices.

Could you try taking more screenshots, and then post any that have "Kernel processing time" or "DL processing time" above 8ms? If you never see it above 8ms, that's also interesting. Overall, we have 16.6ms total "budget" to work in and still be able to run at 60 FPS.

-[Unknown]

@8bitp1xelz
Copy link

The framedrops are streamed to the log, if you have a PC you can use adb logcat to read them: https://github.com/hrydgard/ppsspp/wiki/How-to-get-an-adb-logcat-from-a-PC

This specific screenshot is helpful, it shows a lot of pipelines and multiple FBOs, which could be related to the performance. That said, this particular frame was pretty fast (1.9ms - if each frame was that fast, 60 FPS wouldn't be a problem.) That's also helpful, because it probably means some frames are slower than others, which might explain why this area is tough on some devices.

Could you try taking more screenshots, and then post any that have "Kernel processing time" or "DL processing time" above 8ms? If you never see it above 8ms, that's also interesting. Overall, we have 16.6ms total "budget" to work in and still be able to run at 60 FPS.

-[Unknown]

Here are some more shots. Didn't see it get up to 8ms, think the highest I saw flash by was 4.
Screenshot_20220814-103958
Screenshot_20220814-103937
Screenshot_20220814-104139
Screenshot_20220814-104037
Screenshot_20220814-104207

@unknownbrackets
Copy link
Collaborator

__KernelReturnFromInterrupt is most likely DL processing, so I think this confirms it's all on the graphics rendering side. Preparing the graphics commands isn't taking all that long, so it's on the GPU and GPU driver side actually executing them.

Flushes don't seem to correlate in your screenshots with performance, although normally that would be a source of overhead. There are 4 clears and 4 depth copies, which is a bit unfortunate.

Can you take a GE frame dump of the slowest area? Just make sure to export it while you are getting the slow performance - it's almost like a 3D screenshot. If you make it while the issue isn't happening, it won't help.

See here for instructions - it's not hard and works on Android too:
https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump

You can zip that and then drag and drop it into a reply here. Unfortunately, frame dumps don't always reproduce performance issues, but they often do.

-[Unknown]

@8bitp1xelz
Copy link

NPJH50332.zip

Hopefully I did this right. I recorded when it was at its slowest in the city area.

@unknownbrackets
Copy link
Collaborator

It might be the frame dump doesn't capture it well. Using a Pixel 5a (Adreno 620), 1x render resolution, not texture scaling, and otherwise default settings I can fastforward that to around 500% and get full speed.

The game:

  • Clears 00044000 (5551) and then 000CC000 (8888) at the start.
  • Draws a bunch to 000CC000, drawing objects far to close (worst on fill rate, but best quality.)
  • Finally blits 000CC000 to 00044000 at the end (i.e. dithering but only at the end.)
  • Does some bloom near the end, around 1853/1921. But... it seems to bloom using a framebuffer it only cleared? I don't see an upload in the dump.

Outside the amount of drawing and fill rate, I don't see anything particularly terrible. Most of the draws are with alpha testing, but that's pretty usual.

-[Unknown]

@8bitp1xelz
Copy link

Is there any other info I can provide to help narrow things down? Also, are you aware that this game is normally ran at 30fps? A lot of people play it with a 60fps patch though, as the game functions normally for the most part with it. At 30fps there is still a tiny bit of that slowdown, but it's much less noticeable, I guess because it's at a lower framerate where as at 60fps it's very noticeable.

@ghost
Copy link

ghost commented Sep 27, 2022

@8bitp1xelz try the latest build this might improve now.

@Davidcard22
Copy link
Author

Davidcard22 commented Sep 27, 2022 via email

@8bitp1xelz
Copy link

8bitp1xelz commented Sep 27, 2022 via email

@Instandhaltung
Copy link

I can replicate the issue on Switch. Played just a bit, but had massive slowdowns in the main hub area (seen on the second picture above). When looking at the load, it seems to be a CPU related problem. One of the four cores on Switch is at 99% all the time in that area, even at max clock speeds.

@ghost
Copy link

ghost commented Dec 8, 2022

What's the status of this issue after #16504

@Instandhaltung
Copy link

What's the status of this issue after #16504

Since standalone verson gets rarely updated on Switch, I won't be able to test.

@8bitp1xelz
Copy link

8bitp1xelz commented Dec 8, 2022 via email

@ghost
Copy link

ghost commented Dec 8, 2022

What's the status of this issue after #16504

Since standalone verson gets rarely updated on Switch, I won't be able to test.

The original poster is using standlone ppsspp.apk with android 10 snapdragon 632 clock at 2.2ghz with 4gb of ram I think the switch is kinda unrelated to this issue.

@ghost
Copy link

ghost commented Dec 8, 2022

I just installed latest I can get from the builds list for Android, and the problem still seems to occur.

On Thu, Dec 8, 2022 at 7:17 AM Instandhaltung @.> wrote: What's the status of this issue after #16504 <#16504> Since standalone verson gets rarely updated on Switch, I won't be able to test. — Reply to this email directly, view it on GitHub <#13914 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QT3ZCHLQVKNRX4HQJTEYLWMHGULANCNFSM4WBHZB4A . You are receiving this because you were mentioned.Message ID: @.>

Savestate from the area where it gets lag/slow performance?
I will test this on my vivo y11 snapdragon 439 clock at 1.9ghz with 3gb of ram.

@8bitp1xelz
Copy link

8bitp1xelz commented Dec 8, 2022 via email

@ghost
Copy link

ghost commented Dec 10, 2022

I won't be around for a little while to give you a save state, but you should be able to duplicate it by going into the blue shop area and look out towards the lobby area. It's consistent for me there. If that doesn't help I can try to get one for you later today On Thu, Dec 8, 2022, 10:12 AM Gamemulatorer @.> wrote:

I just installed latest I can get from the builds list for Android, and the problem still seems to occur. … <#m_-6615568378316570721_> On Thu, Dec 8, 2022 at 7:17 AM Instandhaltung @.
> wrote: What's the status of this issue after #16504 <#16504> <#16504 <#16504>> Since standalone verson gets rarely updated on Switch, I won't be able to test. — Reply to this email directly, view it on GitHub <#13914 (comment) <#13914 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QT3ZCHLQVKNRX4HQJTEYLWMHGULANCNFSM4WBHZB4A https://github.com/notifications/unsubscribe-auth/A2QT3ZCHLQVKNRX4HQJTEYLWMHGULANCNFSM4WBHZB4A . You are receiving this because you were mentioned.Message ID: @.
> Savestate from the area where it gets lag/slow performance? I will test this on my vivo y11 snapdragon 439 1.9ghz with 3gb of ram. — Reply to this email directly, view it on GitHub <#13914 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QT3ZGG6U2R2KAF7JDPYNTWMH3FPANCNFSM4WBHZB4A . You are receiving this because you were mentioned.Message ID: @.
**>

Ok thanks 😊

@ghost
Copy link

ghost commented Feb 16, 2023

@8bitp1xelz no feedback?

@Aerin-Wind
Copy link

Aerin-Wind commented Apr 27, 2023

It seems the issue still exists for this game, so I will post my findings for it here.

I experience the same random frame drops during gameplay of this game, and have had no luck troubleshooting it.

PPSSPP Version: 1.14.4-1451

OS: Windows 10 Pro

Hardware: Ryzen 5 3600, RX 480, 16 GB RAM @ 3000 Mhz
PPSSPP and all files are on an M.2 NVME SSD.

I did a test using a separate PPSSPP install, using all default settings, 1xPSP resolution, with the only modifications being using Vulkan and using the 60 FPS cheat available on the PSP2i wiki. The frame drops still occurred, and I have the "dropped frames" log from the console. I consistently saw two kinds of entries, one related to audio, and one about the dropped frames. They will be posted below.

Kernel processing time: 0.48 ms
Slowest syscall: __KernelReturnFromInterrupt : 0.17 ms
Most active syscall: __KernelReturnFromInterrupt : 0.46 ms
DL processing time: 0.46 ms, 1 drawsync, 0 listsync
Draw calls: 451, flushes 197, clears 6 (cached: 0)
Num Tracked Vertex Arrays: 0
Vertices: 29333 cached: 0 uncached: 84745
FBOs active: 8 (evaluations: 11)
Textures: 311, dec: 0, invalidated: 0, hashed: 1227 kB
readbacks 0 (0 non-block), uploads 0, depal 0
replacer: tracks 0 references, 0 unique textures
Copies: depth 5, color 0, reint 2, blend 0, selftex 0
GPU cycles executed: 819198 (27.656633 per vertex)
Vertex, Fragment, Pipelines loaded: 18, 29, 254
Pushbuffer space used: Vtx 747528, Idx 50324
N/A

32:42:396 SOUND_THREAD E[ME]: HLE\sceAtrac.cpp:1751 80630016=sceAtracResetPlayPosition(0, 0, 0, 0): first byte count not in valid range
32:53:473 SOUND_THREAD E[ME]: HLE\sceAtrac.cpp:1751 80630016=sceAtracResetPlayPosition(0, 0, 0, 0): first byte count not in valid range

I hope this can provide some more insight to the issue, as no change to graphics settings or anything within PPSSPP has rectified this.

@unknownbrackets
Copy link
Collaborator

As noted previously, it doesn't seem like this is on the CPU side - you can see 0.48ms there, which is good enough for 2000 FPS.

What graphics card are you using? For a clean test, make sure you're not using texture scaling or any texture replacements (texture replacements are enabled by default, if you have a pack installed.) Using a texture upscaling shader on Vulkan should be OK, though.

-[Unknown]

@Aerin-Wind
Copy link

Aerin-Wind commented Apr 30, 2023

I have an RX 480 and a Ryzen 5 3600, and did a clean test, it has the same drops on my setup regardless of settings.
Others have reported similar anomalies with this title, and I don't get these drops on other titles like this, so it's plausible the issue lies with the english patch modifications or the 60 FPS code.

I have good performance on PPSSPP on the whole, and I swear I've changed just about every setting possible, and updated graphics drivers, etc. I even rolled back builds to about 1.10 when clean testing, same issue happens.

Edit:
For more specific information, these hitches will happen typically when on any mission, at random.
When they do occur, it's a considerable hitch and the sound stutters alongside it as well.
Again, this issue still happens when clean testing at 1x Resolution, all defaults, no texture scaling.

@Aerin-Wind
Copy link

Did another clean test on 1.15, issue still present.

@ghost
Copy link

ghost commented Sep 16, 2023

Tested with 1.16.1, issue is still there, even with ubershaders disabled. And I disagree about being a translation patch issue, I had the same problem when I played the regular PSO2 some time ago. It goes for shops and stages corridors that give access to another "room" (not the transitions to other maps).

@EPIC3477
Copy link

EPIC3477 commented Nov 6, 2023

Hello I have the same problem, im using 1.16.6 latest version of android apk and still lag on first area. Is theres a way to fix it

@IrfanH495
Copy link

I also experienced, but only a few places
when turning the camera and opening the door the fps would go down, I asked my friend he said it was only at headquarters
https://youtu.be/Jp9NzhN84nQ
device
samsung m20
Exynos 7904
Mali-G71 MP2
ppsspp v1.17.1-35-

@hosjou
Copy link

hosjou commented Jun 23, 2024

I got these same issues, framerate drops at 20-25 on 30 fps lock, 50-56 with 60 fps cheats. Same location (Blue shop in game, facing lobby)
Snapdragon 680
Adreno 610
6GB of RAM
PPSSPP 1.17.1

Edit: disabled ubershader, On 30 fps lock (default) the framedrop didn't occur. But notable drop occured when 60 fps patch/cheats enabled (dropped down to 37 fps). Idk if the game intentionally dropped just over 30 fps so the game won't get noticeable performance on real hardware (iirc 25 fps locked).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Unexpected slow performance issues
Projects
None yet
Development

No branches or pull requests