[Galago-devel] Galago as unified presence API for non IM applications

Brian Nitz Brian.Nitz at Sun.COM
Thu Aug 9 09:10:53 PDT 2007


Do you think Galago is (or could be made) an appropriate common API for 
signaling applications to go into a lower resource usage mode when the 
user isn't present?  I'm working on a proposal and if Galago experts 
think this is appropriate, I'd like to get the input of the Gnome 
community. 

Here is a rough draft of my proposal.  I have references to Sun Ray, but 
I think this could be useful for all thin clients and probably even fat 
client desktops:

Problem Statement:
Provide a unified mechanism for notifying desktop applications of user 
presence so that applications can behave appropriately.

Goals

    * Integrate presence information from chat-clients, VOIP clients, 
screensavers and other highly interactive or animated applications.
    * Improve Sun Ray scalability.
    * Improve desktop usability of Sun Ray session portability.
    * Provide a common mechanism for power-management to also trigger 
polite application behavior when user is not present.

Existing architecture and its limitations
Sun Ray provides a well-defined mechanism for associating a user with a 
session via smart cards and/or passwords. From the user's perspective, 
the session is always active and available instantly as soon as the 
password or session card authentication is completed.

 From each applications' perspective, the user is also always present. 
Sun Ray displays are implemented as asynchronous virtual frame buffers. 
Because of this, applications do not know whether the virtual display 
they are writing to is associated with a real display or a real user. 
Here are two example use cases which demonstrate how this limitation 
manifests itself in the real world:

    * User logs into a Sun Ray with his session card and then enters a 
chat client. User pulls card out of Sun Ray and walks away without 
manually logging out of chat client or marking himself "away." All of 
the users he was chatting with see him as online as his chat client is 
still up and running on a virtual display which is no longer associated 
with a real display.

    * User logs into a Sun Ray session and browses to a highly 
interactive website containing advertisements, flash and gif animations. 
Then user pulls his session card and walks away. Sun Ray server memory 
and CPU resources continue to be consumed in order to display these 
animations regardless of the fact that they are not being displayed to 
an actual display or to a user.

Utactions
Sun Ray Server Software (SRSS) provides utaction as a mechanism for 
notifying applications when a session card is inserted or removed. A 
utaction can trigger a script or executable on session card insertion or 
removal. Utactions are currently used to trigger xscreensaver when the 
user removes their session card so that when they re-insert their 
session card they must enter the unlock password. Utactions scripts 
deployed by system administrators can help solve some of the limitations 
above. For example, some people use a utaction script to tell the PIDGIN 
(GAIM) IRC client that they are away. Sun ITOPS internal configuration 
currently uses utactions to run a freeze script which pstops selected 
applications when the smart card is removed. These ad-hoc approaches 
aren't easily supportable and they don't solve all of the problems 
caused by application unawareness of detached sessions and session mobility.


Galago
As of GNOME 2.18, a common API for integrating presence information has 
not yet been integrated, but the Telepathy IRC API currently uses 
Galago. Both Telepathy and Galago appear to be getting some traction as 
unified IRC and presence frameworks for GNOME and KDE.

 From Galago's website:
Galago is a desktop presence framework, designed to transmit presence 
information between programs. To put it in simpler terms, it takes 
information on who is online and their away/idle states from an instant 
messenger (such as gaim) or other similar programs and lets other 
programs (such as Ximian's Evolution) to make use of it.

The advantage of such a framework is that it brings your programs closer 
together. When you receive an e-mail from a friend who is in your buddy 
list, you'll be able to immediately tell their online status, for example.

Galago is desktop-neutral, and will in time provide easy to use widgets 
for Gtk+ and Qt applications. Currently, Gtk+ widgets are available in 
our Subversion repository under the module name libgalago-gtk. Qt 
widgets will be available in time.

Requirements

Gnome-Panel/General Desktop

    * Integrate Galago framework.
    * Create an applet or other mechanism for setting and reading global 
Galago presence.
    * Provide a mechanism for utaction to trigger global Galago presence.
    * Possibly mark my processes as eligible for swap???

IRC (Pidgin)

    * Listen for Galago presence notifications.
    * Set IRC user state appropriately to match actual state of user 
based on notifications.

VOIP (Ekiga)

    * Listen for Galago presence notifications.
    * Set VOIP client to HOLD or HANGUP if user is Away.

Browser(Firefox)

    * Listen for Galago presence notifications.
    * Stop animations and interactive child plugins when user is Away.
    * Continue animations and interactive plugins on Available

Media players (Totem/Realplayer/JMplayer)

    * Listen for Galago presence notifications.
    * Stop playback of movie when user is Away.
    * Resume playback of movie when user is present.

Music players (Rhythmbox)

    * Listen for Galago presence notifications.
    * Stop playback of movie when user is Away.
    * Resume playback of movie when user is present.

Email (Evolution/Thunderbird)

    * Automate "away message" if user hasn't been present for a certain 
amount of time.
    * Add option to notify sender if recipient is available.

Considerations
A11Y
Don't break A11Y.

Latency during session reactivation.
If processes are stopped or paged out when users aren't present, they 
should quickly resume when user return. Hot-desking performance should 
not noticeably decrease.

Multi-user/multi-card desktops, multiple desktops per user (e.g. 
multihead), multiple servers.
 From Bob Dolittle: "See if you can support a model of 
multiple-desktop-presence for a user. For something like gaim, it might 
be nicest to choose the most-recently-touched desktop for "ringing",if a 
user has more than one active. Also try to support the notion that the 
user's active desktops can be on multiple servers."

Power management
Possibly provide a mechanism allowing powersaving activity (e.g. 
preparation for sleep/hibernate) to trigger global Galago presence???

Global Presence Applet (Available|Away|Busy|Auto)
Global user presence information could be set with a single applet with 
options for Available, Away, Busy and Auto. Auto would try to glean 
presence information from keystrokes and mouse movements. Individual 
application menus could either inherit this global presence or set the 
individual application presence (in case the user would like to be 
"here" for Pidgin, but "away" for the VOIP client.) These individualized 
presence settings could be saved in a "presence profile."

Presence Class
The Presence Class should contain the following:

    * Presence_User_ID (assume session authentication took place elsewhere.)
    * Presence_State
          o Available
          o Away
          o Busy

    * Users_last_seen_location - Points to the server and display where 
the user was last available (based on keystrokes, mouse movements and 
manual settings.)

For example: USER_LAST_SEEN_ON="sr1-edub-04:49.0"

    * Time_since_last_seen - Counts the number of seconds since the user 
was last Available.

Presence Profiles
Each presence profile contains a name and a list of desktop 
applications. For each desktop application, presence is set to one of 
the following:

    * Available - User is available
    * Away - User is away
    * Busy - User is online but busy.
    * Auto - Glean presence from keystrokes/mouse moves
    * Global - Inherit global presence attribute.
    * Forced - Application behaves as though user is always present. 
(e.g. I've started my program running, I know I'm going to be away but I 
want it to continue without me!)




More information about the galago-devel mailing list