jorgenkraghjakobsen / snapclient

WIP snapclient on ESP32
240 stars 50 forks source link

unable to boot on esp32 wroom module board #23

Open jirmjos opened 3 years ago

jirmjos commented 3 years ago

Hi Jorgen,

Sorry to bother you, so much.

Flashed board (at this moment I´m only have wroom modules at hand) but now it falls to a looping reboot I think is because try to init psram that this ESP32 module don´t have. I try to disable psram trough idf.py menuconfig - ESP32 audio buffer and i2s pin config --->, but seems no effect.

Seems a issue yet fixed on esp-idf v4.2, that is the idf version I use, but for some reason is not aplying on this project See : https://github.com/espressif/esp-idf/issues/6063

I don´t know how to fix it.

That´s the monitor output:

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

rst:0xc (SW_CPU_RESET),boot:0x17 (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:2 load:0x3fff0030,len:4 load:0x3fff0034,len:7036 load:0x40078000,len:13772 ho 0 tail 12 room 4 load:0x40080400,len:4632 0x40080400: _init at ??:?

entry 0x400806f4 I (30) boot: ESP-IDF v4.2-dirty 2nd stage bootloader I (31) boot: compile time 09:36:25 I (31) boot: chip revision: 1 I (34) boot_comm: chip revision: 1, min. bootloader chip revision: 0 I (41) boot.esp32: SPI Speed : 40MHz I (46) boot.esp32: SPI Mode : DIO I (50) boot.esp32: SPI Flash Size : 4MB I (55) boot: Enabling RNG early entropy source... I (60) boot: Partition Table: I (64) boot: ## Label Usage Type ST Offset Length I (71) boot: 0 nvs WiFi data 01 02 00009000 00004000 I (79) boot: 1 otadata OTA data 01 00 0000d000 00002000 I (86) boot: 2 phy_init RF data 01 01 0000f000 00001000 I (94) boot: 3 factory factory app 00 00 00010000 00100000 I (101) boot: 4 ota_0 OTA app 00 10 00110000 00100000 I (109) boot: 5 ota_1 OTA app 00 11 00210000 00100000 I (116) boot: End of partition table I (120) boot: Defaulting to factory image I (125) boot_comm: chip revision: 1, min. application chip revision: 0 I (132) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x26618 (157208) map I (207) esp_image: segment 1: paddr=0x00036640 vaddr=0x3ffb0000 size=0x03928 ( 14632) load I (214) esp_image: segment 2: paddr=0x00039f70 vaddr=0x40080000 size=0x00404 ( 1028) load 0x40080000: _WindowOverflow4 at C:/Users/josei/esp/components/freertos/xtensa/xtensa_vectors.S:1730

I (215) esp_image: segment 3: paddr=0x0003a37c vaddr=0x40080404 size=0x05c9c ( 23708) load I (234) esp_image: segment 4: paddr=0x00040020 vaddr=0x400d0020 size=0xa85bc (689596) map 0x400d0020: _stext at ??:?

I (522) esp_image: segment 5: paddr=0x000e85e4 vaddr=0x400860a0 size=0x154f8 ( 87288) load 0x400860a0: esp_flash_erase_region at C:/Users/josei/esp/components/spi_flash/esp_flash_api.c:331

I (579) boot: Loaded app from partition at offset 0x10000 I (579) boot: Disabling RNG early entropy source... I (580) psram: This chip is ESP32-D0WD E (585) psram: PSRAM ID read error: 0xffffffff E (589) cpu_start: Failed to init external RAM! Re-enable cpu cache.

abort() was called at PC 0x40081ec6 on core 0 0x40081ec6: call_start_cpu0 at C:/Users/josei/esp/components/esp32/cpu_start.c:191 (discriminator 1)

Backtrace:0x4008c912:0x3ffe3b90 0x4008cfd1:0x3ffe3bb0 0x40093e4e:0x3ffe3bd0 0x40081ec6:0x3ffe3c40 0x400790e2:0x3ffe3c80 |<-CORRUPTED 0x4008c912: panic_abort at C:/Users/josei/esp/components/esp_system/panic.c:330

0x4008cfd1: esp_system_abort at C:/Users/josei/esp/components/esp_system/system_api.c:106

0x40093e4e: abort at C:/Users/josei/esp/components/newlib/abort.c:46

0x40081ec6: call_start_cpu0 at C:/Users/josei/esp/components/esp32/cpu_start.c:191 (discriminator 1)

ELF file SHA256: e70d25980491c421`

Regards, Jose,

jorgenkraghjakobsen commented 3 years ago

Hi Jose No problem - I will see if I can get it running on a non PSRAM board later today. /j

jirmjos commented 3 years ago

Hi Again,

I get snapclient on ESP32 Wroom module running.

Easy enough fix it, because only needed disable external spi ram trough menuconfig: Component config ---> ESP32-specific ---> Support for external, SPI-connected RAM

My fault because fast reading error I messed up, PSRAM with SPI RAM. On default ESP32 Wroom modules you need disable PSRAM and SPI RAM support.

Now seems my module are up, and next step is tunning configuration to my cheap PCM1502 dac board and propper attach it to esp32 (I see some references to ma12070 and i2c bus (that it´s not propper for my dac board) and finally I think then I can last configure and test snapcast.

Monitor output from boot:

I (29) boot: ESP-IDF v4.2-dirty 2nd stage bootloader I (29) boot: compile time 18:46:05 I (29) boot: chip revision: 1 I (32) boot_comm: chip revision: 1, min. bootloader chip revision: 0 I (39) boot.esp32: SPI Speed : 40MHz I (44) boot.esp32: SPI Mode : DIO I (48) boot.esp32: SPI Flash Size : 4MB I (53) boot: Enabling RNG early entropy source... I (58) boot: Partition Table: I (62) boot: ## Label Usage Type ST Offset Length I (69) boot: 0 nvs WiFi data 01 02 00009000 00004000 I (76) boot: 1 otadata OTA data 01 00 0000d000 00002000 I (84) boot: 2 phy_init RF data 01 01 0000f000 00001000 I (91) boot: 3 factory factory app 00 00 00010000 00100000 I (99) boot: 4 ota_0 OTA app 00 10 00110000 00100000 I (106) boot: 5 ota_1 OTA app 00 11 00210000 00100000 I (114) boot: End of partition table I (118) boot: Defaulting to factory image I (123) boot_comm: chip revision: 1, min. application chip revision: 0 I (130) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x21d3c (138556) map I (192) esp_image: segment 1: paddr=0x00031d64 vaddr=0x3ffb0000 size=0x038b4 ( 14516) load I (198) esp_image: segment 2: paddr=0x00035620 vaddr=0x40080000 size=0x00404 ( 1028) load 0x40080000: _WindowOverflow4 at C:/Users/josei/esp/components/freertos/xtensa/xtensa_vectors.S:1730 I (199) esp_image: segment 3: paddr=0x00035a2c vaddr=0x40080404 size=0x0a5ec ( 42476) load I (226) esp_image: segment 4: paddr=0x00040020 vaddr=0x400d0020 size=0x9eb38 (650040) map 0x400d0020: _stext at ??:? I (474) esp_image: segment 5: paddr=0x000deb60 vaddr=0x4008a9f0 size=0x0c568 ( 50536) load 0x4008a9f0: vTaskSuspend at C:/Users/josei/esp/components/freertos/tasks.c:1838 I (509) boot: Loaded app from partition at offset 0x10000 I (509) boot: Disabling RNG early entropy source... I (509) cpu_start: Pro cpu up. I (513) cpu_start: Application information: I (518) cpu_start: Project name: snapclient I (523) cpu_start: App version: 6a52d87-dirty I (528) cpu_start: Compile time: Feb 28 2021 18:45:47 I (534) cpu_start: ELF file SHA256: 3cc6ce130b85b11e... I (540) cpu_start: ESP-IDF: v4.2-dirty I (546) cpu_start: Starting app cpu, entry point is 0x400819fc 0x400819fc: call_start_cpu1 at C:/Users/josei/esp/components/esp32/cpu_start.c:287 I (0) cpu_start: App cpu up. I (556) heap_init: Initializing. RAM available for dynamic allocation: I (563) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (569) heap_init: At 3FFB9C50 len 000263B0 (152 KiB): DRAM I (575) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (582) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (588) heap_init: At 40096F58 len 000090A8 (36 KiB): IRAM I (594) cpu_start: Pro cpu start user code I (612) spi_flash: detected chip: gd I (613) spi_flash: flash io: dio I (613) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (662) SNAPCAST: Start codec chip I (662) HAL: INIT setup output 21 22 I (662) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (672) gpio: GPIO[22]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 Setup input NCLIP:33 NERR:32 I (682) gpio: GPIO[32]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (692) gpio: GPIO[33]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 Driver param setup : 0 Driver installed : 0 060c 00 ESP_I2C_WRITE ERROR : -1 i2c Error read - readback Hardware version: 0xff Scan I2C bus: i2c Error read - readback 0x20 => GEN2 ,i2c Error read - readback 0x21 => GEN2 ,i2c Error read - readback 0x22 => GEN2 ,i2c Error read - readback 0x23 => GEN2 , i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback i2c Error read - readback 0x8000 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x8020 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x8040 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x8060 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x8080 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x80a0 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x80c0 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x80e0 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x8100 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x8120 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x8140 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x8160 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x8180 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x81a0 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x81c0 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 0x81e0 : 01 00 00 00 64 6d fb 3f 7d 93 05 80 50 b6 fb 3f 80 bc fb 3f 20 e9 fa 3f 98 ab fb 3f 1d 00 00 00 i2c Error read - readback Address 0 : 0x01 0003 50 ESP_I2C_WRITE ERROR : -1 0004 50 ESP_I2C_WRITE ERROR : -1 0005 02 ESP_I2C_WRITE ERROR : -1 I (932) MA120: ma120_setup done [ok] I (932) MA120 Driver: config_iface w. mode and interface I (942) HAL: codec_hal done I (942) AUDIO_BOARD: board-handle done I (942) SNAPCAST: Audio board_init done I (952) AUDIO_HAL: Codec mode is 3, Ctrl:1 I (952) MA120 Driver: ctrl w. mode and ctrl_state I (962) GENERIC_BOARD: I2S0, MCLK output by GPIO0 0.000309 0.000619 0.000309 -1.949630 0.950868 0.000309 0.000619 0.000309 -1.949630 0.950868 0.975124 -1.950249 0.975124 -1.949630 0.950868 0.975124 -1.950249 0.975124 -1.949630 0.950868 0.975124 -1.950249 0.975124 -1.949630 0.950868 0.975124 -1.950249 0.975124 -1.949630 0.950868 1.008780 -1.957178 0.950152 -1.957615 0.958495 1.008780 -1.957178 0.950152 -1.957615 0.958495 I (1022) wifi:wifi driver task: 3ffc23bc, prio:23, stack:6656, core=0 I (1022) system_api: Base MAC address is not set I (1022) system_api: read default base MAC address from EFUSE I (1042) wifi:wifi firmware version: 1865b55 I (1042) wifi:wifi certification version: v7.0 I (1042) wifi:config NVS flash: enabled I (1042) wifi:config nano formating: disabled I (1042) wifi:Init data frame dynamic rx buffer num: 32 I (1052) wifi:Init management frame dynamic rx buffer num: 32 I (1052) wifi:Init management short buffer num: 32 I (1062) wifi:Init static tx buffer num: 16 I (1062) wifi:Init static rx buffer size: 1600 I (1062) wifi:Init static rx buffer num: 10 I (1072) wifi:Init dynamic rx buffer num: 32 I (1072) wifi_init: tcpip mbox: 32 I (1082) wifi_init: udp mbox: 6 I (1082) wifi_init: tcp mbox: 6 I (1082) wifi_init: tcp tx win: 5744 I (1092) wifi_init: tcp rx win: 5744 I (1092) wifi_init: tcp mss: 1440 I (1102) wifi_init: WiFi IRAM OP enabled I (1102) wifi_init: WiFi RX IRAM OP enabled I (1192) phy: phy_version: 4500, 0cd6843, Sep 17 2020, 15:37:07, 0, 0 I (1192) wifi:mode : sta (30:ae:a4:15:d1:fc) I (1192) WIFI: wifi_init_sta finished. I (1312) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1 I (1312) wifi:state: init -> auth (b0) I (1322) wifi:state: auth -> assoc (0) I (1332) wifi:state: assoc -> run (10) I (1342) wifi:connected with N600_24, aid = 7, channel 1, BW20, bssid = 00:90:a9:a6:61:1b I (1342) wifi:security: WPA2-PSK, phy: bgn, rssi: -50 I (1342) wifi:pm start, type: 1 I (1372) wifi:AP's beacon interval = 102400 us, DTIM period = 2 I (2002) esp_netif_handlers: sta ip: 10.10.1.62, mask: 255.255.255.0, gw: 10.10.1.1 I (2002) WIFI: got ip:10.10.1.62 I (2002) WIFI: connected to ap SSID:N600_24 I (2012) SNAPCAST: Connected to AP I (2012) SNAPCAST: Setup ws server I (2012) server_task: server listening I (2022) NETF: Setup mdns I (2022) server_handle_task: task starting I (2032) OTA: idf.py build ; curl snapclient.local:8032 --data-binary @- < build/snapclient.bin I (2042) I2S: Call dsp setup I (2042) I2S: queue free spaces: 7 I (2042) I2S: DMA Malloc info, datalen=blocksize=3840, dma_buf_count=8 I (2072) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 32, CLKM: 1, BCK_M: 8, MCLK: 22579194.000, SCLK: 2822399.250000, diva: 1, divb: 0 I (2072) I2S: I2S interface master setup I (2072) I2S: Setup i2s dma and interface Setup ringbuffer using internal ram - only space for 150ms - Snapcast buffer_ms parameter ignored Ringbuffer ok I (2092) SNAPCAST: ... allocated socket I (2492) I2S: Wait: no data in buffer 1 0 I (2892) I2S: Wait: no data in buffer 2 0 I (3292) I2S: Wait: no data in buffer 3 0 I (3692) I2S: Wait: no data in buffer 4 0 I (4092) I2S: Wait: no data in buffer 5 0 I (4492) I2S: Wait: no data in buffer 6 0 I (4892) I2S: Wait: no data in buffer 7 0 I (5292) I2S: Wait: no data in buffer 8 0

First main step seems done.

Regards

jorgenkraghjakobsen commented 3 years ago

Hi Jose - Nice yes you need to setup you own custom board - or get one of the MA12070p based setup. /J

jorgenkraghjakobsen commented 3 years ago

The repo is very much work in progress. The MA120 that I am using is not released yet. /J

jirmjos commented 3 years ago

Hi Jorgen,

I´m in process to buy this MA12070P board https://www.audiophonics.fr/en/amplifier-boards/balanced-class-d-10-20-21-40-amplifier-module-ma12070-160w-4-ohm-p-14732.html. I hope they build enough well the board and mantain the good MA12070p spechs chip and his performance. In few days I hoppe have this Merus/Infineon board in my hands and too some purchased ESP32 Wroover boards to start real test with target final hardware.

Meanwhile I try to steep forward to test and understand your snapcast client to tunning but with the hardware I have now .

Regards