4

I have a Dell XPS 13 Laptop (old series) with ArchLinux and Gnome 3.18. I've read in official gnome 3.18 release notes that

If a light sensor is present, GNOME will now automatically adjust the display brightness in order to adjust for the ambient light level.

Can be tested using a ColorHugALS device for those who don't have built in hardware.

Windows 8 compatible hardware is supported.

A switch in the control center's power panel allows automatic display brightness to be turned on/off.

My ambient light sensor is not supported by Linux kernel out of the box, however I have compiled and installed / loaded this module and now my sensor appears as /sys/bus/acpi/devices/ACPI0008:00/. For example I can do

$ cat /sys/bus/acpi/devices/ACPI0008:00/iio\:device0/in_illuminance_raw
153

and read current raw illuminance.

However this seems not to be detected / supported by gnome as I still don't get a "switch in the control center's power panel" and display brightness is not automatically adjusted.

enter image description here

How can I make it work?

  • @doc_crissti: yes in the mean time I had landed there too... I've installed it from AUR but still no luck. I issued a request here github.com/hadess/iio-sensor-proxy/issues/46 – lviggiani Oct 9 '15 at 12:31
  • Of course I will bit I'm still struggling... – lviggiani Oct 9 '15 at 12:39
  • I'm not allowed to comment and lviggiani's patch answer is correct but the code has changed and this patch is no longer valid for the current git version. A search and replace of in_illuminance_input to in_illuminance_raw in src/drv-iio-poll-light.c will also do the trick. I noticed however that om my Acer S7 the values of _raw are "on the low side" and i suspect that the kernel "corrects" them for known sensors when exposing them in _input. – Milo Feb 21 '16 at 11:58
2

In the end I managed to get it working thanks to the support of one of the iio-sensor-proxy and kernel developers.

In my case I had to pull iio-sensor-proxy from git and apply this patch:

diff --git a/src/drv-iio-poll-light.c b/src/drv-iio-poll-light.c
index c2c5821..b568e78 100644
--- a/src/drv-iio-poll-light.c
+++ b/src/drv-iio-poll-light.c
@@ -37,7 +37,7 @@ iio_poll_light_discover (GUdevDevice *device)
        return FALSE;

    path = g_build_filename (g_udev_device_get_sysfs_path (device),
-                "in_illuminance_input",
+                "in_illuminance_raw",
                 NULL);
    ret = g_file_test (path, G_FILE_TEST_IS_REGULAR);
    g_free (path);
@@ -130,7 +130,7 @@ iio_poll_light_open (GUdevDevice        *device,

    drv_data->interval = get_interval (device);
    drv_data->input_path = g_build_filename (g_udev_device_get_sysfs_path (device),
-                        "in_illuminance_input",
+                        "in_illuminance_raw",
                         NULL);

    return TRUE;

Compiled and installed as per README instruction and finally enabled iio-sensor-proxy.service Now I have automatic brightness adjustment working.

Finally, the dev has submitted a patch to linux kernel that in future will enable iio-sensor-proxy working out of the box also on computers having similar ALS without requiring to patch iio-sensor-proxy.

  • 1
    Which version of the Linux kernel will have this update? And without the kernel update, did the software itself have any update to address this? – palswim Jul 15 '17 at 6:39
1

It worked for me after I installed the "iio-sensor-proxy" package from the aur.

  • On dell xps 13? – lviggiani Oct 13 '15 at 9:26
  • On a Macbook Pro 13 2013 (but this should not matter). Gnome uses iio-sensor-proxy to access the sensors, so it is a requirement If you want to use those. I hope this helped. – Guest Oct 13 '15 at 10:02
  • This package worked on a Lenovo ThinkPad Helix as well to enable dbus events for the ambient light sensor. Thank you! – eduncan911 Jan 31 '16 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.