Closed tsctrl closed 2 years ago
update, i have use V2 with hardware playback with the same result.
result: large delay on playback as above.
D: Song stopped correctly after 0 msec D: Connect to host icecast.omroep.nl:80/radio1-bb-mp3 D: Connect to icecast.omroep.nl on port 80, extension /radio1-bb-mp3 D: Connected to MP3 host at 145.58.53.145 on port 80 D: send GET command D: Switch to HEADER D: Headerline: Content-Type: audio/mpeg D: audio/mpeg seen. D: Headerline: icy-br:192 D: Headerline: ice-audio-info: samplerate=48000;channels=2;bitrate=192 D: Headerline: icy-br:192 D: Headerline: icy-genre:Talk D: Headerline: icy-metadata:1 D: Headerline: icy-name:NPO Radio1 D: Headerline: icy-pub:0 D: Headerline: icy-url:http://www.radio1.nl D: Headerline: Server: Icecast 2.4.0-kh15 D: Headerline: Cache-Control: no-cache, no-store D: Headerline: Expires: Mon, 26 Jul 1997 05:00:00 GMT D: Headerline: Connection: Close D: Headerline: Access-Control-Allow-Origin: * D: Headerline: Access-Control-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type, Icy-MetaData D: Headerline: Access-Control-Allow-Methods: GET, OPTIONS, SOURCE, PUT, HEAD, STATS D: Headerline: icy-metaint:16000 D: Switch to DATA, bitrate is 192, metaint is 16000 D: Streamtitle found, 47 bytes
Can you disconnect the rotary switch. Maybe this is causing the trouble.
i have disconnected the rotary encoder. ir sensor, lcd and only retain the vs1053.restarted the device i still having the same issue.
With the "test" command in the serial interface you can see some stream info. If there is a low number of bytes in the stream, you have a network problem. Try a different network.
hi @Edzelf, how low is low? i am streaming the url directly in web browser using the same network as the esp32 is connected and it play smoothly in browser.
wondering if there is any variable or settings i could change to tweak or play around to get the optimal stream. other than that what else i could do to check?
thanks!
could you point the code part where the stream was transfered to the spi? any way i could increase the buffer?
this is the details when i press the test button.
Here some console logs:
D: Connect to new host 109.206.96.34:8100 D: Connect to 109.206.96.34 on port 8100, extension / D: Connected to server D: Switch to HEADER D: Headerline: icy-name:NAXI LOVE RADIO (NAXI,Belgrade,Serbia, NAXI,Beograd,Srbija) - 128k D: Headerline: icy-genre:Love and Romance D: Headerline: icy-url:http://www.naxi.rs D: Headerline: content-type:audio/mpeg D: audio/mpeg seen. D: Headerline: icy-pub:0 D: Headerline: icy-metaint:8192 D: Headerline: icy-br:128 D: Switch to DATA, bitrate is 128, metaint is 8192 D: Duration mp3loop 35 D: Metadata block 48 bytes D: Streamtitle found, 47 bytes D: StreamTitle='Ja biram sta slusam';StreamUrl=''; D: Command client available D: handlehttp started D: Get command is: status D: Send reply for status D: Command: status with parameter 0 D: Command client available D: handlehttp started D: Get command is: status D: Send reply for status
D: Command: test with parameter 0 D: Stack maintask is 6008 D: Stack playtask is 92 D: Stack spftask is 600 D: ADC reading is 0 D: scaniocount is 10 D: Max. mp3_loop duration is 35 D: 0 IR interrupts seen D: Free memory is 218192, chunks in queue 97, stream 0, bitrate 3435518 kbps D: Duration mp3loop 1 D: Duration mp3loop 4 D: Duration mp3loop 6 D: Command client available D: handlehttp started D: Get command is: status D: Send reply for status D: Command: status with parameter 0 D: Duration mp3loop 7
tested most of the preset and radio in the search list with the same results
As you can see, there is no input in the stream. So try a different network.
D: Free memory is 218192, chunks in queue 97, stream 0, bitrate 3435518 kbps
i have tried to place the module just beside the internet router to get the strongest signal and tried with other wifi network too. mobile hotspot and different fibre internet with the same lag.
Hi @Rainer-G ,
thank you and appreciate your reply. i updated pin definition in config to -1 as below: D: Command: pin_enc_clk with parameter -1 D: Command: pin_enc_dt with parameter -1 D: Command: pin_enc_sw with parameter -1
and pull the rotary decoder off but still have the same issue. I also tried with open hotspot from my pc connected to gbit lan, the esp is very close to the pc hotspot but still having the same lag issue.
probably my vs chip is fake? or i guess this is something related to the how the wifi connection is fetching the stream and how the stream is feed to the vs1053. probably require some logic where how many byte was in buff and how it is transferred to the vs1053. i also have tweaks esp hardware related wifi configuration to enable more rx buffer, speed optimization, enable features like ampdu tx and also set the esp signal strength to the max but still with the same issue.
Hi @Edzelf
below is my startup logs:
D: Starting ESP32-radio running on CPU 0 at 240 MHz. Version Mon, 28 Jun 2021 12:40:00 GMT. Free memory 282876 D: Display type is BLUETFT D: Partition nvs found, 24576 bytes D: Read 42 keys from NVS D: pin_ir set to 35 D: pin_enc_clk set to 25 D: pin_enc_dt set to 26 D: pin_enc_sw set to 27 D: pin_tft_cs set to 15 D: pin_tft_dc set to 2 D: pin_tft_scl set to -1 D: pin_tft_sda set to -1 D: pin_tft_bl set to -1 D: pin_tft_blx set to -1 D: pin_sd_cs set to 21 D: pin_ch376_cs set to -1 D: pin_ch376_int set to -1 D: pin_vs_cs set to 5 D: pin_vs_dcs set to 16 D: pin_vs_dreq set to 4 D: pin_shutdown set to -1 D: pin_shutdownx set to -1 D: pin_spi_sck set to 18 D: pin_spi_miso set to 19 D: pin_spi_mosi set to 23 D: GPIO0 is HIGH D: GPIO2 is HIGH D: GPIO4 is HIGH D: GPIO5 is HIGH D: GPIO12 is HIGH D: GPIO13 is HIGH D: GPIO14 is HIGH D: GPIO15 is HIGH D: GPIO16 is LOW, probably no PULL-UP D: GPIO17 is HIGH D: GPIO18 is LOW, probably no PULL-UP D: GPIO19 is HIGH D: GPIO21 is HIGH D: GPIO22 is HIGH D: GPIO23 is HIGH D: GPIO25 is HIGH D: GPIO26 is HIGH D: GPIO27 is HIGH D: GPIO32 is HIGH D: GPIO33 is HIGH D: GPIO34 is LOW, probably no PULL-UP D: GPIO35 is LOW, probably no PULL-UP D: GPIO39 is LOW, probably no PULL-UP D: gpio_00 will execute uppreset = 1 D: gpio_12 will execute upvolume = 2 D: gpio_13 will execute downvolume = 2 D: Enable pin 35 for IR D: Start display D: Create list with acceptable WiFi networks D: Added xxxx to list of networks D: End adding networks D: Scan Networks D: Scan completed D: Number of available networks: 12 D: 1 xxxxx - Signal: -16 dBm, Encryption WPA2_PSK, ..... D: End of list D: Command: clk_dst with parameter 0 D: Command: clk_offset with parameter 8 D: Command: clk_server with parameter my.pool.ntp.org D: Command: gpio_00 with parameter uppreset = 1 D: Command: gpio_12 with parameter upvolume = 2 D: Command: gpio_13 with parameter downvolume = 2 D: Command: ir_40bf with parameter upvolume = 2 D: Command: ir_c03f with parameter downvolume = 2 D: Command: mqttbroker with parameter none D: Command: mqttpasswd with parameter *** D: Command: mqttport with parameter 1883 D: Command: mqttprefix with parameter none D: Command: mqttuser with parameter none D: Command: pin_enc_clk with parameter 25 D: Command: pin_enc_dt with parameter 26 D: Command: pin_enc_sw with parameter 27 D: Command: pin_ir with parameter 35 D: Command: pin_sd_cs with parameter 21 D: Command: pin_tft_cs with parameter 15 D: Command: pin_tft_dc with parameter 2 D: Command: pin_vs_cs with parameter 5 D: Command: pin_vs_dcs with parameter 16 D: Command: pin_vs_dreq with parameter 4 D: Command: preset with parameter 8 D: Command: preset_00 with parameter 109.206.96.34:8100 D: Command: preset_01 with parameter airspectrum.cdnstream1.com:8114/1648_128 D: Command: preset_02 with parameter us2.internet-radio.com:8050 D: Command: preset_03 with parameter airspectrum.cdnstream1.com:8000/1261_192 D: Command: preset_04 with parameter airspectrum.cdnstream1.com:8008/1604_128 D: Command: preset_05 with parameter us1.internet-radio.com:8105 D: Command: preset_06 with parameter icecast.omroep.nl:80/radio1-bb-mp3 D: Command: preset_07 with parameter 205.164.62.15:10032 D: Command: preset_08 with parameter astro2.rastream.com/era D: Command: preset_09 with parameter 94.23.66.155:8106 D: Command: preset_10 with parameter ihr/IHR_IEDM D: Command: preset_11 with parameter ihr/IHR_TRAN D: Command: toneha with parameter 0 D: Command: tonehf with parameter 0 D: Command: tonela with parameter 0 D: Command: tonelf with parameter 0 D: Command: volume with parameter 72 D: Slow SPI, Testing VS1053 read/write registers... D: Fast SPI, Testing VS1053 read/write registers again... D: Connect to WiFi D: Try WiFi xxxx D: Connected to xxxxx D: IP = 192.168.0.132 D: Start server for commands D: Network found. Starting mqtt and OTA D: Rotary encoder is enabled D: Sync TOD D: Sync TOD, new value is 01:09:43 D: STOP requested D: New preset/file requested (8/0) from astro2.rastream.com/era D: New station request D: Connect to new host astro2.rastream.com/era D: Connect to astro2.rastream.com on port 80, extension /era D: Song stopped correctly after 0 msec D: Connected to server D: Switch to HEADER D: Headerline: icy-br: 47 D: Headerline: icy-pub: 0 D: Headerline: icy-description: Unspecified description D: Headerline: icy-url: D: Headerline: Instance-id: 2f65edb2bb2da9af8cbeed2ca3f4f298 D: Headerline: Cache-Control: no-cache D: Headerline: Server: AIS Streaming Relay 8.6.5 D: Headerline: icy-genre: various D: Headerline: Expires: Mon, 26 Jul 1997 05:00:00 GMT D: Headerline: icy-metaint: 1024 D: Headerline: Pragma: no-cache D: Headerline: icy-name: D: Headerline: Connection: close D: Headerline: Content-Type: audio/aacp D: audio/aacp seen. D: Headerline: Set-Cookie: AISSessionId=6220f200b840d683_3197913_vKHviNQD_MTAzLjIxLjgxLjM6ODA!_0000004hLFL; Path=/; Domain=astro2.rastream.com; Max-Age= D: Switch to DATA, bitrate is 47, metaint is 1024 D: Metadata block 96 bytes D: Streamtitle found, 91 bytes D: StreamTitle='Adele - Easy On Me';StreamUrl='Easy On MeAdeleEasy On MeAdeleEasy On MeAdele'; D: Duration mp3loop 82 D: Metadata block 256 bytes D: Streamtitle found, 240 bytes
thanks!
updated pin definition for rotary encoder in config to -1 after the config above with the same issue. use/play any channel with the same issue
The station astro2.rastream.com/era plays well on my radio. But I am using version 2. The "test" command reveals:
test
D: Free memory is 66832, chunks in queue 400, bitrate 48 kbps
So the input stream queue is fully filled (400 chunks is the max).
This line:
D: GPIO16 is LOW, probably no PULL-UP
is strange, GPIO16 is your vs_dcs, that should be pulled high if idle.
configuring pins to -1 is not necessary, all pins except the SPI pins are set to -1 by default.
Hi @Edzelf , @Rainer-G
I have fix the issue.
using the pcb in the doc but did not realize the pin 16 is used for nextion and i have plug it in for dcs. i move the dupon to pin 32 and it works! no more lags! // GPIO16 RXD2 - - - TX of NEXTION (if in use)
Before i end this, i would like to ask here a bit more. i have question regarding the vs1053. is the output is only from the audio out 3.5mm audio jack? means the isolator transformer need to be connected to the audio jack before going to the PAM amplifier? i saw other version of pcb in the doc which the PAM amplifier and the isolator transformer is hooked up directly in the pcb. how its done? thats what make me wondering if there is other output pin available from the vs1053 to be connected to the pcb traces where i did not find any. I unable to find the pcb from Harm Verbeek to check as the site to download the pcb was unavailable now.
Thank you so much for your time, help and reply. thanks again for this great project!
hi @Rainer-G , thank you for the tips, look like couldnt avoid to use the 3.5mm jack interface to the pam. it looks improper to connect both component (vs-pam) using the 3.5mm jack and crimping 3.5jack with wire are so frustrating. that is one of the reason i hopefully does not have to use any 3.5mm audio jack on my setup. any way of using isolated power or a transformer couldnt help me to solve the 3.5mm jack setup. where i am wondering the picture i shared previously where it install pam transformer and vs in a single board without require 3.5mm jack or it is actually required but not installed by @Edzelf in the doc image.
i have bought a isolated psu 5-15v recomended by Ed in the doc as this one to try but it havent arrive yet
also a audio transformer too:
would like to see how it goes. hope i did not have to use any of this component and could accept the audio quality without it. so far i am satisfied with audio output from vs to external speakers with build in amp amp. i havent use internal speakers with pam. i guess using pam could be the cause of the audio quality issue mentioned. i still have lots to try to decide.
would like to know what kind of isolated 12v power u are using. thanks again!
thanks @Rainer-G, will add the isolation as seems it is required. i will check the option how it is done in VS1053 Feather board too.
closing this issue as resolved.
hi Ed!
i had issue where audio is lagging. it is 2s playback and then 10s silence and playback again for 2s then silence back.
i have use the provided pcb and check the connection. i am using usb to power the esp and did not attach the 220uf and 470uf caps for now to test.
i am on master branch. compiled and flash successfully to the original esp32 devkit. the internet radio link just play nicely on web browser.
the rotary encoder dail is not working as expected, i am using a 3x 10k ohm rotary encoder. only able to mute and unmute. 2 or 3 press will display channel selection but turning the knob does not change the channel on display.
thanks!