[SOLVED]Laptop Brightness broke between kernel 4.19 and 5.6

Getting your soundcard to work, using Debian on non-i386 hardware, etc

[SOLVED]Laptop Brightness broke between kernel 4.19 and 5.6

Postby LateToTheGame » 2020-08-08 15:34

Hi,

Somewhere between kernel 4.19 and 5.6 my laptop backlight key (F5 / F6) stopped working. Backlight or screen brightness does work when using the slider in Gnome. To be completely accurate, I could also state that the issue showed up between Debian 10 and Debian Testing.

To rule out hardware issues, I installed a fresh copy of Debian 10 with the Gnome desktop, pressed F5 and the graphic showing the backlight key had been pressed, showed up. I then installed a fresh copy of Debian Testing, pressed F5, and no graphic. It's like the keypress isn't getting registered. Again, in both cases, moving the slider in the Gnome control panel does what it is supposed to do, and the backlighting is adjusted.

Details about how my backlighint work may be important, so I'll explain them here. My laptop is old, it's a 2012 Sony VPCEG Vaio. When I first installed Linux, the backlight controls, both hardware and through Gnome didn't work. I found an old bug report about something similar and used this "work around" to get things going. I created two files:


$ cat /etc/udev/rules.d/99-writeintelbacklight.rules
Code: Select all
ACTION=="change", SUBSYSTEM=="backlight", RUN+="/usr/sbin/writeintelbacklight.sh"


$ cat /usr/sbin/writeintelbacklight.sh
Code: Select all
#!/bin/bash
intelmaxbrightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
acpimaxbrightness=`cat /sys/class/backlight/acpi_video0/max_brightness`
scale=`expr $intelmaxbrightness / $acpimaxbrightness`
acpibrightness=`cat /sys/class/backlight/acpi_video0/brightness`
newintelbrightness=`expr $acpibrightness \* $scale`
curintelbrightness=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ "$newintelbrightness" -ne "$curintelbrightness" ]
then
  echo $newintelbrightness > /sys/class/backlight/intel_backlight/brightness
fi
exit 0


So it looks like my integrated intel graphics weren't getting or using ACPI messages when the system received a keypress (F5 / F6 in my case) or when the slider in Gnome was manipulated. So nothing worked. When I added these files, both the key presses and the Gnome slider worked perfectly.

I was reading through the Arch Wiki (https://wiki.archlinux.org/index.php/Backlight) and under the section "Unable to control eDP Panel brightness (Intel i915 only)" I read "Note: The parameter changed from bool to int in linux 5.4." When Linux boots, I see i915 all the time, so I know my system uses that module or whatever it is. Though not specific to my problem, I wonder if other changes were made in the 5.4 kernel that break my work around.

I think it is relevant to note, that even without my "work around" pressing the F5 / F6 keys always resulted in the backligh graphic displaying on the screen. It didn't do anything but the key triggered the graphic. That is no longer the case, no graphic.

If anyone can help, or point me in the right direction, I'd appreciate it! Thank you.
Last edited by LateToTheGame on 2020-08-09 22:48, edited 1 time in total.
LateToTheGame
 
Posts: 12
Joined: 2019-03-03 23:16

Re: Laptop Brightness broke between kernel 4.19 and 5.6

Postby Bulkley » 2020-08-08 17:02

Debian 10 uses 4.19. Where did you get 5.6?
Bulkley
 
Posts: 5992
Joined: 2006-02-11 18:35

Re: Laptop Brightness broke between kernel 4.19 and 5.6

Postby LateToTheGame » 2020-08-09 06:48

I run Testing / Bullseye.
LateToTheGame
 
Posts: 12
Joined: 2019-03-03 23:16

Re: Laptop Brightness broke between kernel 4.19 and 5.6

Postby Head_on_a_Stick » 2020-08-09 09:30

Then find the bad commit and report it upstream so that it's fixed for the next release: https://wiki.debian.org/DebianKernel/GitBisect

But first confirm that you actually have /sys/class/backlight/intel_backlight and also try the suggested i915.enable_dpcd_backlight=1 kernel parameter.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12485
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Laptop Brightness broke between kernel 4.19 and 5.6

Postby LateToTheGame » 2020-08-09 19:42

Thank you for the suggestions HoaS.

I did some more testing between two identical computers, one running Buster / GNOME 3.30.2 and the one that doesn't work, running Bullseye / GNOME 3.36. Using "libinput record" I verified that what was coming out of the kernel on both machines was the same. So I don't think my issue is kernel related since libinput is in user space and is responsible for handling the keyboard. Since what is going in is identical on both test machines, I'm thinking the issue is either in libinput or GNOME. Not sure how to proceed but I think the easiest thing to do is to backport libinput 1.16 to Buster and see if the problem shows up.
LateToTheGame
 
Posts: 12
Joined: 2019-03-03 23:16

Re: Laptop Brightness broke between kernel 4.19 and 5.6

Postby LateToTheGame » 2020-08-09 22:45

I'm going to go ahead and mark this solved. I built a few versions of libinput, and the failure is unique to the latest version, 1.16.0. I'll post a bug report on freedesktop.org.

Thanks!
LateToTheGame
 
Posts: 12
Joined: 2019-03-03 23:16

Re: [SOLVED]Laptop Brightness broke between kernel 4.19 and

Postby emariz » 2020-08-10 23:49

I created this thread years ago, but something there might be relevant to you.
viewtopic.php?f=5&t=78471

I loved my Sony Vaio VPCEG, mate. I got it brand new and sold it about two years ago, and only because a co-worker insisted and I already had a new laptop. I should have kept it.
emariz
 
Posts: 2922
Joined: 2008-10-17 07:59

Re: [SOLVED]Laptop Brightness broke between kernel 4.19 and

Postby LateToTheGame » 2020-08-13 21:22

Hi emariz, I’m just now seeing your post. I had fixed the issue your thread talks about, but it stopped working because the kernel reports the Vaio keys as joystick inputs and the latest libinput ignores them. Though the problem is in the kernel, the libinput guys will go back to processing joystick events as keyboard input as they had been doing. So I’m all good now.

My Vaio is one of the VPCEG models. If you had one in that series, you would have had issues with the touchpad when getting close to the edge. I’m relatively new to Linux, and left my engineering career 17 years ago, but I really wanted to fix the touchpad. It took forever because as a total noob I had to learn how to build and debug stuff in the kernel. Turns out the touchpad hardware was sending junk when fingers got near its edge. Sucks that I did so much work just for me!!! So if you get another one, hit me up. I also tweeked the touchpad with libinput quirks that are now part of libinput, so you’ll get that without doing anything.

When I was debugging the touchpad, I wanted a second VPCEG and got one off eBay for 80 bucks. I wanted a third for parts, but then the prices went crazy. I saw one go for $200! A few for $150. That’s a lot for an old computer I think. I maxed out the ram, put in a SSD and a blue tooth dongle so it’s ready for a few more years of service. Its is pretty snappy too. All those ports, lightweight and great keyboard. I really like it!
LateToTheGame
 
Posts: 12
Joined: 2019-03-03 23:16


Return to Hardware

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable