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

[libretro] abysmal performance on android #15561

Closed
5 tasks done
andres-asm opened this issue May 29, 2022 · 28 comments
Closed
5 tasks done

[libretro] abysmal performance on android #15561

andres-asm opened this issue May 29, 2022 · 28 comments
Labels
Libretro Issue on Libretro but not all ports.

Comments

@andres-asm
Copy link
Contributor

andres-asm commented May 29, 2022

Game or games this happens in

Tried several, RIDGE RACER in this case

What area of the game / PPSSPP

Performance is a crapshoot on the libretro core now, but I don't think it's a performance issue per se, more like the core is implemented incorrectly or something like that because I get full speed sound but ~20fps video.

The core used to be fine ~6 months ago, I played ridge racer and peace walker to completion using this core.

Video of the issue (recording is not what is causing this at all)
https://photos.app.goo.gl/Fk5ydfiiLSBG7mnB7

What should happen

Performance should be as before.

Logs

No response

Platform

libretro / Retroarch

Mobile phone model or graphics card

Samsung Galaxy S22

PPSSPP version affected

164c1b5

Last working version

sadly the libretro versions are not stored

Graphics backend (3D API)

Direct3D 9

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 without any cheats and without loading any save states.
  • Include logs or screenshots of issue.
@anr2me
Copy link
Collaborator

anr2me commented May 29, 2022

Are you using Auto-frameskipping? if you are, try disabling it (ie. not using any frameskipping) and see if it makes a difference.

Btw, you may want to set the FPS to Both when making a recording, so the devs know what's the internal FPS and the performance rate. Oops it's libretro, not sure whether it have this kinda setting or not.

@hrydgard
Copy link
Owner

Could be related to #15541 ?

@andres-asm
Copy link
Contributor Author

no I don't think so, I have seen this for months, it was fine ~6 months ago but I didn't backup the core so it's hard to tell

@unknownbrackets unknownbrackets added the Libretro Issue on Libretro but not all ports. label Jun 16, 2022
@Jetup13
Copy link

Jetup13 commented Dec 23, 2022

Didn't want to create another issue but I'm having the same issue with performance on the Android Libretro PPSSPP core. Doesn't matter what device I'm on (Retroid Pocket 2+, Retroid Pocket 3+, Samsung S10e SD855, Samsung Galaxy S22, ROG Phone 5) I seem to get around -25% to -30% performance hit on the core.

Seen someone over on the Libretro discord mention it might of had a regression over time. Went back on what they mentioned that the last build that had better performance seems to be in RetroArch Plus (maybe -20% performance hit).

Only reason why I want to use the core over the standalone is for RetroAchievements 😅

@yudhiyou
Copy link

This issue is happening to me also. Even if I tried on not demanding game like Street Fighter Alpha 3 the framerate is really struggling.

@yudhiyou
Copy link

So this issue is impossible to fix? Because I haven't seen any progress in years.

@hrydgard
Copy link
Owner

It's a libretro issue, and the libretro core is not officially supported by the project, it's just on a level of minimal effort to keep it working. I have enough to do with the standalone builds...

So it's up to someone interested to go investigate and fix it, I'm happy to merge fixes.

@yudhiyou
Copy link

I see :(

@yudhiyou
Copy link

yudhiyou commented Feb 12, 2023

For temporary until this is fixed, by using highrange soc like snapdragon 8 gen 2 will help to solve this issue?

@anr2me
Copy link
Collaborator

anr2me commented Feb 12, 2023

I don't think this is hardware issue, but you're free to try it if you had the device :)

You can use standalone builds until this issue fixed.

PS: Since iOS also suffers from FPS issue where the FPS is capped at 45 FPS (which is about -25% performance hit from 60 FPS), so may be both Android and iOS have similar issue?

@andres-asm
Copy link
Contributor Author

using standalone fixes everything, so just use that :)

@yudhiyou
Copy link

using standalone fixes everything, so just use that :)

That is not an option because I need some of retroarch's features like overlay layout, shaders, etc.

@andres-asm
Copy link
Contributor Author

andres-asm commented Feb 13, 2023

ahh...
I'd rather play games than spend a lifetime tweaking them with retroarch

@yudhiyou
Copy link

I have tried to set audio resampler setting on Retroarch to null and ppsspp becomes running brutally fast with frame skipping everything.
So looked like this issue is related to audio syncing. Can this information help you to solve this issue?

@Jetup13
Copy link

Jetup13 commented Mar 21, 2023

That's what I've been leaning towards, audio related. Here was another issue that's somewhat related to Libretro & Audio

#12841

@andres-asm
Copy link
Contributor Author

andres-asm commented Mar 21, 2023 via email

@ygordreyer
Copy link

Well. I'll ward this issue here.
I'm a developer, but I have 0 experience with libretro and PPSSPP.

If there is anything I can to do help, or any clue regarding this issue, feel free to contact me.

@hrydgard
Copy link
Owner

@warmenhoven is looking into this, I gave him a few pointers.

@yudhiyou
Copy link

Is using high-end cpu like snapdragon 8 gen 2 will help to remedy this issue?

@warmenhoven
Copy link
Contributor

I don't know for a fact that Android and iOS have the same issue, but I'm assuming they do. If so, then no, a faster cpu won't help, as it's not a performance problem exactly, it's a buffer blocking problem. On iOS the audio buffer gets filled, and the main thread then gets blocked waiting to add more audio data to the queue.

@yudhiyou
Copy link

I don't know for a fact that Android and iOS have the same issue, but I'm assuming they do. If so, then no, a faster cpu won't help, as it's not a performance problem exactly, it's a buffer blocking problem. On iOS the audio buffer gets filled, and the main thread then gets blocked waiting to add more audio data to the queue.

I see. Have you managed to fix it for android?

@warmenhoven
Copy link
Contributor

warmenhoven commented Jun 21, 2023

No. I have an open PR that sort of works around the issue when using vulkan on iOS. I'm currently pondering how to fix the issue on iOS in a better way without potentially breaking all of the other cores, which would hopefully also fix it for the GL renderer. However, neither the workaround PR nor the theoretical fix would help Android at all. I think I understand the issue well enough that I can explain it to someone who can work on Android, and they should be able to confirm whether it's the same issue and look at potentially similar solutions.

@anr2me
Copy link
Collaborator

anr2me commented Jun 21, 2023

If you can find out which commit causing PPSSPP to push more audio data than it should for the buffer to gets filled too fast like that, the other devs might be able to come up with a proper fix generally.

@warmenhoven
Copy link
Contributor

Pretty sure #17687 fixes this for both iOS and Android.

@yudhiyou
Copy link

Pretty sure #17687 fixes this for both iOS and Android.

Wow... Finally! Thank you so much.

@trotsky40
Copy link

Confirming that #17687 resolved the issue for me with Android running on an Odin Pro.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Jul 12, 2023

Closing as it's reported fixed.

@LunaMoo LunaMoo closed this as completed Jul 12, 2023
@andres-asm
Copy link
Contributor Author

andres-asm commented Jul 13, 2023

thanks @warmenhoven good to see someone at libretro is willing to put the work 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Libretro Issue on Libretro but not all ports.
Projects
None yet
Development

No branches or pull requests

10 participants