From 82934f0c3d501cdc4f1d6d5299c7f5b72f5c8a4c Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 5 Sep 2021 06:48:10 +0100 Subject: [PATCH] Do not try to read as audio data sectors with medium error. --- Aaru.Core/Devices/Dumping/CompactDisc/Data.cs | 22 ++++++++++--------- Aaru.Core/Devices/Dumping/CompactDisc/Trim.cs | 5 +++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Data.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Data.cs index 1b6457126..a5fd52cfb 100644 --- a/Aaru.Core/Devices/Dumping/CompactDisc/Data.cs +++ b/Aaru.Core/Devices/Dumping/CompactDisc/Data.cs @@ -166,10 +166,12 @@ namespace Aaru.Core.Devices.Dumping { if(j > (ulong)lastSector) { - if(!failedCrossingLeadOut) + if(!failedCrossingLeadOut && + !inData) blocksToRead += (uint)sectorsForOffset; - if(sectorsForOffset > 0) + if(sectorsForOffset > 0 && + !inData) crossingLeadOut = true; break; @@ -232,16 +234,16 @@ namespace Aaru.Core.Devices.Dumping } } - if(!inData && - currentReadSpeed == 0xFFFF) - { - _dumpLog.WriteLine("Setting speed to 8x for audio reading."); - UpdateStatus?.Invoke("Setting speed to 8x for audio reading."); + /* if(!inData && + currentReadSpeed == 0xFFFF) + { + _dumpLog.WriteLine("Setting speed to 8x for audio reading."); + UpdateStatus?.Invoke("Setting speed to 8x for audio reading."); - _dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _); + _dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _); - currentReadSpeed = 1200; - } + currentReadSpeed = 1200; + }*/ if(inData && currentReadSpeed != _speed) { diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Trim.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Trim.cs index 2596d3e0f..a5c00b4c3 100644 --- a/Aaru.Core/Devices/Dumping/CompactDisc/Trim.cs +++ b/Aaru.Core/Devices/Dumping/CompactDisc/Trim.cs @@ -157,6 +157,8 @@ namespace Aaru.Core.Devices.Dumping sectorsToTrim = (byte)(sectorsForOffset + 1); } + bool forceFixOffset = false; + if(_supportsPlextorD8 && audioExtents.Contains(badSector)) sense = ReadPlextorWithSubchannel(out cmdBuf, out senseBuf, badSectorToRead, blockSize, sectorsToTrim, supportedPlextorSubchannel, out cmdDuration); @@ -197,8 +199,7 @@ namespace Aaru.Core.Devices.Dumping DecodedSense? decSense = Sense.Decode(senseBuf); // Try to workaround firmware - if((decSense?.ASC == 0x11 && decSense?.ASCQ == 0x05) || - decSense?.ASC == 0x64) + if(decSense?.ASC == 0x64) { sense = _dev.ReadCd(out cmdBuf, out _, badSectorToRead, blockSize, sectorsToTrim, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true,