Need help with locating sensor source for Nexus 5

451 views
Skip to first unread message

Raghavan Santhanam

unread,
Oct 13, 2014, 12:06:43 PM10/13/14
to android...@googlegroups.com
Hi,

I would like to know where exactly is the sensor source for the sensors in Nexus 5(InvenSense, Qualcomm, Bosch, Avago, and Akm).
I have seen some source under hardware/* but the target shared library(lib*.so) being created with these code don't seem to be present
under /system/lib or /system/lib/hw or anywhere under root(/). Any idea where can I get the source for these? I am aware of the code
for the synthetic sensors(Rotation Vector, etc) under frameworks/native/service/sensorservice/*, but I need the code for the real hardware
sensors.

Thanks.

Raghavan Santhanam

unread,
Oct 13, 2014, 2:31:33 PM10/13/14
to android...@googlegroups.com
By the way, these are the sensors(including synthetic/virtual sensors) being reported for Nexus 5.

1. MPU6515 Accelerometer - InvenSense
 2. AK8963 Magnetometer - AKM
 3. AK8963 Magnetometer Uncalibrated - AKM
 4. MPU6515 Gyroscope - InvenSense
 5. MPU6515 Gyroscope Uncalibrated - InvenSense
 6. Proximity Proximity & Light - Avago
 7. Light Proximity & Light - Avago
 8. BMP280 Barometer - BOSCH
 9. Gravity - Qualcomm
 10. Linear Acceleration - Qualcomm
 11. Rotation Vector - Qualcomm
 12. Step Detector - Qualcomm
 13. Step Counter - Qualcomm
 14. Significant Motion Detector - Qualcomm
 15. Game Rotation Vector - Qualcomm
 16. Geomagnetic Rotation Vector - Qualcomm
 17. Orientation - Qualcomm
 18. MPU6515 Game Rotation Vector Secondary - InvenSense
Thanks.

Brian Carlstrom

unread,
Oct 14, 2014, 1:33:06 AM10/14/14
to android...@googlegroups.com
Are they part of the "proprietary binaries"?

https://source.android.com/source/building-devices.html#obtaining-proprietary-binaries

-bri
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-contr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Raghavan Santhanam

unread,
Oct 14, 2014, 11:38:53 AM10/14/14
to android...@googlegroups.com
Not sure since I absolutely have any idea about which *.so is referring to which sensor HAL module implementation from these vendors. But, I can see some libraries available at https://developers.google.com/android/nexus/blobs-preview from these vendors. Again, not sure which library is responsible for which sensor HAL module implementation from these vendors.

All I want to do is to sniff the sensor readings being at sensor HAL level just for my academic experiments and no commercial intent involved in it.

Now, it seems not possible to get their respective source from these vendors. However, I am trying to find what actually calls the poll() function of each of  sensor HAL modules by looking at the Android System hierarchy. Hopefully I will find something.

Cheers!

Raghavan Santhanam

unread,
Oct 15, 2014, 12:32:40 PM10/15/14
to android...@googlegroups.com
After some brainstorming and researching, I have found the place within the frameworks/service/sensorservice/* code where I can do the necessary sniffing of sensor readings from the real hardware sensors. Previously, I used to modify the hardware sensors HAL code implemented under hardware/* but now I can do the same inside the virtual sensors' code. Cool!

Cheers,
Raghavan

Moustafa Alzantot

unread,
Mar 5, 2015, 11:15:17 PM3/5/15
to android...@googlegroups.com
Hi Raghavan,

I am trying to modify the invesense hal under hardware/invensense/* . However, when I rebuilt and flash the android Image I believe my code changes are not taking place ? There are 3 different directories there 60xx, 6515, and 65xx. I tried changing all of them but still my updates are not reflected.

Also, after rebuilding those "libinvensense_hal.so" module, I can't find where to push this file on the Android device.

I wonder if it worked with you?
Best,
Moutsafa 

Denis Ciocca

unread,
Jul 22, 2015, 3:28:39 PM7/22/15
to android...@googlegroups.com
Hi guys,

first you need to remove the original sensors.hammerhead.so. Here: /vendor/lib/hw/

Then you can push yours in one of these locations:
/system/lib/hw/
/system/vendor/lib/hw/
/vendor/lib/hw/
up to you where...the system search from vendor folders...

Anyway, I think it doesn't work because in Nexus 5 sensors are read from Qualcomm ADSP. You should disable it before.


Denis
Reply all
Reply to author
Forward
0 new messages