Edzelf / ESP32-Radio

Internet radio based on ESP32, VS1053 and a TFT screen.
GNU General Public License v3.0
965 stars 227 forks source link

Volume control problem (error in dsp_update_line(); in the LCD2004.h file) #425

Open TomiBp opened 3 years ago

TomiBp commented 3 years ago

I tried to increase the volume but the device restarts automatically. If I do not define a volume of 0, it will constantly restart again and again.

I only use these two devices: banggood - ESP32 Development Board WiFi+bluetooth Ultra Low Power Consumption Dual Cores ESP-32 ESP-32S Board aliexpress - 1PCS New VS1053 MP3 Module Development Bard (on-board recording funcon)

ESP -   cable   -   VS1053
+5V -   red -   +5V
GND -   black   -   GND
EN  -   purple  -   XRST
4   -   gray    -   DREQ
5   -   white   -   XCS
18  -   green   -   SCK
19  -   orange  -   MISO
23  -   yellow  -   MOSI
32  -   brown   -   XDCS

LOG:

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

D: Starting ESP32-radio running on CPU 1 at 160 MHz.  Version Mon, 19 Oct 2020 14:12:00 GMT.  Free memory 287864
D: Display type is LCD2004
D: Partition nvs found, 20480 bytes
D: Read 17 keys from NVS
D: pin_ir set to -1
D: pin_enc_clk set to -1
D: pin_enc_dt set to -1
D: pin_enc_sw set to -1
D: pin_tft_cs set to -1
D: pin_tft_dc set to -1
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 22
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 32
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 LOW, probably no PULL-UP
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 HIGH
D: GPIO17 is HIGH
D: GPIO18 is HIGH
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: SD Card Mount Failed!
D: Create list with acceptable WiFi networks
D: Added 1200mbps to list of networks
D: End adding networks
D: Scan Networks
D: Scan completed
D: Number of available networks: 4
D:  1 - 1200mbps-csak-Internet    Signal: -58 dBm, Encryption WPA_WPA2_PSK, Acceptable
D:  2 - 1200mbps                  Signal: -61 dBm, Encryption WPA_WPA2_PSK, Acceptable
D:  3 - FaryLink_E148CB           Signal: -68 dBm, Encryption OPEN, 
D:  4 - 3Bredband-BD2A            Signal: -78 dBm, Encryption WPA2_PSK, 
D: End of list
D: Command: pin_sd_cs with parameter 22
D: Command: pin_spi_miso with parameter 19
D: Command: pin_spi_mosi with parameter 23
D: Command: pin_spi_sck with parameter 18
D: Command: pin_vs_cs with parameter 5
D: Command: pin_vs_dcs with parameter 32
D: Command: pin_vs_dreq with parameter 4
D: Command: preset with parameter 1
D: Command: preset_00 with parameter adas.klubradio.hu/stream.m3u
D: Command: preset_01 with parameter stream.klubradio.hu:8080/bpstream
D: Command: preset_02 with parameter stream.klubradio.hu:8080/32kbit
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 0
D: Slow SPI, Testing VS1053 read/write registers...
D: Fast SPI, Testing VS1053 read/write registers again...
D: endFillByte is 0
D: Connect to WiFi
D: Try WiFi 1200mbps
D: Connected to 1200mbps
D: IP = 192.168.100.186
D: Start server for commands
D: Network found. Starting mqtt and OTA
D: MDNS responder started
D: Rotary encoder is disabled (-1/-1/-1)
D: STOP requested
D: New preset/file requested (1/0) from stream.klubradio.hu:8080/bpstream
D: Connect to new host stream.klubradio.hu:8080/bpstream
D: Connect to stream.klubradio.hu on port 8080, extension /bpstream
D: Song stopped correctly after 0 msec
D: Connected to server
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: HTTP input shorter than expected
D: Duration mp3loop 1
D: Switch to HEADER
D: Headerline: Server: Icecast 2.4.4
D: Headerline: Connection: Close
D: Headerline: Content-Type: audio/mpeg
D: audio/mpeg seen.
D: Headerline: Cache-Control: no-cache, no-store
D: Headerline: Expires: Mon, 26 Jul 1997 05:00:00 GMT
D: Headerline: Pragma: no-cache
D: Headerline: icy-br:96
D: Headerline: ice-audio-info: channels=1;samplerate=44100;bitrate=96
D: Headerline: icy-name:Klubradio 96kbit http Stream
D: Headerline: icy-pub:0
D: Headerline: icy-metaint:16000
D: Switch to DATA, bitrate is 96, metaint is 16000
D: Duration mp3loop 39
D: Metadata block 32 bytes
D: Streamtitle found, 18 bytes
D: StreamTitle=' - ';
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: status with parameter 0
D: Command client available
D: handlehttp started
D: Get command is: upvolume=2
D: Send reply for upvolume=2
D: Command: upvolume with parameter 2
Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x400d235d  PS      : 0x00060b30  A0      : 0x800d23ca  A1      : 0x3ffd84d0  
A2      : 0x00000000  A3      : 0x000000d4  A4      : 0x00000020  A5      : 0x3ffb8058  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x800d235d  A9      : 0x3ffd84b0  
A10     : 0x3ffd3940  A11     : 0x00000020  A12     : 0x00000001  A13     : 0x80000020  
A14     : 0x00000000  A15     : 0x3ffd7d20  SAR     : 0x00000010  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000018  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0xffffffff  

Backtrace: 0x400d235d:0x3ffd84d0 0x400d23c7:0x3ffd84f0 0x400d23ed:0x3ffd8510 0x400d2420:0x3ffd8530 0x400d245b:0x3ffd8550 0x400d24dd:0x3ffd8580 0x400d26da:0x3ffd85b0 0x400d4695:0x3ffd85d0 0x400d46c2:0x3ffd85f0 0x4008aba5:0x3ffd8610

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

D: Starting ESP32-radio running on CPU 1 at 160 MHz.  Version Mon, 19 Oct 2020 14:12:00 GMT.  Free memory 287864
D: Display type is LCD2004
D: Partition nvs found, 20480 bytes
D: Read 17 keys from NVS
D: pin_ir set to -1
D: pin_enc_clk set to -1
D: pin_enc_dt set to -1
D: pin_enc_sw set to -1
D: pin_tft_cs set to -1
D: pin_tft_dc set to -1
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 22
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 32
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 LOW, probably no PULL-UP
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 HIGH
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: SD Card Mount Failed!
D: Create list with acceptable WiFi networks
D: Added 1200mbps to list of networks
D: End adding networks
D: Scan Networks
D: Scan completed
D: Number of available networks: 4
D:  1 - 1200mbps                  Signal: -56 dBm, Encryption WPA_WPA2_PSK, Acceptable
D:  2 - 1200mbps-csak-Internet    Signal: -56 dBm, Encryption WPA_WPA2_PSK, Acceptable
D:  3 - FaryLink_E148CB           Signal: -67 dBm, Encryption OPEN, 
D:  4 - 3Bredband-BD2A            Signal: -79 dBm, Encryption WPA2_PSK, 
D: End of list
D: Command: pin_sd_cs with parameter 22
D: Command: pin_spi_miso with parameter 19
D: Command: pin_spi_mosi with parameter 23
D: Command: pin_spi_sck with parameter 18
D: Command: pin_vs_cs with parameter 5
D: Command: pin_vs_dcs with parameter 32
D: Command: pin_vs_dreq with parameter 4
D: Command: preset with parameter 1
D: Command: preset_00 with parameter adas.klubradio.hu/stream.m3u
D: Command: preset_01 with parameter stream.klubradio.hu:8080/bpstream
D: Command: preset_02 with parameter stream.klubradio.hu:8080/32kbit
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 0
D: Slow SPI, Testing VS1053 read/write registers...
D: Fast SPI, Testing VS1053 read/write registers again...
D: endFillByte is 0
D: Connect to WiFi
D: Try WiFi 1200mbps
D: Connected to 1200mbps
D: IP = 192.168.100.186
D: Start server for commands
D: Network found. Starting mqtt and OTA
D: MDNS responder started
D: Rotary encoder is disabled (-1/-1/-1)
D: STOP requested
D: New preset/file requested (1/0) from stream.klubradio.hu:8080/bpstream
D: Connect to new host stream.klubradio.hu:8080/bpstream
D: Connect to stream.klubradio.hu on port 8080, extension /bpstream
D: Song stopped correctly after 0 msec
D: Connected to server
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: HTTP input shorter than expected
D: Duration mp3loop 1
D: Switch to HEADER
D: Headerline: Server: Icecast 2.4.4
D: Headerline: Connection: Close
D: Headerline: Content-Type: audio/mpeg
D: audio/mpeg seen.
D: Headerline: Cache-Control: no-cache, no-store
D: Headerline: Expires: Mon, 26 Jul 1997 05:00:00 GMT
D: Headerline: Pragma: no-cache
D: Headerline: icy-br:96
D: Headerline: ice-audio-info: channels=1;samplerate=44100;bitrate=96
D: Headerline: icy-name:Klubradio 96kbit http Stream
D: Headerline: icy-pub:0
D: Headerline: icy-metaint:16000
D: Switch to DATA, bitrate is 96, metaint is 16000
D: Duration mp3loop 38
D: Command client available
D: handlehttp started
D: Get command is: status
D: Send reply for status
D: Command: status with parameter 0
D: Metadata block 32 bytes
D: Streamtitle found, 18 bytes
D: StreamTitle=' - ';
D: Command client available
D: handlehttp started
D: Get command is: status
D: Send reply for status
D: Command: status with parameter 0
TomiBp commented 3 years ago

I found the cause of some of the error.

Esp32_radio.ino displayvolume() ;

=>>

LCD2004.h dsp_update_line(3) ;

I have another display (ILI9341) so I didn't look for the cause of the error anymore.

There must be an error in _dsp_updateline in the LCD2004.h file that causes the device to crash and restart.