The Rhythmbox UPnP plugin

For some time now there has been a UPnP plugin based on Coherence for Rhythmbox.

It allows Rhythmbox to access UPnP/DLNA MediaServers on the network and will also export the Rhythmbox music collection to other UPnP/DLNA MediaRenderers, for example the Sony Playstation 3 has been tested and works with this plugin.
In the latest versions it even comes with nice device icons for visual identification.

This video shows Rhytmbox interacting with a Nokia n800.

As of today (December 10,2007) you need for this:

  • Rhythmbox >= 0.11.2 or current trunk(Fedora 8 and rawhide seem to be up to date)
  • Coherence version 0.40 or higher

First you will need to install coherence, we recommend that you currently (as of 2nd March 2009) checkout the latest version from subversion as some distributions (notably Ubuntu) ship a version of Rythmbox which requires a newer version of the coherence plugin than that which is in their repository. There should be a guide on how to install coherence from svn in the Coherence Documentation Department.

Installing Rhythmbox

Now on to Rhythmbox itself, if your distribution ships a recent enough version then you can skip the following steps and go straight to the plugin install.

Either download the latest tar-ball or (probably better) go for svn - svn co http://svn.gnome.org/svn/rhythmbox/trunk rhythmbox.

Enter the newly created rhythmbox directory and issue the following commands as described here:

./autogen.sh
make

after that a rhythmbox binary should have been created.
You can install it with sudo make install to /usr/local/bin or just run in locally with shell/rhythmbox (or ./rhythmbox).

Eventually you need to install a current totem-pl-parser too.
But a simple download, unpack, ./configure, make and sudo make install is sufficient.

Plugin Install

On Ubuntu, the plugin directory is: /usr/lib/rhythmbox/plugins/upnp_coherence, remove all the files EXCEPT the coherence.rb-plugin file, and replace them with:

http://coherence.beebits.net/browser/trunk/Coherence/misc/Rhythmbox-Plugin/upnp_coherence/__init__.py?format=raw
http://coherence.beebits.net/browser/trunk/Coherence/misc/Rhythmbox-Plugin/upnp_coherence/MediaPlayer.py?format=raw
http://coherence.beebits.net/browser/trunk/Coherence/misc/Rhythmbox-Plugin/upnp_coherence/MediaStore.py?format=raw
http://coherence.beebits.net/browser/trunk/Coherence/misc/Rhythmbox-Plugin/upnp_coherence/UpnpSource.py?format=raw

Obviously, rename them to the correct filenames (__init__.py, MediaPlayer.py, MediaStore.py, UpnpSource.py).

You should now try and run rhythmbox from a console window so that you can see the output it produces. Here is what a (working) installation looks like when it starts up:

phil@ubuntu:~$ rhythmbox
(rhythmbox:8141): Gtk-WARNING **: AudioCdSourcePopupCopyCd: missing action MusicAudioCDDuplicate
(rhythmbox:8141): Gtk-WARNING **: AudioCdSourcePopupCopyCd: missing action MusicAudioCDDuplicate
WARN  coherence                   Mar 02 23:20:29  Coherence UPnP framework version 0.6.1 starting... (coherence/base.py:275)
WARN  webserver                   Mar 02 23:20:29  WebServer on port 36527 ready (coherence/base.py:110)
WARN  rb_media_store              Mar 02 23:20:29  __init__ MediaStore {'no_thread_needed': True, 'urlbase': 'http://192.168.0.110:36527/8b0258c2-1434-4549-9d5d-9fcfcb10d3e3', 'db': <__main__.RhythmDBTree object at 0xa32ec84 (RhythmDBTree at 0x9c54018)>, 'plugin': <CoherencePlugin object at 0xa3a961c (RBPlugin at 0xa38f448)>} (coherence/MediaStore.py:297)
WARN  rb_media_renderer           Mar 02 23:20:29  __init__ RhythmboxPlayer {'shell': <rb.Shell object at 0xa204eb4 (RBShell at 0x9ae4050)>, 'no_thread_needed': True, 'urlbase': 'http://192.168.0.110:36527/918251f3-6436-4504-b088-7633f641a535'} (coherence/MediaPlayer.py:34)
WARN  rb_media_store              Mar 02 23:20:29  __init__ MediaStore initialized (coherence/MediaStore.py:380)
WARN  mediaserver                 Mar 02 23:20:29  Rhythmbox on 192.168.0.110 MediaServer (<upnp_coherence.MediaStore.MediaStore object at 0xaa3154c>) activated with 8b0258c2-1434-4549-9d5d-9fcfcb10d3e3 (coherence/upnp/devices/media_server.py:601)
WARN  rb_media_renderer           Mar 02 23:20:29  get_volume 1.0 (coherence/MediaPlayer.py:370)
WARN  mediarenderer               Mar 02 23:20:29  Rhythmbox on 192.168.0.110 MediaRenderer (RhythmboxPlayer'>) activated with 918251f3-6436-4504-b088-7633f641a535 (coherence/upnp/devices/media_renderer.py:121)
WARN  rb_coherence_plugin         Mar 02 23:20:29  found upnp server Rhythmbox on 192.168.0.110 (uuid:8b0258c2-1434-4549-9d5d-9fcfcb10d3e3) (coherence/__init__.py:154)
WARN  rb_coherence_plugin         Mar 02 23:20:31  found upnp server Coherence - Apple Trailers (uuid:ccc392aa-fbad-45bc-a4a5-9a0323dfb086) (coherence/__init__.py:154)

configuring rhythmbox

Within Rhythmbox you can activate DLNA/UPnP sharing and control support in the [Edit][Plugins] menu.

In the main Rhythmbox window you should now see a new section/list in the left hand panel called 'Shared' and under that you should see any MediaServers which are on your local network.

Troubleshooting

If the Rhythmbox MediaServer doesn't show up at your UPnP client you should:

  • add a multicast route to your network configuration, using the interface your system is connected to the network:
    sudo route add -net 239.0.0.0 netmask 255.0.0.0 eth0
    
  • disable for a short while any firewalls that protect your system
  • check your selinux configuration if enabled

Thanks To:

Ender and Jonty for their notes on Ubuntu