disc: log adaptive patch speed transitions; issue SET CD SPEED max unconditionally
Two recovery-path fixes: - patch: log the per-range speed transitions (INFO, phase="patch_speed") — each range enters at 0xFFFF (max) and drops to 0x0000 (slow recovery) on its first read failure. Previously the adaptive-speed behavior was invisible in the logs. - drive init: issue the generic SET CD SPEED max UNCONDITIONALLY at drive-open, not only when a firmware unlocker matched. A stock-mode BD/UHD drive (no firmware unlock) was left riplocked because the call sat inside the unlocker-matched branch.
This commit is contained in:
@@ -1957,6 +1957,14 @@ impl Disc {
|
|||||||
// (below), dropping to the slow recovery speed for the rest of the
|
// (below), dropping to the slow recovery speed for the rest of the
|
||||||
// range and arming the inter-range cooldown.
|
// range and arming the inter-range cooldown.
|
||||||
reader.set_speed(0xFFFF);
|
reader.set_speed(0xFFFF);
|
||||||
|
tracing::info!(
|
||||||
|
target: "freemkv::disc",
|
||||||
|
phase = "patch_speed",
|
||||||
|
range_lba = *range_pos / 2048,
|
||||||
|
range_sectors,
|
||||||
|
speed = "0xFFFF",
|
||||||
|
"patch: range entering at MAX read speed (drops to slow recovery on first failure)"
|
||||||
|
);
|
||||||
state.current_batch = initial_batch;
|
state.current_batch = initial_batch;
|
||||||
let mut range_slowed = false;
|
let mut range_slowed = false;
|
||||||
loop {
|
loop {
|
||||||
@@ -2082,9 +2090,17 @@ impl Disc {
|
|||||||
// Idempotent — only the first failure issues SET CD SPEED.
|
// Idempotent — only the first failure issues SET CD SPEED.
|
||||||
if !range_slowed {
|
if !range_slowed {
|
||||||
reader.set_speed(0x0000);
|
reader.set_speed(0x0000);
|
||||||
|
tracing::info!(
|
||||||
|
target: "freemkv::disc",
|
||||||
|
phase = "patch_speed",
|
||||||
|
lba,
|
||||||
|
speed = "0x0000",
|
||||||
|
"patch: range dropped to slow recovery speed on first read failure"
|
||||||
|
);
|
||||||
range_slowed = true;
|
range_slowed = true;
|
||||||
cooldown_pending = true;
|
cooldown_pending = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
match handle_read_failure(
|
match handle_read_failure(
|
||||||
&mut state,
|
&mut state,
|
||||||
&frame,
|
&frame,
|
||||||
|
|||||||
+7
-4
@@ -431,11 +431,14 @@ impl Drive {
|
|||||||
if let Some(vid) = unlocked.vid {
|
if let Some(vid) = unlocked.vid {
|
||||||
self.oem_vid = Some(vid);
|
self.oem_vid = Some(vid);
|
||||||
}
|
}
|
||||||
// Now that the drive is unlocked, raise it to its maximum read speed
|
|
||||||
// with a generic SET CD SPEED. Best-effort: a failure here must NOT
|
|
||||||
// fail the rip — a slow drive still rips.
|
|
||||||
self.set_speed(crate::speed::DriveSpeed::Max.to_kbps());
|
|
||||||
}
|
}
|
||||||
|
// Raise the drive to its maximum read speed with a generic SET CD SPEED —
|
||||||
|
// UNCONDITIONALLY, whether or not an unlocker matched. A stock-mode BD/UHD
|
||||||
|
// drive (no firmware unlocker) still wants max speed; gating this on an
|
||||||
|
// unlocker match left such drives riplocked. (DVD returns earlier in
|
||||||
|
// stock mode; its sweep sets DVD speed separately.) Best-effort: a
|
||||||
|
// failure here must NOT fail the rip — a slow drive still rips.
|
||||||
|
self.set_speed(crate::speed::DriveSpeed::Max.to_kbps());
|
||||||
let r: Result<()> = Ok(());
|
let r: Result<()> = Ok(());
|
||||||
tracing::info!(
|
tracing::info!(
|
||||||
target: "freemkv::drive",
|
target: "freemkv::drive",
|
||||||
|
|||||||
Reference in New Issue
Block a user