Not working with Rhythmbox 0.13.3 on Fedora 14.

Bug #816503 reported by Graham White
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autoqueue
Fix Committed
High
Eric Casteleijn

Bug Description

I was about to start writing a similar library when I searched around to find one is already in production so let me start by saying thanks!

I installed autoqueue and the rhythmbox plugin on Fedora 14 (32 bit) with Rhythmbox 0.13.3 and the plugin fails to load with some sort of metaclass issue. The relevant output of "rhythmbox -d" is below:

(16:44:20) [0x9dcd0d0] [rb_python_module_init] rb-python-module.c:406: Init of python module
Traceback (most recent call last):
  File "/usr/lib/rhythmbox/plugins/rhythmbox_autoqueue/__init__.py", line 78, in <module>
    class AutoQueuePlugin(rb.Plugin, AutoQueueBase):
TypeError: Error when calling the metaclass bases
    metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

(rhythmbox:3770): Rhythmbox-WARNING **: Could not load plugin rhythmbox_autoqueue

(16:44:20) [0x9dcd0d0] [rb_python_module_finalize] rb-python-module.c:413: Finalizing python module (null)

(rhythmbox:3770): Rhythmbox-WARNING **: Error, impossible to activate plugin 'Autoqueue plugin'

In order to perform the installation I decided to turn both autoqueue and the rhythmbox plugin into RPM files for Fedora. As a contribution to the project I attach the spec file used for this purpose, which if you're not familiar with making RPMS is all you (or your users) need to make RPM files for their distribution.

Once installed, these RPMs have installed the following files on my system:
/usr/lib/autoqueue/autoqueue-similarity-service
/usr/lib/python2.7/site-packages/autoqueue
/usr/lib/python2.7/site-packages/autoqueue-1.0.0alpha7-py2.7.egg-info
/usr/lib/python2.7/site-packages/autoqueue/__init__.py
/usr/lib/python2.7/site-packages/autoqueue/__init__.pyc
/usr/lib/python2.7/site-packages/autoqueue/__init__.pyo
/usr/lib/python2.7/site-packages/autoqueue/similarity.py
/usr/lib/python2.7/site-packages/autoqueue/similarity.pyc
/usr/lib/python2.7/site-packages/autoqueue/similarity.pyo
/usr/lib/python2.7/site-packages/mirage
/usr/lib/python2.7/site-packages/mirage/__init__.py
/usr/lib/python2.7/site-packages/mirage/__init__.pyc
/usr/lib/python2.7/site-packages/mirage/__init__.pyo
/usr/lib/python2.7/site-packages/mirage/res
/usr/lib/python2.7/site-packages/mirage/res/dct.filter
/usr/lib/python2.7/site-packages/mirage/res/filterweights.filter
/usr/lib/python2.7/site-packages/mirage/res/testfile.py
/usr/lib/python2.7/site-packages/mirage/res/testfile.pyc
/usr/lib/python2.7/site-packages/mirage/res/testfile.pyo
/usr/lib/python2.7/site-packages/mirage/res/writefilters.m
/usr/lib/python2.7/site-packages/mirage_miximize.py
/usr/lib/python2.7/site-packages/mirage_miximize.pyc
/usr/lib/python2.7/site-packages/mirage_miximize.pyo
/usr/lib/python2.7/site-packages/mirage_songs.py
/usr/lib/python2.7/site-packages/mirage_songs.pyc
/usr/lib/python2.7/site-packages/mirage_songs.pyo
/usr/lib/python2.7/site-packages/mpd_autoqueue.py
/usr/lib/python2.7/site-packages/mpd_autoqueue.pyc
/usr/lib/python2.7/site-packages/mpd_autoqueue.pyo
/usr/lib/python2.7/site-packages/quodlibet_autoqueue.py
/usr/lib/python2.7/site-packages/quodlibet_autoqueue.pyc
/usr/lib/python2.7/site-packages/quodlibet_autoqueue.pyo
/usr/share/dbus-1/services/org.autoqueue.service
/usr/share/doc/python-autoqueue-1.0.0alpha7
/usr/share/doc/python-autoqueue-1.0.0alpha7/COPYRIGHT.txt
/usr/share/doc/python-autoqueue-1.0.0alpha7/README.txt
/usr/lib/rhythmbox/plugins/rhythmbox_autoqueue
/usr/lib/rhythmbox/plugins/rhythmbox_autoqueue/__init__.py
/usr/lib/rhythmbox/plugins/rhythmbox_autoqueue/__init__.pyc
/usr/lib/rhythmbox/plugins/rhythmbox_autoqueue/__init__.pyo
/usr/lib/rhythmbox/plugins/rhythmbox_autoqueue/rhythmbox_autoqueue.rb-plugin

Revision history for this message
Graham White (graham-alton) wrote :
Revision history for this message
Eric Casteleijn (thisfred) wrote :

Hi Graham, thanks for reporting this, and helping with the RPM stuff!

I will look into this after work.

Changed in autoqueue:
assignee: nobody → Eric Casteleijn (thisfred)
importance: Undecided → High
Changed in autoqueue:
status: New → Fix Committed
Revision history for this message
Eric Casteleijn (thisfred) wrote :

I reproduced and fixed the metaclass issue here. (Somehow subclasses from rb.Plugin cannot also subclass from something that has a metaclass, even though rb.Plugin itself does not have a metaclass. Weird.)

Anyways, this should resolve this error, but there may be more depending on whether or not you have mirage installed. I tried to make mirage a soft dependency as much as possible, but I may have made some mistakes there that I don't see because I do have it installed. Please file a new bug if it still does not work, and I'll look into it.

