Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Spotify Connect failures on Moode 4.4
#42
Update:
2 days later, no drop-outs. That's me converted.

NOTE: This does NOT fix librespot crashing when there is a network interruption; however THAT crash has log entries and can be watched/restarted (I'll build that into the script later).

Here's the script I'm using to start/restart/stop librespot:

Code:
#!/bin/bash

launch_librespot () {
 screen -dmS librespot `which librespot` \
 --name osmc \
 --bitrate 320 \
 --initial-volume 50 \
 --enable-volume-normalisation \
 --disable-audio-cache \
 --verbose \
 --username XXXXXXXXXXX \
 --password XXXXXXXXXXX \
 --backend alsa
 #--device plughw:0 \
 #--onevent /var/local/www/commandw/spotevent.sh
 echo "librespot started"
}

if [[ "$1" == "start" ]]; then

 if [[ -z `screen -ls | grep librespot` ]]; then
   launch_librespot
 else
   echo "librespot is already running"
 fi
 exit 1

elif [[ "$1" == "restart" ]]; then

 if [[ -z `screen -ls | grep librespot` ]]; then
   echo "librespot not running"
 else
   echo "restarting librespot"
   kill -9 `screen -ls librespot | grep librespot | cut -d "." -f 1`
   screen -wipe | 1>/dev/null
 fi

 launch_librespot
 exit 1

elif [[ "$1" == "stop" ]]; then
 if [[ -z `screen -ls | grep librespot` ]]; then
   echo "librespot not running"
 else
   echo "stopping librespot"
   kill -9 `screen -ls librespot | grep librespot | cut -d "." -f 1`
   screen -wipe | 1>/dev/null
 fi
 exit 1

else
 echo "function: ./librespot [start|restart|stop]"
fi
Reply


Messages In This Thread
Spotify Connect failures on Moode 4.4 - by abyrd - 12-13-2018, 05:51 PM
RE: Spotify Connect failures on Moode 4.4 - by oboote - 12-06-2019, 03:01 AM

Forum Jump: