GSoC Proposal: Statistics synchronization for pluggable devices and

Bart Cerneels bart.cerneels at
Wed Mar 21 07:43:47 UTC 2012

On Wed, Mar 21, 2012 at 00:06, Matěj Laitl <matej at> wrote:
> Hi Teo, Bart and list,
> as suggested by Teo, I've decided to try to take part in GSoC 2012 working as
> a student on Amarok. My idea is not on the KDE Ideas page, but I've been
> playing with (a variant of it) for months.
> Continues a very draft of my GSoC proposal. I'd be very grateful for any
> possible comments, pointed-out omissions or questions that may arise.
> Introduction
> =======
> Amarok has an ability to store per-track play statistics such as play count,
> first & last played date, rating and labels. It then has powerful means to
> generate custom-tailored playlists based on gathered statistics (e.g.: play me
> what I've listened to last month) that many users like to exploit. This works
> well when your computer is the only device you play music from. More likely
> situation is that you play music using Amarok at home, listen to iPod while
> commuting and use Amarok or another music player at work. All these 3 devices
> are able to keep track of what you've listened to, but each one only a third
> of it, which makes Amarok statistics more or less useless. This project aims
> to remedy the situation; is an online service that can keep track of
> music a user listens to[1] and can help us with a part of this project. Amarok
> Users group on has over 23 000 users.[2]
> Project Goals
> ========
> This project will implement:
>  * track statistics synchronization between Amarok collections that support
> statistics; these are currently Local Collection and iPod Collection, but the
> framework will be general
>  * scrobbling from pluggable media players that support statistics
> (iPods, currently) using the general framework from previous point
>  * ability to synchronize labels from Amarok to
>  * ability to synchronize play counts, first & last played date from to
> Amarok collections (other way around is already implemented by scrobbling)
>  * GUI dialogue for performing the synchronization/resolving conflicts
> Bonus points (what will Amarok gain for free):
>  * ability to synchronize statistics of Amarok and other media player that
> scrobbles to
>  * track statistics backup through
> Caveats:
>  * has no concept of track ratings. This can be however worked around
> by special labels such as "7/10 stars"
>  * advanced features will be only available for users; is free
> to use, but the data are public which may be unpleasant for certain users
> Implementation
> =========
> Amarok represents audio tracks by Meta::Track abstract C++ class that provides
> getter methods for meta-data (title, artist, album..) and getter/setter
> methods for statistics (rating, play count...). These tracks are grouped into
> so-called Collections, where each Collection represents one source of songs
> (iPod, Local, USB Mass Storage..). Tracks from different collections will be
> matched together using their meta-data and other collection's QueryMaker to
> perform the search. Moreover, iPods provide additional data that can be
> used for conflict-resolution: app_rating and recent_playcount. [3] I plan to
> expose these as new capability offered by Collections. This capability will
> also be used to implement scrobbling from iPods (in fact, every
> collection that will support this capability), exploiting recent_playcount
> field in the iPod case. It should be noted that I have already implemented
> similar synchronization in my spare time back in summer 2011 [4], but I was
> not satisfied with its iPod-specific design and GUI, so I decided not to strive
> for its inclusion. But I have the code working and ported to Amarok 2.5, so it
> can be used to fast-start this project.
> Another interesting note is that was functional
> in Amarok 1.4 days, but this feature got dropped during rewrites leading to
> 2.0, so this will fix one long-overdue regression.
> Speaking about integration, provides rather nice RESTful API
> [5] a subset of which is already used through liblastfm [6] library in Amarok
> to submit (scrobble) currently played songs. I plan to reuse this library and
> Amarok code dealing with it; the API is powerful enough to support all
> claimed features. There is already even on-line service Collection,
> but it focuses on playing radio streams and doesn't handle individual
> tracks. In order to implement actual synchronization with, user's
> Library (that contains relevant track data) can be represented as a
> new (invisible) Collection or as special case in synchronizer, I have yet to
> decide this design choice.
> Timeline
> =====
> [To be done when the general idea is accepted.] Generally: inter-collection
> synchronization will be first and will be done by the midterm evaluation,
> support will be second. I'm already quite bound to Amarok community,
> so I can finish the design, iron-out some details and perhaps present some GUI
> mockups during the community bonding period.
> If accepted, GSoC will be my main commitment during the summer, I plan to have
> a week-long vacation and a few 3-day trips, but I'm used to work during
> weekends on open source projects, so the vacation will be compensated.
> About me
> ======
> I'm a 24-year-old student of mathematical informatics from Prague, Czech
> Republic. I've been passionate about FLOSS since high school and recently I've
> started contributing to a couple of projects (manly KDE related), most notably
> Amarok where I worked on fixing various bugs singe last autumn [7] and recently
> I've rewritten the iPod collection from scratch [8] as suggested by Amarok's
> Bart Cerneels; I plan to submit a review request for this in coming weeks.
> I've been also particularly active on KDE's bugzilla where I've commented to
> more than 300 bugs.[9] I know C, C++, Python, Java, a bit of French (pun
> intended) and some other less relevant languages. Thanks to my work on Amarok
> I have some experience in GUI programming in Qt & KDE libs.
> I've chosen Amarok because I fell in love with it last year, and statistics
> synchronization because it is an area where I found it a bit lacking; I'm a
> music enthusiast who dislikes to listen to the same song twice in a week and I
> believe more Amarok users are that picky and will therefore benefit from this
> work.
> I can be reached via e-mail matej at which serves as my Jabber and
> Google account, too. I sometimes hang on #amarok under nick strohel.
> [1]
> [2]
> [3]
> [4]
> [5]
> [6]
> [7]
> [8]
> [9]

I very much see the need for statistics syncing between iPod and SQL
and similar. But I strongly object to a Collection for, even a
hidden one. It's  corrupting the architecture ( does not
provide us distinct playable tracks, hence can not be a real
Collection) and further complicates the codebase with various special
cases. We've been suffering a similar mistake with Services already
and want to avoid making it again at all cost.

If all you really need for synchronization from to a
Collection is metadata and a QueryMaker, I don't see the need for a Collection, QueryMaker, etc. In order to keep it sane you'll
have to execute the sync from the service anyway and have a
config to select which Collections are synced (SQL as default). From
SQL to is already implemented with scrobbling.

Very good proposal in any case and I'm confident you can pull it off.


More information about the Amarok-devel mailing list