GeekShadow
sweet, but you are not oblige to create 2 extensions for 32 and 64, one extension can handle these 2 platforms
This is both 32 and 64-bit Linux compatible.
If anyone has OSX and is willing to try to get it working, it'd be awesome. Message me on Github. I'm not 100% if it's even possible though.
This extensions provides an MPRIS interface for controlling Songbird through the Linux DBUS.
This allows for changing tracks, volume and position, prev/next, play/pause/stop, as well as allows for retrieval of metadata on songs.
This supports almost all MPRIS functionality, except for:
* AddTrack method
* DelTrack method
* GetCaps method just says everything works
* CapsChange signal not implemented
* TrackListChange signal not implemented
* Metadata retrieval from external sources like Musicbrainz and Amazon
If you want them implemented, leave a comment!
Uses
This will allow query/control with anything using the MPRIS protocol.
For example:
Sample Code
#!/usr/bin/env python
import dbus
bus = dbus.SessionBus()
object = bus.get_object('org.mpris.songbird', '/Player')
stat = object.GetStatus()
if stat[0] == 0:
print "Playing"
elif stat[0] == 1:
print "Paused"
else:
print "Stopped"
data = object.GetMetadata()
print data['title']
print data['artist']
Source Code
The code is up on GitHub here.
http://github.com/loganfsmyth/mpris-songbird
Updates
I haven't been using Songbird since they initially said they were stopping Linux support, but if you need me to bump the version of this to work with newer Linux builds, just post a comment or an issue on github.
Bumped to support 1.10.0a
sweet, but you are not oblige to create 2 extensions for 32 and 64, one extension can handle these 2 platforms
@thesmyth Ahh yes, have installed the Pidgin MusicTracker plugin (http://code.google.com/p/pidgin-musictracker/) and chose "Auto-detect" for the player and it seems to work. The only reason I thought it wasn't is because there's no way that I can see my now playing status. I only found out it was working by typing /nowplaying into a conversation window or by asking my contacts what my status was. Guess this is a limitation of Pidgin / MusicTracker but I don't see how I know what is being set for my now playing status.
Great plugin so thanks for the hard work. Looking forward to playing around with this a lot more.
@Slate8
If you go into musictracker and choose MPRIS, it should work. Does for me anyhow ^_^
Ahh nevermind just saw your post, seems it was working after all ¬_¬
coolest thing ever
Great addon, but there are some problems:
1. If you pause a song and then try to resume, it starts playing from beginning. I tried this with two different command line scripts.
2. Doesn't work with gajim (the main reason I was looking for a dbus addon for songbird). After changing a track, the tune icon in gajim flashes for a short time but almost instantly disappears. Might be a bug in gajim, though.
arguments to dbus_connection_send_with_reply_and_block() were incorrect, assertion "(error) == NULL || !dbus_error_is_set ((error))" failed in file dbus-connection.c line 3301.
This is normally a bug in some application using the D-Bus library.
Gentoo, dbus-1.2.3. Any good ideas?
@thesmyth
With your plugin Songbird crashes always when I double-click on a track or press next/prev on my keyboard! :'(
I tested it under Songbird 1.2 and 1.3b1, always the same. (Ubuntu 9.04 with KDE4 and Gnome).
Any suggestions?
same thing here. Linux tbird-x4 2.6.30-gentoo-r2 #1 SMP PREEMPT Sun Jul 19 18:47:23 CEST 2009 x86_64 AMD Phenom(tm) II X4 940 Processor AuthenticAMD GNU/Linux on gcc 4.3.2 and dbus 1.2.3-r1. With the extension installed songbird randomly crashes, no logs in console, and no indication of what's running. i've got the following addons installed:
without the extension it runs all fine, with it randomly crashes on track change, play or other functions.
@thesmyth
Sorry for my late answer, Im running K/Ubuntu 64bit with Songbird from Getdeb.net
I tested it on a clean install without any plugin (same with Songbird 1.2 and 1.3b1).
The console gives nothing back to me if it crashes. So I have no error-messages for you :-(
But sometimes it crashes when I double-click on a track to start playing it. So I think there is something corrupt generating the dbus-output for other applications. Is there anything parsed?
cheers
@thesmyth
How do I use the debug-mode?
If I start songbird through the terminal, nothing happens and songbird crashes still stilent as before. Also "songbird --debug" didn't help.
@thesmyth
Got it, thanks. My output when changing a track untill it crashed:
→ http://paste.ubuntuusers.de/395938/
→ http://paste.ubuntuusers.de/395937/
Remarkable: the output at line 7 and 21 ;-)
But "comment" and "title" seems to be clean/right. :-\
If it helps I can send you these two tracks.
OK, I'll send you a few links. But I have to say that songbird crashes kind of randomly, that means that it crashed not every time I started playing/changing tracks with these files!
cheers
I'am german, it's all set to de_DE. (UTF-8). Same with Songbird.
Thanks so much for your help!
Hello, I tested the new version today and it worked the whole time without any problem! =)
Thanks a lot!
I too was getting the random crashing issue and am happy to say this new version seems to have fixes things. Wish I could have joined in the error reporting but been very busy recently.
Thanks for all the hard work put into geting this sorted, very much appreciated and great add-on.
wonderful. i'm having some problems with kde4 style dbus calls, but manual dbus-send calls work just great. no crashes as far as i can see. thank you very much.
Actually I'am using the Plugin only to make my MediaKeys working under KDE, because the MMKeys-Addon works only for Gnome.
@Slate8
What problems do you have with kde4 style dbus calls? I'am asking because I tried to add the commands to some key-combination through the system-settings in KDE4. But it didn't work:
"Interface 'org.freedesktop.mediaplayer' not available in object /Player at org.mpris.songbird:
org.freedesktop.DBus.Error.UnknownInterface (Interface 'org.freedesktop.mediaplayer' was not found)"
But if I try it in the console with "dbus-send --type=method_call --dest=org.mpris.songbird /Player org.freedesktop.MediaPlayer.Pause" it works well. :-\
@opu.e I think you must have meant to direct your question to @verdi - I am Gnome all the way :)
@thesmyth I am only using it for the MusicTracker plugin in Pidgin. Works great! Would love to hear of other uses.
Ooops, yeah. Sorry :-p
@opu.e yes i think i get the same behaviour. the fix is pretty easy. most players expect a org.freedesktop.MediaPlayer.Next style command. With this plugin a simple Next call does the trick.
@thesmyth There's two more issues of implementations: could you code it so that pause/play is one command? also on a fresh start the play command won't do anything until you hit play the first time. would there be a way to change that?
@verdi
Great, thank you =)
@thesmyth if you like AWN, check out Cairo-Dock - its very pretty and easier to use in comparison http://www.cairo-dock.org/ww_page.php?p=Accueil&lang=en
2 questions·!·!·!·
a) Does it work in 64 bit?
b)why this does not work?
=========================
#!/usr/bin/env python
import dbus
bus = dbus.SessionBus()
object = bus.get_object('org.mozilla.songbird', '/org/mozilla/songbird')
print object.getStatus()
print object.getTitle()
print object.getArtist()
==========================
I am trying to use the plugins "music" for amsn
ideas???
According to the MPRIS standard the meta data's location entry should be an URL. The location returned by this AddOn indeed starts with file:// but special characters (space, German umlauts, ...) are not escaped.
Now it's like this:
file:///path/to somewhere/reläx.mp3
But it should be like this:
file:///path/to%20somewhere/rel%C3%A4x.mp3
This is not a serious bug, but MPRIS clients may expect/require the second form.
PS: We are utilizing your add on as part of the remote control project Remuco.
Project link in previous post is broken. Fixed: Remuco.
Is the source code available? Your site mentions it briefly, but I don't see where. It's to make a compile for OpenSolaris.
Hi,
I'm on Ubuntu 9.10 with Songbird 1.2 from Getdeb.
Has anyone got aMSN (0.98.1) to show title of song playing in Songbird? Used to have it with the Songbird add-on Dbusbird but that's not been updated for 1.2.
I've tried various options in the aMSN Music plugin configuration but with no luck so far.
Thanks in advance for any pointers.
Thanks thesmyth.
That worked. Shows perfectly the song being played with aMSN music plugin configured for Songbird MPRIS.
Ta.
sorry for a nube question, but i want to use KDE's Input Actions (in system settings) to set up global hotkeys for songbird. I have no idea how to, but i know it can be done easely.
Thanks
@thesmyth.. thanks for the addon.. it's working great!!!
Here's what I'm using, it's all 64-bit...
Ubuntu Satanic Edition 666.7 (aka v 9.10)
Pidgin 2.6.3
pidgin-musictracker 0.4.19
Hi,
I'm using Kubuntu 9.10 with Songbird 1.2 from Getdeb with mpris add-on.
I tried controlling Songbird through DBUS in console with:
dbus-send --print-reply --type=method_call --dest=org.mpris.songbird /Player org.freedesktop.MediaPlayer.Pause
That results in an error output:
Error org.freedesktop.DBus.Error.UnknownMethod: Method "Pause" with signature "" on interface "org.freedesktop.MediaPlayer" doesn't exist
What am I doing wrong?
Sorry for double-post, but I didn't find an option for editing my previouse comment.
In addition to console I tried the Python sample code. But I got an error, too:
Traceback (most recent call last):
File "songbird-test", line 6, in <module>
stat = object.GetStatus()
File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 68, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in __call__
**keywords)
File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 620, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "GetStatus" with signature "" on interface "(null)" doesn't exist
I don't know how to fix that problem. Please help me!
DBUS should work, because controlling Amarok in console with "dbus-send ..." is working.
Thanks thesmyth for your help! I've got it!
In the end it was my fault... After testing and trying around a long time I disabled all add-ons aside form mpris and it works! Problem was an outdated add-on. I used FireTray from here (I disabled the compability check in songbird so that I could use this "old" add-on - stupid idea...).
I didn't know that I can use add-ons from "mozilla.org" but installing the current version of FireTray (https://addons.mozilla.org/de/firefox/addon/4868) solved all my problems!
Are you going to update this version for the Songbird 1.4b3??? I really want to try this add on
Hi,
I created a very basic python script (for use on linux) that uses lastfmsubmitd set up for use with libre.fm. If you launch this script after Songbird has started it will submit your songs to libre.fm.
I'm not experienced in python coding so this is a "hacked together" script, don't expect it to run very well. Maybe someone with more knowledge of python can create something better based on this idea.
You can find the script here.
love this addon, especially with the mpris-remote too. nice work
it would be nice if we could love the tracks(with the last.fm addon) too with this protocol, is it possible?
Hey, great add-on!
I would really like to see the AddTrack/DelTrack methods supported, so that Songbird can better integrate with my Android project, Tesla: http://tesla.seanhodges.co.uk
Currently, the playlist and collection browser functionality are incomplete for Songbird, due to the aforementioned missing methods. Is this something you have already started work on? Could you use some help with the implementing / testing?
This extension doesn't seem to work with Cairo Dock 2.1.2-1 in Ubuntu 9.10.
@thesmyth i guessed so, i am planning to learn coding to try and get this done over my vacations. lets see how it goes (ie integrating mpris and ratings with last.fm)
@thesmyth
I've just sent you an email, please let me know if you don't receive it!
I have the same problem veritasnoctis... I downloaded this add on hoping it would let the music applet to control songbird so I didn't have to change destops to change the track or stop and pause... This is the only Dbus support Addon that will work with my songbird. I appreacite any help. Thanks guys
For the record when I hit the music player to play or pause (Not skip track) then songbird gives me a notice a bubble above the icon saying whatever tab is selected on songbird. Also the music player as static all over it. Just saying that incase it helps...
I want to extend my deepest thanks for this plugin.
For months I'd been attempting to find a solution to use pidgim to show "Now Playing" from songbird. Tried with live-tweeter, no luck, tried various solutions, and it was not until I found this add-on that I could get it to actually work.
Thank you very much for this fantastic plugin. I rate it 5 stars. It works perfectly with Pidgin on Ubuntu 9.10.
I am using ubuntu 9.10 with Songbird 1.4.3.
Suppose, I run Songbird and then play a song. Now, If i query for the current track using dbus, I get the right output. If the tracks change by themselves, there is no problem. But, if i change the track myself by clicking on next track button in Songbird, the next time i query the current track using dbus, i get this error..
Traceback (most recent call last):
File "./last.py", line 11, in <module>
status = player_obj.GetStatus()
File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 68, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in __call__
**keywords)
File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 620, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "GetStatus" with signature "" on interface "(null)" doesn't exist
Oh, i forgot one thing. I am using 64 bit ubuntu 9.10
any help you give is appreciated thesmyth. I guess I will use Rhythmbox (Because it works with Cario dock) until you get the time to help. I will be losing all the cool add ons in Songbird, but I do a LOT of multitasking so being able to change the song without having to switch desktop or app is great. I don't know much about programing (other than apt-get and sudo) by the way where would I go to understand all this hardcore stuff? Anyway thanks once again.
hey thesmyth,
I just wanted to stop by and say thanks, iv'e been selfishly using it with CoverGloobus for a few months. so ya, thanks!
I have just updated Cario and tryied the music app... when songbird is up the player shows that it is open and with compiz window preview on I can see the window.... but it still is not able to control it. I have the Cario Weekly Update PPA enabled in Ubuntu Tweak... I couldn't figure how to install it from the website... Do I need the Websit or does the Build not work?
Do you plan to add support for v1.7.3?
Are you planning to continue development on this plugin?
Also the linux version in not officially released but there still are nightly builds keeping in pace with the normal windows, and osx releases.
So any plans to extending the plugin's functionality to the new versions?
I don't want this plugin to die. It makes me interact with AWN and conky.
Does anyone have this working under OS X? I have installed DBus and have been trying to control Songbird via this add-on using mpris-remote, but no joy so far.
This is a great addon, but I am having a bit of a problem. I'm using the sample code you gave above to test things out, but all I get is an error:
Traceback (most recent call last):
File "songbirdMPRIS.py", line 7, in <module>
stat = objectBus.GetStatus()
File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 68, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in __call__
**keywords)
File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 619, in call_blocking
reply_message = self.send_message_with_reply_and_block(message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "GetStatus" with signature "" on interface "(null)" doesn't exist
I'm using songbird 1.4.3 and Ubuntu 10.04
Slate8
Nice! I take it this will open up a load of possibilities for interaction between songbird and other apps? Have managed to see the DBUS messages emmitted by Songbird with "dbus-monitor".
Has anyone got Songbird talking to another app? I tried the Pidgin "MusicTracker" and "Now Playing" plugins, but no joy.
Would be cool to have a panel applet for gnome that can control Songbird over MPRIS.
Anyone got anything cool going?