-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
PPSSPP warns about bad performant CHD while using ZSTD #18925
Comments
Hm, strange. I'll look into it. |
Probably the issue is caused by what's mentioned here: #18803 (comment) Edit: yeah they changed it to 2 sectors per hunk, didn't tested, but I guess to create a valid chd now for PPSSPP, the commands should be changed to: |
My god, chdman finds ever more ways to make trouble for us.. I suppose we could add a bit of caching, which would improve performance with larger hunks, but would rather not add the complexity when a 2048 hunk size will perform just fine. |
Or just change the guide and warning message to include the specific hunk size and let people, who're in love with container format heavily linked to an arcade cabinet emulation, deal with it on their own. Edit: So seeing the format was requested and is loved by some purely based on the filesize, bothersome and complex workarounds in here would just make the format being missused and lose it's potential benefits. ~Just to vent I detest mame for one new reason, building it on windows was a chore, heh all just to get that new, broken chdman. |
People have been complaining that Variable hunk size has always been a feature of the CHD format. The hunk size is always a whole multiple of the sector size.
|
PPSSPP accesses ISOs in 2048-byte increments since it's the natural sector size, games often do things by sector. It seems ridiculous to want to create CHDs with non-native sector sizes. |
People use CHD format because they want compression. That works better with larger hunk sizes. Would you also complain that hard disk CHDs aren’t limited to 512-byte hunks to match the sector size? Compression isn’t very effective at that size because the compressor doesn’t have much to work with and won’t find much redundancy. Every emulator for CD-based systems has been working fine with the default of 8 sectors/hunk for CD-ROM/GD-ROM, and every emulator for hard disk-based systems has been working fine with the default of 16 sectors/hunk for regular ATA/SCSI hard disks. |
But before CHD, there was never any reason for us to implement sector caching. CSO is in the native sector size. So supporting the CHD format adds additional hassle. |
Why are you guys taking it out on us?
For a feature of the format that’s been there forever and works with every other emulator.
You know the users want CHD format for compression. Let’s face it, the majority of them probably aren’t asking for it for the SHA1 digests in the header or something. Giving the compressor more data gives better compression, at the cost of needing to decompress more if the software only wants a single sector. A lot of the time, software does linear reads anyway, so it’s a performance win with zlib or Zstandard due to less I/O (it’s less of a win with LZMA due to high decompression overhead).
Going out of your way to do things the hard way, then blaming the developers for it, and “detest” is pretty strong language. |
Simply because PPSSPP's I/O code relies on a 2048-byte hunk size (it's a very deep assumption, and various PSP APIs are 2048-byte block-based), we never had to support anything else before, and it was working fine with the createdvd command until you guys changed it. It's a bit frustrating. PPSSPP could probably support other hunk sizes too but it makes CHD support much less of a drop-in change than people advocating for supporting it had claimed. |
We had a bunch of PPSSPP users complaining on reddit about lower compression ratios with default
I fail to see how what these advocates did or didn’t say is our fault. Anyway, my main points are:
|
Just to note, CHD compression of PSP games is on average better with 2048 than 4096. It varies per game, but 2048 wins, so if CHD users care only about that, CHD should actually work like maxcso and test every sector size for every file to find the best compression. Good luck 😆 |
Did you compare it to 16384? Because that’s equivalent to the 8-sector hunks used for CDs. |
@cuavas I concede the point that what the advocates said isn't your fault, and as for "detesting", that's not me. I'll look into how hard it would be to at least make larger hunk sizes work faster in the common large-read cases. But the 2048-byte assumption permeates our I/O code (and the PSP's APIs) so it may be hard to avoid overlapping reads in some cases. EDIT: I found a bug causing large reads to be unnecessarily suboptimal. Fixing that might be enough, actually. |
OK, turns out our already existing block read combination code is mostly sufficient, just with a bug that made it do redundant reads. With #18931, it performs quite a bit better, so removing the warning. Still, for best performance, I'll keep recommending 2048. |
Just wanna leave this here for future reference: Edit: More stats because why not: |
Game or games this happens in
None
What area of the game / PPSSPP
using the follow command:
chdman createdvd -c "zstd,zlib,huff,flac" -i "game.iso" -o "game.chd"
the emulator identifies as bad performant CHD, zstd should be more performant than lzma...
PS: using the MAME 0.263 chdman.
What should happen
It should identify the CHD as good one.
Logs
No response
Platform
Windows
Mobile device model or graphics card (GPU)
AMD 7900 XT
PPSSPP version affected
1.17.1 (stable)
Last working version
No response
Graphics backend (3D API)
Vulkan
Checklist
The text was updated successfully, but these errors were encountered: