[RELEASE] Skype (VoIP Program) Addon

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
anwmalos Offline
Junior Member
Posts: 21
Joined: May 2010
Reputation: 0
Location: Athens
Thumbs Up  [RELEASE] Skype (VoIP Program) Addon
Post: #1
https://code.google.com/p/xbmc-skype-addon/

Changelog:

20/11/2010:
-Added new icons, country flags, addon icon
-Changed background image (Taken straight from xbmc subtitles addon)
-Audio call place/receive, much more stable now but still needs some work
-Filled details window with the details of selected user (homepage/about/telephones etc.)



Original post
------------
I just commited the initial version which is only for the brave, it is missing most of the features, it does some pretty stupid stuff, it might crash etc etc etc

But hey, it works (sort of)

To use it you have to compile xbmc from the svn and enable external python, (which I has to be at least 2.6, haven't tested later versions) as well as install Skype4py.When you install Skype4py you have to find the file posix.py, which at least in ubuntu is in /usr/local/lib/python2.6/dist-packages/Skype4Py/api and change the line

trans = opts.pop('Transport', 'dbus')
with
trans = opts.pop('Transport', 'x11')

After that, install skype for linux (I used apt-get from the ubuntu repo), sign in and the first time you run the addon, accept the plugin connection from the addon to skype. That's it (I think)....

I don't know if it is possible to work with dbus, but right now it is causing me problems and I am too bored to fix it. I am also interested if anyone want to try making this work in windows as I have only tried in linux x64, I don't know if it is even possible.

Anyone who wants to contribute, first of all I need ideas, so brainstorm all you like about the look and feel of the addon. If anyone knows how to make pretty backgrounds/icons and stuff like that would be useful. Code wise, you are also welcome to make any suggestions

Disclaimer: I am a C/C++ coder so I don't know how my python coding looks, I'm sorry if it is not according to python coding style Tongue


And last but not least, many thanks to the author if the Gmail Checker plugin as I used (aka stolen) his code as a base for my addon!
(This post was last modified: 2010-11-20 21:56 by anwmalos.)
find quote
Spulit Offline
Member
Posts: 58
Joined: Feb 2010
Reputation: 0
Post: #2
Hi,

Thanks for posting this!
How do we install the addon on XBMC? I tried copying the folder to the scripts folder but I get an error indicating a failure in importing the "xbmcaddon" module...
find quote
anwmalos Offline
Junior Member
Posts: 21
Joined: May 2010
Reputation: 0
Location: Athens
Post: #3
I currently store it at $HOME/.xbmc/addons/script.skype/
Keep in mind that it is developed for dharma (specifically current SVN) so it might have some problems with that. Also check if the python path is correct, as a last resort you can manually add some paths on default.py.
find quote
Spulit Offline
Member
Posts: 58
Joined: Feb 2010
Reputation: 0
Post: #4
For now I'm just putting it to work with the latest XBMC Live distribution. For now I came up with a problem I previously detected in my developments.

Traceback (most recent call last):
15:54:22 T:2965613424 M:1999708160 NOTICE: File "/home/ecaalyx/.xbmc/scripts/Common Scripts/Skype/default.py", line 28, in ?
15:54:22 T:2965613424 M:1999708160 NOTICE: ui = gui.GUI( "ui.xml" , os.getcwd(), "Default")
15:54:22 T:2965613424 M:1999708160 NOTICE: File "/home/ecaalyx/.xbmc/scripts/Common Scripts/Skype/resources/lib/gui.py", line 146, in __init__
15:54:22 T:2965613424 M:1999708160 NOTICE: self.skype = Skype4Py.Skype(Events=self)
15:54:22 T:2965613424 M:1999708160 NOTICE: File "/usr/share/xbmc/system/python/python24.zip/Skype4Py/skype.py", line 243, in __init__
15:54:22 T:2965613424 M:1999708160 NOTICE: self._SetEventHandlerObj(Events)
15:54:22 T:2965613424 M:1999708160 NOTICE: AttributeError
15:54:22 T:2965613424 M:1999708160 NOTICE: :
15:54:22 T:2965613424 M:1999708160 NOTICE: 'Skype' object has no attribute '_SetEventHandlerObj'
15:54:22 T:2965613424 M:1999708160 ERROR: Scriptresult: Error

In fact, in the latest Skype4Py version there is no _SetEventHandlerObj() method and I found several other users complaining about this. Which is your Skype4Py version?
find quote
anwmalos Offline
Junior Member
Posts: 21
Joined: May 2010
Reputation: 0
Location: Athens
Post: #5
you are using python 2.4, I don't know if it is possible to run it under 2.4. I had a lot of problems with it even with the the hacks I have mentioned on the other thread. It's best to use external python and use at least 2.6 although I think it might work with 2.5
find quote
Spulit Offline
Member
Posts: 58
Joined: Feb 2010
Reputation: 0
Post: #6
I don't think it is related to using 2.4. If you look into the Skype object code (in skype.py) you will see that that method is not defined...Weird...
find quote
anwmalos Offline
Junior Member
Posts: 21
Joined: May 2010
Reputation: 0
Location: Athens
Post: #7
Spulit Wrote:I don't think it is related to using 2.4. If you look into the Skype object code (in skype.py) you will see that that method is not defined...Weird...

It's defined in utils.py:480 (Skype4Py-1.0.32.0)
find quote
Spulit Offline
Member
Posts: 58
Joined: Feb 2010
Reputation: 0
Post: #8
Hello,

I fixed the problem by manually setting the handlers. Now I'm stuck with a problem:

Traceback (most recent call last):
19:03:07 T:2964880240 M:1995587584 NOTICE: File "/home/ecaalyx/.xbmc/scripts/Common Scripts/Skype/default.py", line 28, in ?
19:03:07 T:2964880240 M:1995587584 NOTICE: ui = gui.GUI( "ui.xml" , os.getcwd(), "Default")
19:03:07 T:2964880240 M:1995587584 NOTICE: File "/home/ecaalyx/.xbmc/scripts/Common Scripts/Skype/resources/lib/gui.py", line 147, in __init__
19:03:07 T:2964880240 M:1995587584 NOTICE: self.skype = Skype4Py.Skype()
19:03:07 T:2964880240 M:1995587584 NOTICE: File "/usr/share/xbmc/system/python/python24.zip/Skype4Py/skype.py", line 250, in __init__
19:03:07 T:2964880240 M:1995587584 NOTICE: self._Api = SkypeAPI(Options)
19:03:07 T:2964880240 M:1995587584 NOTICE: File "/usr/share/xbmc/system/python/python24.zip/Skype4Py/api/posix.py", line 37, in SkypeAPI
19:03:07 T:2964880240 M:1995587584 NOTICE: from posix_x11 import SkypeAPI
19:03:07 T:2964880240 M:1995587584 NOTICE: File "/usr/share/xbmc/system/python/python24.zip/Skype4Py/api/posix_x11.py", line 179, in ?
19:03:07 T:2964880240 M:1995587584 NOTICE: libpath = find_library('X11')
19:03:07 T:2964880240 M:1995587584 NOTICE: File "/usr/share/xbmc/system/python/python24.zip/ctypes/util.py", line 120, in find_library
19:03:07 T:2964880240 M:1995587584 NOTICE: return _get_soname(_findLib_ldconfig(name) or _findLib_gcc(name))
19:03:07 T:2964880240 M:1995587584 NOTICE: File "/usr/share/xbmc/system/python/python24.zip/ctypes/util.py", line 110, in _findLib_ldconfig
19:03:07 T:2964880240 M:1995587584 NOTICE: os.popen('/sbin/ldconfig -p 2>/dev/null').read())
19:03:07 T:2964880240 M:1995587584 NOTICE: OSError
19:03:07 T:2964880240 M:1995587584 NOTICE: :
19:03:07 T:2964880240 M:1995587584 NOTICE: [Errno 2] No such file or directory
19:03:07 T:2964880240 M:1995587584 ERROR: Scriptresult: Error

I should stress again that I'm trying to use this with an XBMC Live distribution, by repacking XBMC's internal python libraries package (/usr/lib/xbmc/system/python/python24.zip).

Another thing is that if I try to use dbus, I get these errors, which I don't know if are critical:

Corrupt JPEG data: 78 extraneous bytes before marker 0xd1
Corrupt JPEG data: 78 extraneous bytes before marker 0xd1

With this, the script doesn't show up anything.

Thanks
find quote
anwmalos Offline
Junior Member
Posts: 21
Joined: May 2010
Reputation: 0
Location: Athens
Post: #9
This plugin is not intended to be run on python 2.4. If you want to run in on python 2.4 then I already have solved all these issues on my earlier thread. Be warned that skype4py was unstable using this technique. I have not tested with dbus yet, please be patient if you want other things supported than the ones mentioned in the first post, I will try to fix most of them in time, as well as make a proper release
find quote
cbxbiker61 Offline
Senior Member
Posts: 183
Joined: Nov 2010
Reputation: 2
Post: #10
The following patch fixes dbus support in Skype4Py.

I've got the skype plugin working through dbus. Seems to work fine. Really need to get video support working to make this plugin do what I want.

Code:
--- ./Skype4Py/api/posix_dbus.py.orig    2010-07-30 18:24:52.000000000 -0600
+++ ./Skype4Py/api/posix_dbus.py    2010-11-15 23:00:59.627656895 -0700
@@ -85,6 +85,16 @@ class SkypeAPI(SkypeAPIBase):
             self.mainloop = gobject.MainLoop()

     def run(self):
+        # Bug fix 'segmentation fault core dumped' when using dbus.
+        self.logger.info('thread started')
+        if self.run_main_loop:
+            context = self.mainloop.get_context()
+            while True:
+                context.iteration(False)
+                time.sleep(0.2)
+        self.logger.info('thread finished')
+
+    def runOld(self):
         self.logger.info('thread started')
         if self.run_main_loop:
             self.mainloop.run()
(This post was last modified: 2010-11-19 05:27 by cbxbiker61.)
find quote
cbxbiker61 Offline
Senior Member
Posts: 183
Joined: Nov 2010
Reputation: 2
Post: #11
I see in your default.py you have a sys.path.append to get the dist-packages directory added to the external python's sys.path. A proper fix in xbmc would prevent this hackery (on my installation dist-packages is in /usr/lib64/python2.6). So here is a patch for xbmc that would fix this properly. I'll be submitting it to the xbmc bug tracker for proper inclusion.

The patch is here http://trac.xbmc.org/ticket/10715. It's been updated.
(This post was last modified: 2010-11-20 08:17 by cbxbiker61.)
find quote
anwmalos Offline
Junior Member
Posts: 21
Joined: May 2010
Reputation: 0
Location: Athens
Post: #12
About d-bus, that's good news, although I was hoping we could have a fix on the addon side so we don't need to add even more hacks. Are there any advantages over x11? Is it worth to use it? I was thinking maybe to include all the skype4py module in the addon so I can include the changes you mentioned.

Regarding video support, unfortunately my free time is very limited, so the development is not very fast, but it's moving forward. I also want to make a better gui and integrate the addon with xbmc better (maybe if possible to automatically pause a movie and pop up a answer/decline dialog when there is an incoming call).

I will test these in the weekend, as well as commit some new things, stay tuned...
find quote
extrospection Offline
Member
Posts: 77
Joined: Aug 2009
Reputation: 0
Post: #13
anwmalos Wrote:Regarding video support, unfortunately my free time is very limited, so the development is not very fast, but it's moving forward. I also want to make a better gui and integrate the addon with xbmc better (maybe if possible to automatically pause a movie and pop up a answer/decline dialog when there is an incoming call).
Wishlist (quoting myself from this thread: http://forum.xbmc.org/showthread.php?tid=81366)
extrospection Wrote:Wishlist for features (overlapping and on top of your project spec):
  • Lots of configurable options (e.g. pause media on incoming call or not, mute if music is playing on incoming call or not, option to set "away" or "do not disturb" when watching movies/listening to music and so on)
  • Video calling is a definite wishlist requirement. Showing both "remote" and local camera would be good
  • Easy navigation of contact list and call setup: ideally should be possible to do without keyboard/mouse: an easy menu option from main XBMC window leading to a remote control operable contact list would be good
  • leveraging XBMC OSD notification options? making it really easy to answer or ignore an incoming call
  • optional: ring on incoming call using a different audio output than main xbmc / call setup: use case is where people have XBMC connected to a receiver or TV but are switched to a different source: if your script could ring on an external speaker, one could switch TV+receiver to XBMC source and answer the call?
Keep up the great work - I am keen to test this when you deem it ready for "public consumption" :-)
find quote
anwmalos Offline
Junior Member
Posts: 21
Joined: May 2010
Reputation: 0
Location: Athens
Post: #14
@extrospection

I think the options list is pretty resonable but right now, I am not interested in coding them at all Tongue. I want to finish with the main features and continue with the "nice to have" features later Tongue

About video support, you have to consider that skype4py gives just an interface to control the skype client so I don't think I will be very free to develop it as I wish. I think I will take a fair bit of hacks just to enable proper video support. Considering this I will try to have both cams, altough I think showing only the remote camera gives more tribute to sci-fi movies Smile.

For the same reason, I think it will be a bit hard to control the way skype handles audio, right now I already have my soundcard connected to external amp/speakers so it's not much of a problem. I guess it would be more of a computer setup, like hdmi for xbmc and soundcard for skype, or 2 soundcards etc.

If you wish to try it out, right now it's pretty stable although not very feature rich and it's designed from the ground up to be operated only with a remote control, so if you don't mind compiling xbmc from source it's pretty safe to use it (place/answer audio calls)
find quote
anwmalos Offline
Junior Member
Posts: 21
Joined: May 2010
Reputation: 0
Location: Athens
Post: #15
New svn version, added some stuff like details window although I have to work on it a little more to make it prettier. Next up, I have to figure how to minimize the annoying skype windows that get in the way, as well as first experiments with video support. Stay tuned!

PS. I'm not very good with graphics. All the graphics are taken from the internet (public domain/open source only) and modified a little to work well on the interface. Anyone who has any artistic talents, you are free to make some new icons/improve on existing ones. If you do, try to keep the look & feel of the windows skype client (more of a guideline than a rule Wink )
find quote
Post Reply