Once it works completely, I'll happily include the RPM spec file as well.

Revision history for this message
Graham White (graham-alton) wrote :

Sadly, this doesn't seem to have fixed the problem for me. I get the same error message:

(08:29:16) [0x98de0d0] [rb_python_module_init] rb-python-module.c:406: Init of python module
Traceback (most recent call last):
  File "/usr/lib/rhythmbox/plugins/rhythmbox_autoqueue/__init__.py", line 79, in <module>
    class AutoQueuePlugin(rb.Plugin, AutoQueueBase):
TypeError: Error when calling the metaclass bases
    metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

(rhythmbox:21184): Rhythmbox-WARNING **: Could not load plugin rhythmbox_autoqueue

(08:29:16) [0x98de0d0] [rb_python_module_finalize] rb-python-module.c:413: Finalizing python module (null)

(rhythmbox:21184): Rhythmbox-WARNING **: Error, impossible to activate plugin 'Autoqueue plugin'

This time I tried checking out the trunk, made it into an RPM to upgrade my previous alpha7 version, then did then upgrade so I should have the very latest version of all parts of the code now. Just to be clear, the diff between the plugin files appears to simple be the following:

--- /usr/lib/rhythmbox/plugins/rhythmbox_autoqueue/__init__.py 2011-07-27 08:16:46.000000000 +0100
+++ __init__.py 2011-05-06 16:32:26.000000000 +0100
@@ -68,8 +68,7 @@

     def get_rating(self):
         """Return the rating of the song."""
- rating = self.db.entry_get(self.song, rhythmdb.PROP_RATING)
- return rating / 5.0
+ return 5.0 / self.db.entry_get(self.song, rhythmdb.PROP_RATING)

     def get_playcount(self):
         """Return the playcount of the song."""

Thanks for the speedy response. I'm happy to continue testing and can submit a modified version of the spec file once we get this going as I noticed the trunk version now makes up the quodlibet plugin too which I've added in there now.

Revision history for this message
Eric Casteleijn (thisfred) wrote :

That change fixes another bug I found while looking for this, but the real fix is in autoqueue/__init__.py. Are you sure you reinstalled the whole package? 'sudo python setup.py install' would do it, I'm guessing the rpm might need to be uninstalled first if you reinstall it because the version may be the same, and so it won't necessarily upgrade to this version. That's pure guesswork though, as I don't know anything about rpms.

Revision history for this message
Graham White (graham-alton) wrote :

Oh, crap, I'm a muppet... I only upgraded the Rhythmbox code! OK, let me try again and I'll report back....

Right so after I fixed up my PEBKAC the plugin can now be enabled in Rhythmbox. However, it still doesn't quite work and gives the error:

(13:39:26) [0x8f330d0] [AutoQueuePlugin.log] /usr/lib/rhythmbox/plugins/rhythmbox_autoqueue/__init__.py:269: Error handler received: (DBusException(dbus.String(u'Process /usr/lib/autoqueue/autoqueue-similarity-service exited with status 1'),),), {}

I was reading through a bit of your code this morning and I suspect this might be because I've not installed the dependencies, I don't have mirage installed and scipy, etc. Although, you've said you tried not to depend on those things and drop out to last.fm. The functionality I'm looking for is simply to have the playlist update with similar songs or to be able to populate the playlist with something along the lines of "play me some music I like" (which I know isn't what this plugin is intended to do) but all from last.fm. Once I can get that going I might invest my time into improving the Rhythmbox interface for the plugin (some sort of configuration and on/off UI is going to be needed) instead of creating the plugin from scratch myself.

Revision history for this message
Graham White (graham-alton) wrote :

hmm, yes that error is probably because I didn't install scipy as shown when I try to run autoqueue-similarity-service

# /usr/lib/autoqueue/autoqueue-similarity-service
Traceback (most recent call last):
  File "/usr/lib/autoqueue/autoqueue-similarity-service", line 2, in <module>
    from autoqueue.similarity import main
  File "/usr/lib/python2.7/site-packages/autoqueue/similarity.py", line 22, in <module>
    from mirage import (
  File "/usr/lib/python2.7/site-packages/mirage/__init__.py", line 32, in <module>
    from scipy import array, fromfile, zeros, dot, single, vectorize
ImportError: No module named scipy

After installing scipy I then get an error about the lack of mirage installation

# /usr/lib/autoqueue/autoqueue-similarity-service
Traceback (most recent call last):
  File "/usr/lib/autoqueue/autoqueue-similarity-service", line 2, in <module>
    from autoqueue.similarity import main
  File "/usr/lib/python2.7/site-packages/autoqueue/similarity.py", line 22, in <module>
    from mirage import (
  File "/usr/lib/python2.7/site-packages/mirage/__init__.py", line 48, in <module>
    "/usr/lib/banshee-1/Extensions/libmirageaudio.so")
  File "/usr/lib/python2.7/ctypes/__init__.py", line 431, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/banshee-1/Extensions/libmirageaudio.so: cannot open shared object file: No such file or directory

It seems the separation of mirage and last.fm isn't quite there and the code still insists on having mirage installed rather than simply ignoring it and falling back to last.fm. I wonder if I should be setting "by_mirage" to false?

Revision history for this message
Graham White (graham-alton) wrote :

Setting "by_mirage" to false doesn't seem to have any effect either, I get the same error output from autoqueue-similarity-service as above.

Revision history for this message
Eric Casteleijn (thisfred) wrote :

Right, that's what I feared. I've opened a new bug for that: LP #816967

Revision history for this message
Eric Casteleijn (thisfred) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.