make amarok, ummm, amarawk

May 23, 2007 under Amarok, Linux, MySQL

I mentioned before that since I dumped Windows XP on my desktop computer in favour of Kubuntu, I’ve been using Amarok as my replacement for iTunes. I like Amarok much better, actually. But I noticed that Amarok would perform terribly when it was switching tracks, loading albums, finishing a playlist and more. Being a music dork, I have a pretty big collection – we’re talking > 30 GBs. And this may have been part of the problem.

A default install of Amarok will use an internal implementation of SQLite to manage your music library. SQLite is a nifty embeddable database engine that developers can embed into their apps. It’s well suited to small data sets and a minimal number of transactions. I should’ve first clued in when it took Amarok over 15 minutes to initially scan my music folder and store the info in the music library. Rifling through the file system of 7000 songs to get artist/album/title/genre/track number/album art info and then run INSERT queries shouldn’t take that long on a P4 2.4GHz with 1GB of RAM, but it did. And then the general sluggishness followed.

Thankfully, Amarok also supports the use of MySQL and PostgreSQL to store music library data. I chose MySQL, mostly because I haven’t installed PostgreSQL yet, and don’t have a pressing need to. Let me tell you, it took less than 5 minutes to rescan my music folder and load the data into the music library, and the sluggishness is gone completely.

For future reference, or for those interested in learning how to configure Amarok to use MySQL, do the following (assuming you already have MySQL installed and ready to rock):

Log into MySQL with your root account:

$ mysql -p -u root

At the MySQL prompt, create a database. I called mine ever-so-apropriately ‘amarok’ 🙂

CREATE DATABASE amarok;

Now let’s use our new database and create a user. Again, here I go with the appropriateness, and called mine ‘amarok’. I won’t tell the password I chose, so let’s pretend it’s ‘12345’:

USE mysql;
GRANT ALL ON amarok.* TO amarok@localhost
IDENTIFIED BY '12345';
FLUSH PRIVILEGES;

The fire up Amarok and go to the settings dialog under Settings | Configure Amarok. Next, click on the Collection tab. Change the value of the Database listbox to “MySQL”. If the music is on your computer, keep the host as “localhost”, the port can probably remain as 3306 (unless you’ve changed your MySQL config), and the name of the database that you created for it (in my case, it’s “amarok”). Finally, the username and password, in my case, are “amarok” and “12345” .

amaRAWK!

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 1 »

One Response to "make amarok, ummm, amarawk"

  • Carissa says:

    Thank you! I’ve spent two weeks trying to find a solution for a somewhat different problem: forcing Amarok to compile my Collection from media on a secondary mounted drive. This gave me enough of an insight to find a way to get things up and running.

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>