You are not logged in.

#1 2021-03-03 18:20:55

gavsiu
Member
Registered: 2016-04-08
Posts: 29

Lenovo Legion 7i backlight does not "work out of the box"

The wiki claims the Legion 7i has a working backlight out of the box, but not for me.

/sys/class/backlight/intel_backlight does exist, but does nothing. The backlight either goes 100% or 0%. There is no in between. The brightness file is being written to. I've tried all the kernel command line options from Backlight wiki, Intel wiki and pretty much anything else I've found online. I've even tried changing the nvidia card, but that shouldn't have worked anyway because it's not the default card. I went through all the troubleshooting steps on both the Backlight and Intel wiki.

The only workaround is using xrandr brightness, but that is not the ideal way. It also prevents me from calibrating the screen as displaycal sets the xrandr brightness to 1.0 (100%).

I'd love to see how whoever said it works out of the box did it.

Offline

#2 2021-03-05 14:04:23

adigitoleo
Member
From: Australia
Registered: 2020-08-02
Posts: 47

Re: Lenovo Legion 7i backlight does not "work out of the box"

I'm no expert, but another thing to check could be the driver. Are you using proprietary or noveau?

Seems like there were some issues with recent nvidia drivers, e.g.

https://forum.manjaro.org/t/cant-adjust … xfce/28771

Offline

#3 2021-03-05 19:51:09

gavsiu
Member
Registered: 2016-04-08
Posts: 29

Re: Lenovo Legion 7i backlight does not "work out of the box"

I tried everything from that thread. I am using proprietary drivers. That thread seems to only talk about different Linux kernels being part of the issue.

Offline

#4 2021-03-06 01:49:25

adigitoleo
Member
From: Australia
Registered: 2020-08-02
Posts: 47

Re: Lenovo Legion 7i backlight does not "work out of the box"

Hmm, you have dual graphics? As in one dedicated nvidia card and one integrated intel card?

If yes, can you change between "discrete" and "switchable" modes (something like that) in the BIOS?

Offline

#5 2021-03-06 02:27:50

RDDO
Member
From: Brazil
Registered: 2008-02-21
Posts: 23

Re: Lenovo Legion 7i backlight does not "work out of the box"

for the legion 5 (radeon/nvidia 1660 Ti) just installed acpilight and added the 90-backlight.rules file to /etc/udev... as explained in the package github page. I have also added these lines to /etc/X11/xorg.conf

Section "Device"
[...]
BusID       "PCI:1:0:0"
Option      "RegistryDwords" "EnableBrightnessControl=1" 
EndSection

I'm using the latest nvidia driver and running the discrete graphics only (set at BIOS). After all was set, tried running at terminal

xbacklight -ctrl nvidia_0 -inc 10

if it works, a basic shell script to increase/decrease the bightness bound to a key seals the deal.

I'm using the discrete graphics because I still can't get the switchable gpus to work, read the PRIME, Optimus and other bunch, but still didn't understood how it works. I'm also having trouble with scalling, everything seems like 125% (small sized) any tips would be appreciated.

Offline

#6 2021-03-06 17:29:32

gavsiu
Member
Registered: 2016-04-08
Posts: 29

Re: Lenovo Legion 7i backlight does not "work out of the box"

I have dual graphics, but I've kept it in hybrid mode. If I have to use discrete graphics to get backlight to work, I'd rather have a non-working backlight and use xrandr brightness.

Correct me if I'm wrong, but I think it will probably use more battery running the discrete GPU all the time than backlight at 100%. If it was like my old laptop with a dead battery, I'd run the discrete GPU on A/C.

At the moment, I am using oled-linux and xorg-xbacklight to have working brightness controls.

I have tried adding the RegistryDwords option and has done nothing.

To get switchable GPUs to work, I kept the BIOS in hybrid mode. I installed proprietary NVIDIA drivers. It should boot using Intel GPU.

glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa Intel(R) UHD Graphics (CML GT2)

I only use the NVIDIA GPU for Steam, but you could launch any app using the same method. All my Steam games have this at the end of the launch options:

prime-run %command%

You could test it or run any other app by running it in terminal:

prime-run glxinfo | grep "OpenGL renderer"

I guess you could add it to the desktop files if you use menus so you don't have to launch from a terminal.

In the end, I do really want an actual working backlight for battery efficiency. I had a 7 year old 17" laptop with a dead battery for years. It was a brick before the battery died and had poor battery life. Then it became a permanent desktop. The Legion 7i actually seems to have a pretty decent battery life for a gaming laptop even with the backlight at 100%.

Also without a working backlight, I cannot color calibrate my screen. Because I'm using xrandr brightness, displaycal sets it back at 100%.

Last edited by gavsiu (2021-03-06 17:41:51)

Offline

#7 2021-03-07 01:28:38

adigitoleo
Member
From: Australia
Registered: 2020-08-02
Posts: 47

Re: Lenovo Legion 7i backlight does not "work out of the box"

You're right, and there should be a way to get brightness to work in hybrid mode. You said the value of

/sys/class/backlight/intel_backlight/brightness

is being changed, but nothing happens, right? You've probably tried xbacklight already (no luck?) and manually writing to the file like

sudo echo N > /sys/class/backlight/intel_backlight/brightness

where N is lower than the current value, could be worth a try. In case xbacklight works, make sure you've tried:

https://wiki.archlinux.org/index.php/Ba … ess_change

I'm not really familiar with dual graphics, so hopefully someone more knowledgable can offer better advice.

Offline

#8 2021-03-10 17:58:34

gavsiu
Member
Registered: 2016-04-08
Posts: 29

Re: Lenovo Legion 7i backlight does not "work out of the box"

adigitoleo wrote:

You're right, and there should be a way to get brightness to work in hybrid mode. You said the value of

/sys/class/backlight/intel_backlight/brightness

is being changed, but nothing happens, right? You've probably tried xbacklight already (no luck?) and manually writing to the file like

sudo echo N > /sys/class/backlight/intel_backlight/brightness

where N is lower than the current value, could be worth a try. In case xbacklight works, make sure you've tried:

https://wiki.archlinux.org/index.php/Ba … ess_change

I'm not really familiar with dual graphics, so hopefully someone more knowledgable can offer better advice.

Tried xbacklight and manually writing to file. For the link, xbacklight doesn't work anyway.

Offline

#9 2021-10-21 18:15:15

lfelipe1501
Member
From: Santiago de Cali
Registered: 2015-04-19
Posts: 1

Re: Lenovo Legion 7i backlight does not "work out of the box"

I have placed a solution that works and I have updated the laptop guide in the official Arch wiki:

https://wiki.archlinux.org/title/Lenovo … #Backlight

At the moment, the brightness can only be adjusted per terminal using the display identifier to make it work.

Offline

#10 2021-10-21 18:35:37

gavsiu
Member
Registered: 2016-04-08
Posts: 29

Re: Lenovo Legion 7i backlight does not "work out of the box"

Isn't xrandr at the software level? Meaning dimming your display won't reduce power consumption and I only see it as a temporary fix.

https://linuxhint.com/display_brightness_commandline/

A few months ago, I settled on using https://github.com/lawleagle/oled-linux with "xbacklight -ctrl intel_backlight". Looking into the source, it's pretty much the same as your solution, but with the ability to be keybinded.

Offline

#11 2021-12-08 15:59:53

jenefermarker
Member
Registered: 2021-12-08
Posts: 5

Re: Lenovo Legion 7i backlight does not "work out of the box"

Can't we get inspiration from other distros were it actually works ? I used ubuntu and Pop OS before and the backlight control worked out of the box, so that could means that the issue is not from the kernel itself at least.

Last edited by jenefermarker (2021-12-08 16:00:23)

Offline

#12 2021-12-08 18:39:13

jenefermarker
Member
Registered: 2021-12-08
Posts: 5

Re: Lenovo Legion 7i backlight does not "work out of the box"

So after some tinkering, I found that for this model, there are two backlight interfaces located in /sys/class/backlight/. One for intel intel_backlight and the other for nvidia nvidia_0. If you turn on the machine in hybrid mode, you will find both of these. For some reason, changing brightness using fn+F5/fn+F6 or from desktop environment affects the values in the nvidia_0 interface (/sys/class/backlight/nvidia_0/actual_brightness so the changes are not visible since technically it is intel gpu that outputs at the end in hybrid mode. So changing manually the values in /sys/class/backlight/intel_backlight/brightness actually changed the brightness level, I think that's how xrandr and oled-linux probably work. I have also checked on my other system running Pop OS and I can confirm that the system applies the changes to the intel_backlight interface and not to the nvidia_0 one when in hybrid mode.
So as a fix, I suggest that devs change the target of the backlight change to intel_backlight instead of nvidia's from the system, then maybe the desktop environment and keyboard mapping will work as intended. I don't know how to do it honestly but I can see that it is not an issue of the kernel.
Also as another confirmation, when booting in dedicated gpu mode, only the nvidia_0 is present in /sys/class/backlight/ and backlight control works just fine from DE and keyboard keys.

Last edited by jenefermarker (2021-12-08 18:40:12)

Offline

#13 2021-12-09 02:02:33

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Lenovo Legion 7i backlight does not "work out of the box"

jenefermarker wrote:

So as a fix, I suggest that devs change the target of the backlight change to intel_backlight instead of nvidia's from the system, then maybe the desktop environment and keyboard mapping will work as intended. I don't know how to do it honestly but I can see that it is not an issue of the kernel.

Be specific, which devs? Hopefully you're aware that Arch devs (in their role as Arch devs) are packagers and not developers for each piece of software?

Raise a bug with the appropriate project.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#14 2021-12-09 10:32:58

jenefermarker
Member
Registered: 2021-12-08
Posts: 5

Re: Lenovo Legion 7i backlight does not "work out of the box"

ngoonee wrote:
jenefermarker wrote:

So as a fix, I suggest that devs change the target of the backlight change to intel_backlight instead of nvidia's from the system, then maybe the desktop environment and keyboard mapping will work as intended. I don't know how to do it honestly but I can see that it is not an issue of the kernel.

Be specific, which devs? Hopefully you're aware that Arch devs (in their role as Arch devs) are packagers and not developers for each piece of software?

Raise a bug with the appropriate project.

I'm sorry I'm not specific as I don't really know which system component is responsible for changing the values of these files, so I don't know where to raise the bug.

Offline

#15 2021-12-09 10:46:15

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,415

Re: Lenovo Legion 7i backlight does not "work out of the box"

The relevant buttons will normally be handled by an ACPI daemon of your desktop environment, which environment are you using? E.g. KDE uses powerdevil which apparently just landed a fix for this that will be part of the next major plasma release:
https://bugs.kde.org/show_bug.cgi?id=399646
https://invent.kde.org/plasma/powerdevi … 0aefb8669c

Offline

#16 2021-12-09 10:54:23

jenefermarker
Member
Registered: 2021-12-08
Posts: 5

Re: Lenovo Legion 7i backlight does not "work out of the box"

V1del wrote:

The relevant buttons will normally be handled by an ACPI daemon of your desktop environment, which environment are you using? E.g. KDE uses powerdevil which apparently just landed a fix for this that will be part of the next major plasma release:
https://bugs.kde.org/show_bug.cgi?id=399646
https://invent.kde.org/plasma/powerdevi … 0aefb8669c

Yes I'm using KDE. I thought the backlight control was handled by some system component and DEs just update to the changes of these files. Isn't that how things should be so that you won't have to face the same bug in every DE ? I didn't check on other DEs but on the wiki it's mentioned that backlight control is not working properly for this device, so I'm assuming it's the same on Gnome and other DEs.

Last edited by jenefermarker (2021-12-09 10:58:14)

Offline

#17 2021-12-09 11:19:55

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,415

Re: Lenovo Legion 7i backlight does not "work out of the box"

The "desktop-agnostic" userspace daemon for this is usually upower but that doesn't appear to handle screen backlights. So it looks like all of the bigger DE's implement their own logic here. The kernel/system component just passes the relevant button press along.

Offline

#18 2021-12-09 13:19:14

jenefermarker
Member
Registered: 2021-12-08
Posts: 5

Re: Lenovo Legion 7i backlight does not "work out of the box"

V1del wrote:

The "desktop-agnostic" userspace daemon for this is usually upower but that doesn't appear to handle screen backlights. So it looks like all of the bigger DE's implement their own logic here. The kernel/system component just passes the relevant button press along.

I see now. Well, thank you for the explanation,  I learned some new stuff. I hope other DEs implement the same fix for this kind of problem.

Offline

Board footer

Powered by FluxBB