diff --git a/cereal b/cereal index 9ce45916c6..596d34e77a 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 9ce45916c6c27e8cfbbe2aa6b796fac41eeeba00 +Subproject commit 596d34e77ac380f965f0f5f96f59d622c9e814b1 diff --git a/selfdrive/assets/sounds/prompt.wav b/selfdrive/assets/sounds/prompt.wav index 4f649bf3ea..f35e66e144 100644 Binary files a/selfdrive/assets/sounds/prompt.wav and b/selfdrive/assets/sounds/prompt.wav differ diff --git a/selfdrive/assets/sounds/prompt_distracted.wav b/selfdrive/assets/sounds/prompt_distracted.wav new file mode 100644 index 0000000000..557be172aa Binary files /dev/null and b/selfdrive/assets/sounds/prompt_distracted.wav differ diff --git a/selfdrive/assets/sounds/refuse.wav b/selfdrive/assets/sounds/refuse.wav index 6a26756198..a21bb1a36e 100644 Binary files a/selfdrive/assets/sounds/refuse.wav and b/selfdrive/assets/sounds/refuse.wav differ diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 9107f5fe2e..d858dbfcbc 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -375,7 +375,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo "KEEP EYES ON ROAD", "Driver Distracted", AlertStatus.userPrompt, AlertSize.mid, - Priority.MID, VisualAlert.steerRequired, AudibleAlert.prompt, .1), + Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1), }, EventName.driverDistracted: { @@ -399,7 +399,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo "TOUCH STEERING WHEEL", "Driver Unresponsive", AlertStatus.userPrompt, AlertSize.mid, - Priority.MID, VisualAlert.steerRequired, AudibleAlert.prompt, .1), + Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1), }, EventName.driverUnresponsive: { diff --git a/selfdrive/hardware/tici/hardware.h b/selfdrive/hardware/tici/hardware.h index 3d025775ae..549170412d 100644 --- a/selfdrive/hardware/tici/hardware.h +++ b/selfdrive/hardware/tici/hardware.h @@ -10,7 +10,7 @@ class HardwareTici : public HardwareNone { public: static constexpr float MAX_VOLUME = 0.9; - static constexpr float MIN_VOLUME = 0.3; + static constexpr float MIN_VOLUME = 0.15; static bool TICI() { return true; } static std::string get_os_version() { return "AGNOS " + util::read_file("/VERSION"); diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 95bf325d7c..2996331fe4 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -6da38baefb2741902f8b10fbf2b5e64fd15ced1f \ No newline at end of file +e15e446543ea74cce4864f07902a39bdb8b10688 \ No newline at end of file diff --git a/selfdrive/ui/soundd/sound.cc b/selfdrive/ui/soundd/sound.cc index 7ce758d0ad..f42edd308e 100644 --- a/selfdrive/ui/soundd/sound.cc +++ b/selfdrive/ui/soundd/sound.cc @@ -47,7 +47,7 @@ void Sound::update() { // scale volume with speed if (sm.updated("carState")) { - float volume = std::clamp(sm["carState"].getCarState().getVEgo() / 29.f, 0.1f, 1.0f); + float volume = util::map_val(sm["carState"].getCarState().getVEgo(), 11.f, 29.f, 0.f, 1.0f); volume = QAudio::convertVolume(volume, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale); volume = util::map_val(volume, 0.f, 1.f, Hardware::MIN_VOLUME, Hardware::MAX_VOLUME); for (auto &[s, loops] : sounds) { diff --git a/selfdrive/ui/soundd/sound.h b/selfdrive/ui/soundd/sound.h index 6215da6ac0..0990591093 100644 --- a/selfdrive/ui/soundd/sound.h +++ b/selfdrive/ui/soundd/sound.h @@ -13,6 +13,7 @@ const std::tuple sound_list[] = { {AudibleAlert::PROMPT, "prompt.wav", 0}, {AudibleAlert::PROMPT_REPEAT, "prompt.wav", QSoundEffect::Infinite}, + {AudibleAlert::PROMPT_DISTRACTED, "prompt_distracted.wav", 0}, {AudibleAlert::WARNING_SOFT, "warning_soft.wav", QSoundEffect::Infinite}, {AudibleAlert::WARNING_IMMEDIATE, "warning_immediate.wav", 10}, diff --git a/selfdrive/ui/tests/test_soundd.py b/selfdrive/ui/tests/test_soundd.py index 5be16348c7..df795c4c88 100755 --- a/selfdrive/ui/tests/test_soundd.py +++ b/selfdrive/ui/tests/test_soundd.py @@ -17,9 +17,10 @@ SOUNDS = { AudibleAlert.none: 0, AudibleAlert.engage: 197, AudibleAlert.disengage: 230, - AudibleAlert.refuse: 223, + AudibleAlert.refuse: 189, AudibleAlert.prompt: 217, AudibleAlert.promptRepeat: 475, + AudibleAlert.promptDistracted: 187, AudibleAlert.warningSoft: 477, AudibleAlert.warningImmediate: 468, } @@ -39,7 +40,7 @@ class TestSoundd(unittest.TestCase): pm = messaging.PubMaster(['deviceState', 'controlsState']) # make sure they're all defined - alert_sounds = {v: k for k, v in car.CarControl.HUDControl.AudibleAlert.schema.enumerants.items() if not k.endswith('DEPRECATED')} + alert_sounds = {v: k for k, v in car.CarControl.HUDControl.AudibleAlert.schema.enumerants.items()} diff = set(SOUNDS.keys()).symmetric_difference(alert_sounds.keys()) assert len(diff) == 0, f"not all sounds defined in test: {diff}"