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

I2S audio demo - ESP32-P4-NANO (IDFGH-14251) #15047

Open
3 tasks done
Ncouch64 opened this issue Dec 17, 2024 · 3 comments
Open
3 tasks done

I2S audio demo - ESP32-P4-NANO (IDFGH-14251) #15047

Ncouch64 opened this issue Dec 17, 2024 · 3 comments
Assignees
Labels
Status: Opened Issue is new

Comments

@Ncouch64
Copy link

Ncouch64 commented Dec 17, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hello, I am creating an issue post about this because it seems the only related issues are long closed. I am attempting to test out the speaker function of the new P4 kit, but when running this example I am getting no sound.

I (174110) i2s_es8311: [music] i2s music played, 640000 bytes are written.

is printing out over and over but nothing from the speaker. I saw an issue related to the P4 board about switching the DI and DO pins but that issue was fixed and closed. I tried it anyway, still nothing.

Is there anything I am missing that I could try?

ESP-ROM:esp32p4-eco1-20240205
Build:Feb  5 2024
rst:0x1 (POWERON),boot:0x30f (SPI_FAST_FLASH_BOOT)
SPI mode:DIO, clock div:1
load:0x4ff33ce0,len:0x18e4
load:0x4ff2abd0,len:0xd74
load:0x4ff2cbd0,len:0x322c
entry 0x4ff2abda
I (25) boot: ESP-IDF v5.3.2 2nd stage bootloader
I (26) boot: compile time Dec 17 2024 13:12:01
I (26) boot: Multicore bootloader
I (30) boot: chip revision: v0.1
I (32) boot: efuse block revision: v0.1
I (37) boot.esp32p4: SPI Speed      : 80MHz
I (42) boot.esp32p4: SPI Mode       : DIO
I (46) boot.esp32p4: SPI Flash Size : 2MB
I (51) boot: Enabling RNG early entropy source...
I (57) boot: Partition Table:
I (60) boot: ## Label            Usage          Type ST Offset   Length
I (67) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (75) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (82) boot:  2 factory          factory app      00 00 00010000 00100000
I (91) boot: End of partition table
I (94) esp_image: segment 0: paddr=00010020 vaddr=40020020 size=a8260h (688736) map
I (218) esp_image: segment 1: paddr=000b8288 vaddr=30100000 size=0000ch (    12) load
I (219) esp_image: segment 2: paddr=000b829c vaddr=3010000c size=00038h (    56) load
I (225) esp_image: segment 3: paddr=000b82dc vaddr=4ff00000 size=07d3ch ( 32060) load
I (239) esp_image: segment 4: paddr=000c0020 vaddr=40000020 size=1d534h (120116) map
I (261) esp_image: segment 5: paddr=000dd55c vaddr=4ff07d3c size=0834ch ( 33612) load
I (270) esp_image: segment 6: paddr=000e58b0 vaddr=4ff10100 size=01b2ch (  6956) load
I (276) boot: Loaded app from partition at offset 0x10000
I (276) boot: Disabling RNG early entropy source...
I (290) cpu_start: Multicore app
W (300) clk: esp_perip_clk_init() has not been implemented yet
I (306) cpu_start: Pro cpu start user code
I (307) cpu_start: cpu freq: 360000000 Hz
I (307) app_init: Application information:
I (309) app_init: Project name:     audio_test
I (315) app_init: App version:      1
I (319) app_init: Compile time:     Dec 17 2024 13:11:15
I (325) app_init: ELF file SHA256:  3146e8a7b...
I (330) app_init: ESP-IDF:          v5.3.2
I (335) efuse_init: Min chip rev:     v0.1
I (340) efuse_init: Max chip rev:     v1.99 
I (345) efuse_init: Chip rev:         v0.1
I (349) heap_init: Initializing. RAM available for dynamic allocation:
I (357) heap_init: At 4FF13320 len 00027CA0 (159 KiB): RAM
I (363) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM
I (369) heap_init: At 4FF40000 len 00060000 (384 KiB): RAM
I (375) heap_init: At 50108080 len 00007F80 (31 KiB): RTCRAM
I (381) heap_init: At 30100044 len 00001FBC (7 KiB): TCM
I (388) spi_flash: detected chip: generic
I (392) spi_flash: flash io: dio
W (396) spi_flash: Detected size(16384k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
W (409) i2c: This driver is an old driver, please migrate your application code to adapt `driver/i2c_master.h`
I (420) main_task: Started on CPU0
I (430) main_task: Calling app_main()
i2s es8311 codec example start
-----------------------------
I (430) i2s_es8311: i2s driver init success
I (460) ES8311: ES8311 in Slave mode and I2S format
I (470) i2s_es8311: es8311 codec init success
I (470) main_task: Returned from app_main()
I (10380) i2s_es8311: [music] i2s music played, 634240 bytes are written.
I (21300) i2s_es8311: [music] i2s music played, 640000 bytes are written.
I (32210) i2s_es8311: [music] i2s music played, 640000 bytes are written.
I (43130) i2s_es8311: [music] i2s music played, 640000 bytes are written.
I (54050) i2s_es8311: [music] i2s music played, 640000 bytes are written.
I (64950) i2s_es8311: [music] i2s music played, 640000 bytes are written.
I (75870) i2s_es8311: [music] i2s music played, 640000 bytes are written.
I (86790) i2s_es8311: [music] i2s music played, 640000 bytes are written.
@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 17, 2024
@github-actions github-actions bot changed the title I2S audio demo - ESP32-P4-NANO I2S audio demo - ESP32-P4-NANO (IDFGH-14251) Dec 17, 2024
@suda-morris
Copy link
Collaborator

Have you set the correct GPIO according to your P4-Nano board? https://www.waveshare.net/w/upload/9/97/ESP32-P4-NANO.pdf

ESP32P4 I2S_DO_IO is connected ES8311 PIN9-SDIN, from the schematic it's GPIO9, so please set it correctly in the example_config.h.

Please note, esp-idf example doesn't contain any BSP package, there's no guarantee that it can run out of the box for all boards on the market. We expect the user will read the README before trying the example.

@L-KAYA
Copy link
Collaborator

L-KAYA commented Dec 18, 2024

This issue probably caused by the PA (Power Amplifier) is not enabled. According to the schematic from the link above:

image

The PA_CTRL (which is connected to GPIO53) need to be at high level to enable the PA. You can either set GPIO53 to high in the example, or just connect GPIO53 to VCC with a jump wire.

BTW, P4-EV board also uses GPIO53 as the PA_CTRL, PA is not enabled by default on these P4 boards, please take care when using P4 dev kit~

Back to the example, the example can't ensure whether the PA on board is enabled by default or connect to a particular GPIO. So, the PA enable step won't be added into the example. But I think we can add some hints since this issue is pretty common for P4 boards.

And thanks for the feed back! @Ncouch64

@Ncouch64
Copy link
Author

I appreciate the assistance here, still new to the ESP world so figuring things out as I go along. I will try what has been posted here and provide an update. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

4 participants