Required a step-by-step guide on how to play sounds and media through a 3.5mm audio jack

Hi Eddy, welcome to the forum!

I wasn’t able to get VLC working (pretty new to this all myself) but I was able to get sounds playing reliably through the path outlined here (Owlz84’s media player) - more for alerts etc than as a media player, so depending on what you are trying to do may or may not suit your use case: Shell_command to play local sounds

I 've tried with both official VLC addon and the one from Rodrifp (https://github.com/rodripf/hassio-local-vlc). Maybee it’s the same thing ?
Same behaviour: no sound at all.
HA and addon Logs are clean, not a single error. I’m able to telnet to vlc on port 4212 but don’t know how to test vlc with telnet command line.
Sound on rasp is working : paplay in terminal plays wav files. But nothing from HA et no error in logs…
i’ve copied the same audio files to 3 folders (being not sure of the right one…): share, media and config/www (aka \local in ha …?).
Problem has already been posted on github by someone else (rodripf version).

Thanks :wink:
Eddy

Hi gasbrake. it’s for alerting, not for music. i’ll check that tonight, keep you posted. thanks.

As paplay and aplay work fine in Terminal with little wav audio files (i mean in ssh&webterm addon), i’m actually trying to have “shell_command” been passed (paplay/aplay commands) from home assistant to SSH&Webterminal addon via script as documented by frenck in his addon documentation:
http://homeassistant.local:8123/hassio/addon/a0d7b954_ssh/documentation
When i’ll got it working, i’ll come back to post :wink:
Eddy
*************** UPDATE ****************
Got it working ! ! !
Example in automation:

action:

  • service: hassio.addon_stdin
    data:
    addon: a0d7b954_ssh
    input: paplay /share/captcha.wav

i copied the wave files in /share with samba share addon.

1 Like

You can do TTS with VLC-telnet, TTS would be done Google as an example and the resulting audio goes to VLC
configuration.yaml

tts:
  - platform: google_translate
    cache: false
    service_name: google_say

media_player:
  - platform: vlc_telnet
    name: <whatever name you like>

    host: <put IP address or host name here>
    password: <secret>
    port: <VLC port>

in automation.yaml

  - service: tts.google_say
    data:
      language: en
      message: "Text you need spoken"
      entity_id: media_player.<whatever name above>

i just tried with “local vlc” add-on because in this one, i can configure the password (same as the one in configuration for vlc-telnet): does not work. Thanks.

Logfile of my local vlc add-on:
[b6cc9bd0] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[b6cc9bd0] main interface error: no suitable interface module
[b6e6df00] main libvlc error: interface “dbus,none” initialization failed
[b6cc9e10] main interface error: no suitable interface module
[b6e6df00] main libvlc error: interface “globalhotkeys,none” initialization failed
[b6cdee80] main playlist: playlist is empty
[b6cc9c90] [telnet] lua interface: Listening on host “telnet://:4212”.
[b26c4510] [http] lua interface: Lua HTTP interface

If you are using the official VLC addon, where do you set the addon password (VLC) ?
thanks
Eddy

In the addon settings tab, go to supervisor->vlc->settings

No, there is not in the official VLC add-on. i think that maybe there is a bug in the new version of official VLC addon: if you already had a password, it’s probably still there BUT if you install the new version for the first time: nowhere a place to set the password.
In the non-official VLC addon: “LOCAL VLC” repository, the place for the password is there, where you told me it should be :slight_smile:
So there is something weird with latest versions of official VLC addon.
thanks,
Eddy
PS: Are you using the official VLC addon or the “local VLC” (old one) ?
I posted in my google drive a few screenshots:

I am not using the add on any more

I created the add-on Notifier that allows you to send notifications to a speaker connected directly to the Raspberry via 3.5mm jack, for each notification the audio volume (in percentage) and the name of the audio file (.wav or .mp3) are established. It is also possible to send TTS messages using Pico TTS.
I’ve made adding notifications as simple as possible: no “integrations” into configuration.yaml are needed, just add automations. The addon can be found in the repository GitHub - guido-syseng/Hassio-Addons

