Karmascrobbler

Rio Karma

This little Java program let you update your Last.fm (or any Audioscrobbler-powered site) profile with the tracks you played on your Rio Karma.

It is command-line only and should work on any Java-capable system. Please don’t hesitate to send me feedback, requests, or comments about it.

Usage

You should invoke the program this way:

java -jar karmascrobbler.jar parameters

Where required parameters include:

-ip karma_ip
The IP address of your karma or its domain name.
-lfmuser user
Your last.fm user name.
-lfmpass pass
Your last.fm password.
OPTIONAL parameters:
-riopass pass
Your Karma password, in case you set it up.
-rioport port
The port to use when contacting your Karma. I don’t know if this may be useful.
-collection file
The local file in which to save your collection. By default, it is collection.xml in the current directory.
-forcedate
Forces the date of the latest played track. All the preceding tracks play times are calculated from this one. The value should be given in the following format: “YYYY-MM-DD hh-mm-ss”. Don’t forget the quotes!
-ignoreclock
Ignores the play times given by the Karma, and use the date given with the -forcedate option as a base. Useful if your Karma’s clock is broken.
-debug
Shows debug traces about the session with the audioscrobbler server.

So a typical session would be like:

java -jar karmascrobbler.jar -ip 192.168.1.10 -lfmuser Foobar -lfmpass letmein -riopass letmein

The first time you run Karmascrobbler, it won’t submit anything but just cache your collection. After that, go listen a few tracks and run it again!

How it works

The Karma keeps, for each track, the number of times this track has been played and a timestamp of the last play time. Karmascrobbler uses a local cache which is a copy of your Karma collection the last time you synced it. When you run Karmascrobbler, it connects to your Karma, fetches your complete collection, and compares it with the cache in order to know which tracks have to be submitted. Once the Audioscrobbler server accepts all the tracks, your local cache is updated with the Karma collection.

Limitations & known bugs

  • You must access your Karma through the Ethernet interface. I don’t know of any documentation about the USB protocol or library that can use it.
  • If you play the same track twice, only the latest play time will be known for submitting. Unknown play times are calculated backward from the length of the track and the oldest known play time.
  • I don’t know how the Audioscrobbler server would behave if you send overlapping tracks (e.g. listening to your Karma and desktop player at the same time?) or use another plugin before submitting your Karma tracks (tracks submitted in the past). The server might reject your tracks in this case.
  • After using Karmascrobbler, I am not able to load additional tracks to the device using RMM until I switch it off then back on. Not a big deal, but I don’t know what I’m doing wrong.
  • I’m not exactly sure in which timezone does the Karma stores its play times. Right now I’ve been adopting settings that work for me, but your mileage may vary. After submission, please check on your profile page whether the play times are correct.

Download

Karmascrobbler 0.1.4, released 2006/02/26:

Credits

  • XStream, used to easily save/load the music collection on disk.
  • Pearllib, used to access the Karma and fetch the collection.