Board: XIAO ReSpeaker Lite (ESP32-S3 + XU316 + AIC3204) Version: 1.0.0 Status: Phase 2 Complete - Audio Playback
This project implements a smart speaker application on the XIAO ReSpeaker Lite board, featuring:
- Audio playback from SPIFFS storage
- Audio recording from XU316-processed microphones
- Network transmission of recorded audio via TCP
- Visual feedback via RGB LED
- User interaction via button control
- ESP32-S3: Main MCU (8MB Flash, 8MB PSRAM)
- XMOS XU316: Audio DSP (I2C: 0x42) - microphone processing
- TLV320AIC3204: Audio codec (I2C: 0x18) - speaker output
- WS2812 RGB LED: GPIO1 - status indication
- User Button: GPIO3 (D3) - user interaction
Implemented Components:
board_config.h- Hardware configuration and GPIO definitionsfilesystem_manager.c/h- SPIFFS filesystem operationsi2c_manager.c/h- I2C bus management for AIC3204 and XU316aic3204_driver.c/h- TLV320AIC3204 codec controlxu316_driver.c/h- XMOS XU316 processor controlbutton_handler.c/h- Button with debouncing and long press detectionled_controller.c/h- WS2812 LED control with effectsapp_config.h- Application configuration constantspartitions.csv- Custom partition table with SPIFFSsdkconfig.defaults- ESP-IDF configuration defaultsKconfig.projbuild- Project-specific configuration options
Features:
- ✅ SPIFFS filesystem mounted and operational
- ✅ I2C communication with AIC3204 codec
- ✅ I2C communication with XU316 processor
- ✅ Button press detection (short and long press)
- ✅ LED color control and effects (blink, pulse)
- ✅ Volume control via AIC3204
- ✅ XU316 firmware version reading
- ✅ VNR (Voice Noise Reduction) value reading
Implemented Components:
audio_playback.c/h- Playback managementwav_decoder.c/h- WAV file parsingi2s_output.c/h- I2S TX operations
Features:
- ✅ WAV file playback from SPIFFS
- ✅ I2S TX in slave mode (XU316 provides clocks)
- ✅ Support for 16-bit and 32-bit PCM audio
- ✅ Automatic bit depth conversion
- ✅ Synchronous and asynchronous playback
- ✅ Volume control integration
- ✅ Playback statistics tracking
- ✅ Button-triggered playback
- ✅ LED status indication
To Be Implemented:
audio_recording.c/h- Recording managementwav_encoder.c/h- WAV file creationi2s_input.c/h- I2S RX operations
To Be Implemented:
audio_tcp_client.c/h- TCP audio transmissionnetwork_manager.c/h- Network state management
To Be Implemented:
state_machine.c/h- Application state management
- ESP-IDF v5.x installed and configured
- XIAO ReSpeaker Lite board connected via USB
# Set ESP-IDF environment
. $HOME/esp/esp-idf/export.sh
# Configure project (optional)
idf.py menuconfig
# Build project
idf.py build
# Flash to device
idf.py -p /dev/ttyACM0 flash
# Monitor output
idf.py -p /dev/ttyACM0 monitor# Build project
idf.py build
# Flash to device (adjust COM port as needed)
idf.py -p COM3 flash monitorThe current Phase 2 implementation provides audio playback functionality:
- Power on the board - LED will show RGB startup sequence (Red → Green → Blue)
- LED turns green - System is ready
- Short press button - Plays WAV file from SPIFFS (LED turns blue during playback)
- Press again during playback - Stops playback
- Long press button (hold for 1 second) - Cycles through volume levels (MAX → HIGH → MEDIUM → LOW)
I (xxx) smart_speaker: === XIAO ReSpeaker Lite Smart Speaker ===
I (xxx) smart_speaker: Version: 1.0.0
I (xxx) smart_speaker: Phase 1: Basic Infrastructure Test
I (xxx) smart_speaker: Initializing SPIFFS...
I (xxx) smart_speaker: SPIFFS: 1536 KB total, 0 KB used
I (xxx) smart_speaker: Initializing I2C bus...
I (xxx) smart_speaker: Scanning I2C bus...
I (xxx) i2c: Found device at address: 0x18 (AIC3204)
I (xxx) i2c: Found device at address: 0x42 (XU316)
I (xxx) smart_speaker: AIC3204 initialized successfully
I (xxx) smart_speaker: Volume set to 0x10
I (xxx) xu316: XU316 Firmware: v1.2.3
I (xxx) smart_speaker: XU316 VNR value: 50
I (xxx) smart_speaker: LED controller initialized successfully
I (xxx) smart_speaker: Button handler initialized successfully
I (xxx) smart_speaker: Phase 1 Infrastructure Test Complete!
Edit main/Kconfig.projbuild or use idf.py menuconfig:
- Audio Sample Rate: 16000 Hz (default)
- Recording Duration: 10 seconds (default)
- Default Volume: 0x10 (default)
- TCP Server IP: 192.168.1.100 (default)
- TCP Server Port: 3333 (default)
Edit main/board_config.h:
- GPIO pin assignments
- I2C addresses
- Audio parameters
- LED colors
- Buffer sizes
| Function | GPIO | Description |
|---|---|---|
| I2S BCK | GPIO8 | Bit Clock (from XU316) |
| I2S WS | GPIO7 | Word Select (from XU316) |
| I2S DOUT | GPIO43 | Data Out to AIC3204 |
| I2S DIN | GPIO44 | Data In from XU316 |
| I2C SDA | GPIO5 | I2C Data |
| I2C SCL | GPIO6 | I2C Clock |
| RGB LED | GPIO1 | WS2812 LED |
| Button | GPIO3 | User Button (D3) |
| Device | Address | Description |
|---|---|---|
| AIC3204 | 0x18 | TLV320AIC3204 Audio Codec |
| XU316 | 0x42 | XMOS Audio Processor |
| Color | Status |
|---|---|
| Green | Idle / Ready |
| Blue | Playing Audio |
| Yellow | Volume Adjustment |
| Red | Error |
- Check GPIO1 connection
- Verify WS2812 power supply
- Check LED strip component installation
- Verify GPIO3 (D3) connection
- Check pull-up resistor configuration
- Test with multimeter for button continuity
- Run I2C bus scan to detect devices
- Check SDA (GPIO5) and SCL (GPIO6) connections
- Verify I2C pull-up resistors (typically 4.7kΩ)
- Check device addresses (0x18 for AIC3204, 0x42 for XU316)
- Ensure ESP-IDF v5.x is properly installed
- Run
idf.py fullcleanand rebuild - Check that all dependencies are installed
- Verify
led_stripcomponent is available
esp-smart-speaker/
├── CMakeLists.txt # Top-level CMake configuration
├── partitions.csv # Custom partition table
├── sdkconfig.defaults # Default SDK configuration
├── README.md # This file
├── PHASE1_COMPLETE.md # Phase 1 completion report
├── PHASE2_COMPLETE.md # Phase 2 completion report
├── main/
│ ├── CMakeLists.txt # Main component CMake
│ ├── Kconfig.projbuild # Project configuration menu
│ ├── idf_component.yml # Component dependencies
│ ├── tcp_client_main.c # Main application
│ ├── board_config.h # Hardware definitions
│ ├── app_config.h # Application configuration
│ ├── filesystem_manager.c/h # SPIFFS operations
│ ├── i2c_manager.c/h # I2C bus management
│ ├── aic3204_driver.c/h # AIC3204 codec driver
│ ├── xu316_driver.c/h # XU316 processor driver
│ ├── button_handler.c/h # Button handler
│ ├── led_controller.c/h # LED controller
│ ├── wav_decoder.c/h # WAV file parser
│ ├── i2s_output.c/h # I2S TX operations
│ └── audio_playback.c/h # Audio playback manager
├── plans/
│ └── smart-speaker-plan-complete.md # Complete implementation plan
└── managed_components/
├── espressif__esp_audio_codec/
└── espressif__led_strip/
- ESP-IDF Programming Guide
- TLV320AIC3204 Datasheet
- XMOS XU316 Documentation
- Complete Implementation Plan
This project is provided as-is for educational and development purposes.
This is an active development project. Contributions and suggestions are welcome!
Last Updated: 2026-01-02 Phase: 2 of 5 Complete