1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

[audio, mixer] Memory and CPU performance improvements (#8387)

This commit is contained in:
Kevin Ahrendt
2025-03-12 14:18:31 -05:00
committed by GitHub
parent 35199c9b96
commit 266c2ef337
8 changed files with 80 additions and 30 deletions

View File

@@ -490,7 +490,8 @@ void MixerSpeaker::audio_mixer_task(void *params) {
break;
}
output_transfer_buffer->transfer_data_to_sink(pdMS_TO_TICKS(TASK_DELAY_MS));
// Never shift the data in the output transfer buffer to avoid unnecessary, slow data moves
output_transfer_buffer->transfer_data_to_sink(pdMS_TO_TICKS(TASK_DELAY_MS), false);
const uint32_t output_frames_free =
this_mixer->audio_stream_info_.value().bytes_to_frames(output_transfer_buffer->free());