Speaker Audio Media Player in esp32-s3?

Speaker Audio Media Player in esp32-s3?

Has anybody obtained Speaker Audio Media Player operating on something like an esp32-s3 pls?

I’ve had a nightmare with updates breaking my DIY sensible speaker for ages now… in the direction of the tip of final 12 months I re-did it from scratch, brute-forcing what labored and what didnt. Had to choose utilizing the arduino framework and media participant, nothing else would work out.
Over the previous couple of months updates to each esphome and HA core break it in varied methods once more. So I’ve needed to cease operating the most recent variations of each.

A few days in the past, I noticed point out of the (new?) Speaker Audio Media Player, so thought I’d give it a strive. Just a media participant to start with, which I’d use for varied TTS notifications from HA. Then perhaps a voice assistant.
I cant get it to make any noise in any respect, utilizing the instance from https://esphome.io/elements/media_player/speaker#media-player-speaker-play-on-device-media-file-action, and {hardware}/connections which have labored with older variations of HA and esphome.

Other than the fundamental definition of the board, wifi, pins, an LED, I’ve copied/pasted the instance.
Has anybody obtained this instance engaged on something like an esp32-s3?
Or can anybody see what I’m doing unsuitable?

The yaml that isn’t working for me:

substitutions:
  friendly_name: Jarvis2
  host_name: jarvis2

  led_brightness:     25%       # RGB LED brightness for easy on/off
  min_led_brightness: 20%       # Min LED brghtness for results
  max_led_brightness: 40%       # Max LED brghtness for results

  log_level:      DEBUG         # NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE

  static_ip:      192.168.5.36  # Static ID particulars
  static_gateway: 192.168.5.254
  static_subnet:  255.255.255.0
  static_dns:     192.168.5.2

  vol_up_pin:     GPIO12        # Button for Vol+
  vol_down_pin:   GPIO11        # Button for Vol-

  amp_din_pin:    GPIO04        # Amp DIN
  amp_bclk_pin:   GPIO05        # Amp BCLK
  amp_lrc_pin:    GPIO06        # Amp LRC

  rgb_led_pin:    GPIO21        # RGB LED pin, GPIO21 for onboard LED
  no_leds:        "1"           # Number of RGB LEDs, 1 for onboard LED

api:                                    # Enable Home Assistant API.
  encryption:
    key: !secret api_encryption_key

ota:
  platform: esphome # For 2024.6.1+
  password: !secret ota_password

safe_mode: # For 2024.6.1+

esphome:
  title: $host_name
  friendly_name: $friendly_name
  platformio_options:
    board_build.flash_mode: dio
  on_boot:
    - logger.log:
        stage: ERROR
        format: "****Booted"
    - mild.turn_on:
        id: rgb_led
        brightness: $led_brightness
        blue: 0%
        pink: 100%
        inexperienced: 100%

esp32:
  board: esp32-s3-devkitc-1
  flash_size: 4MB
  variant: esp32s3
  framework:
    sort: esp-idf
    model: advisable
psram:
  mode: quad
  velocity: 80MHz

wifi:                                   # WiFi connection particulars. Without area:, defaults to .native. https://esphome.io/elements/wifi.html
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  manual_ip:
    static_ip: $static_ip
    gateway: $static_gateway
    subnet: $static_subnet
    dns1: $static_dns
  power_save_mode: none                 # NONE, LIGHT, HIGH

  ap:                                   # Enable fallback hotspot (captive portal) in case wifi connection fails
    ssid: "${friendly_name} Fallback"
    password: !secret fallback_password
captive_portal:

web_server:
  port: 80
  include_internal: true              # embody inner entities
  native: true                           # Load every little thing domestically somewhat than over the online

sensor:
  - platform: wifi_signal # Reports the WiFi sign power in dB. https://esphome.io/elements/sensor/wifi_signal.html
    title: "WiFi Signal dB"              # Uncomment to point out sign DB in HA
    id: wifi_signal_db
    update_interval: 60s                # Report sign each minute
    entity_category: "diagnostic"
    device_class: "signal_strength"
    disabled_by_default: true           # Shows entity in HA, however disabled by default
    inner: true
  - platform: copy                      # Reports the WiFi sign power %
    source_id: wifi_signal_db
    title: "WiFi Signal"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "%"
    entity_category: "diagnostic"
    device_class: "signal_strength"
    disabled_by_default: true           # Shows entity in HA, however disabled by default
  - platform: uptime
    id: uptime_seconds
    # update_interval: 10s
    inner: true                    # Uncomment to go away inner and never ship to HA
    title: "Uptime seconds"
    entity_category: "diagnostic"
    disabled_by_default: true           # Shows entity in HA, however disabled by default

button:
  - platform: restart
    id: "restart_device"
    title: "Restart"
    entity_category: "diagnostic"
  - platform: safe_mode
    id: "restart_device_safe_mode"
    title: "Restart (Safe Mode)"
    entity_category: "diagnostic"
    disabled_by_default: true           # Shows entity in HA, however disabled by default
  - platform: factory_reset
    title: Restart with Factory Default Settings
    disabled_by_default: true
    entity_category: diagnostic
  - platform: shutdown
    title: "Shutdown"
    disabled_by_default: true
    entity_category: diagnostic

debug:
  update_interval: 5s

text_sensor:
  # Expose WiFi info as sensors.
  - platform: wifi_info
    ip_address:
      title: Wi-Fi IP
      icon: mdi:wifi
    mac_address:
      title: Wi-Fi MAC
      icon: mdi:wifi
  - platform: model
    title: "ESPHome Version"
    icon: mdi:wrench-outline
    disabled_by_default: true
  - platform: debug
    machine:
      title: "Device Info"
    reset_reason:
      title: "Reset Reason"

# Sync time with Home Assistant
time:
  - platform: homeassistant
    id: ha_time

logger:                                 # Enable logging. https://esphome.io/elements/logger.html
  stage: $log_level
  baud_rate: 0                          # Stops logging over onboard UART

binary_sensor:
  - platform: standing
    title: "API Status"
  - platform: gpio
    pin:
      quantity: $vol_up_pin
      mode:
        enter: true
        pullup: true
    title: "Vol+"
    filters:
      - invert:
    inner: true
    on_press:
      - media_player.volume_up
      - mild.turn_on:
          id: rgb_led
          brightness: $led_brightness
          blue: 100%
          pink: 100%
          inexperienced: 0%
  - platform: gpio
    pin:
      quantity: $vol_down_pin
      mode:
        enter: true
        pullup: true
    title: "Vol-"
    filters:
      - invert:
    inner: true
    on_press:
      - media_player.volume_down
      - mild.turn_on:
          id: rgb_led
          brightness: $led_brightness
          blue: 100%
          pink: 100%
          inexperienced: 0%

mild:
  - platform: esp32_rmt_led_strip
    id: "rgb_led"
    title: "RGB LED"
    pin: $rgb_led_pin
    num_leds: 1
    # rmt_channel: 0
    rgb_order: GRB
    chipset: ws2812
    default_transition_length: 0ms
    results:
      - pulse:
          title: "Fast Pulse"
          transition_length: 0.5s
          update_interval: 0.5s
          min_brightness: $min_led_brightness
          max_brightness: $max_led_brightness
      - pulse:
          title: "Slow Pulse"
          # transition_length: 1s       # defaults to 1s
          update_interval: 2s
          min_brightness: $min_led_brightness
          max_brightness: $max_led_brightness
      - pulse:
          title: "Breathe"
          transition_length:
            on_length: 1s
            off_length: 500ms
          update_interval: 1.5s
          min_brightness: $min_led_brightness
          max_brightness: $led_brightness
      - random:
          title: Random
      - random:
          title: Random, customized timing
          transition_length: 500ms
          update_interval: 2s
      - strobe:
      - strobe:
          title: Strobe Effect, RGBW
          colours:
            - state: true
              brightness: $led_brightness
              pink: 100%
              inexperienced: 0%
              blue: 0%
              length: 1000ms
            - state: true
              brightness: $led_brightness
              pink: 0%
              inexperienced: 100%
              blue: 0%
              length: 1000ms
            - state: true
              brightness: $led_brightness
              pink: 0%
              inexperienced: 0%
              blue: 100%
              length: 1000ms
            - state: true
              brightness: $led_brightness
              pink: 100%
              inexperienced: 100%
              blue: 100%
              length: 1000ms
      - flicker:
      - flicker:
          title: Flicker Effect With Custom Values
          alpha: 95%
          depth: 1.5%
      - lambda:
          title: Lambda
          update_interval: 1s
          lambda: |-
            static int state = 0;
            auto name = id(rgb_led).turn_on();
            // Transition of 1000ms = 1s
            name.set_transition_length(1000);
            if (state == 0) {
              name.set_rgb(1.0, 1.0, 1.0);
            } else if (state == 1) {
              name.set_rgb(1.0, 0.0, 1.0);
            } else if (state == 2) {
              name.set_rgb(0.0, 0.0, 1.0);
            } else {
              name.set_rgb(1.0, 0.0, 0.0);
            }
            name.carry out();
            state += 1;
            if (state == 4)
              state = 0;              
      - addressable_rainbow:
      - addressable_color_wipe:
      - addressable_twinkle:
      - addressable_random_twinkle:

i2s_audio:
    i2s_lrclk_pin: $amp_lrc_pin
    i2s_bclk_pin: $amp_bclk_pin
    # sample_rate: 48000
speaker:
  - platform: i2s_audio
    id: speaker_id
    dac_type: exterior
    i2s_dout_pin: $amp_din_pin
    sample_rate: 48000
  - platform: mixer
    id: mixer_speaker_id
    output_speaker: speaker_id
    source_speakers:
      - id: announcement_spk_mixer_input
      - id: media_spk_mixer_input
  - platform: resampler
    id: media_spk_resampling_input
    output_speaker: media_spk_mixer_input
  - platform: resampler
    id: announcement_spk_resampling_input
    output_speaker: announcement_spk_mixer_input
media_player:
  - platform: speaker
    title: "Speaker Media Player"
    id: speaker_media_player_id
    media_pipeline:
        speaker: media_spk_resampling_input
        num_channels: 2
    announcement_pipeline:
        speaker: announcement_spk_resampling_input
        num_channels: 1
    information:
      - id: alarm_sound
        file: pip.flac # Placed within the yaml listing. Should be encoded with a 48000 Hz pattern fee, mono or stereo audio, and 16 bits per pattern.
swap:
  - platform: template
    title: "Ring Timer"
    id: timer_ringing
    optimistic: true
    restore_mode: ALWAYS_OFF
    on_turn_off:
        # Stop taking part in the alarm
        - media_player.cease:
            announcement: true
        - mixer_speaker.apply_ducking:  # Stop ducking the media stream over 2 seconds
            id: media_spk_mixer_input
            decibel_reduction: 0
            length: 2.0s
    on_turn_on:
        # Duck media audio by 20 decibels immediately
        - mixer_speaker.apply_ducking:
            id: media_spk_mixer_input
            decibel_reduction: 20
            length: 0.0s
        - whereas:
            situation:
                swap.is_on: timer_ringing
            then:
                # Play the alarm sound as an announcement
                - media_player.speaker.play_on_device_media_file:
                    media_file: alarm_sound
                    # announcement: true
                # Wait till the alarm sound begins taking part in
                - wait_until:
                    media_player.is_announcing:
                # Wait till the alarm sound stops taking part in
                - wait_until:
                    not:
                      media_player.is_announcing:

Thanks quite a bit

1 put up – 1 participant

Read full subject

HI-FI News

through Home Assistant Community – Latest matters https://ift.tt/AydhS0l

April 25, 2025 at 11:42AM