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>
old-commit-hash: cebddc94c4
This commit is contained in:
robbederks 2021-07-26 16:28:41 -07:00 committed by GitHub
parent 4d0543d92d
commit e31f004593
10 changed files with 38 additions and 14 deletions

View File

@ -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

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c6ef7f760160e1c5d9ec7a9b2cd46a79866acfdd3dbba6a8fd49051490b37aa7
size 50316

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5429a1633695013bcd69a6d8e529e4ac95a9e0e4c50e8ae0027b06003ed662e2
size 50288

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1c31dab68d1498b84912c6e424fd783d054942242ca40a5dfb311edd148b744a
size 50304

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:209c3328f1eb924917f78438c2faf43d9c23ae7f39b7ba6105b7ca509e279e15
size 31094

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8687abcc94d4bb30dd18be37ed03e2a224cc6ddc227c1e8c0c3ba9bdfc85b302
size 134392

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:92a69b8847a51b7d60af4447f930b50e343f7f04316a765d0a13ae4d0152160f
size 70114

View File

@ -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)

View File

@ -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() {

View File

@ -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));