logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 101361 1232
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #691 21453321
    robgold
    Level 20  
    Mp3, Aac even up to 320kbps play without a problem, but FLAC 1000kbps does not make it. I play this radio every day and I make some corrections in the code and I do not have any problems, resets or stream ripping.
  • ADVERTISEMENT
  • #692 21453716
    slaslo
    Level 17  
    Welcome colleagues. Appreciation for the contributions to the project and thanks for sharing your knowledge.
    I have managed to get the radio working, but I can't figure out the pin to connect the IR receiver. Can anyone help?
    Thank you.

    I connect to pin 15 of the ESP and no response. Maybe it's the remote control or the receiver.
  • #693 21453832
    wirbud
    Level 13  
    robgold wrote:
    Mp3, Aac with no problem even up to 320kbps are running, but already FLAC 1000kbps can not cope. With me this radio plays every day to this some corrections in the code I make and I do not have any problems, resets or ripping of the stream.
    .

    I've had Radio Paradise Melow FLAC - (1445 kbps) flying at me for an hour now, not once did it cut.
    I don't know for sure .... but my intuition tells me that this is due to the lack of screen support (only IR and WEB control). (I have commented out all lines with screen)


    Screenshot of Radio Paradise Mellow FLAC online player. .
  • #694 21453854
    khoam
    Level 42  
    wirbud wrote:
    I don't know for sure .... but my intuition tells me that this is due to the lack of screen support (only IR and control via WEB).

    Your intuition tells you well :) And this "merit" is 99% due to the lack of task prioritisation for audio support in the software.
  • #695 21454068
    CodeBoy
    Level 33  
    Ok, I am starting to play with the radio, in the sense of assembling the blocks and so I look but I bought probably the wrong display ? because my display has only 7 pins, and I see in some pictures that there are displays for 16 pins and now the question is which is good :)
    mine is like this

    OLED display module with pins and product details
  • ADVERTISEMENT
  • #696 21454133
    robgold
    Level 20  
    @khoam
    The audio task in the library from what I remember has its priority raised to "2". After the display we don't write non-stop (in the case of FLAC I even disable VUmeter) so you send the data and that's it. However, we still have problems playing FLAC streams. The yoRadio compilation uses a rather old audio library maybe therein lies the success ?

    Code: C / C++
    Log in, to see the code
    .

    @CodeBoy
    You have a very good display. Find the display declaration in the code and set the one for the SH1122. I have this display and the radio works normally on it.
    Code: C / C++
    Log in, to see the code
    .
  • #697 21454151
    CodeBoy
    Level 33  
    @robgold and what connections only uses 7 with ESP ? instead of 16 ?
    sorry for the stupid question but it's also new to me :)
  • #698 21454159
    khoam
    Level 42  
    robgold wrote:
    The audio task in the library from what I remember has its priority raised to "2".
    .
    But it calls audio.loop() in the arduino loop with priority 1, which is none.
    https://github.com/schreibfaul1/ESP32-audioI2S/blob/master/src/Audio.cpp#L2325
    So what if the taskWrapper (to handle I2S) has priority 2 (also low), when handling the audio stream from the net is with priority 1.
  • #699 21454168
    robgold
    Level 20  
    @khoam
    Do you propose to "dress" this audio.loop in a Task and pin it with at least one higher priority (in the sense of 2)?

    @CodeBoy
    Both displays use the SPI bus. The fact that the other one has 16 pins does not mean they are all pinned.

    Code: C / C++
    Log in, to see the code
  • ADVERTISEMENT
  • #700 21454178
    DJCheester
    Level 26  
    robgold wrote:
    / Encoder 1 - grounded for the player
    #define CLK_PIN1 -1//6 // Connection from pin 6 to CLK on right encoder
    #define DT_PIN1 -1//5 // Connection from pin 5 to DT on right encoder
    #define SW_PIN1 4 // Connection from pin 4 to SW on right encoder (button)

    // Encoder 2 - used for radio
    #define CLK_PIN2 -1 //10 // Connection from pin 10 to CLK on encoder
    #define DT_PIN2 -1 //11 // Connection from pin 11 to DT on left encoder
    #define SW_PIN2 1 // Connection from pin 1 to SW on the left encoder (button)



    Thanks to robgold ;) .

    The configuration works stably (just checking) without encoders

    Greetings
  • #701 21454182
    khoam
    Level 42  
    robgold wrote:
    do you propose to "dress" this audio.loop in a Task and pin it with at least one higher priority (in the sense of 2) ?
    .
    Preferably with a priority of 3 or higher. WiFi "system" tasks in ESP have priorities higher than 10.
  • #702 21454237
    robgold
    Level 20  
    @khoam
    Give some more hints on how to hook this up as I assume it won't work so easily:

    Code: C / C++
    Log in, to see the code
    .
  • #703 21454259
    khoam
    Level 42  
    @robgold It probably cannot be explained more simply:

    Code: C / C++
    Log in, to see the code
    .
  • #704 21454270
    robgold
    Level 20  
    I've already made such a prosthesis by making a looped void audioProcessing(void *p) where audio.loop sits inside but the effects are the same as if the audio sat in the main loop. On FLAC stations the hiccups continue.

    Here's what it looks like:

    Code: C / C++
    Log in, to see the code
    .
  • #705 21454279
    khoam
    Level 42  
    robgold wrote:
    I have already made such a prosthesis by making a looped void audioProcessing(void *p) where audio.loop sits inside
    .
    I can't comment on this.
  • #706 21454287
    robgold
    Level 20  
    Don't be like AI, hint at something ;) What else can be improved to make it work better ? The main loop is completely empty. Nothing is called there just for information.
  • #707 21454298
    khoam
    Level 42  
    robgold wrote:
    The main loop is completely empty. Nothing is called there just for information.
    .
    Which code are you specifically referring to?
  • #708 21454305
    robgold
    Level 20  
    I mean voild loop(). For testing there is nothing there, in void setup() we read the stream from the card, fire up the audio, create a shuffle, give it priority and that's it.

    Code: C / C++
    Log in, to see the code
    .
  • #710 21454348
    robgold
    Level 20  
    I know this thread was even set up by JCS, who also make their receivers. We leave those FLAC files in. Had a bit of fun with the taxis but that didn't solve the problem.
  • #711 21454423
    hevet
    Level 16  
    If anyone would like the code without encoders and player then please Link .
    You should also swap the Audio library to mine, as I've extended the equalizer range from -40 to +12.

    Version @robgold
  • ADVERTISEMENT
  • #712 21454611
    DJCheester
    Level 26  
    hevet wrote:
    If anyone would like the code without encoders and player then please Link .
    You should also swap the Audio library to mine, as I've extended the equalizer range from -40 to +12.

    Version @robgold
    .

    Are you talking about the last available version, kol robgold ?

    Question for you I have connected just without encoders in the DT declaration at -1 and CLK at -1 Sw both encoders declared pins 1 and 4 and it works stably.

    Tell me what is the difference between this version of your radio and my current one from the user point of view probably nothing ?

    You must have removed the lines concerning encoders from the whole code ?

    Greetings ...
  • #713 21454652
    robgold
    Level 20  
    A quick question for anyone using a single encoder, which option would be more convenient:

    OPTION 1:
    We spin the encoder - change the Volume
    Press and spin we are in the station selection list

    OPTION 2 (as it is now):
    We spin the encoder - we are in the station selection list
    Press and turn to change Volume

    I'm testing both options and so I wonder. What do you think?
  • #714 21454669
    hevet
    Level 16  
    A first for me, I think I prefer the 'easier' access to the volume control.
  • #716 21454835
    simw
    Level 27  
    robgold wrote:
    Just a quick question for anyone using a single encoder, which option would be more convenient:
    .
    I don't know about others, but I change the station more often than the volume. So option #2.
    As for spinning and the station list, I would prefer the station to be changed in a loop in a given bank. Without the extra clicks of "OK"
    That is.
    1. turning the knob - changing the station up or down, within the bank. Without previewing the station name or the name may flash briefly.
    2. short press - "volume" interface, turning the knob up and down: changes the volume
    Longer press - station list, scroll up and down through the station list, "ok" station selection.
    4. while in the station list, long press - bank selection list.

    If I could go crazy, this is what I would do :) .
  • #717 21454856
    khoam
    Level 42  
    @robgold A double click of the encoder would toggle between options i.e. whether volume first or station selection ;) .
  • #718 21454949
    robgold
    Level 20  
    I can see that as many people as many different needs and ideas. There is an option on the remote control to skip station by station. On the radio, however, it's good if there's a list, because with 99 stations, moving with a step of +1 can be a bit tiring. We will probably leave it as it is. Only in my version for the housing of the finished tuner I will leave it in the option with priority "volume" because something feels that in a moment a small TPA from TI will fly there and make an amplifier and then the volume control is a priority ;) .
  • #719 21454972
    DJCheester
    Level 26  
    I admittedly use the radio on my PCB without encoders, but nevertheless if I were ever to make an enclosure I would be in favour of volume control. And since my PCB provided in this topic has slots for two encoders, the question is whether it would not be possible to set the list and stations permanently under the second encoder.

    As someone would have two it would be easier to operate, especially for a pensioner like me 😀 . Especially as there is such an option on the PCB.

    Besides, if others make their enclosures two encoders can then be put on the faceplate without a problem.

    So far there is a remote control
  • #720 21454979
    wirbud
    Level 13  
    back to the FLAC ripping - I don't understand it a bit - but the Russkies have found a solution.
    He quotes the translation:

    A bit of history:
    E-radio is compiled on Arduino, and Arduino uses an
    already compiled ESP-IDF ( https://github.com/espressif/esp-idf ) with many libraries.
    When compiling ESP-IDF you can configure whatever you want, but Arduino uses the default configuration and there is no way to fix this.
    I found a good solution at https://github.com/sch...better_wifi_throughput
    The problem with the internet was in the maximum TCP connections used by the LWIP library in the esp-idf sdk and recompiled esp-idf with the new parameter
    CONFIG_LWIP_MAX_ACTIVE_TCP=512
    CONFIG_LWIP_MAX_LISTENING_TCP=512
    CONFIG_LWIP_TCP_SND_BUF_DEFAULT=8192
    CONFIG_LWIP_TCP_WND_DEFAULT=32768
    CONFIG_LWIP_TCP_RECVMBOX_SIZE=32
    CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
    BLWIP-FIX.ZIP 2. Unzip and copy liblwip.a to the directory (you have a username, hardware version may be different): C:UsersAppDataLocalArduino15packages32hardwareespesp322.0.17tools.liblwip.a - for ESP32 or C:UsersAppDataLocalArduino15packages32hardwareesp322.0.17UsersuserAppData - for ESP32S3 (the old liblwip.a file should be in this directory, which we will replace with the new file) 3. Restart Arduino 4. Recompile E-radio as before and load into ESP32
    Works with kernels 2.0.6 - 2.0.17 If you want the same fix for kernel 3.0.X - see post:
    liblwip for 3.0.5 I hope my experience will be useful for e-radio enthusiasts who have the same problems

    As if anyone needed it - I've passed the registration at https://4pda.to/forum and can already download files.

Topic summary

The discussion revolves around building an internet radio and audio file player using the ESP32-S3 microcontroller. The project includes features such as an OLED display, Wi-Fi connectivity, and audio playback capabilities. Users share their experiences with hardware setup, including issues with pin configurations, library compatibility, and troubleshooting compilation errors in the Arduino IDE. Suggestions for libraries, such as ESP32-audioI2S and WiFiManager, are provided to enhance functionality. Participants also discuss the importance of proper wiring, capacitor usage for encoders, and the potential for adding features like DLNA support and a web management interface for radio station management. Several users report on their progress, share code snippets, and offer solutions to common problems encountered during development.
Summary generated by the language model.
ADVERTISEMENT