From 23640c4a36f17b5eaedc638b281c0cf3beaced80 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 28 Nov 2026 11:58:37 -0600 Subject: [PATCH] Play disengage chime when booting while engaged (#34884) --- openpilot/cereal/log.capnp | 1 + openpilot/selfdrive/selfdrived/events.py | 6 ++++++ openpilot/selfdrive/selfdrived/selfdrived.py | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/openpilot/cereal/log.capnp b/openpilot/cereal/log.capnp index b884002b11..68a275c6d0 100644 --- a/openpilot/cereal/log.capnp +++ b/openpilot/cereal/log.capnp @@ -100,6 +100,7 @@ struct OnroadEvent @0xc4fa6047f024e718 { startupNoControl @62; startupNoSecOcKey @63; startupMaster @64; + startupCruiseCanceled @105; fcw @65; steerSaturated @66; belowEngageSpeed @67; diff --git a/openpilot/selfdrive/selfdrived/events.py b/openpilot/selfdrive/selfdrived/events.py index d4a895dcd5..9ee47220e6 100755 --- a/openpilot/selfdrive/selfdrived/events.py +++ b/openpilot/selfdrive/selfdrived/events.py @@ -695,6 +695,12 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), }, + EventName.startupCruiseCanceled: { + ET.PERMANENT: Alert("Cruise Canceled", "Cruise was on at startup", + AlertStatus.normal, AlertSize.mid, + Priority.MID, VisualAlert.none, AudibleAlert.disengage, 3.), + }, + EventName.buttonCancel: { ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), ET.NO_ENTRY: NoEntryAlert("Cancel Pressed"), diff --git a/openpilot/selfdrive/selfdrived/selfdrived.py b/openpilot/selfdrive/selfdrived/selfdrived.py index 0b0a9222f1..c97fbc49c5 100755 --- a/openpilot/selfdrive/selfdrived/selfdrived.py +++ b/openpilot/selfdrive/selfdrived/selfdrived.py @@ -254,6 +254,7 @@ class SelfdriveD: self.requested_experimental_mode = False self.personality = self.params.get("LongitudinalPersonality", return_default=True) self.recalibrating_seen = False + self.startup_cruise_checked = False self.dm_lockout_set = False self.dm_uncertain_alerted = False self.state_machine = StateMachine() @@ -482,6 +483,11 @@ class SelfdriveD: set_offroad_alert("Offroad_DriverMonitoringUncertain", True) self.dm_uncertain_alerted = True + if not getattr(self, "startup_cruise_checked", False) and CS.canValid and not CS.canTimeout: + self.startup_cruise_checked = True + if CS.cruiseState.enabled and not CS.accFaulted and not self.events.contains(ET.ENABLE) and not REPLAY: + self.events.add(EventName.startupCruiseCanceled) + # Create events for temperature, disk space, and memory if self.sm['deviceState'].thermalStatus >= ThermalStatus.overheated: self.events.add(EventName.overheat)