Languages

Menu
Sites
Language
Sensor data acquisition and keeping the CPU awake

Hi all,

I've recently observed some really strange behavior on a Samsung Gear S3 device running Tizen 3.0.0.2. I've written both a native service app an web app targetting Tizen 3.0 for wearables but don't see any difference. During launch of these apps, I've used corresponding calls to keep the CPU awake to prevent the sensor acquisition to go to sleep which I had previously experienced. I log the samples in a file stored on the device's local storage (in /opt/usr/media/). 

Now the strange thing is, when I force the CPU to stay awake, the log file contains twice as many sensor samples.

To clarify, if I'm logging the acceleromter signal I'm getting: Acc1 - Acc1 - Acc2 - Acc2 -  .... - AccN - AccN instead of just Acc1 - Acc2 - Acc3, etc. which I observe when not forcing the CPU to stay awake. So somehow forcing the CPU to stay awake is pushing the system to simply repeat every sample. Even the event time-stamps are the same for every pair of identical samples!!

Has anyone observed this behavior before? Is it a known Tizen bug?

Thanks in advance for your input/comments,
Rich

View Selected Answer

Responses

3 Replies
Yasin Ali

Hi,

Could you please share your recorded data with timestamp
while keeping the cpu awake.

R Keanan

Hi Yasin,

Here's a snippet of the data:

931353298,931370,0.3086740970611572,-0.011964112520217896,9.834501266479492
931353298,931370,0.3086740970611572,-0.011964112520217896,9.834501266479492
931373293,931389,0.29431718587875366,0.035892341285943985,9.89432144165039
931373293,931389,0.29431718587875366,0.035892341285943985,9.89432144165039
931393288,931406,0.2847459018230438,-0.016749758273363113,9.82971477508545
931393288,931406,0.2847459018230438,-0.016749758273363113,9.82971477508545

....

The rest of the file is the same, constant repetition.

First two columns are the event time-stamp and clock_monotonous values, followed by the 3D accelerometer x,y,z values.  I also reset the watch because I was worried it had to do with some uncancelled alarms but with no luck. When I comment out the C-statements (which are in service_app_create and _terminate) that lock and release the CPU awake then this problem resolves but sensor logging drops after some time which is counter to what I want. I also have the necessary privildges like display and healthinfo enabled. Also, the background category is set to sensor.  So not sure what's going on..

Kind regards,
Rich

 

Mark as answer
Yasin Ali

Check Tizen native service application life-cycle(service application states).
Match your code and log accordingly.

Link: https://developer.tizen.org/development/guides/native-application/application-management/applications/service-application