Hi all,
After viewing some posts and videos, i want to connect a simple speaker to ESP32 dev board using the
Max98357 DAC amplifier
The configuration builds and setup the esp32 as expected with audio media player device created for the esp
but i cant hear anything i try to play (some sample MP3 files from the internet)
Here is my yaml config, i removed non- relevant stuff
esphome:
name: esp32-speaker
friendly_name: esp32-speaker
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "###"
ota:
- platform: esphome
password: "###"
wifi:
ssid: # !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.0.29
gateway: 192.168.0.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "ESP"
password: "###"
captive_portal:
web_server:
port: 80
i2s_audio:
i2s_lrclk_pin: GPIO21
i2s_bclk_pin: GPIO18
media_player:
- platform: i2s_audio
name: "ESP32 Audio Player"
dac_type: external
i2s_dout_pin: GPIO19
mode: mono
id: media_out
when i try to play the media file via dev tools HA page (see pic)
it seems the device is getting the file but no sound …
log from esp32 console:
|10:58:25|[D]|[media_player:061]|'ESP32 Audio Player' - Setting|
| --- | --- | --- | --- |
|10:58:25|[D]|[media_player:068]|Media URL: https://file-examples.com/storage/fe00d37cde6728af4966ebc/2017/11/file_example_MP3_700KB.mp3|
|10:58:25|[W]|[component:237]|Component i2s_audio.media_player took a long time for an operation (529 ms).|
|10:58:25|[W]|[component:238]|Components should block for at most 30 ms.|
|10:58:26|[W]|[component:237]|Component i2s_audio.media_player took a long time for an operation (486 ms).|
|10:58:26|[W]|[component:238]|Components should block for at most 30 ms.|
when i play same file on my google nest (via same HA dev tools page target is ) it plays ok as expected
I attach a photo of the setup
esp32 runs on 5V USB
5V/GND connect to DAC chip
3 connections from esp32 to DAC as in yaml
GPIO19 → DIN
GPIO18 → LRC
GPIO21 → BCLK
4 ohms speaker connected to speaker temrinal outputs of DAC
the remaining 2 connections (GAIN, SD) on the DAC are left unconnected
any idea what im doing wrong? or what to test maybe electrically on the DAC pins / speaker terminals to know if its working or not?