esphome / esphome/feature-requests

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

Open
#2,859 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**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)](https://en.wikipedia.org/wiki/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)](https://en.wikipedia.org/wiki/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?

* https://esphome.io/components/speaker/i2s_audio
* https://esphome.io/components/media_player/i2s_audio

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

* TAS5805M (TAS5805MPWP/TAS5805MPWPR) DAC
* https://github.com/esphome/feature-requests/issues/2666
* ES8388
* https://github.com/esphome/esphome/pull/6956
* Also used on in the [Raspiaudio Muse Luxe (ESP MUSE)](https://raspiaudio.com/muse/) and the [Raspiaudio Radio](https://raspiaudio.com/raspiaudio/).
* MAX9744
* https://www.analog.com/en/products/max9744.html
* Also used on Adafruit's [Stereo 20W Class D Audio Amplifier](https://www.adafruit.com/product/1752) development board.
* MAX98357
* https://www.analog.com/en/products/max98357a.html
* DS4420
* https://www.analog.com/en/products/ds4420.html
* ES9038Q2M
* https://www.esstech.com/wp-content/uploads/2021/03/ES9038Q2M-Datasheet-v1.4.pdf

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

* https://www.analog.com/en/product-category/programmable-gain-amplifiers.html#products-in-category
* https://www.ti.com/amplifier-circuit/pga-vga/overview.html
* https://www.esstech.com/products-overview/digital-to-analog-converters/sabre-audiophile-dacs/

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:

* https://github.com/esphome/feature-requests/issues/1813
* https://github.com/esphome/feature-requests/issues/1751
* https://github.com/esphome/esphome/pull/6956
* https://github.com/esphome/feature-requests/issues/2619
* https://github.com/esphome/feature-requests/issues/2666
* https://github.com/HA-TB303/ESPHome-Louder-ESP32
* https://github.com/sonocotta/esp32-tas5805m-dac/
* https://www.espthings.io/louder-esp32
* https://www.youtube.com/shorts/yzx_xf33BAk
* https://github.com/esphome/feature-requests/issues/1750
* https://github.com/esphome/feature-requests/issues/1864
* https://github.com/esphome/esphome/pull/6062
* https://github.com/esphome/feature-requests/issues/2574
* https://github.com/esphome/feature-requests/issues/1874
* https://github.com/esphome/feature-requests/issues/1898
* https://github.com/esphome/feature-requests/issues/1875
* https://github.com/krzychb/dac-cosine
* https://github.com/esphome/feature-requests/issues/2125
* https://github.com/esphome/esphome/pull/5515
* https://github.com/esphome/esphome/pull/6062

**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:

* https://github.com/esphome/feature-requests/issues/2619

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

* https://github.com/esphome/esphome/pull/7137 (currently being worked on by @nielsnl68)
* https://github.com/esphome/esphome/pull/7183 (currently being worked on by @nielsnl68)
* https://github.com/esphome/esphome/pull/7306 (currently being worked on by @pyos)

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/

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the speaker/i2s_audio and media_player/i2s_audio configurations, then compare related work in PRs 6956, 7137, 7183, and 7306. The scope still needs agreement on a standard for I2C-controlled PGA volume and volume readback across voice assistant and media player audio.

Written by the indexing model from the issue text.

Assessment

Domain
audio-video-rtc, embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.