Audio & Video

  • audio
  • video
  • MIC
  • I2S
  • PDM
  • display
  • camera
  • MIPI-CSI

Which modules can directly drive a speaker for audio playback?

ESP32, ESP32-S2, ESP32-S3, ESP32-C3, and similar SoCs can output audio directly through PWM (LEDC) or DAC, making it possible to connect a simple speaker or earphones for playback. The output volume is limited, so this is suitable mainly for basic applications.

In the official examples, a speaker can be connected directly to GPIOs such as GPIO25/26 on ESP32 and GPIO1/2 on ESP32-S2/S3/C3, with a 47 Ω series resistor. Example:
https://github.com/espressif/esp-iot-solution/blob/master/examples/audio/wav_player/README.md

Note that most ESP32 modules do not integrate a power amplifier. Directly driving a high-power speaker usually results in low volume. If higher volume or better sound quality is required, use a development board with an external audio amplifier or add an amplifier circuit around the module.

A project uses both ES7210 and NS4168. They have the same channel count, sample rate, and bit depth. Can they share BCLK and LRCK?

Yes. ES7210 is an input device and NS4168 is an output device. I2S can support input and output at the same time, and the data directions are opposite, while the other clock signals can be shared.

Only one channel needs to be created. On ESP32-S3, I2S supports full-duplex operation. See:
https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32s3/api-reference/peripherals/i2s.html#id17

Can an ESP32-S3 module directly connect to and drive a microphone?

An ESP32-S3 module can directly connect to and drive an I2S digital microphone through the I2S interface.

For a PDM digital microphone, the ESP32-S3 can also use the PDM mode of the I2S peripheral and connect directly to the CLK and DATA signal lines.

An ESP32-S3 module cannot directly drive an analog microphone. An analog microphone requires an external Codec chip or another analog audio front-end circuit.

What is the recommended maximum PCLK when ESP32-S3R2 drives an RGB565 display, and how can the refresh rate be improved?

When ESP32-S3R2 drives an RGB565 interface display, keep PCLK at or below 11 MHz.

To improve the refresh rate, enable bounce buffer mode and turn on the following project configuration:

CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y

Why does video_lcd_display report MIPI-CSI camera detection failure on WT99P4C5-S1 with ESP-IDF v5.5.2?

A typical error log is:

I (1512) app_lcd: Install LCD driver of ek79007
I (1517) ek79007: version: 1.0.2
E (1700) sccb_i2c: s_sccb_i2c_transmit_receive_reg_a16v8(112): faled to transmit receive
E (1701) sc2336: Get sensor ID failed
E (1701) esp_video_init: failed to detect MIPI-CSI camera sensor with address=30
E (1708) app_video: Open video failed
E (1711) app_main: video cam open failed
I (1715) main_task: Returned from app_main()

video_lcd_display initializes the camera with the SC2336 driver by default and reads the sensor ID over SCCB/I2C. If the connected camera module does not use an SC2336 sensor, the sensor ID read fails, which then causes MIPI-CSI camera detection and video opening to fail.

Select the Camera Sensor Configuration that matches the actual sensor in menuconfig. See the video_lcd_display example documentation for the configuration path and procedure.

The current examples are adapted for SC2336. Using another sensor also requires the corresponding driver and parameter adaptation.