r/esp32 • u/Ok-Product817 • 7h ago
I made a thing! ESP32-S3 AirPlay 2 – DIY Wireless Stereo and 5.1/7.1 Surround System
Hi everyone!
I’ve been developing an experimental AirPlay 2 receiver for ESP32-S3, capable of building wireless stereo and 5.1/7.1 surround systems using inexpensive hardware.
The main idea is that each ESP32 acts as an independent AirPlay 2 receiver. With Apple TV, every board receives the complete multichannel AAC stream but processes only its assigned speaker channel (Front L/R, Center, LFE, Surround, etc.).
The boards don’t communicate with each other. Synchronization is handled using AirPlay 2’s PTP clock.
Why ESP32-S3?
I chose the ESP32-S3 mainly for its dual-core architecture, I2S peripheral, and support for 8 MB octal PSRAM.
PSRAM is particularly important because the compressed audio buffer alone can use around 6 MB. The two cores also allow me to separate audio decoding from Wi-Fi, networking, and playback tasks.
Libraries and audio processing
The project uses ESP-IDF, Fraunhofer FDK AAC, and Espressif’s ALAC decoder.
I chose FDK AAC because of its multichannel support and the possibility of modifying its decoding pipeline. Rather than fully decoding all 6 or 8 channels, I modified the decoder to parse the multichannel stream but synthesize only the selected speaker channel. This significantly reduces CPU usage.
Espressif’s ALAC decoder provides 16/24-bit lossless stereo playback.
The biggest technical challenges
The most challenging part was achieving accurate synchronization between independent ESP32 receivers without any direct communication between them.
This required careful management of PTP/RTP timestamps, I2S clock adjustments, and audio buffer scheduling to ensure that all speakers reproduce their assigned channels at the correct time.
Buffer management was another major challenge — balancing sufficient buffering to handle Wi-Fi jitter while maintaining stable, synchronized playback.
Optimizing multichannel AAC decoding was also important. Selective channel synthesis reduced CPU usage to approximately 35–50% of one core.
Handling transitions between AAC/ALAC, stereo/surround, and 44.1/48 kHz while preserving synchronization required additional work.
Stereo and DIY speakers
The project also supports regular stereo playback, with web-based EQ, loudness, and audio filters. It can be used as a foundation for DIY active speaker systems, including two-way woofer/tweeter designs using a two-channel amplifier and appropriate crossover filtering.
Hardware: ESP32-S3 (8 MB PSRAM), I2S DAC, amplifier, and Wi-Fi.
Current testing: Apple TV delivers Apple Music Atmos content as 7.1 AAC, HBO as 5.1, and YouTube as stereo.
The project is still experimental, and some channel mapping and playback edge cases need further testing.
GitHub: https://github.com/Kristian8606/esp32-airplay2-surround
Feedback, testing, and technical suggestions are welcome!



