Skip to content

Releases

GKMD 4.12.0

Choose a tag to compare

@4zyz4 4zyz4 released this 05 Dec 08:04

v4.12.0 — 2026-12-05 — In-box usbip-win2 driver, root-hub filter, and transport management API

English | 简体中文

GKMD 4.12.0 removes the vendor installer from the Windows transport path and
adds the root-hub filter that DualSense audio needs, together with managed and
C APIs to inspect, install, upgrade and uninstall the transport.

Highlights

  • In-box usbip-win2 host controller — the Windows build embeds the signed
    usbip2_ude.inf / .sys / .cat package under Resources/usbip/ instead of
    the 25 MB Inno installer. InstallUsbipBackend stages the package, registers
    ROOT\USBIP_WIN2\UDE with SetupDi and installs it through
    UpdateDriverForPlugAndPlayDevices(INSTALLFLAG_FORCE). The vendor installer,
    its Apps entry and its extension INF are never run or installed.
  • Root-hub filter for DualSense audio — usbip2_filter.sys runs as
    GKMDUsbipFilter on GKMD's own host controller root hub only. It answers
    usbaudio.sys's QueryBusTime, so a shared-mode render keeps its 10 ms
    speaker periods instead of taking them in 20 ms pairs, and it forwards
    select-configuration, select-interface and pipe-reset to the host controller.
    The hub is restarted for the filter only while it carries no device, under a
    cross-process gate shared with VhciClient.Attach. The vendor extension INF,
    which would add the filter to every USB 3 root hub, is never installed.
  • Transport management API — GKContext.GetUsbipBackendStatus() reports
    presence, IOCTL ABI (0.9.8.1 / 0.9.8.0 / 0.9.7.x / in-kernel), pinned
    package, NeedsUpgrade, pending reboot and root-hub filter state.
    InstallUsbipBackend() installs or repairs; UpgradeUsbipBackend() moves a
    supported older usbip-win2 to the pinned 0.9.8.1; UninstallUsbipBackend(force)
    removes only what GKMD installed: its filter, the devnode it registered, the
    package it added, the staged files and the install record.
  • Old releases stay usable — 0.9.7.x and 0.9.8.0 are still auto-detected and
    can create controllers. The upgrade is explicit and optional; it is what
    enables the pinned driver and the root-hub filter. An upgrade or uninstall
    refuses while devices are attached, unless force is passed.
  • Smaller Windows build — the x64 NativeAOT DLL drops from 29,291,520 to
    4,770,304 bytes and the x64 zip from 26,806,626 to 2,208,634 bytes.
  • Leftover controllers recovered — a machine with several driverless
    ROOT\USB usbip-win2 devnodes (interrupted installs or an old vendor node)
    now keeps one and removes the rest before installing, instead of refusing to
    install a driver on several at once.

Artifacts

File Size Notes
GKMD-v4.12.0-windows-x64.zip 2,208,634 bytes Windows x64: GKMD.dll (4,770,304 bytes, NativeAOT PE, embeds usbip2_ude + usbip2_filter.sys), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.12.0-windows-arm64.zip 2,107,540 bytes Windows ARM64: GKMD.dll (4,884,992 bytes, NativeAOT PE, embeds usbip2_ude + usbip2_filter.sys), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.12.0-linux-x64.zip 1,709,311 bytes Linux x64: libGKMD.so (3,440,336 bytes, NativeAOT ELF, no driver payload), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.12.0-linux-arm64.zip 1,635,498 bytes Linux ARM64: libGKMD.so (3,571,344 bytes, NativeAOT ELF, no driver payload), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt

SHA-256:

  • GKMD-v4.12.0-windows-x64.zip: 1A19F981026759CF2BEFADDA3C9C1C9A8ECF51997BFCD8FFA859572216FC9EFE
  • GKMD-v4.12.0-windows-arm64.zip: 0EC9F8537F325EE62B8584EF171DAB7FFEF39ECABB04BED68A0FCB974A214246
  • GKMD-v4.12.0-linux-x64.zip: A2AC08E5E0680A30A7860073148CA950E0AED06E7D6384DD8291CD774CF46AB0
  • GKMD-v4.12.0-linux-arm64.zip: 66BF4E05DC848388A71BDC820102365D2F5CD623C57182C92E3BDB491BCFAF90

Build / verify

dotnet build -c Release for both net10.0-windows and net10.0, and all four
PackageRelease builds, compile with 0 warnings and 0 errors. The Windows
packages were built on Windows (x64 and ARM64); the Linux packages on WSL
Ubuntu. A Windows Sandbox clean run installed the transport, loaded
GKMDUsbipFilter, attached a DualSense (including its MEDIA audio interface),
ran UpgradeUsbipBackend, removed everything with UninstallUsbipBackend, and
installed again. The native ABI's gkmd_context_backend_status /
gkmd_context_uninstall_backend path was exercised in the same sandbox;
gkmd_version returns 4.12.0.

Notes

  • A direct install, upgrade or uninstall needs an elevated process. The old
    vendor installer raised UAC itself; the SDK now reports the requirement.
  • The filter is attached only when the host controller runs the pinned 0.9.8.1
    package. Older supported releases still create controllers but keep the
    filter unavailable until upgraded.
  • On Linux, uninstall throws: vhci_hcd is the running kernel's module and is
    shared with every other USB/IP user. Use sudo rmmod vhci_hcd only when no
    USB/IP device is in use.

v4.12.0 — 2026-12-05 — 内嵌 usbip-win2 驱动、root-hub filter 与传输管理 API

GKMD 4.12.0 从 Windows 传输路径中去掉了厂商安装器,并加入 DualSense 音频所需的
root-hub filter;同时提供托管 API 与 C ABI,用于查询、安装、升级和卸载传输。

主要改动

  • 内嵌 usbip-win2 主机控制器 —— Windows 构建不再带 25 MB 的 Inno 安装器,
    改为在 Resources/usbip/ 下嵌入签名的 usbip2_ude.inf / .sys / .cat。
    InstallUsbipBackend 暂存这些文件,用 SetupDi 注册 ROOT\USBIP_WIN2\UDE,
    再通过 UpdateDriverForPlugAndPlayDevices(INSTALLFLAG_FORCE) 安装。厂商安装器、
    它的 Apps 卸载项和扩展 INF 都不会被运行或安装。
  • DualSense 音频所需的 root-hub filter —— usbip2_filter.sys 以
    GKMDUsbipFilter 服务只运行在 GKMD 自己的 host controller root hub 上。它替
    usbaudio.sys 回答 QueryBusTime,让共享模式播放保持 10 ms 的扬声器周期,
    而不是按 20 ms 成对提交;同时把 select-configuration、select-interface 和
    pipe-reset 转给 host controller。只有 hub 上没有设备时才为加载 filter 重启它,
    并持有与 VhciClient.Attach 共享的跨进程门。会给所有 USB 3 root hub 加 filter
    的厂商扩展 INF 从不安装。
  • 传输管理 API —— GKContext.GetUsbipBackendStatus() 报告是否存在、IOCTL
    ABI(0.9.8.1 / 0.9.8.0 / 0.9.7.x / in-kernel)、是否 pinned、
    NeedsUpgrade、是否需重启和 root-hub filter 状态。InstallUsbipBackend()
    负责安装或修复;UpgradeUsbipBackend() 把受支持的旧版 usbip-win2 升到 pinned
    0.9.8.1;UninstallUsbipBackend(force) 只移除 GKMD 自己装的东西:filter、
    注册的 devnode、它添加的驱动包、暂存文件和安装记录。
  • 旧版仍可用 —— 0.9.7.x 与 0.9.8.0 仍会被自动探测并能创建控制器;升级是显式、
    可选的,只用于启用 pinned 驱动和 root-hub filter。还有设备 attach 时,升级或
    卸载会拒绝执行,除非传 force。
  • Windows 产物显著变小 —— x64 NativeAOT DLL 从 29,291,520 字节降到
    4,770,304 字节,x64 zip 从 26,806,626 字节降到 2,208,634 字节。
  • 遗留控制器可自动恢复 —— 机器上存在多个无驱动的 ROOT\USB
    usbip-win2 devnode(中断的安装或旧版厂商节点)时,会保留一个并删除其余
    节点后再安装驱动,不再直接拒绝。

构建产物

文件 大小 说明
GKMD-v4.12.0-windows-x64.zip 2,208,634 字节 Windows x64:GKMD.dll(4,770,304 字节,NativeAOT PE,内嵌 usbip2_ude + usbip2_filter.sys)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt
GKMD-v4.12.0-windows-arm64.zip 2,107,540 字节 Windows ARM64:GKMD.dll(4,884,992 字节,NativeAOT PE,内嵌 usbip2_ude + usbip2_filter.sys)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt
GKMD-v4.12.0-linux-x64.zip 1,709,311 字节 Linux x64:libGKMD.so(3,440,336 字节,NativeAOT ELF,无驱动载荷)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt
GKMD-v4.12.0-linux-arm64.zip 1,635,498 字节 Linux ARM64:libGKMD.so(3,571,344 字节,NativeAOT ELF,无驱动载荷)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt

SHA-256:

  • GKMD-v4.12.0-windows-x64.zip:1A19F981026759CF2BEFADDA3C9C1C9A8ECF51997BFCD8FFA859572216FC9EFE
  • GKMD-v4.12.0-windows-arm64.zip:0EC9F8537F325EE62B8584EF171DAB7FFEF39ECABB04BED68A0FCB974A214246
  • GKMD-v4.12.0-linux-x64.zip:A2AC08E5E0680A30A7860073148CA950E0AED06E7D6384DD8291CD774CF46AB0
  • GKMD-v4.12.0-linux-arm64.zip:66BF4E05DC848388A71BDC820102365D2F5CD623C57182C92E3BDB491BCFAF90

构建 / 验证

两个 TFM(net10.0-windows / net10.0)以及四个 PackageRelease 构建均为
0 warning / 0 error。Windows 包在 Windows 上构建(x64 与 ARM64),Linux 包在
WSL Ubuntu 上构建。Windows Sandbox 干净安装验证了:安装传输、加载
GKMDUsbipFilter、创建 DualSense(含 MEDIA 音频接口)、执行
UpgradeUsbipBackend、用 UninstallUsbipBackend 完整移除、然后重新安装。
native ABI 的 gkmd_context_backend_status / gkmd_context_uninstall_backend
也在同一 Sandbox 中验证;gkmd_version 返回 4.12.0。

