A versatile audio streaming solution for ESP32 that enables high-quality audio transmission over network using RTP protocol. The device can operate in four distinct modes, bridging different audio interfaces (USB/S/PDIF) with network streaming.
The ESP32 RTP Transceiver is an audio streaming device that transforms your ESP32 into a powerful audio bridge. It supports both sending and receiving audio streams over your local network using the Real-time Transport Protocol (RTP), with support for both USB Audio Class (UAC 1.0) and S/PDIF digital audio interfaces.
Screenshots:
- Four Operating Modes: Flexible configuration as sender or receiver with USB or S/PDIF interfaces
- RTP Protocol: Industry-standard real-time audio streaming
- mDNS Discovery: Automatic device discovery on local networks
- Web Configuration: User-friendly web interface with setup wizard
- OTA Updates: Over-the-air firmware updates
- NTP Synchronization: Precise time synchronization for coordinated playback
- Adaptive Buffering: Dynamic buffer management for optimal audio quality
- Power Management: Sleep modes and battery charging support (BQ25895)
- Import/Export Settings: Backup and restore device configurations
- Function: Receives RTP audio streams from the network
- Output: USB UAC 1.0 DAC
- Use Case: Stream network audio to USB speakers/DACs
- Description: Device acts as a network audio receiver, outputting audio through USB to connected DACs or speakers
- Function: Receives RTP audio streams from the network
- Output: S/PDIF digital audio
- Use Case: Stream network audio to S/PDIF equipment
- Description: Device receives network audio and outputs through S/PDIF optical/coaxial connection
- Function: Captures audio from USB host (PC/Console)
- Output: RTP network stream
- Use Case: Stream PC/console audio to network
- Description: Device appears as a USB sound card to computers/consoles and streams received audio to the network
- Function: Captures audio from S/PDIF input
- Output: RTP network stream
- Use Case: Stream S/PDIF sources to network
- Description: Device captures S/PDIF audio input and broadcasts it as RTP stream on the network
-
Lifecycle Manager (
lifecycle_manager.c)- Central state machine controlling device operation
- Manages mode transitions and configuration changes
- Handles power management and sleep states
-
Web Server (
web_server.c)- HTTP server for configuration interface
- REST API endpoints for device control
- Captive portal for initial setup
- WebSocket support for real-time updates
-
Network Components
- RTP Sender (
network_out.c): Handles audio streaming to network - RTP Receiver (
network_in.c): Receives and processes network audio streams - mDNS Service: Device discovery and advertisement
- NTP Client: Time synchronization
- RTP Sender (
-
Audio Interfaces
- USB Host (
usb_out.c): USB DAC output support - USB Device (
usb_in.c): USB audio capture from host - S/PDIF Input (
spdif_in.c): Digital audio capture with clock recovery - S/PDIF Output (
spdif_out.c): Digital audio output
- USB Host (
-
Configuration Management
- Config Manager (
config_manager.c): Persistent settings storage - WiFi Manager (
wifi_manager.c): Network connection management - OTA Manager (
ota_manager.c): Firmware update handling
- Config Manager (
INITIALIZING
↓
HW_INIT (Hardware initialization, NVS, Power management)
↓
STARTING_SERVICES (WiFi, Web server)
↓
AWAITING_MODE_CONFIG (Wait for user configuration)
↓
[Based on configuration]
├── MODE_SENDER_USB
├── MODE_SENDER_SPDIF
├── MODE_RECEIVER_USB
└── MODE_RECEIVER_SPDIF
- ESP32-S3 development board
- For USB modes: USB OTG support
- For S/PDIF modes: S/PDIF transceiver hardware
- Optional: BQ25895 battery charger IC
- Optional: TS3USB30ERSWR USB switch
- Wiring: Connect SPDIF to data pin 17
- Power On: The device will start in Access Point mode if not configured
- Connect: Join the WiFi network "ESP32-Scream" (default)
- Configure: Navigate to http://192.168.4.1 in your browser
- Setup Wizard: Follow the interactive setup wizard to:
- Select operating mode
- Configure network settings
- Set device name
- Configure audio parameters
Hold GPIO 0 or GPIO 1 during the first 3 seconds of boot to reset all settings to defaults.
Access the device's IP address in a web browser to access the configuration interface:
- Configuration Tab: Setup wizard and quick configuration
- Logs Tab: Real-time system logs viewer
- System Update Tab: OTA firmware updates
- Import/Export Tab: Backup and restore settings
The device supports automatic discovery through mDNS:
- Service Type:
_scream._tcp - Advertised Properties:
- Device name
- IP address
- Port number
- Operating mode
Compatible with:
- Scream (Windows)
- PulseAudio RTP
- Generic RTP clients (Pipewire, VLC, etc...)
Firmware updates can be performed through the web interface:
- Navigate to the "System Update" tab
- Select or drag the
.binfirmware file - Click "Start Update"
- Device will automatically restart after successful update
- Battery charging management
- Power status monitoring
- USB power delivery support
- Protocol: RTP (Real-time Transport Protocol)
- Transport: UDP
- Multicast: Supported
- Discovery: mDNS
- Formats: PCM 16-bit
- Sample Rates: 48kHz
- Channels: Stereo
For a quick and easy way to flash pre-built firmware, you can use the web flash tool:
- Open Chrome browser and navigate to https://screamrouter.net/esp32-flasher
- Connect your ESP32 device via USB
- Follow the on-screen instructions to flash the firmware
- ESP-IDF v5.0 or later
- Python 3.7+
# Clone the repository
git clone https://github.com/your-repo/esp32-rtp
cd esp32-rtp
# Initialize submodules
git submodule update --init --recursive
# Configure the project
idf.py menuconfig
# Build
idf.py build
# Flash to device
idf.py -p /dev/ttyUSB0 flash
# Monitor output
idf.py -p /dev/ttyUSB0 monitor- Stream audio from PC to HiFi system
- Wireless speaker systems
- Console audio streaming
- Low-latency game audio
- Wireless gaming headsets
-
No Audio Output
- Check network connectivity
- Verify port configuration
- Ensure correct mode selection
-
Audio Dropouts
- Increase buffer sizes
- Check WiFi signal strength
- Reduce network congestion
-
Device Not Discovered
- Check firewall/AP settings
- Ensure same network segment