A DOOM port isn't much fun without a keyboard and some noise. The ESP32-P4 has a USB host, so we drive input straight off it: USB keyboards (boot protocol) mapped to the usual DOOM keys and generic HID gamepads. Keyboard and gamepad coexist — whichever enumerates just works.
One gotcha worth flagging for anyone doing USB host on the P4: a full-speed device behind a high-speed hub needs a Transaction Translator, and that isn't implemented in the IDF USB host stack we used — so a FS controller plugged into a HS hub simply won't enumerate. Connected directly, it's fine.
For audio we hung an external ES8311 codec (an M5 Atomic EchoBase) off I2S. The catch: the EchoBase has no external MCLK, so the codec derives its clock from the bit clock (use_mclk = false) — at 22050 Hz / 16-bit the internal multiplier lands on the right ratio. The onboard amplifier is un-muted through a little PI4IOE I/O-expander rather than a plain GPIO pin. SFX only (music off), and DOOM has its sound back.
Andrea Ricci
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.