superg / redumper

Low level CD dumper utility
GNU General Public License v3.0
221 stars 20 forks source link

Feature Request - CD/Refine - Add special checks for sectors that return null data or data from a previous sector when read from drive cache #35

Open ehw opened 1 year ago

ehw commented 1 year ago

This might not be an issue for normal CD dumping, this is more of an issue for GD disc dumping with Plextor drives (or maybe audio trap discs and Plextors in general).

Sometimes when you dump a disc that involves reading data from cache, there might be a scenario where bad data is pulled from cache due to a malfunction with the drive. For instance, if you clear the cache and go to read a sector, sometimes the cache returns all 00 for all 2352 bytes, including the subchannel data. This is bad, as the drive will not tell Redumper that an error occurred that affects what is stored in the cache, it will mark the sector in the state file erroneously (meaning this obvious bad sector will be marked 'good'). If the cache is not cleared before a sector is read, you will return the previously read sector's data instead. I can see this being an issue for flashed ASUS drives as well, or any drive that depends on dumping data from the cache since it seems like something that could happen, or has happened, that could destroy the integrity of using these newer drives.

To prevent this scenario from occurring, Redumper should check the raw data returned from the cache for the following: 1.) Does the raw 2352 byte data AND the subchannel data in the cache match the checksum for something where both are all null? This is extremely unusual and highly suspect, as the subchannel is always filled with something. Checking the subchannel alone might help too, I think. 2.) Does the raw 2352 byte data AND the subchannel data match the raw data from the previously read sector?

If one of the two checks are false, move onto the next sector. If one of the two checks return true, we need to do something about the drive.

Since we only really ever dealt with this issue so far since we experimented with GD disc dumping. we don't really know of a good solution for fixing the issue once the drive starts doing this. I believe that going back and rereading an earlier sector until the data in the cache changes might be a good way. Although, maybe the drive will have to be reset or something.