CelliesProjects / ESP32_VS1053_Stream

A streaming library for Arduino esp32 with a vs1053 mp3/aac/ogg/flac decoder. Plays http, https (insecure mode) and chunked streams and parses the metadata. Also plays ogg and mp3 from sdcard.
MIT License
40 stars 10 forks source link

I am using this library to listen to my favorite radios, from time to time (about 30-60min) the Esp32 reboots and then keeps rebooting for a few minutes immediately after the first sounds from the station comes out, then it functions normally again. Any ideas? #18

Closed lidense closed 12 months ago

CelliesProjects commented 1 year ago

Not really. Sounds like a failing or too hot 3.3v LDO.

-EDIT: You could try disabling psram, as this is implemented rather buggy on most older esps.

lidense commented 1 year ago

OK thanks.

lidense commented 1 year ago

But if I disable PSRAM I will not have the ringbuffer? ..that will increase the risk of having clicks during streaming? Why is a ringbuffer only implemented if PSRAM is present? Isn't it possible to implement it in RAM using one of the 2 cores of the esp32?

CelliesProjects commented 1 year ago

But if I disable PSRAM I will not have the ringbuffer?

No ringbuffer without PSRAM. Normal RAM is too small for a second buffer.

..that will increase the risk of having clicks during streaming?

Yes, as the vs1053 is filled straight from the http buffer which has to fit in normal RAM.

Why is a ringbuffer only implemented if PSRAM is present? Isn't it possible to implement it in RAM using one of the 2 cores of the esp32?

Basically the same answer as the first question. Normal RAM is too small for a second buffer.

And for V0.0 ESP32 boards, I rarely have any dropouts listening without ringbuffer, but that might depend on your isp and which station you listen.

lidense commented 1 year ago

Thanks. I have an Adafruit_feather_esp32s3_tft with an Adafruit Music Maker FeatherWing , I like it because the esp32 and vs1053 are mounted one on top of the other with no wires (I had a lot of interference/instability when using a vs1053 board connected to the esp32 with Dupont wires). Do you think my setup has good enough PSRAM? If not which esp32 board/vs1053 would you recommend?

CelliesProjects commented 1 year ago

That is a very nice combo. If Adafruit might ever stock up again on the featherwing boards I will get some myself.

Your hardware is more than capable.

CelliesProjects commented 1 year ago

To go back to your original question: I got no idea.

Which app do you use to tune in? Which station?

CelliesProjects commented 1 year ago

And maybe you could run the following code to actually see what hardware revision you have.

#include <Arduino.h>
#include <esp_chip_info.h>

/* https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/external-ram.html#chip-revisions */

void setup() {
#if defined(CONFIG_IDF_TARGET_ESP32S2) && ARDUHAL_LOG_LEVEL != ARDUHAL_LOG_LEVEL_NONE
    delay(3000);
    Serial.setDebugOutput(true);
#endif
    Serial.begin(115200);

    /* Print chip information */
    esp_chip_info_t chip_info;
    esp_chip_info(&chip_info);
    Serial.printf("This is ESP32 chip with %d CPU cores, WiFi%s%s\n",
            chip_info.cores,
            (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
            (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");

    Serial.printf("silicon revision %d\n", chip_info.revision);

    Serial.printf("%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
            (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
}

void loop() {
}
lidense commented 1 year ago

OK thanks

----- Mail original ----- De: "Cellie" @.> À: "CelliesProjects/ESP32_VS1053_Stream" @.> Cc: "lidense" @.>, "Author" @.> Envoyé: Mercredi 4 Octobre 2023 09:59:13 Objet: Re: [CelliesProjects/ESP32_VS1053_Stream] I am using this library to listen to my favorite radios, from time to time (about 30-60min) the Esp32 reboots and then keeps rebooting for a few minutes immediately after the first sounds from the station comes out, then it functions normally again. Any ideas? (Issue #18)

That is a very nice combo. If Adafruit might ever stock up again on the featherwing boards I will get some myself.

On S2 and S3 boards the psram issues are fixed, so with your S3 board you should have no psram issues.

— Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you authored the thread. Message ID: <CelliesProjects/ESP32_VS1053_Stream/issues/18/1746340894 @ github . com>

lidense commented 1 year ago

I would like to listen to an italian radio that broadcasts in HLS: https://radioitaliasmi.akamaized.net/hls/live/2093120/RISMI/master.m3u8 I have found some code developed for the M5stack that is supposed to decrypt HLS: https://github.com/Yokohama-Miyazawa/M5HLSPlayer It has a file AudioGeneratorTS.cpp that is supposed to decrypt the .ts files (demux?) i was wondering if it is possible to use it to get an .aac file from the .ts using this converter (?) and pipe it to your ESP32_VS1053_Stream.cpp. I would like to learn more about all this to be able to do that but I could not find useful documents online that explain how to demux with an esp32...

CelliesProjects commented 1 year ago

For the rebooting problem I think I found the solution.

https://github.com/CelliesProjects/ESP32_VS1053_Stream#prevent-reboots-while-playing

Let me know if it works for you.

lidense commented 12 months ago

I have revision V3, so I put "-D BOARD_HAS_PSRAM" in platformio.ini and it seems to work OK. Do you have any idea concerning the HLS question above (2 days ago)? Thanks and regards

CelliesProjects commented 12 months ago

Closing as solved.