diff --git a/release/files_tici b/release/files_tici index bf4e3afb5..69d4b121c 100644 --- a/release/files_tici +++ b/release/files_tici @@ -6,6 +6,7 @@ selfdrive/timezoned.py selfdrive/assets/navigation/* selfdrive/assets/training_wide/* +selfdrive/assets/sounds_tici/* selfdrive/camerad/cameras/camera_qcom2.cc selfdrive/camerad/cameras/camera_qcom2.h diff --git a/selfdrive/assets/sounds_tici/disengaged.wav b/selfdrive/assets/sounds_tici/disengaged.wav new file mode 100644 index 000000000..182adffa2 Binary files /dev/null and b/selfdrive/assets/sounds_tici/disengaged.wav differ diff --git a/selfdrive/assets/sounds_tici/engaged.wav b/selfdrive/assets/sounds_tici/engaged.wav new file mode 100644 index 000000000..5c4c8b4d1 Binary files /dev/null and b/selfdrive/assets/sounds_tici/engaged.wav differ diff --git a/selfdrive/assets/sounds_tici/error.wav b/selfdrive/assets/sounds_tici/error.wav new file mode 100644 index 000000000..c4e280e9a Binary files /dev/null and b/selfdrive/assets/sounds_tici/error.wav differ diff --git a/selfdrive/assets/sounds_tici/warning_1.wav b/selfdrive/assets/sounds_tici/warning_1.wav new file mode 100644 index 000000000..c937b3be0 Binary files /dev/null and b/selfdrive/assets/sounds_tici/warning_1.wav differ diff --git a/selfdrive/assets/sounds_tici/warning_2.wav b/selfdrive/assets/sounds_tici/warning_2.wav new file mode 100644 index 000000000..49188db88 Binary files /dev/null and b/selfdrive/assets/sounds_tici/warning_2.wav differ diff --git a/selfdrive/assets/sounds_tici/warning_repeat.wav b/selfdrive/assets/sounds_tici/warning_repeat.wav new file mode 100644 index 000000000..bb3bfd0d5 Binary files /dev/null and b/selfdrive/assets/sounds_tici/warning_repeat.wav differ diff --git a/selfdrive/hardware/tici/amplifier.py b/selfdrive/hardware/tici/amplifier.py index b0c201c07..99b6d0598 100755 --- a/selfdrive/hardware/tici/amplifier.py +++ b/selfdrive/hardware/tici/amplifier.py @@ -31,7 +31,7 @@ BASE_CONFIG = [ AmpConfig("Enable PLL2", 0b1, 0x1A, 7, 0b10000000), AmpConfig("DAI1: I2S mode", 0b00100, 0x14, 2, 0b01111100), AmpConfig("DAI2: I2S mode", 0b00100, 0x1C, 2, 0b01111100), - AmpConfig("Right speaker output volume", 0x1F, 0x3E, 0, 0b00011111), + AmpConfig("Right speaker output volume", 0x1a, 0x3E, 0, 0b00011111), AmpConfig("DAI1 Passband filtering: music mode", 0b1, 0x18, 7, 0b10000000), AmpConfig("DAI1 voice mode gain (DV1G)", 0b00, 0x2F, 4, 0b00110000), AmpConfig("DAI1 attenuation (DV1)", 0x0, 0x2F, 0, 0b00001111), @@ -41,8 +41,8 @@ BASE_CONFIG = [ AmpConfig("ALC enable", 0b0, 0x43, 7, 0b10000000), AmpConfig("ALC/excursion limiter release time", 0b101, 0x43, 4, 0b01110000), AmpConfig("DAI1 EQ enable", 0b0, 0x49, 0, 0b00000001), - AmpConfig("DAI2 EQ enable", 0b1, 0x49, 1, 0b00000010), - AmpConfig("DAI2 EQ clip detection disabled", 0b0, 0x32, 4, 0b00010000), + AmpConfig("DAI2 EQ enable", 0b0, 0x49, 1, 0b00000010), + AmpConfig("DAI2 EQ clip detection disabled", 0b1, 0x32, 4, 0b00010000), AmpConfig("DAI2 EQ attenuation", 0x5, 0x32, 0, 0b00001111), AmpConfig("Excursion limiter upper corner freq", 0b100, 0x41, 4, 0b01110000), AmpConfig("Excursion limiter lower corner freq", 0b00, 0x41, 0, 0b00000011), @@ -57,6 +57,9 @@ BASE_CONFIG = [ AmpConfig("DAI2 audio port selector", 0b01, 0x1E, 6, 0b11000000), AmpConfig("Enable left digital microphone", 0b1, 0x48, 5, 0b00100000), AmpConfig("Enable right digital microphone", 0b1, 0x48, 4, 0b00010000), + AmpConfig("Enhanced volume smoothing disabled", 0b0, 0x49, 7, 0b10000000), + AmpConfig("Volume adjustment smoothing disabled", 0b0, 0x49, 6, 0b01000000), + AmpConfig("Zero-crossing detection disabled", 0b0, 0x49, 5, 0b00100000), ] BASE_CONFIG += configs_from_eq_params(0x84, EQParams(0x65C4, 0xC07C, 0x3D66, 0x07D9, 0x120F)) @@ -88,11 +91,11 @@ class Amplifier: self.set_config(AmpConfig("Global shutdown", 0b0 if amp_disabled else 0b1, 0x51, 7, 0b10000000)) def initialize_configuration(self): + self.set_global_shutdown(amp_disabled=True) + for config in BASE_CONFIG: self.set_config(config) - # Re-init amp - self.set_global_shutdown(amp_disabled=True) self.set_global_shutdown(amp_disabled=False) diff --git a/selfdrive/hardware/tici/hardware.h b/selfdrive/hardware/tici/hardware.h index 0ff73b840..1626cda56 100644 --- a/selfdrive/hardware/tici/hardware.h +++ b/selfdrive/hardware/tici/hardware.h @@ -9,7 +9,7 @@ class HardwareTici : public HardwareNone { public: - static constexpr float MAX_VOLUME = 0.5; + static constexpr float MAX_VOLUME = 1.0; static constexpr float MIN_VOLUME = 0.4; static bool TICI() { return true; } static std::string get_os_version() { diff --git a/selfdrive/ui/soundd.cc b/selfdrive/ui/soundd.cc index 33fe57b9a..318449930 100644 --- a/selfdrive/ui/soundd.cc +++ b/selfdrive/ui/soundd.cc @@ -17,15 +17,17 @@ class Sound : public QObject { public: explicit Sound(QObject *parent = 0) { + // TODO: merge again and add EQ in the amp config + const QString sound_asset_path = Hardware::TICI ? "../assets/sounds_tici/" : "../assets/sounds/"; std::tuple sound_list[] = { - {AudibleAlert::CHIME_DISENGAGE, "../assets/sounds/disengaged.wav", false}, - {AudibleAlert::CHIME_ENGAGE, "../assets/sounds/engaged.wav", false}, - {AudibleAlert::CHIME_WARNING1, "../assets/sounds/warning_1.wav", false}, - {AudibleAlert::CHIME_WARNING2, "../assets/sounds/warning_2.wav", false}, - {AudibleAlert::CHIME_WARNING2_REPEAT, "../assets/sounds/warning_2.wav", true}, - {AudibleAlert::CHIME_WARNING_REPEAT, "../assets/sounds/warning_repeat.wav", true}, - {AudibleAlert::CHIME_ERROR, "../assets/sounds/error.wav", false}, - {AudibleAlert::CHIME_PROMPT, "../assets/sounds/error.wav", false} + {AudibleAlert::CHIME_DISENGAGE, sound_asset_path + "disengaged.wav", false}, + {AudibleAlert::CHIME_ENGAGE, sound_asset_path + "engaged.wav", false}, + {AudibleAlert::CHIME_WARNING1, sound_asset_path + "warning_1.wav", false}, + {AudibleAlert::CHIME_WARNING2, sound_asset_path + "warning_2.wav", false}, + {AudibleAlert::CHIME_WARNING2_REPEAT, sound_asset_path + "warning_2.wav", true}, + {AudibleAlert::CHIME_WARNING_REPEAT, sound_asset_path + "warning_repeat.wav", true}, + {AudibleAlert::CHIME_ERROR, sound_asset_path + "error.wav", false}, + {AudibleAlert::CHIME_PROMPT, sound_asset_path + "error.wav", false} }; for (auto &[alert, fn, loops] : sound_list) { sounds[alert].first.setSource(QUrl::fromLocalFile(fn));