GSoC Mini Report

July 8th, 2008  |  Published in Code  |  View Comments

Some non-Summer-of-Code related business popped up over the weekend, to take care of which required a slight road-trip. As such, I haven’t had much time to work on my project, however I’m heading back home today and I plan to get the code I have chilling in my local branch pushed to the main subversion repository.

Surprisingly, bulleted lists seem to be the most concise means to list progress [/sarcasm]

  • Still working on Harmony integration.
  • Harmony authentication is working (Thanks Lateralus from MP3tunes!).
  • The daemon is receiving notification updates.
  • Notification processing is what I’m working on now.

While looking at my last couple reports about harmony, I realized that the information is somewhat dry. I think this is because harmony is a highly technical, behind the scenes feature, and, also, often it is difficult to inject excitement into mundane programming updates. The humdrum is slightly symbolic of harmony. You will enable it once and forget about it as it silently keeps your music collection synced.

Related posts: GSoC Report Week 5: Harmonizing Amarok, One small step for Amarok…

GSoC Report Week 5: Harmonizing Amarok

July 2nd, 2008  |  Published in Code  |  View Comments

Project: MP3tunes + Amarok Integration

Total Commits: 106 Weekly Commits: 26

Past 7 Days

I usually aim to post these reports on Monday, but I’m usually wrapping up a final commit or two on Monday night so I wait till Tuesday to post the report. Well now it’s 3:30 on Wednesday morning and I’m just starting. My last commit for “this week” was, oh, about 30 seconds ago.

During the last 7 days I:

  • Patched libmp3tunes to support track fetching based off a filekey.
  • Used the aforementioned patch in Amarok to enable saving of MP3tunes tracks to playlists.
  • Made the MP3tunes Service “Lazy Load” upon Amarok’s start-up.
  • Fixed misc non-mp3tunes related Amarok bugs.
  • Added libmp3tunes::Harmony to the source tree.
  • Created a harmony daemon that runs asynchronously within Amarok.

As usual you can see a list of my most recent commits via my fisheye page.

What the heck is this Harmony nonsense?

Harmony, itself, is a subset of libmp3tunes that provides an api for receiving event notifications from the MP3tunes servers. Essentially, what it boils down to is harmony enables the MP3tunes servers to notify Amarok when a user’s Locker has been changed. This will allow Amarok to assess the changes and perform an appropriate action (e.g., download a new track).

Suppose Jenni buys a song from eClassical and has it loaded directly to her locker. When this happens her Amarok will receive a notification: “Hey Amarok, Jenni just had a track added to her locker.” At which point Amarok will seamlessly download the track to Jenni’s local collection.

Upcoming 7 Days

Pretty cool right? Sure is, there’s just one caveat: it’s not working yet. Getting harmony to play nice with Amarok was a challenge that took a couple days, but as of this morning harmony is running in Amarok.

By this time next week I plan to have harmony fully integrated with Amarok, so the above scenario can actually take place. Even though the feature freeze that was announced for Amarok 2.0 technically doesn’t include me, I will still be taking some time to polish all the work I’ve done since May.

GSoC Report Week 4

June 24th, 2008  |  Published in Code, Technology

Project: MP3tunes + Amarok Integration

Total Commits: 84 Weekly Commits: 36

Past 7 Days

Starting these posts with “It was another busy week..” is starting to get boring; I’ll cook up something more exciting for next week.

In case you missed it, in the past seven days history has been made. I’ll let that stand in as the bulk of my weekly report, but a few worthwhile things have occurred since then that deserve a mention.

Remote Track Upload – You can now sideload tracks to your MP3tunes collection from remote sources in Amarok. What the heck is sideload and what remote sources you ask? Sideload is a feature of the MP3tunes API that allows for server-to-server transfers. This means you can give your Locker a URL to a track, and it will automatically be downloaded into your Locker. Currently Amarok sports three services with remote collections that are sideloadable to MP3tunes: Ampache, Magnatune, and Jamendo. This method of transferring is generally very fast, because the transfer bypasses your slow internet connection.

Upload Progress Bar – When you upload (or sideload) tracks to MP3tunes there is now a simple status bar to let you know how far along in the process you are.

Non-Supported Track Filtering – This one is simple: If you try and upload a file-type that MP3tunes doesn’t support, Amarok will tell you and stop that track from being transferred.

Upcoming 7 Days

  • Work on allowing MP3tunes tracks to persist after a restart.
  • Flesh out the synchronization system: what it’s going to do, and how it’s going to do it.
  • Design any UI widgets needed for the syncing system

The first one will be simple, in fact I plan to code it up after writing this report. These second and third tasks, however, signify that I’m moving into the last stage of the project. According to my original proposal I am ahead by a week, so I’ll be using this week as extra time to plan and get a jump-start on the synchronization framework.

One small step for Amarok…

June 20th, 2008  |  Published in Code, Technology  |  View Comments

I’m very excited to announce that the first Amarok->Cloud transfer has taken place. Just moments ago, for the first time ever (as far as I’m aware), a track was sent up into the Cloud from a desktop media player, escaping the local collection prison. This track shed the chains of limited accessibility, and is no longer doomed to obscurity, lost in an sql database in my home directory.

