From 117120ee8fdbeadeb611b2d1a422189e51c785b8 Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 14 Oct 2025 10:21:10 +0200 Subject: [PATCH 1/2] Fix AudioInput on RP2040 --- internal/config_checks_rp2040.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/config_checks_rp2040.h b/internal/config_checks_rp2040.h index 5ba884415..4e1382dac 100644 --- a/internal/config_checks_rp2040.h +++ b/internal/config_checks_rp2040.h @@ -125,6 +125,6 @@ MOZZI_CHECK_SUPPORTED(MOZZI_I2S_FORMAT, MOZZI_I2S_FORMAT_PLAIN, MOZZI_I2S_FORMAT #define MOZZI__INTERNAL_ANALOG_READ_RESOLUTION 12 MOZZI_CHECK_SUPPORTED(MOZZI_ANALOG_READ, MOZZI_ANALOG_READ_NONE, MOZZI_ANALOG_READ_STANDARD) -MOZZI_CHECK_SUPPORTED(MOZZI_AUDIO_INPUT, MOZZI_AUDIO_INPUT_NONE, MOZZI_ANALOG_READ_STANDARD) +MOZZI_CHECK_SUPPORTED(MOZZI_AUDIO_INPUT, MOZZI_AUDIO_INPUT_NONE, MOZZI_AUDIO_INPUT_STANDARD) #endif // #ifndef CONFIG_CHECK_RP2040_H From 396168081ef2db6a73d4d21deab2d7f07b4f2930 Mon Sep 17 00:00:00 2001 From: tomcombriat Date: Mon, 20 Oct 2025 22:46:32 +0200 Subject: [PATCH 2/2] Small progress towards fixing audio Input in RP2040 --- internal/MozziGuts.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/MozziGuts.hpp b/internal/MozziGuts.hpp index 660171f28..a3fd88b00 100644 --- a/internal/MozziGuts.hpp +++ b/internal/MozziGuts.hpp @@ -84,6 +84,13 @@ uint64_t samples_written_to_buffer = 0; inline void bufferAudioOutput(const AudioOutput f) { audioOutput(f); ++samples_written_to_buffer; + #if MOZZI_IS(MOZZI__LEGACY_AUDIO_INPUT_IMPL, 1) // in that case, we rely on asynchroneous ADC reads implemented for mozziAnalogRead to get the audio in samples + MOZZI_ASSERT_NOTEQUAL(MOZZI_ANALOG_READ, MOZZI_ANALOG_READ_NONE); + adc_count = 0; + startSecondADCReadOnCurrentChannel(); + #endif + + } #else CircularBuffer output_buffer; // fixed size 256