TTS + MPD no sound


I’ve a working configuration of MPD and able to produce sound via HA scripts using playlists. Now I am trying to add TTS component, so added following code:

In the configuration.yaml:

  - platform: google_translate
    cache: true
    cache_dir: /tmp/tts
    time_memory: 300
    service_name: google_say

In scripts.yaml:

  alias: speech_testing
  - service: tts.google_say
      entity_id: media_player.mpd
      message: Testing 1 2 3
      cache: true
      language: en_US
  mode: single

After restarting, the script executes but there is no sound output, please advise if I did something wrong with the configuration above?

I have been fighting the same problem for a few days and I have come to the following result on my Raspi.

You need to use a dmix audio device to enable sound mixing from different sources.
Generally a audio device will have permissions set to 0660, which means a multiple sessions from the same user can use the device simultanious.
If your users are not the same, then you need to set the permissions in the asound.conf file, which is found in /etc on a raspi.
You need to set ipc_perm 0666 for the dmix device or the slave device mention in the dmix device. You insert the line just below the other ipc_ lines.

Thanks for input, I will try it out.

One question - are you running HA instance with SSL (self-signed) or plain http?

currently just plain http, but that should not have an effect on this.

I am having a similar problem, which is probably I don’t understand how to set this up.
I am running Home Assistant Core = 2021.12.7, Home Assistant OS 7.1. I have set up tts and MPD as follows.

    platform: mpd
    host: 192.168.1.xx # the IP for the raspberry pi running HA and from which I am trying to output sound on the 3.5mm audio port
    scan_interval: 1
# Text to speech
    platform: google_translate
    base_url: https://xxxx.duckdns:8123
    service_name: google_say

When I call the google tts.google_say service (with media_player.mpd as the Entity), I receive the appropriate .mp3 file, but it does not appear to be played by mpd.

I have tried the following to test the mpd install. I have located the media folder on the pi sd card and can see a subfolder mpd with mpd\media and mpd\playlists and have loaded a few music mp3 files. If I use the UI from the MPD Add-on in the supervisor, I can select to play the music files I have loaded and it plays correctly from the pi. When I use tts, I get an mp3 added to the queue that does not have any sound. Additionally, If I try to play the google file, it doesn’t make any sound. HOWEVER, if I go to Media Browser (in the HA web page), I can play both the music files and the google files (but they play via the web browser on the device running the browser).

So I think I have tts communicating a valid file back to me, MPD set up capable of playing audio on the pi, and the tts file being queued on MPD, but either not playing or not being valid for processing by MPD.

Any ideas of what I have done wrong??