On Thu, Oct 03, 2019 at 03:08:54PM -0300, Anatoli wrote:
> Hi Erling,
Hi Anatoli, sorry for the late reply. Your answer somehow ended up in
in Gmail spam.
 
> Your problem is probably with the page name. Check it with usbhidctl -r
> -f /dev/uhid0 (the value you're interested in is what is shown for
> "Collection page").

$ usbhidctl -r -f /dev/uhid0
Report descriptor:
Collection page=Consumer usage=Consumer_Control
Input   size=16 count=1 Array page=Consumer usage=Unassigned..0x03ff, logical 
range 0..1023
Input   size=8 count=1 Array page=Keyboard usage=No_Event..0x00ff, logical 
range 0..255
Input   size=1 count=1 page=Microsoft usage=0xfe03, logical range 0..1
Input   size=1 count=1 page=Microsoft usage=0xfe04, logical range 0..1
Input   size=5 count=1 page=Microsoft usage=0xff05, logical range 0..31
Input   size=8 count=1 page=Microsoft usage=0xff02, logical range 0..255
End collection
Total   input size 7 bytes
Total  output size 0 bytes
Total feature size 0 bytes
> 
> Also, it's probably required for the actions to go on new lines in the
> action config.

They do in my config. I just joined the lines in my original email
before sending. For no really good reason I admit.

