mirror of
https://github.com/esphome/esphome.git
synced 2024-11-15 03:28:12 +01:00
[i2s_audio] Bugfix: Adjust I2S speaker setup priority (#7759)
Some checks are pending
CI / Test split components (push) Blocked by required conditions
CI / Check flake8 (push) Blocked by required conditions
CI / Create common environment (push) Waiting to run
CI / Check black (push) Blocked by required conditions
CI / Check pylint (push) Blocked by required conditions
CI / Check pyupgrade (push) Blocked by required conditions
CI / Run script/ci-custom (push) Blocked by required conditions
CI / Run pytest (push) Blocked by required conditions
CI / Check clang-format (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 IDF (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP8266 (push) Blocked by required conditions
CI / list-components (push) Blocked by required conditions
CI / Component test (push) Blocked by required conditions
CI / Split components for testing into 20 groups maximum (push) Blocked by required conditions
CI / CI Status (push) Blocked by required conditions
Some checks are pending
CI / Test split components (push) Blocked by required conditions
CI / Check flake8 (push) Blocked by required conditions
CI / Create common environment (push) Waiting to run
CI / Check black (push) Blocked by required conditions
CI / Check pylint (push) Blocked by required conditions
CI / Check pyupgrade (push) Blocked by required conditions
CI / Run script/ci-custom (push) Blocked by required conditions
CI / Run pytest (push) Blocked by required conditions
CI / Check clang-format (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 IDF (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP8266 (push) Blocked by required conditions
CI / list-components (push) Blocked by required conditions
CI / Component test (push) Blocked by required conditions
CI / Split components for testing into 20 groups maximum (push) Blocked by required conditions
CI / CI Status (push) Blocked by required conditions
This commit is contained in:
parent
0a92405f2d
commit
c7c8711c9c
2 changed files with 2 additions and 11 deletions
|
@ -99,14 +99,6 @@ void I2SAudioSpeaker::setup() {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->i2s_event_queue_ = xQueueCreate(I2S_EVENT_QUEUE_COUNT, sizeof(i2s_event_t));
|
|
||||||
|
|
||||||
if (this->i2s_event_queue_ == nullptr) {
|
|
||||||
ESP_LOGE(TAG, "Failed to create I2S event queue");
|
|
||||||
this->mark_failed();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void I2SAudioSpeaker::loop() {
|
void I2SAudioSpeaker::loop() {
|
||||||
|
@ -339,7 +331,7 @@ void I2SAudioSpeaker::speaker_task(void *params) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void I2SAudioSpeaker::start() {
|
void I2SAudioSpeaker::start() {
|
||||||
if (this->is_failed() || this->status_has_error())
|
if (!this->is_ready() || this->is_failed() || this->status_has_error())
|
||||||
return;
|
return;
|
||||||
if ((this->state_ == speaker::STATE_STARTING) || (this->state_ == speaker::STATE_RUNNING))
|
if ((this->state_ == speaker::STATE_STARTING) || (this->state_ == speaker::STATE_RUNNING))
|
||||||
return;
|
return;
|
||||||
|
@ -519,7 +511,6 @@ void I2SAudioSpeaker::delete_task_(size_t buffer_size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
xEventGroupSetBits(this->event_group_, SpeakerEventGroupBits::STATE_STOPPED);
|
xEventGroupSetBits(this->event_group_, SpeakerEventGroupBits::STATE_STOPPED);
|
||||||
xQueueReset(this->i2s_event_queue_);
|
|
||||||
|
|
||||||
this->task_created_ = false;
|
this->task_created_ = false;
|
||||||
vTaskDelete(nullptr);
|
vTaskDelete(nullptr);
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace i2s_audio {
|
||||||
|
|
||||||
class I2SAudioSpeaker : public I2SAudioOut, public speaker::Speaker, public Component {
|
class I2SAudioSpeaker : public I2SAudioOut, public speaker::Speaker, public Component {
|
||||||
public:
|
public:
|
||||||
float get_setup_priority() const override { return esphome::setup_priority::LATE; }
|
float get_setup_priority() const override { return esphome::setup_priority::PROCESSOR; }
|
||||||
|
|
||||||
void setup() override;
|
void setup() override;
|
||||||
void loop() override;
|
void loop() override;
|
||||||
|
|
Loading…
Reference in a new issue