NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.07k stars 14.08k forks source link

Keyboard backlight doesn't work #59421

Open pinage404 opened 5 years ago

pinage404 commented 5 years ago

Issue description

The keyboard backlight has never worked under NixOS but perfectly works under my Windows 10 partition

The backlight is always powered on at full brightness in blue

I can change the state (only until the next poweroff) if I :

  1. start under Windows 10
  2. change the brightness, the color or turn it off
  3. restart my laptop

In this case, the keyboard backlight remains in the state (brightness, color and on / off) given under Windows 10 before the reboot

I have a Gigabyte Sabre 15

I don't know what kind of information i need to give to solve this problem

Steps to reproduce

I don't really know ¯\(ツ)

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the results.

 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.110, NixOS, 18.09.2474.222950952f1 (Jellyfish)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.1.3`
 - channels(pinage404): `"nixos-18.09.2505.46d3867a08a, nixos-unstable-19.09pre174426.acbdaa569f4, unstable"`
 - channels(root): `"nixos-18.09.2505.46d3867a08a"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
emmanuelrosa commented 5 years ago

What files do you have in /sys/class/leds/?

pinage404 commented 5 years ago

Hi,

I have this :

ls -al /sys/class/leds/
total 0
drwxr-xr-x  2 root root 0 14 avril 15:57 .
drwxr-xr-x 56 root root 0 14 avril 15:51 ..
lrwxrwxrwx  1 root root 0 14 avril 15:57 input0::capslock -> ../../devices/platform/i8042/serio0/input/input0/input0::capslock
lrwxrwxrwx  1 root root 0 14 avril 15:57 input0::numlock -> ../../devices/platform/i8042/serio0/input/input0/input0::numlock
lrwxrwxrwx  1 root root 0 14 avril 15:57 input0::scrolllock -> ../../devices/platform/i8042/serio0/input/input0/input0::scrolllock
lrwxrwxrwx  1 root root 0 14 avril 15:57 input35::capslock -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/usb3/3-1/3-1:1.2/0003:046D:C52B.0003/0003:046D:4016.0005/input/input35/input35::capslock
lrwxrwxrwx  1 root root 0 14 avril 15:57 input35::compose -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/usb3/3-1/3-1:1.2/0003:046D:C52B.0003/0003:046D:4016.0005/input/input35/input35::compose
lrwxrwxrwx  1 root root 0 14 avril 15:57 input35::kana -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/usb3/3-1/3-1:1.2/0003:046D:C52B.0003/0003:046D:4016.0005/input/input35/input35::kana
lrwxrwxrwx  1 root root 0 14 avril 15:57 input35::numlock -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/usb3/3-1/3-1:1.2/0003:046D:C52B.0003/0003:046D:4016.0005/input/input35/input35::numlock
lrwxrwxrwx  1 root root 0 14 avril 15:57 input35::scrolllock -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/usb3/3-1/3-1:1.2/0003:046D:C52B.0003/0003:046D:4016.0005/input/input35/input35::scrolllock
lrwxrwxrwx  1 root root 0 14 avril 15:57 phy0-led -> ../../devices/pci0000:00/0000:00:1c.6/0000:04:00.0/leds/phy0-led
emmanuelrosa commented 5 years ago

There's no mention of a keyboard backlight in that list. Either you're missing a kernel module or Linux doesn't support your keyboard's backlight. Try lspci and see if there's something that looks like it could be a keyboard backlight. Basically, more details about the hardware are needed in order to potentially match it to a Linux kernel module.

pinage404 commented 5 years ago
lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 05)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 05)
00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev 04)
00:14.0 USB controller: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller (rev 31)
00:14.2 Signal processing controller: Intel Corporation 100 Series/C230 Series Chipset Family Thermal Subsystem (rev 31)
00:16.0 Communication controller: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 (rev 31)
00:17.0 SATA controller: Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] (rev 31)
00:1c.0 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #1 (rev f1)
00:1c.4 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #5 (rev f1)
00:1c.6 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #7 (rev f1)
00:1f.0 ISA bridge: Intel Corporation HM175 Chipset LPC/eSPI Controller (rev 31)
00:1f.2 Memory controller: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller (rev 31)
00:1f.3 Audio device: Intel Corporation CM238 HD Audio Controller (rev 31)
00:1f.4 SMBus: Intel Corporation 100 Series/C230 Series Chipset Family SMBus (rev 31)
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)
02:00.0 USB controller: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8411B PCI Express Card Reader (rev 01)
03:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)
04:00.0 Network controller: Intel Corporation Dual Band Wireless-AC 3168NGW [Stone Peak] (rev 10)

I don't see anything obvious that could be a keyboard backlight

I'm not familiar with the hardware, let alone the communication between software and hardware, even worse under Linux (kernel modules and all that kind of thing)

Maybe these things, because on Windows I have 3 areas where I can change the colors (I don't know if in the software it's 3 hardware devices with 1 state or 1 hardware device with 3 states)

00:1c.0 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #1 (rev f1)
00:1c.4 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #5 (rev f1)
00:1c.6 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #7 (rev f1)
borisbabic commented 5 years ago

There seems to have been some changes that affect brightness. I additionally had issues with the screen brightness on my laptop, however I also got control of the keyboard backlight working as well:

What I did was followed the instructions from https://github.com/NixOS/nixpkgs/issues/59927#issuecomment-485141310 except for the keyboard brightness you should add your user to the input group.

Then do xbacklight -list and you should see a device for your keyboard, for me it wastpacpi::kbd_backlight, then you can use xbacklight as normal just include -c $device ex: xbacklight -c tpacpi::kbd_backlight -set 50

pinage404 commented 5 years ago

I tried but it didn't worked :disappointed:

  1. added acpilight and hardware.brightnessctl.enable = true; to my config
  2. did nixos-rebuild switch
  3. reboot

And now xbacklight -list gives me this :

intel_backlight
acpi_video0
input16::compose
phy0-led
input16::kana
input0::scrolllock
input16::scrolllock
input0::capslock
input16::capslock
input16::numlock
input0::numlock
stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
patka-123 commented 11 months ago

Hello @pinage404 :wave:

I'm wondering if this is still an issue that you experience. If this issue has been resolved, would you be able to close this issue?

(I'm going through issues marked as stale to see what can be resolved. If this is still an issue then don't mind me).

pinage404 commented 11 months ago

Hello @patka-123,

Yes, i didn't find a way to fix that

It is not a major issue, if you need to close minor issue, i could understand

Al-Ghoul commented 10 months ago

Well I've the same issue (My keyboard isn't supported) I usually turn my keyboard's backlight with Scroll Lock (on windows); I've had the same issue earlier with Archlinux and they had the following solution in their docs/wiki and that works on NixOS for me

echo 1 > /sys/class/leds/tpacpi::kbd_backlight/brightness # For me I replaced tpacpi::kbd_backlight with input3::scrolllock

However you'll need sudo or root user for this. Reference: https://wiki.archlinux.org/title/keyboard_backlight

pinage404 commented 10 months ago

I tried to write on every /sys/class/leds/*/brightness

sudo sh -c 'for led in /sys/class/leds/*/brightness; do echo 1 > $led; done'

It changed nothing