I2S_write doesn't resume task fast enough
Posted: Tue Oct 23, 2018 12:06 am
Hi there,
I am trying to play a .wav file using the ESP32, I have successfully set up the I2S driver to send data to an external codec chip.
My issue however is when I call I2S_write to write the next 1024 bytes of wav data, like this: It doesnt return in time to cleanly write the next 1024 byte sample
I am having trouble where when running a different lower priority task that blocks for a significant amount of time, there is glitch in the playback until the other task unblocks. Is it possible to have an interrupt that fires once the i2s_write function returns and is ready to accept more data into the buffer? That way it would interrupt any other task that's blocking?
I am trying to play a .wav file using the ESP32, I have successfully set up the I2S driver to send data to an external codec chip.
My issue however is when I call I2S_write to write the next 1024 bytes of wav data, like this: It doesnt return in time to cleanly write the next 1024 byte sample
Code: Select all
i2s_write(I2S_NUM, (const char *)wavBuffer, 1024, &bytesWritten, portMAX_DELAY);