esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
420 stars 26 forks source link

Support for MAX4908-MAX4932 analog audio switcher chips in media_player #1750

Open nagyrobi opened 2 years ago

nagyrobi commented 2 years ago

Describe the problem you have/What new integration you would like With the new media player functionality added to ESPHome, next thing to think about is how to handle multiple, external (auxiliary) audio sources. This is where audio switches like MAX4908-MAX4932 come into the picture: kép

kép

These ICs add multiple selectable audio input sources to the media player.

Please describe your use case for this integration and alternatives you've tried: Use case is for when you have sound coming out from the TV (directly or via an SPDIF-to-Analog converter), or from the PC soundcard/whatever to your living room speakers, and you'd like to integrate them with ESPHome to also play TTS from HA or webradio streams.

In the example schematic above, ESP audio output could be connected to X0 and Y0, while X/Y1 and 2 could be other external sources like television or computer. With proper configuration these sources could be added to Home Assistant media player as available selections.

media_player:
  - platform: i2s_audio
    name: ESP32 Media Player
    dac_type: external
    i2s_ws_pin: 26
    i2s_dout_pin: 25
    i2s_bclk_pin: 27
  - source_selector: max49xx
    cb1_pin: 4
    cb2_pin: 5
    source_xy0: "ESPHome"
    source_xy1: "Television"
    source_xy2: "Computer"

kép

Additional context Related to https://github.com/esphome/esphome/pull/3487 There are of course many other similar manufacturers of signal switchers, but the principle is mostly the same.

nagyrobi commented 2 years ago

Use case: https://forum.raspiaudio.com/t/suggestion-for-espmuse-multiple-analog-inputs/401