ESP32 Audio Docks is a range of extension boards (i.e. docks) that allow you to develop Audio solutions based on ESP32 chips. These were created to make Audio development entry as easy and inexpensive as possible.
I spent last few years developing different solutions based on ESP delices. It all started with ESP8266, where CPU power is not really sufficient to do real-time decoding, so you're limited to rather simple ding-dong business. Then ESP32 came, bringing two much more capable cores, so you have powerhouse to handle communication and decoding at the same time. Perhaps most importantly it also came with SPIRAM, so you can do decent buffering (essential for streamed content).
Now new ESP32 C-Series and S-Series chips are entering the market, and their potential is mostly unrealized as for today.
I created those docks, to be able quick prototype for whole range of ESP8266 and ESP32 chips, starting with the simplest finger-sized toys and going all the way up to full-sized speakers.
ESP Audio Solo | ESP Audio Duo | Hifi ESP | Louder ESP | |
---|---|---|---|---|
Image | ||||
Docks with | ESP8266, ESP32C3, ESP32S2 Mini modules | ESP32 Mini Module | ESP32 Mini Module | ESP32 Mini Module |
DAC | Single I2S DAC (MAX98357) with built in D-Class amp | Dual I2S DAC (MAX98357) with built in D-Class amp | PCM5100A 32bit Stereo DAC -100 dB typical noise level |
Stereo I2S DAC (TAS5805M) with built in D-Class amp |
Output (4Ω) | 3W | 2x 3W | Non-amplified stereo output | 2x 15W at 12V Vin |
Output (8Ω) | 1.5W | 2x 1.5W | Non-amplified stereo output | 2x 23W at 22V Vin |
Adds | 8MB PSRAM (4MB usable) | 8MB PSRAM (4MB usable) | 8MB PSRAM (4MB usable) | |
Connectivity | WiFi (ESP8266, ESP32S2) WiFi + BT5.0 (ESP32C3) |
WiFi + BT4.2 + BLE | WiFi + BT4.2 + BLE | WiFi + BT4.2 + BLE Ethernet |
Audio streaming require proper buffering to work, even with ESP32 500K of RAM it is a challenging task. For that reason most of the projects will require WROVER modules that have onboard PSRAM chip.
All ESP32 Docks has 8MB PSRAM chip onboard, connected via high-speed SDIO interface. This effectively turns your regular WROOM module into WROVER module with no effort required. Any code using PSRAM with just work out-of-the box.
I2S CLK | I2S DATA | I2S WS | |
---|---|---|---|
ESP8266 | 15 | 3 | 2 |
ESP32C3 | 5 | 20 | 6 |
ESP32S2 | 12 | 37 | 16 |
I2S CLK | I2S DATA | I2S WS | PSRAM CE | PSRAM CLK | |
---|---|---|---|---|---|
ESP32 | 26 | 22 | 25 | 16 | 17 |
I2S CLK | I2S DATA | I2S WS | PSRAM CE | PSRAM CLK | |
---|---|---|---|---|---|
ESP32 | 26 | 22 | 25 | 16 | 17 |
I2S CLK | I2S DATA | I2S WS | PSRAM CE | PSRAM CLK | TAS5805 SDA | TAS5805 SCL | TAS5805 PWDN | TAS5805 FAULT | |
---|---|---|---|---|---|---|---|---|---|
ESP32 | 26 | 22 | 25 | 16 | 17 | 21 | 27 | 33 | 34 |
Starting from revision E, Louder ESP exposes Ethernet header, compatible with popular W5500 module
SPI CLK | SPI MOSI | SPI MISO | SPI CS | SPI HOST/SPEED | ETH INT | ETH RST | |
---|---|---|---|---|---|---|---|
ESP32 | 18 | 23 | 19 | 05 | 2/20MHz | 35 | 14 |
In the software section two firmware examples provided.
- esp32-i2s-bare is base I2S implementation based on ESP-IDF implementation directly.
- esp32-i2s-esp8266audio is based on excellent ESP8266Audio library (it works with the whole ESP range, don't get fooled by the name), providing minimum code implementation.
- esp32-i2s-web-radio is based on the same library, providing minimum web-readio stream player. It expects playlist as an input in 'data' folder.
- Squeezelite-ESP32 - see more details below
All samples are provided as Plarformio IDE projects. After installing it, open sample project. Select proper environment based on your dock. Run Build
and Upload
commands to install necessary tools and libraries, build and upload prject to the board. Communication and proper upload method selection will be handled by IDE automatically.
Follow the ESP8266Audio library guide. Default settings will work out of the box with ESP8266 and ESP32 boards. For ESP32C3 and ESP32S2 board please adjust pinout according to the above section
Squeezelite-ESP32 is a multimedia software suite, that started as renderer (or player) of LMS (Logitech Media Server). Now it is extended with
- Spotify over-the-air player using SpotifyConnect (thanks to cspot)
- AirPlay controller (iPhone, iTunes ...) and enjoy synchronization multiroom as well (although it's AirPlay 1 only)
- Traditional Bluetooth device (iPhone, Android)
And LMS itself
- Streams your local music and connect to all major on-line music providers (Spotify, Deezer, Tidal, Qobuz) using Logitech Media Server - a.k.a LMS with multi-room audio synchronization.
- LMS can be extended by numerous plugins and can be controlled using a Web browser or dedicated applications (iPhone, Android).
- It can also send audio to UPnP, Sonos, ChromeCast and AirPlay speakers/devices.
All ESP32 based boards are tested with Squeezelite-ESP32 software, that can be flashed using nothing but web-browser. You can use Squeezelite-ESP32 installer for that purpose.
Use Squeezelite-ESP32 installer to flash firmware first.
Use Generic/I2S profile |
|
Connect device to USB port and select if from the list | |
Press Flash and wait around 2 minutes |
|
(Optional) You may enter serial console to get more information | |
Device is in recovery mode. Connect to squeezelite-299fac wifi network with squeezelite password (your network name suffix will be different) |
|
When redirected to captive portal let device scan wifi network and provide valid credentials | |
You can use provided IP address (http://192.168.1.99/ on the screenshot) to access settings page | |
ESP Audio Duo, HiFi-ESP Navigate to Hardware section and provide following updates in the DAC Options DAC model: I2S Clock GPIO: 26 Word Select GPIO: 25 Data GPIO: 22 Press Save button |
|
Louder ESP Navigate to NVS Editor section and provide following updates dac_config: model=I2S,bck=26,ws=25,do=22,sda=21,scl=27,i2c=45 (STEREO, BTL mode) dac_controlset: {"init":[{"reg":3,"val":2},{"reg":3,"val":3}],"poweron":[{"reg":3,"val":3}],"poweroff":[{"reg":3,"val":0}]} (MONO, PBTL mode) dac_controlset: {"init":[{"reg":3,"val":2},{"reg":3,"val":3},{"reg":2,"val":4}],"poweron":[{"reg":3,"val":3}],"poweroff":[{"reg":3,"val":0}]} i2c_config: scl=27,sda=21,speed=400000,port=1 set_GPIO: 33=vcc Press Commit button |
|
Louder ESP, Rev E Update Ethernet configuration, if you're planning to use Ethernet module eth_config: model=w5500,cs=5,speed=20000000,intr=35,rst=14 spi_config: mosi=23,clk=18,host=2,miso=19 Press Commit button |
|
(Optional) You may change device names to something close to you heart | |
Exit recovery |
You can use it now
Bluetooth | Spotify Connect | AirPlay | LMS Renderer |
---|---|---|---|
SnapCast is an openSource Multi-Room-Audio Protocol. Which is mainly developed by https://github.com/badaix. In comparision to the SqueezeLite-Solution it offers a much better syncing experience. I tested the sync and for me it was not hearable that the speakes arent wired together. Due the hard work of the Music-Assistant Developers its quite easy to use this.
What will I need to get all stuff running?
- HomeAssistant Installation with the capabilities to run Addons
- A PC (preffered Linux or macOS but windows should also work)
- SnapCast-Server (e.g an Raspberry Pi, doesnt need to be an Pi4) or a Proxmox VM in the coming months the SnapCast Server will be available as an Addon for HomeAssistant which makes this again a lot easier.
What are we doing now?
- Install the Music-Assistant Addon
- Install a SnapCast-Server
- Configure Music-Assistant to use the SnapCast-Server as an Player
- Install the Development-Tools for building the Code for the ESP32
- Changing the Settings to your needs (WiFi-Password, Player-Name etc.)
Note: The Addon is released as an BETA which means that Bugs are possible and changes are possible. The developers of MusicAssistant created already a detailed installation instructions. To summarise it:
- Install HACS: https://hacs.xyz/docs/setup/prerequisites
- Install the Integration
- Install the Addon. For more details please read here: https://github.com/music-assistant/hass-music-assistant#installation-of-the-home-assistant-beta-integration
Please visit hardware section for board schematics and PCB designs. Note that PCB are shared as multi-layer PDFs.
Image | Legend |
---|---|
MAX98357 DAC Speaker Terminal |
Image | Legend |
---|---|
MAX98357 DAC Speaker Terminals 8MB PSRAM IC |
Image | Legend |
---|---|
PCM5100A DAC Speaker Terminals 8MB PSRAM IC Ultra-Low noise LDO 3V3 Voltage regulator |
Image | Legend |
---|---|
TAS5805M DAC Speaker Terminals 8MB PSRAM IC 3V3 Drop-Down voltage regulator (powers ESP32) Input Voltage terminal |
|
(REV B, C, D) | TAS5805M DAC Speaker Terminals - 8MB PSRAM IC (Hidden under ESP32 module) - 3V3 Drop-Down voltage regulator (powers ESP32, hidden under ESP32 module) Input Voltage terminal |
Image | Legend |
---|---|
Optional Ethernet header is exposed on the bottom side of the PCB | |
Use popular W5500 based module as displayed on the picture |
TAS5805M DAC Allows 2 modes of operation.
BTL | PBTL | |
---|---|---|
Descriotion | Bridge Tied Load, Stereo | Parallel Bridge Tied Load, Stereo |
Rated Power | 2×23W (8-Ω, 21 V, THD+N=1%) | 45W (4-Ω, 21 V, THD+N=1%) |
Schematics | ||
Speaker Connection |
Starting from Rev E, additonal header is exposed to allow datasheet-speced connectivity
Image | Legend |
---|---|
Stereo Mode - leave open | |
Mono (PBTL) Mode, close horisontally |
Barrel jack used is speced at 6mm hole/2mm pin, which is typically 5.5/2.5mm jack on the male side.
Screw-terminal is connected parallel to the barrel-jack, you can use either interchangeably.
The power adapter specs depend on the speaker you're planning to use. DAC efficiency is close to 100%, so just take the power rating of your speaker (say 2x10w), impedance (say 8 ohm) and you'd need at least 9 volts rated at 1.2 amps per channel, round up to 3 total amps.
It is not recommended to go beyond voltage your speakers can take, otherwise amp will blow you speakers in no time.
You may support my work by ordering these product at Tindie