webMAN-MOD icon indicating copy to clipboard operation
webMAN-MOD copied to clipboard

[Feature request] ps3netsrv : .chd support

Open turbosagat opened this issue 9 months ago • 4 comments

Originally created as part of the MAME project for hard-drive contents of certain arcade games, CHD (Compressed Hunks of Data) is a streamable container format that has grown to include both CD and DVD-ROM. Inside, data is in a compressed in a lossless fashion, utilising multiple compression types dependant on the type of data, in order to maximise compression ratio, into 'hunks' which are, by default, the size of a sector.

In more recent years, zstd compression has been included as part of the suite of codecs, further improving compression ratios but vastly improving decompression speeds.

For the PS1, chd compressed libraries that use zstd are, collection-dependent, about half the size of an equivalent BIN/CUE collection, with support from duckstation, ppsspp and others is already in place.

The case to add support for this format from ps3netsrv is it helps keep the ps3 hardware relevant, allowing people to continue to enjoy their hosted collections on real hardware as well as emulation, avoid friction of pkg installation steps, whilst taking advantage of smaller storage sizes and not having to manually decompress games first.

A standalone C library to work with CHD files is available here , with a c++ available in the mame repo.

Idea is this would be for PS1 discs only - chd is also the de facto storage format for PS2 games (with pcsx2 support), but ps3netsrv does not stream PS2ISO.

Perhaps at some point further in the future subject to resource limitations available to cobra this format could even be supported on the hardware itself, though that is obviously even beyond the scope of WMM.

Be good to hear your views Aldo.

turbosagat avatar Feb 23 '25 19:02 turbosagat

Thank you for the feature request. ISO compression is one of the most wanted features for PS3.

Unfortunately nobody have dedicated time to implement this feature. ps3netsrv is one of the best candidates to support the ISO compression formats due the PC doesn't have the memory limitations found on the PS3.

CHD would be a great addition. Same as other formats like ISZ or CSO would be welcome.

Unfortunately I don't' have experience using that CHD library. If you or someone else could submit a Pull Request (PR) with a working code, I could include it in the project and eventually develop over it.

By the way, if you're running ps3netsrv on a Windows environment, the native NTFS compression can be helpful to save some disk space without software modification and with minimal impact in the performance.

aldostools avatar Feb 24 '25 02:02 aldostools

I examined this a little bit. CHD is a pretty interesting because among data-specific compression it offers delta-encoding: you may have one "parent" file and "child" files with deltas. But this feature implemented only in MAME probably. ppsspp supports only single chd: https://github.com/hrydgard/ppsspp/blob/9b56c9e1f84d0f5086ee5ca3223f624d0624f48a/Core/FileSystems/BlockDevices.cpp#L603

xakep666 avatar Mar 08 '25 17:03 xakep666

In the case of PS3, I'm not sure the parent/child feature would be very helpful.

Most of the PS3 content that would benefit from CHD are ISO files (single file or multi-part file). If I understand it correctly, the parent/child deltas would be helpful for revisions and "clones" of an original file.

Probably the CHD format, if ever is supported on PS3, would need to be implemented in a "proxy" plugin similar to rawseciso. Or as as extended feature of rawseciso.

I don't think Cobra payload would have enough free space to allow compression algorithms for native support without a proxy plugin.

aldostools avatar Mar 08 '25 17:03 aldostools

I examined this a little bit. CHD is a pretty interesting because among data-specific compression it offers delta-encoding: you may have one "parent" file and "child" files with deltas. But this feature implemented only in MAME probably. ppsspp supports only single chd: https://github.com/hrydgard/ppsspp/blob/9b56c9e1f84d0f5086ee5ca3223f624d0624f48a/Core/FileSystems/BlockDevices.cpp#L603

Duckstation and PCSX2 support Parent Child CHDs

RinMaru avatar Mar 08 '25 23:03 RinMaru