说明

  • 直接安装、升级或卸载都需要提权。旧厂商安装器会自己弹 UAC;现在由 SDK 报告该要求。
  • filter 只在 host controller 运行 pinned 0.9.8.1 包时挂载。旧版仍可创建控制器,
    但 filter 会保持不可用,直到升级。
  • Linux 上的卸载会抛异常:vhci_hcd 是运行中内核的模块,被所有 USB/IP 用户共享。
    仅在确认没有 USB/IP 设备使用时,才用 sudo rmmod vhci_hcd。

GKMD 4.11.0

Choose a tag to compare

@4zyz4 4zyz4 released this 28 Nov 05:19

v4.11.0 — 2026-11-28 — HIDMaestro 2.2.0–2.4.1 USB/IP sync and digitizer profiles

English | 简体中文

GKMD 4.11.0 syncs the USB/IP runtime work that landed in HIDMaestro 2.2.0
through 2.4.1 and applies to GKMD's pure USB/IP backend. No managed API or
C ABI function changed.

Highlights

  • Connection-table lookups retry — a lookup that finds no owner reads the
    table up to three times, with spare room doubling from 64 to 8192 rows, so a
    table that grows or is caught mid-update no longer rejects a legitimate
    host-controller import. Two counters record how single reads fail.
  • Attaches held by killed programs are freed — before an attach, the host
    controller's connections to GKMD ports of exited processes are ended. A
    program killed inside the import handshake used to hold the controller's
    attach path forever; the handshake now fails, the request returns, and the
    next attach proceeds.
  • Liveness by connect — the stale sweep no longer trusts the TCP listener
    table, which can miss another process's loopback listener. It probes every
    relevant port in parallel with SYN retransmissions off; a dead port fails in
    under a millisecond inside the one-second budget.
  • USB 2.0 port count — the create reads the count from the host
    controller's root hub, falls back to the driver's parameters rule, and
    counts only imports below SuperSpeed. A create past the limit is refused by
    name before the attach, and the attach checks again if it fails.
  • Interrupt IN answers respect the URB — every parked read keeps its
    TransferBufferLength, and the pump, protocol replies and queued-frame
    answers send no more bytes than it asked for.
  • Extended frames must match the declared report — a HID device sends an
    extended frame only at the declared length of the report it names; other
    frames are dropped and the last report keeps serving reads and
    GET_REPORT(Input).
  • No-ID output reports — a descriptor with no Report ID items publishes
    report ID 0 and the data whole on interrupt OUT and SET_REPORT, matching
    what the UMDF2 driver gives the output ring. Keyboards, mice and the raw
    Xbox 360 output are affected.
  • Precision touchpad, touchscreen and pen — three new built-in personas,
    precision-touchpad (5 contacts), touchscreen (10 contacts) and pen.
    HidDescriptorBuilder emits their descriptors and feature answers,
    including the touchpad's 257-byte certification report; SubmitTouch and
    SubmitPen pack the reports, and TouchDeviceMode exposes the mode
    Windows writes. Windows enumerates them as "HID-compliant touch pad",
    "HID-compliant touch screen" and "HID-compliant pen", and wrote Device
    Mode 3 / 2 for the first two in a live run.
  • 1024-byte input lane — the extended lane grows from 80 to 1024 bytes,
    so a 10-contact touchscreen report (104 bytes) and a 257-byte feature
    answer fit whole. Multi-report touch submits are handed to the pump one at
    a time through an in-process input-read event.

Artifacts

File Size Notes
GKMD-v4.11.0-windows-x64.zip 26,806,626 bytes Windows x64: GKMD.dll (29,291,520 bytes, NativeAOT PE, embeds USBip-0.9.8.1-x64.exe), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.11.0-windows-arm64.zip 19,663,217 bytes Windows ARM64: GKMD.dll (22,362,624 bytes, NativeAOT PE, embeds USBip-0.9.8.1-arm64.exe), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.11.0-linux-x64.zip 1,706,589 bytes Linux x64: libGKMD.so (3,440,288 bytes, NativeAOT ELF, no installer payload), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.11.0-linux-arm64.zip 1,633,379 bytes Linux ARM64: libGKMD.so (3,571,288 bytes, NativeAOT ELF, no installer payload), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt

SHA-256:

  • GKMD-v4.11.0-windows-x64.zip: 3CCDBF773084C1211FB3B4FDFAA5390F5EC0DD5C914595C1E2702F29F2ADB3E8
  • GKMD-v4.11.0-windows-arm64.zip: 7807E50897F60A50F1C074898F1050E3E81EEF051F7E107F911B31336876C9B6
  • GKMD-v4.11.0-linux-x64.zip: 640587102533F4C6B84E19CF07B6993EFEA80A4CD5BC408C294F2891CFDBBDC7
  • GKMD-v4.11.0-linux-arm64.zip: DBA9E1D7F47FFF085D21BEAC4F99B5207E1B2D97F6D127BDDC859DB360FB27D6

Build / verify

dotnet build -c Debug and the Windows (net10.0-windows) and Linux
(net10.0) targets both compile with 0 warnings and 0 errors. The Linux
packages were built on WSL Ubuntu; the Windows packages on Windows.

A live Windows run created the three digitizer personas, and Windows
enumerated them as “HID-compliant touch pad”, “HID-compliant touch screen”
and “HID-compliant pen”; it wrote Device Mode 3 for the touchpad and 2 for
the touchscreen.

v4.11.0 — 2026-11-28 — 同步 HIDMaestro 2.2.0–2.4.1 并新增触控板、触屏与笔

English | 简体中文

GKMD 4.11.0 同步 HIDMaestro 2.2.0 至 2.4.1 中适用于 GKMD 纯 USB/IP 后端的运行时改动,
并新增精确触控板、触屏与笔三种 digitizer persona。
托管 API 与 C ABI 函数均未改变。

主要改动

  • 连接表查找重试 — 找不到 owner 时最多重读三次,备用空间从 64 行逐次翻倍到 8192 行;
    表在增长或更新中的短暂不一致不再拒绝合法的 host controller import。另记录两种单次读取失败的计数。
  • 被终止程序的 attach 不再永久占住 — attach 前结束 host controller 与已退出 GKMD 进程之间仍存在的连接。
    被杀死在 import 握手内的程序原本会永久占住 attach 路径;现在握手失败、请求返回,后续 attach 正常进行。
  • 按 connect 判断存活 — 死服务清扫不再信任 TCP listener 表(它可能漏掉其它进程的 loopback listener)。
    改为并行 connect 所有相关端口并关闭 SYN 重传;死端口在 1 秒预算内以毫秒级失败。
  • USB 2.0 端口计数 — 从 host controller 根集线器读取端口数,根集线器不回答时回退到驱动参数规则;
    只统计低于 SuperSpeed 的 import。端口已满时 create 在 attach 前按名称拒绝,attach 失败时再检查一次。
  • 中断 IN 应答遵守 URB 长度 — 每个挂起的读取记住自己的 TransferBufferLength;
    输入泵、协议应答与排队帧应答都不发送超过该长度的字节。
  • 扩展帧必须匹配声明的报文 — HID 设备只发送与所声明报文长度一致的扩展帧;
    其它帧被丢弃,最后一份报文继续服务读取与 GET_REPORT(Input)。
  • 无 Report ID 的输出报文 — 描述符没有 Report ID 项时,interrupt OUT 与 SET_REPORT
    发布 report ID 0 和完整数据,与 UMDF2 驱动写入输出 ring 的内容一致;涉及键盘、鼠标与原始 Xbox 360 输出。
  • 精确触控板、触屏与笔 — 新增 precision-touchpad(5 指)、touchscreen(10 指)与 pen
    三个内建 persona。HidDescriptorBuilder 生成它们的描述符与 feature 应答(含触控板 257 字节认证报告);
    SubmitTouch / SubmitPen 负责打包,TouchDeviceMode 暴露 Windows 写入的模式。Windows 将其识别为
    “HID-compliant touch pad”、“HID-compliant touch screen”与“HID-compliant pen”,实测前两者分别被写入
    Device Mode 3 与 2。
  • 1024 字节输入通道 — 扩展通道从 80 字节扩到 1024 字节,完整承载 10 指触屏的 104 字节报文与
    257 字节 feature 应答。多帧 touch 提交通过进程内 input-read 事件逐帧交给输入泵。

构建产物

文件 大小 说明
GKMD-v4.11.0-windows-x64.zip 26,806,626 字节 Windows x64:GKMD.dll(29,291,520 字节,NativeAOT PE,内嵌 USBip-0.9.8.1-x64.exe)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt
GKMD-v4.11.0-windows-arm64.zip 19,663,217 字节 Windows ARM64:GKMD.dll(22,362,624 字节,NativeAOT PE,内嵌 USBip-0.9.8.1-arm64.exe)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt
GKMD-v4.11.0-linux-x64.zip 1,706,589 字节 Linux x64:libGKMD.so(3,440,288 字节,NativeAOT ELF,无安装器载荷)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt
GKMD-v4.11.0-linux-arm64.zip 1,633,379 字节 Linux ARM64:libGKMD.so(3,571,288 字节,NativeAOT ELF,无安装器载荷)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt

SHA-256:

  • GKMD-v4.11.0-windows-x64.zip:3CCDBF773084C1211FB3B4FDFAA5390F5EC0DD5C914595C1E2702F29F2ADB3E8
  • GKMD-v4.11.0-windows-arm64.zip:7807E50897F60A50F1C074898F1050E3E81EEF051F7E107F911B31336876C9B6
  • GKMD-v4.11.0-linux-x64.zip:640587102533F4C6B84E19CF07B6993EFEA80A4CD5BC408C294F2891CFDBBDC7
  • GKMD-v4.11.0-linux-arm64.zip:DBA9E1D7F47FFF085D21BEAC4F99B5207E1B2D97F6D127BDDC859DB360FB27D6

构建 / 验证

