There are non-zero bytes in C2 file. I did some analysis of logs / files and came to a conclusion that sth is wrong with parsing C2 / writing to SCM.
Code: Select all
ofs: 1d4, 1d5, 1df, 272, 273, 297, 32a, 32b, 365, 3e2, 3e3, 3f2, 3f3, 41d, 4aa, 4ab, 4b0, 4b1, 4d5, 562, 563, 568, 569, 620, 621, 630, 631,
LBA[080785], LBA translation to SCM address in hex[0xb534430], LBA in C2 file[0x16a6886] Detected C2 error 27 bit
Next step: verification of SCM writes:
1) Extract sector 080785 from SCM file prior to rereading -> File A
2) Extract sector 080785 from SCM file after rereading -> File B
3) Compare File A <=> File B
4) Differences at offsets: F4 and F5, and 2 more. The thing is that offsets F4 and F5 can't be written to according to C2 pointers. I have also verified that the writes to F4 and F5 offsets inject wrong data which result in extra errors after descrambling.
Then I attempted to repair the image in cdmage and extracted 080785 sector (2 files - before and after repairing).
Then I tried to match differences between those both 2 files and C2 file. C2 pointers matched after I shifted the sector by 40 bytes (see attachment - UNFIXED_SECTOR file). So maybe Plextor 760 has some additional C2 shift?
Another thing is that it looks like single bit in C2 file should be treated as if there were 2 erroneous bytes in image file. Some bits are not reported in C2 file and 2 bytes are bad in image. It's weird.
Disc info:
Code: Select all
========== Offset (Drive offset refers to http://www.accuraterip.com) ==========
Combined Offset(Byte) 32, (Samples) 8
- Drive Offset(Byte) 120, (Samples) 30
----------------------------------------------
CD Offset(Byte) -88, (Samples) -22
Overread sector: 1
SubChannel Offset: 0
Btw, is the C2 file using combined offset? 40bytes = 10 samples vs 8 samples combined offset, this gives 2 samples offset in C2. What is this? Some versions of PX760 have different C2 offsets?
Please look at it and try to fix it.
EDIT: have a look at this:
Code: Select all
if (IsPlextor712OrNewer(pDevice)) {
BOOL bRetA = ContainsC2Error(pDevice, 1, CD_RAW_READ_C2_294_SIZE, lpNextBuf, &pDiscPerSector->uiC2errorNum, nLBA, FALSE);
UINT c2ErrorBak = pDiscPerSector->uiC2errorNum;
BOOL bRetB = ContainsC2Error(pDevice, 0, 1, lpNextBuf + CD_RAW_SECTOR_WITH_C2_294_AND_SUBCODE_SIZE, &pDiscPerSector->uiC2errorNum, nLBA, FALSE);
pDiscPerSector->uiC2errorNum += c2ErrorBak;
bRet = bRetA == RETURNED_NO_C2_ERROR_1ST ? bRetB : bRetA;
}
In your implementation first bRet was overwritten with 2nd one
EDIT2:
After I applied fix above C2 rereading algorithm started to work but I don't know why since there's that 40bytes SCM / C2 offset. Weird