Thanks Guido. I’ll give it a try soon. Actually, my HA plays small wave files with paplay command and it works really fine except tts that needs a media player integration.

Notifier is an add-on for Hass.io based on Sox, for features and possibilities:
Hassio-Addons/README.md at 896096c7c2d19b8cee6b1a252e0294fa06e08865 · guido-syseng/Hassio-Addons · GitHub
for documentation:
Hassio-Addons/DOCS.md at 896096c7c2d19b8cee6b1a252e0294fa06e08865 · guido-syseng/Hassio-Addons · GitHub
I am available to answer any questions

3 Likes

I did follow the instructions but no way, i was not able to get it to work :frowning:
picotts installed and running, config/www/ contains only one wav file for testing but i only need TTS
Any idea ?
Thanks
Eddy



image
configuration.yaml contains:
image
I also tried tons of conbinations for the subdir but not sure the problem is there.

Starting with the very comprehensive documentation you posted:
from the log it seems that everything went well (no error message after the test) and that the test was carried out regularly
Most likely the problem is in the output:

  1. the speaker connected to the Raspberry AUX OUT has too low impedance
  2. the jack is not of the 3-way type
  3. the connection cable is faulty
  • I recommend trying to insert earphones into the AUX OUT of the Raspberry, then restart the add-on, to do a final test
  • Alternatively, with the speaker turned on, put a music.wav file in the /media directory and give from the SSH & Terminal add-on
    the command aplay /media/music.wav to see if the speaker is suitable.

Additional non-essential clarifications:
The subdirectory is to be set only if needed and is in addition, in case you refer me it is to be removed, if you put the files in config/www you leave it empty.
For example, if I write “audio”, the files are in config/www/audio.
In configuration.yaml
-tts: platform: picotts
is superfluous, the message is sent directly to the standard port 59126 of the picotts add-on.
The proof by marking music_test and tts_test is self contained in the add-on and starts at startup (a piece of piano music of about 10 seconds and the phrase Pico tts demo + hour + minutes).
By checking debug you get verbose messages, useful for problem determination, but in our case it seems that everything is going well.

Let me know the results of the tests, I remain available for further information

Thank you for creating this. I managed to add the store using “GitHub - guido-syseng/Hassio-Addons

The only Issue I have is that when I actually want to install the addon it tells me “all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial unix:///var/run/docker/containerd/containerd.sock: timeout”: unavailable”

Did you delete files from the docker?

  1. I have not changed the guido-syseng/Hassio-Addons library in any way for several days
  2. Main features of my installation (from Supervisor → Info):
System Health
version: core-2021.5.5
installation_type: Home Assistant OS
host_os: Home Assistant OS 5.13
update_channel: stable
supervisor_version: supervisor-2021.04.3
docker_version: 19.03.15
  1. As a test I just uninstalled and reinstalled the Add-on Notifier from the GitHub libraries and it works perfectly.

Are you using Hass.OS and is it updated to the latest version?

Hi Guido, thank you for your help.
Audio output was working really fine from the beginning, the following test automation plays the captach.wav file perfectly on the amplified speaker connected. But TTS is not working at all :upside_down_face: :upside_down_face: :upside_down_face:
This automation is triggered when i press an “unused” button on an old chacon rf433 remote (with rflink).
aplay and paplay, both commands are working fine. I don’t know wich one is better ? If someone knows… thanks :wink:

image

And i found also an interresting thing: adding an “&” at the end of the command launch the command in background… Processing does NOT wait the end of command execution (sound file playing in this case).
Here below, an example with 2 wav files playing almost simultaneously :slight_smile:
image

Only now I have seen your answer and the action you set to make TTS work.
It seems to me that you will have to replace
addon: 3ebf62bd-notifier
with
addon: 3ebf62bd_notifier
Let me know the result

Hi Guido. You got it :slight_smile: Now, it works.
Thank you
Eddy