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

Check the official Addon Store in Supervisor. VLC will be available as a core addon when version 2021.3 of home assistant is released. Or you can join the beta program and test it now.

1 Like

It is truly amazing that there is not a straight forward way to get a noise out of Pi built-in audio. Frustrating and hoping with further experimentation I can find a solution too.

3 Likes

@tom_l looks like the official add on for VLC is available now but it does not have an option to set the password. Am I missing something? configuration entery for vlc telnet errors out if i leave the password blank. any thoughts?

Facing the same problem: Added VLC ADDON and no documentation on how to set a password for it.

For the vlc_telnet (in configuration;yaml), i can set a password and, as i imagine, this one should be the VLC ADDON password…? Am i wrong ?
So, where to setup this VLC ADDON password ? SECRET.yaml ??? And correct syntax if so…?
Thanks in advance to anyone who can help.
Eddy
configuration.yaml
###################################
media_player:

  • platform: vlc
    name: speaker
    ##arguments: “–alsa-audio-device=hw:1,0”
  • platform: vlc_telnet
    name: vlctelnet
    host: 192.168.1.15
    port: 4212
    password: vlctelnet
    ###################################
1 Like

Check the Home Assistant Addon github repository (I don’t have access at the moment) there may be an issue open for this already. If not, open one.

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