ESP keeps rebooting with setIndex() #1912
-
Hello, I run this example code with only two modifications:
and
because I want to play just the second file. It works fine without the setIndex() - it plays the first file in the 003 folder. But the result with setIndex(1) is:
assert failed: xStreamBufferSend stream_buffer.c:700 (pxStreamBuffer) Backtrace: 0x40082571:0x3ffd1450 0x400947e5:0x3ffd1470 0x4009b46a:0x3ffd1490 0x40095b76:0x3ffd15c0 0x400d3c06:0x3ffd1600 0x400d3c8f:0x3ffd1630 0x400d8967:0x3ffd1660 0x400d5d0f:0x3ffd1690 0x400d3661:0x3ffd16c0 0x400d6ea0:0x3ffd1710 0x4020e57d:0x3ffd1730 0x400d401f:0x3ffd1750 0x400d50e9:0x3ffd1780 0x400d9876:0x3ffd17b0 0x400d9b8b:0x3ffd17e0 0x400d9eb1:0x3ffd1820 0x400d9f3a:0x3ffd1850 0x400da346:0x3ffd1880 0x400e83b7:0x3ffd1920 0x40095eba:0x3ffd1940 ELF file SHA256: 2811b231f Rebooting...
Thank you for any hint. |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 14 replies
-
I don't think this is crashing in any my functionality: decode the backtrace to analyze where the issue is coming from.. If you want to play an individual file, maybe it is easier just to copy the file to the decoder. |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks. Is there an example somewhere how to do that? I started to use the library yesterday so would appreciate some guidance code before I get familiar with it. |
Beta Was this translation helpful? Give feedback.
-
That should be easy to find: just consider the naming conventions... |
Beta Was this translation helpful? Give feedback.
-
If anybody would be able to identify the cause from the backtrace: |
Beta Was this translation helpful? Give feedback.
-
I get the same error when using setPath() too. Changed the wires, double-checked the pins, used different SD card and different SD card reader. Nothing helped. Could you please point me out how to play an individual file without using setIndex() and setPath()? Thank you very much for any hint. |
Beta Was this translation helpful? Give feedback.
-
Maybe you should cosider this advice instead of moving from one complex case to another w/o any proper testing. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I just tried this sketch with an AudioKit using ESP32 core 3.1.2, SDFAT library 2.3.0 and the latest versions of my libraries. You can call the checkMemory(true) method of my AudioTools to report on the RAM or just call ESP.getFreeHeap(). You can also define your custom Pins for the SD library by defining your custom SPI pins with the SPI.begin() method ! I also tried the same with an output to A2DPStream and the available RAM was between 29k and 37k after each copy step. |
Beta Was this translation helpful? Give feedback.
-
The ESP32 (with its 512 KB SRAM) has more then enough RAM (even w/o PSRAM) and as I was writing above I could not reproduce your issue even with the challenging A2DP sketch on an AudioKit which has a regular ESP32 processor using the latest ESP32 core version! And there is definitly much more RAM then needed if you use the I2S output.
There are plenty of ways to optimize the RAM usage by adusting the relevant parameters of your different components: just read the documentation.
But in any case you will need to do a proper root cause analysis The most memory efficient way to use A2DP is to just provide the audio data via the callback method: with this there is no need for the memory intensitive queue and I already mentioned that WAV are not using any RAM at all because they don't need to be decoded. It's just about copying data from the source to the destination! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I put together a working sketch that takes any file from the SD card and plays it using a BT speaker. It works nicely. When I try to do the same with the same HW setup using player.setPath(), it fails. I'm affraid I'm at the end of my investigation as I'm stuck and the working sketch does what I wanted to accomplish. Thank you Phil for your time and if you could think of why the setPath is failing in my case, please let me know. |
Beta Was this translation helpful? Give feedback.
I don't think this is crashing in any my functionality: decode the backtrace to analyze where the issue is coming from..
If you want to play an individual file, maybe it is easier just to copy the file to the decoder.