This lucky track happened to be Making Me Nervous by Brad Sucks available over at the great indie music label Magnatune.

Early this morning I committed the last bit of code that allows you to upload tracks to your MP3tunes Locker from Amarok. Amarok is the first client, besides the official client, to allow you to do such a thing. One of the great things about this feature is it’s seamless integration in the UI.

Click for the full view
Amarok 2: Copy to Mp3tunes

After a short upload I go check the MP3tunes Web Player
Listening to Brad Sucks via MP3tunes

From this point I can listen to the track on my phone, on my squeezebox, or any other MP3tunes supported devices.

Of course there are some caveats, but I aim to fix these over the next several days:

  • No upload progress information.
  • No error handling when you attempt to upload a filetype mp3tunes doesn’t support.
  • It’s not possible to upload non-local content (say from magnatune or ampache)

Don’t start thinking that things are winding down; uploading and downloading are only one small part of the show. The end goal is fully automated bi-directional syncing between Amarok and MP3tunes with 100% support for the MP3tunes API.

What exactly does this entail?

  1. I foresee a “keep in sync with MP3tunes” checkbox for each playlist in the Amarok playlist browser, so you can add/remove tracks from your favorite playlists and thoughtlessly have access to them on any MP3tunes enabled device.
  2. Imagine clicking “Purchase” at an online music store (like eclassical) and having the tracks instantly available in Amarok and anywhere else you have access to your locker.
  3. Your friend beams you a track from his Android phone to your Android phone while you are out on the town, and when you get home the track is all ready in your local Amarok collection, added to your smart playlists ready to jam.
  4. You subscribe to an awesome podcast using Amarok’s built in podcast directory, and seconds after a new episode is released it’s available on your wifi enabled portable player (or phone)

And it all started today.

GSoC Report Week 3: Tanstaafl

June 17th, 2008  |  Published in Code, Technology  |  View Comments

Project: MP3tunes + Amarok Integration

Total Commits: 51 Weekly Commits: 12

Past 7 Days

It was another productive week in #amarok with over 150 commits! In the 12 of those that were mine I managed to do several things.

  • Added elegant session handling to the MP3tunes service
  • Fixed the collection search box, so you can filter your MP3tunes Locker.
  • Enabled Copy To Collection functionality, so you can now copy (read: download) mp3tunes tracks to some other collection!

Of course, implementing those items wasn’t as simple as it sounds, but the features are essential and basic.

The search box (filtering) could use some improvement as currently it only filters via the artist field, but that is a limitation of the MP3tunes API. When I say it
“only filters via the artist field” I mean that it only matches against artists, so searching for a particular track name will not work. To fully support the filtering feature the MP3tunes API would need to allow you to do something like get a list of artists based on a partial track name in a single request. That is just one example, and yes, I could workaround it by doing multiple queries, however that would slow the entire operation significantly. Users expect the search fields in Amarok to be snappy, not take ~5 seconds per. token they supply. It is certainly not a showstopper, and it functions well enough for now, but hopefully MP3tunes will be open to expanding their API later on down the rode. To be fair I have never come across a web API that supported that sort of complex searching. The Ampache service in Amarok suffers from the same lack of functionality.

Interjection: Major props to my GSoC mentor, Nikolaj, for attempting to explain various parts of Amarok’s innards to me, not only once, but the several times it took to get the concepts through my thick skull. Also, he’s helped me track down several childish mistakes I’ve made when I was at my wits end trying to locate them. I can’t thank him enough. Hands down he’s the best GSoC mentor.

With the addition of “Copy to Collection” Amarok has taken a large step towards being fully integrated with MP3tunes. Up till this week all you could do was browse and stream your MP3tunes Locker. That is fine and dandy, but you could do that from the MP3tunes web player, their mobile player, your PS3, or any other number of their supported devices. However, none of those options allow you to seamlessly download and organize your stored music into your local music collection at the click of a button.

There is one shortcoming that needs to be addressed at some point before I’m satisfied: there is no progress indicator of any kind when you download tracks. The only way to see if tracks are being downloaded after you press Go is to watch the destination directory for changes. Thankfully this affects all collections you can “copy to/from”, not just MP3tunes, so perhaps someone else will feel inclined to whip up a progress indicator. There’s no such thing as a free lunch.

Upcoming 7 Days:

I have one big goal this week:

  • Add MP3tunes Upload features

By Monday next week, you will be able to do Copy tracks from your local collection, Ampache collection, and the Magnatune database, to your MP3tunes locker.

Copy to Collection

There is quite a bit of work to be done before this can happen, but I will spare you the gritty implementation details until next week after I’ve committed the code where my mouth is (?).

Of course my weekly predictions wouldn’t be complete without a task to fall back on if I happen to complete the aforementioned task in a Ballmer-Fueled rage. After upload is in place there is only one major item left: Syncing. I need to break “Syncing” into manageable actionables (quite a term, eh?) and then lay out some mid-level designs for the process. Later on during the week I will dedicate an entire post to this topic.