Spotify Connect Chain

Highly recommended to ignore this post if you’re questioning the use of this! (citing @jawn…)

Hi all,

There was an itch to scratch last December. Being rehearsing for the school parents band’s performance for Christmas.

This itch made me develop a Spotify Connect chain, where Zynthian acts as a Spotify Connect device.

This allows you to play along with the songs on the same sound system. It uses spotifyd as the backend. You can even autotune Last Christmas, which it needs to play along with. Or record a loop of a part to study with SooperLooper.

Also nice to have high quality sound during the day job.

If there is interest in this, not the least from the developers, I will create two pull requests (one for zynthian-sys, one for zynthian-ui).

I totally understand it if this is rejected, because of ‘promoting non-free functions’, or leading too much astray from what Zynthian should be.

It is not perfect, in more than one way:

  1. Connections may get lost, but that’s more a thing of Spotify connect devices in general. Just yesterday, I was unable to connect at all. Today all is fine and dandy.
  2. I appeared utterly unable to implement tallies via D-Bus only. Talking with AI about glib mainloop just sent me in a loop. So I did what is done with the internet radio in VLC: parsing command line output.
  3. Spotify could probably at any time change something which would break this. That being said, I have been using this almost daily for the last couple of months. But I may not be able to ensure continued use.
  4. Don’t use this in a live setting: anyone could connect when on the same network!!!

Zynthian-ui: GitHub - pft/zynthian-ui at ft-spotify-connect-v · GitHub

Zynthian-sys: GitHub - pft/zynthian-sys at pft-vangelis · GitHub (dunno if I’ve done the right thing™ to engine_config.json—just concocted a hash for the ID—but it does work).

NOTE: if testing this, you have to run regenerate_engines_db, before this turns up under Audio Generator > Other.

3 Likes

How do you enter user credentials?

You don’t have to. It should pop up as a device to connect to on your phone/desktop spotify app. As spotifyd@zynthian (or whatever hostname you choose).

I think there were ways to restrict further access, but have not investigated.

That is indeed the preferred way, it is also possible with a manual Authentication method

With a manual method of authentication, discover on the network can be disabled

I would certainly like this!

Thank you @niels
IMHO it makes sense, at least for the use case that made you do it, and it’s exactly what I was testing and talking with @jawn on the other thread over the weekend.

Maybe there is some way to make this not Spotify specific (this requires Premium).
My skills are very limited to go anywhere, but I’m interested in attempting to integrate Lyrion Music Server and Squeezelite player in the same way. The overall architecture seems quite similar.

1 Like