Skip to content

Commit 75ed286

Browse files
committed
espressif: i2sout: enlarge buffers
1 parent 3a82730 commit 75ed286

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ports/espressif/common-hal/audiobusio/__init__.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void i2s_fill_buffer(i2s_t *self) {
8484
if (self->instance < 0 || self->instance >= I2S_NUM_MAX) {
8585
return;
8686
}
87-
#define STACK_BUFFER_SIZE (512)
87+
#define STACK_BUFFER_SIZE (4096)
8888
int16_t signed_samples[STACK_BUFFER_SIZE / sizeof(int16_t)];
8989

9090
if (!self->playing || self->paused || !self->sample || self->stopping) {
@@ -188,8 +188,8 @@ void port_i2s_allocate_init(i2s_t *self, bool left_justified) {
188188
.bits_per_sample = 16,
189189
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
190190
.communication_format = left_justified ? I2S_COMM_FORMAT_STAND_I2S : I2S_COMM_FORMAT_STAND_I2S,
191-
.dma_buf_count = 2,
192-
.dma_buf_len = 128, // in _frames_, so 128 is 512 bytes per dma buf
191+
.dma_buf_count = 3,
192+
.dma_buf_len = 1024, // in _frames_, so 1024 is 4096 bytes per dma buf
193193
.use_apll = false,
194194
};
195195
CHECK_ESP_RESULT(i2s_driver_install(self->instance, &i2s_config, I2S_QUEUE_SIZE, &i2s_queues[self->instance]));

0 commit comments

Comments
 (0)