dotnet build -c Debug 的 Windows(net10.0-windows)与 Linux(net10.0)目标均以 0 警告、0 错误通过。
Linux 包在 WSL Ubuntu 上构建,Windows 包在 Windows 上构建。

在 Windows 上实测创建三种 digitizer persona,Windows 分别识别为
“HID-compliant touch pad”、“HID-compliant touch screen”与“HID-compliant pen”,
并向触控板写入 Device Mode 3、向触屏写入 2。

GKMD 4.9.1

Choose a tag to compare

@4zyz4 4zyz4 released this 14 Nov 09:58

v4.9.1 — 2026-11-14 — Switch report fixes for DirectInput and eden

English | 简体中文

GKMD 4.9.1 is a bug-fix release for the Switch Pro / Joy-Con personas. It
replaces the single report shape with per-consumer reports and fixes the axis
range, so Windows HIDClass/DirectInput and eden (SDL HIDAPI plus its own
joycon driver) both decode the pad correctly. No managed API or C ABI
function changed.

Highlights

  • 0x3F is the only standard HID gamepad — the USB HID report descriptor
    now declares report 0x3F as a 12-byte standard gamepad (16 buttons, a
    4-bit hat, X/Y/Rx/Ry) and makes 0x30 / 0x21 / 0x81 opaque 63-byte
    vendor inputs. DirectInput therefore sees a real pad before any protocol
    host connects and can no longer read the full-mode timer/battery bytes as
    buttons. The outputs 0x01 / 0x10 / 0x80 / 0x82 stay opaque.
  • 4-byte Logical Maximum — the axes now use the long form
    0x27 FF FF 00 00. A 2-byte 0x26 FF FF is sign-extended to -1 by the
    HID parser, which left DirectInput's axis range invalid and reported 0 for
    X/Y/Rx/Ry even though the buttons and hat worked.
  • One frame shape at a time — subcommand 0x03 selects the input mode:
    0x30 / 0x31 stream the 64-byte Nintendo full report, 0x3F (the
    default) streams the 12-byte simple frame. Frames of the previous shape are
    dropped when the mode flips, so eden never parses a full-mode frame as its
    "input-only" digital-stick packet and DirectInput never sees timer/battery
    bytes in a simple frame. GET_REPORT(Input) serves the latest frame of the
    requested shape.
  • Switch SubmitState packs the 48-byte body — a caller that only has
    GKGamepadState now drives the same Nintendo body path as
    SubmitRawReport: buttons, both 12-bit sticks and three IMU frames. Face
    buttons follow SDL's positional wiring (X/left, Y/top, A/bottom, B/right).
  • Optional diagnostics — setting GKMD_SWITCH_DEBUG=1 (or
    GKME_SWITCH_DEBUG=1, or placing an empty switch_debug.txt next to the
    executable) writes sampled gkme_switch.log lines: device creation, stream
    and submitted-body hex, report-mode changes and rumble decoding. Disabled,
    it costs one bool test per call site.

Artifacts

File Size Notes
GKMD-v4.9.1-windows-x64.zip 26,708,544 bytes Windows x64: GKMD.dll (29,085,184 bytes, NativeAOT PE, embeds USBip-0.9.8.1-x64.exe), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.9.1-windows-arm64.zip 19,569,077 bytes Windows ARM64: GKMD.dll (22,145,024 bytes, NativeAOT PE, embeds USBip-0.9.8.1-arm64.exe), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.9.1-linux-x64.zip 1,651,523 bytes Linux x64: libGKMD.so (3,323,776 bytes, NativeAOT ELF, no installer payload), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.9.1-linux-arm64.zip 1,580,390 bytes Linux ARM64: libGKMD.so (3,438,392 bytes, NativeAOT ELF, no installer payload), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt

SHA-256:

  • GKMD-v4.9.1-windows-x64.zip: 0C70D19CFA81CABB2BDCFA021F9AA91C3E5B8C172EAA8EA9905B2645DD3CBFE4
  • GKMD-v4.9.1-windows-arm64.zip: 28F5218BAE3524B8398008EC1E1D83F4335D8AEF9E06B2A3CED48730BB18F7D2
  • GKMD-v4.9.1-linux-x64.zip: DAEBFBFB9762B04E27E80BF2DDB287F99F1E7253DDA7FCCC1F4ECD9753D79BDB
  • GKMD-v4.9.1-linux-arm64.zip: 80EC02265E799E7512B320AF6D7B5FC462A5C53DB83F8E283F6F5F31AC63634C

Build / verify

dotnet build -c Release                          # IL + analyzers, 0 warnings
dotnet build -c Release -f net10.0-windows -t:PackageRelease -r win-x64
dotnet build -c Release -f net10.0-windows -t:PackageRelease -r win-arm64
dotnet build -c Release -f net10.0 -t:PackageRelease -r linux-x64
dotnet build -c Release -f net10.0 -t:PackageRelease -r linux-arm64

Notes

  • The wire format changed: the report descriptor is now 149 bytes (was 203)
    and the default input report before a protocol host connects is 0x3F
    (12 bytes), not 0x30 (64 bytes). Protocol hosts that send subcommand
    0x03 0x30 during init still receive the full report.
  • Consumers that reference the released native library through the gkmd_*
    C ABI need no code change.
  • Switch diagnostics remain opt-in; nothing is written to disk unless the
    environment variable or marker file is present.

v4.9.1 — 2026-11-14 — Switch 手柄在 DirectInput 与 eden 下的报文修复

English | 简体中文

GKMD 4.9.1 是 Switch Pro / Joy-Con persona 的缺陷修复版本。它把单一报文形状
拆成按消费者区分的报文,并修正轴范围,使 Windows HIDClass/DirectInput 与
eden(SDL HIDAPI 加它自带的 joycon 驱动)都能正确解析手柄。托管 API 与 C ABI
函数均未变化。

亮点

  • 0x3F 是唯一的标准 HID 手柄报文 —— USB HID 报告描述符现在把 0x3F
    声明为 12 字节标准手柄(16 个按键、4 位 hat、X/Y/Rx/Ry),并把 0x30 /
    0x21 / 0x81 改为不透明的 63 字节 vendor 输入。因此在任何协议宿主连接
    之前,DirectInput 就能看到一个真实手柄,也不会再把全量报文的 timer/battery
    字节当成按键。输出报文 0x01 / 0x10 / 0x80 / 0x82 保持不透明。
  • 4 字节 Logical Maximum —— 轴改用长格式 0x27 FF FF 00 00。2 字节的
    0x26 FF FF 会被 HID 解析器符号扩展成 -1,导致 DirectInput 的轴范围
    无效,即使按键与 hat 正常,X/Y/Rx/Ry 也恒为 0。
  • 同一时刻只发一种帧形状 —— 子命令 0x03 选择输入模式:0x30 / 0x31
    发送 64 字节 Nintendo 全量报文,0x3F(默认)发送 12 字节简单帧。模式切换
    时会丢弃旧形状的排队帧,eden 不会再把全量帧当成它的「仅输入」数字摇杆报文,
    DirectInput 也不会在简单帧里读到 timer/battery 字节。GET_REPORT(Input)
    按宿主请求的形状返回对应长度的最新帧。
  • Switch SubmitState 打包 48 字节 body —— 只有 GKGamepadState 的
    调用方现在与 SubmitRawReport 走同一条 Nintendo body 路径:按键、两个
    12 位摇杆与三帧 IMU。面键遵循 SDL 的位置映射(X/左、Y/上、A/下、B/右)。
  • 可选诊断日志 —— 设置 GKMD_SWITCH_DEBUG=1(或 GKME_SWITCH_DEBUG=1,
    或在可执行文件旁放一个空的 switch_debug.txt)会向 gkme_switch.log
    写入采样日志:设备创建、stream 与提交 body 的十六进制、报文模式切换和
    震动解码。未启用时每个调用点只花一次 bool 判断。

产物

文件 大小 说明
GKMD-v4.9.1-windows-x64.zip 26,708,544 字节 Windows x64:GKMD.dll(29,085,184 字节,NativeAOT PE,内嵌 USBip-0.9.8.1-x64.exe)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt
GKMD-v4.9.1-windows-arm64.zip 19,569,077 字节 Windows ARM64:GKMD.dll(22,145,024 字节,NativeAOT PE,内嵌 USBip-0.9.8.1-arm64.exe)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt
GKMD-v4.9.1-linux-x64.zip 1,651,523 字节 Linux x64:libGKMD.so(3,323,776 字节,NativeAOT ELF,无安装器载荷)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt
GKMD-v4.9.1-linux-arm64.zip 1,580,390 字节 Linux ARM64:libGKMD.so(3,438,392 字节,NativeAOT ELF,无安装器载荷)、gkmd.h、LICENSE、THIRD-PARTY-NOTICES.txt

SHA-256:

  • GKMD-v4.9.1-windows-x64.zip:0C70D19CFA81CABB2BDCFA021F9AA91C3E5B8C172EAA8EA9905B2645DD3CBFE4
  • GKMD-v4.9.1-windows-arm64.zip:28F5218BAE3524B8398008EC1E1D83F4335D8AEF9E06B2A3CED48730BB18F7D2
  • GKMD-v4.9.1-linux-x64.zip:DAEBFBFB9762B04E27E80BF2DDB287F99F1E7253DDA7FCCC1F4ECD9753D79BDB
  • GKMD-v4.9.1-linux-arm64.zip:80EC02265E799E7512B320AF6D7B5FC462A5C53DB83F8E283F6F5F31AC63634C

构建 / 验证

dotnet build -c Release                          # IL + 分析器,0 警告
dotnet build -c Release -f net10.0-windows -t:PackageRelease -r win-x64
dotnet build -c Release -f net10.0-windows -t:PackageRelease -r win-arm64
dotnet build -c Release -f net10.0 -t:PackageRelease -r linux-x64
dotnet build -c Release -f net10.0 -t:PackageRelease -r linux-arm64

说明

  • 线上格式已改变:报告描述符现在是 149 字节(原为 203 字节),协议宿主连接
    前的默认输入报文是 0x3F(12 字节),不再是 0x30(64 字节)。在初始化
    时发送子命令 0x03 0x30 的协议宿主仍会收到全量报文。
  • 通过 gkmd_* C ABI 引用发布产物的使用者无需改动代码。
  • Switch 诊断日志仍为显式开启;没有环境变量或标记文件时不会写任何文件。

GKMD 4.9.0

Choose a tag to compare

@4zyz4 4zyz4 released this 01 Nov 03:44

v4.9.0 — 2026-11-01 — NativeAOT distribution, Linux support and Windows on Arm

English | 简体中文

GKMD 4.9.0 changes the distribution form to NativeAOT and adds Linux
support and Windows on Arm. Every released artifact is now a native shared
library exporting the gkmd_* C ABI:

Platform Artifact
Windows x64 / ARM64 GKMD.dll (native PE)
Linux x64 / ARM64 libGKMD.so (native ELF)

The managed assembly is no longer a distributable form. GKME compiles the
GKMD sources into its own AOT image; other callers use the C ABI in
gkmd.h.

Highlights

NativeAOT and the C ABI

  • PublishAot by default — GKMD.csproj sets <PublishAot>true</PublishAot>.
    Because the project is OutputType=Library, the SDK emits a shared library
    (NativeLib=Shared) and exports every [UnmanagedCallersOnly] entry point.
  • 19 gkmd_* functions — version/error, context lifecycle, profile
    enumeration by index, controller creation/destruction, SubmitGamepad,
    SubmitRawReport, and an output callback. The full contract is in
    Native/gkmd.h, shipped in every zip.
  • Blittable boundary — GkmdGamepadState / GkmdAxisValue mirror
    GKGamepadState; strings are UTF-8; managed objects are opaque void*
    handles. No CLR marshalling and no managed assembly are involved.
  • Resources survive AOT — the embedded usbip-win2 installer is still a
    manifest resource after publishing; the x64 build carries the x64 asset and
    the ARM64 build the ARM64 asset.
  • GKME source integration — GKME.csproj now uses
    <Compile Include="..\GKMD\**\*.cs" ...> plus the embedded payload instead
    of ProjectReference. The resulting AOT image behaves the same.

Linux (in-kernel vhci_hcd)

  • Managed attach through sysfs — VhciClient.Linux.cs connects to the
    in-process server, performs the OP_REQ_IMPORT handshake itself, and hands
    the connected socket to the kernel by writing port sockfd devid speed to
    /sys/devices/platform/vhci_hcd.0/attach. Detach, status and the
    /var/run/vhci_hcd/port<N> location records match the usbip tool, so
    location-based detach and the stale sweep work unchanged.
  • modprobe replaces the installer — UsbipDriverInstaller.Linux.cs
    keeps the same API. EnsureInstalled only probes and throws
    UsbipInstallRequiredException when vhci_hcd is absent; Install runs
    modprobe vhci-hcd directly when root and through pkexec for an
    interactive, non-root install.
  • uid-based admission — TcpConnectionOwner.Linux.cs reads the peer's uid
    from /proc/net/tcp and the server admits root or this process's own uid.
  • Asynchronous detach — detach waits (bounded) for the port to report
    VDEV_ST_NULL (4) instead of expecting a synchronous ioctl.
  • Port 0 is a real port — Linux's global vhci numbering starts at 0
    (Windows starts at 1), so VhciClient.Detach treats only a negative value
    as "every port", and FindLocation returns -1 when nothing matches.
  • Verified on WSL2 — the managed backend was verified against
    6.6.87.2-microsoft-standard-WSL2 (DualShock 4 and Switch Pro enumerated,
    usbhid bound HID, evdev produced events, detach returned every port to
    VDEV_ST_NULL, concurrent attaches used ports 0 and 1). The NativeAOT
    libGKMD.so was loaded through ctypes and enumerated all 10 profiles.

Windows on Arm

  • ARM64 payload — Resources/USBip-0.9.8.1-arm64.exe is the upstream
    release asset, unmodified (19,060,408 bytes, SHA-256
    CAB7FF97F79275EEB5C5B8BB2EB3111FF6B6C4EEAD07D9BEC9BE5BD1E3A35800). Like the
    x64 asset it is a 32-bit Inno Setup binary; what differs is the driver
    package it carries (ARM64 usbip2_ude.sys).
  • One payload per build — UsbipPayloadArch follows RuntimeIdentifier
    when one is given and defaults to x64. Any other value fails the build.
  • OS-architecture selection — at run time UsbipDriverInstaller chooses
    by RuntimeInformation.OSArchitecture, not the process architecture: an
    x64 host process under emulation on Windows on Arm still installs the ARM64
    driver, the only kind ARM64 Windows loads.
  • vHCI layouts unchanged — the IOCTL structs contain no pointer-sized
    fields, so the 0.9.8.1 ARM64 driver speaks the same
    0.9.8.1 / 0.9.8.0 / 0.9.7.x request layouts and the existing probe
    discovers the installed one.

Breaking changes

  • The release zip no longer contains a managed GKMD.dll; it contains a
    native library. Existing ProjectReference consumers must either include
    the sources (as GKME does) or call the gkmd_* C ABI.
  • The managed API itself is unchanged for source consumers.
  • The version stays 4.9.0; this is a distribution-form change, not a new
    feature line.

Artifacts

File Size Notes
GKMD-v4.9.0-windows-x64.zip 26,701,763 bytes Windows x64: GKMD.dll (29,062,144 bytes, NativeAOT PE, embeds USBip-0.9.8.1-x64.exe), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.9.0-windows-arm64.zip 19,559,613 bytes Windows ARM64: GKMD.dll (22,118,912 bytes, NativeAOT PE, embeds USBip-0.9.8.1-arm64.exe), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.9.0-linux-x64.zip 1,639,308 bytes Linux x64: libGKMD.so (3,303,216 bytes, NativeAOT ELF, no installer payload), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt
GKMD-v4.9.0-linux-arm64.zip 1,569,281 bytes Linux ARM64: libGKMD.so (3,438,320 bytes, NativeAOT ELF, no installer payload), gkmd.h, LICENSE, THIRD-PARTY-NOTICES.txt

SHA-256:

  • GKMD-v4.9.0-windows-x64.zip: C6D3FF0BE08FC919E2ED021AD699A84C397B456A7696675739B7B439D6195CD7
  • GKMD-v4.9.0-windows-arm64.zip: 127FD73105505D520B00D1A1B32E50CD181F260E07BE93798F85759A21134925
  • GKMD-v4.9.0-linux-x64.zip: 473814E1EE225E43BA3762E881AE6EDB6CBFF2FF173416F499C584E7642ADB8A
  • GKMD-v4.9.0-linux-arm64.zip: D3DEC59057E88ADD5558A96F2BAA914263B94F4D15E27A4C730C1150D6AD13E5

Build / verify

dotnet build -c Release                          # IL + analyzers, 0 warnings
dotnet build -c Release -f net10.0-windows -t:PackageRelease -r win-x64
dotnet build -c Release -f net10.0-windows -t:PackageRelease -r win-arm64
dotnet build -c Release -f net10.0 -t:PackageRelease -r linux-x64
dotnet build -c Release -f net10.0 -t:PackageRelease -r linux-arm64

Cross-compilation constraints: NativeAOT cannot cross operating systems, so
the Linux RIDs are built on Linux (for example WSL). Windows ARM64 needs the
MSVC ARM64/ARM64EC build tools component; on VS 2026 its ID follows the
toolset version (for example ...VC.14.44.17.14.ARM64). If the ARM64 linker
is only in an older toolset, set PATH/LIB to that toolset and pass
-p:IlcUseEnvironmentalTools=true. Linux ARM64 on an x64 host needs
aarch64-linux-gnu-objcopy and
-p:ObjCopyName=aarch64-linux-gnu-objcopy.

Known limitations

  • Linux attach requires root; there is no unprivileged helper.
  • UsbipReceiveMode is Windows-only and ignored by the Linux build.
  • One payload per Windows build: shipping the x64 DLL on Windows on Arm, or
    the ARM64 DLL on x64, is reported at install time rather than silently
    worked around.
  • Layout (de)serialization uses reflection-based System.Text.Json; under a
    trimmed/AOT host the GKLayout* types must be preserved by the host.
  • The native ABI is new. Consumers that need the managed types must compile
    the sources, not reference the released binary.

v4.9.0 — 2026-11-01 — NativeAOT 分发、Linux 支持与 Windows on Arm

English | 简体中文

GKMD 4.9.0 把分发形态改为 NativeAOT,并加入 Linux 支持与 Windows on Arm。
每个发布产物都是导出 gkmd_* C ABI 的 native 共享库:

平台 产物
Windows x64 / ARM64 GKMD.dll(native PE)
Linux x64 / ARM64 libGKMD.so(native ELF)

managed assembly 不再是分发形态。GKME 把 GKMD 源码编译进自己的 AOT 镜像;
其他调用方使用 gkmd.h 中的 C ABI。

亮点

NativeAOT 与 C ABI

  • 默认 PublishAot —— GKMD.csproj 设置 <PublishAot>true</PublishAot>。
    工程是 OutputType=Library,SDK 因此生成共享库(NativeLib=Shared),并导出
    所有 [UnmanagedCallersOnly] 入口。
  • 19 个 gkmd_* 函数 —— 版本 / 错误、context 生命周期、按索引枚举 profile、
    controller 创建 / 销毁、SubmitGamepad、SubmitRawReport 与输出回调。完整契约
    见 Native/gkmd.h,随每个 zip 分发。
  • blittable 边界 —— GkmdGamepadState / GkmdAxisValue 对应
    GKGamepadState;字符串为 UTF-8;托管对象以不透明 void* 句柄传递。不涉及
    CLR marshalling,也不依赖 managed assembly。
  • 资源在 AOT 后保留 —— 内嵌的 usbip-win2 安装器在发布后仍是 manifest
    resource;x64 构建携带 x64 载荷,ARM64 构建携带 ARM64 载荷。
  • GKME 源码集成 —— GKME.csproj 改用
    <Compile Include="..\GKMD\**\*.cs" ...> 加内嵌载荷,不再使用
    ProjectReference;生成的 AOT 镜像行为不变。

