Created attachment 937319 [details] lspci -vvv Description of problem: Whenever I press Fn buttons to change backlight on my Dell Inspiron 1520, I observe: * Brightness level changes twice * Gnome brightness indicator shows level change twice * Journalctl shows two executions of gsd-backlight-helper * udevadm shows 2 kernel and 2 udev events Version-Release number of selected component (if applicable): Linux kelly.ddns.int.prhv.afunix.org 3.16.2-200.fc20.x86_64 #1 SMP Mon Sep 8 11:54:45 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux How reproducible: Easily Steps to Reproduce: 1. Press Fn+UP to increase backlight brightness level Actual results: Brightness is increased twice Expected results: Brightness increased once Additional info: Journalctl log: Sep 14 16:25:49 kelly.ddns.int.prhv.afunix.org pkexec[9342]: pam_unix(polkit-1:session): session opened for user root by (uid=1044) Sep 14 16:25:49 kelly.ddns.int.prhv.afunix.org pkexec[9342]: afunix: Executing command [USER=root] [TTY=unknown] [CWD=/home/afunix] [COMMAND=/usr/libexec/gsd-backlight-helper --set-brightness 5] Sep 14 16:25:49 kelly.ddns.int.prhv.afunix.org pkexec[9349]: pam_unix(polkit-1:session): session opened for user root by (uid=1044) Sep 14 16:25:49 kelly.ddns.int.prhv.afunix.org pkexec[9349]: afunix: Executing command [USER=root] [TTY=unknown] [CWD=/home/afunix] [COMMAND=/usr/libexec/gsd-backlight-helper --set-brightness 6] # udevadm monitor KERNEL[6937.062837] change /devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0 (backlight) UDEV [6937.145949] change /devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0 (backlight) KERNEL[6937.173884] change /devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0 (backlight) UDEV [6937.174845] change /devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0 (backlight)
Hi, Can you please do: "sudo yum install evemu" Then change to a text console (ctrl+alt+f2) and run evemu-record. This will give you a list of input devices, then select the first one, press the brightness keys and see if you get any events for them, press ctrl+c to exit. Note down the device name if you get events, then move to the second one in the list, etc. Repeat this until you've gone over the entire list, and please let us know which devices generate brightness key events (I suspect there will be 2 distinct devices doing this). Thanks, Hans
Hi Hans, The devices which generate events upon brightness keys: /dev/input/event3 AT Translated 2 Keyboard /dev/input/event5 Video Bus Not sure if it helps, but I don't know how to debug further: $ ls -l /sys/class/input | grep event3 lrwxrwxrwx. 1 root root 0 сен 20 08:40 event3 -> ../../devices/platform/i8042/serio0/input/input3/event3 $ cat /sys/class/input/event3/dev 13:67 $ cat /sys/class/input/event3/device/phys isa0060/serio0/input0 $ cat /sys/class/input/event3/device/modalias input:b0011v0001p0001eAB41-e0,1,4,11,14,k71,72,73,74,75,76,77,79,7A,7B,7C,7D,7E,7F,80,8C,8D,8E,8F,94,98,9B,9C,9D,9E,9F,A2,A3,A4,A5,A6,AC,AD,B7,B8,B9,BF,CD,D4,D7,D9,E0,E1,E2,E3,EC,F0,ram4,l0,1,2,sfw $ ls -l /sys/class/input | grep event5 lrwxrwxrwx. 1 root root 0 сен 20 08:40 event5 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:2d/LNXVIDEO:00/input/input7/event5 $ cat /sys/class/input/event5/dev 13:69 $ cat /sys/class/input/event5/device/phys LNXVIDEO/video/input0 $ cat /sys/class/input/event5/device/modalias input:b0019v0000p0006e0000-e0,1,kE0,E1,E3,F1,F2,F3,F4,F5,ramlsfw $ cat /proc/cmdline BOOT_IMAGE=/vmlinuz-3.16.2-201.fc20.x86_64 root=/dev/mapper/kelly-root ro vconsole.font=latarcyrheb-sun16 rd.lvm.lv=kelly/usr rd.lvm.lv=kelly/root rd.lvm.lv=kelly/swap rhgb quiet crashkernel=128M LANG=ru_RU.UTF-8
Created attachment 939721 [details] lsmod
Hi Pavel, Sorry for the slow response, I've had quite a busy month with the XDC & Plumbers conferences, etc. Lets try and see where the "AT Translated 2 Keyboard" events are coming from and if we can disable them. Can you boot your system with "atkbd.softraw=0" added to the kernel commandline, then switch to a text-console (use ctrl+alt+F2), login as root and then run: showkey -s And then press the brightness up / down key-combos, write down what the emit, and report back here in bugzilla what they emit, then I can see if I can find where they are being mapped, and if we can suppress that mapping. Regards, Hans
Hi Hans. Updated kernel commandline to (/proc/cmdline): BOOT_IMAGE=/vmlinuz-3.16.6-200.fc20.x86_64 root=/dev/mapper/kelly-root ro vconsole.font=latarcyrheb-sun16 rd.lvm.lv=kelly/usr rd.lvm.lv=kelly/root rd.lvm.lv=kelly/swap rhgb quiet crashkernel=128M LANG=ru_RU.UTF-8 atkbd.softraw=0 Brightness up key emits: 0xe0 0x06 0xe0 0x54 0xe0 0xd4 Brightness down key emits: 0xe0 0x05 0xe0 0x4c 0xe0 0xcc
Hi Pavel, Good, we seem to be getting somewhere, can you please (as root) open: /lib/udev/hwdb.d/60-keyboard.hwdb In a terminal, and then go to line 193, at (or around) line 193 you should have: KEYBOARD_KEY_85=brightnessdown # Fn+Down Brightness Down KEYBOARD_KEY_86=brightnessup # Fn+Up Brightness Up Change these 2 lines into: KEYBOARD_KEY_85=unknown # Brightness Down, also emitted by acpi-video, ignore KEYBOARD_KEY_86=unknown # Brightness Up, also emitted by acpi-video, ignore Then save and close the file. After this as root run: udevadm hwdb --update And then reboot your system, after this the double key presses should be gone. To make a proper upstreamable patch of this, I need to add a snippet to 60-keyboard.hwdb overriding the previous snippet, which matches on your model only. So if this fixes things, please restore the 2 lines to their original, and add a new snippet below the generic Dell block (the block which starts with "keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pn*" This new snippet should look something like this: keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*1520:pvr* KEYBOARD_KEY_85=unknown # Brightness Down, also emitted by acpi-video, ignore KEYBOARD_KEY_86=unknown # Brightness Up, also emitted by acpi-video, ignore The "Inspiron*1520" bit may be incorrect, do: cat /sys/class/dmi/id/product_name To see what you should use to match your model on. Once you've the new snippet written, run "sudo udevadm hwdb --update" again, and reboot again, then check the brightness keys still only emit one event per press. Once you've a working overriding snippet, please add a comment here copy and pasting the new snippet, then I'll turn it into a patch and submit that to the upstream hwdb maintainers. Thanks, Hans
Hans, it's amazing! The snippet is exactly the one you've posted: # Dell Inspiron 1520 keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*1520:pvr* KEYBOARD_KEY_85=unknown KEYBOARD_KEY_86=unknown And /sys/class/dmi/id/product_name contains: Inspiron 1520 Thank you, it finally works!
Created attachment 952019 [details] [PATCH] hwdb: Ignore brightness keys on Dell Inspiron 1520 to avoid double events (In reply to Pavel Malyshev from comment #7) > Thank you, it finally works! Great. I've just send a patch upstream (systemd) to add the fix to the official hwdb. Fixing this offically in Fedora also is up to the systemd maintainers, so I'm re-assigning this to them. Hi systemd-maintainers, this patch (which has also been send upstream) fixes this issue, perhaps you can add it to the next build of systemd for F20+ ? Regards, Hans
Re-assigning this to systemd. Hi systemd-maintainers, the attached patch (which has also been send upstream) fixes this issue, perhaps you can add it to the next build of systemd for F20+ ? Regards, Hans
Sure, thanks for the patch.
http://pkgs.fedoraproject.org/cgit/systemd.git/commit/?h=f20&id=da0dff040ae0b79cc7ba7a84e3d33507290a5e3e
systemd-208-29.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/systemd-208-29.fc20
Package systemd-208-29.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing systemd-208-29.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-0254/systemd-208-29.fc20 then log in and leave karma (feedback).
systemd-208-29.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.