drive: apply drive-features for every disc, incl. DVD (fix riplock)

DVD ran the drive at ~0.4x stock speed: init() early-returned for DVD
before any speed was set, and its only speed command was the sweep's lone
legacy SET CD SPEED, which this BU40N ignores for DVD. BD/UHD got up to
speed only via the firmware unlocker's calibration — a path a DVD can't
take (it breaks stock CSS).

Call the new unlock-crate drive-features capability at init() for ALL disc
kinds, before the DVD stock-mode early-return, via a bridge shim. Stock
MMC only (SET STREAMING + SET CD SPEED), no bus unlock, so CSS is
undisturbed.
This commit is contained in:
Matthew Jackson
2026-07-01 08:56:19 -07:00
parent fe14a2d5e5
commit ceaa1da369
2 changed files with 29 additions and 1 deletions
+9 -1
View File
@@ -411,8 +411,16 @@ impl Drive {
pub fn init(&mut self) -> Result<()> {
let t0 = std::time::Instant::now();
tracing::info!(target: "freemkv::drive", phase = "init", "begin");
// Drive-level features (max read speed / riplock lift) — matched on the
// DRIVE, applied for ANY disc. STOCK MMC commands only (no firmware
// unlock), so this is safe for a CSS DVD that must stay in stock mode.
// Runs BEFORE the DVD early-return below so a DVD is no longer riplocked:
// previously only the BD/UHD path (which returns clear content via the
// firmware unlock + its speed calibration) got up to speed, and DVD fell
// through with just the legacy SET CD SPEED the drive ignores.
crate::unlock_bridge::apply_drive_features(self.scsi.as_mut(), &self.drive_id);
if self.disc_is_dvd() {
tracing::info!(target: "freemkv::drive", phase = "init", dvd = true, elapsed_ms = t0.elapsed().as_millis() as u64, "end (stock-mode DVD, no unlock)");
tracing::info!(target: "freemkv::drive", phase = "init", dvd = true, elapsed_ms = t0.elapsed().as_millis() as u64, "end (stock-mode DVD, drive features applied, no bus unlock)");
self.init_ran = true;
return Ok(());
}