Trixarian / NetherSX2-patch

Unofficial Patches for NetherSX2
https://discord.gg/6cGWCrqAw5
The Unlicense
821 stars 33 forks source link

No Support for CHDman "createdvd" #37

Open VorgonBattlecruiser opened 9 months ago

VorgonBattlecruiser commented 9 months ago

When the CHD is created with a newer version of CHDman using the newly added command "createdvd", instead of "createcd" as was used before, the image isnt recognized.

Trixarian commented 9 months ago

"createdvd" was added to MAME (and CHDman) at the end of May 2023, with most emulators only adding support for it from mid August 2023 to late October 2023. The core AetherSX2 4248, and subsequently NetherSX2, uses is from the March 12th, 2023 build of PCSX2 Nightly, a good 5 months before PCSX2 added support for it

Basically, its way too new for the core used with AetherSX2/NetherSX2. It may be possible to update the libchd compiled into it by reverse engineering the code for the core (since Talhreth left us without any source code). We're not there yet, but this may change in the future

Trixarian commented 9 months ago

For now I suggest converting the chd files back to iso, then recompressing them to chd using createcd

VorgonBattlecruiser commented 9 months ago

Yeah, i mean, its fine. Only noticed this when i wanted to add two games (using createdvd) to my collection (all createcd). Noticed they wouldnt load and thought i should say something. Thanks for keeping this all going!

OneOfaKindDPC commented 3 months ago

Hey there, is there any chance of revisiting this? apparently there are performance gains to be had by using the createdvd with hunksize 2048, obviously I can't pretend to know how difficult something like this would be giving the circumstances. But I figured it wouldn't hurt to ask. Thanks for finding ways to keep this going

Trixarian commented 3 months ago

There is no in-game performance difference using either type of CHD, if that's that you're asking. The performance difference is in the compression and decompression step, and most people wouldn't notice the difference in the latter while the prior takes slightly longer with createdvd

OneOfaKindDPC commented 3 months ago

The PPSSPP community seems to disagree, but you'd know more about this than I do... I'm just reading on the internet. This thread sums up most of the findings in a nutshell, I figure it's easier than spamming a bunch of links. Maybe it makes more sense to you, I will say it's night and day performance on PPSSPP on 1.17.1. I haven't tried it on PCSX2, but the belief is it's effects both PPSSPP and PCSX2.

https://github.com/hrydgard/ppsspp/issues/18798

Trixarian commented 3 months ago

That's because the PPSSPP emulator complains if you use it, yet it makes no difference in performance on a modern device from what I've tested on my own Mali device.

Also look at the test case device they used to prove it - a Samsung Galaxy S9 - a device from 2018 running Mali graphics on an Exynos 9810 processor. It already struggles to emulate PSP, which is why a few extra decompression cycles - since they went and broke createcd CHD generation when they initial implemented createdvd - would have a performance impact on such a device. Any device powerful enough to run PS2 or GameCube emulation wouldn't have this issue however, much less more powerful computers

They fixed the issue in later versions of chdman, and sped up the compression process of createdvd significantly, making it even less of an issue

Trixarian commented 3 months ago

But for fairness sake, let's test it with 1.9 dev using createcd chd and the original iso using a game I know has video issues on my phone like Tales of Destiny DC. Watch this space

OneOfaKindDPC commented 3 months ago

I don't know what's considered a modern device, but I can tell you first hand there with PPSSPP there is definitely a performance difference on my 35xx sp and my odin 2 pro. But I don't know how that translates to ps2 emulation yet, still working on converting my ps2 games. But I can test it on my ROG Ally if that would help.

Trixarian commented 3 months ago

Just tested with an newly patched iso and made a createcd chd file based on it using the latest mame 0.266 version of chdman. I note zero performance difference in NetherSX2. Both the FMV and the game still runs at the same FPS, and suffer the same kind of FPS dips at native, although oddly it's more frequent with the iso than the chd file during gameplay - which is... something. Using 3x upscaling performance stays somewhat equal between iso and chd, although iso is again hit harder with the FPS dips than CHD - which is really really weird

I'd consider anything that can run PS2 and GameCube emulation as modern - which at the bare minimum has at least 2x A75 cores or better. So that would be true of the Odin 2 Pro, and not with the Anbernic 35XX SP which only has A53 cores, making it even weaker than the Samsung S9 in the above example. You'd definitely feel those extra cycles with the Anbernic, making cso the better choice for compression with PSP games on that device

Further testing is needed, and games in the PS2 catalogue where it has a more notable effect needs to be found, probably something that does a lot of streaming off the disc. For now it seems chd files are more performant than straight up using isos with NetherSX2 - which wasn't the result I was expecting

OneOfaKindDPC commented 3 months ago

I appreciate your time and quick responses either way

Zadeis commented 3 months ago

Another thing to consider, though likely may be infeasible depending on how this is added via your patching method, is support for newer compression methods.

If you are just updating the version of chdman then this will come with supporting the createdvd format. Newer compression methods may differ on compression ratios however some are more performant than others, namely zstd, for many applications and is the preferred compression method for other emulators (e.g. dolphin and it's rvz file format).

Just another thing to consider, and gain, should the chdman version within be updated.

OneOfaKindDPC commented 3 months ago

Another thing to consider, though likely may be infeasible depending on how this is added via your patching method, is support for newer compression methods.

If you are just updating the version of chdman then this will come with supporting the createdvd format. Newer compression methods may differ on compression ratios however some are more performant than others, namely zstd, for many applications and is the preferred compression method for other emulators (e.g. dolphin and it's rvz file format).

Just another thing to consider, and gain, should the chdman version within be updated.

Yes, I didn't do a very good job getting that part across, the new chdman script for psp and ps2 chd files if zstd is supported is:

for /r %%i in (.cue, .gdi, *.iso) do chdman createdvd -hs 2048 -c zstd,zlib,huff,flac -i "%%i" -o "%%~ni.chd"