Jump to content


Photo

Alcohol 120% produces malformed cue sheets


  • Please log in to reply
15 replies to this topic

#1 OBattler

OBattler

    1% Member

  • +Alcohol-Customer
  • 8 posts

Posted 16 December 2024 - 03:29 AM

Pre-gaps on tracks 2 onwards are ignored for times of subsequent tracks.

As evidence, here I quote the cue sheet produced for the Japanese release of Little Big Adventure:

FILE "UNTITLED.BIN" BINARY
  TRACK 01 MODE1/2352
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    PREGAP 00:02:00
    INDEX 01 22:09:03
  TRACK 03 AUDIO
    INDEX 01 25:23:25
  TRACK 04 AUDIO
    INDEX 01 28:23:41
  TRACK 05 AUDIO
    INDEX 01 30:55:65
  TRACK 06 AUDIO
    INDEX 01 33:43:52
  TRACK 07 AUDIO
    INDEX 01 36:30:48
  TRACK 08 AUDIO
    INDEX 01 38:09:11
  TRACK 09 AUDIO
    INDEX 01 41:50:19
  TRACK 10 AUDIO
    INDEX 01 43:25:72

This is how it should be:
FILE "UNTITLED.BIN" BINARY
  TRACK 01 MODE1/2352
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    PREGAP 00:02:00
    INDEX 01 22:09:03
  TRACK 03 AUDIO
    INDEX 01 25:21:25
  TRACK 04 AUDIO
    INDEX 01 28:21:41
  TRACK 05 AUDIO
    INDEX 01 30:53:65
  TRACK 06 AUDIO
    INDEX 01 33:41:52
  TRACK 07 AUDIO
    INDEX 01 36:28:48
  TRACK 08 AUDIO
    INDEX 01 38:07:11
  TRACK 09 AUDIO
    INDEX 01 41:48:19
  TRACK 10 AUDIO
    INDEX 01 43:23:72

As evidence, this is the tracks list from the actual disc:
11 tracks: 00 5A 01 0A
Track 000: 00 14 01 00 00 00 02 00
Track 001: 00 10 02 00 00 16 0D 03
Track 002: 00 10 03 00 00 19 19 19
Track 003: 00 10 04 00 00 1C 19 29
Track 004: 00 10 05 00 00 1E 39 41
Track 005: 00 10 06 00 00 21 2D 34
Track 006: 00 10 07 00 00 24 20 30
Track 007: 00 10 08 00 00 26 0B 0B
Track 008: 00 10 09 00 00 29 34 13
Track 009: 00 10 0A 00 00 2B 1B 48
Track 010: 00 10 AA 00 00 2F 13 06

Note how track wth number 0x02 has a MSF of 22:13:03 which in the cue sheet is correctly subracted by 00:04:00 (twice 00:02:00 - once for the track 0x01 pre-gap and once for the track 0x02 pre-gap), but track 0x03 only by 00:02:00, when it should also be by 00:04:00. The lead-out track has a MSF of 47:19:06, which with 00:04:00 (ie. the correct amount) subtracted from it is 47:15:06, which indicates a total length of 212631 sectors or 500108112 bytes, which is the exact length of the corresponding .BIN file produced, but if I only substract 00:02:00 as Alcohol 120%'s produced cue sheet would have it, then I'm off by 150 sectors = 352800 bytes.

 

Would it be possible to have this fixed?

 

Thanks in advance for your time and understanding!



#2 Charalambos

Charalambos

    Support Team Member

  • Support Team
  • 5,032 posts

Posted 16 December 2024 - 08:32 PM

The problem is that the postgap/pregap data are contained in the subchannel data area of the audio disc sectors and some copy protections use this area too. So Alcohol doesn't read this area's data if you use the AudioCD datatype. it reads them if you use the AudioCD+ datatype but then you can't rip the disc in the cue/bin format. Theoretically it could have been possible for Alcohol to distinguish between the postgap/pregap data and the copy protection data but until now this hasn't been accomplished.



#3 NARS

NARS

    Forum Administration

  • Administration
  • 2,816 posts

Posted 16 December 2024 - 10:24 PM

Anyway, I will ask our developer to look at this topic. Thank you.



#4 OBattler

OBattler

    1% Member

  • +Alcohol-Customer
  • 8 posts

Posted 17 December 2024 - 12:13 AM

The problem is that the postgap/pregap data are contained in the subchannel data area of the audio disc sectors and some copy protections use this area too. So Alcohol doesn't read this area's data if you use the AudioCD datatype. it reads them if you use the AudioCD+ datatype but then you can't rip the disc in the cue/bin format. Theoretically it could have been possible for Alcohol to distinguish between the postgap/pregap data and the copy protection data but until now this hasn't been accomplished.

