HA Voice Preview Edition Toslink digital audio output

Using my SPDIF digital audio PR I non-intrusively added a Toslink digital audio port to my Home Assistant Voice Preview Edition via the Grove port. The wiring was super simple – just a Grove connector wire I cut and soldered to an optical Toslink transmitter.

I’m now streaming perfect 48KHz digital audio from Music Assistant to our office’s high-end MSB Technology DAC.

This is the config I’m using:

packages:
  remote_package_shorthand: github://esphome/home-assistant-voice-pe/home-assistant-voice.yaml@dev

esphome:
  name: home-assistant-voice
  friendly_name: Home Assistant Voice
  name_add_mac_suffix: false

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true # Required for hidden AP

external_components:
  - source: github://pr#8065
    components: [ i2s_audio, spdif_audio ]
    refresh: 0s

i2s_audio:
  - id: !remove i2s_output
  - id: i2s_output_spdif

speaker:
  - id: !remove i2s_audio_speaker
  - id: spdif_speaker
    platform: spdif_audio
    i2s_audio_id: i2s_output_spdif
    data_pin: GPIO1 # Grove port SDA pin
    sample_rate: 48000
    timeout: never
    buffer_duration: 80ms
    fill_silence: true
    debug: true

switch:
  - platform: gpio
    pin: GPIO46
    id: grove_port_power
    restore_mode: ALWAYS_ON
    setup_priority: 1001

media_player:
  - id: !extend nabu_media_player
    name: Media Player
    audio_dac: !remove
    volume_increment: !remove
    volume_min: !remove
    volume_max: !remove

You’ll see in this config it’s using two of my PRs to support this. Hopefully this can all get merged in before too long!

Add `id` to the `speaker` component by johnboiles · Pull Request #294 · esphome/home-assistant-voice-pe · GitHub (this one is merged now!)

10 Likes

This is so cool!

I wish HA Voice had that port built in by default, I think it could have opened up a whole new market for them. In combination with music assistant this could actually be a really cost-effective way to create a super high quality audio streaming system.

The only other product that I’m aware of that outputs a digital audio signal is the Wiim Mini, which sells at $90. Would be amazing if the HA Voice could just directly compete with that :slight_smile:

Well the way I read it… 5 bucks in parts and two PRs will do just that.

This is DEFINITELY how I’m connecting it to my Denon AVR.

Sorry for posting on an older thread, but can you tell me where you got that stand for the voice?

That LOOKS like the one Rudd-o made

3d printable

1 Like

Thanks and yes indeed that’s the one I made a few weeks ago. I’m glad the variant with the hole in the back for the GPIO port came in handy for our fellow Voice Assistant enthusiast!

1 Like

Well, there is an integration for Denon/Marantz available. That would make this obsolete, correct? I commented on a bug report in github, because I cannot get it to work with the denon integration. But in theory the above “hack” should not be required. A simple voice command with the Voice PE, to playback song X on a denon /marantz receiver/avr X/Y/Z should suffice.

How would a denon make this obsolete? I use that very denon integration to drive my avr and HEOS… Denon controls denon stuff. Ha controls ha stuff. This allows oj to send digital via hardware. If anything they can work together. So if I sent something to the vpe connected to the denon via hardwire toslink it works just as well.

The HA integration of Music Assistant and Denon would make a fysical link obsolete. There is nothing more you can do through the toslink that one could do through these various integrations.

Interesting to see though you do not have problems combinging those, I guess since you use HEOS, so you do not suffer from;

If I wouldnt suffer from the above, I dont see an additional reason for the toslink connection. I guess as per the TS he does it since its an older receiver without network capabilities. Than it serves an obvious reason.

2 Likes

Ahh I understand you’re talking music only…

You’re missing the voice assistant audio use case. Assist.start_conversation. Announce etc.

You can’t start a conversation on a denon avr With Music Assistant (check out Friday’s Party I literally said I’m not making a music tool use MA. The Fes scripts are great.) that’s assist device only. So you need that audio to go somewhere.

Im literally using mine on my denon AVR right now. It’s WAY easier to toslink or however you’re connected and do an quick audio switch than try to figure out how to cast the onboard audio from the vpe. For that I prefer toslink to the squealing ground loopy 3.5mm

They work together they don’t supplant each other.

The disadvantage of using the voice preview connected to your Marantz or Denon receiver that way is that you need to keep your stereo running all the time, which consumes power and can shorten the lifespan of your receiver.

Now, I used to have my own Marantz receiver on all the time (for over five years), until I noticed that receiver plus speakers used to consume about 70 watts idle. I realized that it was probably not good idea. Yet my receiver is fine.

I agree that the voice preview could use better sound quality speakers. I’m not so sure that I want to keep it at all times connected to my receiver such that the voice preview is always selected as the active source in the receiver. What if I want to watch a TV show or play some Xbox? Then I cannot get any voice output from my voice preview edition because it’s obviously no longer outputting through its internal speaker because it is connected to the receiver.

My kit is on all occupied hours. Not using it meant an additional set of speakers. You pair it with an intelligent autoswitcher that only flips that input when the vpe is active. Works fine

I don’t know what receiver you are using, but in my Marantz preprocessor, it takes up to 3 seconds for any newly selected audio input to actually begin producing audio. And there’s an audible pop when switching between some sources. So an auto-switcher is just not practical for me, it would never work.

If my VP made a short announcement through the system and I were to use this autoswitcher thing that you suggest (which is certainly feasible), I would miss the entirety of the announcement.

And not to mention how annoying it would be if it switched to the VPE while I was watching television or gaming, which meant that my TV show / game would be interrupted just to hear an announcement. In a team game that would almost certainly be cause for me getting called the N word or the R word by my teammates.

As much as I like nice sounding things, I just can’t afford to reserve a 5.1 system just to interact with a VPE.

Avrs-940H Nope no pops. Most of the time I don’t even know it switched. It’s not reserved for that it’s reserved for my main living room kit which 80% of the time is playing ambient music… And if it’s off I won’t want the vpe bothering me either. Look I get it’s not for yih but it’s the EXACT correct solution for me

We often forget - our chosen way is not the ONLY way to do something. You and I like our VPEs cradled in a well designed base connected tk a high quality audio output…

some people don’t :wink:

BTW the base is still awesome… Looks great i high gloss black.

1 Like