From 26e4889fcb5e4331e1ef67ef6c8890b39ecdce2a Mon Sep 17 00:00:00 2001 From: Isaac Barham Date: Fri, 28 Aug 2026 19:38:48 -0400 Subject: [PATCH] Raise comma four alert volume --- openpilot/selfdrive/ui/soundd.py | 2 +- openpilot/selfdrive/ui/tests/test_soundd.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openpilot/selfdrive/ui/soundd.py b/openpilot/selfdrive/ui/soundd.py index afd6ff6b1e..d173fb97ff 100644 --- a/openpilot/selfdrive/ui/soundd.py +++ b/openpilot/selfdrive/ui/soundd.py @@ -60,7 +60,7 @@ sound_list: dict[int, tuple[str, int | None, float]] = { def calculate_volume_for_device(weighted_db: float, device_type: str) -> float: ambient_db = 30 if device_type in ("mici", "tizi") else 26 volume_base = 10 if device_type in ("mici", "tizi") else 20 - volume_boost = 1.2 if device_type == "mici" else 1.0 + volume_boost = 1.5 if device_type == "mici" else 1.0 volume = ((weighted_db - ambient_db) / DB_SCALE) * (MAX_VOLUME - MIN_VOLUME) + MIN_VOLUME return min(MAX_VOLUME, volume_boost * math.pow(volume_base, (np.clip(volume, MIN_VOLUME, MAX_VOLUME) - 1))) diff --git a/openpilot/selfdrive/ui/tests/test_soundd.py b/openpilot/selfdrive/ui/tests/test_soundd.py index 11a26c44b5..aa15010c52 100644 --- a/openpilot/selfdrive/ui/tests/test_soundd.py +++ b/openpilot/selfdrive/ui/tests/test_soundd.py @@ -11,12 +11,12 @@ AudibleAlert = log.SelfdriveState.AudibleAlert class TestSoundd(OpenpilotTestCase): - def test_comma_four_volume_is_20_percent_louder_than_comma_three_x(self): + def test_comma_four_volume_is_50_percent_louder_than_comma_three_x(self): for weighted_db in (20.0, 30.0, 40.0, 50.0): with self.subTest(weighted_db=weighted_db): comma_three_x_volume = calculate_volume_for_device(weighted_db, "tizi") comma_four_volume = calculate_volume_for_device(weighted_db, "mici") - assert comma_four_volume == min(1.0, comma_three_x_volume * 1.2) + assert comma_four_volume == min(1.0, comma_three_x_volume * 1.5) def test_milestone_chime_uses_ui_milestone_event(self): soundd = Soundd()