From 94c68ecbaa5489bba3073c46475f2e46effe2c97 Mon Sep 17 00:00:00 2001 From: NeoCat Date: Thu, 13 Nov 2025 08:29:27 +0900 Subject: [PATCH] Call i2s_channel_enable(_tx_handle) in AudioOutputSPDIF::begin() (#799) i2s_channel_enable(_tx_handle) was only called within AudioOutputSPDIF::SetRate(), which caused i2s_channel_write to fail if the rate was the same with the default 44100Hz. This fixes the issue by calling it in begin(). --- src/AudioOutputSPDIF.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AudioOutputSPDIF.cpp b/src/AudioOutputSPDIF.cpp index 4cd2b58..c28b308 100644 --- a/src/AudioOutputSPDIF.cpp +++ b/src/AudioOutputSPDIF.cpp @@ -148,6 +148,7 @@ bool AudioOutputSPDIF::begin() { std_cfg.clk_cfg.clk_src = i2s_clock_src_t::I2S_CLK_SRC_APLL; #endif assert(ESP_OK == i2s_channel_init_std_mode(_tx_handle, &std_cfg)); + assert(ESP_OK == i2s_channel_enable(_tx_handle)); #else if (!I2SDriver.begin(_buffers, _bufferWords)) { audioLogger->println(F("ERROR: Unable to start I2S driver"));