Brigthness Control not working on Thinkpad T440p (and possibly others)

  • Dear all, after a while of not seing updates in OpenELEC I realized many of the developers forked into LibreELEC, so I switched here.
    First of all I would really like to congratulate you on the project and sustained support for all of us users.

    As I mentioned, I came from OpenELEC system, and I have noticed since the last upgrades, initially to OpenELEC beta and Milhouse builds and lately to LibreELEC 7.0.2 that the brightness control built in on my ThinkPad T440p notebook does not work. I have tested it in both v7.0.2 and LibreELEC (Krypton) v7.90.002 ALPHA.
    I have alse replicated this same issue in another T450.

    Some notes and troubleshooting I have already done:
    * Tried the system that came from the upgrade (severals) and also a clean fresh install. Same beahviour.
    * If I set the brightness before Kodi loads, it works, but upon load it goes to full brightness.

    Usually it is activated via Fn + F6/F5, to no avail. It looks like it is a kernel issue (or a keymap issue). I am using both Kali and Xubuntu on the same machine, and on both distros brightness operates flawlessly.

    Quick search on the web shows many results related to this same issue in different Linux Flavours.

    Attached are links for dmesg, kodi.log and backlight information (below)

    Code
    OpenELEC-T440p:~ # ls /sys/class/backlight/
    intel_backlight

    dmesg output:
    baFG

    kodi.log output (in debug mode):
    eKCc

    Latest keypresses reflect key to change brightness, apparently keys are not recognized.


    Your help or troubleshooting guidance will be appreciated.


    Regards


    Edit 1: installed System Tools Addon and using getscancodes the system does not seem to recognize the brightness adjust keys.

    Code
    LibreELEC-Portable:~ # getscancodes /dev/input/event4
    Input driver version is 1.0.1
    Input device ID: bus 0x11 vendor 0x1 product 0x1 version 0xab54
    Input device name: "AT Translated Set 2 keyboard"

    It may be related to the latest update to the .hwdb syntax.

    Edited once, last by Gaudi (July 7, 2016 at 1:15 AM).

  • I happened to do some extra testing. Searching the web, found the way to manually change screen brightness.
    I have investigated and there the interface is up, and reports as following:

    Code
    OpenELEC-T440p:~ # ls /sys/class/backlight/intel_backlight/
    actual_brightness  device             subsystem
    bl_power           max_brightness     type
    brightness         power              uevent

    I can then issue a command to change backlight to an arbitrary value:

    Code
    echo XXX > /sys/class/backlight/intel_backlight/brightness

    Where XXX is a value between 0 (backlight off) and max_brightness (4794 for this particular model).

    So apparently the issue is related to the keys themselves not responding or setting the change.

    I am not very acknowledgeable in any way with scripting, but I guess that it should be fairly simple to create a script that could increment or decrement by 10% (1/10th of the max-min brightness) and assign it to a Kodi key.

    Can anyone help me to achieve this?


    Thanks!

  • Did you try to add this config:

    Code
    Section "Device"
      Identifier "card0"
      Driver "intel"
      Option "Backlight" "intel_backlight"
      BusID "PCI:0:2:0"
    EndSection


    to /etc/X11/xorg.conf.d/20-intel.conf file?

    Edited once, last by valdi74 (December 2, 2016 at 1:57 PM).


  • Did you try to add this config:

    Code
    Section "Device"
      Identifier "card0"
      Driver "intel"
      Option "Backlight" "intel_backlight"
      BusID "PCI:0:2:0"
    EndSection


    to /etc/X11/xorg.conf.d/20-intel.conf file?


    Will give it a try and post results.

    Thanks!


  • Did you try to add this config:

    Code
    Section "Device"
      Identifier "card0"
      Driver "intel"
      Option "Backlight" "intel_backlight"
      BusID "PCI:0:2:0"
    EndSection


    to /etc/X11/xorg.conf.d/20-intel.conf file?

    There is no such directory. only X11 with the following files:

    Code
    OpenELEC-T440p:~ # ls /etc/X11/
    xorg-i915.conf           xorg-nvidia.conf
    xorg-nvidia-legacy.conf  xorg-radeon.conf

    Besides, I guess /etc/ is mounted as read only, as it is part of the compressed image that gets mounted at boot time.

    Any suggestion?


  • "cp /etc/X11/xorg-i915.conf /storage/.config/xorg.conf" then edit the new file and reboot (or restart xorg.service) to effect changes

    Thanks for the suggestion. I have to comment that creating and editing the file has ho effect.
    As I have mentioned before, I am able to change backlight using xrandr and echo command (see original post), what does not seem to work is the fn key mapping, as these produce no recognized kernel keymap.

    I guess best solution will be to come with a bash script to increase or decrease brightness by, lets say, 10%.
    That is, to query max backlight level, and current value, and increment or decrement accordingly. I can then map these scripts to any desired key.

    I am not that much profficient in bash scripting, so I will need to do some learning to come with a functional script.

    I'd rather have the original fn keys working, but it may be related to some kernel incompatibility. I use Kali and Xubuntu 16.04 on this same machine and fn keys work as expected, changing backlight.

    Thank you!