hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.02k stars 2.15k forks source link

Bad performance on Raspberry Pi3 with new 1.6.3 version #11265

Closed luizthiagor closed 5 years ago

luizthiagor commented 6 years ago

What happens?

I have bad performance (speed in games) with the new ppsspp v 1.6.3 on raspberry Pi 3 (Batocera.linux project)

What should happen?

in the version 1.5.4 the speed is good , i've played some games , including the God Of War - Chains of Olympus with satisfactory performance in my raspberry Pi 3 ...but the 1.5.4 version has some bugs mainly in the "High Impact Games" like Ratchet and Clank , Jak and Daxter and others (overbrightness issue , yet related in github)

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

Raspberry Pi 3 , Batocera Linux 5.16 with new 1.6.3 ppsspp

Has some way to improve the performance of the new ppsspp in Raspberry Pi 3 ? the 1.6.3 has sayed has the "FAST" version , but in raspberry the speed of games is worse than the 1.5.4 .....

unknownbrackets commented 6 years ago

What graphics backend are you using? Does this affect both OpenGL and Vulkan? Are you using the latest git build, or the release version of v1.6.3?

-[Unknown]

luizthiagor commented 6 years ago

i'm not can say aboutl how version is used because i'm not the developer of batocera Linux i'm running, but i believ it's is the release version of 1.6.3 because my compilation running still has the problem of "save states" message "load state. saved in game. Restart and load for less bugs" .... so, this is a issue related to the "old "version of ppsspp 1.6.3 ...

but the main problem of performance is unsolved for me only in raspberry ...

I'm agree with the fact of "Raspberry Pi3 has a low hardware" to run PSP games at full speed , but i have used the 1.5.4 ppsspp and i can run even the God Of War Chains of Olympus acceptable playing (if use some specific configs - like the frameskip) ....

so, i belieeve the 1.6.3 should be better in speed because the multithread for openGL...

In addiction to it, i have noticed has the OpenGL used in my ppsspp version in system settings shows "OpenGL ES 1.00" ...and not the 2.0 or 3.1 (i not can say raspberry supports the 3.1...) it can be related to this ?

luizthiagor commented 6 years ago

I not have the vulkan disponible for RPI3 ..only OpenGL can see

unknownbrackets commented 6 years ago

In theory, the improvements we've made should be better even for the quad core Raspberry Pi 3. However, it does have a VideoCore GPU which is pretty obscure and weak - it might be that its driver doesn't really handle our multithreading well.

It could also be a bug in the git build you're using. Is there any way for you to test other builds? If you can determine which git build first had the performance loss it would help to find the cause.

