We have moved to a new Sailfish OS Forum. Please start new discussions there.
2

Timer slows down when screen is off [answered]

asked 2014-08-22 22:58:24 +0200

FloR707 gravatar image

updated 2014-08-22 23:29:10 +0200

kimmoli gravatar image

Hi there,

I just noticed that my timer function still slows down significantly if me screen is off and no other program is active. The app I am currently working on also uses sounds. When I debug the timer I can see on Qt Creator that the timer slows down but as soon as a sound is played as well the timer runs normal again. I saw that turning off THO can cause this. I already unmasked the service in case it was masked and rebooted the device, no change. Does anyone know why this happens?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by eric
close date 2014-08-25 16:37:06.091312

1 Answer

Sort by » oldest newest most voted
3

answered 2014-08-22 23:28:08 +0200

kimmoli gravatar image

The phone goes to deep-sleep and almost nothing runs - not even sw timers - You need to use libiphb or nemokeepalive or such methods to wake up the phone periodically or prevent it going to sleep.

Some pointers for more info (in middle of threads maybe)

https://lists.sailfishos.org/pipermail/devel/2014-March/003746.html

https://lists.sailfishos.org/pipermail/devel/2014-January/002977.html

https://lists.sailfishos.org/pipermail/devel/2014-March/003694.html

edit flag offensive delete publish link more

Comments

I am really a beginner and I am not sure if these approaches are easy enough for me to understand it. What is also mentioned in the mailing list and what I also observed is that if any audio is played the timer works fine. So I will loop through a Second of silence to make sure the project stays awake =)

Thanks for the links anyway.

FloR707 ( 2014-08-23 09:18:28 +0200 )edit

yep. been there - i was afraid of those things as i'm also a beginner, failed to use them at first, but after few trial and error and help in IRC channels got libiphb working as i wanted.

ofc the "stay-alive" implementation depends what your app does, how strict timing you need, where you want to distribute it (harbour, openrepos or making it just for you).

Using silent audio method might get fail on harbour QA power measurements:

https://together.jolla.com/question/13243/my-app-got-rejected-to-store-because-of-high-power-consumption-how-to-debug-problems/#post-id-13247

kimmoli ( 2014-08-23 12:20:14 +0200 )edit

Question tools

Follow
3 followers

Stats

Asked: 2014-08-22 22:58:24 +0200

Seen: 572 times

Last updated: Aug 22 '14