General Spotify Issues

My amplipi experience is new, so take this for what it’s worth, but running 0.2.1, I’m not having much success with long spotify sessions.

It will often work fine for a few songs, but then it goes haywire. For instance, I had it playing for a while today, then I paused it. I muted the zone in amplipi. I went to resume it after a while, I go to the Spotify app on my phone and the amplipi is not showing as a device. I go to amplipi.local and unmute it, but that doesn’t seem to make it show up in Spotify. Then I remove spotify from Input 1 and add it back. Now I see the amplipi output in the Spotify app. I then pick that and the Spotify app just circles and circles, no sound comes out. Just now, I was finally able to send audio back to the amplipi.

Yesterday my wife was trying to use it. A few times it stopped playing music, so then she transferred the session back to the Google Home. Then minutes later, the amplipi would pick it back up, stealing the session back from the Google Home, a song or two back in the playlist.

I previously setup spotifyd on another raspberry pi I have laying around and it seems to work without much drama, so I feel confident that the amplipi can as well.

When I look in the log file, I don’t see much of interest pointing to errors (though I do see a ton of GET /api/ messages that I’d like to filter out). Is there an editable location for the config file? I see ~/amplipi-dev/streams/spot_config.toml, but I see device_name and device look generic, so I’m not sure that’s really read (I’d like to check the bitrate).

Thanks for all the work on this!

Hey there!
Sorry you’re having some problems with our Spotify integration, we’ve seen the spinning issue you mentioned and we’ve found that generally if you switch the Spotify app to playing on the device you’re on then back to the Amplipi it starts working. As for the other two issues we haven’t seen those! We’ll keep an eye out for them on our setup, if they happen again send us the log and we can see if anything sticks out to us.

As for the get requests you mentioned seeing we don’t currently have a way to filter those out.

Lastly, spot_config.toml is a template config that’s copied to each Spotify stream with those generic values you mentioned replaced with the correct ones. If you wanted to try changing the bitrate you could do it in that file and any Spotify streams you start would have that bitrate.

Thanks! I’ll keep an eye on the log files if this happens again.

Right now, I fired spotify up on my phone. I see my amplipi as a device to connect to, I select it, but it just says “connecting” for a bit and never connects (audio is coming out of my phone the whole time). I look in the logs and see nothing worth reporting.

I go into the amplipi, change input 1 to RCA, then back to Spotify. Back on my phone, I pick the amplipi in the spotify app again, and now sound comes through the amplipi.

Just now, listening, everything seems fine. Then after a song it stops advancing. I was busy, so I ignored it and kept doing other things. Then 5 minutes (?) later, it starts back up. Only error related thing I see for spotify in the logs is this:

Couldn't fetch metadata from spotify: Http(Transport(Transport { kind: ConnectionFailed, message: Some("tls connection init failed"), url: Some(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.spotify.com")), port: None, path: "/v1/tracks/3JDOa1mC1h2UJW9bGcZsVN", query: None, fragment: None }), source: Some(Os { code: 110, kind: TimedOut, message: "Connection timed out" }) }))

The amplipi played one more track, and now seems to have frozen again. I watched the logs and as soon as this popped in, it advnaced to the next track and played:

Couldn't fetch metadata from spotify: Http(Transport(Transport { kind: ConnectionFailed, message: Some("tls connection init failed"), url: Some(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.spotify.com")), port: None, path: "/v1/tracks/1qzHqfvKrZWo6dVHM1dXrj", query: None, fragment: None }), source: Some(Os { code: 110, kind: TimedOut, message: "Connection timed out" }) }))

That track (1qzHqfvKrZWo6dVHM1dXrj) was the one that played last, before the 5 minute pause.

Just another data point. I was playing around with my HA setup so I noticed this. I was playing one track, the sound advanced to the next track, however the metadata didn’t update. I figured this meant it was about to freeze. At the end of the track it was playing (while showing metadata for the prior track), it froze. I expect in a moment I will see the above error message, and it will start playing again.

Sorry for the delayed response, while it’s stuck trying to connect if you press the Spotify connect button in the Spotify app you should see “this phone” if you connect to “this phone” then try switching back to the other Spotify connect device again it typically starts working.

This might be caused by an underlying bug in the version of Spotifyd we’re currently using that should be fixed in a more up to date version. We’re currently testing out a newer version to potentially update to.

1 Like

When should we expect a new version?

Tonight I had the same issues. I was playing something on Spotify. I wanted to restart the track, so I went to the Spotify app and clicked the back arrow. The Spotify app reverted to playing to my phone. Meanwhile, the amplipi kept playing and advanced to the next track. I logged into the amplipi app and hit pause. 15 minutes later, while eating dinner, the amplipi randomly started playing Spotify again.

We just made a prerelease a moment ago with an updated Spotifyd binary, it’s called “Spotifyd Update”. You can try updating to that and hopefully it’ll fix some of your problems!

1 Like

I installed it earlier this evening. It doesn’t seem to address the most egregious of issues.

I was playing Spotify from my phone. I went to repeat the track. The amplipi didn’t respond and kept moving forward in the playlist. I changed my phone to “playing to this device”. Then music was coming out of both my phone and the amplipi. I hit pause on the amplipi ui and nothing happened - only way to stop it was to mute the amplipi.

I can reproduce the problem with the back button, but only when Spotify is autoplaying from a single song. I cannot however get music to play out of both devices at the same time. Either way this is definitely an issue with Spotifyd, I’ll report it to them and keep you updated.

1 Like

Just providing more information. Today I was messing around with my HA dashboard and I noticed the song playing was not what I was seeing in HA. I figured that meant the amplip was about to “pause” for an unknown time, so I watched the logs. It stopped after the song that was playing (4gi1hTYfNDi7kKY8Jk3K1C:

Apr 15 12:51:19 amplipi authbind[829]: Loading <Can't Help Falling in Love (From the Original Motion Picture Soundtrack ELVIS) DELUXE EDITION - Bonus Track> with Spotify URI <spotify:track:4gi1hTYfNDi7kKY8Jk3K1C>
Apr 15 12:51:20 amplipi authbind[829]: <Can't Help Falling in Love (From the Original Motion Picture Soundtrack ELVIS) DELUXE EDITION - Bonus Track> (142581 ms) loaded

This song played and the metadata was showing in the amplipi UI correctly. It then paused until the following showed in the logs:

Apr 15 13:10:05 amplipi authbind[829]: Couldn't fetch metadata from spotify: Http(Transport(Transport { kind: ConnectionFailed, message: Some("tls connection init failed"), url: Some(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.spotify.com")), port: None, path: "/v1/tracks/0rzaRSujxA0bKyjJl6vHYq", query: None, fragment: None }), source: Some(Os { code: 110, kind: TimedOut, message: "Connection timed out" }) }))
Apr 15 13:10:05 amplipi authbind[829]: Loading <Midnight Rain> with Spotify URI <spotify:track:3rWDp9tBPQR9z6U5YyRSK4>
Apr 15 13:10:06 amplipi authbind[829]: <Midnight Rain> (174782 ms) loaded

0rzaRSujxA0bKyjJl6vHYq is what was playing that I never saw the information get updated for in HA, or in the amplipi UI.

It then played Midnight Rain (3rWDp9tBPQR9z6U5YyRSK4) and froze again. The metadata for 3rWDp9tBPQR9z6U5YyRSK4 also never showed, so even though it played, the amplipi UI still shows the metadata still for 4gi1hTYfNDi7kKY8Jk3K1C.

1 Like