If speed is set to MAX, reduce to 8x on audio tracks to enhance reliability.

This commit is contained in:
2020-03-03 03:04:01 +00:00
parent c399291c25
commit cc8fd59161
3 changed files with 31 additions and 4 deletions

View File

@@ -122,6 +122,7 @@ namespace Aaru.Core.Devices.Dumping
InitProgress?.Invoke();
int currentReadSpeed = _speed;
bool crossingLeadOut = false;
bool failedCrossingLeadOut = false;
@@ -207,6 +208,31 @@ 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.");
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
currentReadSpeed = 1200;
}
if(inData && currentReadSpeed != _speed)
{
_dumpLog.WriteLine($"Setting speed to {(_speed == 0xFFFF ? "MAX for data reading" : $"{_speed}x")}.");
UpdateStatus?.Invoke($"Setting speed to {(_speed == 0xFFFF ? "MAX for data reading" : $"{_speed}x")}.");
_speed *= _speedMultiplier;
if(_speed == 0 ||
_speed > 0xFFFF)
_speed = 0xFFFF;
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, (ushort)_speed, 0,
_dev.Timeout, out _);
}
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
// ReSharper disable CompareOfFloatsByEqualityOperator

View File

@@ -953,8 +953,8 @@ namespace Aaru.Core.Devices.Dumping
// Set speed
if(_speedMultiplier >= 0)
{
_dumpLog.WriteLine($"Setting speed to {(_speed == 0 ? "MAX" : $"{_speed}x")}.");
UpdateStatus?.Invoke($"Setting speed to {(_speed == 0 ? "MAX" : $"{_speed}x")}.");
_dumpLog.WriteLine($"Setting speed to {(_speed == 0 ? "MAX for data reading" : $"{_speed}x")}.");
UpdateStatus?.Invoke($"Setting speed to {(_speed == 0 ? "MAX for data reading" : $"{_speed}x")}.");
_speed *= _speedMultiplier;
@@ -962,7 +962,8 @@ namespace Aaru.Core.Devices.Dumping
_speed > 0xFFFF)
_speed = 0xFFFF;
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, (ushort)_speed, 0, _dev.Timeout, out _);
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, (ushort)_speed, 0, _dev.Timeout,
out _);
}
// Start reading

View File

@@ -266,7 +266,7 @@ namespace Aaru.Core.Devices.Dumping
audioExtents.Contains(badSector) &&
offsetBytes != 0)
{
int offsetFix = offsetBytes > 0 ? (int)(sectorSize - (offsetBytes * -1)) : offsetBytes;
int offsetFix = offsetBytes < 0 ? (int)(sectorSize - (offsetBytes * -1)) : offsetBytes;
if(supportedSubchannel != MmcSubchannel.None)
{