Can you quantify the difference between 1.5.4 and 1.6.3? I'm assuming you weren't getting 60 fps in God of War in 1.5.4 (that's a bit hard to believe given how heavy that game is), so it'd help to know the fps for 1.5.4 and 1.6.3 in that game in the same scene.

-[Unknown]

luizthiagor commented 6 years ago

I've not in 60fps in God Of war, because it's a very heavy game, yes, but in 1.5.4 with the specific settings (frameskip auto and 2) i've running in the 18/30FPS ...in 1.6.3 , running in 10 - 12/30 fps wich the same settings ...

i've tried other games too, like ratchet and clank and others and all is a bit more slow than the 1.5.4 ....maybe, the github version testes can have bugs of performance.... but i can't say about this ...

luizthiagor commented 6 years ago

My performance in 1.5.4 : https://youtu.be/KlDhKyJxZHI

luizthiagor commented 6 years ago

now, you have too an Libreto Core of ppsspp ....it can be tested too in future releases of Batocera Linux by developers ..and, maybe, do an better performance .....

I believe videoCore IV present in raspberry can not have an "wonderfull speed" for some PSP games, but can be an "medium" experienced with this wonderfull ppsspp emulator

luizthiagor commented 6 years ago

The performance of ppsspp can be improved for raspberry Pi 3 ? the dev's can test this ?

unknownbrackets commented 6 years ago

It's hard to say without seeing which changes specifically affected performance.

Most mobile devices, weak and strong, benefited from the changes, and there were some pretty significant ones. It would be very hard to make the changes "optional" just for rpi3.

However, it could just be one small part of them causing the problem, which might be a lot easier to work around. The hard part is identifying if and what part, but if you're able to compile and test builds, you can narrow it down pretty quickly.

-[Unknown]

luizthiagor commented 6 years ago

I have tested yesterday the commit :

Version.: Commits on Aug 11, 2018 (v1.6.3)

PPSSPP_VERSION = 1fdb1f785a5f179851e5672425bde7c394eeed54

So : The performance problem persists and is more visible in this commit ... Mainly in games like Ratchet and Clank / GOW etc .... (in RPI3 only)

If devs have an RPI3 it's more easy to can view this better ...

luizthiagor commented 6 years ago

i'm so sad about this ... :(

luizthiagor commented 5 years ago

I'm returned here to show all people my performances with version 1.5.4 with batocera linux 5.17 (open system with wonderfull last commit of 1.5.4). ... I'm sad about the new 1.6.3 run too slow in same hardware RPI3.

This is my performances games in 1.5.4 from batocera.linux system .....all can see even "heavy" games like God Of War - chains Of olympus can run playable in an Raspberry Pi 3 .....

https://youtu.be/XrRD-yThmns

If someday an dev of ppsspp can have an raspberry pi 3 and do an attention doing tests in RPi3 and help us, it be so greatfull !!

luizthiagor commented 5 years ago

I will teste an new build for RPI3 about batocera Linux 5.19 version :+1: In this beta build has new ppsspp 1.7 version ...maybe, can be run better than 1.6.3 ...i hope very much for this day ...because the 1.5.4 is amazing like you can see in the video posted above !!

It be so wonderfull if any day i can run the new versions of ppsspp as i can play in my Rpi3 with 1.5.4 (last commit)

luizthiagor commented 5 years ago

Friends, i returned here to say : It's possible to do an "button menu"to can "Enable/Disable" Multithreads (changes improved in ppsspp versions post 1.5.4 ?

Because, i believe this can be the cause of bad performance on 1.6.3 and newer versions in Rpi3 ...

These "Multithread" implemented in the 1.6.3 could be the best for newer and "god" hardwares, but for rpi this have hurt the performances ...since this, we stoped in 1.5.4 and cant update anymore ...

But i believe, if it's possible to do, we can disable the multithread and play well again like in older versions, no ?

Thanks for the attention

unknownbrackets commented 5 years ago

Unfortunately, it's not.

The new code was modified heavily to support this much better, and on most systems, much faster multithreaded. Asking to turn off multithreaded now is kinda like asking for an "off switch" for your spine. I'm sure there are situations where being invertebrate would be useful, just ask an octupus. But it's not practical.

We bulldozed and rebuilt buildings, paved new roads, completely altered the landscape to enable the new method of multithreading. Much of the code involved is nearly unrecognizable compared to before. It was not a tiny tweak, it was a huge redo.

There's probably something at a driver level making it not work on rpi, but we don't know what. Remember, PPSSPP is open source, and gets better the more people contribute. Just because you're not a programmer doesn't mean you can't. It might shock you, but almost zero humans are born as programmers. Instead, they learned it at some point because they were interested. Almost every human is capable of this.

You might think that bringing back the old code - setting up a complete, life-size replica of the old city from before in PPSSPP makes sense. Can't we just have both versions? But that's pointless. No one will ever implement fixes on that old version, so it's the same thing as you still using PPSSPP 1.5.4 - you'll be stuck with the same bugs. The only difference is that it would make contributing to PPSSPP harder, so PPSSPP would just get worse for everyone - and not better for rpi. That's why there are no plans to do that.

-[Unknown]

luizthiagor commented 5 years ago

yes, I understand your position ... it's really a shame that there is nothing to do since there really have been many code changes to allow the multithread .... I thought it would be easier to create a "on / off" button "for this in which the default would be ON, but could be changed to OFF not only in rpi3 but also in other slower devices helping them .... maybe someone can also help with the inclusion of patch fixes like what mrfixit2001 did that is below:   --- a / SDL / SDLMain.cpp +++ b / SDL / SDLMain.cpp @@ -340,6 +340,14 @@  #undef main  #endif  int main (int argc, char * argv []) { +

This patch seems to cause CPU affinity to work only on a core by avoiding multithreading and improving performance, but it still needs improving so maybe working more on code to "block" multitasking for slower devices ....

it's a shame that the big emulator ppsspp has lost performance after version 1.6.3 because it is excellent, and unfortunately, although version 1.5.4 runs very well on raspberry, it has its bugs and impediments to playing some games ... .

unknownbrackets commented 5 years ago

Try this command:

echo 5 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

You can view the clock speed of your pi with:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

The problem is that now that we're using more threads, and waiting more on the GPU driver (because we got so efficient), the CPU is doing less than 50% (as seen with htop.) So the CPU clocks down, e.g. a Pi3 goes from 1.2 Ghz to 0.6 Ghz.

This is one of those unfortunate issues with temperature scaling. The command I gave will cause the Pi to scale up significantly more often (if cpu is > 5%) and should bring performance back to - or likely better than - before.

Another tip: you probably want to increase GPU RAM using sudo raspi-config and verify it has increased after a reboot with sudo vcgencmd get_mem gpu.

Does that help?

-[Unknown]

unknownbrackets commented 5 years ago

It sounds likely these issues are related to temperature scaling - there haven't been any comments since. We care about performance but sometimes, especially on devices that do aggressive CPU scaling, it can actually get slower when you make it faster.

Lukcily, the Raspberry Pi has options to tune how aggressively it underclocks the CPU.

If that's not working, comment here and we'll reopen.

-[Unknown]