Picture of Jürgen Kreileder

Last.fm for Rhythmbox – New Style

Just like a lot of other users I like to scrobble my played tracks to last.fm. Unfortunately Rhythmbox provides no way to love a track. The last.fm plug-ins for Windows and OS X have been modified to scrobble through the last.fm client some time ago but the Rhythmbox plug-in still submits directly. That is until now…

Rhythmbox and lastfm

I have written a new last.fm plug-in for Rhythmbox today. Instead of scrobbling directly like the old one, it submits tracks via the lastfm client application. The client displays additional information about the currently playing song and you can love and tag the song with it.

The source code is available as a patch against Rhythmbox 2.90.1 (git snapshot 20120108): scrobbler-v3t.patch
You can apply this patch with:

patch -NEp1 < ~/scrobbler-v3t.patch

Ubuntu Oneiric Ocelot users can get precompiled packages from my APT repositories by running these commands in a terminal:

$ sudo add-apt-repository \
    '/static/debian/rhythmbox/ main'
$ wget /static/gpg.asc -O - | \
    sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install rhythmbox rhythmbox-plugins lastfm

To enable the new plug-in go to Edit » Plugins. Disable the “Last.fm” plug-in and enable the “New Style Last.fm Scrobbler”.
If you enable this scrobbler plug-in, you have to disable the old Last.fm plug-in! Otherwise you will have two plug-ins which will both submit to last.fm at the same time. Only use one at a time!

Note that this first version of the plug-in does not start the lastfm client automatically! It will scrobble only if you start the client manually. I will fix this in the next version.

Feedback, postive as well as negative, is very welcome. If you want to report a bug, please include the output of “rhythmbox -D rb-scrobbler-plugin” and the tags of the song you wanted to scrobble.
If you want to report a crash, providing a gdb backtrace would be nice.

You might also want to take a look at this thread on the last.fm development forum.

May 20th, 2007: v2 of the plug-in is available now. lastfm gets launched automatically now.
May 22nd, 2007: v3 is available. The patch and the Ubuntu package have been updated: Changes since v2
May 25th, 2007: v3a: Updated patch and deb for the new Ubuntu Gutsy version of Rhythmbox.
May 29th, 2007: v3b: Updated patch and deb for the new Rhythmbox release.
May 31st, 2007: Updated patch Ubuntu package.
June 1st, 2007: Added APT repositories for Ubuntu Feisty and Gutsy.
June 28th, 2007: v3c: Updated patch and debs for the new Rhythmbox release.
August 16th, 2007: v3d: Updated patch and debs for Rhythmbox 0.11.2.
November 14th, 2007: v3e: Updated patch and debs for Rhythmbox 0.11.3. Add Hardy repository.
November 30th, 2007:Updated gusty and hardy builds. Include fixed Croatian po file from Franko Burolo.
February 7th, 2008: v3f: Updated patch and debs for Rhythmbox 0.11.4. (Thanks to Iain Buchanan for notifying me of the missing patch!)
May 31st, 2008: v3g: Updated patch to apply cleanly to Rhythmbox 0.11.5. (The debs for hardy have been at 0.11.5 for quite a while).
October 15st, 2008: v3h: Updated patch to apply cleanly to Rhythmbox 0.11.6. Ubuntu packages are available for i386, amd64, and lpia now.
October 20st, 2008: v3i: Updated patch to apply cleanly to the real Rhythmbox 0.11.6 release. v3h was for a later version from SVN.
April 24th, 2009: v3j: Update patch to apply cleanly to Rhythmbox 0.12.0. Provide debs for Ubuntu Jaunty.
November 4th, 2009: v3k: Update patch to apply cleanly to Rhythmbox 0.12.5 and provide debs for Ubuntu Karmic.
November 29th, 2009: v3l: Update patch to apply cleanly to Rhythmbox 0.12.6 and provide debs for Ubuntu Lucid too.
April 25th, 2010: v3m: Update patch to apply cleanly to Rhythmbox 0.12.8. Provide debs for Ubuntu Lucid.
Jun 3rd, 2010: v3n: Update patch to apply cleanly to Rhythmbox 0.12.8git20100602. Provide debs for Ubuntu Maverick Meerkat 10.10.
Jun 13th, 2010: v3o: Update patch to apply cleanly to Rhythmbox 0.12.8git20100611. Updated debs for Ubuntu Maverick Meerkat 10.10.
October 10th, 2010: v3p: Update patch to apply cleanly to Rhythmbox 0.13.1. Provide updated debs for Ubuntu Maverick Meerkat 10.10.
April 4th, 2011: v3p: Update patch to apply cleanly to Rhythmbox 0.13.3. Provide debs for Ubuntu Natty Narwhal 11.04.
October 16th, 2011: v3r: Updated patch for new plug-in infrastructure in Rhythmbox 2.90.1. Provide debs for Ubuntu Oneiric Ocelot 11.10.
December 23rd, 2011: v3s: Updated patch. Provide debs for Ubuntu Precise Pangolin 12.04.
January 14th, 2012: v3t: Update patch and debs for Ubuntu Precise.

This article Jürgen Kreileder is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

189 Comments

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post. Both comments and pings are currently closed.

Matthijs van Wolferen said

Is there a problem with the Rep for Ubuntu on AMD64? I keep getting an error message that the deb can’t be reached.

Matthijs, there isn’t an amd64 repository yet but I’m about to set up one. Stay tuned.

Jan said

Just wanted to thank you for this nice patch!
It works flawlessly and me and my friends are grateful.
Keep up the great work!

Theodore said

Matthijs, I use the package that vern posted before for the amd64 and works fine:
http://ribbed.us/linux/rhythmbox/rhythmbox_0.11.3-0ubuntu3jk1g_amd64.deb

mollwe said

Gabriel, I had the same problem but I found a solution that worked for me. I changed the soundcard in last.fm client options under “Radio” section “Audio”. This makes Rhythmbox work with scrobbling using the last.fm client but I can no longer listen to radio stations in the client. I don’t use that feature so I don’t mind.

Matthijs van Wolferen said

Sorry guys, I thought it was allready up! I’ll try the .deb posted. Thanks for the support. If I get it working I’ll post my ranting approval here. :D

Matthijs van Wolferen said

Yes, worked! I have to say I’ve got the feeling I want to switch betweens plug-ins the coming days. The problem I have is that I like the fact that I can now love and hate tracks, and get information about the track I’m playing like in Amarok, but now via the Last-plugin. I just wish that I could have all this within the Rhythmbox program, because the plus the native plugin has is the user stations you can play in Rhythmbox itself.
Then again, track-submission is a lot better…argh..I’m in two minds.:D

Matt, I understand you! I’d prefer to have the love/hate thing and the additional song information integrated into rhythmbox too. Unfortunately I don’t have the time to implement it myself. It shouldn’t be too hard to do though, the hardest problem probably is to find a good way to integrate it into rhythmbox’ GUI.

Ben Marvin said

When is this going to be merged with the official Rhythmbox? This is way better than the plugin they’ve got going on.

Ben Marvin said

My current version of rhythmbox is 0.11.5 and I can’t get it to “upgrade” to this version with the plugin.

Ben, Ubuntu has just released a new version of rhythmbox. I’ll provide an updated build of my package tomorrow.

Ben Marvin said

Thanks so much. I guess I’ll have to suffer through the old one till then.

I’ve released a new build now. To prevent further upgrade problems you might want to use pinning. Add the following to /etc/apt/preferences:

Package: rhythmbox
Pin: release l=jkreileder
Pin-Priority: 999

(untested but it should work :)

J said

>>>I’ve released a new build now. To prevent further upgrade problems you might want to use pinning. Add the following to /etc/apt/preferences:

>>>Package: rhythmbox
Pin: release l=jkreileder
Pin-Priority: 999

What does that do?
How can I tell Ubuntu to only update rhythmbox from your repository? Or does that line make so?

J, those 3 lines should do exactly that. They tell apt, that rhythmbox from my repository (identified via the label ‘jkreileder’) has a higher priority than rhythmbox from other repositories.

James said

I was using this with gutsy and liked it a lot, but I upgraded to hardy yesterday and lost it. Now I can’t get it to download your version of rhythmbox – it keeps forcing the version in the main repository. I tried the pinning like you describe but it acts like it can’t find your version when I have that in the preferences and doesn’t install anything.

James, it should be enough to update the line for my repository in /etc/apt/sources.list. Just replace “gutsy” with “hardy”.

hex said

I’ve just tried to install from your repository. Rhythmbox won’t play anything. It starts playing a song, tells its name to the last.fm client, but the song doesn’t play, it stays at 00:00. I can start different tracks — they switch, but don’t play. When I try to quit Rhythmbox, it usually hangs and I have to force kill it. I’m using Hardy.

hex said

Cancel that. Looks like the Last.fm client blocks ALSA. If I first start Rhythmbox, then Last.fm, the latter tells me that ALSA is in use and I can play songs fine.

Nice plugin, thanks!  But couldn’t the “love” feature be implemented in the plugin itself? Having to run a separate qt application doesn’t always make me feel good, especially when I’m doing so on an EEE PC. ;)  I’m just curious, perhaps there are reasons for using the client?

hex, you might want to check why ALSA’s dmix doesn’t work for your card. It should be enabled for most cards by default nowadays. Another work-around migt be using PulseAudio, I haven’t tried that yet though.

The main reason why I use this plugin and the last.fm client is that it provides more reliable scrobbling and more information about the currently playing track. I’d prefer to have this functionality implemented in Rhythmbox directly too but nobody has implemented that yet and I don’t have the time to do it myself.

James said

I was able to get it from source. for some reason, it couldn’t read the deb repository listing – maybe because my computer is amd64.

So said

So you’ve released v 0.11.5? I’m using 0.11.5 and wanna verify I’m using your version – you didn’t write in you post that you’ve released 0.11.5

Good point! I usually track the latest Ubuntu packages, the debs for hardy have been at 0.11.5 for quite a while. I’ve updated the patch to apply cleanly to 0.11.5 now.

NONAME said

Hi Is there a package for amd64 Hardy Heron. If not could you please help me with this. I am unable to patch or download packages from sudo apt .

JohnnyPea said

This one is great! I was in worry I would not be able to scrobble my music in Ubuntue. Thx man now I can ;)

OMG said

I JUST WANT TO SCROBBLE! its not working. i have a X64 machine!

PLEASE I JUST WANT TO SCROBBLE

hanzo said

Great plugin! Last.fm in rhythmbox was so lousy, but this solves the problem in the best possible way! Thanks a lot for it!

James said

What directory should I be in when I apply this patch?

Hadret said

Will there soon be new version of patch for Rhythbmox 0.11.6? (:

[…] się jednak, że powstała alternatywna wtyczka dla Rhythmboksa wspierająca serwis Last.fm – New Style Last.fm scrobbler. Co ją odróżnia od dotychczasowej wtyczki scrobblującej? Mechanizm. Rhythmbox zaczyna używać […]

hanzo said

strange. The plugin worked really great for some time but now it somehow seems to have stopped. Rhythmbox still starts the last.fm client and everything, but the songs I play don’t get passed on to the client, and nothing shows up there (in the now playing box). There was no upgrade or anything though. Rhythmbox still is 0.11.5-0ubuntu8jk1h (on Hardy 32).
Anyboby a clue on what could have happened?

hanzo said

even strager things happen…
now it’s working again.
but I haven’t done anything.
whatever. :)
sorry to have bothered you.

monikgtr said

I got this message:

monikgtr@monikgtr-desktop:~$ patch -NEp1 < ~/scrobbler-v3g.patch
bash: /home/monikgtr/scrobbler-v3g.patch: No such file or directory
monikgtr@monikgtr-desktop:~$ patch -NEp1 < ~/Packages/scrobbler-v3g.patch
can’t find file to patch at input line 25
Perhaps you used the wrong -p or –strip option?
The text leading up to this was:
————————–
|http://blog.blackdown.de/2007/05/19/lastfm-for-rhythmbox-new-style
|
|v3g: * Update for rhythmbox 0.11.5
|v3f: * Update for rhythmbox 0.11.4
|v3e: * Update for rhythmbox 0.11.3
|v3d: * Update for rhythmbox 0.11.2
|v3c: * Update for rhythmbox 0.11.1
|v3b: * Update for rhythmbox 0.11.0
|v3a: * Update for Ubuntu rhythmbox 0.10.90
|v3: * Start client in system tray
| * Try last.fm (beta client) before lastm
| * Reduce bogus RESUME/PAUSE commands
| * Misc small bug fixes
|v2: * Autostart lastfm
| * Bugfixes
| * Ignore tracks shorter than 30s
|v1: * Basic functionality, no autostart of lastfm yet
|
|Signed-off-by: Juergen Kreileder
|
|
|diff -urN rhythmbox-0.11.5.orig/configure rhythmbox-0.11.5/configure
|— rhythmbox-0.11.5.orig/configure 2008-03-15 23:55:17.000000000 +0100
|+++ rhythmbox-0.11.5/configure 2008-05-31 01:03:57.000000000 +0200
————————–
File to patch:

what do I do next? :S

czaber said

What about us – Rhythmbox 0.11.6 users? Your plugins sounds really great! Good luck.

Christian said

This is so great :-D

Elwro said

Works great with Rhythmbox 0.11.5 on Ubuntu 8.04.1. Fantastic work!

Jonty said

Would it be possible to get this merged with the official plugin, so that if the client is running it uses it, otherwise it uses the internal implementation? (And obviously pushed into upstream rhythmbox).

We’d love to see this happen here at last.hq….

YEAH!!!! This fix the “now playing” too!!!
Thank you man!!! This plug in kick ass! :DDDD

Ben Marvin said

Any love for Intrepid Ibex yet? I’m testing the alpha and miss the plugin already!

steev said

Hi thanks for this, works very well. ubuntu hardy 8.04

Darck said

repozitories seems not to work.

Darck said

Sorry – it wokrs. Ask rhythmbox developers weather they can add yours plugin to official rhythmbox release.

Agustin said

same doubt as “monikgtr” a few posts above me, please help

Master Onion said

Here is a patch I hacked up together against rhythmbox-0.11.6:

http://www.yousendit.com/download/bVlETmZUTStGOFJjR0E9PQ

I haven’t tested it yet, but it should work just fine, since the original patch consists only of some hooks in Makefile.* and configure.* and a new subdirectory in plugins/scrobbler. I basically recreated the same changes in the rhythmbox-0.11.6 tree structure.

The link will be available for 7 days. I think it is enough time for the maintainer of the patch to put it somewhere else. :)

Master Onion said

OK, I’ve now tested it in my debian machine and it works. :)

Master Onion said

OK, previous patch had a little mistake in file plugins/scrobbler/scrobbler.rb-plugin (an extra line with a “=” at the end). But this one should fix it:

http://www.yousendit.com/download/bVlETmZWT010QTN2Wmc9PQ

Sorry. :)

Paool said

how about intrepid repo? :)

Thanks for the patience, guys! New packages for Hardy and Intrepid are available now. From now on for i386, amd64, and lpia.

Agustin said

File to patch: ????