Display brightness keys do not work in KDE

I’m using KDE. The brightness keys on my laptop work in a live ISO, but after installing and doing a system update they no longer work. Changing brightness through settings or a program like brightnessctl does work, it’s just the keys that don’t. All other fn keys (media keys, volume keys, airplane mode, etc.) work fine.

showkey shows the inputs going through.

# showkey
kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
keycode  28 release
keycode 224 press
keycode 224 release
keycode 225 press
keycode 225 release

# showkey -s
kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
0x9c
0xe0 0x4c
0xe0 0xcc
0xe0 0x54
0xe0 0xd4

224 and 225 are the keycodes for the KEY_BRIGHTNESSDOWN and KEY_BRIGHTNESSUP events, respectively.

evtest does not show the inputs at all. Pressing the keys while running evtest has no output. evemu-describe shows that the brightness up and down key events (224 and 225) are not supported by my keyboard, despite them clearly being there in showkey:

# EVEMU 1.3
# Kernel: 6.8.7-arch1-1
# DMI: dmi:bvnINSYDECorp.:bvr03.03:bd10/17/2023:br3.3:svnFramework:pnLaptop13(AMDRyzen7040Series):pvrA5:rvnFramework:rnFRANMDCP05:rvrA5:cvnFramework:ct10:cvrA5:skuFRANDGCP05:
# Input device name: "AT Translated Set 2 keyboard"
# Input device ID: bus 0x11 vendor 0x01 product 0x01 version 0xab83
# Supported events:
#   Event type 0 (EV_SYN)
#     Event code 0 (SYN_REPORT)
#     Event code 1 (SYN_CONFIG)
#     Event code 2 (SYN_MT_REPORT)
#     Event code 3 (SYN_DROPPED)
#     Event code 4 ((null))
#     Event code 5 ((null))
#     Event code 6 ((null))
#     Event code 7 ((null))
#     Event code 8 ((null))
#     Event code 9 ((null))
#     Event code 10 ((null))
#     Event code 11 ((null))
#     Event code 12 ((null))
#     Event code 13 ((null))
#     Event code 14 ((null))
#     Event code 15 (SYN_MAX)
#   Event type 1 (EV_KEY)
#     Event code 1 (KEY_ESC)
#     Event code 2 (KEY_1)
#     Event code 3 (KEY_2)
#     Event code 4 (KEY_3)
#     Event code 5 (KEY_4)
#     Event code 6 (KEY_5)
#     Event code 7 (KEY_6)
#     Event code 8 (KEY_7)
#     Event code 9 (KEY_8)
#     Event code 10 (KEY_9)
#     Event code 11 (KEY_0)
#     Event code 12 (KEY_MINUS)
#     Event code 13 (KEY_EQUAL)
#     Event code 14 (KEY_BACKSPACE)
#     Event code 15 (KEY_TAB)
#     Event code 16 (KEY_Q)
#     Event code 17 (KEY_W)
#     Event code 18 (KEY_E)
#     Event code 19 (KEY_R)
#     Event code 20 (KEY_T)
#     Event code 21 (KEY_Y)
#     Event code 22 (KEY_U)
#     Event code 23 (KEY_I)
#     Event code 24 (KEY_O)
#     Event code 25 (KEY_P)
#     Event code 26 (KEY_LEFTBRACE)
#     Event code 27 (KEY_RIGHTBRACE)
#     Event code 28 (KEY_ENTER)
#     Event code 29 (KEY_LEFTCTRL)
#     Event code 30 (KEY_A)
#     Event code 31 (KEY_S)
#     Event code 32 (KEY_D)
#     Event code 33 (KEY_F)
#     Event code 34 (KEY_G)
#     Event code 35 (KEY_H)
#     Event code 36 (KEY_J)
#     Event code 37 (KEY_K)
#     Event code 38 (KEY_L)
#     Event code 39 (KEY_SEMICOLON)
#     Event code 40 (KEY_APOSTROPHE)
#     Event code 41 (KEY_GRAVE)
#     Event code 42 (KEY_LEFTSHIFT)
#     Event code 43 (KEY_BACKSLASH)
#     Event code 44 (KEY_Z)
#     Event code 45 (KEY_X)
#     Event code 46 (KEY_C)
#     Event code 47 (KEY_V)
#     Event code 48 (KEY_B)
#     Event code 49 (KEY_N)
#     Event code 50 (KEY_M)
#     Event code 51 (KEY_COMMA)
#     Event code 52 (KEY_DOT)
#     Event code 53 (KEY_SLASH)
#     Event code 54 (KEY_RIGHTSHIFT)
#     Event code 55 (KEY_KPASTERISK)
#     Event code 56 (KEY_LEFTALT)
#     Event code 57 (KEY_SPACE)
#     Event code 58 (KEY_CAPSLOCK)
#     Event code 59 (KEY_F1)
#     Event code 60 (KEY_F2)
#     Event code 61 (KEY_F3)
#     Event code 62 (KEY_F4)
#     Event code 63 (KEY_F5)
#     Event code 64 (KEY_F6)
#     Event code 65 (KEY_F7)
#     Event code 66 (KEY_F8)
#     Event code 67 (KEY_F9)
#     Event code 68 (KEY_F10)
#     Event code 69 (KEY_NUMLOCK)
#     Event code 70 (KEY_SCROLLLOCK)
#     Event code 71 (KEY_KP7)
#     Event code 72 (KEY_KP8)
#     Event code 73 (KEY_KP9)
#     Event code 74 (KEY_KPMINUS)
#     Event code 75 (KEY_KP4)
#     Event code 76 (KEY_KP5)
#     Event code 77 (KEY_KP6)
#     Event code 78 (KEY_KPPLUS)
#     Event code 79 (KEY_KP1)
#     Event code 80 (KEY_KP2)
#     Event code 81 (KEY_KP3)
#     Event code 82 (KEY_KP0)
#     Event code 83 (KEY_KPDOT)
#     Event code 85 (KEY_ZENKAKUHANKAKU)
#     Event code 86 (KEY_102ND)
#     Event code 87 (KEY_F11)
#     Event code 88 (KEY_F12)
#     Event code 89 (KEY_RO)
#     Event code 90 (KEY_KATAKANA)
#     Event code 91 (KEY_HIRAGANA)
#     Event code 92 (KEY_HENKAN)
#     Event code 93 (KEY_KATAKANAHIRAGANA)
#     Event code 94 (KEY_MUHENKAN)
#     Event code 95 (KEY_KPJPCOMMA)
#     Event code 96 (KEY_KPENTER)
#     Event code 97 (KEY_RIGHTCTRL)
#     Event code 98 (KEY_KPSLASH)
#     Event code 99 (KEY_SYSRQ)
#     Event code 100 (KEY_RIGHTALT)
#     Event code 102 (KEY_HOME)
#     Event code 103 (KEY_UP)
#     Event code 104 (KEY_PAGEUP)
#     Event code 105 (KEY_LEFT)
#     Event code 106 (KEY_RIGHT)
#     Event code 107 (KEY_END)
#     Event code 108 (KEY_DOWN)
#     Event code 109 (KEY_PAGEDOWN)
#     Event code 110 (KEY_INSERT)
#     Event code 111 (KEY_DELETE)
#     Event code 112 (KEY_MACRO)
#     Event code 113 (KEY_MUTE)
#     Event code 114 (KEY_VOLUMEDOWN)
#     Event code 115 (KEY_VOLUMEUP)
#     Event code 116 (KEY_POWER)
#     Event code 117 (KEY_KPEQUAL)
#     Event code 118 (KEY_KPPLUSMINUS)
#     Event code 119 (KEY_PAUSE)
#     Event code 121 (KEY_KPCOMMA)
#     Event code 122 (KEY_HANGEUL)
#     Event code 123 (KEY_HANJA)
#     Event code 124 (KEY_YEN)
#     Event code 125 (KEY_LEFTMETA)
#     Event code 126 (KEY_RIGHTMETA)
#     Event code 127 (KEY_COMPOSE)
#     Event code 128 (KEY_STOP)
#     Event code 140 (KEY_CALC)
#     Event code 142 (KEY_SLEEP)
#     Event code 143 (KEY_WAKEUP)
#     Event code 155 (KEY_MAIL)
#     Event code 156 (KEY_BOOKMARKS)
#     Event code 157 (KEY_COMPUTER)
#     Event code 158 (KEY_BACK)
#     Event code 159 (KEY_FORWARD)
#     Event code 163 (KEY_NEXTSONG)
#     Event code 164 (KEY_PLAYPAUSE)
#     Event code 165 (KEY_PREVIOUSSONG)
#     Event code 166 (KEY_STOPCD)
#     Event code 172 (KEY_HOMEPAGE)
#     Event code 173 (KEY_REFRESH)
#     Event code 183 (KEY_F13)
#     Event code 184 (KEY_F14)
#     Event code 185 (KEY_F15)
#     Event code 217 (KEY_SEARCH)
#     Event code 226 (KEY_MEDIA)
#   Event type 4 (EV_MSC)
#     Event code 4 (MSC_SCAN)
#   Event type 17 (EV_LED)
#     Event code 0 (LED_NUML)
#        State 0
#     Event code 1 (LED_CAPSL)
#        State 0
#     Event code 2 (LED_SCROLLL)
#        State 0
#   Event type 20 (EV_REP)
#     Event code 0 (REP_DELAY)
#     Event code 1 (REP_PERIOD)
# Properties:
N: AT Translated Set 2 keyboard
I: 0011 0001 0001 ab83
P: 00 00 00 00 00 00 00 00
B: 00 0b 00 00 00 00 00 00 00
B: 01 fe ff ff ff ff ff ff ff
B: 01 ff ff ef ff df ff ff fe
B: 01 01 d0 00 f8 78 30 80 03
B: 01 00 00 00 02 07 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 02 00 00 00 00 00 00 00 00
B: 03 00 00 00 00 00 00 00 00
B: 04 10 00 00 00 00 00 00 00
B: 05 00 00 00 00 00 00 00 00
B: 11 07 00 00 00 00 00 00 00
B: 12 00 00 00 00 00 00 00 00
B: 14 03 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00

I ran these commands in the live ISO as well and got the same outputs, but for some reason it works in the live ISO and not on my install.

I can run setkeycodes to add the scancodes/keycodes from showkey to evemu-describe, but the keys still don’t do anything and aren’t recognized by evtest.

I suspect that this has something to do with the recent changes to powerdevil in KDE, but I don’t know for sure. I haven’t tried other desktop environments.

What is your laptop brand and model?

Framework Laptop 13.

$ inxi -Fxxc0z
System:
  Kernel: 6.8.7-arch1-1 arch: x86_64 bits: 64 compiler: gcc
    v: 13.2.1
  Desktop: KDE Plasma v: 6.0.4 tk: Qt v: N/A
    wm: kwin_wayland dm: SDDM Distro: EndeavourOS
    base: Arch Linux
Machine:
  Type: Laptop System: Framework product: Laptop 13 (AMD
    Ryzen 7040Series) v: A5 serial: <superuser required>
  Mobo: Framework model: FRANMDCP05 v: A5
    serial: <superuser required> part-nu: FRANDGCP05
    UEFI: INSYDE v: 03.03 date: 10/17/2023
Battery:
  ID-1: BAT1 charge: 18.4 Wh (33.9%)
    condition: 54.3/55.0 Wh (98.7%) volts: 15.0 min: 15.4
    model: N/A serial: <filter> status: discharging
CPU:
  Info: 6-core model: AMD Ryzen 5 7640U w/ Radeon 760M
    Graphics bits: 64 type: MT MCP arch: Zen 4 rev: 1 cache:
    L1: 384 KiB L2: 6 MiB L3: 16 MiB
  Speed (MHz): avg: 880 high: 2277
    min/max: 400/4971:5121:5275:5579:5425 cores: 1: 1394
    2: 400 3: 400 4: 1367 5: 400 6: 2277 7: 400 8: 400
    9: 1367 10: 400 11: 1366 12: 400 bogomips: 83876
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1
    sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Phoenix1 vendor: Framework driver: amdgpu
    v: kernel arch: RDNA-3 pcie: speed: 16 GT/s lanes: 16
    ports: active: eDP-1 empty: DP-1, DP-2, DP-3, DP-4,
    DP-5, DP-6, DP-7, DP-8, Writeback-1 bus-ID: c1:00.0
    chip-ID: 1002:15bf temp: 37.0 C
  Display: wayland server: X.org v: 1.21.1.13
    with: Xwayland v: 23.2.6 compositor: kwin_wayland driver:
    X: loaded: amdgpu unloaded: modesetting
    alternate: fbdev,vesa dri: radeonsi gpu: amdgpu
    display-ID: 0
  Monitor-1: eDP-1 res: 1504x1003 size: N/A
  API: EGL v: 1.5 platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast surfaceless: drv: radeonsi wayland:
    drv: radeonsi x11: drv: radeonsi inactive: gbm
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa
    v: 24.0.5-arch1.1 glx-v: 1.4 direct-render: yes
    renderer: AMD Radeon Graphics (radeonsi gfx1103_r1 LLVM
    17.0.6 DRM 3.57 6.8.7-arch1-1) device-ID: 1002:15bf
    display-ID: :1.0
  API: Vulkan Message: No Vulkan data available.
Audio:
  Device-1: AMD Rembrandt Radeon High Definition Audio
    vendor: Framework driver: snd_hda_intel v: kernel pcie:
    speed: 16 GT/s lanes: 16 bus-ID: c1:00.1
    chip-ID: 1002:1640
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor
    vendor: Framework driver: snd_pci_ps v: kernel pcie:
    speed: 16 GT/s lanes: 16 bus-ID: c1:00.5
    chip-ID: 1022:15e2
  Device-3: AMD Family 17h/19h HD Audio vendor: Framework
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s
    lanes: 16 bus-ID: c1:00.6 chip-ID: 1022:15e3
  API: ALSA v: k6.8.7-arch1-1 status: kernel-api
  Server-1: PipeWire v: 1.0.5 status: active with:
    1: pipewire-pulse status: off 2: wireplumber
    status: active 3: pipewire-alsa type: plugin 4: pw-jack
    type: plugin
Network:
  Device-1: MEDIATEK MT7922 802.11ax PCI Express Wireless
    Network Adapter driver: mt7921e v: kernel pcie:
    speed: 5 GT/s lanes: 1 bus-ID: 01:00.0
    chip-ID: 14c3:0616
  IF: wlan0 state: up mac: <filter>
Bluetooth:
  Device-1: MediaTek Wireless_Device driver: btusb v: 0.8
    type: USB rev: 2.1 speed: 480 Mb/s lanes: 1 bus-ID: 1-5:3
    chip-ID: 0e8d:e616
  Report: btmgmt ID: hci0 rfk-id: 0 state: down
    bt-service: disabled rfk-block: hardware: no software: yes
    address: N/A
Drives:
  Local Storage: total: 931.51 GiB used: 9.75 GiB (1.0%)
  ID-1: /dev/nvme0n1 vendor: Western Digital
    model: WD BLACK SN770 1TB size: 931.51 GiB
    speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 33.9 C
Partition:
  ID-1: / size: 930.51 GiB used: 9.75 GiB (1.0%) fs: btrfs
    dev: /dev/nvme0n1p2
  ID-2: /boot/efi size: 1022 MiB used: 584 KiB (0.1%)
    fs: vfat dev: /dev/nvme0n1p1
  ID-3: /home size: 930.51 GiB used: 9.75 GiB (1.0%)
    fs: btrfs dev: /dev/nvme0n1p2
  ID-4: /var/log size: 930.51 GiB used: 9.75 GiB (1.0%)
    fs: btrfs dev: /dev/nvme0n1p2
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu
    temp: 38.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 16 GiB note: est. available: 14.82 GiB
    used: 5.29 GiB (35.7%)
  Processes: 319 Power: uptime: 39m wakeups: 0
    Init: systemd v: 255 default: graphical
  Packages: pm: pacman pkgs: 1051 Compilers: clang: 17.0.6
    gcc: 13.2.1 Shell: fish v: 3.7.1 running-in: alacritty
    inxi: 3.3.34

Does it use FN + space bar to turn on the backlit keyboard? This is how my lenovo Thinkbook works.

Edit: It turns on when you boot and then shuts off when logged into the desktop. You have to turn it on and then it has two brightness levels using the same keys. Then it turns off if you press them again. It will stay on during successive boots when you turn it on.

Sorry, I just realized I hadn’t specified that I was talking about display brightness. Keyboard brightness works fine.

Edit: I edited the title topic to specify “Display”.

Okay … sorry i wasn’t sure.

Edit: You do have that in the title topic. I just missed it.

Have you tried using any one of the following kernel parameters? Not sure if you are using the default systemd-boot or grub?

acpi_backlight=video
acpi_backlight=vendor
acpi_backlight=native

I tried native, but I haven’t tried the others. I’ll test that now.

You do know how to add them properly for either systemd-boot or grub?

Yep. I’m testing with grub.

1 Like

Just make sure you run the update grub command and reboot to test it.

This is the only other thing i can offer.

https://wiki.archlinux.org/title/Framework_Laptop_13

It’s F7 & F8 for brightness keys?

No luck.

Just for clarity, I added acpi_backlight=video to the end of GRUB_CMDLINE_LINUX_DEFAULT= in /etc/default/grub, then ran sudo grub-mkconfig -o /boot/grub/grub.cfg and rebooted. I then replaced video with vendor and did the same thing, then native. None had any effect.

Do those kernel parameters affect the keyboard or just the display? Changing the display brightness through tools like backlightctl or the UI does work, it’s just the keyboard controls that don’t work.

Yes

I’m not entirely sure if it controls the backlight or the keyboard keys or both? I see they have a differnet kernel parameter for the Intel version.

@Kekker
I just found this?

Brightness Keys Not Working Due to a quirk with Linux drivers and how the Framework laptop is setup, one cannot have both the ambient light sensor and the brightness keys work. For the brightness keys to function and send XF86MonBrightnessUp / Down events the ambient light sensor driver must be disabled.Mar 25, 2024

Edit: This info might be helpful also.

Specifically in the following link I’m looking at this.

Backlight:

The backlight brightness keys (on the 7840U at least) show up as ACPI events rather than keyboard keys, and require the CONFIG_I2C_DESIGNWARE_PLATFORM kernel option to be set to work. The backlight itself can still be adjusted without that config option, via the usual echoing to the appropriate brightness file: /sys/class/backlight/amdgpu_bl0/brightness

The backlight keys will also need sys-power/acpilight installed, replacing x11-apps/xbacklight if it was previously installed.

https://wiki.gentoo.org/wiki/Framework_Laptop_13#AMD_7040_Series

Edit: Not sure if this is just on the Intel version or not?

https://wiki.gentoo.org/wiki/Framework_Laptop_13#Brightness_Keys_Not_Working

Edit: Some of the info may be helpful or not. :man_shrugging:

I have the light sensor module disabled, and it looks like the I2C ACPI module is loaded:

$ lsmod | grep hid
usbhid                 77824  0
mac_hid                12288  0
hid_multitouch         32768  0
hid_generic            12288  0
i2c_hid_acpi           12288  0
i2c_hid                40960  1 i2c_hid_acpi

I don’t know if the i2c_hid_acpi module is the same as the CONFIG_I2C_DESIGNWARE_PLATFORM option. Hopefully I don’t have to compile a kernel just to get a couple keys to work :sweat_smile:

I don’t have a lot of experience with frameworks laptops. I guess all you can do is keep looking for info and or try things as you are doing by trial and error.

Oh well. Thanks for your help! I’ll keep poking around and update here if I find a fix.

What does lsmod | grep i2c show?