diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-06-14 14:27:56 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-06-14 14:27:56 +1000 |
| commit | 00b1ba58f0efca59e1ef2acbeab21849db4faafe (patch) | |
| tree | b4b73afc039cdf95789a036db393337558ac092b /src/tangara/audio/i2s_audio_output.cpp | |
| parent | bcaa133a4cf757025273bb5bd0a968817405c5b1 (diff) | |
| download | tangara-fw-00b1ba58f0efca59e1ef2acbeab21849db4faafe.tar.gz | |
Improve DAC power+mute management to reduce clicks and pops
Diffstat (limited to 'src/tangara/audio/i2s_audio_output.cpp')
| -rw-r--r-- | src/tangara/audio/i2s_audio_output.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/tangara/audio/i2s_audio_output.cpp b/src/tangara/audio/i2s_audio_output.cpp index 09fc3e69..8222b8c9 100644 --- a/src/tangara/audio/i2s_audio_output.cpp +++ b/src/tangara/audio/i2s_audio_output.cpp @@ -41,8 +41,6 @@ static constexpr uint16_t kMaxVolumeBeforeClipping = 0x185; static constexpr uint16_t kLineLevelVolume = 0x13d; static constexpr uint16_t kDefaultVolume = 0x100; -static constexpr size_t kDrainBufferSize = 8 * 1024; - I2SAudioOutput::I2SAudioOutput(drivers::IGpios& expander, drivers::PcmBuffer& buffer) : IAudioOutput(), @@ -55,10 +53,6 @@ I2SAudioOutput::I2SAudioOutput(drivers::IGpios& expander, current_volume_(kDefaultVolume), max_volume_(0) {} -I2SAudioOutput::~I2SAudioOutput() { - dac_->Stop(); -} - auto I2SAudioOutput::changeMode(Modes mode) -> void { if (mode == current_mode_) { return; @@ -70,7 +64,6 @@ auto I2SAudioOutput::changeMode(Modes mode) -> void { // Turning off this output. Ensure we clean up the I2SDac instance to // reclaim its valuable DMA buffers. if (dac_) { - dac_->Stop(); dac_.reset(); } return; @@ -87,7 +80,6 @@ auto I2SAudioOutput::changeMode(Modes mode) -> void { } // Set up the new instance properly. SetVolume(GetVolume()); - dac_->Start(); } current_mode_ = mode; |
