Repository navigation
Add ES8311 audio-reactive support for the Waveshare ESP32-P4-ETH - #128
TouchMyLight wants to merge 1 commit into
Conversation
New firmware variant (esp32p4rev1-eth-es8311), board definition, and Ethernet/I2C/I2S pins for the Waveshare ESP32-P4-ETH's onboard ES8311 codec, selectable from the web installer. Bench-verified end to end: Ethernet link + DHCP, codec ACK at 0x18, and live mic data (level, onsets, peak Hz) flowing through AudioService. Core: - New CONFIG_MM_P4_ES8311 Kconfig option gates the esp_codec_dev managed-component dependency and the P4's AudioCodecPins, since most other P4 boards share this chip target but have no onboard codec. - Two codec bring-up bugs fixed in platform_esp32_es8311.cpp, both shared with the S31's codec path (not P4-ETH-specific): esp_codec_dev's I2C layer right-shifts the address it's given (the bare 7-bit 0x18 silently targeted 0x0C, so every register write NACK'd despite a scan at 0x18 ACKing cleanly), and esp_codec_dev_new requires a non-null data_if that was never set. - New "ESP32-P4-ETH" Ethernet preset in NetworkModule.h (IP101, same pins as the P4-NANO, independently confirmed rather than aliased). Scripts/MoonDeck: - New esp32p4rev1-eth-es8311 entry in build_esp32.py's FIRMWARES dict; regenerated mooninstaller/firmwares.json. Docs/CI: - New esp32-p4-eth.md hardware reference (pins, bench findings). - Device catalog entry, cross-reference updates (gpio-usage.md, firmware-variants.md, the S31 doc's shared-bug note), mkdocs nav. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for this, and for bench-verifying it end to end. The ES8311 driver already exists:
Your two codec fixes are real bugs that hit the S31 too: the address PR #55 adds the Guition JC-ESP32P4-M3-DEV the same way, and its codec wiring is identical to this board's. The proposed entry for this board, with the codec control names still to be settled (pins from the Waveshare wiki and your bench test): {
"name": "Waveshare ESP32-P4-ETH",
"chip": "ESP32-P4",
"firmwares": ["esp32p4rev1-eth"],
"url": "https://www.waveshare.com/wiki/ESP32-P4-ETH",
"supported": ["LEDs", "Ethernet", "Audio"],
"modules": [
{ "type": "System", "id": "System", "controls": { "deviceModel": "Waveshare ESP32-P4-ETH" } },
{ "type": "EthernetModule", "id": "Ethernet", "parent_id": "Network", "controls": { "ethBoard": "P4-NANO" } },
{ "type": "AudioService", "id": "Audio", "parent_id": "Services",
"controls": { "mode": 2, "codec": "ES8311", "codecSda": 7, "codecScl": 8, "codecAddr": 24,
"mclkPin": 13, "sckPin": 12, "wsPin": 10, "sdPin": 11 } },
{ "type": "ParallelLedDriver", "id": "ParallelLed", "parent_id": "Drivers",
"controls": { "peripheral": "Parlio", "pins": "20,21,22,23,24,25,26,27" } }
]
}Once that lands, would you rebase this onto it, keeping the board documentation and the catalog entry and dropping the firmware variant? |
|
I agree that a new firmware variant is not necessary. I'll rebase once the coded becomes a runtime config. |
|
An update: the ES8311 support this PR asked for is built, in a slightly different shape, and goes into main as the latest release in the coming days. What is built
Verified on a P4-ETH here: Ethernet with DHCP, the codec found at Thanks for the bring-up work and for finding the two codec bugs, which the S31 shared. Once the release is out, a test from your side on the latest build would be welcome. |
|
Thank you @TouchMyLight. This is merged in #129 in a different shape: the ES8311 codec became runtime configuration (AudioService |
…2-P4-ETH Writes the hardware reference page for the Waveshare ESP32-P4-ETH's onboard ES8311 codec and Ethernet wiring, which PR #128's firmware-variant approach never landed on main after PR #129 made the codec runtime configuration. Also renames the shared P4 Ethernet preset to "P4-NANO/ETH" so its UI label doesn't imply it's NANO-only. **Core** - `EthernetModule.h`: `kEthPresets`' shared P4 RMII row renamed `"P4-NANO"` → `"P4-NANO/ETH"`, naming both boards that use it; doc comment updated to match. **Scripts/MoonDeck** - `check_devices.py`: its own restatement of the preset label (cross-checked against `platform_config.h`'s chip default) updated to match the rename — this is the check that caught the miss on the first pass. **Docs/CI** - New `docs/reference/hardware/esp32-p4-eth.md`: audio (ES8311) and Ethernet pin tables, free-GPIO table, bench-verification notes, written against the current runtime-codec architecture (`AudioService`/`I2cBusModule`), not copied from the closed PR #128. - `firmware-variants.md`, `gpio-usage.md`: P4-ETH named alongside the P4-NANO as sharing `esp32p4rev1-eth`. - `mkdocs.yml`: nav entry for the new page. - `mooninstaller/deviceModels.json`: the renamed preset label carried into all 5 P4-family catalog entries that reference it. Bench-verified on the Waveshare ESP32-P4-ETH (plain `esp32p4rev1-eth` firmware, no new variant): I2C bus scan ACKs the codec at 0x18, `AudioService` reports live mic data, Ethernet link + DHCP hold, and the renamed preset round-trips cleanly on an already-provisioned board (auto-resolves to the new label, same pins, no reseed to Custom). Reviews - Pre-existing, unrelated to this diff (confirmed by reproducing on a clean `main`): `check_docgen` carries 1 pre-existing error (`Hub75Slots.h`) and `check_code` a 4-finding drift, both from commits already on `main` before this branch started — named here rather than fixed, since neither file is touched by this change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
New firmware variant (esp32p4rev1-eth-es8311), board definition, and Ethernet/I2C/I2S pins for the Waveshare ESP32-P4-ETH's onboard ES8311 codec, selectable from the web installer. Bench-verified end to end: Ethernet link + DHCP, codec ACK at 0x18, and live mic data (level, onsets, peak Hz) flowing through AudioService.
Core:
Scripts/MoonDeck:
Docs/CI: