[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#456763: resending, I got the recipient wrong



I patched (see attachment) xserver-xorg-input-keyboard's kbd.c to log the input that it's getting from the kernel. To me, kernel input looks valid, so I think the X server is messing things up.

For example the following input to kbd.c

[1225291057.843404] kbd driver rec scancode: 0x022 down
[1225291057.915488] kbd driver rec scancode: 0x023 down
[1225291057.987358] kbd driver rec scancode: 0x024 down
[1225291058.026931] kbd driver rec scancode: 0x022 up
[1225291058.061505] kbd driver rec scancode: 0x025 down
[1225291058.067089] kbd driver rec scancode: 0x023 up
[1225291059.143171] kbd driver rec scancode: 0x024 up
[1225291059.143222] kbd driver rec scancode: 0x025 up

results in the following output in an X window:

1234444444444444

Clearly, the kernel didn't send more than one "4". First I thought that the repeat was because the "0x025 up" came more than 1 second later than "0x025 down", however there were similar cases, in which the output was fine:

[1225298340.310084] kbd driver rec scancode: 0x022 down
[1225298340.346280] kbd driver rec scancode: 0x023 down
[1225298340.417964] kbd driver rec scancode: 0x024 down
[1225298340.457444] kbd driver rec scancode: 0x022 up
[1225298340.491913] kbd driver rec scancode: 0x025 down
[1225298340.497723] kbd driver rec scancode: 0x023 up
[1225298340.533022] kbd driver rec scancode: 0x024 up
[1225298344.135780] kbd driver rec scancode: 0x025 up

resulted in the correct output: 1234, although the last "up" is nearly 4 seconds late. So it seems to me that there is some kind of indeterministic behaviour inside the X server.

Therefore I have reassigned the bug to xserver-xorg-core. If anybody doesn't agree with my conclusions, just move it back.

Kind regards,

Thiemo
--- kbd.c	2008-05-21 21:39:38.000000000 +0200
+++ /scratch/thiemo/linux/xserver-xorg-input-keyboard-1.3.1/src/kbd.c	2008-10-29 15:32:53.000000000 +0100
@@ -581,6 +581,8 @@
   return (Success);
 }
 
+#include "sys/time.h"
+
 static void
 PostKbdEvent(InputInfoPtr pInfo, unsigned int scanCode, Bool down)
 {
@@ -597,8 +599,11 @@
   unsigned long changeLock = 0;
   static int  lockkeys = 0;
 
+#define DEBUG
 #ifdef DEBUG
-  ErrorF("kbd driver rec scancode: 0x02%x %s\n", scanCode, down?"down":"up");
+  struct timeval tv;
+  if (gettimeofday( &tv, NULL )) ErrorF("gettimeofday() failed");
+  ErrorF("[%li.%06li] kbd driver rec scancode: 0x02%x %s\n", tv.tv_sec, tv.tv_usec, scanCode, down?"down":"up");
 #endif
 	  
   /* Disable any keyboard processing while in suspend */

Reply to: