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

Unexpected performance drop [Corpse Party] #15348

Open
4 of 5 tasks
Nabokov86 opened this issue Jan 25, 2022 · 36 comments
Open
4 of 5 tasks

Unexpected performance drop [Corpse Party] #15348

Nabokov86 opened this issue Jan 25, 2022 · 36 comments
Labels
Performance Unexpected slow performance issues
Milestone

Comments

@Nabokov86
Copy link

Nabokov86 commented Jan 25, 2022

Game or games this happens in

ULJM05704 - コープスパーティー ブラッドカバー リピーティッドフィアー

What area of the game

The game runs very fast, but sometimes there is a big drop in performance. Especially when you go from one location to another.
This causes the sound to stutter for a moment, which is annoying.

Speed seen in PPSSPP

With unlimited speed - 800%, when dropped - 30-60%.

GE frame capture and debug statistics

ULJM05704_00006

Platform

Android

Mobile phone model or graphics card

Mali-G31 GPU

PPSSPP version affected

v1.12.3-776-g1c18c172a
V1.12.3
V1.11.3
V1.10.3

Last working version

No response

Graphics backend (3D API)

OpenGL / GLES
Vulkan

Any other notes or things you've tried

I tried resetting the settings, tried other android devices, same issue.

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try changing graphics settings to determine if one causes the slowdown.
  • Include logs or screenshots of issue.
@Nabokov86
Copy link
Author

These peaks occur every time you enter a different area.
ULJM05704_00011

@hrydgard hrydgard added the Performance Unexpected slow performance issues label Jan 26, 2022
@hrydgard hrydgard added this to the Future-Prio milestone Jan 26, 2022
@hrydgard
Copy link
Owner

Hm, those peaks look quite nasty indeed..

@unknownbrackets
Copy link
Collaborator

Do the same peaks, just with a presumably lower amplitude, occur on PC? I want to make sure this isn't IO related - I know Android recently made IO much slower.

It's interesting that LockLwMutex is so hot, it's probably some sort of tight loop, I guess. I don't think that has timings yet.

-[Unknown]

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Jan 30, 2022
This better matches tests on real firmware.  These funcs are sometimes
often used.  See hrydgard#15348 - Corpse Party.
@Nabokov86
Copy link
Author

@unknownbrackets The desktop computer handles it better, but I think the peaks are relatively the same.
ULJM05704_00002

And with unlimited speed:
ULJM05704_00001

@hrydgard
Copy link
Owner

@Nabokov86 Does it work better in the latest builds (829, for example?)

@hrydgard hrydgard modified the milestones: Future-Prio, v1.13.0 Jan 30, 2022
@Nabokov86
Copy link
Author

Nabokov86 commented Jan 30, 2022

@hrydgard It looks the same, no difference

Oh, no! It definitely got better!

@Nabokov86
Copy link
Author

Look at this!

Android:
ULJM05704_00013

@hrydgard
Copy link
Owner

Still not great, but looks better indeed! Do you still get audio glitches?

I wonder if this happens to any degree on the real PSP, or if there are more related timing issues somehow.

@Nabokov86
Copy link
Author

@hrydgard Audio glitches are still present, but they are shorter and much less annoying.

Still sometimes the sound is noticeably interrupted, especially in certain areas.

@unknownbrackets
Copy link
Collaborator

Do the debug statistics show anything different now?

-[Unknown]

@Nabokov86
Copy link
Author

@unknownbrackets No :(
ULJM05704_00035_1

@unknownbrackets
Copy link
Collaborator

Strange. I'd be less surprised if sceAtracDecodeData was maybe the cuplrit, but I wonder why it's locking mutexes enough that it's noticeably slow... I wonder if unlock is just behind it in slowness...?

When #15368 is merged, it may be easier to catch these blips using frame advance, and especially see if there's interesting stats right before or right after. I'm also interested in whether the time taken is significantly different when frame advancing.

-[Unknown]

@Nabokov86
Copy link
Author

@unknownbrackets I apologize for the late response.

#15368 is merged, right?
I can't find the frame advance option. Could you please help me with that?

@unknownbrackets
Copy link
Collaborator

You can map a button in control mapping to frame advance. Then when you press that button, it will pause, and you can keep pressing it to step forward one frame at a time. To stop frame advance, press whatever button is mapped to fast-forward.

-[Unknown]

@Nabokov86
Copy link
Author

@unknownbrackets Thanks for the quick reply!

Checked twice, I definitely don't have that button. Could this option be unavailable on android?
I will try it on Windows later.

@Nabokov86
Copy link
Author

@unknownbrackets Yes, frame advance is not available on android.

I recorded two videos: using frame advance and 5% speed. The result is quite different.

5% speed:
https://user-images.githubusercontent.com/26260168/152365423-6d69079d-c202-4f1a-9dcf-c82da5a703d5.mp4
Here you can clearly see the lag and LockLwMutexCB.

Frame advance:
https://user-images.githubusercontent.com/26260168/152367211-570ae50b-dbf8-442e-a191-459d4eb96cf5.mp4

Hope this will be useful.

@Nabokov86
Copy link
Author

Android:

Android_debug.mp4

@unknownbrackets
Copy link
Collaborator

Has anything improved in the very latest git builds? We made another change, which might help.

-[Unknown]

@Nabokov86
Copy link
Author

@unknownbrackets No, nothing.

@unknownbrackets
Copy link
Collaborator

There was another recent change, has this improved on Android?

-[Unknown]

@Nabokov86
Copy link
Author

Nabokov86 commented Apr 8, 2022

@unknownbrackets Same, nothing has changed :(

Peaks on the graph look the same. A very short image lag is noticeable during peaks as before. ULJM05704_00059

@Nabokov86
Copy link
Author

Nabokov86 commented Apr 8, 2022

In other locations there are even bigger peaks.
ULJM05704_00053
ULJM05704_00057

@Nabokov86
Copy link
Author

Nabokov86 commented Apr 9, 2022

I discovered a new thing. Bluetooth-friendly buffer reduces audio glitches a lot in this game.

@hrydgard
Copy link
Owner

hrydgard commented Apr 9, 2022

Yeah well that means that we still have stalls, just that the buffer is large enough with that setting to cover for it..

@unknownbrackets
Copy link
Collaborator

I have been thinking of putting atrac decode on a thread, which might help this. I suspect the game is decoding the entire background music for the next area during the scene transition.

-[Unknown]

@Nabokov86
Copy link
Author

I suspect the game is decoding the entire background music for the next area during the scene transition

I don't think so. The background music does not change during scene transitions.

For example, there is a dead end in this scene. The background music does not change, there seems to be no new sounds at all. The only new content is textures and a text note. The textures are loaded before this peak on the graph. Every time you enter this location causes this. Looks like something is loaded/decoded every time for this particular scene.

ULJM05704_00051_1

@ghost
Copy link

ghost commented Apr 11, 2022

Cache full ISO in RAM doesn't help this if you enable?
IMG_20220411_114848

@Nabokov86
Copy link
Author

@EternalsDarkhole No, it didn't help.

@ghost
Copy link

ghost commented Apr 13, 2022

Can you upload save state of this area/stage of this game where it lag.

@Nabokov86
Copy link
Author

@EternalsDarkhole Sure.

  1. ULJM05704_1.03_0.zip Go up here.
  2. ULJM05704_1.03_1.zip Go left here.

It lags almost everywhere more or less, though.

@ghost
Copy link

ghost commented Apr 13, 2022

@EternalsDarkhole Sure.

  1. ULJM05704_1.03_0.zip Go up here.
  2. ULJM05704_1.03_1.zip Go left here.

It lags almost everywhere more or less, though.

Thanks!
BTW is NPUH-10117 is the usa version?

@Nabokov86
Copy link
Author

NPUH-10117 is the usa version

Yeah, I think so. But I have the Japanese version ULJM-05704

@ghost
Copy link

ghost commented Apr 13, 2022

Android:

Android_debug.mp4

I cannot reproduce this kind of issue on the usa version of this game on my phone using ppsspp latest build.

Screenrecorder-2022-04-13-20-50-46-65.mp4

@ghost
Copy link

ghost commented Apr 13, 2022

Maybe this issue is similar to KoF Orochi Collection #12543 where the USA version is smooth while the JAP version is slow.

@Nabokov86
Copy link
Author

Yes, I confirm. Looks like it's only related to the Japanese version.

NPUH-10117:
NPUH10117_00003_1

@ghost
Copy link

ghost commented Apr 14, 2022

Yes, I confirm. Looks like it's only related to the Japanese version.

NPUH-10117: NPUH10117_00003_1

Can you try software rendering?

@hrydgard hrydgard modified the milestones: v1.13.0, Future-Prio Apr 16, 2022
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

3 participants