logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 114222 1263
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • #871 21470103
    robgold
    Level 20  
    @wirbud to eliminate any pin, connection issues start with the connection as it is defined in the software - this is a reliable proven configuration. Not every GPIO on the ESP32 is usable. It's hard to say if what you have is a problem with the display or the quality of connecting it all together. You need to take a small step approach to solving this - if you make a lot of changes at once, redefine the pins, on top of that everything "hangs" on the "Arduino" cables then unfortunately diagnostics are almost impossible. Updates from the network are done by being in the Bank menu and pressing the remote button assigned to the command rcCmdDirect . Alternatively, delete the bank files from the card then the radio will have to download them from the network.

    I don't know if you managed to take a picture or if that green LED is on all the time on the module, which would mean that the UART is sending something all the time and that's a big problem. Normally the UART only sends some debug information, when changing stations etc. It does not transmit non-stop. It does not transmit non-stop.

    @CodeBoy very interesting design. The undoubted advantage is the use of an already existing VFD display. Unfortunately not every radio has one that can display letters. The board doesn't appeal to me. Everything put together with "Lego Arduino" ;) .
  • ADVERTISEMENT
  • #872 21470146
    wirbud
    Level 13  
    But you sensed me ;-) Actually the current version has the pins for the screen for SPI2 and not as in the forum one. But previously I had the pins as per the schematic. Similar problems. I will go back to the forum ones. My ESP32S3 board is the popular version from ali and the WS RGB diode is on pin 48 - and this is connected to the MOSI SD.
    I had the red and green LEDs blinking - in the version compiled under Platformio. Now I've compiled with Arduino and the green diode doesn't blink and the red one is on continuously.
    In addition - FLAC doesn't jam like it does with code compiled with Platformio ..... My conclusion is that the Platformio downloads independently the software for the ESP32 boards and the flac stutters a lot. So for this reason you have to stay with the arduino or point the Platformio to use the russian network libraries.
  • #874 21470219
    hevet
    Level 16  
    @robgold When the radio starts up, the sampling value, bit count and kbps value are missing. Only displays:
    0.0kHz bit kbps
    Values will appear when I change stations, or if a station is broadcasting song or programme information and they change.
  • #875 21470484
    robgold
    Level 20  
    @hevet, I've uploaded a fix, see if that solves the problem. With me this effect doesn't occur but indeed at startup if you have a specific link this can happen. Would like to get rid of that extra refresh at all costs.

    @ArturAVS it's just a shame that it's one line. Not much to display with a radio like that. Definitely cool for some project. I like the VFDs a lot.
  • #876 21470523
    hevet
    Level 16  
    @robgold I have applied the corrections, looks like the problem has disappeared :) .

    Ps. what interesting mode 3 are you introducing there?
  • #877 21470555
    robgold
    Level 20  
    Well there is literally nothing hiding ;) Ah these commits on GitHub...everything as on the palm of your hand :D .
    I haven't settled with myself yet.... And seriously, it was supposed to be a mode in which the station name is written in small font and the srcoller works with large font like Marantz/Denon network players. However, this requires adding Polish "tails" to the large font.
  • #878 21470595
    wirbud
    Level 13  
    it runs beautifully. No hang-ups, no junk on the screen, (now I'm just practicing the encoder without WEB control ).
    Respect! Thank you very much.
    Will you throw in those 2 lines - of course if MCLK doesn't slow down the radio - well, because it would be pointless to give the proc a job without needing it.
    I have the feeling, however, that whether there is this declaration or not, there is no difference in the work of the radio.

    #define I2S_MCLK 0
    audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT, I2S_MCLK); // Configure pinout for I2S audio interface
  • #879 21470611
    robgold
    Level 20  
    @wirbud fantastic that everything is working. You must have connected somewhere where there was already some function mapped or to the pins where the PSRAM is. I'll do an "ifdef" in my spare time and there will be a declaration if there is SPDIF or not. From what I remember it is for ESP32-S3 you can move this signal to any GPIO. It doesn't have to be on 16 or 0. I think this restriction is for other modules.
  • ADVERTISEMENT
  • #880 21470627
    MAJSTER XXL
    Level 29  
    And I went back to my original version on the 128x64 display today, I am delighted with its brightness and clarity. In small steps I am rewriting the display on it from my v2 version with a 256x64 screen.
    This old version got a whole new life, a few things had to be knocked out like the weatherman, the joystick, the calendar card.
    For now, I still don't have support for those original 4 buttons, only 2 encoders work, the radio and file player work elegantly. It remains to refine the content display. If anyone has had and is still using this first version, it's time for a full update:
    https://github.com/sarunia/ESP32_radio_player/blob/main/ESP32_radio_player.ino

    If one had such a screen with the same brightness and pixel size, but 256x64, it would be wonderful:



    .
  • #881 21470760
    Lechuuu
    Level 13  
    I have a problem with missing Time.h library, I am using arduino 1.8.19

    ESP32_radio_evo3.15:18:10: fatal error: Time.h: No such file or directory
       18 | #include <Time.h>  // Biblioteka do obsługi funkcji związanych z czasem, np. odczytu daty i godziny
          |          ^~~~~~~~
    compilation terminated.
    exit status 1
    Time.h: No such file or directory
    .

    https://github.com/PaulStoffregen/Time

    Is this the library? Only I have doubts because here is TimeLib.h and in the code Time.h
  • #882 21470784
    wirbud
    Level 13  
    most importantly whether you have the manufacturer's board library version 2.0.17!
    In the Arduino libraries - quite empty.... (libraries with the corresponding versions are on Github of the author and robgold.
    In my case it compiles with such content:


    Screenshot of a folder containing programming libraries. .
  • #883 21470798
    Lechuuu
    Level 13  
    @wirbud MAJSTER XXL and robgold have not added this library to their projects. Ardoino version 2 does not have this library added by default either. Generally it works for me because I commented out the library, and later still tried with the one I gave in the link.... I'm just wondering because robgold wrote about adding a dimmer and the display dims after 10 seconds, but I don't have anything like that, hence my question if I'm sure I have the right library.


    I currently have the manufacturer's tile library version 3.0.7
  • ADVERTISEMENT
  • #884 21470803
    robgold
    Level 20  
    The Time library is a standard library of the Espressif package. This would mean that you do not have the core for ESP installed correctly.
    3.0.7 is the best version, as there are no problems with the Audio library and the improved pre-compiled part responsible for the wifi connection works, so you can play stations broadcasting in FLAC format without problems.

    Screenshot showing code in an editor with the time.h library .
  • #885 21470852
    Slawek K.
    Level 35  
    I've looked through this code in more detail, and I have a suggestion, I would suggest knocking this debugging on Serial out of the code, or at least flagging it with some kind of bool so that in the final code it doesn't spit on Serial, as this causes a lot of lag and also potential problems with audio or lcd stuttering :) and there is a huge amount of this in the loop, and more.

    Greetings
  • #886 21470857
    robgold
    Level 20  
    @Sławek K This debug on the serial is only when we're doing something so it doesn't take part when you play the stream. In fact, that's why I put "debug-- .... almost everywhere " to make it easy to cut it out. At the moment this makes software development very easy. I'll have to think of a bit to disable it in releases.
    I haven't noticed that it cuts playback or radio performance in any way. Have you caught any problems with this?
  • #887 21470869
    hevet
    Level 16  
    No bushes on the display have occurred at my place so far either, also great.
  • ADVERTISEMENT
  • #888 21470876
    robgold
    Level 20  
    @CodeBoy Going back for a moment to that Sony conversion you showed. I'd be very interested to see what's on that SD card. I wonder if we will find there a banks file downloaded from JCS, Major or myself ;) .
  • #889 21470918
    CodeBoy
    Level 33  
    robgold wrote:
    @CodeBoy Going back for a moment to that Sony conversion you showed. I would be very interested to see what is on that SD card. I wonder if you will find there a banks file pulled from JCS, the Major or myself ;)
    .

    Unfortunately I don't know the author of the modification, but looking that your soft is already some months old I wouldn't be surprised at all :)
  • #890 21471675
    pacmanx
    Level 12  
    You don't have to worry, I am the author of this Sony :) conversion on the card are my banks in my format. Anyway, I came across this thread after I had already written my radio software. Interestingly I have my own AirPlay implementation on the radio :) and a couple of other solutions like spdif on the other i2s.
    There is a dedicated PC software with Radiobrowser API support for the lists - so the user can easily arrange their lists and save them to the tuner. Anyway, there are about 90 stations in my list to start with - I bet yours have more.
    As for the board - this is easier, cheaper and faster. No smd soldering which I don't like. I've wondered a few times if I shouldn't make a board not based on universal modules, but I don't see much point... it would be hard to solder esp well (ground underneath) and also USB can come in handy in these modules.
    The advantage is the original DAC and digital filter - I have information from the first users that the quality is better than the original Denon tuners :) .
  • #892 21471880
    robgold
    Level 20  
    @pacmanx Not worried at all :) That's why I made the content available on GitHub to use. I was just curious because I know what a tedious job it is to put together all these banks, streams etc. Glad to welcome you here. I've been thinking about the app too and the option to create Banks using radiobros. "Melody of the future", maybe one day. As for SMD soldering and that pad under the module, there is a simple solution for that - you make a hole such a big metallized via and then pour tin or don't solder those pads at all. Espressif himself wrote that it is not necessary to solder them, they do not function as thermal pads. I assume you are also using the audio implementation from Wollie. Wouldn't you like to share the SPDIF output implementation ?

    If anyone would be interested in a peek inside this tuner, here is the service manual:
    https://dn790008.ca.archive.org/0/items/manual_DAR1000ES_SM_SONY_EN/DAR1000ES_SM_SONY_EN.pdf .

    As far as I can see, the VFD display has its own circuit and "dares" over serial communication, Data IN and CLK. It can display 22 characters. This is practically the name of each station can be shown "at once". In addition, the keyboard is a typical 6x8 matrix. Not a bad base for modifications, it gives a chance to use the original buttons and display.

    Datasheet of the transmitter:
    https://www.alldatasheet.com/datasheet-pdf/view/118636/SONY/CXD2564AM.html .

    @pacmanx When i2s is applied and the mute is turned off on the SYSM pin and possibly INIT initialised does it start immediately or do you need to do some more "magic" with this transmitter ?
  • #893 21472041
    pacmanx
    Level 12  
    >>21471880 .
    Yes, I am using this implementation, but I have removed code that is unnecessary for me + I have made a lot of changes and corrections so it is already significantly different from the original. I rewrote some things "my way". Among other things, I threw in support for the ALAC codec and AirPlay.
    Spdif - no secrets here, it's based on this code: https://github.com/amedes/esp_a2dp_sink_spdif
    I made the rest, i.e. the interface with the user, communication with the PC application or writing/reading the settings from scratch in my own way, on dedicated threads and so as to relieve the decoding processes or communication essential for stream playback.
    I also didn't try to embrace the web interface - because it's hard to make it work satisfactorily on esp. This is also due to my assumptions - I don't have, for example, any limits on the number of stations in the banks. There is an interface, but you could say - a vestigial one, for basic operation and replacing the remote control. A dedicated application working online with the tuner is a more convenient solution and also wider possibilities.
    For the display, keyboard and remote control, I use the whole board with the controller already existing there from Sony. It's simpler and more convenient that way.
    As for the transmitter, there's no "special" magic there. I, not being some kind of expert managed it, so others should also :) .
    Generally, my conversion was aimed at interfering as little as possible with the radio - without any sheet metal cutting or major modifications to the electronics and so to retain as much of the original as possible. If it wasn't for the need for a 3.3->5V conversion, the whole thing could be closed with just the esp board practically because everything happens in the software.

    I did the whole conversion for myself, but a couple of people asked me to make them these radios too. Now I would probably use a raspberry (e.g. zero), because as I see it, esp has too many limitations which don't allow to add some cool features and adding anything else is a balance between performance and possibilities. Although probably this version will not be created, because what is there already has what I wanted (radio and especially AirPlay).
  • #894 21472242
    robgold
    Level 20  
    Welcome,

    New revision of Evo 3.16 - Link
    What's new ?
    - This is the first version to hold full station information (name, bank, number, URL) in the PSRAM. Until now, the URL was kept ONLY in a file on the card. This sped up access to this data minimally. And why this change ? Evo 3.16 can work WITHOUT an SD-CARD.

    If the radio does not detect an SD card, it will load Bank1 into memory on first start-up and will start playing station 1. Changes to stations and banks and the volume parameter will be kept in EEPROM in this case. The Bank change board will show "NO CARD" and will constantly display "NETWORK UPDATE". On the main screen I have decided not to put, any additional information that we are working without a micro SD card.

    Advantages:
    - we can build a radio using only EPS32 one encoder or IR receiver and PCM converter

    Disadvantages of this solution:
    - saving Flash memory every time (EEPROM in ESP32 is emulated)
    - no storage of equalizer settings
    - no synchronisation between EEPROM data and SD card. The card always has priority.
    - Sometimes GitHub has a long response time to the Bank data upload request. I don't know if it's a peculiarity of my connection or if it's just like that.
    - You are "condemned" to listen to what is on GitHub, any changes of stations, numbers will be felt immediately. The radio only records the bank number and the station number, so it doesn't know if under bank 1, station 3 is RMF or maybe Radio Zet.
    - Limit the length of the station name including the URL to 200 characters. I randomly checked and the average is 100-120 characters. It seems to me that there is no link longer than 200 characters in Banks.

    Let me know if this makes sense.
    I did this as a fun activity for fun and it turned out to work quite well so I decided to upload to GitHub.

    ESP32 device display showing BANK 1, NO CARD, and NETWORK UPDATE. .
  • #895 21472269
    tytka
    Level 22  
    ArturAVS wrote:
    The front panel of the NBOX has a pretty cool VFD.


    VFD displays have their charm, I like them too.
    But better for this purpose, would be a Posnet checkout display.
    Here is my attempt with such a display:
    VFD display showing text NOWY ŚWIAT T - PION I and time 19:23. .
    To be honest, I had initially planned to use one in my radio for the mini 25 set, but unfortunately it is too wide to layout the front as I would have liked. So I ended up using a 2.4" OLED there.
    Media player with a front panel display and several control buttons. .
  • #896 21472274
    robgold
    Level 20  
    @tytka I think I have the same VFD just from an old box :) For worse some on the exchange I bought a case with it. What I miss about OLEDs is the brightness. If there's no filter in front of them it's OK but building them into any equipment already makes their low brightness very apparent. Even Denon/Marantz using exactly the same OLED we have here in the radio (3.12 inches) uses a very slightly smoky graphite filter to make anything visible.

    It looks very nice what you have built. Is this some part of a larger set up ?
  • #897 21472538
    DJCheester
    Level 26  
    Gentlemen a little on the other side

    If I would like to build the radio on a PCB such Arduino-like

    https://pl.aliexpress.com/item/1005008143867026.html

    Use a sandwich-type overlay or can the pins declared in the sketch be freely changed ? Or some must remain in their places ?

    The idea is to use what is already in place and not to move the unsoldered ones.

    It is about this variant

    Purple ESP32-S3 UNO board with labeled pins and dimensions.

    Greetings ...
  • #898 21472891
    tytka
    Level 22  
    @robgold I had to put a filter, two in fact, in front of the OLED in my project.
    I wanted an orange colour to coordinate with the rest. So there's a yellow OLED, a red filter on top of it, and still a smoked filter on top of it to dull the red and deepen the black. Unfortunately the brightness has clearly lost out on this.

    OLED screen with yellow display and red filter on a silver panel. .

    And the answer to your question is: yes, this is part of the kit, there are three more items in it.
  • #899 21474252
    hevet
    Level 16  
    Does the version from @robgold also have an hour forward on you?
  • #900 21474304
    robgold
    Level 20  
    @hevet actually does, I didn't even pay attention. I don't know why, I'll have to check because there were no problems before.