While you're correct, the problem here is simply mathematical - Alcohol 120% forgets to shift the other tracks' times by the pregap's length, resulting in there being <pre-gap length> of extra time between the track with the pre-gap and the track that follows - see above, how track 02 (which has 00:02:00 of pre-gap) length is at 22:09:03 and track 03 at 25:23:25 - on the actual disc, they are at 22:13:03 and 25:25:25, so since 00:04:00 (pre-gap of track 01 - correctly omitted from the cue sheet - and pre-gap of track 02) was subtracted from track 02's time, it should have been subtracted to track 03 (and the track afterwards) time as well, so track 03 in the cue sheet should be at 25:21:25 (= 25:25:25 - 00:04:00).



#5 Charalambos

Charalambos

    Support Team Member

  • Support Team
  • 5,032 posts

Posted 17 December 2024 - 08:15 PM

It seems simple but it isn't, you can search and read about the subchannel data yourself if you want.



#6 OBattler

OBattler

    1% Member

  • +Alcohol-Customer
  • 8 posts

Posted 18 December 2024 - 09:36 AM

What does the subchannel data have to do with anything here? It's completely irrelevant. Do the maths - see the distance between 22:13:03 and 25:25:25 (times from the TOC on the actual disc), and then see the distance between 22:09:03 and 25:23:25 (times from the cue sheet produced by Alcohol 120%). They don't match. And they should. Cue sheets produced by Redumper or DiscImageCreator do not have such a problem, in fact, my own parser that reconstructs the TOC form a cue sheet produces incorrect results from Alcohol 120%'s cue sheet if I make it produce the correct results from the other two's cue sheets, and vice-versa.

 

And I've read up on everything - I've spent the entire last month reading the ATAPI, Red Book, etc. specifications since I've been fixing the CD-ROM code in my own emulator.



#7 Charalambos

Charalambos

    Support Team Member

  • Support Team
  • 5,032 posts

Posted 18 December 2024 - 08:22 PM

The subchannel data area has 8 subunits, P to W. The postgap/pregap is coded in the P and Q subunits. The rest are for CD text (basically the titles of the songs). Some copy protections use these 8 subunits in a different way in order to copy protect the audio CDs. I can't explain more (there is no more to explain in fact).

If you want anyway each audio CD sector is 2356 bytes (audio data) + 96 bytes (subchannel data) = 2448 bytes. Each subunit from P to W is 96/8 = 16 bytes. Now I really have nothing more to say. :huh:



#8 OBattler

OBattler

    1% Member

  • +Alcohol-Customer
  • 8 posts

Posted 19 December 2024 - 12:45 AM

Yes, I'm aware of that. The ATAPI and Red book specifications say as much. But how exactly does it disprove what I'm saying here?



#9 OBattler

OBattler

    1% Member

  • +Alcohol-Customer
  • 8 posts

Posted 19 December 2024 - 08:13 PM

So I just wrote some simple code to calculate track size (including pre-gaps and post-gaps) from the subchannel data and this has revealed that the TOC entries are indeed of Index 1's (that much I already knew from reading the specification), but *every* audio track also has 150 frames of pregap that are not marked as such in the cue sheet (they should be marked as INDEX 0 instead of PREGAP), and are instead implied to belong to the preceding track. This makes the resulting cue sheet even less accurate.



#10 Charalambos

Charalambos

    Support Team Member

  • Support Team
  • 5,032 posts

Posted 19 December 2024 - 08:28 PM

The pregap/postgap is 150 sectors indeed (75 sectors/second) but the information about the existence of it is being written in the subchannel data area. Period.



#11 OBattler

OBattler

    1% Member

  • +Alcohol-Customer
  • 8 posts

Posted 19 December 2024 - 10:38 PM

Yes, I'm well aware of that, I literally just said I determine the pre-gaps from the subchannel data. I still don't get what this has to do with the fact that Alcohol 120% writes incorrect track times into the cue sheets it produces.



#12 Charalambos

Charalambos

    Support Team Member

  • Support Team
  • 5,032 posts

Posted 20 December 2024 - 08:22 PM

The track lengths are correct, the start/end times are incorrect exactly because the pregaps are missing. In the cue sheet there should be a pregap entry for every audio track, in the cue sheet that Alcohol produces these pregaps are missing for the explained reasons and that makes the difference.



#13 OBattler

OBattler

    1% Member

  • +Alcohol-Customer
  • 8 posts

Posted 21 December 2024 - 05:01 AM

> the start/end times are incorrect exactly because the pregaps are missing.

