Currently, the CHD (V5) format suffers from architectural limitations that prevent it from storing critical CD metadata, specifically:Multi-index Tracks: The format drops secondary index markers (Index 00, Index 02+, etc.), which causes accurate sub-track split points and audio pre-gaps to be permanently lost (Ref: mamedev/mame#10308).Disc-level Meta Tags: Header-level tags inside .cue files—such as CATALOG (UPC/EAN barcodes) and ISRC codes—are stripped entirely during conversion (Ref: mamedev/mame#15529, #15214).While the upstream MAME team focuses primarily on arcade preservation (where these Redump-style subchannel specifics are rarely utilized), libchdr is the de facto standard for console emulators (e.g., RetroArch cores, DuckStation, Flycast, and standalone Saturn/Sega CD emulators). For home console emulation, the absence of this data directly causes breaking gameplay and audio bugs.Since modifying the core CHD format requires a V6 specification—which has been stalled in MAME's roadmap for years—I propose a pragmatic, decentralized solution implemented directly within libchdr: Sidecar Metadata File Support.
Proposed Solution:
Sidecar Metadata File (.chd.meta)Instead of altering the compressed .chd binary file, libchdr can look for an optional companion text-based sidecar file sharing the same base filename (e.g., Game.chd paired with Game.chd.meta).When libchdr initializes a CHD image, it will check for this sidecar file. If present, it will dynamically inject the missing indices, catalog codes, and track metadata back into the virtual layout structure delivered to the core emulator.
Why This is Necessary & Key Benefits
- Perfect Console Emulation CompatibilityCertain platforms—most notably the Sega Saturn and Sega CD—rely strictly on precise multi-index track timing or sub-code data to bypass copy protection, trigger CD audio tracks, or sync in-game events. This enhancement allows libchdr to parse these games flawlessly without forcing users to revert to bulky, uncompressed .bin/.cue rips.
- 100% Backward Compatibility with Existing ArchivesUsers will not need to re-compress their massive, terabyte-scale collections of existing CHD V5 files. They only need to generate a tiny sidecar file (a few hundred bytes) exclusively for the specific games that require it.
- Bypassing MAME's Stalled V6 RoadmapThe upstream MAME team has shown long-term hesitation regarding the CHD V6 development path, leaving these format bugs in limbo. Furthermore, upstream MAME naturally deprioritizes non-arcade console edge cases. Implementing this feature directly inside libchdr empowers the console emulation scene to resolve these long-standing issues independently.
Currently, the CHD (V5) format suffers from architectural limitations that prevent it from storing critical CD metadata, specifically:Multi-index Tracks: The format drops secondary index markers (Index 00, Index 02+, etc.), which causes accurate sub-track split points and audio pre-gaps to be permanently lost (Ref: mamedev/mame#10308).Disc-level Meta Tags: Header-level tags inside .cue files—such as CATALOG (UPC/EAN barcodes) and ISRC codes—are stripped entirely during conversion (Ref: mamedev/mame#15529, #15214).While the upstream MAME team focuses primarily on arcade preservation (where these Redump-style subchannel specifics are rarely utilized), libchdr is the de facto standard for console emulators (e.g., RetroArch cores, DuckStation, Flycast, and standalone Saturn/Sega CD emulators). For home console emulation, the absence of this data directly causes breaking gameplay and audio bugs.Since modifying the core CHD format requires a V6 specification—which has been stalled in MAME's roadmap for years—I propose a pragmatic, decentralized solution implemented directly within libchdr: Sidecar Metadata File Support.
Proposed Solution:
Sidecar Metadata File (.chd.meta)Instead of altering the compressed .chd binary file, libchdr can look for an optional companion text-based sidecar file sharing the same base filename (e.g., Game.chd paired with Game.chd.meta).When libchdr initializes a CHD image, it will check for this sidecar file. If present, it will dynamically inject the missing indices, catalog codes, and track metadata back into the virtual layout structure delivered to the core emulator.
Why This is Necessary & Key Benefits