📢 Listen (AI):

Topic summary

The discussion centers on the development of an internet radio and audio file player based on the ESP32-S3-WROOM-1 module, featuring a custom-designed prototype PCB with OLED display and user controls including rotary encoders and buttons. Key challenges addressed include pin spacing discrepancies in the ESP32-S3 module footprint, integration of Wi-Fi connectivity with dynamic station list updates, and handling of Polish character encoding on the OLED display. The project uses Arduino IDE (version 2.3.2) with ESP-IDF support and requires enabling PSRAM. Audio playback supports MP3, AAC, and FLAC streams, with the ESP32-audioI2S library recommended over the incompatible Audio library. Users reported issues with SPI MISO pin assignment causing bootloader conflicts, resolved by reassigning MISO to pin 35. The project incorporates WiFiManager for network configuration, EEPROM and SD card storage for saving last played station and settings, and includes plans for tone control via an external KA2107 equalizer and a CS8673 amplifier module. Problems with encoder input stability and memory limitations for Bluetooth A2DP on ESP32-S3 were noted. The community suggested alternatives like KaRadio and ESP32-MiniWebRadio projects. Debugging tips include serial terminal logs for HTTP errors and flash memory erasure to resolve boot loops. The project is open-source on GitHub, encouraging forks and modifications. Additional features under development include browser-based updates, directory navigation, and potential audio recording to SD card.
Summary generated by the language model.
ADVERTISEMENT