Closed jer194 closed 3 years ago
It doesn't look like a termux problem:
s8: dumpsys sensorservice
...
TMD4906 RGB IR Sensor: last 10 events
1 (ts=427657.534586773, wall=11:08:28.930) 18446744073709551616.00, 1035.00, 1427.00, 1358.00, 14101.00, 17.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
...
@jer194 are you on stock android or is this with a custom rom?
That's LOS Pie, built by myself, using these additional packages:
lineage-16.0 github.com/exynos8895 android_vendor_samsung_dreamlte vendor/samsung/dreamlte
lineage-16.0 github.com/exynos8895 android_vendor_samsung_universal8895-common vendor/samsung/universal8895-common
lineage-16.0 github.com/exynos8895 android_device_samsung_dreamlte device/samsung/dreamlte
lineage-16.0 github.com/exynos8895 android_device_samsung_universal8895-common device/samsung/universal8895-common
lineage-16.0 github.com/exynos8895 android_kernel_samsung_universal8895 kernel/samsung/universal8895
lineage-16.0 github.com/LineageOS android_hardware_samsung hardware/samsung
lineage-16.0 github.com/LineageOS android_packages_resources_devicesettings packages/resources/devicesettings
LOS 17.1 from the same repos here, so probably/maybe specific to these sources
So you observe the same issue on LOS17.1? If so, it should be something in the sensor driver code in the kernel I guess.
My S8 ROM is here btw: https://sourceforge.net/projects/jer194/files/Android/LOS16.0/
So you observe the same issue on LOS17.1?
Yes.
I'm trying to get sensor data directly from the kernel, without using all the layers in between. For battery it is pretty easy, everything is listed here (S8): /sys/devices/platform/battery/power_supply/battery/uevent
For other sensors, it is not that easy, the closest I could find is dumpsys. But probably some sensors need to be switched on, in order to deliver data.
termux seems to use some java API for this purpose.
Everything available through termux-api comes from the android API, so only the info available from (for example) the battery manager is available: https://developer.android.com/reference/android/os/BatteryManager
Problem description @dreamlte:~/ termux-sensor -s "TMD4906 RGB IR Sensor"
In bright sunshine, the first (sommetimes the fifth) value seems to be misinterpreted as a floating point number.
Example sequence (compressed format):
Steps to reproduce Put an S8 / dreamlte into bright sunshine, and execute the command.
Expected behavior The first value probably should be interpreted as unsigned integer value, and maybe I4 instead of I2.
Additional information
logcat only shows this: