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.07k stars 2.15k forks source link

Performance problems with CHD #18798

Closed master1274 closed 7 months ago

master1274 commented 7 months ago

RESOLVED:

It is CRITICAL that you use createdvd, not createcd. If your chdman doesn't support createdvd, get a new one.

Game or games this happens in

  1. Dante's Inferno 2. God of War - Chains of Olympus 3. God of War - Ghost of Sparta 4. Colin McRae Rally 2005 5. Tekken 5 Dark Resurrection 6. The Treasures of Montezuma (minis) (PSN) 7. N.O.V.A. Near Orbit Vanguard Alliance (minis) (PSN)

What area of the game / PPSSPP

Some performance problems after converting to chd

What should happen

Performance shouldn't suffer

Logs

No response

Platform

Android

Mobile device model or graphics card (GPU)

Various devices

PPSSPP version affected

Since the launch of support chd, before the current build

Last working version

Since the launch of support chd, before the current build

Graphics backend (3D API)

OpenGL / GLES

Checklist

hrydgard commented 7 months ago

You tried the same game in both CHD and ISO, and you can measure a difference? You sure?

master1274 commented 7 months ago

This list was compiled by several contributors. Of course, the games were initially tested in iso. There were no problems. I personally checked Tekken 5: Dark Resurrection and The Treasures of Montezuma. Tekken 5: Dark Resurrection was also checked in cso. There were no problems either. Because We don’t know the reasons for the problem, we just decided to pass the list here so we can check this observation.

hrydgard commented 7 months ago

How does the problem manifest itself? Are the framerates low? Choppy or slow loading of the next level?

I need to know what to look for in order to investigate. Got any video comparison?

The thing is, CHD should only affect the speed of UMD disc reading, and games are already tolerant of slow speed, so a bit of additional compression and hashing really shouldn't make much of a difference, other than slightly affecting load times maybe.

master1274 commented 7 months ago

The problem appears to be severe gaps in animation and sound. I can’t make a video from the screen, because... recording it in parallel with emulation will not allow you to record something acceptable. The device will not hold up.

hrydgard commented 7 months ago

Seems very odd to me that CHD would cause that, and if it does, it's really libchd performing poorly. We use it just as if it was the CSO backend, no difference there.

I recommend you use CSO on lower powered devices.

master1274 commented 7 months ago

I did this. After conversion, I check the image a little. If nothing is spoiled I leave it chd. If I have problems, I continue to use it. iso or cso. When I noticed problems in Tekken 5 Dark Resurrection I assumed that this was due to the size and graphics of the game. However Tekken 6 after conversion it works fine, but simple The Treasures of Montezuma spoiled. This means the reason most likely lies deeper. I think it makes sense to wait for additional reports on this issue.

HFPasfho commented 7 months ago

I'm afraid I can confirm the issue.

These recordings are made on mostly stock settings. Only changes are rendering resolution set to 4x, fps and speed counter are enabled and onscreen menu button is shown.

Game is GTA VCS. Iso image is 1.57 GB, chd is 832 MB. I can't test cso now. Smartphone is Samsung S9. CPU is Exynos 9810, storage is UFS 2.1.

https://github.com/hrydgard/ppsspp/assets/128609045/3b97ae82-e41a-4831-9c89-b408b8882be8

https://github.com/hrydgard/ppsspp/assets/128609045/99b481d6-349c-4556-b1f3-058c34369643

hrydgard commented 7 months ago

Huh, that is really surprisingly bad. Still, I'd say the problem is probably in libchd, not PPSSPP. But, probably worth looking into. Do you see this on PC as well?

hrydgard commented 7 months ago

Also, to be sure I'll be testing the same thing: Can you provide the exact command line you used to compress your GTA VCS ISO to CHD?

HFPasfho commented 7 months ago

I've never used PPSSPP or screen recording on PC. I'll try to investigate but won't be able before weekend. About conversion to chd I used chdman without changing a thing. Default script looks like this for /r %%i in (*.cue, *.gdi, *.iso) do chdman createcd -i "%%i" -o "%%~ni.chd"

hrydgard commented 7 months ago

I heard from others that the recommended command was createdvd, although it probably doesn't matter it matters!

hrydgard commented 7 months ago

Ok, i've tested both now, and that's indeed your problem.

Download a fresh version of mame and get chdman from there, then use createdvd. createdvd is what you should use for both PPSSPP and PCSX2.

I think maybe the sectors get misaligned if you use createcd, generating a lot of extra reads and work for the decompression.