>                And for dubugging I'd use something like `echo 1 >>
> /tmp/uhid_debug` so you know that it's working, e.g.:
> Consumer:Volume_Decrement 1
>       echo 1 >> /tmp/uhid_debug

Absolutely no output. It's like the keys don't exist no matter what I
try. Are there ways to test for keyboard input at a lower level – like
in single user mode, before the USB driver potentially gets clogged by
other devices/processes?

> On the other hand, I'm working on a new driver that would make all this
> usbhid* operations unnecessary, the keys would work natively.

I'm looking forward to that! Please feel free to contact me for testing
diffs.

Regards,
Erling

> 
> Regards,
> Anatoli
> 
> On 2/10/19 09:54, Erling Westenvik wrote:
> > Hi,
> > I am unable to get the four multimedia keys (Play/Pause, Volume
> > Decrement/Increment, Mute) on my old'ish USB Microsoft Wired Keyboard
> > 600 to respond.
> > I have tried to do my homework by reading man pages, like
> > usbhidaction(1) and usbhidctl(1), and I've been looking at how-tos on
> > the net [1], but to no prevail and I've decided to reach out to misc@
> > for guidance. dmesg(1) below [2].
> > 
> > This is what I have tried:
> > 
> > 1. Identifying key strokes:
> > 
> >    $ usbhidctl -l -f /dev/uhid0
> >    Consumer_Control.Play/Pause=1
> >    Consumer_Control.No_Event=1
> >    Consumer_Control.0xfe03=0
> >    Consumer_Control.0xfe04=0
> >    Consumer_Control.0xff05=0
> >    Consumer_Control.0xff02=0
> >    
> >    Consumer_Control.Unassigned=1
> >    Consumer_Control.No_Event=1
> >    Consumer_Control.0xfe03=0
> >    Consumer_Control.0xfe04=0
> >    Consumer_Control.0xff05=0
> >    Consumer_Control.0xff02=0
> >    
> >    [...identical output (except for name) for the other four keys...]
> > 
> > 2. usbhidaction(1) configuration file:
> > 
> >    $ cat ~/.usbhidaction.conf
> >    Consumer:Play/Pause 1 mixerctl outputs.master.mute=toggle
> >    Consumer:Volume_Decrement 1 mixerctl outputs.master=-8
> >    Consumer:Volume_Increment 1 mixerctl outputs.master=+8
> >    Consumer:Mute 1 mixerctl outputs.master.mute=toggle
> > 
> > 3. Executing usbhidaction during xsession or from xterm..
> > 
> >    $ usbhidaction -c ~/.usbhidaction.conf -f /dev/uhid0
> > 
> >    ..exits without errors but keys are not responding.
> > 
> > Bwt:
> > - I used to have a PS/2 keyboard with multi media keys and it was
> >   working well with the machine in question.
> > - The current USB keyboard is tested and fully functional on another
> >   machine running Windows 7.
> > - None of the multi media keys gets detected by xev(1).
> > 
> > 
> > Regards,
> > 
> > Erling
> > 
> > ---
> > [1] https://www.bsdhowto.ch/extrakeys.html
> > [2] $ dmesg
> > OpenBSD 6.6-beta (GENERIC.MP) #314: Mon Sep 16 19:13:24 MDT 2019
> >     dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > real mem = 12867665920 (12271MB)
> > avail mem = 12464992256 (11887MB)
> > mpath0 at root
> > scsibus0 at mpath0: 256 targets
> > mainbus0 at root
> > bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xfcdf0 (57 entries)
> > bios0: vendor American Megatrends Inc. version "V1.15" date 03/04/2011
> > bios0: MICRO-STAR INTERNATIONAL CO.,LTD MS-7599
> > acpi0 at bios0: ACPI 1.0
> > acpi0: sleep states S0 S3 S4 S5
> > acpi0: tables DSDT FACP APIC MCFG OEMB SRAT HPET SSDT
> > acpi0: wakeup devices PCE2(S4) PCE3(S4) PCE4(S4) PCE5(S4) PCE6(S4) PCE7(S4) 
> > PCE9(S4) PCEA(S4) PCEB(S4) PCEC(S4) SBAZ(S4) P0PC(S4) UHC1(S4) UHC2(S4) 
> > UHC3(S4) USB4(S4) [...]
> > acpitimer0 at acpi0: 3579545 Hz, 32 bits
> > acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
> > cpu0 at mainbus0: apid 0 (boot processor)
> > cpu0: AMD Athlon(tm) II X4 635 Processor, 2907.73 MHz, 10-05-03
> > cpu0: 
> > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,ITSC
> > cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 
> > 64b/line 16-way L2 cache
> > cpu0: ITLB 32 4KB entries fully associative, 16 4MB entries fully 
> > associative
> > cpu0: DTLB 48 4KB entries fully associative, 48 4MB entries fully 
> > associative
> > cpu0: AMD erratum 721 detected and fixed
> > tsc_timecounter_init: TSC skew=0 observed drift=0
> > cpu0: smt 0, core 0, package 0
> > mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
> > cpu0: apic clock running at 200MHz
> > cpu0: mwait min=64, max=64, IBE
> > cpu1 at mainbus0: apid 1 (application processor)
> > TSC skew=3
> > cpu1: AMD Athlon(tm) II X4 635 Processor, 2907.34 MHz, 10-05-03
> > cpu1: 
> > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,ITSC
> > cpu1: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 
> > 64b/line 16-way L2 cache
> > cpu1: ITLB 32 4KB entries fully associative, 16 4MB entries fully 
> > associative
> > cpu1: DTLB 48 4KB entries fully associative, 48 4MB entries fully 
> > associative
> > cpu1: AMD erratum 721 detected and fixed
> > tsc_timecounter_init: TSC skew=3 observed drift=0
> > cpu1: smt 0, core 1, package 0
> > cpu2 at mainbus0: apid 2 (application processor)
> > TSC skew=4
> > cpu2: AMD Athlon(tm) II X4 635 Processor, 2907.34 MHz, 10-05-03
> > cpu2: 
> > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,ITSC
> > cpu2: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 
> > 64b/line 16-way L2 cache
> > cpu2: ITLB 32 4KB entries fully associative, 16 4MB entries fully 
> > associative
> > cpu2: DTLB 48 4KB entries fully associative, 48 4MB entries fully 
> > associative
> > cpu2: AMD erratum 721 detected and fixed
> > tsc_timecounter_init: TSC skew=4 observed drift=0
> > cpu2: smt 0, core 2, package 0
> > cpu3 at mainbus0: apid 3 (application processor)
> > TSC skew=-18
> > cpu3: AMD Athlon(tm) II X4 635 Processor, 2907.34 MHz, 10-05-03
> > cpu3: 
> > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,ITSC
> > cpu3: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 
> > 64b/line 16-way L2 cache
> > cpu3: ITLB 32 4KB entries fully associative, 16 4MB entries fully 
> > associative
> > cpu3: DTLB 48 4KB entries fully associative, 48 4MB entries fully 
> > associative
> > cpu3: AMD erratum 721 detected and fixed
> > tsc_timecounter_init: TSC skew=-18 observed drift=0
> > cpu3: smt 0, core 3, package 0
> > ioapic0 at mainbus0: apid 4 pa 0xfec00000, version 21, 24 pins
> > acpimcfg0 at acpi0
> > acpimcfg0: addr 0xe0000000, bus 0-255
> > acpihpet0 at acpi0: 14318180 Hz
> > acpiprt0 at acpi0: bus 0 (PCI0)
> > acpiprt1 at acpi0: bus 1 (PCE2)
> > acpiprt2 at acpi0: bus -1 (PCE3)
> > acpiprt3 at acpi0: bus -1 (PCE4)
> > acpiprt4 at acpi0: bus -1 (PCE5)
> > acpiprt5 at acpi0: bus 2 (PCE6)
> > acpiprt6 at acpi0: bus -1 (PCE7)
> > acpiprt7 at acpi0: bus -1 (PCE9)
> > acpiprt8 at acpi0: bus -1 (PCEA)
> > acpiprt9 at acpi0: bus -1 (PCEB)
> > acpiprt10 at acpi0: bus -1 (PCEC)
> > acpiprt11 at acpi0: bus 3 (P0PC)
> > acpicpu0 at acpi0: C1(@1 halt!), PSS
> > acpicpu1 at acpi0: C1(@1 halt!), PSS
> > acpicpu2 at acpi0: C1(@1 halt!), PSS
> > acpicpu3 at acpi0: C1(@1 halt!), PSS
> > acpipci0 at acpi0 PCI0: _OSC failed
> > acpicmos0 at acpi0
> > acpibtn0 at acpi0: PWRB
> > "PNP0C14" at acpi0 not configured
> > cpu0: 2907 MHz: speeds: 2900 2200 1700 800 MHz
> > pci0 at mainbus0 bus 0
> > 0:0:0: mem address conflict 0xe0000000/0x20000000
> > pchb0 at pci0 dev 0 function 0 "ATI RX780 Host" rev 0x00
> > ppb0 at pci0 dev 2 function 0 "ATI RD790 PCIE" rev 0x00
> > pci1 at ppb0 bus 1
> > radeondrm0 at pci1 dev 0 function 0 "ATI Radeon HD 5770" rev 0x00
> > drm0 at radeondrm0
> > radeondrm0: msi
> > azalia0 at pci1 dev 0 function 1 "ATI Radeon HD 5700 Audio" rev 0x00: msi
> > azalia0: no supported codecs
> > ppb1 at pci0 dev 6 function 0 "ATI RD790 PCIE" rev 0x00
> > pci2 at ppb1 bus 2
> > re0 at pci2 dev 0 function 0 "Realtek 8168" rev 0x03: RTL8168D/8111D 
> > (0x2800), msi, address 40:61:86:c6:16:49
> > rgephy0 at re0 phy 7: RTL8169S/8110S/8211 PHY, rev. 2
> > ahci0 at pci0 dev 17 function 0 "ATI SBx00 SATA" rev 0x00: apic 4 int 22, 
> > AHCI 1.1
> > ahci0: port 0: 1.5Gb/s
> > ahci0: port 1: 3.0Gb/s
> > scsibus1 at ahci0: 32 targets
> > sd0 at scsibus1 targ 0 lun 0: <ATA, ST3250410AS, 3.AA> 
> > t10.ATA_ST3250410AS_9RY1SS4X
> > sd0: 238475MB, 512 bytes/sector, 488397168 sectors
> > sd1 at scsibus1 targ 1 lun 0: <ATA, SAMSUNG HD403LJ, CT10> 
> > naa.50000f001b400584
> > sd1: 381554MB, 512 bytes/sector, 781422768 sectors
> > ohci0 at pci0 dev 18 function 0 "ATI SB700 USB" rev 0x00: apic 4 int 16, 
> > version 1.0, legacy support
> > ohci1 at pci0 dev 18 function 1 "ATI SB700 USB" rev 0x00: apic 4 int 16, 
> > version 1.0, legacy support
> > ehci0 at pci0 dev 18 function 2 "ATI SB700 USB2" rev 0x00: apic 4 int 17
> > usb0 at ehci0: USB revision 2.0
> > uhub0 at usb0 configuration 1 interface 0 "ATI EHCI root hub" rev 2.00/1.00 
> > addr 1
> > ohci2 at pci0 dev 19 function 0 "ATI SB700 USB" rev 0x00: apic 4 int 18, 
> > version 1.0, legacy support
> > ohci3 at pci0 dev 19 function 1 "ATI SB700 USB" rev 0x00: apic 4 int 18, 
> > version 1.0, legacy support
> > ehci1 at pci0 dev 19 function 2 "ATI SB700 USB2" rev 0x00: apic 4 int 19
> > usb1 at ehci1: USB revision 2.0
> > uhub1 at usb1 configuration 1 interface 0 "ATI EHCI root hub" rev 2.00/1.00 
> > addr 1
> > piixpm0 at pci0 dev 20 function 0 "ATI SBx00 SMBus" rev 0x3c: SMI
> > iic0 at piixpm0
> > iic0: addr 0x28 01=00 02=00 03=00 04=00 05=00 06=00 07=03 3e=03 41=00 42=00 
> > 43=00 44=00 45=00 46=00 47=03 81=00 82=00 83=00 84=00 85=00 86=00 87=03 
> > c1=00 c2=00 c3=00 c4=00 c5=00 c6=00 c7=03 words 00=ff00 01=0000 02=0000 
> > 03=00ff 04=00ff 05=00ff 06=00ff 07=ffff
> > spdmem0 at iic0 addr 0x50: 4GB DDR3 SDRAM PC3-10600
> > spdmem1 at iic0 addr 0x51: 2GB DDR3 SDRAM PC3-10600
> > spdmem2 at iic0 addr 0x52: 4GB DDR3 SDRAM PC3-10600
> > spdmem3 at iic0 addr 0x53: 2GB DDR3 SDRAM PC3-10600
> > pciide0 at pci0 dev 20 function 1 "ATI SB700 IDE" rev 0x00: DMA, channel 0 
> > configured to compatibility, channel 1 configured to compatibility
> > atapiscsi0 at pciide0 channel 1 drive 0
> > scsibus2 at atapiscsi0: 2 targets
> > cd0 at scsibus2 targ 0 lun 0: <HL-DT-ST, DVDRAM GH40N, NV02> removable
> > cd0(pciide0:1:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 5
> > azalia1 at pci0 dev 20 function 2 "ATI SBx00 HD Audio" rev 0x00: apic 4 int 
> > 16
> > azalia1: codecs: Realtek ALC888
> > audio0 at azalia1
> > pcib0 at pci0 dev 20 function 3 "ATI SB700 ISA" rev 0x00
> > ppb2 at pci0 dev 20 function 4 "ATI SB600 PCI" rev 0x00
> > pci3 at ppb2 bus 3
> > ohci4 at pci0 dev 20 function 5 "ATI SB700 USB" rev 0x00: apic 4 int 18, 
> > version 1.0, legacy support
> > pchb1 at pci0 dev 24 function 0 "AMD AMD64 10h HyperTransport" rev 0x00
> > pchb2 at pci0 dev 24 function 1 "AMD AMD64 10h Address Map" rev 0x00
> > pchb3 at pci0 dev 24 function 2 "AMD AMD64 10h DRAM Cfg" rev 0x00
> > km0 at pci0 dev 24 function 3 "AMD AMD64 10h Misc Cfg" rev 0x00
> > pchb4 at pci0 dev 24 function 4 "AMD AMD64 10h Link Cfg" rev 0x00
> > usb2 at ohci0: USB revision 1.0
> > uhub2 at usb2 configuration 1 interface 0 "ATI OHCI root hub" rev 1.00/1.00 
> > addr 1
> > usb3 at ohci1: USB revision 1.0
> > uhub3 at usb3 configuration 1 interface 0 "ATI OHCI root hub" rev 1.00/1.00 
> > addr 1
> > usb4 at ohci2: USB revision 1.0
> > uhub4 at usb4 configuration 1 interface 0 "ATI OHCI root hub" rev 1.00/1.00 
> > addr 1
> > usb5 at ohci3: USB revision 1.0
> > uhub5 at usb5 configuration 1 interface 0 "ATI OHCI root hub" rev 1.00/1.00 
> > addr 1
> > isa0 at pcib0
> > isadma0 at isa0
> > com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
> > com0: probed fifo depth: 15 bytes
> > pckbc0 at isa0 port 0x60/5 irq 1 irq 12
> > pckbd0 at pckbc0 (kbd slot)
> > wskbd0 at pckbd0: console keyboard
> > pcppi0 at isa0 port 0x61
> > spkr0 at pcppi0
> > usb6 at ohci4: USB revision 1.0
> > uhub6 at usb6 configuration 1 interface 0 "ATI OHCI root hub" rev 1.00/1.00 
> > addr 1
> > vmm0 at mainbus0: SVM/RVI
> > uhidev0 at uhub3 port 3 configuration 1 interface 0 "Logitech USB-PS/2 
> > Optical Mouse" rev 2.00/27.20 addr 2
> > uhidev0: iclass 3/1
> > ums0 at uhidev0: 8 buttons, Z and W dir
> > wsmouse0 at ums0 mux 0
> > uhidev1 at uhub4 port 3 configuration 1 interface 0 "Microsoft Wired 
> > Keyboard 600" rev 1.10/1.10 addr 2
> > uhidev1: iclass 3/1
> > ukbd0 at uhidev1: 8 variable keys, 6 key codes
> > wskbd1 at ukbd0 mux 1
> > uhidev2 at uhub4 port 3 configuration 1 interface 1 "Microsoft Wired 
> > Keyboard 600" rev 1.10/1.10 addr 2
> > uhidev2: iclass 3/0, 3 report ids
> > uhid0 at uhidev2 reportid 1: input=7, output=0, feature=0
> > uhid1 at uhidev2 reportid 3: input=1, output=0, feature=0
> > vscsi0 at root
> > scsibus3 at vscsi0: 256 targets
> > softraid0 at root
> > scsibus4 at softraid0: 256 targets
> > sd2 at scsibus4 targ 1 lun 0: <OPENBSD, SR RAID 1, 006>
> > sd2: 238417MB, 512 bytes/sector, 488279018 sectors
> > root on sd2a (b14f96613fb578e5.a) swap on sd2b dump on sd2b
> > initializing kernel modesetting (JUNIPER 0x1002:0x68B8 0x1682:0x2990 0x00).
> > radeondrm0: 1920x1080, 32bpp
> > wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0
> > wskbd1: connecting to wsdisplay0
> > wsdisplay0: screen 1-5 added (std, vt100 emulation)
> > sd3 at scsibus4 targ 2 lun 0: <OPENBSD, SR CRYPTO, 006>
> > sd3: 237382MB, 512 bytes/sector, 486158505 sectors
> > 
> 

Reply via email to