From 08640fe3988d6348fbe69ecff12f5236ef3112e2 Mon Sep 17 00:00:00 2001 From: Mischa Siekmann Date: Mon, 17 Jun 2024 13:44:42 +0200 Subject: [PATCH] fix: adf-i2s-in: send audio setting request in every preparation phase. --- esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.cpp | 7 +++++++ esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.cpp b/esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.cpp index 07c521f..20abb95 100644 --- a/esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.cpp +++ b/esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.cpp @@ -90,6 +90,13 @@ void ADFElementI2SIn::clear_adf_elements_(){ this->valid_settings_ = false; } +bool ADFElementI2SIn::prepare_elements(bool initial_call){ + if( initial_call ){ + this->valid_settings_ = false; + } + return ADFPipelineElement::prepare_elements(initial_call); +} + } // namespace i2s_audio } // namespace esphome diff --git a/esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.h b/esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.h index f3f0d56..352bdca 100644 --- a/esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.h +++ b/esphome/components/i2s_audio/adf_pipeline/adf_i2s_in.h @@ -21,7 +21,7 @@ class ADFElementI2SIn : public I2SReader, public ADFPipelineSourceElement, publi const std::string get_name() override { return "I2S_Reader"; } void dump_config() override { this->dump_i2s_settings(); } bool is_ready() override; - + bool prepare_elements(bool initial_call) override; protected: bool valid_settings_{false};