Thanks for sharing. Works as a charm
But I have a small problem with my alsa sink. I use a Rotel A12 amplifier and its USB input. The problem appears if the amplifier is turned off and so the destination device isn't present the whole librespot-prozess is killed with:
ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
[2023-10-13T18:41:44Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device hw:0,0 May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'ENOENT: No such file or directory'
and I have to manually start the process again.
Here is my start line:
/mnt/mmcblk0p2/tce/librespot --name PiCoreWohnzimmer --cache /mnt/mmcblk0p2/tmp --bitrate 320 --backend alsa --format S24_3 --mixer softvol --volume-ctrl fixed --initial-volume 100 --device hw:0,0 > /dev/null 2>&1 &
So my question is if there is a way to "ignore" the Alsa error to keep the librespot process alive or do I have to start a watchdog which is starting the librespot process again when it's gone?
Sincerely, Ino