We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a2bd29 commit 71590f2Copy full SHA for 71590f2
src/rp2_common/pico_audio_i2s/audio_i2s.c
@@ -367,6 +367,12 @@ void audio_i2s_set_enabled(bool enabled) {
367
368
if (enabled) {
369
audio_start_dma_transfer();
370
+ } else {
371
+ // if there was a buffer in flight, it will not be freed by DMA IRQ, let's do it manually
372
+ if (shared_state.playing_buffer) {
373
+ give_audio_buffer(audio_i2s_consumer, shared_state.playing_buffer);
374
+ shared_state.playing_buffer = NULL;
375
+ }
376
}
377
378
pio_sm_set_enabled(audio_pio, shared_state.pio_sm, enabled);
0 commit comments