Hello!
Im trying to make a doorbell automation, and got stuck at playing an audio file to a specified speaker.
The speaker im trying to play to is not the system default output.
Heres my doorbell.sh script:
#!/bin/bash
PULSE_SINK=0 cvlc --play-and-exit /home/User X/.homeassistant/doorbell.mp3
When i run this as (current) user X, it play on the main speakers, but when i use this .sh script in homeassistant, it plays on the my (5.1) headphone and throws the same error block 3 times (for every shell command):
pulseaudio[26761]: [pulseaudio] alsa-mixer.c: Volume element Headphone has 8 channels. That's too much! I can't handle that!
pulseaudio[26761]: [pulseaudio] alsa-mixer.c: Volume element Headphone has 8 channels. That's too much! I can't handle that!
pulseaudio[26761]: [pulseaudio] alsa-mixer.c: Volume element Headphone has 8 channels. That's too much! I can't handle that!
pulseaudio[26761]: [pulseaudio] alsa-mixer.c: Volume element Headphone has 8 channels. That's too much! I can't handle that!
pulseaudio[26761]: [pulseaudio] sink.c: Default and alternate sample rates are the same.
pulseaudio[26761]: [pulseaudio] module-combine-sink.c: Invalid slave sink 'alsa_output.pci-0000_00_1b.0.iec958-ste$'
pulseaudio[26761]: [pulseaudio] module.c: Failed to load module "module-combine-sink" (argument: "sink_name=combined slaves=SnapServer,alsa_output.pci-0000_00_1b.0.iec958-ste$"): initialization failed.
pulseaudio[26761]: [pulseaudio] main.c: Module load failed.
pulseaudio[26761]: [pulseaudio] main.c: Failed to initialize daemon.
pulseaudio[26758]: [pulseaudio] main.c: Daemon startup failed.
Homeassistant service runs as User X.
I have a combined sink on my system, which is mentioned in the error log too for some reason… Why does it want to load a pulse module? hmmm…
Probably the same reason why this command doesnt work:
pacmd set-default-sink SnapServe
r
Error:
ERROR (MainThread) [homeassistant.components.shell_command] Error running command:
pacmd set-default-sink SnapServer, return code: 1
Any idea guys?