ESP32-P4 4″ Wi-Fi 6 touch panel with built-in voice – the next-gen wall panel?

Thanks. I’m not quite sure what you mean by “the ES8311 working with the dual microphones and speaker?” As far as I understand, the problem is that we can’t use both the microphone and speaker simultaneously on this device (perhaps this is just an ESPHome limitation for now, and judging by the Discord conversations, it’s an ESPHome issue, not a hardware one). In any case, full functionality is just a matter of time. As for “Also wondering if you’re running everything straight on the P4 or still using the C6 for Wi-Fi and BLE” - I don’t get it at all. I haven’t read the P4 Discord thread for a long time, so maybe I don’t quite understand what you’re talking about. In any case, I’ll publish the firmware in about 10 days, and I’d be happy if someone improves my config.

1 Like

C6 is just for WiFi and Bluetooth. It has its own UART connection for possibly updating the firmware or writing custom code but the P4 uses SDIO which you define for WiFi. I’m not really sure you can do anything else, well thread and Zigbee maybe but it may not be working yet. Below is what I’m using on my M5Stack M5Tab then the normal WiFi information.

Everything runs in PSRAM on the P4, or at least I’ve set that option as it has 32MB of PSRAM and 16MB of flash ROM. Voice assistant is working but as already stated can’t send and receive data at the same time. Only half duplex, not full duplex. From my understanding (I could be mistaken) the PE and Respeaker which both have an XMOS chip currently support a stop word, I know the Respeaker needed a firmware update to the XMOS chip to support it. On the m5tab it just locks up the I2S bus, at least in my attempts to get it working so I just created a stop button in LVGL. Way more responsive regarding action time, especially with sliders.

esp32_hosted:
  variant: esp32c6
  active_high: true
  clk_pin: GPIO12
  cmd_pin: GPIO13
  d0_pin: GPIO11
  d1_pin: GPIO10
  d2_pin: GPIO9
  d3_pin: GPIO8
  reset_pin: GPIO15
  slot: 1

WIP

I also bought the same ESP32-P4.
Thank you very much for providing your example. That gave me a good start.
About the audio issue, both the ES8311 and ES7210 share the same clock lines provided by the ESP. In your configuration, you set ES8311 sample rate to 48000 and the ES7210 sample rate to 16000. The only way to make them run at the same time is to use identical data format.
I’m not experienced with Esphome but I would think when the sample sample rate is used, there should be a chance to use both at the same time.

Did anyone of you try to use the AEC feature?
From what I understand of the ES7210 datasheet, there are no noise cancelling features in hardware. The speaker is connected to mic3 so any noise cancelling must be done in software.
Next issue: The ES7210 driver in Esphome seems to be fixed to stereo mode. I think using mic3 would require to change I2S transmission mode.
According to the datasheet, DSP/PVM Mode A should be fine as this mode allowed to enable 4 channles for the microphone and stay in sync with 1 channel for the speaker.
ES7210 and ES8311 drivers seems to be hard wired to default I2S mode.

I never used EZZ studio before but here’s a walkthrough using this board granted he had to use AI and LVGL docs to get it working but pretty nice layout. Here is the YAML

@katagia Thanks! The guys at ESPHome said about three months ago that it’s not currently possible to use both the microphone and speaker simultaneously, but they had plans to fix it in the future. Maybe they’ve already fixed it, I don’t know.
As for the example, these are the first tests. Things are much better now, but it hasn’t been published on GitHub yet, but the first demo version will be out soon! Here’s an example; that panel is on the left.

what is one to the right?, the old 4848s040 (esp32-s3 no mic) or the new ESP32-S3 Smart 86 Box (dual mic) ?

fun story, i bought the first 4848s040 in april 2024 for 10 bucks (including shipping), prices sure changed after AI became the buzzword :sweat_smile:

@alaltitov
I dived into it, I think there is a lot of work.

  1. As written, the same I2S hardware is used for speaker and microphone. TDM Mode A with 48kHz samplerate and 4 channels should work for ES8311, ES7210 and ESP32-P4
  2. ES8311 and ES7210 packages (for I2C) must support the new I2C tranmission mode configuration.
  3. As you said, i2s_audio only support mic or speaker. The reason for this is that the bus gets locked as soon as microphone or speaker package accesses it.
  4. Resampling as voice assistant only accepts 16kHz samplerate.
  5. Echo cancellation. The ES7210 doesn’t support this in hardware. It’s just a microphone ADC. What they did is to connect the 3rd mic to to speaker codec output. That’s also the reason for TDM mode in step 1 so this can be implemented in software. Esphome doesn’t support this at the moment. ASP-ADF seems to support this.

So there is some work to do here … I have to see if I have some free time but I’m not see deep into Software … I have to see.

@RealDeco
I think none of them is right, this thread is about a ESP32-P4.
/Edit: Your’re right, sorry didn’t read it the right way.

i’m replying to Alexay’s comment “Here’s an example; that panel is on the left.”, so i’m asking, then what is to the right? :man_shrugging:t3: simply wondering what he is comparing the p4 with, screen difference…

@RealDeco @katagia On the right, that’s the old Guition ESP32-4848S040. I’m almost done with the Guition ESP32-4848S040, though I did encounter some issues with the stack. I think I’ll be working on porting it to Waveshare in a couple of weeks, tops. I should be able to get a demo up and running in a week, tops. Once I’ve uploaded it, we can discuss audio and microphone issues. I think a lot could change in that time, as the guys at ESPHome are constantly working on it.

2 Likes

big color difference, guessing the p4 that is closest match to used color code :+1:

I think it depends on the display matrix, since both Guition and Waveshare use RGB565.

you mean the old guition s3 without mic vs the new waveshare s3 with mics?, it could be a older model of the display :man_shrugging:t3:

i only have the old ones but looked at the schematics for the new s3 with mic, looks like shared i2s bus, not that exciting, but if i should try one of those, the new s3 with mic or the p4, which one would you suggest?

Let me try to explain a little. There are the physical properties of the matrix, such as resolution, contrast, interface (MIPI DSI, RGB SPI, etc.), and so on. And then there are the physical capabilities of the microcontroller.
On the S3, you won’t get RGB888 colors, no matter what the matrix is. In principle, you won’t get… only RGB565, meaning 16-bit instead of 24. On the P4, you can without any problems (but not yet with ESPHome). In my screenshot, both screens are running in RGB565 mode, but the image on the Guition seems richer, and the color difference is precisely due to the matrix.

If you’re choosing between P4 and S3-based screens, you should definitely go with the P4. There are, of course, nuances like price and form factor, but aside from those, the P4 is superior to the S3 in every way.

yeah ok i guess i should have said if differently, which was was the most fun device to get working and which one gave the most trouble, guessing the p4 in both cases :smile:

i know is another class of devices but prices are close, so question is just which one you think is most fun to spend money on …

That’s a tough question! It all depends on the task. Waveshare, for example, doesn’t have a 220V power supply (it’s 110V), but even Guition is intimidating to plug into AC power; it only uses USB, and that’s the main concern for many. In this case, Waveshare (on the P4) certainly wins. I won’t list all the advantages; there are many. As for the complexity of the work, the features available on Guition are easily ported to Waveshare. Guition is a proven device, while the P4 version is still in development.

yes i would also not use 220v again, fried one of my guitions after a few months only connected to a lightbulb :eyes:

and you’re right, waveshare s3 would not be so fun to tinker with as th p4, any critical components that isn’t working yet?

Interesting…i run two of them on 230V (actually 240V, since i’m right next to transformer station) for appr. a year now without problems.

Have you disassembled your device? Are there any security components?

In my versions only inductors were missing. I soldered what i’ve had… can’t remember value, i think it was in 10-100uH range. But that inductor is just a noise filter, nothing more.
Funny thing is that one of my guitions only work on 230V - if connected to usb after a few minutes lcd starts to flicker and draws horizontal lines across all screen. But both wake up randomly. i “kinda” solved this by using long press instead of just press.

1 Like

Still need to work on the design, clean up, fix some bugs, and show another version of the light widget. But it’s stable and all widgets work smoothly. The only BUT is that for now you’ll have to flash via UART, since OTA doesn’t want to work with 32Mb PSRAM, and we’ve already exceeded the 16Mb limits, but I think they’ll fix it. Also, you’ll need the DEV version of ESPHome 2025.11.0.