Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting cryptic message when trying to play m4a/aac file using espressif/esp_audio_codec (AUD-5959) #1338

Closed
gamename opened this issue Dec 28, 2024 · 5 comments

Comments

@gamename
Copy link

Environment

  • Audio development kit: None

  • Audio kit version: N/A

  • [Required] ESP32-S3-DevKitC-1-N16

  • [Required] v5.3.1

  • [Required] v2.7-47-g93a56fcd (but that is misleading - see below)

  • Build system: idf.py

  • [Required] Running log:
    squawk_log.txt

  • Compiler version

xtensa-esp-elf-gcc (crosstool-NG esp-13.2.0_20240530) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.```

- Operating system:     MacOS
- (Windows only) N/A
- Using an IDE?: vscode
- Power supply: USB


## Problem Description
I am trying to play an m4a/aac file that is embedded in my app. I added the [esp_audio_codec](https://components.espressif.com/components/espressif/esp_audio_codec/versions/2.0.3) to my project to help with this.

Attached to my esp32-s3-DevKitC microcontroller is a MAX98357A amp which, in turn, is connected to a small speaker.


### Expected Behavior
The m4a file should play on my speakers

### Actual Behavior
I hear nothing and get a cryptic message in my log saying:
```E (445) M4A_PARSE: Skip this audio track 0 select 137```

### Steps to Reproduce
1. Wire the system as per the pictures (below).
1. run `idf.py build flash monitor`

// If possible, attach a picture of your setup/wiring here.
See the github repo below, it has a picture

### Code to Reproduce This Issue
https://github.com/gamename/test-squawk

## Debug Logs

Did not crash.

## Other Items If Possible
[sdkconfig.txt](https://github.com/user-attachments/files/18264516/sdkconfig.txt)
[test-squawk.elf.txt](https://github.com/user-attachments/files/18264519/test-squawk.elf.txt)


@github-actions github-actions bot changed the title Getting cryptic message when trying to play m4a/aac file using espressif/esp_audio_codec Getting cryptic message when trying to play m4a/aac file using espressif/esp_audio_codec (AUD-5959) Dec 28, 2024
@TempoTian
Copy link
Contributor

I have check this issue, there is a typo error in the test code, I see same error in you code, https://github.com/gamename/test-squawk/blob/main/main/test-squawk.c#L152

//simp_dec_all_t *all_cfg = (simp_dec_all_t *)&cfg->dec_cfg;
/simp_dec_all_t *all_cfg = (simp_dec_all_t *)cfg->dec_cfg;

Also I check the provided m4a is not supported currently for its both stco and stsz contain no table item. I have converted it for you, you can use it to do verify please rename it to m4a. Meanwhile I see you have not enable SPIRam support, so there may be not enough space to hold the MP4 tables, you can use menuconfig to enable it

Component Config --> ESP PSRAM 
squawk.mp4

@gamename
Copy link
Author

gamename commented Dec 30, 2024

@TempoTian

I have converted it for you

Thank you! That was very kind. How did you convert it? I would like an example of the process so I can use it in the future.

@gamename
Copy link
Author

gamename commented Dec 30, 2024

@TempoTian

  1. I couldn't download the mp4 file you created, so I did a conversion using vlc to m4v.
  2. I don't have PSRAM, so I cannot enable that. But, I am using an esp32-s3-DevKitC-1-N16 (i.e. there is 16MB of ram).
  3. I made the source code update per your instructions. The repo at https://github.com/gamename/test-squawk has all the updates (including the new m4v file).

Everything compiled and ran, but no sound. :(

Here is the log:

Executing action: all (aliases: build)
Running ninja in directory /Users/tennis/src/test-squawk/build
Executing "ninja all"...
[0/1] Re-running CMake...
-- Building ESP-IDF components for target esp32s3
NOTICE: Processing 2 dependencies:
NOTICE: [1/2] espressif/esp_audio_codec (2.0.3)
NOTICE: [2/2] idf (5.3.2)
-- Project sdkconfig file /Users/tennis/src/test-squawk/sdkconfig
-- Compiler supported targets: xtensa-esp-elf
CMake Deprecation Warning at /Users/tennis/esp/esp-idf-v5.3.2/components/mbedtls/mbedtls/CMakeLists.txt:21 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- App "test-squawk" version: 1ed0edf-dirty
-- Adding linker script /Users/tennis/src/test-squawk/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /Users/tennis/src/test-squawk/build/esp-idf/esp_system/ld/sections.ld.in
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.bt_funcs.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.wdt.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.version.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/soc/esp32s3/ld/esp32s3.peripherals.ld
-- Component idf::main will be linked with -Wl,--whole-archive
-- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_bootloader_format esp_coex esp_common esp_driver_ana_cmpr esp_driver_cam esp_driver_dac esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_i2s esp_driver_isp esp_driver_jpeg esp_driver_ledc esp_driver_mcpwm esp_driver_parlio esp_driver_pcnt esp_driver_ppa esp_driver_rmt esp_driver_sdio esp_driver_sdm esp_driver_sdmmc esp_driver_sdspi esp_driver_spi esp_driver_touch_sens esp_driver_tsens esp_driver_uart esp_driver_usb_serial_jtag esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_vfs_console esp_wifi espcoredump espressif__esp_audio_codec esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash nvs_sec_provider openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport touch_element ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /Users/tennis/esp/esp-idf-v5.3.2/components/app_trace /Users/tennis/esp/esp-idf-v5.3.2/components/app_update /Users/tennis/esp/esp-idf-v5.3.2/components/bootloader /Users/tennis/esp/esp-idf-v5.3.2/components/bootloader_support /Users/tennis/esp/esp-idf-v5.3.2/components/bt /Users/tennis/esp/esp-idf-v5.3.2/components/cmock /Users/tennis/esp/esp-idf-v5.3.2/components/console /Users/tennis/esp/esp-idf-v5.3.2/components/cxx /Users/tennis/esp/esp-idf-v5.3.2/components/driver /Users/tennis/esp/esp-idf-v5.3.2/components/efuse /Users/tennis/esp/esp-idf-v5.3.2/components/esp-tls /Users/tennis/esp/esp-idf-v5.3.2/components/esp_adc /Users/tennis/esp/esp-idf-v5.3.2/components/esp_app_format /Users/tennis/esp/esp-idf-v5.3.2/components/esp_bootloader_format /Users/tennis/esp/esp-idf-v5.3.2/components/esp_coex /Users/tennis/esp/esp-idf-v5.3.2/components/esp_common /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_ana_cmpr /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_cam /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_dac /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_gpio /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_gptimer /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_i2c /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_i2s /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_isp /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_jpeg /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_ledc /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_mcpwm /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_parlio /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_pcnt /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_ppa /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_rmt /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_sdio /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_sdm /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_sdmmc /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_sdspi /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_spi /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_touch_sens /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_tsens /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_uart /Users/tennis/esp/esp-idf-v5.3.2/components/esp_driver_usb_serial_jtag /Users/tennis/esp/esp-idf-v5.3.2/components/esp_eth /Users/tennis/esp/esp-idf-v5.3.2/components/esp_event /Users/tennis/esp/esp-idf-v5.3.2/components/esp_gdbstub /Users/tennis/esp/esp-idf-v5.3.2/components/esp_hid /Users/tennis/esp/esp-idf-v5.3.2/components/esp_http_client /Users/tennis/esp/esp-idf-v5.3.2/components/esp_http_server /Users/tennis/esp/esp-idf-v5.3.2/components/esp_https_ota /Users/tennis/esp/esp-idf-v5.3.2/components/esp_https_server /Users/tennis/esp/esp-idf-v5.3.2/components/esp_hw_support /Users/tennis/esp/esp-idf-v5.3.2/components/esp_lcd /Users/tennis/esp/esp-idf-v5.3.2/components/esp_local_ctrl /Users/tennis/esp/esp-idf-v5.3.2/components/esp_mm /Users/tennis/esp/esp-idf-v5.3.2/components/esp_netif /Users/tennis/esp/esp-idf-v5.3.2/components/esp_netif_stack /Users/tennis/esp/esp-idf-v5.3.2/components/esp_partition /Users/tennis/esp/esp-idf-v5.3.2/components/esp_phy /Users/tennis/esp/esp-idf-v5.3.2/components/esp_pm /Users/tennis/esp/esp-idf-v5.3.2/components/esp_psram /Users/tennis/esp/esp-idf-v5.3.2/components/esp_ringbuf /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom /Users/tennis/esp/esp-idf-v5.3.2/components/esp_system /Users/tennis/esp/esp-idf-v5.3.2/components/esp_timer /Users/tennis/esp/esp-idf-v5.3.2/components/esp_vfs_console /Users/tennis/esp/esp-idf-v5.3.2/components/esp_wifi /Users/tennis/esp/esp-idf-v5.3.2/components/espcoredump /Users/tennis/src/test-squawk/managed_components/espressif__esp_audio_codec /Users/tennis/esp/esp-idf-v5.3.2/components/esptool_py /Users/tennis/esp/esp-idf-v5.3.2/components/fatfs /Users/tennis/esp/esp-idf-v5.3.2/components/freertos /Users/tennis/esp/esp-idf-v5.3.2/components/hal /Users/tennis/esp/esp-idf-v5.3.2/components/heap /Users/tennis/esp/esp-idf-v5.3.2/components/http_parser /Users/tennis/esp/esp-idf-v5.3.2/components/idf_test /Users/tennis/esp/esp-idf-v5.3.2/components/ieee802154 /Users/tennis/esp/esp-idf-v5.3.2/components/json /Users/tennis/esp/esp-idf-v5.3.2/components/log /Users/tennis/esp/esp-idf-v5.3.2/components/lwip /Users/tennis/src/test-squawk/main /Users/tennis/esp/esp-idf-v5.3.2/components/mbedtls /Users/tennis/esp/esp-idf-v5.3.2/components/mqtt /Users/tennis/esp/esp-idf-v5.3.2/components/newlib /Users/tennis/esp/esp-idf-v5.3.2/components/nvs_flash /Users/tennis/esp/esp-idf-v5.3.2/components/nvs_sec_provider /Users/tennis/esp/esp-idf-v5.3.2/components/openthread /Users/tennis/esp/esp-idf-v5.3.2/components/partition_table /Users/tennis/esp/esp-idf-v5.3.2/components/perfmon /Users/tennis/esp/esp-idf-v5.3.2/components/protobuf-c /Users/tennis/esp/esp-idf-v5.3.2/components/protocomm /Users/tennis/esp/esp-idf-v5.3.2/components/pthread /Users/tennis/esp/esp-idf-v5.3.2/components/sdmmc /Users/tennis/esp/esp-idf-v5.3.2/components/soc /Users/tennis/esp/esp-idf-v5.3.2/components/spi_flash /Users/tennis/esp/esp-idf-v5.3.2/components/spiffs /Users/tennis/esp/esp-idf-v5.3.2/components/tcp_transport /Users/tennis/esp/esp-idf-v5.3.2/components/touch_element /Users/tennis/esp/esp-idf-v5.3.2/components/ulp /Users/tennis/esp/esp-idf-v5.3.2/components/unity /Users/tennis/esp/esp-idf-v5.3.2/components/usb /Users/tennis/esp/esp-idf-v5.3.2/components/vfs /Users/tennis/esp/esp-idf-v5.3.2/components/wear_levelling /Users/tennis/esp/esp-idf-v5.3.2/components/wifi_provisioning /Users/tennis/esp/esp-idf-v5.3.2/components/wpa_supplicant /Users/tennis/esp/esp-idf-v5.3.2/components/xtensa
-- Configuring done (3.7s)
-- Generating done (0.4s)
-- Build files have been written to: /Users/tennis/src/test-squawk/build
[0/1] Re-running CMake...
-- Building ESP-IDF components for target esp32s3
-- Project sdkconfig file /Users/tennis/src/test-squawk/sdkconfig
-- Compiler supported targets: xtensa-esp-elf
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/soc/esp32s3/ld/esp32s3.peripherals.ld
-- Bootloader project name: "bootloader" version: 1
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.bt_funcs.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.wdt.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.version.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld
-- Adding linker script /Users/tennis/esp/esp-idf-v5.3.2/components/bootloader/subproject/main/ld/esp32s3/bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp_app_format esp_bootloader_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa
-- Component paths: /Users/tennis/esp/esp-idf-v5.3.2/components/bootloader /Users/tennis/esp/esp-idf-v5.3.2/components/bootloader_support /Users/tennis/esp/esp-idf-v5.3.2/components/efuse /Users/tennis/esp/esp-idf-v5.3.2/components/esp_app_format /Users/tennis/esp/esp-idf-v5.3.2/components/esp_bootloader_format /Users/tennis/esp/esp-idf-v5.3.2/components/esp_common /Users/tennis/esp/esp-idf-v5.3.2/components/esp_hw_support /Users/tennis/esp/esp-idf-v5.3.2/components/esp_rom /Users/tennis/esp/esp-idf-v5.3.2/components/esp_system /Users/tennis/esp/esp-idf-v5.3.2/components/esptool_py /Users/tennis/esp/esp-idf-v5.3.2/components/freertos /Users/tennis/esp/esp-idf-v5.3.2/components/hal /Users/tennis/esp/esp-idf-v5.3.2/components/log /Users/tennis/esp/esp-idf-v5.3.2/components/bootloader/subproject/main /Users/tennis/esp/esp-idf-v5.3.2/components/bootloader/subproject/components/micro-ecc /Users/tennis/esp/esp-idf-v5.3.2/components/newlib /Users/tennis/esp/esp-idf-v5.3.2/components/partition_table /Users/tennis/esp/esp-idf-v5.3.2/components/soc /Users/tennis/esp/esp-idf-v5.3.2/components/spi_flash /Users/tennis/esp/esp-idf-v5.3.2/components/xtensa
-- Configuring done (4.2s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/tennis/src/test-squawk/build/bootloader
[1/2] cd /Users/tennis/src/test-squawk/build/bootloader/esp-idf/esptool_py && /Users/tennis/.espressi...sizes.py --offset 0x8000 bootloader 0x0 /Users/tennis/src/test-squawk/build/bootloader/bootloader.bin
Bootloader binary size 0x5490 bytes. 0x2b70 bytes (34%) free.
[999/1012] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/test-squawk.c.obj
/Users/tennis/src/test-squawk/main/test-squawk.c:146:36: warning: 'get_simple_decoder_type' defined but not used [-Wunused-function]
  146 | static esp_audio_simple_dec_type_t get_simple_decoder_type(const uint8_t *data, size_t size) {
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~
/Users/tennis/src/test-squawk/main/test-squawk.c:56:13: warning: 'play_audio' defined but not used [-Wunused-variable]
   56 | static bool play_audio = false;
      |             ^~~~~~~~~~
[1010/1012] Generating binary image from built executable
esptool.py v4.8.1
Creating esp32s3 image...
Merged 2 ELF sections
Successfully created esp32s3 image.
Generated /Users/tennis/src/test-squawk/build/test-squawk.bin
[1011/1012] cd /Users/tennis/src/test-squawk/build/esp-idf/esptool_py && /Users/tennis/.espressif/pyt...-squawk/build/partition_table/partition-table.bin /Users/tennis/src/test-squawk/build/test-squawk.bin
test-squawk.bin binary size 0xaf180 bytes. Smallest app partition is 0x100000 bytes. 0x50e80 bytes (32%) free.
Executing action: flash
Serial port /dev/cu.usbmodem21101
Connecting....
Detecting chip type... ESP32-S3
Running ninja in directory /Users/tennis/src/test-squawk/build
Executing "ninja flash"...
[1/5] cd /Users/tennis/src/test-squawk/build/esp-idf/esptool_py && /Users/tennis/.espressif/python_en...-squawk/build/partition_table/partition-table.bin /Users/tennis/src/test-squawk/build/test-squawk.bin
test-squawk.bin binary size 0xaf180 bytes. Smallest app partition is 0x100000 bytes. 0x50e80 bytes (32%) free.
[1/1] cd /Users/tennis/src/test-squawk/build/bootloader/esp-idf/esptool_py && /Users/tennis/.espressi...sizes.py --offset 0x8000 bootloader 0x0 /Users/tennis/src/test-squawk/build/bootloader/bootloader.bin
Bootloader binary size 0x5490 bytes. 0x2b70 bytes (34%) free.
[4/5] cd /Users/tennis/esp/esp-idf-v5.3.2/components/esptool_py && /opt/homebrew/bin/cmake -D IDF_PAT...src/test-squawk/build -P /Users/tennis/esp/esp-idf-v5.3.2/components/esptool_py/run_serial_tool.cmake
esptool.py --chip esp32s3 -p /dev/cu.usbmodem21101 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size detect 0x0 bootloader/bootloader.bin 0x10000 test-squawk.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.8.1
Serial port /dev/cu.usbmodem21101
Connecting...
Chip is ESP32-S3 (QFN56) (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: f4:12:fa:5b:3f:0c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 16MB
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x000bffff...
Flash will be erased from 0x00008000 to 0x00008fff...
SHA digest in image updated
Compressed 21648 bytes to 13310...
Writing at 0x00000000... (100 %)
Wrote 21648 bytes (13310 compressed) at 0x00000000 in 0.4 seconds (effective 392.2 kbit/s)...
Hash of data verified.
Compressed 717184 bytes to 494734...
Writing at 0x000bd993... (100 %)
Wrote 717184 bytes (494734 compressed) at 0x00010000 in 8.6 seconds (effective 666.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 478.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
Executing action: monitor
Running idf_monitor in directory /Users/tennis/src/test-squawk
Executing "/Users/tennis/.espressif/python_env/idf5.3_py3.13_env/bin/python /Users/tennis/esp/esp-idf/tools/idf_monitor.py -p /dev/cu.usbmodem21101 -b 115200 --toolchain-prefix xtensa-esp32s3-elf- --target esp32s3 --revision 0 /Users/tennis/src/test-squawk/build/test-squawk.elf -m '/Users/tennis/.espressif/python_env/idf5.3_py3.13_env/bin/python' '/Users/tennis/esp/esp-idf/tools/idf.py'"...
--- esp-idf-monitor 1.5.0 on /dev/cu.usbmodem21101 115200
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x2b (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048c26
--- 0x40048c26: uart_tx_flush in ROM

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2810,len:0x1870
load:0x403c8700,len:0x4
load:0x403c8704,len:0xce8
load:0x403cb700,len:0x2ed8
entry 0x403c8918
I (26) boot: ESP-IDF v5.3.2-dirty 2nd stage bootloader
I (27) boot: compile time Dec 30 2024 11:06:19
I (27) boot: Multicore bootloader
I (30) boot: chip revision: v0.1
I (34) boot: efuse block revision: v1.2
I (39) boot.esp32s3: Boot SPI Speed : 80MHz
I (43) boot.esp32s3: SPI Mode       : DIO
I (48) boot.esp32s3: SPI Flash Size : 16MB
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 00006000
I (77) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (84) boot:  2 factory          factory app      00 00 00010000 00100000
I (92) boot: End of partition table
I (96) esp_image: segment 0: paddr=00010020 vaddr=3c060020 size=3e388h (254856) map
I (149) esp_image: segment 1: paddr=0004e3b0 vaddr=3fc93f00 size=01c68h (  7272) load
I (151) esp_image: segment 2: paddr=00050020 vaddr=42000020 size=5e06ch (385132) map
I (223) esp_image: segment 3: paddr=000ae094 vaddr=3fc95b68 size=012bch (  4796) load
I (224) esp_image: segment 4: paddr=000af358 vaddr=40374000 size=0fdfch ( 65020) load
I (249) boot: Loaded app from partition at offset 0x10000
I (249) boot: Disabling RNG early entropy source...
I (261) cpu_start: Multicore app
I (270) cpu_start: Pro cpu start user code
I (270) cpu_start: cpu freq: 160000000 Hz
I (271) app_init: Application information:
I (273) app_init: Project name:     test-squawk
I (279) app_init: App version:      1ed0edf-dirty
I (284) app_init: Compile time:     Dec 30 2024 11:08:13
I (290) app_init: ELF file SHA256:  ee034ee61...
I (295) app_init: ESP-IDF:          v5.3.2-dirty
I (300) efuse_init: Min chip rev:     v0.0
I (305) efuse_init: Max chip rev:     v0.99 
I (310) efuse_init: Chip rev:         v0.1
I (315) heap_init: Initializing. RAM available for dynamic allocation:
I (322) heap_init: At 3FC97D00 len 00051A10 (326 KiB): RAM
I (328) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (334) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (341) heap_init: At 600FE100 len 00001EE8 (7 KiB): RTCRAM
I (348) spi_flash: detected chip: gd
I (351) spi_flash: flash io: dio
I (355) sleep: Configure to isolate all GPIO pins in sleep state
I (362) sleep: Enable automatic switching of GPIO sleep configuration
I (369) main_task: Started on CPU0
I (379) main_task: Calling app_main()
I (379) SQUAWK_PLAYER: Free heap size before playback: 379572
D (379) i2s_common: tx channel is registered on I2S0 successfully
D (389) i2s_common: DMA malloc info: dma_desc_num = 4, dma_desc_buf_size = dma_frame_num * slot_num * data_bit_width = 1024
D (399) i2s_std: Clock division info: [sclk] 160000000 Hz [mdiv] 14 [mclk] 11289600 Hz [bdiv] 8 [bclk] 1411200 Hz
D (409) i2s_common: MCLK is pinned to GPIO0 on I2S0
D (419) i2s_std: The tx channel on I2S0 has been initialized to STD mode successfully
D (429) i2s_common: i2s tx channel enabled
I (429) gpio: GPIO[10]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (439) gpio: GPIO[9]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (449) SQUAWK_PLAYER: I2S configured successfully
I (449) M4A_PARSE: Get channel 2 bits:16 sample_rate 44100
I (459) M4A_PARSE: Set audio format:3

I (459) M4A_PARSE: Correct audio sample_rate:44100 channel 2
I (649) M4A_PARSE: All sample sent
I (649) SQUAWK_PLAYER: Decode for 7 cpu: 15.07%
I (649) SQUAWK_PLAYER: Playback succeeded for embedded file
I (649) SQUAWK_PLAYER: Free heap size after playback: 374324
I (659) main_task: Returned from app_main()

@TempoTian
Copy link
Contributor

From the log, it already decode OK, I see your code, you need write data to i2s in order to play it.
Currently your code just do decode

static int simple_decoder_write_pcm(uint8_t *data, int size) {
    adjust_volume(data, size, volume);
    write_ctx.decode_size += size;
   // Add your write data to i2s flow like
  //   int ret = i2s_channel_write(tx_chan, data, size, &bytes_written, 1000);
    return size;
}

@gamename
Copy link
Author

@TempoTian That worked! Closing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants