Thank you for your donation!


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


Problem: Spotify connect keeps dropping
#40
Update over in other thread:


(12-06-2019, 03:01 AM)oboote Wrote: 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 oliver.boote.dl \
  --password nm3^h8g%FbuP \
  --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 keeps dropping - by PhotonHerder - 11-24-2018, 10:12 PM
RE: Spotify connect keeps dropping - by jonners - 11-25-2018, 09:40 PM
RE: Spotify connect keeps dropping - by zaqqq - 11-25-2018, 01:13 PM
RE: Spotify connect keeps dropping - by zaqqq - 11-25-2018, 02:07 PM
RE: Spotify connect keeps dropping - by ksone - 11-28-2018, 08:42 AM
RE: Spotify connect keeps dropping - by ksone - 12-05-2018, 09:28 PM
RE: Spotify connect keeps dropping - by ksone - 12-06-2018, 07:55 AM
RE: Spotify connect keeps dropping - by ksone - 12-06-2018, 01:43 PM
RE: Spotify connect keeps dropping - by adixor - 03-22-2019, 08:11 PM
RE: Spotify connect keeps dropping - by Edward - 03-31-2019, 06:25 PM
RE: Spotify connect keeps dropping - by ksone - 04-01-2019, 12:10 PM
RE: Spotify connect keeps dropping - by deafnut - 04-13-2019, 08:55 PM
RE: Spotify connect keeps dropping - by deafnut - 04-17-2019, 08:49 PM
RE: Spotify connect keeps dropping - by deafnut - 04-19-2019, 12:01 AM
RE: Spotify connect keeps dropping - by ksone - 04-22-2019, 08:32 AM
RE: Spotify connect keeps dropping - by oboote - 12-03-2019, 11:47 PM
RE: Spotify connect keeps dropping - by oboote - 12-06-2019, 03:04 AM

Forum Jump: