Tomi Ollila wrote:

> ... as my prog still gets killed... should I also give 3rd arg to 
> osso_initialize() as true instead of false.

Yes, all the mamemo examples pass in TRUE, but according to the docs
this parameter is deprecated and should be FALSE. I ended up passing
FALSE at the end, it works for me. Also make sure that the version
string you pass to osso_initialize() is identical to that in your
desktop file.

I spent about 4 hours last w/k trying to get this work, so some
observations on what the whole thing does:

* When you select your app from Task Navigator menu, the TN usesses some
lib osso function to start your app based on the service name in the
desktop file.

* osso starts your application, using the Exec line in the service file
(so if your app gets started at all, it is working up to here).

* the system waits for the app to register the dbus handler; this
happens when you call osso_initialize(),

* the system gives the app a few seconds to start up the dbus service,
if it does not happen, it kills (I think it just sends it sigkill). The
waiting period is quite long, I have managed even to attach gbd during
it few times (not that it does much good once the app is killed).


There are two main reasons why the kill signal is sent:

a) your call to to osso_initialize() fails; this would invarriably
happen to me when I tried to start the app in scratchbox from gdb to see
what is happening; at the end, the only way to start it inside gdb was
to run gdb like this:

    run-standalone.sh gdb

Then you can start it, but, it does not do much good, because now it is
not attached to the TN, so it will not get killed. Best probably to
print lot of dbg stuff to the console.

b) your call to osso_initialize() succeeds, but the name of the service
does not match the name of the service the system is looking for -- if
that happens, double check the desktop and service files for typos:
whatever is found the desktop file and as a parameter to
osso_initialize() will endup prefixed with 'com.nokia.'


The other thing that has occurred to me as possible (but this is just a
hunch), is that you not only have to create the service, but have to
register some of the callbacks for it; my app registers 3, the HW event
call back, the rpc default callback and the application exit callback.

It is also possible to run you application without dbus service at all
-- you simply remove the X-Osso-Service line from you desktop file, in
which case the TN will start your appl just by using the Exec line, and
it will not get killed. The major problem with doing that is that some
of the significant events get only notified over dbus, and I think
without having a correctly registered service you would not receive those.

Hope some of this helps.

Tomas
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers

Reply via email to