I noticed that the screen of my Librem 5 with Crimson does not switch of the screen when I hold the phone at my ear during a phone call. I forgot now if this is also the case in Byzantium.
Does the screen of the Librem 5 switch off when holding the Librem 5 at your ear during a phone call in Byzantium?
monitor-sensor gives a binary value as used by Phosh.
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_raw gives the raw value from the sensor (which is compared to in_proximity_nearlevel to get the binary value).
Try monitor-sensor, and move your hand near the sensor (by the top speaker). You should see the proximity value change to 1 when something is near and 0 otherwise.
If this works, stop here, we need to walk up the software stack to see whatâs going on.
Otherwise, then try watch -n 0.2 cat /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_raw and see if the value changes with your hand near the sensor.
My phone just now is pretty consistently >45 when very close, and less when farther. It drops off very quickly, the ânear levelâ is 7 which is about 2-3 cm away.
Next I did a reboot, and now the in_proximity_raw file is missing:
purism@crimson:~$ ls -sla /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_raw
ls: cannot access '/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_raw': No such file or directory
So the problem is device specific. Note that initially there was a in_proximity_raw file (from the 5th of January, after reboot it disappeared).
Then I checked the /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060 directory:
purism@crimson:~$ ls -sla /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060
total 0
0 drwxr-xr-x 3 root root 0 Jan 9 08:28 .
0 drwxr-xr-x 9 root root 0 Jan 9 08:28 ..
0 -r--r--r-- 1 root root 4096 Jan 9 08:37 modalias
0 -r--r--r-- 1 root root 4096 Jan 9 08:29 name
0 lrwxrwxrwx 1 root root 0 Jan 9 08:37 of_node -> ../../../../../../../firmware/devicetree/base/soc@0/bus@30800000/i2c@30a30000/prox@60
0 drwxr-xr-x 2 root root 0 Jan 9 08:37 power
0 lrwxrwxrwx 1 root root 0 Jan 9 08:28 subsystem -> ../../../../../../../bus/i2c
0 lrwxrwxrwx 1 root root 0 Jan 9 08:37 supplier:platform:30220000.gpio -> ../../../../../../virtual/devlink/platform:30220000.gpio--i2c:1-0060
0 lrwxrwxrwx 1 root root 0 Jan 9 08:37 supplier:platform:30330000.pinctrl -> ../../../../../../virtual/devlink/platform:30330000.pinctrl--i2c:1-0060
0 -rw-r--r-- 1 root root 4096 Jan 9 08:28 uevent
0 -r--r--r-- 1 root root 4096 Jan 9 08:37 waiting_for_supplier
Note that there is no iio:device0 directory, but there is a waiting_for_supplier file. Also some other links or directories are missing compared to my working Librem 5 (driver, trigger0).
What do you think, is this a software or a hardware issue?
does exist, itâs value changes between 3 and 4, with no difference whether I hold my hand in front of the sensor or not.
This is whatâs in that directory:
purism@pureos:~$ grep . /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/*
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/dev:247:0
grep: /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/events: Is a directory
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_illuminance_integration_time:0.080000
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_illuminance_integration_time_available:0.080000 0.160000 0.320000 0.640000
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_illuminance_raw:0
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_illuminance_scale:0.100000
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_calibbias:0.050000
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_calibbias_available:0.050000 0.075000 0.100000 0.120000 0.140000 0.160000 0.180000 0.200000
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_integration_time:0.000100
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_integration_time_available:0.000100 0.000150 0.000200 0.000250 0.000300 0.000350 0.000400 0.000800
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_nearlevel:7
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_oversampling_ratio:1
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_oversampling_ratio_available:1 2 4 8
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_raw:4
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/name:vcnl4000
grep: /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/of_node: Is a directory
grep: /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/power: Is a directory
grep: /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/subsystem: Is a directory
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/uevent:MAJOR=247
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/uevent:MINOR=0
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/uevent:DEVNAME=iio:device0
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/uevent:DEVTYPE=iio_device
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/uevent:OF_NAME=prox
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/uevent:OF_FULLNAME=/soc@0/bus@30800000/i2c@30a30000/prox@60
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/uevent:OF_COMPATIBLE_0=vishay,vcnl4040
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/uevent:OF_COMPATIBLE_N=1
/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/waiting_for_supplier:0
Notice that illuminance is stuck at 0 too, which would explain another issue: when I turn on automatic brightness, it turns the brightness all the way down to 0, so that the screen backlight is completely off and impossible to see! I have to shine a flashlight into it to be able to go back into the menu to turn automatic brightness back off! (at least thatâs what I had to do a while ago when I last tried it, I donât dare try that again, I might not be able to see the screen at all)