mamedev / mame

MAME
https://www.mamedev.org/
Other
8.02k stars 1.99k forks source link

CHD does not store CD track indexes from cuesheet #10308

Open Senemu opened 2 years ago

Senemu commented 2 years ago
Example input cuesheet
```cue-sheet FILE "purikura.bin" BINARY TRACK 01 MODE1/2352 INDEX 01 00:00:00 TRACK 02 AUDIO INDEX 00 15:49:15 INDEX 01 15:51:15 TRACK 03 AUDIO INDEX 00 18:09:16 INDEX 01 18:11:15 TRACK 04 AUDIO INDEX 00 20:29:17 INDEX 01 20:31:16 TRACK 05 AUDIO INDEX 00 22:49:18 INDEX 01 22:51:17 TRACK 06 AUDIO INDEX 00 25:09:19 INDEX 01 25:11:18 TRACK 07 AUDIO INDEX 00 27:29:20 INDEX 01 27:31:19 TRACK 08 AUDIO INDEX 00 29:49:21 INDEX 01 29:51:20 TRACK 09 AUDIO INDEX 00 31:53:51 INDEX 01 31:55:50 TRACK 10 AUDIO INDEX 00 33:24:34 INDEX 01 33:26:33 TRACK 11 AUDIO INDEX 00 35:08:06 INDEX 01 35:10:05 TRACK 12 AUDIO INDEX 00 37:10:65 INDEX 01 37:12:64 TRACK 13 AUDIO INDEX 00 39:06:17 INDEX 01 39:08:16 TRACK 14 AUDIO INDEX 00 40:57:23 INDEX 01 40:59:22 TRACK 15 AUDIO INDEX 00 43:11:54 INDEX 01 43:13:53 TRACK 16 AUDIO INDEX 00 45:01:71 INDEX 01 45:03:70 TRACK 17 AUDIO INDEX 00 45:19:49 INDEX 01 45:21:48 TRACK 18 AUDIO INDEX 00 45:33:27 INDEX 01 45:35:26 TRACK 19 AUDIO INDEX 00 45:43:17 INDEX 01 45:45:16 TRACK 20 AUDIO INDEX 00 45:51:66 INDEX 01 45:53:65 TRACK 21 AUDIO INDEX 00 46:02:64 INDEX 01 46:04:63 TRACK 22 AUDIO INDEX 00 48:09:68 INDEX 01 48:11:67 TRACK 23 AUDIO INDEX 00 50:39:24 INDEX 01 50:41:23 TRACK 24 AUDIO INDEX 00 53:36:23 INDEX 01 53:38:22 INDEX 02 53:41:00 INDEX 03 53:44:05 INDEX 04 53:48:33 INDEX 05 53:51:57 INDEX 06 53:55:05 INDEX 07 53:58:28 INDEX 08 54:01:50 INDEX 09 54:06:03 INDEX 10 54:09:08 TRACK 25 AUDIO INDEX 00 54:13:36 INDEX 01 54:15:35 INDEX 02 54:20:34 INDEX 03 54:29:63 INDEX 04 54:33:73 INDEX 05 54:45:61 INDEX 06 54:50:14 INDEX 07 54:53:57 INDEX 08 54:58:51 INDEX 09 55:03:11 INDEX 10 55:07:55 INDEX 11 55:11:03 INDEX 12 55:14:16 INDEX 13 55:23:39 INDEX 14 55:26:72 INDEX 15 55:30:30 INDEX 16 55:35:62 TRACK 26 AUDIO INDEX 00 55:40:35 INDEX 01 55:42:34 INDEX 02 55:48:25 INDEX 03 55:58:22 INDEX 04 56:07:59 INDEX 05 56:14:02 INDEX 06 56:21:12 INDEX 07 56:26:07 INDEX 08 56:29:57 INDEX 09 56:35:41 INDEX 10 56:39:45 INDEX 11 56:43:33 INDEX 12 56:48:16 INDEX 13 56:53:64 INDEX 14 57:00:57 TRACK 27 AUDIO INDEX 00 57:08:19 INDEX 01 57:10:18 INDEX 02 57:16:35 INDEX 03 57:20:64 INDEX 04 57:26:41 INDEX 05 57:29:37 INDEX 06 57:34:56 INDEX 07 57:38:51 INDEX 08 57:41:54 INDEX 09 57:45:66 TRACK 28 AUDIO INDEX 00 57:50:18 INDEX 01 57:52:17 INDEX 02 57:55:47 INDEX 03 58:02:59 INDEX 04 58:06:07 INDEX 05 58:15:10 INDEX 06 58:19:04 INDEX 07 58:23:03 INDEX 08 58:26:13 INDEX 09 58:33:64 INDEX 10 58:38:17 INDEX 11 58:44:04 INDEX 12 58:49:51 INDEX 13 58:56:10 INDEX 14 59:01:38 INDEX 15 59:08:74 INDEX 16 59:12:12 INDEX 17 59:17:09 INDEX 18 59:21:44 INDEX 19 59:28:41 INDEX 20 59:32:50 INDEX 21 59:38:23 INDEX 22 59:43:09 INDEX 23 59:48:63 TRACK 29 AUDIO INDEX 00 59:53:03 INDEX 01 59:55:02 INDEX 02 60:02:29 INDEX 03 60:07:11 INDEX 04 60:15:33 INDEX 05 60:17:63 INDEX 06 60:23:12 INDEX 07 60:28:18 INDEX 08 60:35:18 TRACK 30 AUDIO INDEX 00 60:39:63 INDEX 01 60:41:62 INDEX 02 60:49:67 INDEX 03 60:56:02 INDEX 04 61:00:36 INDEX 05 61:08:67 INDEX 06 61:14:15 INDEX 07 61:22:08 TRACK 31 AUDIO INDEX 00 61:30:47 INDEX 01 61:32:46 INDEX 02 61:41:39 INDEX 03 61:47:12 INDEX 04 61:50:28 INDEX 05 61:57:74 INDEX 06 62:01:28 TRACK 32 AUDIO INDEX 00 62:07:13 INDEX 01 62:09:12 INDEX 02 62:18:48 INDEX 03 62:22:49 INDEX 04 62:33:03 INDEX 05 62:39:07 INDEX 06 62:42:53 INDEX 07 62:50:05 ```
CHD creation
```console $ chdman createcd -i "purikura.cue" -o "purikura.chd" chdman - MAME Compressed Hunks of Data (CHD) manager 0.247 (unknown) Output CHD: purikura.chd Input file: purikura.cue Input tracks: 32 Input length: 62:56:22 Compression: cdlz (CD LZMA), cdzl (CD Deflate), cdfl (CD FLAC) Logical size: 693,459,648 Compression complete ... final ratio = 52.7% ```
CHD information
```console $ chdman info -v -i "purikura.chd" chdman - MAME Compressed Hunks of Data (CHD) manager 0.247 (unknown) Input file: purikura.chd File Version: 5 Logical size: 693,459,648 bytes Hunk Size: 19,584 bytes Total Hunks: 35,410 Unit Size: 2,448 bytes Total Units: 283,276 Compression: cdlz (CD LZMA), cdzl (CD Deflate), cdfl (CD FLAC) CHD size: 365,490,028 bytes Ratio: 52.7% SHA1: d5bd4c7df597101def2081b548bc1f07932e67d1 Data SHA1: e4af08ad9e0953398db4a00e0ba2206f6e4d41f4 Metadata: Tag='CHT2' Index=0 Length=92 bytes TRACK:1 TYPE:MODE1_RAW SUBTYPE:NONE FRAMES:71190 PREGAP:0 PGTYPE:MODE1 PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=1 Length=91 bytes TRACK:2 TYPE:AUDIO SUBTYPE:NONE FRAMES:10501 PREGAP:150 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=2 Length=91 bytes TRACK:3 TYPE:AUDIO SUBTYPE:NONE FRAMES:10501 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=3 Length=91 bytes TRACK:4 TYPE:AUDIO SUBTYPE:NONE FRAMES:10501 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=4 Length=91 bytes TRACK:5 TYPE:AUDIO SUBTYPE:NONE FRAMES:10501 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=5 Length=91 bytes TRACK:6 TYPE:AUDIO SUBTYPE:NONE FRAMES:10501 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=6 Length=91 bytes TRACK:7 TYPE:AUDIO SUBTYPE:NONE FRAMES:10501 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=7 Length=90 bytes TRACK:8 TYPE:AUDIO SUBTYPE:NONE FRAMES:9330 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=8 Length=90 bytes TRACK:9 TYPE:AUDIO SUBTYPE:NONE FRAMES:6808 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=9 Length=91 bytes TRACK:10 TYPE:AUDIO SUBTYPE:NONE FRAMES:7772 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=10 Length=91 bytes TRACK:11 TYPE:AUDIO SUBTYPE:NONE FRAMES:9209 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=11 Length=91 bytes TRACK:12 TYPE:AUDIO SUBTYPE:NONE FRAMES:8652 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=12 Length=91 bytes TRACK:13 TYPE:AUDIO SUBTYPE:NONE FRAMES:8331 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=13 Length=92 bytes TRACK:14 TYPE:AUDIO SUBTYPE:NONE FRAMES:10081 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=14 Length=91 bytes TRACK:15 TYPE:AUDIO SUBTYPE:NONE FRAMES:8267 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=15 Length=91 bytes TRACK:16 TYPE:AUDIO SUBTYPE:NONE FRAMES:1328 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=16 Length=91 bytes TRACK:17 TYPE:AUDIO SUBTYPE:NONE FRAMES:1028 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=17 Length=90 bytes TRACK:18 TYPE:AUDIO SUBTYPE:NONE FRAMES:740 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=18 Length=90 bytes TRACK:19 TYPE:AUDIO SUBTYPE:NONE FRAMES:649 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=19 Length=90 bytes TRACK:20 TYPE:AUDIO SUBTYPE:NONE FRAMES:823 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=20 Length=91 bytes TRACK:21 TYPE:AUDIO SUBTYPE:NONE FRAMES:9529 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=21 Length=92 bytes TRACK:22 TYPE:AUDIO SUBTYPE:NONE FRAMES:11206 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=22 Length=92 bytes TRACK:23 TYPE:AUDIO SUBTYPE:NONE FRAMES:13274 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=23 Length=91 bytes TRACK:24 TYPE:AUDIO SUBTYPE:NONE FRAMES:2788 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=24 Length=91 bytes TRACK:25 TYPE:AUDIO SUBTYPE:NONE FRAMES:6524 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=25 Length=91 bytes TRACK:26 TYPE:AUDIO SUBTYPE:NONE FRAMES:6584 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=26 Length=91 bytes TRACK:27 TYPE:AUDIO SUBTYPE:NONE FRAMES:3149 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=27 Length=91 bytes TRACK:28 TYPE:AUDIO SUBTYPE:NONE FRAMES:9210 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=28 Length=91 bytes TRACK:29 TYPE:AUDIO SUBTYPE:NONE FRAMES:3510 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=29 Length=91 bytes TRACK:30 TYPE:AUDIO SUBTYPE:NONE FRAMES:3809 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=30 Length=91 bytes TRACK:31 TYPE:AUDIO SUBTYPE:NONE FRAMES:2741 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Metadata: Tag='CHT2' Index=31 Length=91 bytes TRACK:32 TYPE:AUDIO SUBTYPE:NONE FRAMES:3684 PREGAP:149 PGTYPE:VAUDIO PGSUB:NONE POSTGAP:0. Hunks Percent Name ---------- ------- ------------------------------------ 2,355 6.7% Copy from self 9,370 26.5% CD LZMA 22 0.1% CD Deflate 23,663 66.8% CD FLAC ```
CHD extraction
```console $ chdman extractcd -i "purikura.chd" -o "purikura.cue" chdman - MAME Compressed Hunks of Data (CHD) manager 0.247 (unknown) Output TOC: purikura.cue Output Data: purikura.bin Input CHD: purikura.chd Extraction complete ```
Extracted cuesheet
```cue-sheet FILE "purikura.bin" BINARY TRACK 01 MODE1/2352 INDEX 01 00:00:00 TRACK 02 AUDIO INDEX 00 15:49:15 INDEX 01 15:51:15 TRACK 03 AUDIO INDEX 00 18:09:16 INDEX 01 18:11:15 TRACK 04 AUDIO INDEX 00 20:29:17 INDEX 01 20:31:16 TRACK 05 AUDIO INDEX 00 22:49:18 INDEX 01 22:51:17 TRACK 06 AUDIO INDEX 00 25:09:19 INDEX 01 25:11:18 TRACK 07 AUDIO INDEX 00 27:29:20 INDEX 01 27:31:19 TRACK 08 AUDIO INDEX 00 29:49:21 INDEX 01 29:51:20 TRACK 09 AUDIO INDEX 00 31:53:51 INDEX 01 31:55:50 TRACK 10 AUDIO INDEX 00 33:24:34 INDEX 01 33:26:33 TRACK 11 AUDIO INDEX 00 35:08:06 INDEX 01 35:10:05 TRACK 12 AUDIO INDEX 00 37:10:65 INDEX 01 37:12:64 TRACK 13 AUDIO INDEX 00 39:06:17 INDEX 01 39:08:16 TRACK 14 AUDIO INDEX 00 40:57:23 INDEX 01 40:59:22 TRACK 15 AUDIO INDEX 00 43:11:54 INDEX 01 43:13:53 TRACK 16 AUDIO INDEX 00 45:01:71 INDEX 01 45:03:70 TRACK 17 AUDIO INDEX 00 45:19:49 INDEX 01 45:21:48 TRACK 18 AUDIO INDEX 00 45:33:27 INDEX 01 45:35:26 TRACK 19 AUDIO INDEX 00 45:43:17 INDEX 01 45:45:16 TRACK 20 AUDIO INDEX 00 45:51:66 INDEX 01 45:53:65 TRACK 21 AUDIO INDEX 00 46:02:64 INDEX 01 46:04:63 TRACK 22 AUDIO INDEX 00 48:09:68 INDEX 01 48:11:67 TRACK 23 AUDIO INDEX 00 50:39:24 INDEX 01 50:41:23 TRACK 24 AUDIO INDEX 00 53:36:23 INDEX 01 53:38:22 TRACK 25 AUDIO INDEX 00 54:13:36 INDEX 01 54:15:35 TRACK 26 AUDIO INDEX 00 55:40:35 INDEX 01 55:42:34 TRACK 27 AUDIO INDEX 00 57:08:19 INDEX 01 57:10:18 TRACK 28 AUDIO INDEX 00 57:50:18 INDEX 01 57:52:17 TRACK 29 AUDIO INDEX 00 59:53:03 INDEX 01 59:55:02 TRACK 30 AUDIO INDEX 00 60:39:63 INDEX 01 60:41:62 TRACK 31 AUDIO INDEX 00 61:30:47 INDEX 01 61:32:46 TRACK 32 AUDIO INDEX 00 62:07:13 INDEX 01 62:09:12 ```

Data is identical, but audio track indexes beyond 01 are missing.

ghost commented 2 years ago

Yeah, I've noticed this before.

I've got some audio CDs with an absolute ton of index positions to mark different sections of the songs, they get lost on conversion, always have done even dating back to when CD support was first added.

cuavas commented 2 years ago

Index markers are just a subchannel field. If you use a raw sector format for the data, the index markers will be preserved correctly.

Senemu commented 2 years ago

Index markers are just a subchannel field. If you use a raw sector format for the data, the index markers will be preserved correctly.

This seems to work. Not in MAME, but I can extract the CHD to bin/toc and that works correctly in another Sega Saturn emulator.

bin/cue output is still incomplete, but chdman warns about that.

I have updated the title of this issue to clarify my original problem.

chdman discarding input data without warning is unexpected.

The bin/cue file should work to create a good CHD, since it contains all the required information.

Otherwise, there should be a warning about the conversion being lossy.

cuavas commented 2 years ago

Yeah, we’re aware not all TOC and CUE directives are supported (IIRC TOC zero fill is another thing that isn’t handled).

vmicka72 commented 3 months ago

Indexes informations are lost when creating the CHD. Index informations are stored in Q-subdata. So reading CHD with sbi/lsd file containing subchannel datas is not sufficient to have all informations?

rb6502 commented 3 months ago

CHD-CD was not intended as a bulletproof archival format, and people trying to use it as one are fooling themselves. Use CHD to save disk space, but always keep your original-format rips if you care about that stuff.

That said, index handling is significantly better after recent changes by @987123879113 . Multi-session discs, track flags, and indexes all have much better support now.

zakk4223 commented 4 days ago

Indexes informations are lost when creating the CHD. Index informations are stored in Q-subdata. So reading CHD with sbi/lsd file containing subchannel datas is not sufficient to have all informations?

If you created a chd with sbi/lsd subchannel data AND the process preserved it in the CHD (which I believe it should). The indices are there, it's just that the applications consuming the CHD will have to extract the subchannel data themselves and parse through it for index data. If you created it from a cue file with INDEX elements, it will not do anything with those.

It doesn't feel like there's much support for extending the metadata tags for this stuff in the CHD, so my suggestion would be to only create your chds from rips that have the subchannel data, and encourage your application developers to consume the subchannel data appropriately.

HeroponRikiBestest commented 4 days ago

CHD-CD was not intended as a bulletproof archival format, and people trying to use it as one are fooling themselves. Use CHD to save disk space, but always keep your original-format rips if you care about that stuff.

That said, index handling is significantly better after recent changes by @987123879113 . Multi-session discs, track flags, and indexes all have much better support now.

While I definitely agree that CHD isn't a bulletproof archival format, and shouldn't be used for that purpose, the lack of proper index support does result in issues in games in mame already. There are likely at least a few games that are affected by this issue; drawing from redump's database, the list of games that have at least one track that goes up to index 02 or higher are:

index02.txt

One game I already know of that's impacted by this on MAME is Taito Chase H.Q. + S.C.I. on Sega Saturn. The issue is similar to the one described here: https://github.com/tpunix/SAROO/issues/136

The problem is that each game has only one audio track. They are multi-track [I think they mean multi-index here], contain several voices (radio) that must be played at different times and only play the first time.

In the fenrir it stays played on a loop

MAME suffers the same issue as well, using MAME's software list CHD for Saturn chase hq http://adb.arcadeitalia.net/?mess=chasehqs&list=saturn sha256sum 798cd1eaa030757631518e0e766d3f5177221547a63277a81d545b50d07bd68e taito chase h.q. + s.c.i. (japan) [t-1105g].chd

https://github.com/user-attachments/assets/8701d08a-4826-43d0-a208-552e399e7177

The above is recorded from latest MAME commit. Each radio voice snippet is supposed to just play on the dashboard screen at the start of each level, but instead it just plays the entire track over and over for as long as you continue playing. Real disc on real hardware, for comparison:

https://youtu.be/pvJJkfn5uhQ?t=15

And, redump.org's cuesheet for the game, so you can see what I mean better: http://redump.org/disc/23663/ image (there are two games on this disc that use radio, hence two tracks having a bunch of indexes)

Taito Chase H.Q. + S.C.I. (Japan).cue.txt

While I haven't tested it, I saw the issue with the "Monster Slider" game that mentioned this issue 2 years ago at https://github.com/MiSTer-devel/Saturn_MiSTer/issues/123, and given what's described there, I'd assume that game likely has the same issues on MAME as it did in its linked MiSTer issue.

This is a particularly noticeable issue- SSF appears to have even had a specific hack for this game to make it work right- but given how many titles are in the text file I posted above, there's likely at least a few other games that will suffer from inaccuracies. Given that CHD is regardless the "main" format MAME uses for CD-based games, and the fact that redump and other similar databases for game dumping use cuesheets or similar approaches due to the inherent non-reproducibility of raw subchannel dumps, MAME should add support for storing cuesheet track indexes when converting to chd, or just generate the subchannel data using the track indexes from the cuesheet. Barring either of those, it should at least support reading track indexes from cuesheets a user supplies themselves. At best you could refine to 0 subchannel errors with two relatively pristine copies of the same disc and some luck, and even then, the limited error correction for subchannel data means there can still potentially be incorrect data.

If you created a chd with sbi/lsd subchannel data AND the process preserved it in the CHD (which I believe it should). The indices are there, it's just that the applications consuming the CHD will have to extract the subchannel data themselves and parse through it for index data.

Where did you hear this? SBI/LSD files are, to my knowledge, exclusively for storing the list of subchannel sectors where PSX libcrypt and pre-v4.75 PC SecuROM protected discs have deliberately incorrect CRC16 subchannel hashes, as well as the hashes for said subchannel sectors. I am not aware of any other data it stores beyond what is needed to either make libcrypt function, or make pre-v4.75 SecuROM discs function in the event that your ODE can't return the fallback mode flip check correctly, and that data certainly does not include track indexes.

zakk4223 commented 4 days ago

Sorry, misspoke/was looking at an earlier comment and just autopiloted.

I meant .sub. I have some rips of CD+G audio discs in bin/cue/sub and digging in the SUB files it looks like they contain the Q-channel data (although I'm just staring at hex dumps so I could be wrong). CHD has a full 96 bytes/sector for subcode data so in theory it contains this too. I'll try to look at a converted CHD later to verify.

Unfortunately most of the systems that have this issue with multi indices seem to all be dumped with the index data in CUE files, not in a format that contains subchannel data.

I've already done a bit of work taking the changes from https://github.com/mamedev/mame/pull/12201 and getting chdman to insert those as additional metadata tags. However from the comments/discussion there it seems like mamedev would prefer the solution be actual subchannel data.

HeroponRikiBestest commented 3 days ago

Oh, .sub files sure, those contain the subchannel data for every subchannel (well, provided your dumping program dumps them properly, anyways). Either way, I hope mamedev will allow either index tags, or for chdman to generate subchannel data from the indexes, since for reproducibility/verifiability purposes, subchannel data for dumped discs generally isnt datted or saved (i.e. every redump dump made in the past ~decade has had the subchannel data dumped alongside the bin/cue, it's just not datted and ultimately discarded), and that won't change. (Except for cd+g like you mentioned, plus cd+eg, cd+midi, etc, since there's literally no other option, but as a result, any actual database with that will be a difficult challenge for obvious reasons.)

bikerspade commented 3 days ago

Index tags (and other tags) from the cuesheet are preferable vs. using a sub file. All the information in a cuesheet is deterministic (except for the filename of course) for a specific disc master, whereas .sub are never going to be deterministic in real-world practice.

p1pkin commented 3 days ago

@bikerspade

All the information in a cuesheet is deterministic (except for the filename of course) for a specific disc master, whereas .sub are never going to be deterministic in real-world practice.

this is not true. information in cue is EXACT SAME deterministic as subcodes read from CD disc, because all the information in cue is in fact information from subcodes, but obfuscated in its own cue-way.

Index tags (and other tags) from the cuesheet are preferable vs. using a sub file.

but why? just because Redump.org database and CUE format unable to handle proper original subcodes?

987123879113 commented 2 days ago

Previously I discussed with cuavas about how to handle storing the additional info in CHDs and the answer was basically to generate subchannel data for dumps that don't include subchannel data, and to make the CD-ROM emulation properly handle the subchannel data. And for extracted a CHD to bin/cue, to parse the subchannel data and write the info.

My work in https://github.com/mamedev/mame/pull/12201 was simply to get the required data from the cues into MAME in some way because I needed to add multisession support to make some games work at all, and I brought some much requested friends along with it. All of the info was needed to be able to work on more of the CD-ROM implementation.