Failure in setting the display backlight with Armbian 5.86 [SOLVED]
#1
I tested both current Armbian mainline images (Armbian_5.86_Pinebook-a64_Ubuntu_bionic_next_4.19.38_desktop and Armbian_5.86_Pinebook-a64_Debian_stretch_next_4.19.38) with my Pinebook 11.6" shipped in May '19 and both images have issues with the display brightness settings. 

Indication: After boot up, the backlight is set to maximum brightness and resetting it to other values in /sys/class/backlight/backlight/brightness (or via desktop power manager tool) shows no effect. The brightness level stays the same, although 'cat  /sys/class/backlight/backlight/brightness' returns changed values.

Solution: I managed to work around the issue by modifying the sun50i-a64-pinebook.dtb in /boot/dtb/allwinner/ in the following way:

(You can convert the dtb file to human-readable dts-format with 'dtc -I dtb -O dts /boot/dtb/allwinner/sun50i-a64-pinebook.dtb > converted.dts')

Initial content was:

Code:
[...]
backlight {
compatible = "pwm-backlight";
   pwms = < 0x43 0x00 0xc350 0x01 >;
brightness-levels = < 0x0 0x5 0xa 0xf 0x14 0x1e 0x28 0x37 0x46 0x55 0x64 >;
default-brightness-level = < 0x2 >;
  enable-gpios = < 0x22 0x03 0x17 0x00 >;
phandle = < 0x98 >;
};
[...]

After I removed the line with "phandle = < 0x98 >;", setting backlight brightness worked again. Unfortunately, the levels were reversed (1 meaning brightest, 9 meaning darkest, 0 and 10 turned off the backlight completely). Thus, I have changed the line with "brightness-levels" with inversed level values.

Overall, the final content of the dts file is:
Code:
[...]
backlight {
  compatible = "pwm-backlight";
   pwms = < 0x43 0x00 0xc350 0x01 >;
  brightness-levels = < 0x64 0x55 0x46 0x37 0x28 0x1e 0x14 0xf 0xa 0x5 0x0 >;
  default-brightness-level = < 0x2 >;
  enable-gpios = < 0x22 0x03 0x17 0x00 >;
};
[...]

In order to apply the changes, you have to compile the dts file back to dtb format and overwrite the original file in /boot/dtb/allwinner/. We will backup the original file before overwriting, in case after the reboot you end up with a dark display and need to boot from sd-card in order to undo the changes.
Code:
sudo cp /boot/dtb/allwinner/sun50i-a64-pinebook.dtb /boot/dtb/allwinner/sun50i-a64-pinebook.dtb.bac
sudo dtc -I dts -O dtb converted.dts > /boot/dtb/allwinner/sun50i-a64-pinebook.dtb

Please note, that this is only a shallow workaround. I do not know, what the effect of the phandle line was and why it works to set brightness without it. All I can say is that until now, I saw no negative side effects of this "solution".
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Improve the life of your Pinebook battery by setting charger's voltage limits wlad 0 44 06-11-2019, 02:27 PM
Last Post: wlad
  Display battery charge value with LXDE and lxpanel wlad 0 27 06-11-2019, 09:56 AM
Last Post: wlad
Exclamation Armbian - need help, locked out myself by setting backlight to zero UltraBloxX 6 181 03-31-2019, 12:36 PM
Last Post: guidol
  Armbian - Xenial Desktop (Pinebook) pineadmin 79 14,940 03-06-2019, 04:20 PM
Last Post: tllim
  No display options on Pinebook or Pineboard Fox7799 0 199 02-06-2019, 11:56 AM
Last Post: Fox7799
  Armbian 18.04 (Bionic) for Pinebook Luke 0 931 08-17-2018, 02:28 PM
Last Post: Luke
  How to test the emmc(usdhc2) diver and pwm backlight driver? vinothkumar 0 160 12-29-2017, 11:40 PM
Last Post: vinothkumar
  Screen backlight accidentally zero % boubik 5 426 09-10-2017, 01:14 PM
Last Post: boubik
  Display soc temperature in cpu temperature status of byobu mtk 0 1,658 05-09-2017, 09:52 AM
Last Post: mtk

Forum Jump:


Users browsing this thread: 1 Guest(s)