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.





🎧 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
- 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
- Chinese fonts appear as blocks — LVGL does not support large Unicode range by default → Enable
LV_FONT_FMT_TXT_LARGE, embed full Chinese font - Cover intermittently disappears — Asynchronous queue message race condition → Synchronously hide old cover within LVGL lock to eliminate flicker
- 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