sony ar vgn71: EVIOCSKEYCODE when trying to set correct key codes

Bug #625770 reported by Sergey Klimov
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Incomplete
Low
Unassigned
udev (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: acpi-support

$ acpi_listen
sony/hotkey SNC 00000001 00000010
sony/hotkey SNC 00000001 0000003b
sony/hotkey SNC 00000001 00000011
sony/hotkey SNC 00000001 0000003b
sony/hotkey SNC 00000001 00000010
sony/hotkey SNC 00000001 0000003b
sony/hotkey SNC 00000001 00000010
sony/hotkey SNC 00000001 0000003b

backlight keys do not work correctly.
it s regression

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: acpi-support 0.137
ProcVersionSignature: Ubuntu 2.6.35-19.26-generic 2.6.35.3
Uname: Linux 2.6.35-19-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Sat Aug 28 13:56:36 2010
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Alpha amd64 (20100803.1)
ProcEnviron:
 PATH=(custom, user)
 LANG=ru_UA.UTF-8
 SHELL=/bin/bash
SourcePackage: acpi-support

Revision history for this message
Sergey Klimov (nbdarvin) wrote :
Revision history for this message
Mario (diraimondo) wrote :

The same for me on a Sony Vaio Z21MN. It worked well with Lucid.

$ acpi_listen
sony/hotkey SNC 00000001 00000010
sony/hotkey SNC 00000001 0000003b
sony/hotkey SNC 00000001 00000011
sony/hotkey SNC 00000001 0000003b

Revision history for this message
Steve Langasek (vorlon) wrote :

Thank you for taking the time to report this bug and help to improve Ubunt.

acpi-support is not involved in the handling of these hotkeys. This is a bug either in udev on the input side, or the X server or related packages on the output side. Reassigning to udev; please see /usr/share/doc/udev/README.keymap.txt.gz and follow the instructions described there under "Fixing broken keys" to confirm whether this is a udev bug.

affects: acpi-support (Ubuntu) → udev (Ubuntu)
Changed in udev (Ubuntu):
status: New → Invalid
status: Invalid → Incomplete
Revision history for this message
Sergey Klimov (nbdarvin) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

We still need the information from comment 3.

Revision history for this message
Sergey Klimov (nbdarvin) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in upstream git, thank you!

Changed in udev (Ubuntu):
status: Incomplete → Fix Committed
Revision history for this message
Mario (diraimondo) wrote :

When could we see such commit in maverick-proposed?

Revision history for this message
Martin Pitt (pitti) wrote :

We upload the current keymaps to stable releases from time to time, but this wasn't even released upstream and into natty yet. So perhaps a month from now.

Revision history for this message
Mario (diraimondo) wrote :

Could you provide a patch/file/package that we could test: in this way we could check that it is the correct fix.

Thanks for your work.

Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Mario (diraimondo) wrote :

I've tried to manually patch the udev files in my Maverick installation but the brightness keys still don't work... :(
I've clearly rebooted the machine.

I report few details on the modified files:

$ ls -la /lib/udev/rules.d/95-keymap.rules
-rw-r--r-- 1 root root 9919 2010-11-12 18:04 /lib/udev/rules.d/95-keymap.rules

The involved part of 95-keymap.rules:
......................[CUT].....................
#
# The following are exposed as separate input devices with low key codes, thus
# we need to check their input device product name
#

LABEL="keyboard_modulecheck"

ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}"
ENV{DMI_VENDOR}=="", GOTO="keyboard_end"

ENV{DMI_VENDOR}=="IBM*", KERNELS=="input*", ATTRS{name}=="ThinkPad Extra Buttons", RUN+="keymap $name module-ibm"
ENV{DMI_VENDOR}=="LENOVO*", KERNELS=="input*", ATTRS{name}=="ThinkPad Extra Buttons", RUN+="keymap $name module-lenovo"
ENV{DMI_VENDOR}=="LENOVO*", KERNELS=="input*", ATTRS{name}=="Lenovo ThinkPad SL Series extra buttons", RUN+="keymap $name 0x0E bluetooth"
ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Asus Extra Buttons", ATTR{[dmi/id]product_name}=="W3J", RUN+="keymap $name module-asus-w3j"
ENV{DMI_VENDOR}=="Sony*", KERNELS=="input*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony"

# Older Vaios have some different keys
ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old"

# Some Sony VGN models have yet another one
ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="VGN-AR71*|VGN-FW*|VGN-Z21*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-vgn"
......................[CUT].....................

$ ls -la /lib/udev/keymaps/module-sony-vgn
-rw-r--r-- 1 root root 151 2010-11-12 18:00 /lib/udev/keymaps/module-sony-vgn

$ cat /lib/udev/keymaps/module-sony-vgn
0x00 brightnessdown # Fn+F5
0x10 brightnessup # Fn+F6
0x11 switchvideomode # Fn+F7
0x12 zoomout
0x14 zoomin
0x15 suspend # Fn+F12
0x17 prog1
0x20 media

Revision history for this message
Mario (diraimondo) wrote :

https://bugzilla.kernel.org/show_bug.cgi?id=22722
Is it related? Can we hope in a kernel for Maverick (proposed repository) with this patch?

Revision history for this message
Martin Pitt (pitti) wrote :

Mario,

the referenced kernel bug report was about the backlight, this is about key maps. So this could be related if pressing the brightness keys actually produces a KEY_BRIGHTNESSUP/DOWN event, but it's not causing any actual effect. Can you please follow /usr/share/doc/udev/README.keymap.txt.gz and use the keymap tool to find out which key codes are currently being reported when you press the brightness keys?

Revision history for this message
Mario (diraimondo) wrote :

Dear Martin,
my problem is (only) with the backlight keys on my sony vaio Z21MN. I've already submitted (in the LP bug #627890 comment #15) the output of the suggested procedure. I've tested the patch suggested in this bug without any luck (see comment #12 in this bug report). Do you think that my problem is related with the bug in the kernel (see comment #13 in this bug report)

Revision history for this message
Martin Pitt (pitti) wrote :

Hm, no, this keymap problem isn't related to the kernel bug. Can you please try this manually:

- find out the input device of the hotkeys module with /lib/udev/findkeyboards, i. e. "input/event6" (in https://bugs.launchpad.net/ubuntu/+source/udev/+bug/627890/comments/15)

- run

     sudo /lib/udev/keymap input/event6 0x00 brightnessdown 0x10 brightnessup

 (adapt input/event6 accordingly to the findkeyboards output)

- run

    sudo /lib/udev/keymap -i input/event6

  and press the brightness keys, and check which output you get.

Revision history for this message
Mario (diraimondo) wrote : Re: [Bug 625770] Re: sony ar vgn71 brightness keys do not work correctly

2010/11/25 Martin Pitt <email address hidden>:
> Hm, no, this keymap problem isn't related to the kernel bug. Can you
> please try this manually:
>
> - find out the input device of the hotkeys module with
> /lib/udev/findkeyboards, i. e. "input/event6" (in
> https://bugs.launchpad.net/ubuntu/+source/udev/+bug/627890/comments/15)

$ /lib/udev/findkeyboards
AT keyboard: input/event2
module: input/event3

> - run
>
>     sudo /lib/udev/keymap input/event6 0x00 brightnessdown 0x10
> brightnessup
>
>  (adapt input/event6 accordingly to the findkeyboards output)

(PROBLEM)
$ sudo /lib/udev/keymap input/event3 0x00 brightnessdown 0x10 brightnessup
EVIOCSKEYCODE: Invalid argument
setting scancode 0x 0 to key code 224 failed
EVIOCSKEYCODE: Invalid argument
setting scancode 0x10 to key code 225 failed

I'v also re-done the step to find the scan codes:

$ sudo /lib/udev/keymap -i input/event3
Press ESC to finish
scan code: 0x00 key code: fn_f5
scan code: 0x10 key code: fn_f6
scan code: 0x11 key code: fn_f5
scan code: 0x10 key code: fn_f6
scan code: 0x11 key code: fn_f5
scan code: 0x10 key code: fn_f6
scan code: 0x11 key code: fn_f5
scan code: 0x10 key code: fn_f6

But there is something strange: the first key that I press receives a
0x00 scan codes but the next times it is correctly recognized. It is
not related to the F5 key as you can see below:

$ sudo /lib/udev/keymap -i input/event3
Press ESC to finish
scan code: 0x00 key code: fn_f6
scan code: 0x11 key code: fn_f5
scan code: 0x10 key code: fn_f6
scan code: 0x11 key code: fn_f5
scan code: 0x10 key code: fn_f6

$ sudo /lib/udev/keymap -i input/event3
Press ESC to finish
scan code: 0x00 key code: fn_f9
scan code: 0x14 key code: fn_f10
scan code: 0x15 key code: fn_f9
scan code: 0x14 key code: fn_f10

Is it normal?

I've also tried the suggested command with the correct codes:
$ sudo /lib/udev/keymap input/event3 0x11 brightnessdown 0x10 brightnessup
EVIOCSKEYCODE: Invalid argument
setting scancode 0x11 to key code 224 failed
EVIOCSKEYCODE: Invalid argument
setting scancode 0x10 to key code 225 failed

Martin, please note that in my system I have the patch su suggested as
reported here: https://bugs.launchpad.net/ubuntu/+source/udev/+bug/625770/comments/12

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks. So it seems this is a kernel bug then, if the ioctl to set the correct key codes doesn't work, there is not much we can do about it at the udev level. At least it expains why the patch doesn't work for you. We still need it once the kernel is fixed, though.

At this point I don't know how to debug this further, I'm sorry. Handing this off to the kernel gurus.

summary: - sony ar vgn71 brightness keys do not work correctly
+ sony ar vgn71: EVIOCSKEYCODE when trying to set correct key codes
Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package udev - 165-0ubuntu1

---------------
udev (165-0ubuntu1) natty; urgency=low

  * New upstream release. Switch to Ubuntu-ish version number to avoid
    confusing them with Debian's.
    - Allow local users ACL access to raw USB devices of mobile phones.
      (LP: #316215)
    - Allow local users ACL access to raw FFADO devices. (LP: #681755)
    - Keymap fixes. (LP: #625770, #627890, #686662)
  * debian/control, debian/gir1.2-gudev-1.0.install: Rename GIR package to
    gir1.2-* to match the repository version and the recent transition.
    Add conflicts/replaces to old gir1.0-gudev-1.0.
  * debian/udev.postinst: Call udevadm --convert-db when upgrading from a
    version earlier than 165, to update the running database.
 -- Martin Pitt <email address hidden> Sun, 19 Dec 2010 00:15:00 +0100

Changed in udev (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
penalvch (penalvch) wrote :

Sergey Klimov, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ .

If it remains an issue, could you please run the following command in the development release from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p linux <replace-with-bug-number>

Also, could you please test the latest upstream kernel available (not the daily folder) following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested. For example:
kernel-fixed-upstream-v3.13-rc3

This can be done by clicking on the yellow circle with a black pencil icon next to the word Tags located at the bottom of the bug description. As well, please remove the tag:
needs-upstream-testing

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

As well, please remove the tag:
needs-upstream-testing

Once testing of the upstream kernel is complete, please mark this bug's Status as Confirmed. Please let us know your results. Thank you for your understanding.

tags: added: needs-kernel-logs
Changed in linux (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.