esphome / feature-requests

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

Improve audio components by adding standardized configuration of external DAC with integrated PGA (Programmable Gain Amplifier)? #2859

Open Hedda opened 3 weeks ago

Hedda commented 3 weeks ago

Describe the problem you have/What new integration you would like

Please look at adding standardized volume control configuration for external DACs with integrated PGA (Programmable Gain Amplifier).

Specifically, please consider adding a I2S config settings configuration standard for controlling of the digital volume control for DAC (Digital-to-Analog Converter) with integrated PGA (Programmable Gain Amplifier) using I2C commands for setting audio amplification level (i.e. the sound volume) to I2S config settings in ESPHome's the base i2s audio files . As well as also adding ability to get the current volume that has previously been set. Not only volume control for the voice assistant but also for media player when playing music. Guessing that some volume_multiplier functions/features or similar need to be added to both i2s audio speaker and i2s media player as a start?

External DAC with integrated PGA (Programmable Gain Amplifier) like example these Class-D amplifier (a.k.a. digital switching amplifier) hardware examples which ESPHome users already requested that need support for speaker volume control over i2s + i2c:

For more examples of DACs with integrated PGA suggest also check out these pages:

Note! Some of mentioned DACs also offer controls for advanced features such as enable or disable audio inputs/outputs, and more.

FYI, here are more related requests, PRs and projects/use-cases that requested i2s/i2c audio configurations for DAC in ESPHome:

Please describe your use case for this integration and alternatives you've tried:

The alternative to having a decided standard configuration for all is for all new developers to create their own custom configurations.

Additional context

Also see this similar feature request:

Other than that there is by the way these improvements related to i2s audio configuration that are also currently being worked on:

PS: Off-topic; there is btw also a request for USB UAC ( UAC 2.0 / UAC-2 ) USB Host Audio Driver support as well, which XMOS can do:

https://github.com/esphome/feature-requests/issues/2842 https://github.com/esp-arduino-libs/ESP32_USB_Stream/ https://components.espressif.com/components/espressif/usb_host_uac/versions/1.0.0 https://www.xmos.com/software/usb-audio/driver-support/

Hedda commented 2 weeks ago

FYI, looks like @kbx81 might now be experimenting with concept of a audio_dac component and related components here:

Also see related new configuration and media player improvements:

Suspect he + @kahrendt plan more changes related to DACs + media player in the works so it sounds great, pun intended! 😀

Hedda commented 4 days ago

FYI, @gnumpi and + @nielsnl68 a few other independent developers also seem to be working on different custom i2s_audio and adf_pipeline ESPHome audio components that will offer several enhancements that are all directly or indirectly related to ESPHome-based remote voice satellite and/or media player hardware that can be connected to Home Assistant:

(Looks like they are all currently working in his dev-next branch linked above. At least right now his dev-next branch is way ahead of the main branch in that repository at https://github.com/gnumpi/esphome_audio/tree/main so worth following both main branch and the dev-next branch until if and when those get submitted to upstream.).

And on top of that @rwrozelle has started working on laying the groundwork for extending child components of Media Player in ESPHome (and Home Assistant) to allow ESPHome to be built with a much richer set of capabilities in the media_player. See: