From c075b393f1136010e7f771fa1b30af38e9e9f876 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 23 Oct 2025 13:50:14 -0700 Subject: [PATCH] Properly timeout for ESP32 I2S writes (#794) The I2S write was always blocking meaning only a single loop call might have ended up playing the entire audio output. Replace the timeout of `10` with `0`. --- src/AudioOutputI2S.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AudioOutputI2S.cpp b/src/AudioOutputI2S.cpp index 177734b..bad04a9 100644 --- a/src/AudioOutputI2S.cpp +++ b/src/AudioOutputI2S.cpp @@ -259,7 +259,7 @@ bool AudioOutputI2S::ConsumeSample(int16_t sample[2]) { s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff); size_t i2s_bytes_written = sizeof(uint32_t); - i2s_channel_write(_tx_handle, (const char*)&s32, sizeof(uint32_t), &i2s_bytes_written, 10); + i2s_channel_write(_tx_handle, (const char*)&s32, sizeof(uint32_t), &i2s_bytes_written, 0); return i2s_bytes_written; #elif defined(ESP8266) uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);