Audio task is not stopped upon Audio destruction
Closed this issue · 1 comments
cziter15 commented
Looks like there's an issue with semaphores.
- After destroying Audio instance, audioTask was still running
- When the task tried to take semaphore, the program crashed
0x4037de3d: xQueueSemaphoreTake at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:1657
0x4037de3a: xQueueSemaphoreTake at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:1657
0x403801fa: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162
The solution is to add stopAudioTask
call before calling vSemaphoreDelete at the end of Audio::~Audio
function.
stopAudioTask();
vSemaphoreDelete(mutex_playAudioData);
I've submitted PR #813 as it looks that this resolves the issue for me.
schreibfaul1 commented
Thank you, the PR is merged.