There has been a lot of chatter lately regarding Amarok's switch to MySQL as its only SQL backend. A decent amount is FUD -- either by people simply pushing back against change, or by people that simply don't understand the decision. Some of it (particularly Adriaan's blog post) has been insightful and interesting, but miss the mark in terms of why this change was made. This post attempts to explain why this decision was made, what it really means for you the end-user, and why you should have a cup of tea and relax.
I want to point out first that I said that MySQL is going to be Amarok's only SQL backend. A2's collection system is very powerful. Just take a look at how varied music sources from Shoutcast, Jamendo, Magnatune, Ampache, MP3Tunes, as well as local sources like iPods and your local file system, are treated as equals in A2. A collection is a collection, and is limited only by what capabilities it advertises it can support (and of course, it can supply its own custom capabilities). It's not currently enabled, I don't think, but there's a Nepomuk-based collection option too. So take heart -- this change only affects Amarok's internal SQL collection, and not other sources (although those sources can store information in the SQL database if they wish to cache information).
Since I mentioned Nepomuk, it's time to discuss another common question/demand/complaint: KDE has this nice Strigi-Nepomuk thing going on...why aren't we using it for scanning music and storing information? There are a couple main reasons. The first is that Strigi and Nepomuk are optional, not required. We can't rely on the user installing them, and even if they are installed, we can't rely on the user to configure them properly (remember that we're going cross-platform, making it even less likely). The second reason is speed: Amarok's custom collection scanner is extremely fast and pulls out specific pieces of information with TagLib. Strigi is, by comparison, very slow (it calculates hashes of all files, which means it needs to read the entire file) and pulls out less information. On a local hard drive, it may not be a big issue, but it sure is a huge issue when you throw networked storage into the picture, which is a very common scenario. I've also heard, though don't remember specifics, that querying and such through Nepomuk is rather slow, compared to a normal SQL database. Regardless, though, remember that when the Nepomuk-based collection is finished, tracks sourced through a Nepomuk-based collection will have their metadata changes saved back to Nepomuk. So, it's not that the SQL collection is in place of Nepomuk -- they are entirely independent.
With those topics out of the way, on to the meat.
First, it is important to understand an important pair of facts. Number one: we are not database guys. Sure, we can store data in them, and more or less come up with a working schema, but none of us are gurus/wizards/jedis/etc. This leads in to number two: maintaining three databases was driving us crazy. Every time a minor schema change was needed, it had to be coded up for all three types of databases. Modifying a schema could be trivial for one database type, and super difficult (or impossible) for another. People would report bugs that we couldn't reproduce, only to find out that it was because we didn't quite understand how one database or another behaved (or in some cases, none of the active devs were using that type). And so on. So from the beginning of A2 development (and in our fantasies during A1 development) we knew we wanted just one database.
(We did actually look at abstraction layers like QtSQL and others. I'm not going to comment on them much, as I didn't do the evaluation, but in general they were found to not be flexible enough to handle all of our needs without doing some custom SQL coding (especially in the cases of things like schema changes), which kind of defeats the point. If you want to know more/want to insist that they are, try asking eean, as I think he did the evaluations.)
Now we had to choose the type. At first, SQLite seemed like a good choice. Using transactions, it's decently fast. It's pretty stable (those that complain about odd MySQL bugs should talk to markey, as he, being the SQLite maintainer in 1.4, can attest that SQLite's had its fair share). However, there were a few problems that in the end knocked it out of the running. The first problem is performance. Although for people with small collections it performs fairly well, people with large collections that switched to the MySQL or PostgreSQL backends in A1 would report enormous speed gains when operations performing complex or many queries were performed, such as adding many entries to the playlist, scanning files, or filtering/searching in the collection. Since we want to accommodate users with large collections just as well as those with smaller collections, and since digital music collections aren't getting smaller, the speed increase for our users with large collections was quite important. Many of our developers, after the switch to mysqle (as we call it, though that's not the official name), have noticed huge speed increases in their day-to-day use of A2, so that speed increase is carrying through to the embedded server as well as the normal server. That was the first knock against SQLite.
The other blow for SQLite came for a totally different reason. Many users (myself included) have multiple computers sharing a single Amarok database. Assuming all the computers have access to the music at the same mount point (and a few other things are configured right), this allows you to scan once, play everywhere, update the same ratings no matter where you play it, and more. Even if your aren't sharing the database among multiple computers, many users want their database stored on a particular server for speed, security, or backup reasons. If you think either of these isn't a common use-case, you'd be quite wrong. MySQL and PostrgreSQL were quite happy with this workload. It's a total no-go for SQLite, simply because it's designed for a different purpose. So SQLite had two big knocks against it. K.O.
However, just as we can't rely on the user to set up Strigi/Nepomuk correctly, we can't rely on them to get their tables set up in MySQL or PostgreSQL. So we needed the database to be embeddable, so that it could just work for the user without any setup necessary on their part. MySQL, with libmysqld, had the seeds of this in the 4.1 series, it works decently in 5.0, and it's becoming fully supported (AFAIK) in 5.1. PostgreSQL, on the other hand, does not have any such thing. (They have an interesting and cool concept of their own of embedded SQL though.)
So this leaves us with -- as you guessed -- MySQL. It may not be any particular person's favorite database (although it is for plenty), and I don't know how much overhead it really has in embedded form, but it fit the bill. It's both embeddable and can run standalone on the local or a separate machine (yes, this is not supported yet in A2, but it will be). It is fast and robust for large collections. It is well understood by the development team. And most of all, it is a single-backend solution that fills all of our needs.
If you're still unhappy about our decision, I'm sorry. We try to please most and can't please everyone. But we're the ones that develop and support this thing, and so we made a decision based both upon our needs as developers and the real-world use-cases from the collective feedback of thousands of users that have contacted us over the last few years. Please remember that even if most of the comments on the Dot, or to this post, (i.e. much of the sudden visible feedback) are from people that are unhappy with our decision, it is a decision that will actually suit the vast, vast majority of our users better than the other options we currently have.
We're a project that is known for being good to our users -- we listen to them, we try to implement features they want, try to be responsive with support. It's one of the things that got us where we are today. So please, dear readers -- put some faith in us. This has not been an easy decision -- we've discussed, we've argued, we've thrown things, we've made up, we've had an after-the-make-up orgy or two -- but in the end it's what we collectively felt was the right way to go, and we feel that, in the long run, it will make Amarok even mores awesomer. Hopefully you'll feel that way too.



You guessed it, it connects (notice the iPod collection on the left). After this, you can work with it like usual, or click the disconnect button and the collection will poof away back to things as you see them in the 2nd screenshot, allowing you to eject the iPod.You may have already noticed, that we have released Amarok 2, beta 2. This is a very exciting release for us as we have put an incredible amount of effort into features and bug fixes. This release pushes most of the significant work which was discussed or achieved during Akademy, such as changes to the Amarok core which will bring significant stability improvements and improved user experience.
We’ve made a rather large change with the removal of SQLite as our database backend, opting instead for the MySQL-embedded platform. As I know that many users might not be able to rationalise this change, allow me to explain. MySQL-embedded provides users with the performance boost of a standalone server without actually needing to run the server and without needing to bother with the rather complex procedures of intialising a database, users and permissions. It was also important for us to only support one database backend as we were constantly plagued with problems across different databases. Using MySQL-embedded will thus make it very easy for us to support standalone MySQL servers (in the future) for those that already have these services running, or may want to share databases over a network.
Notable mentions include improved scripting support, the return of lyric fetching and incremental scanner support. It’s important to remember that Amarok 2.0 will not be at feature parity with 1.4 as most of the code base has been rewritten. Many of the features that are not present have simply not been reimplemented due to lack of developer time, or we are unable to complete due to current technical limitations (such as equalisers, visualisations, replay gain).
We hope you enjoy this release.
A quick service announcement:
The Amarok project has started it’s annual fundraiser campaign Roktober. We’re hoping to raise a staggering €10,000 - for server costs, developer hardware, travel costs, expo and trade show exhibitions, developer meetings.
For every €10 you donate, you’ll go into a draw to win an iaudio7. This year we have two grand prizes and we will also give t-shirts to 4 second chance winners.
Also, please digg it.
digg_url = 'http://digg.com/linux_unix/Support_Amarok_during_Roktober_2008';

Lennart forgets that Amarok is definitely a contender for the most popular music player on desktop Linux today. It possibly has the most mindshare of any Linux music player project. Remember that a long time ago, Amarok supported aRts, xine, GStreamer and helix. Now we can take advantage of not needing to care about a specific implementation for an audio output device by using Phonon.
Lennart again:
“Use GStreamer! (Unless your focus is only KDE in which cases Phonon might be an alternative.)”
This implies that a developer should only use Phonon if and only if the developer is targeting a KDE application. Frankly, this reasoning is not very well formed and is shameful. Perhaps what Lennart meant to say belongs along the lines of “Developers using the KDE development libraries might want to use Phonon”.
Amarok is a perfect example of an application which uses the KDE development libraries, but is not tied into the KDE plasma workspace. A grand portion of GNOME users pro actively install Amarok on their system because it is their preferred application for listening to music. Time to pick up the slack and get with the times.
If there was a blogger award for “Most likely to make timely posts”, then in no possible world would I even be considered for the award. I could list some excuses that sound legit in my head, but the real reason I don’t feel motivated to post often (or on time) is because I’d rather spend that time in Google Reader reading everyone else’s exciting content (that was not sarcastic).
So, lets see… last time I posted I was en route to Akademy 2008 (the KDE developers conference). That was July 30th, now, a month and a half later I am back from Europe (which was amazing), GSoC is over (sad), and class has started (jury’s still out).
Current Status of the MP3tunes Amarok Service
The Good (Works)
The Bad (Doesn’t work)
The Ugly
There is one large issue I am still wrestling with. The details of the issue are complicated, but essentially it deals with the way Amarok handles remote tracks in playlists across sessions. Generally, remote tracks’ metadata isn’t cached by Amarok for use between multiple sessions. So, if you add an mp3tunes track to a playlist in Amarok, then restart Amarok and try to play that playlist the mp3tunes track is blank. Now, there exists a method for retrieving that metadata, however it was originally implemented synchronously. When you are retrieving metadata for any significant number of tracks (10+) synchronously, and each one of those retreivals is an HTTP Get request you end up blocking the GUI thread. At Akademy I hacked a way to do this asynchronously, but it is a really nasty hack. I’ve got code on my computer that implements this feature correctly, but it has the nasty habit of crashing Amarok every so often.
Between classes, marching band, homework, and other responsibilities I’m working on getting this ironed out and committed. Hopefully this will happen before the 2.0 release, because right now using MP3tunes in Amarok across sessions is slow and annoying.

It’s taken me the better part of a month to get home, settle in and upload my photos from Akademy to the cloud. Granted, I don’t have many photos since there were enough paparazzi at the event *glares at Bart and Sebas*.
The HDR which I’ve posted here proves that you can indeed create impressive shots only using free software, as long as you have a little perseverance and know how. Maybe Uga’s blogs will get there eventually :).
The rest of the images are on flickr.
Amarok 2 has two scripted services that are really cool. For one SeeqPod, that lets you search for any kind of music on the web and listen to it in Amarok. And the other one is LibriVox, that integrates the LibriVox service. LibriVox offers free audiobooks of public domain books. Both services are great and definitely deserve to be in Amarok 2.0.
The problem is that they were written a few weeks ago in Ruby. Now they need to be ported to QtScript as that is the only scripting language we allow for internal scripts to reduce the headache of script dependencies especially keeping the Windows and Mac releases in mind.
Among all the stuff that needs to be done before the release of Amarok 2.0 those two scripts were kinda forgotten until now and really need some love. If you want to help us get those two scripts back please let me know. Free cookies and hugs included ![]()
The Amarok team is proud to announce the first beta of Amarok 2.0, codenamed Nerrivik.
Please digg it and enjoy the release notes.

If you want to meet some KDE folks, want to see KDE 4.1 in action or if you have questions about KDE FrOSCon in St. Augustin is the place to be this weekend.
Come and say hello at the KDE/Amarok booth and in our dev-room.
We have interesting talks for everyone in our dev room:
Saturday:
11:15 KDE Edu (Frederik Gladhorn)
16:30 KDE Community - How to get involved (Alexandra Leisse and Lydia Pintscher)
Sunday:
11:15 Amarok 2 (Sven Krohlas and Lydia Pintscher)
15:15 Kubuntu - A KDE desktop (Marcus Czeslinski)
16:30 KDE Grill - Ask questions about KDE you always wanted us to answer (KDE dream team ;-))
And on Saturday 15:15 Sebastian Kügler will talk about KDE 4.1 in his talk “Don’t look back” in the main track.
Hope to see you there.
Oh btw: Last year’s social event = best social event of 2007. Let’s see if they can beat Akademy this year ![]()
I should have blogged much more from Akademy, but having hardware which insisted on frequently overheating made life a little difficult. I’m still in Belgium - in Bruges actually, blogging from my N810 courtesy of Nokia. More on that later.
I’ll start by saying that l think we had very productive week, getting lots of design and development done towards our goals for Amarok 2.0. We focused heavily on critiqueing the user interfaces of the major components in our GUI: the playlist, context view and each of our sidebar browsers. In between hacking hours, Mark, Leo and myself hosted design and release-breaking-issue sessions. These have provided valuable direction and motivation to all of our developers, so you can look forward to some exciting progress as we gear up to an imminent beta (and eventually final) release!
We also brainstormed a number of post 2.0 ideas such as interface adjustments to enhance your application experience, including, but not withstanding, mobile and embedded devices. Yes, that’s right folks, before too long (hopefully) you’ll be able to run Amarok on your favourite (maybe) small form factor device. The main use case would be for remote collections and streaming, but we’re not going to shut out users who like carrying 8GB of music on memory cards.
All this talk of small form factor devices is making me drool over my N810 as I write this. Some observations: all this very slow and awkward typing makes me much more coherent; leeching off random wireless to blog has never been easier; and, the inbuilt GPS has already proven invaluable to the Amarok crew as we used it to find our restaurant when we got lost cycling through the mid-west of Belgium. Note: never cycle 15km immediately after eating a huge meal, and never let Casey on a bicycle.
Finally, a big thanks to all that made Akademy so great: the organisers, the participants, the speakers, the boffers, the paparazzi, and all the people that were responsible for either brewing, frying or coating things in sugar.
Finally back at home. Less tired after sleeping in my own bed again. Missing everyone. Caught up on stuff. Laundry still piling up
Akademy was great. Very big THANK YOU to Wendy, Bart and their team. You did an amazing job.
Akademy was quite productive. Talked to lots of people about lots of stuff. Wait for some interesting things to happen in the next weeks and months.
I took the time to talk to some of our Google Summer of Code students about their experience. I wanted to find out where we as a community are doing very well and what we can improve in their opinion. Of course it wouldn’t be of much use if only I knew this so let me share it with you:
Thanks everyone who had a chat with me about their GSoC. If I didn’t find the time to talk to you at Akademy or if you were not there feel free to ping me on IRC. I will make sure your feedback gets heard.
I hope a lot of our students stay with KDE after GSoC. You have done an amazing job. Rock on!
PS: Thanks to everyone who signed my Moleskine at the social event. I considered doing nasty stuff to Sebr when he took it away from me but I have to reconsider this now since it is the BEST THING EVAR
and will be reminding me of Akademy for years to come.
*hug*