Closed nathan-swidget closed 1 month ago
Please provide information about your board as well as ESP-IDF and ESP-ADF to help solve the problem.
The board is a custom board using the ESP-S3-PICO-1
ESP-IDF: release/v5.3 (707d097b01756687cca18be855a2675d150247ae)
ESP-ADF: v2.7 (9cf556de500019bb79f3bb84c821fda37668c052)
Here is a sample repo that can be used to recreate the issue: https://github.com/nathan-swidget/esp_audio_test
Some additional information: The AAC sample file (from https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/audio-samples.html) plays as well. So, MP3 and AAC works, but M4A crashes.
Log from running sample (same result as noted in opening comment)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2810,len:0x10dc
load:0x403c8700,len:0x4
load:0x403c8704,len:0xc98
load:0x403cb700,len:0x2d10
entry 0x403c8904
I (31) boot: ESP-IDF v5.3-383-g0bbd728196-dirty 2nd stage bootloader
I (31) boot: compile time Sep 24 2024 10:42:07
I (31) boot: Multicore bootloader
I (33) boot: chip revision: v0.2
I (36) boot.esp32s3: Boot SPI Speed : 80MHz
I (40) boot.esp32s3: SPI Mode : DIO
I (44) boot.esp32s3: SPI Flash Size : 8MB
I (47) boot: Enabling RNG early entropy source...
I (52) boot: Partition Table:
I (54) boot: ## Label Usage Type ST Offset Length
I (61) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (67) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (74) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (80) boot: 3 ota_0 OTA app 00 10 00010000 00300000
I (87) boot: 4 ota_1 OTA app 00 11 00310000 00300000
I (93) boot: 5 factory_nvs WiFi data 01 02 00610000 00004000
I (100) boot: 6 nvs_keys NVS keys 01 04 00614000 00001000
I (106) boot: 7 storage Unknown data 01 82 00615000 001eb000
I (113) boot: End of partition table
I (116) esp_image: segment 0: paddr=00010020 vaddr=3c040020 size=587b0h (362416) map
I (189) esp_image: segment 1: paddr=000687d8 vaddr=3fc94f00 size=02c4ch ( 11340) load
I (192) esp_image: segment 2: paddr=0006b42c vaddr=40374000 size=04bech ( 19436) load
I (197) esp_image: segment 3: paddr=00070020 vaddr=42000020 size=3d6c4h (251588) map
I (245) esp_image: segment 4: paddr=000ad6ec vaddr=40378bec size=0c2bch ( 49852) load
I (263) boot: Loaded app from partition at offset 0x10000
I (264) boot: Disabling RNG early entropy source...
I (274) esp_psram: Found 2MB PSRAM device
I (274) esp_psram: Speed: 40MHz
I (274) cpu_start: Multicore app
I (694) esp_psram: SPI SRAM memory test OK
I (703) cpu_start: Pro cpu start user code
I (703) cpu_start: cpu freq: 160000000 Hz
I (703) app_init: Application information:
I (706) app_init: Project name: audio_tst
I (711) app_init: App version: 3d7e0f7-dirty
I (716) app_init: Compile time: Oct 17 2024 12:12:27
I (722) app_init: ELF file SHA256: 84d227049...
I (727) app_init: ESP-IDF: v5.3-783-g707d097b01-dirty
I (734) efuse_init: Min chip rev: v0.0
I (739) efuse_init: Max chip rev: v0.99
I (743) efuse_init: Chip rev: v0.2
I (748) heap_init: Initializing. RAM available for dynamic allocation:
I (756) heap_init: At 3FC985F8 len 00051118 (324 KiB): RAM
I (762) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (768) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (774) heap_init: At 600FE100 len 00001EE8 (7 KiB): RTCRAM
I (780) esp_psram: Adding pool of 2048K of PSRAM memory to heap allocator
I (789) spi_flash: detected chip: gd
I (792) spi_flash: flash io: dio
I (796) sleep: Configure to isolate all GPIO pins in sleep state
I (803) sleep: Enable automatic switching of GPIO sleep configuration
I (810) main_task: Started on CPU0
I (831) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (832) main_task: Calling app_main()
I (833) new_codec: new_codec init
I (837) AUDIO_HAL: Codec mode is 2, Ctrl:1
I (844) AUDIO_PIPELINE: link el->rb, el:0x3c0a0fc0, tag:dec, rb:0x3c0a111c
I (850) AUDIO_THREAD: The dec task allocate stack on external memory
I (857) AUDIO_ELEMENT: [dec-0x3c0a0fc0] Element task created
I (863) AUDIO_THREAD: The i2s task allocate stack on internal memory
I (870) AUDIO_ELEMENT: [i2s-0x3c0a0c40] Element task created
I (876) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:2418272 Bytes, Inter:368447 Bytes, Dram:368447 Bytes, Dram largest free:270336Bytes
I (891) AUDIO_ELEMENT: [dec] AEL_MSG_CMD_RESUME,state:1
I (897) CODEC_ELEMENT_HELPER: The element is 0x3c0a0fc0. The reserve data 2 is 0x0.
I (905) AAC_DECODER: A new song playing
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4200c2d2 PS : 0x00060f30 A0 : 0x8201089c A1 : 0x3c0a2950
0x4200c2d2: audio_element_abort_output_ringbuf at /home/spades/projects/esp32/esp-adf/components/audio_pipeline/audio_element.c:760
A2 : 0x00000000 A3 : 0x3c0a2970 A4 : 0x00000003 A5 : 0x00000001
A6 : 0x00000000 A7 : 0x3c0a446c A8 : 0x00000001 A9 : 0x00000000
A10 : 0x00000001 A11 : 0x00000000 A12 : 0x3c0a3bec A13 : 0x00000001
A14 : 0x00000000 A15 : 0x3fc98d8c SAR : 0x00000001 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000020 LBEG : 0x400570e8 LEND : 0x400570f3 LCOUNT : 0x00000000
0x400570e8: memset in ROM
0x400570f3: memset in ROM
Backtrace: 0x4200c2cf:0x3c0a2950 0x42010899:0x3c0a2970 0x420109eb:0x3c0a29a0 0x4201133f:0x3c0a2a50 0x4200e808:0x3c0a2a90 0x4200ea75:0x3c0a2b30 0x4200bde3:0x3c0a2b50 0x4200c354:0x3c0a2b80 0x4200c462:0x3c0a2ba0 0x4200d349:0x3c0a2bd0 0x4200c67b:0x3c0a2c10 0x4037c72d:0x3c0a2c40
0x4200c2cf: audio_element_abort_output_ringbuf at /home/spades/projects/esp32/esp-adf/components/audio_pipeline/audio_element.c:759
0x42010899: mp4_parser_seek at /builds/adf/esp-adf-libs-source/esp_processing/esp-share/mp4_parser.c:762
0x420109eb: mp4_parser_info_init at /builds/adf/esp-adf-libs-source/esp_processing/esp-share/mp4_parser.c:817
0x4201133f: mp4_parser_parse_header at /builds/adf/esp-adf-libs-source/esp_processing/esp-share/mp4_parser.c:1307
0x4200e808: aac_decoder_open at /builds/adf/esp-adf-libs-source/esp_processing/esp-wrapper/aac_decoder.c:324
0x4200ea75: _aac_decoder_open at /builds/adf/esp-adf-libs-source/esp_processing/esp-wrapper/aac_decoder.c:798
0x4200bde3: audio_element_process_init at /home/spades/projects/esp32/esp-adf/components/audio_pipeline/audio_element.c:175
0x4200c354: audio_element_on_cmd_resume at /home/spades/projects/esp32/esp-adf/components/audio_pipeline/audio_element.c:283
0x4200c462: audio_element_on_cmd at /home/spades/projects/esp32/esp-adf/components/audio
ELF file SHA256: 84d227049
_pipeline/audio_element.c:324
0x4200d349: audio_event_iface_waiting_cmd_msg at /home/spades/projects/esp32/esp-adf/components/audio_pipeline/audio_event_iface.c:246
0x4200c67b: audio_element_task at /home/spades/projects/esp32/esp-adf/components/audio_pipeline/audio_element.c:477
0x4037c72d: vPortTaskWrapper at /home/spades/projects/esp32/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40375b08
0x40375b08: esp_restart_noos at /home/spades/projects/esp32/esp-idf/components/esp_system/port/soc/esp32s3/system_internal.c:158
For this M4A have MDAT before MOOV to support it input element should support seek
I have modified your code to let it work, you can try to use it instead. Please rename it firstly.
Hey,
I seem to be unable to playback M4A audio files. I have tried samples provided by espressif, aswell as samples created with Audacity.
The above code works to play MP3 files, but not M4A (selected by changed the define)
I'm at a loss as to what the problem is.