The command is this:
ExecStart=/usr/bin/vlc --aout=alsa --role=notification -I telnet --telnet-port=4213 --telnet-password=VerySecurePassword --no-video --no-osd --no-one-instance -v
When running this interactively from the command line, the HA instance connects and functions exactly as intended. When running as a service, there is no audio output. Here is the units file:
Code: Select all
[Unit]
Description=VLC Media Player - Telnet Service
After=network.target
[Service]
Environment=DISPLAY=:0
Environment="PULSE_SERVER=127.0.0.1"
ExecStart=/usr/bin/vlc --aout=alsa --role=notification -I telnet --telnet-port=4213 --telnet-password=VerySecurePassword --no-video --no-osd --no-one-instance -v
Restart=on-failure
User=sparkyvision
[Install]
WantedBy=multi-user.target
journalctl outputs this:
Code: Select all
Mar 27 20:12:23 ha-media vlc[76337]: [000060806c99a900] main audio output error: module not functional
Mar 27 20:12:23 ha-media vlc[76337]: [00007af1c836bab0] main decoder error: failed to create audio output
Mar 27 20:12:23 ha-media vlc[76337]: [000060806c99a900] alsa audio output error: cannot open ALSA device "default": Host is down
Mar 27 20:12:23 ha-media vlc[76337]: [000060806c99a900] main audio output error: Audio output failed
Mar 27 20:12:23 ha-media vlc[76337]: [000060806c99a900] main audio output error: The audio device "default" could not be used:
Mar 27 20:12:23 ha-media vlc[76337]: Host is down.
Over and over and over again, until HA stops trying to play the file. The second I hit play, this gets output to the console.
Switching to PulseAudio gives the same result; connection happens without an issue when run interactively, but it will not work as a systemd unit. Also tried: aout=pipewire.
Code: Select all
vlcpulse audio output error: PulseAudio server connection failure: Connection refused
aplay -L gives the following:
Code: Select all
sparkyvision@ha-media:/etc/systemd/system$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
pipewire
PipeWire Sound Server
default
Default ALSA Output (currently PipeWire Media Server)
hw:CARD=HDMI,DEV=3
HDA Intel HDMI, HDMI 0
Direct hardware device without any conversions
hw:CARD=HDMI,DEV=7
HDA Intel HDMI, HDMI 1
Direct hardware device without any conversions
hw:CARD=HDMI,DEV=8
HDA Intel HDMI, HDMI 2
Direct hardware device without any conversions
plughw:CARD=HDMI,DEV=3
HDA Intel HDMI, HDMI 0
Hardware device with all software conversions
plughw:CARD=HDMI,DEV=7
HDA Intel HDMI, HDMI 1
Hardware device with all software conversions
plughw:CARD=HDMI,DEV=8
HDA Intel HDMI, HDMI 2
Hardware device with all software conversions
hdmi:CARD=HDMI,DEV=0
HDA Intel HDMI, HDMI 0
HDMI Audio Output
hdmi:CARD=HDMI,DEV=1
HDA Intel HDMI, HDMI 1
HDMI Audio Output
hdmi:CARD=HDMI,DEV=2
HDA Intel HDMI, HDMI 2
HDMI Audio Output
dmix:CARD=HDMI,DEV=3
HDA Intel HDMI, HDMI 0
Direct sample mixing device
dmix:CARD=HDMI,DEV=7
HDA Intel HDMI, HDMI 1
Direct sample mixing device
dmix:CARD=HDMI,DEV=8
HDA Intel HDMI, HDMI 2
Direct sample mixing device
hw:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
Direct hardware device without any conversions
hw:CARD=PCH,DEV=1
HDA Intel PCH, CS4208 Digital
Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
Hardware device with all software conversions
plughw:CARD=PCH,DEV=1
HDA Intel PCH, CS4208 Digital
Hardware device with all software conversions
sysdefault:CARD=PCH
HDA Intel PCH, CS4208 Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
Front output / input
surround21:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Digital
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=PCH,DEV=0
HDA Intel PCH, CS4208 Analog
Direct sample mixing device
dmix:CARD=PCH,DEV=1
HDA Intel PCH, CS4208 Digital
Direct sample mixing device