Something, something music sharing
Go to file
pukkamustard e1cea63cfb logo: init 2023-08-08 20:53:36 +02:00
.reuse Call me Pequod... 2022-01-18 17:14:58 +01:00
LICENSES Call me Pequod... 2022-01-18 17:14:58 +01:00
doc doc/ fix wrong prefixes 2022-01-27 12:08:49 +01:00
src/pequod guix: Update archi to 0.2.0 2022-09-11 12:45:04 +02:00
.gitignore Call me Pequod... 2022-01-18 17:14:58 +01:00
.ocamlformat Pequod: Something about music sharing 2022-01-18 20:10:41 +01:00 Pequod.Vocabulary: Track and Scrobble. 2022-01-24 14:18:00 +01:00
dune-project guix: Remove upstreamed OCaml packages. 2023-01-22 14:52:28 +01:00
guix.scm guix: Remove upstreamed OCaml packages. 2023-01-22 14:52:28 +01:00
logo.png logo: init 2023-08-08 20:53:36 +02:00
logo.svg logo: init 2023-08-08 20:53:36 +02:00


Something, something music sharing.


Pequod is an experiment into a friend-to-friend music sharing system.


Pequod can observes what is being played in MPD and creates XMPP posts for every song listened:

$ dune exec src/pequod/pequod.exe -- scrobble --jid user@strawberry.local --password pencil -v
pequod.exe: [INFO] Connected to MPD.
pequod.exe: [INFO] Opening TCP socket to (port: 5222; disable_ssl: true)
pequod.exe: [INFO] XMPP Client connected as user@strawberry.local/berwsTgK.
pequod.exe: [INFO] Scrobbling track urn:uuid:a944e6fe-9357-3230-8028-b0c7efe7c58a (Jay Dee - Think Twice) to XMPP.

Scrobbles are published as ActivityStreams Listen activities using The Music Ontology properties. Most importantly, the MusicBrainz identfier of the track is included.

See for details on the data model and vocabularies used.

Get Scrobbles

To get scrobbles:

$ dune exec src/pequod/pequod.exe -- get --jid user@strawberry.local --password pencil 
xmpp:user@strawberry.local (2022-01-20 11:31:11 +00:00): Jay Dee - Think Twice (urn:uuid:a944e6fe-9357-3230-8028-b0c7efe7c58a)

Of course this is ugly. A nicer UI will eventually come...

You can also get scrobbles from other users (who share their presence with you) with pequod get

See this blog post for details on how this works.

WARNING: Pequod will re-configure the PEP node net.openengiadina.xmpp.activitystreams to persist 256 items. By default only a single item is persisted on most XMPP servers. In the future this should be less forcefull and configurable.

TODOs and Ideas

A nice UI for viewing scrobbles

Uploading scrobbles is not really useful if there is no way to view them. We need a little client UI that can be used to view your own and your friends scrobbles. Would be nice to have things like weekly/monthly statistics and such.


MPRIS is a D-Bus interface for media players. It can be used to get information on what tracks are being played.

It seems that players do not expose the Musicbrainz metadata via MPRIS, even if the audio files are properly tagged. MPRIS does seem to expose the location of the audio file, so we could get the missing tags by looking at the file directly. This does require using something like Taglib.

Initial experiments with ocaml-taglib failed, as the Musicbrainz tags seems to be in ID3v2 frames or Vorbis metadata that does not seem to be exposed in the OCaml bindings.


Add the ERIS read-capability of the audio file to the scrobbled track. Eventually also make the blocks available and allow sharing of music (and not only music metadata).


A suitable development environment can be set up with Guix:

guix shell -D -f guix.scm

This is currently the easiest way to get hacking as many OCaml dependencies have not yet been published to OPAM.

Use dune exec src/pequod/pequod.exe to run Pequod.

Inspriation and Related Projects

Provided an RDF interface to data.

They use the Music Ontology, FOAF and a simple ontology for describing Scrobbles based on the Event Ontology.


A scrobbler that listens for media players on MPRIS.


pukkamustard [at] posteo [dot] net