You're still not understanding. The start/end times in the cue sheet are 150 frames *ahead* of where they should be - for example, track 03 is listed at 25:23:25 but it should be at 25:21:25, and so on every track up to and including the last track. That is because Alcohol 120% is not taking the track 02's pre-gap into account when adjusting the times for tracks 03 onwards.

Let me comment this, then maybe, hopefully, we're going to be on the same page:

FILE "UNTITLED.BIN" BINARY
  TRACK 01 MODE1/2352
    INDEX 01 00:00:00 - This is correct, the 00:02:00 of this track's pre-gap are absent
                        from the .bin file.
  TRACK 02 AUDIO
    PREGAP 00:02:00 - Since PREGAP is being used and not INDEX 00, then this pre-gap is
                      also absent from the .bin file.
    INDEX 01 22:09:03 - This is correct, the TOC time is 22:13:03, subtract 00:02:00 of
                        track 01's pre-gap and 00:02:00 of this track's pre-gap and you
                        get exactly 22:09:03.
  TRACK 03 AUDIO
    INDEX 01 25:23:25 - This is incorrect, the TOC time is 25:25:25, sutract 00:02:00 of
                        track 01's pre-gap and you get 25:23:25 but track 02's pre-gap
                        has been forgotten here - subtract that and you get 25:21:25.
                        Track 03's pre-gap is here implied to be part of track 02.
  TRACK 04 AUDIO
    INDEX 01 28:23:41 - This is incorrect, the TOC time is 28:25:41, sutract 00:02:00 of
                        track 01's pre-gap and you get 28:23:41 but track 02's pre-gap
                        has been forgotten here - subtract that and you get 28:21:41.
                        Track 04's pre-gap is here implied to be part of track 03.
  TRACK 05 AUDIO
    INDEX 01 30:55:65 - This is incorrect, the TOC time is 30:57:65, sutract 00:02:00 of
                        track 01's pre-gap and you get 30:55:65 but track 02's pre-gap
                        has been forgotten here - subtract that and you get 30:53:65.
                        Track 05's pre-gap is here implied to be part of track 04.
  TRACK 06 AUDIO
    INDEX 01 33:43:52 - This is incorrect, the TOC time is 33:45:52, sutract 00:02:00 of
                        track 01's pre-gap and you get 33:43:52 but track 02's pre-gap
                        has been forgotten here - subtract that and you get 33:41:52.
                        Track 06's pre-gap is here implied to be part of track 05.
  TRACK 07 AUDIO
    INDEX 01 36:30:48 - This is incorrect, the TOC time is 36:32:48, sutract 00:02:00 of
                        track 01's pre-gap and you get 36:30:48 but track 02's pre-gap
                        has been forgotten here - subtract that and you get 36:32:48.
                        Track 07's pre-gap is here implied to be part of track 06.
  TRACK 08 AUDIO
    INDEX 01 38:09:11 - This is incorrect, the TOC time is 38:11:11, sutract 00:02:00 of
                        track 01's pre-gap and you get 38:09:11 but track 02's pre-gap
                        has been forgotten here - subtract that and you get 38:07:11.
                        Track 08's pre-gap is here implied to be part of track 07.
  TRACK 09 AUDIO
    INDEX 01 41:50:19 - This is incorrect, the TOC time is 41:52:19, sutract 00:02:00 of
                        track 01's pre-gap and you get 41:50:19 but track 02's pre-gap
                        has been forgotten here - subtract that and you get 41:48:19.
                        Track 09's pre-gap is here implied to be part of track 08.
  TRACK 10 AUDIO
    INDEX 01 43:25:72 - This is incorrect, the TOC time is 43:27:72, sutract 00:02:00 of
                        track 01's pre-gap and you get 43:25:72 but track 02's pre-gap
                        has been forgotten here - subtract that and you get 43:23:72.
                        Track 10's pre-gap is here implied to be part of track 09.

 

Let's also look at the track lengths, will ignore that of the last track since it can't be determined from the cue sheet alone, and is also not necessarily to make my point:

 

These are the lengths:

Cue sheet:
Track 01: 00:00:00
Track 02: 22:09:03 - Track 01 length (without track 02 pre-gap): 22:09:03
                     With track 02 pre-gap = 22:11:03
Track 03: 25:23:25 - Track 02 length = 03:14:22
Track 04: 28:23:41 - Track 03 length = 03:00:16
Track 05: 30:55:65 - Track 04 length = 02:32:24
Track 06: 33:43:52 - Track 05 length = 02:47:62
Track 07: 36:30:48 - Track 06 length = 02:46:71
Track 08: 38:09:11 - Track 07 length = 01:38:38
Track 09: 41:50:19 - Track 08 length = 03:41:08
Track 10: 43:25:72 - Track 09 length = 01:35:53

TOC:
Track 01: 00:02:00
Track 02: 22:13:03 - Track 01 length (with track 02 pre-gap): 22:11:03 (matches cue sheet)
                     Without track 02 pre-gap: 22:09:03
Track 03: 25:25:25 - Track 02 length = 03:12:22 (00:02:00 *shorter* than in cue sheet)
Track 04: 28:25:41 - Track 03 length = 03:00:16 (matches cue sheet)
Track 05: 30:57:65 - Track 04 length = 02:32:24 (matches cue sheet)
Track 06: 33:45:52 - Track 05 length = 02:47:62 (matches cue sheet)
Track 07: 36:32:48 - Track 06 length = 02:46:71 (matches cue sheet)
Track 08: 38:11:11 - Track 07 length = 01:38:38 (matches cue sheet)
Track 09: 41:52:19 - Track 08 length = 03:41:08 (matches cue sheet)
Track 10: 43:27:72 - Track 09 length = 01:35:53 (matches cue sheet)

They all match, except for track 02, which in the cue sheet, is 00:02:00 longer. Since, according to the cue sheet specification, the track start times indicate where in the .bin file the track's data start, the only way these num,bers can make sense, are if track 02 start is in fact of index 00 (the pre-gap) and the pre-gap is also present in the .bin file, but according to the cue sheet specification, PREGAP indicates a pre-gap that's *not* present in the file, while INDEX 00 indicates a pre-gap present in the .bin file. Even if this PREGAP is really intended to be an INDEX 00, this is still incorrect since INDEX 01 then specifies the time where INDEX 00 should be in the .bin file.

 

So this:

FILE "UNTITLED.BIN" BINARY
  TRACK 01 MODE1/2352
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    INDEX 00 22:09:03
    INDEX 00 22:11:03
  TRACK 03 AUDIO
    INDEX 01 25:23:25
  TRACK 04 AUDIO
    INDEX 01 28:23:41
  TRACK 05 AUDIO
    INDEX 01 30:55:65
  TRACK 06 AUDIO
    INDEX 01 33:43:52
  TRACK 07 AUDIO
    INDEX 01 36:30:48
  TRACK 08 AUDIO
    INDEX 01 38:09:11
  TRACK 09 AUDIO
    INDEX 01 41:50:19
  TRACK 10 AUDIO
    INDEX 01 43:25:72

Would also be correct but then track 02's pre-gap would have to be in the file.

 

We know that the lead out starts at 47:19:06, and the ATAPI specification tell us the last user frame is that - 1, so 47:19:05. This gives track 10's length at 3:51:09. Summing this with all the rest of the track lengths from the TOC, using track 02 length *without* pre-gap, brings us to 500108112 bytes, which is the exact size of the .bin file. If we use the lengths calculated from the cue sheet, instead, we get 500460912 bytes, which is longer than the .bin file. This alone shows the cue sheet produced by Alcohol 120% is wrong because, together we the .bin file, we see that track 10 ends up being exactly 150 frames shorter than it should be. You can easily verify this by inputting all the numbers into an Excel spreadsheet and having it do all the calculations. If I subtract 150 frames (ie. 00:02:00, the exact length of track 02's pre-gap that Alcohol 120% forgets to adjust track 03 onwards' times for) from track 03 onwards' starting times, shortening track 03 by 00:02:00, I then indeed get 500108112 bytes for the whole lot.



#14 Charalambos

Charalambos

    Support Team Member

  • Support Team
  • 5,032 posts

Posted 21 December 2024 - 08:19 PM

 

That is because Alcohol 120% is not taking the track 02's pre-gap into account

 

And all the following ones (if they exist). For Alcohol pregaps of track 2 and onwards just doesn't exist. I can't explain it better and I won't answer anything else that you write. Please stop wasting your time (and mine). :huh:



#15 OBattler

OBattler

    1% Member

  • +Alcohol-Customer
  • 8 posts

Posted 22 December 2024 - 12:34 AM

Exactly, they don't exist, so they should be subtracted from all the track times. But that of track 02 is are not being subtracted, so the times are as if it was there. That's the problem.

 

Also, I would like to know why my two PM's requesting the customer status on this forum have been ignored, I have purachesed Alcohol 120% using the same e-mail address I used to register this forum.



#16 NARS

NARS

    Forum Administration

  • Administration
  • 2,816 posts

Posted 22 December 2024 - 11:02 PM

Please calm down :)  I have no technical knowledge myself to comment about the problem, but as I told before I did ask our developer to look at this topic, I just can't assure you when he may have time for this but it's forwarded, it's all I can do.

Concerning your forum account customer status it's already adjusted.

Merry Christmas and Happy New year!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users