KaRadio32_4 icon indicating copy to clipboard operation
KaRadio32_4 copied to clipboard

Built in DAC and S/PDIF do not work.

Open Ant-12 opened this issue 3 years ago • 13 comments

KaRadio32.bin, 2022-02-17 19:11 (CET)

I (2956) main: audio_output_mode 2 One of I2S=0, I2S_MERUS, DAC_BUILT_IN, PDM, VS1053, SPDIF I (2956) main: Set baudrate at 115200 I (2956) main: Release 2.2, Revision 1 I (2966) main: SDK v4.4

Please make printing of date/time of build on UART.

P.S. Why don't you use ESP-IDF v5.0? There need to modify only 2 files(see Ka-mod) to build KaRadio32:

I (3003) main: audio_output_mode 5 One of I2S=0, I2S_MERUS, DAC_BUILT_IN, PDM, VS1053, SPDIF I (3003) main: Set baudrate at 115200 I (3003) main: Release 2.2, Revision 1 I (3013) main: SDK v5.0-dev-489-gef98a363e-dirty I (3013) main: Heap size: 4398523

Ant-12 avatar Feb 17 '22 19:02 Ant-12

Unable to make DAC working under 4.4 Spdif? I can see it with a scope (cannot test more)

karawin avatar Feb 20 '22 20:02 karawin

Binary from Ka-mod repository has no problem with built in DAC:

mode:DIO, clock div:1 load:0x3fff0030,len:4872 load:0x40078000,len:14020 load:0x40080400,len:3708 entry 0x40080618 I (495) psram: This chip is ESP32-D0WD I (496) spiram: Found 64MBit SPI RAM device I (496) spiram: SPI RAM mode: flash 40m sram 40m I (499) spiram: PSRAM initialized, cache is in low/high (2-core) mode. I (506) cpu_start: Pro cpu up. I (510) cpu_start: Starting app cpu, entry point is 0x400817d0 I (0) cpu_start: App cpu up. I (1398) spiram: SPI SRAM memory test OK I (1405) cpu_start: Pro cpu start user code I (1405) cpu_start: cpu freq: 240000000 I (1405) cpu_start: Application information: I (1408) cpu_start: Project name: Ka-Radio32 I (1414) cpu_start: App version: {1.9.7} I (1419) cpu_start: Compile time: Dec 29 2020 21:52:56 I (1425) cpu_start: ELF file SHA256: 2e90eda64c5219af... I (1431) cpu_start: ESP-IDF: v4.3-dev-2136-gb0150615d-dirty I (1438) heap_init: Initializing. RAM available for dynamic allocation: I (1445) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (1452) heap_init: At 3FFBD0C8 len 00022F38 (139 KiB): DRAM I (1458) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (1464) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (1471) heap_init: At 40099688 len 00006978 (26 KiB): IRAM I (1477) spiram: Adding pool of 4096K of external SPI memory to heap allocator I (1486) spi_flash: detected chip: generic I (1490) spi_flash: flash io: dio I (1495) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (1504) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations W (1514) main: starting app_main() I (1514) main: RAM left: 4417335 I (1534) main: Running partition type 0 subtype 16 (offset 0x00010000) I (1564) main: Partition init done... Log level is now ESP_LOG_INFO I (1914) main: LCD Type 255 I (1914) main: audio_output_mode 2 One of I2S=0, I2S_MERUS, DAC_BUILT_IN, PDM, VS1053, A1S I (1914) main: Set Song buffer to 1024k I (1914) main: Set baudrate at 115200 I (1924) main: Release 1.9, Revision 7 I (1924) main: SDK v4.3-dev-2136-gb0150615d-dirty I (1934) main: Heap size: 3367043 I (1934) main: Volume set to 254

Ant-12 avatar Feb 20 '22 21:02 Ant-12

Yes but I (1924) main: SDK v4.3-dev-2136-gb0150615d-dirty

not

I (2094) main: Release 2.2, Revision 2 I (2104) main: Date Feb 20 2022, Time: 22:19:32 I (2104) main: SDK v4.4

In 4.4 it seems that it doesn't work.

karawin avatar Feb 20 '22 21:02 karawin

Yes but I (1924) main: SDK v4.3-dev-2136-gb0150615d-dirty

not

I (2094) main: Release 2.2, Revision 2 I (2104) main: Date Feb 20 2022, Time: 22:19:32 I (2104) main: SDK v4.4

In 4.4 it seems that it doesn't work

karawin avatar Feb 20 '22 21:02 karawin

It only show that built in DAC can work with SDK v4.3 @ Ka_mod However, it does not work with IDF V5. (I checked)

Ant-12 avatar Feb 20 '22 22:02 Ant-12

https://github.com/tasmota/esp-idf/pull/43/commits/76e8605c2e783a634dd9cd41a694c5a9602022b9

Patch for 4.4 for DAC but still don't work.

karawin avatar Feb 20 '22 22:02 karawin

https://github.com/espressif/esp-idf/issues/8344

karawin avatar Feb 21 '22 08:02 karawin

Working on DAC now The fix is https://github.com/espressif/esp-idf/pull/8327/files (file in binaries directory for curious people) It is better to do a hardware reset when changing output. The software reset is not enough. logo

karawin avatar Feb 21 '22 16:02 karawin

I (2925) main: Date Feb 21 2022, Time: 23:52:32 I (2925) main: SDK v4.4-dirty

Built in DAC now works, but S/PDIF doesn't work absolutely

Is it possible to select from WebUI the firmware file or link for update?

Ant-12 avatar Feb 22 '22 19:02 Ant-12

I wonder if .... https://github.com/espressif/esp-idf/pull/8460/commits/816b0ce87800ab90f78ff139b67f98798b86f24d

karawin avatar Feb 25 '22 20:02 karawin

Changed the s/pdif decoder to this one https://github.com/amedes/esp_a2dp_sink_spdif/blob/master/main/spdif.c Try the new one (just update from the web page of the _4 version.)

karawin avatar Feb 27 '22 17:02 karawin

At least now I hear the sound. But it's distorted on mp3 streams and has gaps on AAC-LC streams. Previously I used binary from github but it always shows the date Feb 23 2022. Maybe it's better to use the date of linking or build number? (if it possible)

Ant-12 avatar Feb 27 '22 19:02 Ant-12

I just bought a little box in order to test directly. Otherwise it is not feasible. Thanks for your help. I will send the next message with a working bin ( and for the good date ;-)

https://www.amazon.fr/dp/B09CPXDR2R/ref=pe_27091421_487052621_TE_item

karawin avatar Feb 27 '22 20:02 karawin