Mopidy
MPD server with Spotify support
www.mopidy.com
Slide 2
Slide 2 text
«når skal vi starte på
spotify mpd serveren
da? :P»
Johannes,
2009-12-23
Slide 3
Slide 3 text
What is MPD?
Slide 4
Slide 4 text
What is MPD?
Short for Music Player Daemon
Slide 5
Slide 5 text
What is MPD?
Server - Protocol - Client
Slide 6
Slide 6 text
What is MPD?
The server plays music from
it's local disk
Slide 7
Slide 7 text
What is MPD?
The client controls playback
and playlists, but got nothing to
do with the actual audio data
Slide 8
Slide 8 text
What is MPD?
The protocol is
badly documented and
inconsistenly used by the
clients
But it ain't that huge
Slide 9
Slide 9 text
What is Spotify?
Slide 10
Slide 10 text
What is Spotify?
99 kr per month in exchange
for all the music you'll ever
need
in high quality on PC and
mobile
Including: Windows, Mac, Linux, iPhone, Android, S60
Excluding: Beatles, Pink Floyd, Led Zeppelin, Frank Zappa
Slide 11
Slide 11 text
What is Spotify?
Free ad-financed version
available, but we're going
Premium
iPhone, Android, S60 and all the open source solutions
requires a Premium subscription
Slide 12
Slide 12 text
What is MPD+Spotify?
Slide 13
Slide 13 text
What is MPD+Spotify?
Mopidy
Slide 14
Slide 14 text
What is MPD+Spotify?
www.mopidy.com
github.com/jodal/mopidy
Slide 15
Slide 15 text
Where to begin?
Slide 16
Slide 16 text
Where to begin?
Extend existing MPD server?
It's old, huge and
we're not C coders
Not yet, at least
Slide 17
Slide 17 text
Where to begin?
Reimplement then
Just the server! No way we're doing all those clients.
And no way we're decoding music ourselves.
Slide 18
Slide 18 text
Where to begin?
Scala and Actors?
Enough to learn in
implementing an MPD server
and Spotify integration
Slide 19
Slide 19 text
Where to begin?
Scala and Actors?
Python is known ground
Slide 20
Slide 20 text
Where to begin?
Spotify integration?
Slide 21
Slide 21 text
Where to begin?
Spotify integration?
despotify is an open, reverse
engineered Spotify library
C, Linux and OS X, not very active
Python wrapper named spytify (thanks to Jørgen P. Tjernø)
Slide 22
Slide 22 text
Where to begin?
Spotify integration?
libspotify is the closed source,
but official library
C, Linux 32-bit only (now 64-bit too)
Python wrapper named pyspotify (thanks to Doug Winter)
Slide 23
Slide 23 text
Where to begin?
Spotify integration?
Lets do both!
We don't know what problems will arise,
so we keep our options open
Slide 24
Slide 24 text
Architecture?
Slide 25
Slide 25 text
Architecture?
Creating it as we walk,
refactoring early and often
Architecture?
Frontends work with
protocols and parsing
Slide 28
Slide 28 text
Architecture?
We got one frontend this far:
Mpd{Server,Session,Handler}
Slide 29
Slide 29 text
Architecture?
Backends work with
playing music
Slide 30
Slide 30 text
Architecture?
We got two backends:
{Despotify,Libspotify}Backend
Slide 31
Slide 31 text
Architecture?
And a third is underway:
GstreamerBackend
It plays music from local disc, like the original MPD server
(thanks to Thomas Adamcik)
Slide 32
Slide 32 text
Architecture?
Mixers are the latest addition
They work with volume control
Slide 33
Slide 33 text
Architecture?
We got two mixers:
{Alsa,Osa}Mixer
One for Linux and one for OS X
(the last one actually includes two lines of AppleScript)
Slide 34
Slide 34 text
Code?
Slide 35
Slide 35 text
Code?
github.com/jodal/mopidy
GPLv2 license
Slide 36
Slide 36 text
No content
Slide 37
Slide 37 text
Tests?
Slide 38
Slide 38 text
Tests?
202 and counting
Runs in 0.4s
>100 new with the gstreamer branch
Slide 39
Slide 39 text
Documentation?
Slide 40
Slide 40 text
Documentation?
Lots!
www.mopidy.com
Slide 41
Slide 41 text
No content
Slide 42
Slide 42 text
Talk?
Slide 43
Slide 43 text
Talk?
#mopidy at irc.freenode.net
Currently eight humans* and a bot
* 6 Norwegians, 1 Swede, 1 Briton
Slide 44
Slide 44 text
Future?
Slide 45
Slide 45 text
Future?
Version 0.1
We need to implement this
release early, release often thingy
Slide 46
Slide 46 text
Future?
Replace libspotify with
libopenspotify?
Identical API, open source, adds OS X and Windows support
Should be a drop-in replacement with only benefits
Slide 47
Slide 47 text
Future?
GstreamerBackend
So we can replace the original MPD server
Slide 48
Slide 48 text
Future?
Multiple backends
at the same time
Mix tracks from Spotify and disk in the same playlist
Slide 49
Slide 49 text
Future?
Bonjour/Avahi here-I-am
Broadcast our existence so clients can automagically find the server
Slide 50
Slide 50 text
Future?
A non-MPD frontend?
Slide 51
Slide 51 text
Future?
Icecast streams?
Server streams music to somewhere else
Slide 52
Slide 52 text
Future?
Squeezebox support?
Deliver music to Squeezebox devices
Slide 53
Slide 53 text
Future?
AirPort Express support?
Deliver music to AirPort Express devices
Slide 54
Slide 54 text
Future?
NAD/Denon mixer
Control volume on amplifiers through RS-232
Slide 55
Slide 55 text
Future?
Distribution infrastructure
Python packaging, Debian packaging, Homebrew recipies, build
server