schreibfaul1 / ESP32-audioI2S

Play mp3 files from SD via I2S
GNU General Public License v3.0
1.1k stars 285 forks source link

Incorrect I2S management issues causing the appplication to crash #804

Closed cziter15 closed 2 months ago

cziter15 commented 2 months ago

I2SStart called with I2S_NUM = 0, no matter what I2S interface is selected

While using the I2S interface in the ESP32 Audio Library, i've spotted that I2SStart seems to be called with I2S_NUM = 0 regardless of the I2S interface selected by the user. This issue causes the device to crash when using I2S_NUM_1 in the constructor of the Audio library and then doing some release, instantiate operations. Additionally, there is a missing call to i2s_channel_disable before channel deletion, which leads to improper deletion of the channel and generates a series of warnings during execution.

09:27:23.742 -> assert failed: xQueueSemaphoreTake queue.c:1653 (( pxQueue ))
09:27:23.742 -> 
09:27:23.742 -> 
09:27:23.742 -> Backtrace: 0x4037797e:0x3fcb5670 0x4037d661:0x3fcb5690 0x403834d5:0x3fcb56b0 0x4037de26:0x3fcb57e0 0x420608ce:0x3fcb5820 0x4038041e:0x3fcb5840

https://github.com/schreibfaul1/ESP32-audioI2S/blob/015e06ba02dfb1cc89da80ee55ea222293b12d8f/src/Audio.cpp#L231

cziter15 commented 2 months ago

Closing as #805 has been merged. Thanks @schreibfaul1 for your quick response.