Linux(内核 vhci_hcd)

  • 通过 sysfs 的托管 attach —— VhciClient.Linux.cs 连接进程内 server,
    自己完成 OP_REQ_IMPORT 握手,再把已连接的 socket 以
    port sockfd devid speed 写入
    /sys/devices/platform/vhci_hcd.0/attach 交给内核。detach、status 与
    /var/run/vhci_hcd/port<N> location 记录都与 usbip 工具一致。
  • 用 modprobe 取代安装器 —— UsbipDriverInstaller.Linux.cs 保持相同
    API;EnsureInstalled 只探测,vhci_hcd 缺失时抛
    UsbipInstallRequiredException;Install 在 root 下直接执行
    modprobe vhci-hcd,非 root 的交互式安装经 pkexec 提权。
  • 按 uid 准入 —— TcpConnectionOwner.Linux.cs 从 /proc/net/tcp 读取
    对端 uid,server 放行 root 或本进程自身。
  • 异步 detach —— detach 会(有界地)等待端口回到 VDEV_ST_NULL(4)。
  • 端口 0 是真实端口 —— Linux 的 vhci 全局端口号从 0 开始(Windows 从 1
    开始),因此 VhciClient.Detach 只在参数为负时表示「全部端口」,
    FindLocation 在未找到时返回 -1。
  • 已在 WSL2 上验证 —— 托管后端在
    6.6.87.2-microsoft-standard-WSL2 上完成验证(DualShock 4 与 Switch Pro
    枚举、usbhid 绑定 HID、evdev 产生事件、detach 后所有端口回到
    VDEV_ST_NULL、两个进程并发 attach 分别落在端口 0 和 1)。NativeAOT 的
    libGKMD.so 也通过 ctypes 加载并枚举出全部 10 个 profile。

