Skip navigation.
Just your average bearded geek

Karmascrobbler

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

Right now, it's a command-line program only - I plan to add a GUI though. It should work on any Java-capable system. Please don't hesitate to send me feedback, requests, or comments about it.

Please subscribe to the Karmascrobbler RSS feed if you want to be informed of new releases.

Licence

This program is distributed under the GNU General Public Licence. You can get the source code and freely hack it - however, I'm not responsible if it breaks your Karma or decides to go postal and kill your dog.

Usage

Right now, Karmascrobbler is command-line only. I plan to add a GUI once I have time.

You should invoke the program this way:

java -jar karmascrobbler.jar parameters

Where MANDATORY 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 are:

-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 to put 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 discussion 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. If they are not, then please inform me, telling me what is the difference between the displayed and real play times, and the timezone you live in (send a message through Last.fm private messenging, username: Gnurou).

Download

Credits

Thanks to the authors of the following software which are used by Karmascrobbler:

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

Thanks for the code

I have added your source code to my project.  It is now available on SourceForge.net.
Please feel free to criticize my French translation.

Hi!I use your source code

Hi!

I use your source code with my Vibezscrobbler. You can find it here: http://emgeh.m-seidl.com/vibezscrobbler/

Thanks

Nice! I'm glad it was useful

Nice! I'm glad it was useful to you. I may update this program one day (GUI is planned), so stay tuned!

That would be wonderful

That would be wonderful

Support for linux?

When I try and run this on Kubuntu (Gusty 7.10) with Sun Java 6 JRE, I get the following (user and passwords changed to protect the innocent):

lingenfr@MPC-MBR:~/Desktop/karmascrobbler-0.1.4$ java -jar karmascrobbler.jar -ip 192.168.1.108 -lfmuser ****** lfmpass ****** -riopass ******
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/gnurou/karmascrobbler/Main (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

Strange - I just tried on

Strange - I just tried on the same configuration (I only use Ubuntu actually) and it worked perfectly. Maybe you can try to build it yourself from source, after installing the JDK?