esp32-s31 audio solution + dialing + small gallery

This content is AI-translated and may differ from the original.

🔥 Handcrafted a full-featured Bluetooth speaker with ESP32! Album cover, lyrics, spectrum all included



Wrote a complete Bluetooth music player firmware for the Espressif ESP32-S31 Korvo1 development board. Once the phone's Bluetooth is connected, it can play music, and the 800×480 touch large screen displays album cover, scrolling lyrics, and spectrum animation in real time, the effect is super cool. It has been fully open‑sourced to GitHub, and the firmware is compiled and ready to flash.

47bb9c97f90de7837f05654f95623176.jpg3859b970bb62c682d746196f81c7db2c.jpg59531a8c1971d29e199f989c3bfb8aff.jpg799717921d1118e733bc0d1b9fe3b4a3.jpgf7f47ae04dfae59408692bb1ce2695d9.jpg

🎧 Feature Overview

Bluetooth Audio

  • Bluetooth A2DP Sink protocol, audio stream from phone/computer is pushed directly for playback
  • AVRCP remote control, supports play/pause, previous/next track, volume adjustment
  • Automatically fetch song title, artist, album name, genre information
  • Receive and display album cover in real time (JPEG format)

Graphical Interface

  • Circularly cropped album cover + continuous rotation animation, giving a record player feel
  • Scrolling synchronized lyrics display, up to 5 lines, current line automatically highlighted
  • 16-band rainbow-colored FFT real-time spectrum bar graph, smooth 25fps refresh
  • GIF emoji gallery, with 14 built-in animations, swipe left/right to view
  • Full dialer interface, numeric keypad + answer/hang‑up/dial buttons
  • Floating volume bar on the right, auto‑hides to avoid obstructing view

Other

  • HFP Bluetooth hands‑free calling, incoming call automatically displays number
  • Left/right swipe gestures to switch among three pages: Gallery → Music → Dialer
  • GT1151 capacitive touch, responsive and smooth control

🛠️ Hardware Configuration

  • Main MCU:ESP32-S31(RISC-V 双核)
  • Development board:ESP32-S31 Korvo1
  • Screen:800×480 RGB 接口 IPS 触摸屏
  • Audio DAC:ES8311 编解码器
  • Memory:16MB Flash + 8MB PSRAM
  • Interfaces:I2S(音频)+ I2C(触摸)+ RGB(显示)

💻 Software Stack

  • ESP-IDF v6.2+ — Espressif official development framework
  • LVGL v9.2.2 — Open‑source embedded graphics library, drives the entire UI
  • ESP-GMF — Espressif multimedia framework, manages audio pipeline
  • BlueDroid — Bluetooth Classic protocol stack (A2DP + AVRCP + HFP)
  • esp_jpeg — JPEG hardware decoding, album cover loads instantly
  • Noto Sans SC — Google Noto Sans SC, perfect Chinese rendering
  • FreeRTOS — Real‑time operating system, multitask scheduling

🧠 Pitfalls Encountered During Development

  1. Cover switch delay — When the song changes, the cover remains from the previous track → Use a separate low‑priority thread to decode JPEG asynchronously, UI thread only handles display
  2. Chinese fonts appear as blocks — LVGL does not support large Unicode range by default → Enable LV_FONT_FMT_TXT_LARGE, embed full Chinese font
  3. Cover intermittently disappears — Asynchronous queue message race condition → Synchronously hide old cover within LVGL lock to eliminate flicker
  4. Firmware compilation errors — ESP32‑S31 uses RISC‑V toolchain, different from the usual ESP32 Xtensa → Took a long time to configure the toolchain path

📂 Open Source Repository

GitHub:https://github.com/han0519/esp32-xiaofeng

What’s in the repository:

  • ✅ Complete project source code, clone and set up the environment to compile
  • ✅ Super detailed README, includes architecture diagram, data flow diagram, configuration guide, debugging commands, FAQ
  • ✅ Release page provides compiled firmware (bootloader + partition table + application firmware, total 3 bin files), flash directly with esptool to run
  • ✅ All dependent components are bundled in the components/ directory, no extra downloads needed

If you want to replicate it, just follow the README step by step; it’s written at a nanny‑level 😎

Comments (2)

Comments

Sign in to leave a comment

  • 2 months ago
    这个 硬件从哪里购买,网上没有搜的
  • 2 months ago
    淘宝乐鑫官方的开发板加俩喇叭
  • 稻草人
    2 months ago
    大佬,这个开发板支持AEC吗?
  • 2 months ago
    完全支持啊,但是我的这个没用到的 ESP32-S31 Korvo1 板载 ES8389 codec: DAC(扬声器输出):2 通道,48kHz ADC(麦克风输入):4 通道,48kHz AEC 需要同时采集参考信号(扬声器播放的声音)和麦克风信号来消除回声,4 通道 ADC 完全满足——其中 1 路采集参考信号(R),1 路采集麦克风(M)。
  • esp32-s31 audio solution + dialing + small gallery | Espressif