Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Hedda opened this issue Aug 21, 2024 · 4 comments

Comments

@Hedda
Copy link

Hedda commented Aug 21, 2024

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:

#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
Copy link
Author

Hedda commented Aug 27, 2024

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
Copy link
Author

Hedda commented Sep 11, 2024

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:

and

@Hedda
Copy link
Author

Hedda commented Oct 18, 2024

FYI, just last night they moved the new audio decoder and resampling libraries from that experimental repository into their own separate repo that can be found here:

They also changed it in the experimental voice-kit repo so it outputs audio to a speaker component instead of directly writing to the I2S bus, (which in turn requires the merged changes in esphome/esphome#7605) so make sure that you do not miss that important change:

And the matching pull request to implement use of that in the "Home Assistant Voice PE" ("home-assistant-voice-pe") fork repo:

Also used as proof-of-concept in the nabu component in the kahrendt-i2s-audio-approach branch of home-assistant-voice-pe:

Suspect that they may potentially also make more refactoring changes that will scramble things around more before merging more from that experimental voice-kit repo into mainline ESPHome.

Hopefully splitting things like that while still keeping repos under the ESPHome originazation on GitHub will make it more readable and get more eyes on it + not as dounting to contribute upstream for mainlining.

@Hedda
Copy link
Author

Hedda commented Dec 25, 2024

FYI, Nabu Casa developers have as part of firmware for the Home Assistant Voice Preview Edition developed a brand new ”nabu” media player and other new audio custom component where most of that code will hopefully be pushed upstream to mainline ESPHome soon, see:

https://github.com/esphome/home-assistant-voice-pe/tree/dev/esphome/components/

And

https://www.home-assistant.io/blog/2024/12/19/voice-preview-edition-the-era-of-open-voice/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant