>Synopsis:      pkg libinput-openbsd, used in sway, returns keyboard type
XT instead of USB
>Category:      sway, wayland, libinput-openbsd
>Environment:
        System      : OpenBSD 7.5
        Details     : OpenBSD 7.5 (GENERIC.MP) #82: Wed Mar 20 15:48:40 MDT
2024
                         dera...@amd64.openbsd.org:
/usr/src/sys/arch/amd64/compile/GENERIC.MP
        Architecture: OpenBSD.amd64
        Machine     : amd64
>Description:
        From a fresh boot, I run startsway.sh to launch the sway window
manager under with wayland.
It emits the following debug log from sway.

00:00:00.362 [DEBUG] [wlr] [backend/libinput/backend.c:88] Starting
libinput backend
libinput error: /dev/wskbd: Keyboard type: XT
00:00:00.364 [DEBUG] [wlr] [backend/libinput/events.c:70] Adding
unsupported [-559038737:-559038737]
00:00:00.364 [DEBUG] [sway/input/input-manager.c:235] adding device:
'-559038737:-559038737:unsupported'
00:00:00.364 [DEBUG] [sway/input/input-manager.c:184] no fallback seat
config - creating default
00:00:00.364 [DEBUG] [sway/config/seat.c:66] Adding non-wildcard seat config
00:00:00.364 [DEBUG] [sway/config/seat.c:83] Config stored for seat seat0
00:00:00.364 [DEBUG] [sway/input/input-manager.c:636] applying seat config
for seat seat0
00:00:00.364 [DEBUG] [sway/input/seat.c:975] adding device
-559038737:-559038737:unsupported to seat seat0
00:00:00.432 [DEBUG] [wlr] [xcursor/wlr_xcursor.c:223] Loaded cursor theme
'default' at size 24 (119 available cursors)
00:00:00.432 [DEBUG] [sway/input/seat.c:723] Applying input mapping to
-559038737:-559038737:unsupported
00:00:00.432 [DEBUG] [sway/input/seat.c:723] Applying input mapping to
-559038737:-559038737:unsupported
00:00:00.432 [DEBUG] [wlr] [backend/libinput/events.c:70] Adding
unsupported [-559038737:-559038737]
00:00:00.432 [DEBUG] [sway/input/input-manager.c:235] adding device:
'-559038737:-559038737:unsupported'
00:00:00.432 [DEBUG] [sway/input/seat.c:975] adding device
-559038737:-559038737:unsupported to seat seat0
00:00:00.441 [DEBUG] [sway/input/keyboard.c:908] Created keyboard group
0x1f93dbd5800
00:00:00.441 [DEBUG] [sway/input/keyboard.c:932] Adding keyboard
-559038737:-559038737:unsupported to group 0x1f93dbd5800
00:00:00.443 [DEBUG] [wlr] [backend/libinput/backend.c:129] libinput
successfully initialized


sway starts like normal. But, I cannot use my keyboard and have to reboot.

I tried to figure out what backend/libinput/backend.c leads to
https://github.com/sizeofvoid/libopeninput/blob/build-on-openbsd/src/wskbdmap.c#L506
Looks like it could be it. I don't know how to debug ioctl.
I have a regular p105 us keyboard. It works fine in Xorg, there is nothing
special about it except
the cool LEDs ;-).

>How-To-Repeat:
        I just run 'startsway.sh 2>&1 1> sway.log' and the error happens
every time,
assuming that xenodm did not run. e.g. we running this command after tty
login.

>Fix:
the hotfix:
        If I let xenodm run before sway the keyboard error changes to
'Keyboard type: USB'
and the window manager/wayland work fine.

# example

doas rcctl stop xenodm

startsway.sh


actual fix:
https://github.com/sizeofvoid/libopeninput/blob/build-on-openbsd/src/wskbdmap.c#L511

int type;

sounds like this integer isn't set properly -- in the log message in
description it is -559038737

from kernel
https://github.com/openbsd/src/blob/master/sys/dev/wscons/wsconsio.h#L130
it should be 3 for XT or 5 for USB.

dmesg:
OpenBSD 7.5 (GENERIC.MP) #82: Wed Mar 20 15:48:40 MDT 2024
    dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8442712064 (8051MB)
avail mem = 8165785600 (7787MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.0 @ 0xd9cb8000 (67 entries)
bios0: vendor HP version "P07 Ver. 02.39" date 11/18/2021
bios0: HP HP ProDesk 600 G3 SFF
acpi0 at bios0: ACPI 5.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT UEFI SSDT TPM2 SSDT MSDM SLIC WSMT HPET APIC
MCFG SSDT SSDT SSDT SSDT SSDT SSDT SSDT SSDT DBGP DBG2 SSDT ASF! FPDT BGRT
acpi0: wakeup devices PS2K(S3) PS2M(S3) GLAN(S4) XHC_(S3) XDCI(S4) HDAS(S4)
RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) PXSX(S4) RP04(S4) PXSX(S4)
RP05(S4) PXSX(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 23999999 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz, 3392.10 MHz, 06-9e-09, patch
000000f8
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SRBDS_CTRL,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,RSBA,MISC_PKG_CT,ENERGY_FILT,GDS_CTRL,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB
64b/line 4-way L2 cache, 6MB 64b/line 12-way L3 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 24MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz, 3392.11 MHz, 06-9e-09, patch
000000f8
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SRBDS_CTRL,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,RSBA,MISC_PKG_CT,ENERGY_FILT,GDS_CTRL,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu1: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB
64b/line 4-way L2 cache, 6MB 64b/line 12-way L3 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz, 3392.10 MHz, 06-9e-09, patch
000000f8
cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SRBDS_CTRL,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,RSBA,MISC_PKG_CT,ENERGY_FILT,GDS_CTRL,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu2: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB
64b/line 4-way L2 cache, 6MB 64b/line 12-way L3 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz, 3392.11 MHz, 06-9e-09, patch
000000f8
cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SRBDS_CTRL,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,RSBA,MISC_PKG_CT,ENERGY_FILT,GDS_CTRL,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu3: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB
64b/line 4-way L2 cache, 6MB 64b/line 12-way L3 cache
cpu3: smt 0, core 3, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 120 pins
acpimcfg0 at acpi0
acpimcfg0: addr 0xf8000000, bus 0-63
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (RP01)
acpiprt2 at acpi0: bus -1 (RP02)
acpiprt3 at acpi0: bus -1 (RP03)
acpiprt4 at acpi0: bus -1 (RP04)
acpiprt5 at acpi0: bus -1 (RP05)
acpiprt6 at acpi0: bus -1 (RP06)
acpiprt7 at acpi0: bus -1 (RP07)
acpiprt8 at acpi0: bus -1 (RP08)
acpiprt9 at acpi0: bus -1 (RP09)
acpiprt10 at acpi0: bus -1 (RP10)
acpiprt11 at acpi0: bus -1 (RP11)
acpiprt12 at acpi0: bus -1 (RP12)
acpiprt13 at acpi0: bus -1 (RP13)
acpiprt14 at acpi0: bus -1 (RP14)
acpiprt15 at acpi0: bus -1 (RP15)
acpiprt16 at acpi0: bus -1 (RP16)
acpiprt17 at acpi0: bus -1 (RP17)
acpiprt18 at acpi0: bus -1 (RP18)
acpiprt19 at acpi0: bus -1 (RP19)
acpiprt20 at acpi0: bus -1 (RP20)
acpiprt21 at acpi0: bus -1 (RP21)
acpiprt22 at acpi0: bus -1 (RP22)
acpiprt23 at acpi0: bus -1 (RP23)
acpiprt24 at acpi0: bus -1 (RP24)
acpiec0 at acpi0: not present
acpiec1 at acpi0
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
acpipci0 at acpi0 PCI0: 0x00000000 0x00000011 0x00000001
"PNP0A06" at acpi0 not configured
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: PWRB
"PNP0C14" at acpi0 not configured
tpm0 at acpi0 TPM_ 2.0 (TIS) addr 0xfed40000/0x5000, device 0x001b15d1 rev
0x10
acpicpu0 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: WRST
acpipwrres1 at acpi0: WRST
acpipwrres2 at acpi0: WRST
acpipwrres3 at acpi0: WRST
acpipwrres4 at acpi0: WRST
acpipwrres5 at acpi0: WRST
acpipwrres6 at acpi0: WRST
acpipwrres7 at acpi0: WRST
acpipwrres8 at acpi0: WRST
acpipwrres9 at acpi0: WRST
acpipwrres10 at acpi0: WRST
acpipwrres11 at acpi0: WRST
acpipwrres12 at acpi0: WRST
acpipwrres13 at acpi0: WRST
acpipwrres14 at acpi0: WRST
acpipwrres15 at acpi0: WRST
acpipwrres16 at acpi0: WRST
acpipwrres17 at acpi0: WRST
acpipwrres18 at acpi0: WRST
acpipwrres19 at acpi0: WRST
acpipwrres20 at acpi0: WRST
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD2F
cpu0: using VERW MDS workaround (except on vmm entry)
cpu0: Enhanced SpeedStep 3392 MHz: speeds: 3401, 3400, 3200, 3000, 2800,
2700, 2500, 2300, 2100, 1900, 1700, 1500, 1400, 1200, 1000, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 7G Host" rev 0x05
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 630" rev 0x04
drm0 at inteldrm0
inteldrm0: msi, KABYLAKE, gen 9
xhci0 at pci0 dev 20 function 0 "Intel 200 Series xHCI" rev 0x00: msi, xHCI
1.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev
3.00/1.00 addr 1
"Intel 200 Series Thermal" rev 0x00 at pci0 dev 20 function 2 not configured
"Intel 200 Series MEI" rev 0x00 at pci0 dev 22 function 0 not configured
puc0 at pci0 dev 22 function 3 "Intel 200 Series KT" rev 0x00: ports: 16 com
com4 at puc0 port 0 apic 2 int 19: ns16550a, 16 byte fifo
ahci0 at pci0 dev 23 function 0 "Intel 200 Series AHCI" rev 0x00: msi, AHCI
1.3.1
ahci0: port 0: 6.0Gb/s
ahci0: port 1: 1.5Gb/s
ahci0: PHY offline on port 2
ahci0: PHY offline on port 3
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, MTFDDAK256TBN-1A, HPC>
naa.500a075119b4c942
sd0: 244198MB, 512 bytes/sector, 500118192 sectors, thin
cd0 at scsibus1 targ 1 lun 0: <hp HLDS, DVDRW GUD1N, LD02> removable
pcib0 at pci0 dev 31 function 0 "Intel Q270 LPC" rev 0x00
"Intel 200 Series PMC" rev 0x00 at pci0 dev 31 function 2 not configured
azalia0 at pci0 dev 31 function 3 "Intel 200 Series HD Audio" rev 0x00: msi
azalia0: codecs: Conexant/0x5098, Intel/0x280b, using Conexant/0x5098
audio0 at azalia0
ichiic0 at pci0 dev 31 function 4 "Intel 200 Series SMBus" rev 0x00: apic 2
int 16
iic0 at ichiic0
em0 at pci0 dev 31 function 6 "Intel I219-LM" rev 0x00: msi, address
18:60:24:ef:ec:47
isa0 at pcib0
isadma0 at isa0
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
vmm0 at mainbus0: VMX/EPT
uhub1 at uhub0 port 3 configuration 1 interface 0 "GenesysLogic USB2.1 Hub"
rev 2.10/6.56 addr 2
uhidev0 at uhub1 port 1 configuration 1 interface 0 "INSTANT USB GAMING
MOUSE" rev 1.10/1.00 addr 3
uhidev0: iclass 3/1, 1 report id
ums0 at uhidev0 reportid 1: 5 buttons, Z dir
wsmouse0 at ums0 mux 0
uhidev1 at uhub1 port 1 configuration 1 interface 1 "INSTANT USB GAMING
MOUSE" rev 1.10/1.00 addr 3
uhidev1: iclass 3/0, 8 report ids
ucc0 at uhidev1 reportid 2: 669 usages, 20 keys, array
wskbd1 at ucc0 mux 1
ukbd0 at uhidev1 reportid 3: 8 variable keys, 6 key codes
wskbd2 at ukbd0 mux 1
uhid0 at uhidev1 reportid 6: input=2, output=0, feature=0
uhid1 at uhidev1 reportid 7: input=0, output=0, feature=7
uhid2 at uhidev1 reportid 8: input=1, output=0, feature=0
uhidev2 at uhub1 port 2 configuration 1 interface 0 "vendor 0x2a7a CASUE
USB KB" rev 1.10/0.01 addr 4
uhidev2: iclass 3/1
ukbd1 at uhidev2: 8 variable keys, 6 key codes
wskbd3 at ukbd1 mux 1
uhidev3 at uhub1 port 2 configuration 1 interface 1 "vendor 0x2a7a CASUE
USB KB" rev 1.10/0.01 addr 4
uhidev3: iclass 3/0, 6 report ids
uhid3 at uhidev3 reportid 1: input=1, output=0, feature=0
ucc1 at uhidev3 reportid 2: 18 usages, 13 keys, enum
wskbd4 at ucc1 mux 1
uhid4 at uhidev3 reportid 3: input=1, output=0, feature=0
ukbd2 at uhidev3 reportid 4: 48 variable keys, 0 key codes
wskbd5 at ukbd2 mux 1
ukbd3 at uhidev3 reportid 5: 56 variable keys, 0 key codes
wskbd6 at ukbd3 mux 1
ukbd4 at uhidev3 reportid 6: 56 variable keys, 0 key codes
wskbd7 at ukbd4 mux 1
uhub2 at uhub0 port 19 configuration 1 interface 0 "GenesysLogic USB3.1
Hub" rev 3.20/6.56 addr 5
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (bb3d0998775ad716.a) swap on sd0b dump on sd0b
drm:pid0:intel_ddi_sanitize_encoder_pll_mapping *NOTICE* [drm]
[ENCODER:94:DDI B/PHY B] is disabled/in DSI mode with an ungated DDI clock,
gate it
drm:pid0:intel_ddi_sanitize_encoder_pll_mapping *NOTICE* [drm]
[ENCODER:119:DDI D/PHY D] is disabled/in DSI mode with an ungated DDI
clock, gate it
inteldrm0: 1920x1200, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wskbd2: connecting to wsdisplay0
wskbd3: connecting to wsdisplay0
wskbd4: connecting to wsdisplay0
wskbd5: connecting to wsdisplay0
wskbd6: connecting to wsdisplay0
wskbd7: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)

usbdevs:
Controller /dev/usb0:
addr 01: 8086:0000 Intel, xHCI root hub
         super speed, self powered, config 1, rev 1.00
         driver: uhub0
addr 02: 05e3:0626 GenesysLogic, USB3.1 Hub
         super speed, self powered, config 1, rev 6.56
         driver: uhub1
addr 03: 05e3:0610 GenesysLogic, USB2.1 Hub
         high speed, self powered, config 1, rev 6.56
         driver: uhub2
addr 04: 30fa:1701 INSTANT, USB GAMING MOUSE
         low speed, power 100 mA, config 1, rev 1.00
         driver: uhidev0
         driver: uhidev1
addr 05: 2a7a:8927 vendor 0x2a7a, CASUE USB KB
         low speed, power 300 mA, config 1, rev 0.01
         driver: uhidev2
         driver: uhidev3

Reply via email to