Should the screen go black when in a call with the phone at your ear?

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?

To my recollection, my phone behaved this way on Byzantium, and still does using Crimson.

Just made a call to confirm and yes, if I put anything over the top of the phone while a call is active, the screen goes black (on Crimson).

3 Likes

It could be an issue relating to the proximity sensor :thinking: @dos What is the easiest way to test the proximity sensor?

1 Like

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).

2 Likes

@janvlug Try:

  1. 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.
  2. 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.
1 Like

Thanks for the hints!

I tested this on two Crimson Librem 5’s. One behaves exactly as expected.

The other one not.

Here some info from the malfunctioning Librem 5:

purism@crimson:~$ ls -sla /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_raw
0 -rw-r--r-- 1 root root 4096 Jan  5 15:45 /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_raw
purism@crimson:~$ cat /sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_raw
cat: '/sys/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0060/iio:device0/in_proximity_raw': Invalid argument

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?

Happens on other kinds of phones also. Perhaps one day they’ll put in ‘ear detectors’?