Skip to main content

Spotify (Autonomic Mirage)

Spotify played through an Autonomic Mirage / MMS music server. The player holds the Spotify session, so there is nothing to register at developer.spotify.com, no OAuth flow, no redirect URL and no Spotify Connect target to name. GEM talks to the player over its control protocol (TCP 5004, the same connection the Autonomic Mirage driver uses) and shows the result on the same Spotify source page the Spotify Web API driver uses — the page does not know which of the two it is bound to.

Use this driver when a site already streams Spotify through a Mirage and you want the Spotify browsing experience (playlist tiles, liked songs, search) rather than the player's generic station lists. Keep the Web API driver for sites that play Spotify on Sonos or another Connect target.

What it does​

  • Your library — Playlists, Liked Songs, Albums and Followed Artists of the account signed in on the player.
  • Discovery — Made For You, Featured playlists and New Releases, as three extra buttons on the source page.
  • Search — playlists, albums, artists and songs, up to 50 of each per query.
  • Drill-down — a playlist or album opens its tracks; an artist opens their albums.
  • Play — a tile's play button plays the whole list; a track row plays from that track. The media bar's play resumes what is playing rather than restarting it. The page's bottom bar offers its own play for the selected playlist, album, artist or Liked Songs, following every drill-down — on every screen size, including phones where some themes (Ember) draw no transports in the media bar.
  • Now playing — track, artist, album and art pushed to the media bar as the player reports them, plus shuffle and repeat state and toggles.
  • Library edits for the playing track — add_to_library / remove_from_library save or remove what is playing (the player's context menu; see the Mirage driver).

What it does not do​

The player exposes no way to do these for Spotify, and the source page hides the buttons:

  • Podcasts and recently played.
  • Artist radio and other station seeds.
  • Save or remove a browsed tile — only the playing track can be saved or removed.

Setup​

  1. Sign the Spotify account in on the player (its web page, Configuration → Content). Spotify Premium is required; the player refuses to stream on a free account.
  2. Create a device with this driver. Enter the player's IP; leave port at 5004. Set instance to the player instance (Player_A, Player_B, …) that carries Spotify.
  3. Create an AV source for the device and set its component to spotify.
  4. Route the player's audio output to rooms as you would any source. The driver creates no zones.

A plain Autonomic Mirage device may target the same instance at the same time — for presets, TuneIn and the other services — the player accepts both sessions.

Attributes​

AttributePurpose
ip, portPlayer address; port 5004.
instancePlayer instance to browse and play on. Default Player_A.
client_nameOptional name advertised to the player.
current_mediaRead-only. Now playing as the Spotify page consumes it: name, artist, album, image_url, shuffle, repeat, context, spotify_id.

Commands​

The Spotify page's contract, on this transport:

CommandNotes
get_listentity of playlist, album, artist, saved_track, made_for_you, featured_playlists, new_releases, or playlist_tracks / album_tracks / artist_albums / artist_tracks with an id; start and count page the list.
searchentity of playlist, album, artist or track and a query.
playcontext_uri (a browsed mirage:playlist:… / mirage:album:… / mirage:artist:… id, or saved_tracks) plays that list; uris with a mirage:track:… id plays from that track; neither resumes.
get_now_playing, get_devicesThe media object, and the player as the single device with the page's capabilities.
pause, stop, play_pause, next, previous, shuffle_toggle, repeat_toggle, volume_up, volume_down, muteTransport, as the Mirage driver.
shuffle, repeatstate of on / off (true / false and 1 / 0 also work) sets it; toggle or no value flips the last state the player reported, turning it on if none was reported yet.
set_volumelevel, sent to the player as given; only players that expose volume act on it.
add_to_library, remove_from_libraryThe playing track.
passthroughA raw protocol line.

Ids are the path of the list on the player (one id per hop from the Spotify home), so a saved id keeps working across sessions.

How it works, and what to expect​

Every list is a walk through the player's browse tree — home menu, Spotify, Your Music, Playlists, the playlist — one round trip per hop. The driver keeps its place, so a sibling list is one step back and one step in, and pages within a list come from a one-minute cache. The first page of a fresh list takes under a second; paging is instant. While a list is on its way the source page clears the tiles and shows a spinner, and only the most recent request fills the pane — a slower reply to an earlier tap never lands on top of the list you asked for last.

Search is the player's own: the driver opens the player's Search prompt, submits the query and reads the result buckets. It becomes available because the driver declares a pick-list size in its connection preamble, which is what makes the player treat a client as a full interface.

Album art comes from the player's web port (5005) as plain http. The source page proxies it through GEM so it renders on an https UI; GEM, not the phone, needs to reach that port.

Troubleshooting​

SymptomCheck
Lists are empty, search reports "search unavailable"The player has no Spotify account signed in, or it is signed in on a different instance. A signed-out service shows a single "Sign in to Spotify" row on the player.
Playback starts in the wrong roominstance names a different player than the one wired to that room.
Tiles keep the placeholder art on the appGEM cannot reach the player's port 5005.
A list is stale after a change made in the Spotify appLists are cached for a minute; reopen the list after that.