Package: acpi-support
Version: 0.95-2
Severity: important

Hi everyone!

I just figured out, that acpi_fakekey is not working for my devices.
(An Asus M2N laptop and a HP k704.de workstation)

An strace of acpi_fakekey gave me:
| # strace acpi_fakekey 16
| execve("/usr/bin/acpi_fakekey", ["acpi_fakekey", "16"], [/* 15 vars */]) = 0
[...]
| open("/dev/input/event0", O_RDWR)       = 3
| ioctl(3, 0x80404521, 0xbfd2d4e8)        = 64
| write(3, "i\206\4\10\364\337\362\267\1\0\20\0\1\0\0\0", 16) = 16
| write(3, "i\206\4\10\364\337\362\267\1\0\20\0\0\0\0\0", 16) = 16
| exit_group(0)                           = ?

Having a look at my event devices gave me (for my M2N):
# head -n 1 /sys/class/input/input*/name
| ==> /sys/class/input/input0/name <==
| Power Button (FF)
| 
| ==> /sys/class/input/input1/name <==
| Sleep Button (CM)
| 
| ==> /sys/class/input/input2/name <==
| Lid Switch
| 
| ==> /sys/class/input/input3/name <==
| AT Translated Set 2 keyboard
| 
| ==> /sys/class/input/input4/name <==
| PC Speaker
| 
| ==> /sys/class/input/input5/name <==
| SynPS/2 Synaptics TouchPad

That means that it is definitely using the event-device of the ACPI power 
button for my machines (both), but the default xorg.conf does only handle the 
standard keyboard. As I guess acpi_fakekey wants to inject the key codes there, 
though the man page only mentions the "correct input FIFO in /dev/input/eventx".

After modding acpi_fakekey.c a bit to see how it selects the event-device:
| # cat acpi_fakekey_mod.c
[...]
| int find_keyboard() {
|       int i, j;
|         int fd;
|         char filename[32];
|         char key_bitmask[(KEY_MAX + 7) / 8];
|       unsigned int u;
|         int first=1;
| 
|         printf("BTN_MISC is %d bits (=%d bytes).\n", BTN_MISC, BTN_MISC/8);
|         for (i=0; i<32; i++) {
|                 snprintf(filename,sizeof(filename), "/dev/input/event%d", i);
| 
|                 fd = open(filename, O_RDWR);
|                 ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bitmask)), 
key_bitmask);
| 
|               for (j = 0; j < BTN_MISC; j++) {
|                       if (TestBit(j, key_bitmask))
|                               break;
|               }
| 
|                 if (j < BTN_MISC) {
|                         printf("found event%d with : \n",i );
|                         for(j=0; j<sizeof(key_bitmask); ++j) {
|                            u=(key_bitmask[j]&0xff);
|                            printf(" %02x", u);
|                            if((j%16) == 7) printf(" "); if((j%16) == 15) 
printf("\n");
|                         }
|                         if(first) { first=0; printf(" -> would select this 
one <-\n"); }
|                         printf("\n");
|                 }
|               close (fd);
|         }
|         return 0;
| }
[...]

I got theese "key_bitmasks":
| # gcc -o acpi_fakekey_mod acpi_fakekey_mod.c && ./acpi_fakekey_mod
| BTN_MISC is 256 bits (=32 bytes).
| found event0 with :   # POWERBTN
|  00 00 00 00 00 00 00 00  00 00 00 00 00 00 10 00
|  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|  -> would select this one <-
| 
| found event1 with :   # SLEEPBTN
|  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|  00 40 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
| 
| found event3 with :   # ATKBD
|  fe ff ff ff ff ff ff ff  ff ff ef ff df ff ff fe
|  01 d0 40 f8 78 20 80 03  00 00 00 02 04 00 00 00
|  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00

Sureley all three devices have bits set below BTN_MISC.

By the way: I'm using 2.6.21.6 with config:
| [...]
| CONFIG_ACPI=y
| [...]
| CONFIG_ACPI_AC=y
| CONFIG_ACPI_BATTERY=y
| CONFIG_ACPI_BUTTON=y
| CONFIG_ACPI_VIDEO=y
| [...]
| CONFIG_INPUT=y
| CONFIG_INPUT_MOUSEDEV=y
| CONFIG_INPUT_MOUSEDEV_PSAUX=y
| CONFIG_INPUT_JOYDEV=y
| CONFIG_INPUT_EVDEV=y
| CONFIG_INPUT_KEYBOARD=y
| CONFIG_KEYBOARD_ATKBD=y
| CONFIG_INPUT_MOUSE=y
| CONFIG_MOUSE_PS2=y
| CONFIG_INPUT_JOYSTICK=y
| CONFIG_INPUT_MISC=y
| CONFIG_INPUT_PCSPKR=y

As a quick and dirty hack
| CONFIG_ACPI_BUTTON=m
solved the problem for me by reordering my devices, but I think it's not the 
way to do it-

Cheers,
   Ralf Miunske

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.21.6 (PREEMPT)
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages acpi-support depends on:
ii  acpid                        1.0.4-7.1   Utilities for using ACPI power man
ii  dmidecode                    2.9-1       Dump Desktop Management Interface 
ii  finger                       0.17-11     user information lookup program
ii  hdparm                       7.5-1       tune hard disk parameters for high
ii  laptop-detect                0.12.1-0.1  attempt to detect a laptop
ii  libc6                        2.6-2       GNU C Library: Shared libraries
ii  lsb-base                     3.1-23.1    Linux Standard Base 3.1 init scrip
ii  powermgmt-base               1.29        Common utils and configs for power
ii  radeontool                   1.5-5       utility to control ATI Radeon back
ii  toshset                      1.72-4      Access much of the Toshiba laptop 
ii  vbetool                      0.7-1.1     run real-mode video BIOS code to a
ii  xbase-clients                1:7.2.ds2-2 miscellaneous X clients

acpi-support recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to