Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: chromebook support, sensor name isl29018 #132

Open
cypa opened this issue Dec 19, 2024 · 3 comments
Open

[Feature request]: chromebook support, sensor name isl29018 #132

cypa opened this issue Dec 19, 2024 · 3 comments

Comments

@cypa
Copy link

cypa commented Dec 19, 2024

Please describe your feature request

how to add chromebook support? my device is Google Pixel 1 (platform name LINK)

$ cat /sys/bus/iio/devices/iio:device0/name
isl29018
$ RUST_BACKTRACE=full wluma                
[2024-12-19T10:39:21Z WARN  wluma] Skipping 'keyboard-dell' as it might be disconnected: No such file or directory (os error 2)
[2024-12-19T10:39:21Z INFO  wluma] Continue adjusting brightness and wluma will learn your preference over time.
thread 'als' panicked at src/main.rs:112:26:
Unable to initialize ALS IIO sensor: "No iio device found"
stack backtrace:
   0:     0x591c1026dee2 - <unknown>
   1:     0x591c10290d63 - <unknown>
   2:     0x591c1026b32f - <unknown>
   3:     0x591c1026dd92 - <unknown>
   4:     0x591c1026f06e - <unknown>
   5:     0x591c1026eeb0 - <unknown>
   6:     0x591c1003b4fe - <unknown>
   7:     0x591c1026f7b9 - <unknown>
   8:     0x591c1026f50a - <unknown>
   9:     0x591c1026e3a9 - <unknown>
  10:     0x591c1026f16c - <unknown>
  11:     0x591c1002bd50 - <unknown>
  12:     0x591c1002c196 - <unknown>
  13:     0x591c10082fbf - <unknown>
  14:     0x591c10033920 - <unknown>
  15:     0x591c10271e4b - <unknown>
  16:     0x7fbc6308439d - <unknown>
  17:     0x7fbc6310949c - <unknown>
  18:                0x0 - <unknown>
@cypa
Copy link
Author

cypa commented Dec 19, 2024

in the daylight I have these

⁅cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
0
⁅cat /sys/bus/iio/devices/iio:device0/in_illuminance0_calibscale 
1.000000
⁅cat /sys/bus/iio/devices/iio:device0/in_illuminance0_scale 
0.015258
⁅cat /sys/bus/iio/devices/iio:device0/in_illuminance0_integration_time 
0.090000

and when I put laptop screen towards window I get

⁅cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
1

and with mobile phone flashlight at varying distance I see

pixel/home/cypa☇cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
29
pixel/home/cypa☇cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
36
pixel/home/cypa☇cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
89
pixel/home/cypa☇cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
50
pixel/home/cypa☇cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
120
pixel/home/cypa☇cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
27
pixel/home/cypa☇cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
15
pixel/home/cypa☇cat /sys/bus/iio/devices/iio:device0/in_illuminance0_input
13

playing with in_illuminance0_calibscale have given no meaningful results,
for in_illuminance0_input I've got values upto 999 with flashlight close to camera on screen top

@cypa cypa changed the title [Feature request]: chromebook support [Feature request]: chromebook support, sensor name isl29018 Dec 19, 2024
@maximbaz
Copy link
Owner

Thanks for the report! Could you try latest main with db77d27 ?

I can find surprisingly little information about how to properly work with all those different files. As far as I understand, when you have _input file, that's already "processed" value, ready for us to use. It's only the _raw files that we have to apply _offset and _scale on top.

I also found in chromium's source code how they work with ALS, that seems wrong to me and contradicts what little pieces I could find elsewhere - they seem to take whatever file is present, raw or not, ignore offset and always multiply it in_intensity_scale (not even by the matching _scale). It feels wrong, but time will tell if it was me who was wrong all along 😂

https://chromium.googlesource.com/chromium/src/+/refs/heads/main/services/device/generic_sensor/linux/sensor_data_linux.cc#21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants