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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Change console resolution (Armbian/bookworm) jcgraybill 1 861 06-22-2023, 01:31 PM
Last Post: jcgraybill
  Armbian 22.02 Release Announcement TRS-80 0 1,292 02-28-2022, 05:02 PM
Last Post: TRS-80
  Big thanks to Armbian! soupbowl 2 2,822 12-30-2021, 01:36 PM
Last Post: rookieone
  [SOLVED] How to poweroff PBP from Linux terminal? mx43 1 3,714 03-21-2020, 12:49 PM
Last Post: tllim
  Display battery charge value with LXDE and lxpanel wlad 1 4,769 12-04-2019, 03:36 AM
Last Post: pnts-se
  Armbian - Xenial Desktop (Pinebook) pineadmin 83 108,963 07-17-2019, 01:22 PM
Last Post: catsmile
  Wi-fi stops working - Armbian cel 1 3,084 06-26-2019, 01:57 PM
Last Post: cel
  Improve the life of your Pinebook battery by setting charger's voltage limits wlad 0 2,724 06-11-2019, 02:27 PM
Last Post: wlad
Exclamation Armbian - need help, locked out myself by setting backlight to zero UltraBloxX 6 7,274 03-31-2019, 12:36 PM
Last Post: guidol
  No display options on Pinebook or Pineboard Fox7799 0 1,913 02-06-2019, 11:56 AM
Last Post: Fox7799

Forum Jump:


Users browsing this thread: 1 Guest(s)