After the I2S media player was removed, I tried my luck building a new media player for my bedroom with the old I2S amp module (WeAct I2S Speaker V1, PCM5100A + 2 amps) and an ESP32S3N16R8. All seems to work - I don't see any errors in the log, but there's no sound coming out of it. That new media_player - speaker architecture is a little more complicated than the old I2S media player, so I'd appreciate if somebody could take a look at the config and tell me if I missed anything?
# Board: ESP32-S3 DevKitC-1 (Espressif)
# Definition: definitions/boards/esp32-s3-devkitc-1/manifest.yaml
substitutions:
i2s_lrclk: GPIO09
i2s_bclk: GPIO10
spk: GPIO11
ledpin: GPIO42
psram: octal
volmin: 0.4
volmax: 0.85
flash: 16mb
bufsize: 500000
task: "true"
bufdur: 100ms
esphome:
name: sendspin-bedroom
friendly_name: sendspin-bedroom
esp32:
variant: esp32s3
flash_size: 8MB
framework:
type: esp-idf
version: recommended
sdkconfig_options:
CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB: "y"
CONFIG_SPIRAM_RODATA: "y"
CONFIG_SPIRAM_FETCH_INSTRUCTIONS: "y"
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST: "y"
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY: "y"
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC: "y"
CONFIG_MBEDTLS_SSL_PROTO_TLS1_3: "y"
logger:
api:
encryption:
key: "xxx"
ota:
- platform: esphome
status_led:
pin:
number: ${ledpin}
inverted: False
wifi:
ssid: 'xxx'
password: 'xxx'
psram:
mode: ${psram}
speed: 80MHz
ignore_not_found: false
globals:
- id: current_volume
type: float
initial_value: '0.2'
- id: announcement_triggered
type: bool
initial_value: 'false'
sendspin:
id: sendspin_hub
task_stack_in_psram: ${task}
# kalman_process_error: 0.01
i2s_audio:
- id: i2s_output
i2s_lrclk_pin:
number: ${i2s_lrclk}
i2s_bclk_pin:
number: ${i2s_bclk}
speaker:
- platform: i2s_audio
id: i2s_audio_speaker
sample_rate: 44100
i2s_dout_pin:
number: ${spk}
bits_per_sample: 16bit
dac_type: external
channel: stereo
timeout: never
buffer_duration: ${bufdur}
# Virtual speakers to combine the announcement and media streams together into one output
- platform: mixer
id: mixing_speaker
output_speaker: i2s_audio_speaker
num_channels: 2
# task_stack_in_psram: ${task}
source_speakers:
- id: announcement_mixing_input
timeout: never
- id: media_mixing_input
timeout: never
# Vritual speakers to resample each pipelines' audio, if necessary, as the mixer speaker requires the same sample rate
- platform: resampler
id: announcement_resampling_speaker
output_speaker: announcement_mixing_input
sample_rate: 44100
bits_per_sample: 16
- platform: resampler
id: media_resampling_speaker
output_speaker: media_mixing_input
sample_rate: 44100
bits_per_sample: 16
media_source:
- platform: audio_http
id: http_announcement_source
buffer_size: 250000
- platform: audio_http
id: http_media_source
buffer_size: ${bufsize}
- platform: sendspin
id: sendspin_media_source
media_player:
- platform: sendspin
id: player
name: Group
- platform: speaker_source
id: external_media_player
name: Player
internal: false
volume_increment: 0.05
volume_min: ${volmin}
volume_max: ${volmax}
announcement_pipeline:
format: NONE
num_channels: 1
speaker: announcement_resampling_speaker
sources:
- http_announcement_source
media_pipeline:
format: NONE
num_channels: 2
speaker: media_resampling_speaker
sources:
- http_media_source
- sendspin_media_source
on_state:
if:
condition:
and:
- lambda: return (!id(announcement_triggered));
- not:
media_player.is_announcing: external_media_player
then:
- mixer_speaker.apply_ducking:
id: media_mixing_input
decibel_reduction: 0
duration: 1.0s
switch:
- platform: restart
name: Reboot
id: reboot_media_player_lab_reboot
sensor:
- platform: wifi_signal
name: WiFi
update_interval: 60s
- platform: rotary_encoder
name: "Encoder"
id: encoder
min_value: 0
max_value: 100
resolution: 4
publish_initial_value: True
filters:
debounce: 30ms
pin_a:
number: GPIO15
inverted: true
mode:
input: true
pullup: true
pin_b:
number: GPIO16
inverted: true
mode:
input: true
pullup: true
binary_sensor:
- platform: gpio
filters:
- delayed_on: 30ms
- delayed_off: 30ms
pin:
number: GPIO17
inverted: true
mode:
input: true
pullup: true
name: "Button"
id: button
http_request:
text_sensor:
- platform: sendspin
type: title
name: Track Title
- platform: sendspin
type: artist
name: Artist
- platform: sendspin
type: album
name: Album
