Planet maemo: category "feed:1ce491273e8f08b207014cd063a93e7f"

alban

Importance of the scheduling priority in D-Bus

2011-02-25 11:29 UTC  by  alban
0
0

Context switches are expensive. When do they happen in D-Bus communication?

Click to read 1628 more words
Categories: General
alban

D-Bus traffic pattern with Telepathy

2011-02-24 16:00 UTC  by  alban
0
0

Telepathy is a big user of D-Bus, both on the GNOME desktop with Empathy and on the N900. When I have a lot of Telepathy accounts and contacts, the start-up time could be about 10 seconds. How much is the D-Bus communication responsible for the start-up time? When I tried the D-Bus in the kernel prototype on the N900, I win 1.3 seconds. It shows it is not negligible and there is room for improvements. But the slowness may not be due only to D-Bus itself but the way it is used. It is interesting to look at the D-Bus traffic pattern. This topic was already largely covered by Will’s  talk on Profiling and Optimizing D-Bus APIs but I want to give a preview on future D-Bus analysis tools. The existing D-Bus tools dbus-monitor, D-Feet and Bustle are still very useful of course.

Click to read 1772 more words
Categories: General
alban

Introducing multicast Unix sockets

2011-02-16 16:20 UTC  by  alban
0
0

I have been working on implementing multicast Unix sockets in the Linux kernel. This allows a process to send a message on a socket to a multicast group with one system call sendmsg() and the message will be received by all sockets member of the multicast group.

Click to read 1906 more words
Categories: General
alban

D-Bus in the kernel, faster!

2010-09-15 15:03 UTC  by  alban
0
0

In the last few weeks at Collabora, I worked on having D-Bus directly in the Linux kernel to improve its performances. I based my work on what Ian Molton did. For now it’s just a prototype, but some benchmarks I did show a good performance improvement.

Click to read 1166 more words
Categories: General
alban

Send files to your contacts on your N900

2010-07-30 12:47 UTC  by  alban
0
0

You can share files on your N900 via Bluetooth, E-Mail and web services (Flickr and Facebook) thanks to libsharing-dialog. But there is no file transfers to a contact through instant messaging.

libsharing-dialog
The sharing dialog with Bluetooth, E-Mail and web services features

But look, the sharing dialog is obviously missing a fourth button named “Share via IM”!

Jonny Lamb wrote Monorail, a file transfer application for the N900. Monorail is a standalone application using the Telepathy framework but so far it does not integrate with libsharing-dialog. Libsharing-dialog is supposed to be extensible by plugins (see the Sharing Plug-in documentation). Unfortunately the API is more suitable for web services than for file transfers through instant messenging so it makes the work more difficult.

So I implemented that fourth button with some hacks to workaround the limitations of the libsharing-dialog API:

  • The Monorail package dpkg-diverts libsharingdialog.so into /var/lib/funsharing/
  • Monorail implements a new library (aka libfunsharing) replacing libsharingdialog.so with the same ABI
  • Libfunsharing calls dlopen() on the real libsharingdialog.so
  • It also patches the class GtkTable in memory (see struct GObjectClass->constructed) just before calling the real function from libsharingdialog.so, and restore it after the call. I use this hack to get a reference to the GtkDialog and the GtkTable containing the three buttons (the libsharing-dialog API does not give us any reference to these objects)
  • In the constructed function of GtkTable, it adds a 4th button “Share via IM” which sends the filenames to share via D-Bus to Monorail
  • Monorail receives the filenames from libfunsharing via D-Bus, shows the contact selector and send the files as usual.

Sharing dialog with the File Transfer feature
The sharing dialog after installing Monorail 0.3

It works fine in the file manager and the image viewer. Do you know any other application with a file sharing feature?

The address book can share contact cards via SMS, Bluetooth and E-Mail but it does not use libsharing-dialog, so Monorail does not automatically add my “Share via IM” button.


Send a contact card from the address book

But since PR1.2, the address book has a new plugin API and it automatically links to your plugins installed in /usr/lib/osso-addressbook/plugins.  The plugin API is designed for menu extensions and does not have helper functions for the sharing dialog. But with Marco’s help, I replaced OssoABookSendContactsDialog’s constructed function to add the fourth button:


Send a contact card from the address book after installing Monorail 0.3

Monorail 0.3 is available in maemo extras-devel.

Categories: General
alban

Play chess with your contacts on your N900

2010-07-09 14:40 UTC  by  alban
0
0

Michael released Miniature 0.1.9-3 to Maemo extras-devel yesterday. With this version, you can play chess with a contact on your N900 without configuring any server thanks to Telepathy. There are still crashes, bugs and UI to polish, but it is demoable and you can already enjoy playing chess with your friends!

The protocol used by Miniature is based on the Forsyth-Edwards Notation. At the moment it sends the whole state of the board to the remote player at each move. Miniature only sends valid moves, but does not have any protections about possible unfriendly other implementations yet.

Miniature implements the standard Telepathy Client interface with the Telepathy-Qt4 library. This enables Miniature to be automatically started by Mission Control on your N900 when a contact invites you to play. Telepathy stream tubes care about the connectivity to the remote device. The Address Book API is used to to show your contacts in the same way as other applications on the platform (avatars, contacts are merged correctly, status).

Miniature integration with Telepathy
Quick overview of the integration with Telepathy

Here is how to play chess step by step:

Miniature snapshot: menu
1. Choose “Join P2P Game” in the main menu

Miniature snapshot: select contact
2. Select your contact in the contact selector

Miniature snapshot: waiting contact's answer
3. Wait your contact’s answer

Miniature snapshot: game offer
4. Your contact is asked whether they want to join the chess game

Miniature snapshot: chess board
5. If your contact accepts, you are ready to play!

Feel free to join the Miniature mailing list and IRC channel.

Categories: General
alban

Your contacts on a map with your N900

2010-05-21 12:21 UTC  by  alban
0
0

Empathy, the GNOME Instant messaging program, can publish your location to your contacts and show their location on a map as explained on Pierre-Luc’s blog. Can you have the same on your N900? It should not be too much work since all the needed software is available on the platform: Telepathy with XEP-0080 (it works well on most Jabber servers including Ovi, but not Google’s), libchamplain, Azimuth and Map Buddy. But it still needed some integration.

Here it is! You just need to install two packages from maemo extras-devel:

Some screenshots:

Map Buddy with a few contacts
Map Buddy with a few contacts

Azimuth configuration, in the control panel
Azimuth configuration in the control panel

Click on a contact and you will be able to start a phone call or an IM conversation.

To debug it, I used the telepathy-ashes Jabber bot. I added the two commands “!setlocation” and “!unsetlocation” so you can see the contact marker moving on the map. You can try it by adding the bot echo@test.collabora.co.uk in your contacts.

If you want to help, join #maemo on Freenode, I am albanc.

Categories: General
alban

D-Bus debugging: how to use D-Feet on N900

2010-04-01 12:47 UTC  by  alban
0
0

To debug problems related to D-Bus, I like to use dbus-monitor and graphical tools D-Feet and Bustle. But until now, I couldn’t use D-Feet on my computer and connect to the bus on my N900 because dbus-daemon only listen on UNIX socket and listening on TCP does not work. Bustle works around the problem by using two different tools: one on the N900 to save the D-Bus traffic in a file and another one on your computer to read the file and display diagrams.

I implemented dbus-daemon-proxy which redirects all the traffic through TCP. There is no authentication, so use this tool only on network you trust! dbus-daemon-proxy is meant to run on your N900 and connects to the local bus (either session or system) and listen on a TCP port. Then you can run D-Feet or dbus-monitor on your computer and let them connect to dbus-daemon-proxy using TCP.

Step by step:

  • Get the sources:
git clone git://git.collabora.co.uk/git/user/alban/dbus-daemon-proxy
  • Compile it in scratchbox and copy the binary to your N900
  • Run it on your N900:
./dbus-daemon-proxy --system
  • Start D-Feet on your computer, use the menu File->Connect to other bus and type something like “tcp:host=myphone,port=8080,family=ipv4″:

D-Feet on N900

  • Enjoy D-Feet!
Categories: General