Share my simple ESP32S3 media player, optimized for Music Assistant

Hi all,

I wanted to share my latest project: a DIY network media player built with an ESP32-S3-DevkitC-1 (N16R8) and a PCM5102A DAC.
This is a very simple build which many people have done. But I met some troubles when building it, I hope my notes could help someone who has same issue.


The goal was to create a stabel player that could handle high-bitrate streams within the Music Assistant.

Key Technical Features:

  • Buffer Optimization: Utilizes media buffers and optimized sdkconfig to leverage 8-line Octal PSRAM.
  • Dual-Pipeline Support: Handles both music from MA (via Sendspin) and HA announcements simultaneously.
  • Verified Hardware: Includes 3D printable enclosures and a full soldering guide.
  • Jack Detection: Uses the pin of Jack to detect whether jack in plugged and switch between deep sleep mode.
  • ESPHome Based: Easy to customize and integrate into your existing dashboard.

I’ve published the full documentation, including a deep dive into my debugging process and various coding strategies (Standard vs. Sendspin vs. Hybrid).

GitHub Repo: [Link to GitHub Repository]

Thanks to community and especially to Arh for their great help to me!

thanks for help, I have used PCM5102 board like yours and didn’t have any sound but with your instructions now it works!
Only thing is that I have a super mini S3 board which have 2Mb PSRAM but it works ok with FLAC.


Found a BT emitter, now I am thinking of doing a V2 of this, adding this BT emitter so that can also connect to BT speaker or earphone.

Many thanks for the detailed write-up. I successfully used elements of your ha-simple-media-player.yaml with a new ESP32-S3N16R8 and a PCM5102A board to build a media player to enable streaming to an amp with out-of-date network functions.

A couple of notes:

  • when compiling using the esp-idf framework, the platformio_options are now ignored so can be removed from the code.
  • with additional board types available, the generic board type esp32-s3-devkitc-1 can be replaced with esp32-s3-devkitc1-n16r8…you can probably do away with many of the the sdk config options (and PSRAM config?) although I’ve not checked all parameters.

For others building this: if you have no errors in HA/MA and still have no audio output, try using different GPIOs. After many hours of troubleshooting I eventually found that the GPIOs 15-17 used in the provided code won’t work on my board! No errors or warnings in the logs and everything looks to be working but there’s no audio out. Still to troubleshoot further but other GPIOs work fine, I eventually used GPIO11-13 and am very happy with the audio output quality.

by the way, how does it work with Music Assitant with the sendspin media player?
I recently always get “Lost sync” error.

[16:18:17.306][D][esp-idf:000][Sendspin]: W (588376) sendspin.sync_task: Lost sync (99304us off), reporting error
[16:18:17.307][D][esp-idf:000][Sendspin]: I (588378) sendspin.sync_task: Regained sync, reporting synchronized
[16:18:18.627][D][esp-idf:000][Sendspin]: W (589698) sendspin.sync_task: Lost sync (91798us off), reporting error
[16:18:18.632][D][esp-idf:000][Sendspin]: I (589700) sendspin.sync_task: Regained sync, reporting synchronized
[16:18:19.656][D][esp-idf:000][Sendspin]: W (590720) sendspin.sync_task: Lost sync (33181us off), reporting error
[16:18:19.657][D][esp-idf:000][Sendspin]: I (590721) sendspin.sync_task: Regained sync, reporting synchronized

Did anyone see the same issue?