mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-03-02 06:43:53 +08:00
Tici sound improvements (#21722)
* tune amp config and add EQed sounds * fix release files * bump up max * cleanup * more volume Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
BIN
selfdrive/assets/sounds_tici/disengaged.wav
Normal file
BIN
selfdrive/assets/sounds_tici/disengaged.wav
Normal file
Binary file not shown.
BIN
selfdrive/assets/sounds_tici/engaged.wav
Normal file
BIN
selfdrive/assets/sounds_tici/engaged.wav
Normal file
Binary file not shown.
BIN
selfdrive/assets/sounds_tici/error.wav
Normal file
BIN
selfdrive/assets/sounds_tici/error.wav
Normal file
Binary file not shown.
BIN
selfdrive/assets/sounds_tici/warning_1.wav
Normal file
BIN
selfdrive/assets/sounds_tici/warning_1.wav
Normal file
Binary file not shown.
BIN
selfdrive/assets/sounds_tici/warning_2.wav
Normal file
BIN
selfdrive/assets/sounds_tici/warning_2.wav
Normal file
Binary file not shown.
BIN
selfdrive/assets/sounds_tici/warning_repeat.wav
Normal file
BIN
selfdrive/assets/sounds_tici/warning_repeat.wav
Normal file
Binary file not shown.
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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<AudibleAlert, QString, bool> 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));
|
||||
|
||||
Reference in New Issue
Block a user