aaru-dps / Aaru

Aaru Data Preservation Suite
Other
495 stars 34 forks source link

Aaru reads data in "track 0" of CD-DA as scrambled if supported by drive #706

Open TheRogueArchivist opened 2 years ago

TheRogueArchivist commented 2 years ago

Version

5.3.0

Commit hash

No response

Tested debug version?

Which operating systems have you used?

What is the architectural bit size you're using?

What processor are you using?

Device manufacturer

Plextor

Device model

PX-W4012A

Bus the device uses to attach to the computer

USB cable or card reader manufacturer

No response

USB cable or card reader model

No response

What were you doing when it failed?

Description

When dumping CDs with data in "track 0", Aaru seems to mistakenly dump this data as scrambled on supported drives, due to "track 0" being the pregap of the audio track 1. When dumping with drives that support scrambled reading commands, the sectors in Aaru dumps seem to be scrambled. When dumping with drives that do not support these commands, the sectors appear to not be scrambled. For reference, I was made aware of a similar bug in DIC (https://github.com/saramibreak/DiscImageCreator/issues/104), and the unscrambled dumps made using DIC seem to resemble the Aaru dumps made with drives that support scrambled reading, and the current test build of DIC that supports descrambling these data pregaps roughly match Aaru dumps made with drives that don't support scrambled reading. There is still an offset difference between the Aaru and DIC dumps, but once accounted for the respective images seem to be identical.

Exact command line used

`aaru m dump F: "Star Wars Test.aaruf"

Expected behavior

Data portion of audio track pregap to be dumped consistently between drives, regardless of commands supported.

Actual behavior

Data portion of audio track pregap doesn't match between drives based on whether or not they support scrambled reading commands

Output of command execution with debug output enabled

(Log of unscrambled dump)
aaru 5.3.0+5c70b325 built by khepri in Debug, modified
Copyright c 2011-2021 Natalia Portillo

Output image format: Aaru Format.
Device in database since 12/10/2021 10:25:50 PM.

Reading full TOC
Building track map...
Checking if drive supports PQ subchannel reading...
Checking if drive supports full raw subchannel reading...
Full raw subchannel reading supported...
Drive returns subchannel in BCD...
Calculating pregaps, can take some time...
Track 2 pregap is 0 sectors
Track 3 pregap is 0 sectors
Track 4 pregap is 0 sectors
Track 5 pregap is 0 sectors
Track 6 pregap is 0 sectors
Track 7 pregap is 0 sectors
Track 8 pregap is 0 sectors
Track 9 pregap is 0 sectors
Track 10 pregap is 0 sectors
Reading ATIP
Reading Disc Information
Reading PMA
Reading Session Information
Reading CD-Text from Lead-In
Solving lead-outs...
Detecting disc type...
Disc contains a hidden track...
Checking mode for track 0...
Track 0 is MODE1
Reading 16 sectors at a time.
Device reports 298056 blocks (729641088 bytes).
Device can read 16 blocks at a time.
Device reports 2448 bytes per logical block.
SCSI device type: MultiMediaDevice.
Media identified as CDDA.
Setting flags for track 1...
Setting flags for track 2...
Setting flags for track 3...
Setting flags for track 4...
Setting flags for track 5...
Setting flags for track 6...
Setting flags for track 7...
Setting flags for track 8...
Setting flags for track 9...
Setting flags for track 10...
Track 0 starts at LBA 0 and ends at LBA 66545
Track 1 starts at LBA 66546 and ends at LBA 83632
Track 2 starts at LBA 83633 and ends at LBA 119882
Track 3 starts at LBA 119883 and ends at LBA 156500
Track 4 starts at LBA 156501 and ends at LBA 170099
Track 5 starts at LBA 170100 and ends at LBA 178577
Track 6 starts at LBA 178578 and ends at LBA 199587
Track 7 starts at LBA 199588 and ends at LBA 216347
Track 8 starts at LBA 216348 and ends at LBA 236120
Track 9 starts at LBA 236121 and ends at LBA 249682
Track 10 starts at LBA 249683 and ends at LBA 298055
Drive reading offset is 2668 bytes (667 samples).
Disc write offset is unknown, dump may not be correct.
Setting speed to MAX for data reading.
Setting speed to 8x for audio reading.
Setting index 1 for track 1 to LBA 66546.
Pregap for track 2 set to 126 sectors.
Pregap for track 2 set to 127 sectors.
Setting index 1 for track 2 to LBA 83633.
Pregap for track 3 set to 159 sectors.
Pregap for track 3 set to 160 sectors.
Setting index 1 for track 3 to LBA 119883.
Pregap for track 4 set to 284 sectors.
Pregap for track 4 set to 285 sectors.
Setting index 1 for track 4 to LBA 156501.
Pregap for track 5 set to 186 sectors.
Setting index 1 for track 5 to LBA 170100.
Pregap for track 6 set to 184 sectors.
Pregap for track 6 set to 185 sectors.
Setting index 1 for track 6 to LBA 178578.
Pregap for track 7 set to 244 sectors.
Pregap for track 7 set to 245 sectors.
Setting index 1 for track 7 to LBA 199588.
Pregap for track 8 set to 209 sectors.
Pregap for track 8 set to 210 sectors.
Setting index 1 for track 8 to LBA 216348.
Pregap for track 9 set to 292 sectors.
Pregap for track 9 set to 293 sectors.
Setting index 1 for track 9 to LBA 236121.
Pregap for track 10 set to 239 sectors.
Pregap for track 10 set to 240 sectors.
Setting index 1 for track 10 to LBA 249683.
Reading sector 298052 of 298056 (13.255 MiB/sec.)
Dump finished in 552.1195062 seconds.
Average dump speed 2257.372 KiB/sec.
Average write speed 3076.769 KiB/sec.
Trimming skipped sectors
Trimming sector 298055
Trimming finished in 4.4621591 seconds.
Correctly retried sector 0 subchannel in pass 1.
Correctly retried sector 225 subchannel in pass 1.
Correctly retried sector 265 subchannel in pass 1.
Correctly retried sector 383 subchannel in pass 1.
Correctly retried sector 450 subchannel in pass 1.
Correctly retried sector 486 subchannel in pass 1.
Correctly retried sector 611 subchannel in pass 1.
Correctly retried sector 712 subchannel in pass 1.
Correctly retried sector 751 subchannel in pass 1.
Correctly retried sector 798 subchannel in pass 1.
Correctly retried sector 827 subchannel in pass 1.
Correctly retried sector 1116 subchannel in pass 1.
Correctly retried sector 1122 subchannel in pass 1.
Correctly retried sector 1197 subchannel in pass 1.
Correctly retried sector 1288 subchannel in pass 1.
Correctly retried sector 1289 subchannel in pass 1.
Correctly retried sector 1347 subchannel in pass 1.
Correctly retried sector 1516 subchannel in pass 1.
Correctly retried sector 1873 subchannel in pass 1.
Correctly retried sector 1909 subchannel in pass 1.
Correctly retried sector 1953 subchannel in pass 1.
Retrying sector 2650 subchannel, pass 1, forward
Closing output file.
Closed in 16.1448117 seconds.

Media details

"Star Wars - Shadows of the Empire Soundtrack" (0 30206 57002 1) tested specifically, other discs that have a data pregap for an audio track assumed to be affected as well.

Unscrambled logs: 706 (Unscrambled).zip Scrambled logs: 706 (Scrambled).zip

claunia commented 2 years ago

Due to architectural changes needed to fix this bug, moved to 6.0 milestone.