Bembel-B Blog


Scrobbling Everywhere All the Time

I must confess I’ve become quite a fanboy. :) So what would be more important than keeping track of as much music playing as possible. Scrobbling the plays of my PC audioplayer Amarok and Foobar2000 ain’t that spectacular, but feeding statistics of my mobile MP3 Player SanDisk Sansa e200 and my stand-alone player Pinnacle SoundBridge HomeMusic (licensed by Roku) I consider being more of that Social Music Revolution

Scrobbling Sansa e200 with Rockbox

Precondition is using the great alternative Firmware Rockbox. It already has the Audioscrobbler logging built in. To submit the logs I use the PC application QTScrobbler under Linux (and occasionally Windows). That’s very easy and convenient. Just be sure to set your Sansa’s clock somewhat correct.

Scrobbling SoundBridge with Firefly Mediaserver

To gain access to my whole music collection without having a PC running, I’m using the fine Linksys NSLU2 NAS running the Firefly Mediaserver (aka. mt-daapd) with a cheapo 160 GB USB HDD (Storage) and a 2 GB USB Flash Drive (OS) attached. I’ve had a working setup using the alternative NSLU2 firmware Unslung, but soon switched to Debian ARM, for its greater versatility and more straight forward configuration.

I’ll write more detailed posts on the NSLU2 soon, especially regarding Firefly and fixed-point Transcoding and Radio. But for now a quick overview on the setup, which should be possible on other platforms and for any streaming client too.

I obtained the Firefly Mediaserver prebuilt from the Firefly website. Installation is quite easy and well documented.

Submission to is done by the Python application Lastfmsubmitd. As the name suggests it’s a daemon permanently waiting for data to be submitted. That data is gathered from text files placed e.g. in /var/spool/lastfm. Under Unslung I had to manually install it from source (python install), and for Debian it’s in the apt repo (but I built a deb package of the recent version found in Debian unstable).

Creating the data files is done periodically by a shell script based on what I found in the Firefly Forum. It’s run every 5 minutes by cron and queries the “last played field” of Firefly’s collection database and outputs results to Lastfmsubmitd’s spool directory.
That’s my current shell script (converting GMT+1 timestamps to UTC by substracting 3600 seconds):


# fetch newly played songs from fireflydb and write
# into lastfmsubmitd readable format

# config

# get last run time
if [ -e "$LASTFILE" ]

# get last database file date
if [ -e "$DBLSFILE" ]

# exit when database file unchanged
if [ "$DBLSRUN" == "$DBLSNOW" ]

# log file date

# query database
OUTFILE=$(mktemp "$TMPDIR"/mt-daapd-XXXXXXXX)
"$SQLITE" "$DATABASE" 'SELECT artist,album,title,track,song_length,time_played FROM songs where time_played > '"$LASTRUN"' ORDER BY time_played ASC;' | gawk -F '|' '{ printf "---\nartist: \"%s\"\nalbum: \"%s\"\ntitle: \"%s\"\ntrack: %s\nlength: %d\ntime: !timestamp %s\n",$1,$2,$3,$4,$5/1000,strftime("%Y-%m-%d %T",$6-3600) }' > "$OUTFILE"

# place non-zero result into spool, else drop file
if [ -s "$OUTFILE" ]
  chmod 664 "$OUTFILE"
  rm "$OUTFILE"

# log query date
echo "LASTRUN="`date +%s` > "$LASTFILE"

Downside of this solution is, Firefly will only consider a track as played, if it has been completely and continuously been played. So skipping or pausing a track will cause it to not be submitted.
Also there’s no separation between Podcasts and the rest of my music collection. What I haven’t tried yet, is the behaviour when playing web radio via Firefly playlists, as I do all radio streaming directly through the SoundBridge user interface.
To iron out the downsides using the same approach, the first one would need changes to the Firefly code I guess, the others could probably be fixed modifying the shell script.



Musical and social networking, acoustic fingerprints, music file tagging

Extend your musical experience, get your music files tagged correctly easier. Social Music Revolution

This free service is a combination of a musical and social network web-application based on the Audioscrobbler technology. You have to submit the music you listen to with your PC’s mediaplayer(s) via plugins, e.g. for me Rhythmbox, XMMS, Winamp. Based on that data, charts of your most “favorite” music are calculated and compared to other charts. Thereby you will be recommended artists you haven’t listened to yet and also people with comparable musical taste. You can also listen to webradio in context to your taste. Paying subscribers will get their own personalised webradio.
There are lots of other features (like fan listings and groups), so best check it out yourself.
I haven’t done research on whether this service is thrustworthy, but they seem to be quite nice ppl there! :) Privacy is taken seriously (server logs are deleted every 3 days) and the content is Creative Commons licensed. I guess they are enthusiasts (musically and IT-related) and earn their money through subscriptions, Amazon affiliation, reputation.
In the future’s database will be fully coherent with MusicBrainz, in order to avoid collecting badly/differently tagged music data. So if available, use a plugin with MusicBrainz integration and/or tag your files like in the MusicBrainz database.
You can take a peek at my userpage at


A database collecting metadata (artist, album, title etc.) for every audio track. Tracks are identified by their acoustic fingerprints (TRM); that’s some checksum magically generated by the amplitude, frequency spectrum, length of a audio track, as far as I understand. The data is user-maintained.
On the project website you can browse the database, download software and keep yourself informed about the project’s development.

Tagging your music files (with Linux)

I tried 3 MusicBrainz enabled taggers for Linux. Most of my problems are probably caused by my old and broken Linux installation (Fedora Core 3), where the RPM database got wiped. With RPM and up-to-date software this shouldn’t be that much of a hassle.
So unfortunately I only got QMBTagger to run. There’s an (new) official MusicBrainz tagger called Picard Tagger, but I obviously failed to update from source to the required wxWindows/wxPython version. Kid3 compilation aborted with an error.
There are many tagging applications around, but my favorite so far is EasyTag! But no MusicBrainz support (at least in my version).
Guidelines for MusicBrainz compliant tagging seem to be: Use correct English upper- and lowercase spelling (e.g. “Tales from the Crypt” and not “Tales From The Crypt”), keep foreign spelling as-is (what about non latin letters?), keep “The”-prefix (i.e. “The Doors” and not “Doors”), don’t add anything to the album title like “CD2” or “EP”. But this is just my impression! I bet there’s an official guideline somewhere on the project site. And in the end, as this is user-driven, any spelling could be “correct”.. :/
And there’s also libid3tag and its command line utilities, which can be handy for mass tagging and checking tags..

Other interesting music related sites

A vast database of artists/bands featuring professional artist and album reviews, style categories, discographies and more.

A community-based discography database.

A neat 2D map displaying artists’/bands’ relations in style and involved persons(?). Formerly called Musicplasma.

A database for drum & bass, jungle and related music.

A (mainstream) music portal in German language including the commercial “rororo Rock Lexikon”.


[2006-04-22: Add tags.]

Blog at