Spotify Jam Sessions: A Synchronization Anomaly
Table of Contents
Spotify - Jam Sessions
Recently, I started using Spotify’s Jam Sessions with a colleague. Thats when you invite another user to join your playlist and listen to the same songs at the same time. We did so until we noticed something strange with the synchronization. It’s fun being able to guess some internals from a system by observing it running.
The Observation
If you start a jam session and invite others, the playlist and the currently playing song are synced. This is also true for settings like the the “loop” and “shuffle” settings.
So we were listening together, my account as the host, my colleague as a guest. After some time he started complaining that I always skip a song, which I did not do. So we checked the playlist (shuffle was turned on) and found the following:
- We both played the same songs
- The host’s “last played” list is correct
- Every second song of the guests “last played” list matched the host’s list
- The playlists (what’s coming next) were completely different
- The “extra song” in the guests “last played” list was the one which would have been next according to his playlist
What we might have learned
Without knowing any internals this is just guesswork. But hey, why not? It seems like Spotify syncs most playlist properties but forgets one. The songs in the overall playlist are synced, the settings are synced, and the host seems to send updates to the currently playing song to the other participants.
But it seems like they forgot to sync the random seed 1 (if there is one) with which the playlist is shuffled, leading to different playlists for each participant. When the current song is over every player switches to the song they think is next until the host sends an update with the actual next song.
Doing further guesswork, I would expect the guests to forward local actions (e.g. if the guest presses next song) to the host. The host handles this action and sends back updates whenever anything changes on his state.
Can we go deeper?
Maybe. We found this during working hours, so we didn’t exactly have the time. But you could try this out with more participants, you could check the behaviour of random shuffle with suggestions and check if wireshark yields anything helpful.
For now, this is just a fun observation I wanted to share.
Hope you enjoyed it, have fun playing with Spotify’s jams and listening to cool music! If you have cool observations, know something about this or have other remarks, send me a mail!
A random seed is a value used to initialize a pseudorandom number generator. Using the same seed will yield the same sequence of pseudorandom numbers and thus can be used for deterministic randomization or sharing the same randomization. A well-known example is the level seed in different games like Factorio (♥) or Minecraft. ↩︎