Can't control screen brightness - ACPI Error - Lenovo Legion Y540

6,721

Solution 1

I noticed that you haven't tried to enable the backlight in xorg.conf. See the 'enable brightness control' tip in the archwiki.

I have switchable graphics but I set the bios to discrete graphics because of my windows dual boot. So I too had to find another solution.

$ uname -a
Linux fifi 5.3.0-42-generic #34-Ubuntu SMP Fri Feb 28 05:49:40 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


$ less /etc/X11/xorg.conf
Section "Device"
        Identifier "Nvidia Card"
        Driver "nvidia"
        VendorName "NVIDIA Corporation"
        BoardName "GeForce GTX 1650"
    Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection

$ ls /sys/class/backlight/nvidia_0/
power/  actual_brightness  bl_power  brightness  device@  max_brightness  subsystem@  type  uevent

Solution 2

I also have same laptop Lenovo Legion Y540. This is now fixed in new update but you have to switch the BIOS option for graphics from Discrete Graphics to Switchable Graphics.

Also you have to update grub configuration (i.e. edit the file /etc/default/grub and then run sudo update-grub) as follows:

GRUB_CMDLINE_LINUX_DEFAULT="acpi_osi=linux acpi_backlight=intel"

Confirm that the acpi_backlight=intel it should not be set to vendor. Setting it to vendor stops the working of function-keys.

Solution 3

I've tried all the stuff written here with no luck. However I've written a small Python GUI script to change brightness through a GUI.

Please check https://github.com/momen84/brightness_controller

Share:
6,721

Related videos on Youtube

barzilay
Author by

barzilay

Updated on September 18, 2022

Comments

  • barzilay
    barzilay over 1 year

    I've observed the same behavior on 4 different Linux distributions (mint, manjaro, debian, ubuntu), they show ACPI errors on boot (link of a picture: https://imgur.com/a/7rLTsyr edit: this seems to be an unrelated and harmless bug reported and marked as won't fix on https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1864895 ) and then the systems works fine, but I can't control the screen brightness that is stuck at 100%. This is a huge issue since I work at night and the 300 nits of the screen are burning my eyes, making the laptop unusable while also draining the battery. Looking online, this is a common issue:

    Brightness control keys don't work on Lenovo Y540 but xrandr does
    https://www.reddit.com/r/Ubuntu/comments/cxygkp/brightness_not_working_on_ubuntu18_nvidia_rtx/
    Brightness adjustment not working on Lenovo Y540 https://www.reddit.com/r/pop_os/comments/ckkqod/cannot_change_screen_brightness_lenovo_legion_y540/

    but everyone seem to have "fixed" their issue the same way: by changing the bios settings from discrete graphics to switchable graphics. Sadly, my processor is the i7-9750HF variant, which does not include an integrated GPU (that's the meaning of the F part). This means that I only have my RTX 2060 discrete GPU and I'm not able to chose switchable graphics since there is nothing else to switch into.

    Here is a list of some of the things I tried and didn't work:

    • linux kernels tested: 5.4, 5.3, 5.0, 4.15

    • Nvidia drivers tested: nouveau, 430, 435, 440

    • BIOS version: BHCN36WW, BHCN35WW

    • Tried updating /etc/default/grub acpi_backlight=<all different options>, no luck.

    • xbacklight does nothing.

    • ls /sys/class/backlight shows only acpi_video0

    • sudo tee /sys/class/backlight/acpi_video0/brightness <<< 5 has no effect

    • the only thing that works is xrandr --output DP-2 --brightness 1 but that is not a solution since the backlight brightness isn't actually being changed, it just ramps the gamma. This is a software workaround that doesn't actually control the hardware. It also wouldn't help with battery life.

    I have tried every solution that I could find or think, but nothing worked. It sounds like something that could be fixed with a BIOS update, since it seems BIOS and ACPI related, but I don't know when or if ever a BIOS update will ever come, is there something on the OS side that could fix this issue?

    Please let me know if there is any extra information I should provide and thank you in advance for your help and patience!

    system info dump:

    • CPU: i7-9750HF
    • GPU: Nvidia RTX 2060
    • Screen: 1920x1080, 300 nits, 144 Hz
    • Laptop: Lenovo Legion Y540 - 15IRH
    • Model name: 81SX
    • BIOS version: BHCN36WW

    PS: Switching secure boot back on makes the brightness control issue go away. But sadly other problems show up, apparently because it loads the nouveau driver and doesn't tell you that it did (the gui will say you are using the proprietary drive but inxi -Gx will tell you the truth that you are using the nouveau one). I was going to try to blacklist it but turns out it was already blacklisted and loaded it anyway.

  • barzilay
    barzilay about 4 years
    You just solved my 4 weeks old problem! Just a few things for anybody else with the same issue: The file xorg.conf didn't exist for me. Following the link @cccplex suggested and also this one I was able to create it but I'm not sure how because of the many errors I got, I think it was using sudo nvidia-xconfig (nvidia Gui also crashed). Also, I discovered that you can enable secure boot and the screen brightness will work again! But you will be stuck with the nouveau driver for some reason, blacklisting it doesn't work.
  • cccplex
    cccplex about 4 years
    Yes you have to create /etc/X11/xorg.conf Do you still have errors? I think it is best to only put the minimal needed configuration there because xorg will automatically configure the rest. The minimal config you can see in my answer. You will have to change the boardname to your own.
  • barzilay
    barzilay about 4 years
    There is a lot of configurations on my file since I used nvidia-xconfig to generate it automatically, should I have just created one from scratch and pasted yours? I could delete mine now and use yours (with a change to the boardname). The screen brightness problem is gone! Thank you so much!
  • barzilay
    barzilay about 4 years
    But I still have another problem, I think it was already here before the changes. On system suspension I get stuck on a black screen for a really long time, while it shows an error message, one error for each time I suspend the system by closing the lid or pressing the power button. With 4 suspensions: imgur.com/ea2jhD0 . Did you get the same problem? It seems to be wifi related but my connection works fine and I couldnt find a similar problem online. Yesterday I saw a different error message for some reason, an ACPI error saying that suspension was not implemented or something.
  • cccplex
    cccplex about 4 years
    Yes, I did have suspend problems on my y540. But on the latest ubuntu with nvidia 435 they are gone. Hopefully it stays gone because it is prone to regression.
  • barzilay
    barzilay about 4 years
    I'm on Ubuntu 19.10 and nvidia 435 =/ Still got suspension problems. Any tips on where to look for a solution?
  • sam
    sam almost 4 years
    Ubuntu 18.04LTS with 4.18 unsigned kernel works perfect. 4.5 hrs battery life on optimus. any other kernel other than 4.18 doesn't work with pch_canonlake sensor and cannot complete the sensors-detect command. My one's got the 1660Ti and 9750H with 256GB, 1TB disks
  • sam
    sam almost 4 years
    after installing the kernel reinstall the graphics drivers else it won't work.
  • barzilay
    barzilay almost 4 years
    enabling backlight in xorg.conf didn't work? What's your model exactly? Do you have an integrated GPU? are you using ubuntu?
  • sam
    sam almost 4 years
    If you want to ignore security vulnerabilities then get the kernel 4.18. everything will get solved
  • Momen84
    Momen84 almost 4 years
    I have Legion Y540 and running Dual Boot Ubuntu 20.04 and Windows 10. I installed both using the Discrete GPU option from the BIOS, however when I tried the Switchable option , xorg fails !!. So I wrote that small script as a work around, however when I deleted the xorg.conf file, everything worked just fine !!! All options now are working just perfect . I don't know why exactly but that's what happened.
  • barzilay
    barzilay over 3 years
    No, that doesn't solve the problem, as mentioned on the question. CPUs with no iGPU do not have the switchable mode
  • barzilay
    barzilay over 3 years
    I had to do a fresh install on manjaro and I only managed to get the backlight to work after adding the Option "RegistryDwords" "EnableBrightnessControl=1" on the /etc/X11/xorg.conf.d/90-mhwd.conf file. Just a heads up to anyone going through the same issue
  • ritesh
    ritesh about 3 years
    This doesn't solve the issue for me, from BIOS options keeping it to Discrete Graphics works for me.
  • MrD
    MrD about 3 years
    Can confirm this solves the issue also for Legion 5 with AMD Ryzen 7 4800H and NVIDIA GeForce GTX 1660 Ti Mobile. It should still be labeled 'intel' because this what the NVIDIA driver uses.