Windows on Arm

  • ARM64 载荷 —— Resources/USBip-0.9.8.1-arm64.exe 是上游 release 原始
    资源,未做修改(19,060,408 字节,SHA-256
    `CAB7FF97F79275EEB5C5B8...
Read more

GKMD 4.8.0

Choose a tag to compare

@4zyz4 4zyz4 released this 31 Oct 06:42

Release notes

v4.8.0 — 2026-10-31 — HIDMaestro 2.0.x allocation-free USB/IP and submit paths

English | 简体中文

GKMD 4.8.0 takes the performance-only work issue #1 deferred: the USB/IP
transfer, frame and control paths no longer allocate per transfer, audio URBs
and frame buffers are pooled, and the input-section write and the submit paths
do less work per frame.

Highlights

  • Frames — the input pump builds each report in its own buffer; queued
    frames come from a pool and go back as soon as a read answers them or the
    queue drops them; Switch and GIP frames are built in place,
    GET_REPORT(Input) copies the latest report from under the HID lock, and a
    non-byte-aligned report field of up to 32 bits goes in with one masked
    read-modify-write instead of one pass per bit.
  • Transfers — the command reader owns a 4 KB receive buffer and reuses the
    arrays for a submit's OUT data, isochronous descriptors and packets; audio
    URBs are pooled with their packet and PCM arrays reused, and the microphone
    completion fills one buffer the engine keeps.
  • Control replies — descriptors, status, configuration, interface, UAC
    values, test-command pages, the resolution multiplier and the Sony feature
    stubs are answered from the stack or a device-owned buffer; the vendor
    request table's hex answers are decoded once at construction.
  • Submit path — WriteInputFrame stores through the section's pointer,
    takes spans, orders the seqlock with one write barrier plus a release store,
    and keeps the SetEvent doorbells out of line; SubmitRawReport writes a
    frame with no fixed bytes straight from the caller's span; SubmitState
    resolves the six simple slots only for the extended codec and the XUSB GIP
    block, letting the descriptor path read the axes itself.

Compatibility

  • No public API or profile format change; controller personas are unchanged.
  • Works against an installed usbip-win2 0.9.7.x, 0.9.8.0 or 0.9.8.1.
  • The bytes on the wire and in the shared input section are unchanged.

Artifact

File Size Notes
GKMD-v4.8.0.zip 25,427,246 bytes Contains GKMD.dll (Release build, IL, net10.0-windows, AnyCPU, embedded usbip-win2 0.9.8.1), LICENSE and THIRD-PARTY-NOTICES.txt

SHA-256: 458620BD08D48C4B3702F9298F58342585788E6E8D01354BCD03CE149306BA9E

Produced by dotnet build -c Release -t:PackageRelease; Native AOT compilation
happens in the host application (GKME), not in this library.

Known limitations

  • The bundled usbip-win2 payload is x64-only.
  • Windows only (net10.0-windows).
  • Layout (de)serialization uses reflection-based System.Text.Json; under a
    trimmed/AOT host the GKLayout* types must be preserved by the host.
  • Owner records and transport-index leases, direct usbip-win2 host-controller
    installation and ARM64 payloads from 2.0.x remain unsynced (not applicable to
    GKMD's transport).

v4.8.0 — 2026-10-31 — 同步 HIDMaestro 2.0.x 零分配 USB/IP 与 submit 路径

English | 简体中文

GKMD 4.8.0 接过 issue #1 中暂缓的纯性能工作:USB/IP 的传输、帧与 control
路径不再逐次分配,audio URB 与帧缓冲改为池化,输入 section 的写入与 submit
路径每帧做的工作也更少。

亮点

  • 帧 — 输入泵在自己的缓冲里构建每一份报文;排队帧来自缓冲池,被读取应答
    或队列淘汰后立即归还;Switch 与 GIP 帧就地构建;GET_REPORT(Input) 在 HID
    锁内复制最新报文;不足一字节对齐、最多 32 位的报文字段改为一次掩码读改写,
    而不是逐位循环。
  • 传输 — 命令 reader 自带 4 KB 接收缓冲,并复用 OUT 数据、等时描述符与包
    数组;audio URB 池化,包与 PCM 数组复用;麦克风完成时填充引擎保留的一个
    缓冲。
  • control 应答 — 描述符、状态、配置、接口、UAC 值、test command 分页、
    resolution multiplier 与 Sony feature stub 均从栈或设备自有缓冲发出;vendor
    请求表的十六进制应答在构造时解码一次。
  • submit 路径 — WriteInputFrame 通过 section 指针写入、接受 span,seqlock
    只用一个 write barrier 加一次 release store,SetEvent 门铃移出内联;
    SubmitRawReport 对没有固定字节的帧直接从调用方 span 写入;SubmitState
    只在扩展 codec 与 XUSB GIP 块真正使用时才解析六个 simple slot,描述符路径由
    BuildReportInto 自己读取轴值。

兼容性

  • 无公开 API 或 profile 格式变化;各手柄人格不变。
  • 兼容已安装的 usbip-win2 0.9.7.x、0.9.8.0、0.9.8.1。
  • 线上字节与共享输入 section 的字节不变。

产物

文件 大小 说明
GKMD-v4.8.0.zip 25,427,246 字节 内含 GKMD.dll(Release 构建、IL、net10.0-windows、AnyCPU,内嵌 usbip-win2 0.9.8.1)、LICENSE 与 THIRD-PARTY-NOTICES.txt

SHA-256:458620BD08D48C4B3702F9298F58342585788E6E8D01354BCD03CE149306BA9E

由 dotnet build -c Release -t:PackageRelease 生成;Native AOT 编译在宿主应用
(GKME)中完成,而非本类库。

已知限制

  • 内嵌的 usbip-win2 载荷仅支持 x64。
  • 仅支持 Windows(net10.0-windows)。
  • layout 序列化/反序列化使用基于反射的 System.Text.Json;在被裁剪的 AOT 宿主中,
    GKLayout* 类型须由宿主保留。
  • 2.0.x 的 owner record 与 transport index lease、直接安装 usbip-win2 host
    controller、ARM64 载荷仍未同步(不适用于 GKMD 的传输层)。

GKMD 4.7.0

Choose a tag to compare

@4zyz4 4zyz4 released this 24 Oct 06:13

Release notes

v4.7.0 — 2026-10-24 — HIDMaestro 2.0.3 runtime fixes

English | 简体中文

GKMD 4.7.0 syncs the USB/IP runtime fixes that landed in HIDMaestro 2.0.0–2.0.3,
gives the server its own listen-port range so GKMD and HIDMaestro can run side
by side, and fixes a bugcheck when creating an Xbox One persona.

Highlights

  • HIDMaestro 2.0.3 transport sync — Dispose wakes the input pump instead
    of waiting out its 500 ms frame wait; only the host controller's connection
    (System, PID 4, found via GetExtendedTcpTable) may import a device; a
    connection has 5 s to finish its handshake and at most 16 handshakes run at
    once; GET_REPORT(Input) STALLs a report ID the descriptor does not declare;
    the claim is identity-checked on release and teardown survives a race with
    the host's detach; detach is by location, since a vhci port may be reused;
    and audio control/stream events are raised on a dedicated thread with a
    throwing handler logged and dropped.
  • Coexistence — the server now listens on 37286..37301, clear of
    HIDMaestro's 18509..18524 / 28509..28524 and FlexInput's 18008. The
    stale sweep inspects only its own range and detaches only imports whose
    server is gone, so neither program takes the other's imports or cancels its
    re-attach attempts. When the range is full it falls back to an OS-assigned
    loopback port.
  • Xbox One persona bugcheck — the GIP metadata blob is rebuilt at 230 bytes
    from the real 214-byte gamepad metadata, appending the PC security opt-out as
    a fourth interface and recomputing the device / total / client-command
    offsets; InputReportSize is corrected from 18 to 14. The previous 182-byte
    sample metadata made xboxgip bugcheck on create.

Compatibility

  • Controller personas are unchanged (Xbox One / Series X|S, Xbox 360,
    Switch Pro / Joy-Con, DualShock 4, DualSense, wheel, keyboard, mouse).
  • Works against an installed usbip-win2 0.9.7.x, 0.9.8.0 or 0.9.8.1.
  • Runs alongside HIDMaestro 2.0.x and FlexInput; the port ranges do not overlap.

Artifact

File Size Notes
GKMD-v4.7.0.zip 25,424,258 bytes Contains GKMD.dll (Release build, IL, net10.0-windows, AnyCPU, embedded usbip-win2 0.9.8.1), LICENSE and THIRD-PARTY-NOTICES.txt

SHA-256: C223A37D51A703046AD72D07016B185FFE4A1EB18A0ABAAB7CF4451654364460

Produced by dotnet build -c Release -t:PackageRelease; Native AOT compilation
happens in the host application (GKME), not in this library.

Build / verify

dotnet build -c Release
dotnet build -c Release -t:PackageRelease
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # from a host project referencing GKMD.csproj

Known limitations

  • The bundled usbip-win2 payload is x64-only.
  • Windows only (net10.0-windows).
  • Layout (de)serialization uses reflection-based System.Text.Json; under a
    trimmed/AOT host the GKLayout* types must be preserved by the host.
  • The zero-allocation frame / output / control paths, owner records and
    transport-index leases, direct usbip-win2 host-controller installation and
    ARM64 payloads from 2.0.x are not synced (performance-only or not applicable
    to GKMD's transport).

Credits & license

Derived from HIDMaestro 1.5.1 (MIT); the original copyright notice is retained
in LICENSE. Bundled usbip-win2 is BSD-2-Clause, see
Resources/THIRD-PARTY-NOTICES.txt.


v4.7.0 — 2026-10-24 — 同步 HIDMaestro 2.0.3 运行时修复

English | 简体中文

GKMD 4.7.0 同步 HIDMaestro 2.0.0–2.0.3 中适用于 USB/IP 架构的运行时修复,为 server
分配独立的监听端口段,使 GKMD 与 HIDMaestro 可以并存,并修复创建 Xbox One 人格时的
蓝屏。

亮点

  • HIDMaestro 2.0.3 传输层同步 — Dispose 唤醒输入泵,不再等满 500 ms 的帧等待;
    只有宿主控制器连接(System 进程 PID 4,经 GetExtendedTcpTable 判定)才能导入
    设备;连接须在 5 秒内完成握手,同时最多 16 个握手;GET_REPORT(Input) 对描述符
    未声明的 report ID 返回 STALL;claim 在释放时做身份校验,teardown 与宿主 detach
    竞态不再结束进程;按 location 拆除(vhci 端口会被复用);音频 control/stream 事件
    在专用线程上触发,handler 抛异常只记录并丢弃。
  • 并存 — server 监听 37286..37301,避开 HIDMaestro 的 18509..18524 /
    28509..28524 与 FlexInput 的 18008。死服务清扫只检查自己的端口段,只拆除
    server 已消失的 import,因此两者不会互相接管 import 或取消对方的 re-attach
    attempts。该段用满时回退到 OS 分配的 loopback 端口。
  • Xbox One 人格蓝屏 — GIP 元数据 blob 以真实手柄的 214 字节 gamepad 元数据为基础
    重建为 230 字节,把 PC security opt-out 追加为第 4 个 interface 并重算 device /
    total / client-command 偏移;InputReportSize 从 18 修正为 14。此前的 182 字节
    示例元数据会让 xboxgip 在创建设备时 bugcheck。

兼容性

  • 各手柄人格不变(Xbox One / Series X|S、Xbox 360、Switch Pro / Joy-Con、
    DualShock 4、DualSense、方向盘、键盘、鼠标)。
  • 兼容已安装的 usbip-win2 0.9.7.x、0.9.8.0、0.9.8.1。
  • 可与 HIDMaestro 2.0.x 及 FlexInput 并存;端口段不重叠。

产物

文件 大小 说明
GKMD-v4.7.0.zip 25,424,258 字节 内含 GKMD.dll(Release 构建、IL、net10.0-windows、AnyCPU,内嵌 usbip-win2 0.9.8.1)、LICENSE 与 THIRD-PARTY-NOTICES.txt

SHA-256:C223A37D51A703046AD72D07016B185FFE4A1EB18A0ABAAB7CF4451654364460

由 dotnet build -c Release -t:PackageRelease 生成;Native AOT 编译在宿主应用
(GKME)中完成,而非本类库。

构建 / 验证

dotnet build -c Release
dotnet build -c Release -t:PackageRelease
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # 在引用 GKMD.csproj 的宿主工程中执行

已知限制

  • 内嵌的 usbip-win2 载荷仅支持 x64。
  • 仅支持 Windows(net10.0-windows)。
  • layout 序列化/反序列化使用基于反射的 System.Text.Json;在被裁剪的 AOT 宿主中,
    GKLayout* 类型需由宿主保留。
  • 2.0.x 中的零分配 frame / output / control 路径、owner record 与 transport-index
    lease、直接安装 usbip-win2 host controller 以及 ARM64 载荷未同步(仅性能优化或不
    适用于 GKMD 的传输层)。

致谢与许可

派生自 HIDMaestro 1.5.1(MIT),原始版权声明保留在 LICENSE;
捆绑的 usbip-win2 为 BSD-2-Clause,见
Resources/THIRD-PARTY-NOTICES.txt。


GKMD 4.6.1

Choose a tag to compare

@4zyz4 4zyz4 released this 17 Oct 06:11

Release notes

v4.6.1 — 2026-10-17 — HIDMaestro 1.12.0 fixes

English | 简体中文

GKMD 4.6.1 syncs the USB/IP-relevant fixes that landed in HIDMaestro after
1.5.1, up to 1.12.0, and follows GKME 4.6.1.

Highlights

  • Audio stream inference — a usbip-win2 0.9.8.1 host controller driver
    paired with an older filter driver never forwards SET_INTERFACE, while the
    audio itself flows. An interface that has never received SET_INTERFACE is
    now opened by its first isochronous transfer and closed about 200 ms after
    the transfers stop; once the host delivers a SET_INTERFACE, only that
    decides the stream state.
  • Stable per-controller serials — a captured serial varies by controller
    index, and personas without one get a stable synthetic serial. Windows keys
    the USB instance id on the serial instead of the vhci port, so a device comes
    back at the same path across dispose/recreate, process restart and reboot.
  • DualShock 4 reports — report 0x01 fields sit at the SDL/Linux offsets,
    the sensor timestamp advances in 16/3 µs ticks, battery/full/cable and touch
    fields follow the real pad, LT_DIGITAL / RT_DIGITAL follow the 8-bit
    trigger value, and calibration is the identity (8192/g, 16/°/s) with the DS4
    0x05 ordering.

Compatibility

  • Controller personas are unchanged (Xbox One / Series X|S, Xbox 360,
    Switch Pro / Joy-Con, DualShock 4, DualSense, wheel, keyboard, mouse).
  • Works against an installed usbip-win2 0.9.7.x, 0.9.8.0 or 0.9.8.1.

Artifact

File Size Notes
GKMD-v4.6.1.zip 25,420,883 bytes Contains GKMD.dll (Release build, IL, net10.0-windows, AnyCPU, embedded usbip-win2 0.9.8.1), LICENSE and THIRD-PARTY-NOTICES.txt

SHA-256: D306D60EDDA7F43822A2590F3476AD80E6D766D39EAC747956D054A0979A09E8

Produced by dotnet build -c Release -t:PackageRelease; Native AOT compilation
happens in the host application (GKME), not in this library.

Build / verify

dotnet build -c Release
dotnet build -c Release -t:PackageRelease
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # from a host project referencing GKMD.csproj

Known limitations

  • The bundled usbip-win2 payload is x64-only.
  • Windows only (net10.0-windows).
  • Layout (de)serialization uses reflection-based System.Text.Json; under a
    trimmed/AOT host the GKLayout* types must be preserved by the host.

Credits & license

Derived from HIDMaestro 1.5.1 (MIT); the original copyright notice is retained
in LICENSE. Bundled usbip-win2 is BSD-2-Clause, see
Resources/THIRD-PARTY-NOTICES.txt.


v4.6.1 — 2026-10-17 — 同步 HIDMaestro 1.12.0 修复

English | 简体中文

GKMD 4.6.1 同步 HIDMaestro 在 1.5.1 之后至 1.12.0 中适用于 USB/IP 架构的修复,
跟随 GKME 4.6.1 发布。

亮点

  • 音频流推断 — usbip-win2 0.9.8.1 主控驱动搭配旧 filter 驱动时收不到
    SET_INTERFACE,但音频本身仍在传输。从未收到 SET_INTERFACE 的接口现在由首次
    等时传输开启,并在传输停止约 200 ms 后关闭;一旦宿主送达 SET_INTERFACE,流状态
    只由它决定。
  • 每控制器稳定 serial — 已捕获的 serial 按控制器索引变化,无 serial 的 persona
    生成稳定的合成 serial。Windows 以 serial 而非 vhci 端口作为 USB 实例 ID,设备在
    销毁重建、进程重启与重启系统后回到同一路径。
  • DualShock 4 报文 — 0x01 各字段落在 SDL/Linux 读取的偏移,传感器时间戳按
    16/3 µs 递增,电量/充满/cable 与触摸字段符合真实手柄,LT_DIGITAL /
    RT_DIGITAL 按 8 位触发值判定,校准为单位校准(8192/g、16/°/s)并提供 DS4
    0x05 顺序。

兼容性

  • 各手柄人格不变(Xbox One / Series X|S、Xbox 360、Switch Pro / Joy-Con、
    DualShock 4、DualSense、方向盘、键盘、鼠标)。
  • 兼容已安装的 usbip-win2 0.9.7.x、0.9.8.0、0.9.8.1。

产物

文件 大小 说明
GKMD-v4.6.1.zip 25,420,883 字节 内含 GKMD.dll(Release 构建、IL、net10.0-windows、AnyCPU,内嵌 usbip-win2 0.9.8.1)、LICENSE 与 THIRD-PARTY-NOTICES.txt

SHA-256:D306D60EDDA7F43822A2590F3476AD80E6D766D39EAC747956D054A0979A09E8

由 dotnet build -c Release -t:PackageRelease 生成;Native AOT 编译在宿主应用
(GKME)中完成,而非本类库。

构建 / 验证

dotnet build -c Release
dotnet build -c Release -t:PackageRelease
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # 在引用 GKMD.csproj 的宿主工程中执行

已知限制

  • 内嵌的 usbip-win2 载荷仅支持 x64。
  • 仅支持 Windows(net10.0-windows)。
  • layout 序列化/反序列化使用基于反射的 System.Text.Json;在被裁剪的 AOT 宿主中,
    GKLayout* 类型需由宿主保留。

致谢与许可

派生自 HIDMaestro 1.5.1(MIT),原始版权声明保留在 LICENSE;
捆绑的 usbip-win2 为 BSD-2-Clause,见
Resources/THIRD-PARTY-NOTICES.txt。


GKMD 4.5.2

Choose a tag to compare

@4zyz4 4zyz4 released this 10 Oct 12:29

Release notes

v4.5.2 — 2026-10-10 — usbip-win2 0.9.8.1 support

English | 简体中文

GKMD 4.5.2 upgrades the embedded USB/IP transport to usbip-win2 0.9.8.1 and
teaches the engine to speak the 0.9.8.1 vHCI request layout, so an installed
0.9.8.1 driver is no longer misdetected as missing. It follows GKME 4.5.2.

Highlights

  • usbip-win2 0.9.8.1 payload — the embedded installer is upgraded from
    USBip-0.9.8.0-x64.exe to USBip-0.9.8.1-x64.exe; UsbipDriverInstaller
    carries the new version string and the upstream release SHA-256
    (38cad6…2a8518a), which is still verified after extraction.
    THIRD-PARTY-NOTICES.txt and both READMEs follow.
  • Multi-layout vHCI probing — VhciClient now probes the installed driver
    for the ABI it actually supports across three layouts (0.9.8.1 / 0.9.8.0 /
    0.9.7.x
    ). In 0.9.8.1 a new location_hash follows port, growing
    plugin_hardware, stop_attach_attempts and imported_device by 4 bytes
    each; Attach, StopAttachAttempts and GetImportedDevices are all built
    for the detected layout.
  • Fix — false "not installed" — a hard-coded 0.9.8.0-sized
    GET_IMPORTED_DEVICES probe was rejected by 0.9.8.1 with an ABI error, so
    IsCurrentAbi() returned false and an installed 0.9.8.1 was treated as
    missing. The per-layout probe fixes this.
  • 0.9.7.x preserved — UsbipReceiveMode is retained; 0.9.7.x has no
    wsk_events field.
  • Git LFS — Resources/*.exe is now tracked through Git LFS.

Compatibility

  • Controller personas are unchanged (Xbox One / Series X|S, Xbox 360,
    Switch Pro / Joy-Con, DualShock 4, DualSense, wheel, keyboard, mouse).
  • Works against an installed usbip-win2 0.9.7.x, 0.9.8.0 or 0.9.8.1.

Artifact

File Size Notes
GKMD-v4.5.2.zip 25,419,331 bytes Contains GKMD.dll (Release build, IL, net10.0-windows, AnyCPU, embedded usbip-win2 0.9.8.1), LICENSE and THIRD-PARTY-NOTICES.txt

SHA-256: 60EF842F3DDEC9F13327E47CDCE675485017BD6940AAFDC6CD63B86494A1B8A7

Produced by dotnet build -c Release -t:PackageRelease; Native AOT compilation
happens in the host application (GKME), not in this library.

Build / verify

dotnet build -c Release
dotnet build -c Release -t:PackageRelease
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # from a host project referencing GKMD.csproj

Known limitations

  • The bundled usbip-win2 payload is x64-only.
  • Windows only (net10.0-windows).
  • Layout (de)serialization uses reflection-based System.Text.Json; under a
    trimmed/AOT host the GKLayout* types must be preserved by the host.

Credits & license

Derived from HIDMaestro 1.5.1 (MIT); the original copyright notice is retained
in LICENSE. Bundled usbip-win2 is BSD-2-Clause, see
Resources/THIRD-PARTY-NOTICES.txt.


v4.5.2 — 2026-10-10 — 支持 usbip-win2 0.9.8.1

English | 简体中文

GKMD 4.5.2 将内嵌的 USB/IP 传输升级到 usbip-win2 0.9.8.1,并让引擎按
0.9.8.1 的 vHCI 请求布局通信,已安装的 0.9.8.1 驱动不再被误判为未安装。跟随
GKME 4.5.2 发布。

亮点

  • usbip-win2 0.9.8.1 载荷 — 内嵌安装程序由 USBip-0.9.8.0-x64.exe 升级至
    USBip-0.9.8.1-x64.exe;UsbipDriverInstaller 同步新的版本串与上游 release
    SHA-256(38cad6…2a8518a),解压后仍会校验。THIRD-PARTY-NOTICES.txt 与两份
    README 一并更新。
  • 多布局 vHCI 探测 — VhciClient 改为探测已安装驱动实际支持的 ABI,覆盖
    0.9.8.1 / 0.9.8.0 / 0.9.7.x 三种布局。0.9.8.1 在 port 之后新增
    location_hash,使 plugin_hardware、stop_attach_attempts 与
    imported_device 各增大 4 字节;Attach、StopAttachAttempts 与
    GetImportedDevices 均按探测结果构造。
  • 修复:误报“未安装” — 硬编码 0.9.8.0 尺寸的 GET_IMPORTED_DEVICES 探测被
    0.9.8.1 以 ABI 错误拒绝,导致 IsCurrentAbi() 返回 false,已安装的 0.9.8.1
    被误判为缺失;按布局探测后修复。
  • 保留 0.9.7.x — 保留 UsbipReceiveMode;0.9.7.x 无 wsk_events 字段。
  • Git LFS — Resources/*.exe 改用 Git LFS 追踪。

兼容性

  • 各手柄人格不变(Xbox One / Series X|S、Xbox 360、Switch Pro / Joy-Con、
    DualShock 4、DualSense、方向盘、键盘、鼠标)。
  • 兼容已安装的 usbip-win2 0.9.7.x、0.9.8.0、0.9.8.1。

产物

文件 大小 说明
GKMD-v4.5.2.zip 25,419,331 字节 内含 GKMD.dll(Release 构建、IL、net10.0-windows、AnyCPU,内嵌 usbip-win2 0.9.8.1)、LICENSE 与 THIRD-PARTY-NOTICES.txt

SHA-256:60EF842F3DDEC9F13327E47CDCE675485017BD6940AAFDC6CD63B86494A1B8A7

由 dotnet build -c Release -t:PackageRelease 生成;Native AOT 编译在宿主应用
(GKME)中完成,而非本类库。

构建 / 验证

dotnet build -c Release
dotnet build -c Release -t:PackageRelease
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # 在引用 GKMD.csproj 的宿主工程中执行

已知限制

  • 内嵌的 usbip-win2 载荷仅支持 x64。
  • 仅支持 Windows(net10.0-windows)。
  • layout 序列化/反序列化使用基于反射的 System.Text.Json;在被裁剪的 AOT 宿主中,
    GKLayout* 类型需由宿主保留。

致谢与许可

派生自 HIDMaestro 1.5.1(MIT),原始版权声明保留在 LICENSE;
捆绑的 usbip-win2 为 BSD-2-Clause,见
Resources/THIRD-PARTY-NOTICES.txt。

GKMD 4.5.0

Choose a tag to compare

@4zyz4 4zyz4 released this 04 Oct 09:02

Release notes

v4.5.0 — 2026-10-04 — Xbox Series X|S persona

English | 简体中文

GKMD 4.5.0 adds a second Xbox GIP persona, the Xbox Series X|S controller
(Model 1914), and follows GKME 4.5.0.

Highlights

  • Xbox Series X|S persona — StaticProfileRegistry registers a new
    xbox-series profile (VID 045E:0B12, PID 0x0B12, product string
    Xbox Wireless Controller) with the same vendor-class GIP descriptor shape
    as the Xbox One persona (bDeviceClass 0xFF, sub-class 0x47,
    protocol 0xD0, one interrupt IN 0x81 / OUT 0x01, 64-byte packets).
  • Series GIP dialect — UsbConfigurationSpec gains GipSeries; the
    GipResponder frames 40-byte GIP_CMD_INPUT (0x20) reports: the 14-byte
    gamepad body, an 18-byte console-function map (byte 14 bit 0 = Share) and
    an 8-byte dynamic-latency block. Metadata advertises
    IConsoleFunctionMap_InputReport and DynamicLatencyInput.
  • Native recognition — Windows binds the same xboxgip.sys / xinputhid.sys
    and exposes the pad as an XInput device; SDL's GIP driver surfaces the Share
    button.

Compatibility

  • Existing personas (Xbox One, Xbox 360, Switch Pro / Joy-Con, DualShock 4,
    DualSense, wheel, keyboard, mouse) are unchanged.
  • The new backend flag gipSeries defaults to false, so Xbox One behavior is
    byte-for-byte identical to 4.3.0.

Artifact

File Notes
GKMD.dll Release build, IL, net10.0-windows, AnyCPU, embedded usbip-win2 0.9.8.0

Produced by dotnet build -c Release; Native AOT compilation happens in the
host application (GKME), not in this library.

Build / verify

dotnet build -c Release
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # from a host project referencing GKMD.csproj

Known limitations

  • The bundled usbip-win2 payload is x64-only.
  • Windows only (net10.0-windows).
  • Layout (de)serialization uses reflection-based System.Text.Json; under a
    trimmed/AOT host the GKLayout* types must be preserved by the host.

Credits & license

Derived from HIDMaestro 1.5.1 (MIT); the original copyright notice is retained
in LICENSE. Bundled usbip-win2 is BSD-2-Clause, see
Resources/THIRD-PARTY-NOTICES.txt.


v4.5.0 — 2026-10-04 — Xbox Series X|S 人格

English | 简体中文

GKMD 4.5.0 新增第二种 Xbox GIP 人格——Xbox Series X|S 手柄(Model 1914),跟随
GKME 4.5.0 发布。

亮点

  • Xbox Series X|S 人格 — StaticProfileRegistry 注册新的 xbox-series
    profile(VID 045E:0B12、PID 0x0B12、产品字符串 Xbox Wireless Controller),
    descriptor 形态与 Xbox One 人格一致(bDeviceClass 0xFF、子类 0x47、
    协议 0xD0,一个中断 IN 0x81 / OUT 0x01,64 字节包)。
  • Series GIP 方言 — UsbConfigurationSpec 新增 GipSeries;GipResponder
    组帧 40 字节 GIP_CMD_INPUT(0x20)报文:14 字节手柄体 + 18 字节
    console-function map(第 14 字节 bit0 = Share)+ 8 字节 dynamic-latency
    块;元数据声明 IConsoleFunctionMap_InputReport 与 DynamicLatencyInput。
  • 原生识别 — Windows 绑定同一 xboxgip.sys / xinputhid.sys,将手柄呈现为
    XInput 设备;SDL 的 GIP 驱动可识别 Share 键。

兼容性

  • 既有各人格(Xbox One、Xbox 360、Switch Pro / Joy-Con、DualShock 4、DualSense、
    方向盘、键盘、鼠标)均不变。
  • 新增后端开关 gipSeries 默认 false,Xbox One 行为与 4.3.0 逐字节一致。

产物

文件 说明
GKMD.dll Release 构建、IL、net10.0-windows、AnyCPU,内嵌 usbip-win2 0.9.8.0

由 dotnet build -c Release 生成;Native AOT 编译在宿主应用(GKME)中完成,
而非本类库。

构建 / 验证

dotnet build -c Release
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # 在引用 GKMD.csproj 的宿主工程中执行

已知限制

  • 内嵌的 usbip-win2 载荷仅支持 x64。
  • 仅支持 Windows(net10.0-windows)。
  • layout 序列化/反序列化使用基于反射的 System.Text.Json;在被裁剪的 AOT 宿主中,
    GKLayout* 类型需由宿主保留。

致谢与许可

派生自 HIDMaestro 1.5.1(MIT),原始版权声明保留在 LICENSE;
捆绑的 usbip-win2 为 BSD-2-Clause,见
Resources/THIRD-PARTY-NOTICES.txt。

GKMD 4.3.0

Choose a tag to compare

@4zyz4 4zyz4 released this 01 Oct 08:23

Release notes

v4.3.0 — 2026-10-01 — first release

English | 简体中文

GKMD 4.3.0 is the first public release of GKMD, a standalone Windows virtual USB
game controller engine extracted from the GKME driver branch and derived from
hifihedgehog/HIDMaestro 1.5.1 (MIT).

Highlights

  • Pure USB/IP transport — every controller is created through the
    usbip-win2 virtual host controller (vHCI). No UMDF2 kernel driver, no INF,
    no PnP device node; usbip-win2 0.9.8.0 is embedded and deployed on demand.
  • Probe-only installation — the engine never installs silently: it throws
    UsbipInstallRequiredException / UsbipRebootRequiredException so the host
    app can turn them into a prompt.
  • Device personas — Xbox One 045E:02EA (GIP handshake, 14-byte input,
    guide key, rumble/LED), Xbox 360 native report + capability query,
    Switch Pro / Joy-Con (057E:2009/2006/2007) subcommand & 0x30/0x21 responder
    with fake SPI mirror, DualShock 4 serial + authentication feature reports,
    DualSense test-command families and updated firmware info, high-resolution
    wheel (Resolution Multiplier), plus keyboard / mouse HID personas.
  • Vendor-class channel — non-HID devices pass opaque input reports through
    verbatim and answer EP0 vendor requests (e.g. Xbox 360 capability report).
  • USB audio — UsbAudioEngine is created only when the profile declares a
    USB Audio streaming interface.
  • Low-latency USB/IP — UsbipReceiveMode.LowLatency is the default, with
    ZeroCopy still available; teardown waits for port detach to avoid reuse
    races during fast mode switching.
  • Static profile catalog — built-in profiles are constructed in code by
    StaticProfileRegistry.cs; no JSON resources are loaded from disk.

AOT (Native Ahead-of-Time) support

  • GKMD.csproj sets <IsAotCompatible>true</IsAotCompatible>: the trim / AOT /
    single-file analyzers run on every build and both Debug and Release builds are
    0 warnings / 0 errors.
  • The only reflection-based JSON paths (GKLayoutLoader.cs) are annotated
    locally with #pragma warning disable IL2026, IL3050; hosts that serialize
    layouts at runtime should keep the GKLayout* types alive
    (JsonSerializerContext or a trimmer root descriptor).
  • Verified end-to-end: a host app referencing GKMD.csproj with
    <PublishAot>true</PublishAot> + <PublishTrimmed>true</PublishTrimmed>
    publishes with dotnet publish -c Release -r win-x64 -p:PublishAot=true with
    no warnings, and at runtime both embedded manifest resources are read back at
    full length (USBip-0.9.8.0-x64.exe = 26,390,744 bytes,
    THIRD-PARTY-NOTICES.txt = 2,269 bytes).
  • GKME already publishes with <PublishAot>true</PublishAot> +
    <PublishTrimmed>true</PublishTrimmed> and links GKMD that way.

Artifact

File Size Notes
GKMD.dll 26,693,632 bytes Release build, IL, net10.0-windows, AnyCPU, embedded usbip-win2 0.9.8.0

SHA-256: 3F71F78359C6A66781973DBBBBE74EA06EAAB1A9F9E799294A813CA8FC9CD41E

The DLL embeds USBip-0.9.8.0-x64.exe and THIRD-PARTY-NOTICES.txt; it is
produced by dotnet build -c Release. Native AOT compilation happens in the
host application, not in this library.

Build / verify

dotnet build -c Release                       # library, trim + AOT analyzers on
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # from a host project referencing GKMD.csproj

Known limitations

  • Layout (de)serialization uses reflection-based System.Text.Json; under a
    trimmed/AOT host the GKLayout* types must be preserved by the host.
  • The bundled usbip-win2 payload is x64-only.
  • Windows only (net10.0-windows).

Credits & license

Derived from HIDMaestro 1.5.1 (MIT); the original copyright notice is retained
in LICENSE. Bundled usbip-win2 is BSD-2-Clause, see
Resources/THIRD-PARTY-NOTICES.txt.


v4.3.0 — 2026-10-01 — 首个版本

English | 简体中文

GKMD 4.3.0 是 GKMD 的首个公开版本:一个独立的 Windows 虚拟 USB 手柄引擎,
从 GKME 驱动分支中抽取,派生自 hifihedgehog/HIDMaestro
1.5.1(MIT)。

亮点

  • 纯 USB/IP 传输 — 所有虚拟手柄均经 usbip-win2 虚拟主机控制器(vHCI)创建,
    无 UMDF2 内核驱动、无 INF、无 PnP 设备节点;内嵌 usbip-win2 0.9.8.0 并按需部署。
  • 仅探测、不擅自安装 — 缺失/过期时抛出 UsbipInstallRequiredException /
    UsbipRebootRequiredException,由宿主应用转成提示。
  • 设备人格 — Xbox One 045E:02EA(GIP 握手、14 字节输入、Home 键、震动/LED)、
    Xbox 360 原生报告 + 能力查询、Switch Pro / Joy-Con(057E:2009/2006/2007)
    子命令与 0x30/0x21 帧 + 伪造 SPI 镜像、DualShock 4 序列号与认证特征报告、
    DualSense 测试指令族与新版固件信息、高分辨率方向盘(Resolution Multiplier),
    以及键盘 / 鼠标 HID 人格。
  • Vendor class 通道 — 非 HID 设备原样透传输入报告并响应 EP0 vendor 请求
    (如 Xbox 360 能力报告)。
  • USB 音频 — 仅当 profile 声明 USB Audio streaming 接口时才创建 UsbAudioEngine。
  • 低延迟 USB/IP — 默认 UsbipReceiveMode.LowLatency,保留 ZeroCopy;
    拆除时等待端口脱离,避免快速切换时的端口复用竞态。
  • 静态 profile 目录 — 内建 profile 由 StaticProfileRegistry.cs 代码构造,
    不再从磁盘加载 JSON 资源。

AOT(Native Ahead-of-Time)支持

  • GKMD.csproj 设置 <IsAotCompatible>true</IsAotCompatible>:每次构建都会运行
    trim / AOT / single-file 分析器,Debug 与 Release 均为 0 警告 / 0 错误。
  • 唯一基于反射的 JSON 路径(GKLayoutLoader.cs)在代码中就地标注
    #pragma warning disable IL2026, IL3050;运行时序列化 layout 的宿主应保留
    GKLayout* 类型(JsonSerializerContext 或 trimmer 根描述符)。
  • 端到端验证:引用 GKMD.csproj、开启 <PublishAot>true</PublishAot> +
    <PublishTrimmed>true</PublishTrimmed> 的宿主执行
    dotnet publish -c Release -r win-x64 -p:PublishAot=true 无任何警告,
    运行时两个内嵌 manifest resource 均可按完整长度读出
    (USBip-0.9.8.0-x64.exe = 26,390,744 字节,THIRD-PARTY-NOTICES.txt = 2,269 字节)。
  • GKME 已使用 <PublishAot>true</PublishAot> + <PublishTrimmed>true</PublishTrimmed>
    发布,并以该方式链接 GKMD。

产物

文件 大小 说明
GKMD.dll 26,693,632 字节 Release 构建、IL、net10.0-windows、AnyCPU,内嵌 usbip-win2 0.9.8.0

SHA-256:3F71F78359C6A66781973DBBBBE74EA06EAAB1A9F9E799294A813CA8FC9CD41E

DLL 内嵌 USBip-0.9.8.0-x64.exe 与 THIRD-PARTY-NOTICES.txt,由
dotnet build -c Release 生成;Native AOT 编译在宿主应用中完成,而非本类库。

构建 / 验证

dotnet build -c Release                                   # 类库,开启 trim + AOT 分析器
dotnet publish -c Release -r win-x64 -p:PublishAot=true   # 在引用 GKMD.csproj 的宿主工程中执行

已知限制

  • layout 序列化/反序列化使用基于反射的 System.Text.Json;在被裁剪的 AOT 宿主中,
    GKLayout* 类型需由宿主保留。
  • 内嵌的 usbip-win2 载荷仅支持 x64。
  • 仅支持 Windows(net10.0-windows)。

致谢与许可

派生自 HIDMaestro 1.5.1(MIT),原始版权声明保留在 LICENSE;
捆绑的 usbip-win2 为 BSD-2-Clause,见
Resources/THIRD-PARTY-NOTICES.txt。