From ede4ef6ac82161266194d698f463bea19a0a4049 Mon Sep 17 00:00:00 2001 From: Matt Black Date: Mon, 17 Mar 2025 17:01:47 +1100 Subject: [PATCH 1/4] Fix long int strfmt during setup logging --- components/i2s/i2s.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/i2s/i2s.cpp b/components/i2s/i2s.cpp index 3491344..bc73229 100644 --- a/components/i2s/i2s.cpp +++ b/components/i2s/i2s.cpp @@ -30,7 +30,7 @@ void I2SComponent::dump_config() { LOG_PIN(" BCK Pin: ", this->bck_pin_); LOG_PIN(" DIN Pin: ", this->din_pin_); LOG_PIN(" DOUT Pin: ", this->dout_pin_); - ESP_LOGCONFIG(TAG, " Sample Rate: %u", this->sample_rate_); + ESP_LOGCONFIG(TAG, " Sample Rate: %lu", this->sample_rate_); ESP_LOGCONFIG(TAG, " Bits Per Sample: %u", this->bits_per_sample_); ESP_LOGCONFIG(TAG, " DMA Buf Count: %u", this->dma_buf_count_); ESP_LOGCONFIG(TAG, " DMA Buf Len: %u", this->dma_buf_len_); From e75718b0b8560ea7fc34b602a78bfb1d0b2d3ed1 Mon Sep 17 00:00:00 2001 From: Matt Black Date: Mon, 17 Mar 2025 17:11:56 +1100 Subject: [PATCH 2/4] Use I2S_MCLK_MULTIPLE_256 as DEFAULT removed in later IDF releases --- components/i2s/i2s.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/i2s/i2s.cpp b/components/i2s/i2s.cpp index bc73229..712c3ba 100644 --- a/components/i2s/i2s.cpp +++ b/components/i2s/i2s.cpp @@ -143,7 +143,7 @@ void I2SComponent::setup() { .use_apll = this->use_apll_, .tx_desc_auto_clear = false, .fixed_mclk = 0, - .mclk_multiple = I2S_MCLK_MULTIPLE_DEFAULT, + .mclk_multiple = I2S_MCLK_MULTIPLE_256, .bits_per_chan = i2s_bits_per_chan_t(0)}; i2s_pin_config_t i2s_pin_config = { From 2f751ff4e04ab98fc1dc1d3b8d01f16c3e11e3a7 Mon Sep 17 00:00:00 2001 From: Matt Black Date: Mon, 17 Mar 2025 17:23:50 +1100 Subject: [PATCH 3/4] Fix long int strfmt during setup logging --- components/sound_level_meter/sound_level_meter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/sound_level_meter/sound_level_meter.cpp b/components/sound_level_meter/sound_level_meter.cpp index 80c9eae..3003cbd 100644 --- a/components/sound_level_meter/sound_level_meter.cpp +++ b/components/sound_level_meter/sound_level_meter.cpp @@ -37,8 +37,8 @@ optional SoundLevelMeter::get_offset() { return this->offset_; } void SoundLevelMeter::dump_config() { ESP_LOGCONFIG(TAG, "Sound Level Meter:"); ESP_LOGCONFIG(TAG, " Buffer Size: %u (samples)", this->buffer_size_); - ESP_LOGCONFIG(TAG, " Warmup Interval: %u ms", this->warmup_interval_); - ESP_LOGCONFIG(TAG, " Task Stack Size: %u", this->task_stack_size_); + ESP_LOGCONFIG(TAG, " Warmup Interval: %lu ms", this->warmup_interval_); + ESP_LOGCONFIG(TAG, " Task Stack Size: %lu", this->task_stack_size_); ESP_LOGCONFIG(TAG, " Task Priority: %u", this->task_priority_); ESP_LOGCONFIG(TAG, " Task Core: %u", this->task_core_); LOG_UPDATE_INTERVAL(this); @@ -117,7 +117,7 @@ void SoundLevelMeter::task(void *param) { auto sr = this_->get_sample_rate(); if (process_count >= sr * (this_->update_interval_ / 1000.f)) { auto t = uint32_t(float(process_time) / process_count * (sr / 1000.f)); - ESP_LOGD(TAG, "Processing time per 1s of audio data (%u samples): %u ms", sr, t); + ESP_LOGD(TAG, "Processing time per 1s of audio data (%lu samples): %lu ms", sr, t); process_time = process_count = 0; } } @@ -362,4 +362,4 @@ void SOS_Filter::reset() { s = {0.f, 0.f}; } } // namespace sound_level_meter -} // namespace esphome \ No newline at end of file +} // namespace esphome From 83acbb5d6cddb3c4890eb526d4e96e9229198073 Mon Sep 17 00:00:00 2001 From: Matt Black Date: Mon, 17 Mar 2025 17:28:39 +1100 Subject: [PATCH 4/4] Include esp_timer.h for some reason --- components/sound_level_meter/sound_level_meter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/components/sound_level_meter/sound_level_meter.cpp b/components/sound_level_meter/sound_level_meter.cpp index 3003cbd..993e121 100644 --- a/components/sound_level_meter/sound_level_meter.cpp +++ b/components/sound_level_meter/sound_level_meter.cpp @@ -1,4 +1,5 @@ #include "sound_level_meter.h" +#include "esp_timer.h" namespace esphome { namespace sound_level_meter {