Remove All Ads from XDA

sensor (pressure) polling rate

2 posts
Thanks Meter: 0
By kolijoco, Junior Member on 19th August 2014, 08:47 AM
Post Reply Subscribe to Thread Email Thread
hi (this is my first post),

i'm trying to tweak the maximum from the pressure sensor in the galaxy s4 coding up a variometer app (yes, i know there are several).
the chip in the device is a bosch180 with quite impressive specs.

i've tried to increase polling rate so as to do filtering without encoding too much delay (which is what other apps are suffering from, imho - hence the motivation).

i found that no matter what poll interval i specify (either through SensorManager.registerListener in java or ASensorEventQueue_setEventRate in native), the refresh rate is always the same (as per logcat):
Sensors(814): Pressure old sensor_state 129, new sensor_state : 137 en : 1
or and diffing event timestamps in the app (that actually shows 170-180 millisecs)

so i went digging further, trying to untangle the mysteries of pressure sensor. i checked the chip specs and linux drivers, and still believe faster polling should be possible.

i'm on cm11-jflte (both release and built from source), rooted

cm11 kernel is configured to use the sensorhub ssp drivers for the pressure sensor (not bmp085.c or bmp18x.c), i tried to re-hardcode the default polling rate for the pressure sensor in the ssp driver files (which is otherwise 200ms for all sensors across the board), which changes the poll_delay file contents on the sysfs, but doesn't change the behavior in the app.

i currently don't have the time to untangle the workings of ssp.

QUESTION: where in the (java or) native android layer or the ssp kernel drivers are the default(?) polling rates for specific sensors specified?
ALT: other ideas as to how to proceed?

(i will reconfigure the kernel to use one of the the other bmp drivers next, but fear how that will impact the rest of the sensorhub...)

(i realize this is more of a hacking/tweaking topic, but as i just signed up to ask this specific question, i'm not yet allowed to post in the rom/tweaks development section - if a moderator could maybe move the thread...)

thanks for all ideas in advance!
21st August 2014, 02:33 PM |#2  
OP Junior Member
Thanks Meter: 0
other drivers don't help.
the hardware is being run by ssp kernel drivers, i could not locate the pressure sensor as a stand-alone anywhere on the i2c.
i'm guessing the driver is being interacted with through the and hal implementations (which are proprietary blobs).

playing around in shell, i found that in fact the polling rate (in sysfs) is set to 66.7ms (15Hz) when i register my listener at SENSOR_DELAY_FASTEST, but the events are still only reported every 180ms.
i was able to intercept pressure events from the shell using getevent /dev/input/event6 and the reported timestamps are also showing 180ms between events.

ideas, anyone?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes