I spent much of this weekend configuring amaroK, a music player/organizer recommended to me by Rob.
Here’s a screenshot (crummily scaled ‘cuz I’m lazy – click for less scaling):
The thing that triggered all this is that I was sick and tired of the way gkrellmms kept crashing while I played Internet radio stations, and would take out both xmms and gkrellm in the process. I decided I wasn’t going to take it anymore, and since just the other day Rob was crowing about amaroK, I figured I’d try that.
amaroK gives you a good way to search for your music, but only if the ID3 tags are correct. It offers a way to look up track info on MusicBrainz, but I found that only worked about 25% of the time for me, so it wasn’t that big a help. Manually updating so many tracks is what took me so long in setting this up (I keep finding other tracks that have wrong info, so I suppose I’m still not done). Actually, amaroK offers a comparatively nice way to update track info, especially for song genre, which in turn makes my pod! more useful. As you can see in the screenshot above, amaroK can also download album covers, which is nice eye candy (though not particularly useful). Unfortunately, it seems to get this wrong about 10% of the time, and I end up listening to Bat Boy and seeing Beauty and the Beast (I’m not even joking, there). Still, for the times that it works, it’s pretty.
As amaroK scripts (what you and I might call plugins) seem to only work never, I found no love with the provided alarm script. As I use my mp3 player to wke me up in the morning, this was rather important; so I compensated with perl:
#!/usr/bin/perl
use strict;
$ENV{DISPLAY} = ":0.0";
# dcop command
my $dcop = "/usr/bin/dcop";
# amaroK binary
my $amarok = "/usr/bin/amarok";
# aumix binary
my $aumix = "/usr/bin/aumix";
# volume to play at
my $vol = '39';
my $debug = 0;
# first; ensure that amarok is running, if it isn't running, run it
my $testPlaying = `$dcop amarok player isPlaying`;
if (($? > 0) || ($testPlaying =~ /call failed/) || ($testPlaying =~ /^Error/)) { # not running
($debug > 0) and print "amaroK not running; starting\n";
`$amarok &`;
}
elsif ($testPlaying =~ /true/) { # running, but already playing
($debug > 0) and print "amaroK already playing; exiting\n";
exit 0;
}
($debug > 0) and print "amaroK not playing\n";
# ensure that the volume is at a reasonable level
`$aumix -v$vol`;
# select random music to play
`$dcop amarok playlist clearPlaylist`;
`$dcop amarok playlist repopulate`;
#`$dcop amarok playlist shufflePlaylist`;
# if we're going too fast, amaroK will try to play before the playlist is
# populated
sleep 2;
# start playing!
`$dcop amarok player play`;
exit 0;
and cron:
# alarm clock
# for work, every weekday
0 7 * * mon-fri /home/tekniklr/mystuff/programs/amarok_alarm.pl >/dev/null 2>&1
# for the other odd days when I have to get up
#0 10 * * sat /home/tekniklr/mystuff/programs/amarok_alarm.pl >/dev/null 2>&1
So far, I like amaroK okay, but it has some problems (besides the ones I mentioned earlier). For one, when I first used it, it crashed every 10 minutes. I fixed that by using the gstreamer output engine instead of xine, and by ensuring that the databse was SQLite instead of MySQL. For two, it’s kinda slow to decide to actually stop playing. For three, though it has a nice freedesktop compliant tray icon, it doesn’t actually hide when you minimize it in Fluxbox, unless you right click on the icon and minimize it from there (that one’s probably not the amaroK people’s problem, admittedly). And for four, whenever you are messing around in any other tab, it will jump you back to the ‘Current’ tab whenever a new song starts, which is really distracting (and possibly dangerous).
As it’s still young software, I’m hoping it grows out of this stuff in the future. Until then, it’s still kinda fun (and using cron as an alarm makes me 1337), and at least I’ve finally given a good portion of my music correct ID3 tags.



