Subject: USB keyboard: ``sticky'' key.
To: None <netbsd-help@netbsd.org>
From: Richard Rauch <rauch@eecs.ukans.edu>
List: netbsd-help
Date: 03/27/2001 04:26:07
I'm not sure if this is a keyboard, VIA chipset, or NetBSD problem, but
this seems like the best place to ask.  (^&

The problem: Sometimes, while typing, the keyboard gets stuck repeating a
key.  The only way to fix it is to (BOTH, but in EITHER order, it
seems) push another key AND detach/reattach the keyboard.

What follows is a bit lengthy.  I'm mostly fishing for either ``Here's
some more information for a send-pr'', or a ``This is
fixed/is-not-a-NetBSD problem'' response.  As I say below, I'll assume
that it's a NetBSD problem & send-pr it, unless I'm told otherwise---but
I'd like to narrow it down, or correlate with any related experiences
beforehand, since the problem strikes rarely and I don't know much about
it.

Although I read this mailing list, I do so via the web rather than via
subscribing to the list.  Due to occasional web problems, and latency, I
would appreciate being CC'ed any replies.  (^&


Anyway, the gorey details (uname -a, dmesg output included at bottom):


What I have:

i386 PC.

I have an MS ``wave'' keyboard.  It's supposed to be a PS/2 keyboard, but
it comes with a little PS/2<->USB adaptor, and is billed as supporting
both USB and PS/2.

The motherboard is a VIA-based motherboard that I bought last August.  
I've had no significant other problems with the motherboard.  (Well, audio
recording with the built-in sound support has never worked terribly
well---but that was also true with the Ensoniq sound card that I have in
the other 'puter, so I'm not sure if that's more due to motherboard
weirdness or driver problems---or even pilot error, since I really never
fiddled much with sound.  (^&)

The OS is NetBSD 1.5 (proper); the kernel is in no way patched, though it
has been built from a custom config.  CPU is an Athlon.

The motherboard appears to have 2 USB hubs.  One is positioned for a
front-panel mounting, the other for rear connectors.  There is no access
for the front port, and so no connectors are associated with it.  The two
USB devices that I have are on the rear connectors (uhub0).

The problem is moderately RARE.  I've had it happen only a couple of times
since switching to the USB keyboard.  I run almost exclusively under
XFree86 (3.3.6), so I can only say that it happens under X---dunno if X
has any bearing on the problem.

I am not aware of anything unusual (especially fast typing, multiple
keypresses, etc.) that I did at the time.  In at least one case, it
happened while I was under a Python/PMW/TKinter text widget (though once
started, redirecting the X focus didn't help).


Other oddities that I've noticed---probably not related, but having to do
with the keyboard in one case and another USB device in the other case:

The 3 Lock keys (CapsLock, NumLock, and ScrollLock) all produce
``pckbc: cmd failed'' messages---though the keys seem to operate normally,
and the keyboard LED lights up.  I assume that this is because I don't
actually have any keyboard on the PS/2 port and that the error messages
are harmless.  (Though wscons probably shouldn't be trying to talk to a
non-existant keyboard...)

An Inland USB<->parallel converter that I use for my printer will NOT work
under NetBSD UNLESS I (re)attach it AFTER booting NetBSD.  (The lpr
printer queue otherwise stalls on the first attempt to print.)  The
printcap file (using native lpr, not CUPS) is directed to use ulpt0.  
/dev/ulpt0 looks like:

crw-------  1 root  wheel  57, 0 Mar 19 02:46 /dev/ulpt0

(The ulpt0 problem may be related to kern/10797; there the person's mouse
doesn't probe properly at boot.  Though in that case, they also plug the
mouse into a hub that lives in the keyboard; dunno if that complicates
things from NetBSD's point of view.)



I'm not sure if the key-repeat deserves a send-pr.  Has it been silently
fixed in -current?  Is it related to my USB controller/motherboard?

This may relate to kern/12366 in some way...the author there claims that
unplugging USB keyboards under XFree86 4.02 causes a freeze.  In my case,
unplugging/reconnecting the keyboard resets whatever died...perhaps
kern/12366 should be reclassified as an X problem?  I don't have _that_
problem under 3.3.6...

I'm happy to file a problem report, and probably will if no one tells me
that it's fixed already (or that there is good reason to think that it is
not a NetBSD problem).  However, if I can gather/summarize any other
experiences with this, that'd be nice.  (^& Due to the low frequency of
the problem, I don't have enough information to narrow the scope of the
problem much.  I don't even know if it's a NetBSD problem...



(Hm...wd0 supports DMA mode 2, Ultra-DMA mode 5---but NetBSD _uses_
``Ultra-DMA mode 2''?  Is that right?  I hadn't ever noticed that
before...)


 /~~~ uname -a

NetBSD rkr1 1.5 NetBSD 1.5 (rkrGENERIC) #5: Fri Feb 16 18:42:00 CST 2001
root@rkr1:/usr/src/sys/arch/i386/compile/rkrGENERIC i386

 \___ uname -a

 /~~~ dmesg

NetBSD 1.5 (rkrGENERIC) #5: Fri Feb 16 18:42:00 CST 2001
    root@rkr1:/usr/src/sys/arch/i386/compile/rkrGENERIC
cpu0: AMD K7 (Athlon) (686-class)
total memory = 127 MB
avail memory = 115 MB
using 1658 buffers containing 6632 KB of memory
BIOS32 rev. 0 found at 0xfb220
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: VIA Technologies product 0x0305 (rev. 0x02)
ppb0 at pci0 dev 1 function 0: VIA Technologies product 0x8305 (rev. 0x00)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
pcib0 at pci0 dev 7 function 0
pcib0: VIA Technologies VT82C686A (Apollo KX133) PCI-ISA Bridge
(rev. 0x22)
pciide0 at pci0 dev 7 function 1: VIA Tech VT82C586A IDE Controller
(rev. 0x10)
pciide0: bus-master DMA support present
pciide0: primary channel configured to compatibility mode
wd0 at pciide0 channel 0 drive 0: <Maxtor 52049H4>
wd0: drive supports 16-sector pio transfers, lba addressing
wd0: 19541 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 40020624
sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data
transfers)
pciide0: secondary channel configured to compatibility mode
atapibus0 at pciide0 channel 1
cd0 at atapibus0 drive 0: <ATAPI 48X CDROM, 48XCDROM Ver3.30, VER-3.3>
type 5 cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
pciide0: secondary channel interrupting at irq 15
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data
transfers)
uhci0 at pci0 dev 7 function 2: VIA Technologies VT83C572 USB Controller
(rev. 0x10)
uhci0: interrupting at irq 5
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA Technologie UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 7 function 3: VIA Technologies VT83C572 USB Controller
(rev. 0x10)
uhci1: interrupting at irq 5
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA Technologie UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
viapm0 at pci0 dev 7 function 4
auvia0 at pci0 dev 7 function 5: VIA VT82C686A AC'97 Audio (rev H)
auvia0: interrupting at irq 10
auvia0: ICE17 codec; headphone, 18 bit DAC, 18 bit ADC, Unknown 3D
audio0 at auvia0: full duplex, mmap, independent
ahc0 at pci0 dev 8 function 0
ahc0: interrupting at irq 11
ahc0: aic7860 Single Channel A, SCSI Id=7, 3/255 SCBs
scsibus0 at ahc0 channel 0: 8 targets, 8 luns per target
tlp0 at pci0 dev 13 function 0: Macronix MX98715AEC-x Ethernet, pass 2.5
tlp0: interrupting at irq 10
tlp0: Ethernet address 00:80:c6:f9:bc:35
tlp0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX
vga1 at pci0 dev 14 function 0: S3 ViRGE/DX (rev. 0x01)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0
lpt0 at isa0 port 0x378-0x37b irq 7
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
isapnp0: no ISA Plug 'n Play devices found
viaenv0 at viapm0
biomask eb65 netmask ef65 ttymask ffe7
scsibus0: waiting 2 seconds for devices to settle...
ahc0: target 3 synchronous at 10.0MHz, offset = 0xf
cd1 at scsibus0 target 3 lun 0: <YAMAHA, CRW6416S, 1.0c> SCSI2 5/cdrom
removable
ahc0: target 4 synchronous at 10.0MHz, offset = 0xf
st0 at scsibus0 target 4 lun 0: <Seagate, STT8000N, 3.22> SCSI2
1/sequential removable
st0: drive empty
IPsec: Initialized Security Association Processing.
ukbd0 at uhub0 port 1 configuration 1 interface 0
ukbd0: Microsoft Natural Keyboard Elite, rev 1.00/1.04, addr 2, iclass 3/1
wskbd1 at ukbd0 mux 1
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
wskbd1: connecting to wsdisplay0
ulpt0 at uhub0 port 2 configuration 1 interface 0
ulpt0: vendor 0x0832 product 0x5850, rev 1.00/1.04, addr 3, iclass 7/1
pckbc: cmd failed
tlp0: transmit underrun; new threshold: 96/256 bytes
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
pckbc: cmd failed
tlp0: transmit underrun; new threshold: 128/512 bytes
pckbc: cmd failed
pckbc: cmd failed

 \___ dmesg


  "I probably don't know what I'm talking about." --rauch@eecs.ukans.edu