Skip to content

Commit

Permalink
Merge pull request #6863 from esphome/bump-2024.5.5
Browse files Browse the repository at this point in the history
2024.5.5
  • Loading branch information
jesserockz committed Jun 5, 2024
2 parents 3fe2fc9 + 664ee56 commit 5b062a2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
25 changes: 24 additions & 1 deletion esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,27 @@ void I2SAudioSpeaker::setup() {
ESP_LOGCONFIG(TAG, "Setting up I2S Audio Speaker...");

this->buffer_queue_ = xQueueCreate(BUFFER_COUNT, sizeof(DataEvent));
if (this->buffer_queue_ == nullptr) {
ESP_LOGE(TAG, "Failed to create buffer queue");
this->mark_failed();
return;
}

this->event_queue_ = xQueueCreate(BUFFER_COUNT, sizeof(TaskEvent));
if (this->event_queue_ == nullptr) {
ESP_LOGE(TAG, "Failed to create event queue");
this->mark_failed();
return;
}
}

void I2SAudioSpeaker::start() { this->state_ = speaker::STATE_STARTING; }
void I2SAudioSpeaker::start() {
if (this->is_failed()) {
ESP_LOGE(TAG, "Cannot start audio, speaker failed to setup");
return;
}
this->state_ = speaker::STATE_STARTING;
}
void I2SAudioSpeaker::start_() {
if (!this->parent_->try_lock()) {
return; // Waiting for another i2s component to return lock
Expand Down Expand Up @@ -141,6 +158,8 @@ void I2SAudioSpeaker::player_task(void *params) {
}

void I2SAudioSpeaker::stop() {
if (this->is_failed())
return;
if (this->state_ == speaker::STATE_STOPPED)
return;
if (this->state_ == speaker::STATE_STARTING) {
Expand Down Expand Up @@ -200,6 +219,10 @@ void I2SAudioSpeaker::loop() {
}

size_t I2SAudioSpeaker::play(const uint8_t *data, size_t length) {
if (this->is_failed()) {
ESP_LOGE(TAG, "Cannot play audio, speaker failed to setup");
return 0;
}
if (this->state_ != speaker::STATE_RUNNING && this->state_ != speaker::STATE_STARTING) {
this->start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void ImprovSerialComponent::write_data_(std::vector<uint8_t> &data) {
#if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32C6) || defined(USE_ESP32_VARIANT_ESP32S3)
case logger::UART_SELECTION_USB_SERIAL_JTAG:
usb_serial_jtag_write_bytes((char *) data.data(), data.size(), 20 / portTICK_PERIOD_MS);
usb_serial_jtag_ll_txfifo_flush(); // fixes for issue in IDF 4.4.7
break;
#endif // USE_ESP32_VARIANT_ESP32C3 || USE_ESP32_VARIANT_ESP32S3
default:
Expand Down
1 change: 1 addition & 0 deletions esphome/components/improv_serial/improv_serial_component.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32C6) || defined(USE_ESP32_VARIANT_ESP32S3) || \
defined(USE_ESP32_VARIANT_ESP32H2)
#include <driver/usb_serial_jtag.h>
#include <hal/usb_serial_jtag_ll.h>
#endif
#if defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3)
#include <esp_private/usb_console.h>
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/voice_assistant/voice_assistant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static const char *const TAG = "voice_assistant";

static const size_t SAMPLE_RATE_HZ = 16000;
static const size_t INPUT_BUFFER_SIZE = 32 * SAMPLE_RATE_HZ / 1000; // 32ms * 16kHz / 1000ms
static const size_t BUFFER_SIZE = 1024 * SAMPLE_RATE_HZ / 1000;
static const size_t BUFFER_SIZE = 512 * SAMPLE_RATE_HZ / 1000;
static const size_t SEND_BUFFER_SIZE = INPUT_BUFFER_SIZE * sizeof(int16_t);
static const size_t RECEIVE_SIZE = 1024;
static const size_t SPEAKER_BUFFER_SIZE = 16 * RECEIVE_SIZE;
Expand Down
2 changes: 1 addition & 1 deletion esphome/const.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Constants used by esphome."""

__version__ = "2024.5.4"
__version__ = "2024.5.5"

ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
VALID_SUBSTITUTIONS_CHARACTERS = (
Expand Down

0 comments on commit 5b062a2

Please sign in to comment.