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`.
This commit is contained in:
1 parent
5a0375f409
commit
c075b393f1
1 file changed
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user