Thank you for your donation!


Problem: Spotify connect keeps dropping
#31
Quote:It shouldn't crash or exit due to interruption in connection, rather it should print a message and periodically try to reconnect.

You'd think, right? But their issues log shows this is a longstanding problem which apparently hasn't been easy for them to resolve.

Regards,
Kent
Reply
#32
Gotcha. I'll add the watchdog code :-)
Reply
#33
This happens to me too. I am on a v5 beta.
Unfortunately after that moOde UI stays in "Spotify Active" mode even after a reboot via shell. Moode is unusable.
Is there a way to NOT reflash the image?
Reply
#34
I did a quick repro by rebooting while playing spotify. The Active screen can be cleared by Browser refresh.
Reply
#35
(04-13-2019, 09:53 PM)Tim Curtis Wrote: I did a quick repro by rebooting while playing spotify. The Active screen can be cleared by Browser refresh.

It happened again. I think it always happens some time after i switch the Spotify control point, for ex. from Smartphone to PC. Suddenly the music stops and the renderer disappears in Spotify. Moode then remains unsuable with "Spotify active" screen even after reboot.

Tim, i tried a browser refresh, different browsers, different devices. Only way out is:
http://moode/snd-config.php#mpd-restart and there restart Spotify client.

Installing newest Moode version now. :-(
Reply
#36
I have Spotify desktop app and also the Smartphone app. Please list the exact steps that u take that result in the issue and I'll try and repro.
Reply
#37
I'm on v5.0 now and hope for the best. The failing librespot client of course is not your problem. My problem was the "Spotify active" that did not deactivate.
On older versions i started music playback via Spotify client on smartphone. For example a playlist or artist radio. Then later i switched to the PC client without touching the smartphone again. After some pause/play/skip commands in the PC app the music stopped after a few more songs as if the playlist ended. But in fact Spotify Connect (Moode) disappeared from PC app with "Spotify active" stayed in Moode UI. I then had to restart Spotify client via terminal.
Reply
#38
(04-19-2019, 12:01 AM)deafnut Wrote: I'm on v5.0 now and hope for the best. The failing librespot client of course is not your problem. My problem was the "Spotify active" that did not deactivate.
On older versions i started music playback via Spotify client on smartphone. For example a playlist or artist radio. Then later i switched to the PC client without touching the smartphone again. After some pause/play/skip commands in the PC app the music stopped after a few more songs as if the playlist ended. But in fact Spotify Connect (Moode) disappeared from PC app with "Spotify active" stayed in Moode UI. I then had to restart Spotify client via terminal.

I ended up having the same problem with the text Spotify active in Moode UI. IF I used the moode audio direct link attached to home screen on my iOS device I couldn't refresh it. Opening safari browser it worked perfectly. So I deleted old home screen link and adding new “link” to home screen, it worked as supposed again.
Reply
#39
Hi guys, cross-posting the latest "workaround" that I'm trying - keen to see if more people get positive results from it. Quoting here but original post over here: http://moodeaudio.org/forum/showthread.p...7#pid14897

(12-03-2019, 11:37 PM)oboote Wrote: Hi guys,

New here  Smile Actually I'm not even a moodeaudio user - but I've been struggling with raspotify/librespot connection issues for ~2 years on 2 separate raspberry pi's and could never find the cause, let alone a workaround - but I came across something yesterday which seems (so far, fingers crossed) to have finally addressed it.

Symptoms experience (in past):
Connect from spotify, play music - music will randomly stop, mid-track. It could be after 10s, it could be after 10 tracks, it could be after an hour. But it WILL happen - generally within an hour. Sometimes the service is still running and I can still re-connect from Spotify and resume playing. Occasionally I'll need to send a quick service raspotify restart so the client can reconnect.

The logs, even verbose logging, display no indication of what is going on  Huh
I have more of these examples stored somewhere but here's what they generally look like:

Code:
Nov 20 10:27:42 officepi librespot[21836]: TRACE:librespot_audio::fetch: chunk 100 / 103 complete
Nov 20 10:27:42 officepi librespot[21836]: TRACE:librespot_audio::fetch: requesting chunk 101
Nov 20 10:27:43 officepi librespot[21836]: TRACE:librespot_audio::fetch: chunk 101 / 103 complete
Nov 20 10:27:43 officepi librespot[21836]: TRACE:librespot_audio::fetch: requesting chunk 102
Nov 20 10:27:43 officepi librespot[21836]: TRACE:librespot_audio::fetch: chunk 102 / 103 complete
Nov 20 10:27:43 officepi librespot[21836]: DEBUG:librespot_audio::fetch: File 96e6fe448652629359c13496af3121320d846eaa complete
[Crash happens here - the above is completely normal and happens for every track - I then restart the service]
Nov 20 10:28:01 officepi systemd[1]: Stopping Raspotify...
Nov 20 10:28:01 officepi systemd[1]: Stopped Raspotify.
Nov 20 10:28:01 officepi systemd[1]: Starting Raspotify...


Setup:
One is running OSMC and connected to USB speakers (I've had it ~1 year), the other is running Raspbian and connected to a TV using HDMI (~2 years). Both experience the same issue.

The workaround:
I came across an obscure post somewhere (which I've lost - I came across this looking for the original) which suggested running librespot manually in a terminal (rather than as a service). I decided to do so just to observe any additional errors that might not be getting logged... But so far my stream held steady the entire afternoon and I haven't experienced the issue.

So what I'm suggesting is disable the service and run librespot in a screen session instead. It's worth a shot.

I have the following simple script (remember to chmod +x it) to launch librespot:

Code:
pi@officepi:~ $ cat manlibrespot.sh
#!/bin/bash

/usr/bin/librespot --name stablepi --bitrate 320 --initial-volume 15 --enable-volume-normalisation --linear-volume --disable-audio-cache --verbose
#OPTIONAL ARGS:--backend alsa --device plughw:0 --onevent /var/local/www/commandw/spotevent.sh --username [USERNAME] --password [PASSWORD]

If you want to automatically start a screen session and run a script at boot I would suggest adding the following to the bottom of /etc/rc.local:

Code:
su pi -c '/usr/bin/screen -dmS manlibrespot /home/pi/manlibrespot.sh'

PS: it's possible the "d" daemon mode in that line might be an issue; still untested (I use that in other service that stop crash).

I've only been running this for half a day so I may come back tonight with my tail between my legs but so far so good.

Side-note: I've been struggling with this for years and it gave me a warm fuzzy feeling to see someone here quote something I shared in a random github convo about the issue  Blush
Reply
#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


Forum Jump: