Re: [SailfishDevel] GPS not turned off if app exits without stopping the GPS

2014-01-13 Thread Aaron McCarthy
Hi,

On Tue, 14 Jan 2014 00:01:40 Marcel wrote:
> my app is far away from being a test object ;) I've just created the C++
> source to check if it is giving me two different accuracies (vertical and
> horizontal) and I never removed it. But if that found a bug, I'm glad that I
> could help... :D
> 
> Sorry to be slightly offtoppic, but a small question on this: what would be
> the best practice then if I would need the position in QML and in C++, or in
> two different pages in QML? Shouldn't I use two PositionSources? I have
> this problem for my app if I want to show the position in the app cover...

To use a single PositionSource object you need to place it in a scope that is 
accessible from both your cover and application pages.

Having two or more PositionSource objects works but unnecessarily increases 
the resources (memory, processing, and IPC communications) used by your 
application. Which is why I would suggest using one.

> And as you can see in the archive page, all your mails have gone to the
> mailing list, the one you've forgotten the CC you had added it to the To
> field.

Force of habit, I usually only reply to the list.

Cheers,

-- 
Aaron McCarthy
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] GPS not turned off if app exits without stopping the GPS

2014-01-13 Thread Marcel
Hi all,

my app is far away from being a test object ;) I've just created the C++ 
source to check if it is giving me two different accuracies (vertical and 
horizontal) and I never removed it. But if that found a bug, I'm glad that I 
could help... :D

Sorry to be slightly offtoppic, but a small question on this: what would be 
the best practice then if I would need the position in QML and in C++, or in 
two different pages in QML? Shouldn't I use two PositionSources? I have this 
problem for my app if I want to show the position in the app cover...

And as you can see in the archive page, all your mails have gone to the 
mailing list, the one you've forgotten the CC you had added it to the To 
field.

Greets,
Marcel

Am Montag, 13. Januar 2014 schrieb christopher.l...@thurweb.ch:
> Hi Aaron and Marcel
> 
> this evening I have done the following battery of tests on my Jolla  
> taking input from Aaron.
> 
> As test GPS-consuming-apps I used:
> 
> a) Maps (as suggested by Aaron)
> b) Marcel's GPSInfo app very kindly posted to  
> https://github.com/balta3/sailfish-gpsinfo
> c) My semi-ported landed25_QT5 app
> 
> More on b) and C) later.
> 
> These are the steps I ran. The arrow symbol --> indicates the result  
> of the test on the line immediately above.
> 
> 
> 1) pkcon install qt5-qttools-qdbus
> 
> 2) Shutdown, waited 5 minutes, restarted Jolla
> 
> 3) connected via ssh as memo
> 
> 4) /usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep  
> '/org/freedesktop/Geoclue/Master/client' | wc -l
> 
> --> 0
> 
> 5) started Maps
> 
> 6) /usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep  
> '/org/freedesktop/Geoclue/Master/client' | wc -l
> 
> --> 1
> 
> 7) pkill -9 sailfish-maps
> 
> 8) /usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep  
> '/org/freedesktop/Geoclue/Master/client' | wc -l
> 
> --> 0
> 
> 9) ps aux | grep geoclue
> 
> -->
> nemo  2003  0.0  0.3   7616  2708 ?S22:01   0:00  
> /usr/libexec/geoclue-master
> nemo  2201  0.0  0.1   5912   856 pts/0S+   22:06   0:00 grep 
geoclue
> 
> 10) pgrep -l geoclue
> 
> -->
> 2003 geoclue-master
> 
> Additional note: GPS icon gone.
> 
> 11) restarted maps
> 
> 12) grep -l geoclue
> 
> -->
> 2003 geoclue-master
> 2438 geoclue-hybris
> 2445 geoclue-here
> 
> 
> 13) killed maps by down-swipe
> 
> 14) rerun step 12) x 4
> 
> --> first 3 runs give output as step 12
> run 4 (within 30 secs) gives
> 
> -->
> 2003 geoclue-master
> 
> Additional note: GPS icon gone.
> 
> 15) Shutdown, waited, restarted, reconnected as nemo via ssh
> 
> 16) /usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep  
> '/org/freedesktop/Geoclue/Master/client' | wc -l
> 
> -->
> 
> 
> 17) started app GPSInfo
> 
> 18) /usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep  
> '/org/freedesktop/Geoclue/Master/client' | wc -l
> 
> -->
> 2
> 
> 19) pgrep -l geoclue
> 
> -->
> 1798 geoclue-master
> 1841 geoclue-hybris
> 1847 geoclue-here
> 
> 20) pkill GPSInfo
> 
> 21) pgrep -l geoclue
> 
> -->
> 1798 geoclue-master
> 1841 geoclue-hybris
> 1847 geoclue-here
> 
> 22) /usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep  
> '/org/freedesktop/Geoclue/Master/client' | wc -l
> 
> -->
> 1
> 
> 23) Steps 21) and 22) repeated X times over many minutes, same result,  
> also GPS Icon still shown.
> 
> 24) Shutdown, waited, restarted, reconnected as nemo via ssh
> 
> 25) started landed25_QT5
> 
> 26) /usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep  
> '/org/freedesktop/Geoclue/Master/client' | wc -l
> 
> -->
> 1
> 
> 27) killed landed25_QT5 manually
> 
> 28) /usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep  
> '/org/freedesktop/Geoclue/Master/client' | wc -l
> 
> -->
> 
> 
> Conclusions:
> 
> The symptoms I reported (GPS stays running after app exits) appears to  
> be limited to Marcel's app GPSInfo (sorry Marcel), or perhaps the way  
> Sailfish handles his app.
> 
> So what does Marcel's app do differently?
> 
> His app was the only one that gave an answer of 2 to  
> "/usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep  
> '/org/freedesktop/Geoclue/Master/client' | wc -l"
> 
> So why 2?
> 
> Well it turns out that Marcel has 2 PositionSources in his code, one  
> in C++, and one in QML, and only one of these is properly cleaned up  
> when the app is killed. One the one-hand the app probably should not  
> have 2 PositionSources, but maybe the OS should still be able to  
> handle this?
> 
> Thanks for your time
> 
> Chris
> 
> p.s, @Marcel, as you was kind enough to post me your code when I was  
> kicking and screaming about a possible bug, I have purposely not cced  
> this to the mailing list, but if you want to forward it there for the  
> benefit of others, I have no objections 8-)
> 
> p.p.s all tests above using 1.0.2.5, I had to resist the temptation to  
> accept the upgrade halfway through. Now about to upgrade ?.
> 
> 
> 
> 
> 
> Zitat von "Aaron McCarthy" :
> 
> > Hi,
> >
> > On Mon

Re: [SailfishDevel] GPS not turned off if app exits without stopping the GPS

2014-01-13 Thread christopher . lamb

Hi Aaron

Thanks for you rapid answer. I am on my way to work, I will play  
around with this further when I get back home this evening (Swiss Time).


So far, on both the N9 and Jolla I used the presence of the GPS icon  
as an indication that it was running / not running.


Once I have run the tests you suggest I will update this thread,

Cheers

Chris

Zitat von "Aaron McCarthy" :


Hi,

On Mon, 13 Jan 2014 08:11:05 christopher.l...@thurweb.ch wrote:

I will call this a behaviour for the moment. Yesterday I noticed that
if an app that uses the GPS exits without stopping the GPS, then the
GPS remains running on the Jolla.


How did you confirm this? Presence of the Location icon on the lock screen?


I compared this to my Nokia N9. On that device if an app using the GPS
exits (e.g. the user closes it), then the GPS stops soon after that
app has exited (even if the app does not explicitly shut the GPS down).

On the N9 this even works with multiple apps open using the GPS. In
this test, when the last GPS-consuming app exits, the GPS shuts down.


This is expected to work. Both the Geoclue master and the provider processes
monitor DBus disconnections and will clean up any associated interfaces. The
provider processes will then close 30 seconds after there are no more
connections.

How to test that geoclue-master is working:

Run

/usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep
'/org/freedesktop/Geoclue/Master/client' | wc -l

to see how many processes have started positioning.

Run the above command, expect 0
Run sailfish-maps
Run the above command, expect 1
pkill -9 sailfish-maps
Run the above command, expect 0

It is harder to test this functionality in the providers as the number of
connections are not readily available.

Can you check whether there are any client interfaces exported by geoclue-
master with the above command. Also what geoclue processes are  
running (ps aux

| grep geoclue).

Cheers,

--
Aaron McCarthy
___
SailfishOS.org Devel mailing list





___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] GPS not turned off if app exits without stopping the GPS

2014-01-12 Thread Aaron McCarthy
Hi,

On Mon, 13 Jan 2014 08:11:05 christopher.l...@thurweb.ch wrote:
> I will call this a behaviour for the moment. Yesterday I noticed that
> if an app that uses the GPS exits without stopping the GPS, then the
> GPS remains running on the Jolla.

How did you confirm this? Presence of the Location icon on the lock screen?

> I compared this to my Nokia N9. On that device if an app using the GPS
> exits (e.g. the user closes it), then the GPS stops soon after that
> app has exited (even if the app does not explicitly shut the GPS down).
> 
> On the N9 this even works with multiple apps open using the GPS. In
> this test, when the last GPS-consuming app exits, the GPS shuts down.

This is expected to work. Both the Geoclue master and the provider processes 
monitor DBus disconnections and will clean up any associated interfaces. The 
provider processes will then close 30 seconds after there are no more 
connections.

How to test that geoclue-master is working:

Run

/usr/lib/qt5/bin/qdbus org.freedesktop.Geoclue.Master | grep 
'/org/freedesktop/Geoclue/Master/client' | wc -l

to see how many processes have started positioning.

Run the above command, expect 0
Run sailfish-maps
Run the above command, expect 1
pkill -9 sailfish-maps
Run the above command, expect 0

It is harder to test this functionality in the providers as the number of 
connections are not readily available.

Can you check whether there are any client interfaces exported by geoclue-
master with the above command. Also what geoclue processes are running (ps aux 
| grep geoclue).

Cheers,

-- 
Aaron McCarthy
___
SailfishOS.org Devel mailing list


[SailfishDevel] GPS not turned off if app exits without stopping the GPS

2014-01-12 Thread christopher . lamb

Hi

I will call this a behaviour for the moment. Yesterday I noticed that  
if an app that uses the GPS exits without stopping the GPS, then the  
GPS remains running on the Jolla.


I compared this to my Nokia N9. On that device if an app using the GPS  
exits (e.g. the user closes it), then the GPS stops soon after that  
app has exited (even if the app does not explicitly shut the GPS down).


On the N9 this even works with multiple apps open using the GPS. In  
this test, when the last GPS-consuming app exits, the GPS shuts down.


Chris


___
SailfishOS.org Devel mailing list