"the cursor scaling is still wrong, make it like the windows one" - the Linux tracker had no way to calibrate at all. The in-game cursor's arm-reach gains (default 3.2/2.6) were tuned specifically for the native Windows tracker's camera/pose characteristics via its "Calibrate cursor" button (core/calibration.h's derive_arm_gains); Linux users were stuck on that default regardless of their own camera/body, with no equivalent tool. tracker/calibration.py is a byte-for-byte port of core/calibration.h's arm-gain derivation (mean(|reach|) -> target/mean, clamped [1,6]) and the calibration.cfg text format load_config()/save_config() share, so a config written by either side is read identically by the shim - not a reimplementation that happens to produce similar numbers, the same formula and the same wire format, verified against tests/test_calibration.cpp's own cases (averaging, diagonal-gesture success, horizontal-only rejection, clamp-to-min, save/reload round-trip) ported 1:1 into tests/test_calibration_py.py - 6/6 passing, plus the existing tracker suite still 11/11. tracker.py gets a --calibrate mode (calibrate_cursor()): mirrors each frame for pose inference exactly like the main loop, computes Kinect joints with mirror=False, and reads HAND_LEFT (index 7) minus SHOULDER_LEFT (index 4) - the slots the player's actual right arm lands in post-mirror, pre-shim-swap, matching exactly where win_main.cpp's CalibrateCursor() reads skeleton.joints[7]/[4] (verified by reading that function directly). Usage: nix run .#tracker -- --calibrate --source 0. docs/calibration.md and docs/linux-wine.md document the Linux flow, the Linux default config path (no %LOCALAPPDATA% equivalent - XDG config dir), and that KINECT_SHIM_CONFIG must be set explicitly in both the calibration tool's environment and the game's launch options (Wine or Proton) so they agree on one file - the same pattern already established for KINECT_SHIM_SHM_FILE. Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Webcam-driven virtual Kinect v1
Make an ordinary RGB webcam present itself as a genuine Microsoft Kinect v1 sensor, so unmodified Kinect apps run with no recompile. The primary proof target is DanceEvolution Arcade (DEA) on Windows. We emulate the device (the thing on USB), not the game's API, so the approach is OS-agnostic and the real host Kinect stack (MS NUI on Windows, OpenNI2/NiTE on Linux) computes the skeleton from webcam-derived synthetic depth.
Quickstart
- Linux (verified path): build the core, run the tracker, see moving synthetic depth through a real OpenNI2 consumer. Follow docs/setup-linux.md.
- Windows (DEA, verified path): download the player bundle, drop in the
Kinect10.dllshim, run the native tracker, and play. Follow docs/setup-windows.md. - DEA under Wine on Linux: the native tracker can't run under Wine (Wine's Media Foundation stubs out video capture device enumeration), so this path runs the Linux Python tracker natively and bridges it to the Wine-hosted shim through a real file-backed shared-memory mapping. Follow docs/linux-wine.md.
- Calibrate the cursor once: docs/calibration.md.
- Something broken: docs/troubleshooting.md.
- Limitations & requirements: docs/limitations.md.
- Build details / toolchain: docs/build.md.
- Native Windows tracker (current path): docs/native-tracker.md.
- How DEA works inside + RE jump-start: docs/game-internals.md.
Architecture
The current Windows path uses the self-contained native tracker
(tracker-native/, C++ Media Foundation capture + Win32 GUI + ONNX BlazePose),
so no Python runtime is needed on the play machine. The original Python tracker
(tracker/) remains the reference/Linux path. Both publish the same contract.
webcam ─► tracker (native tracker-native/ on Windows, or Python tracker/)
│ MediaPipe/BlazePose pose + segmentation
│ publishes to the frozen shared-memory IPC contract
▼
core/ (OS-agnostic engine, libnui_core)
contract · mapping · synth · protocol · calibration
│
┌────────────┴─────────────────────────────┐
▼ ▼
attach/ (per-OS USB attach) fallback/ (per-OS library surface)
linux: usbip/vhci device linux: OpenNI2 "SynthKinect" driver
windows: usbip-win VHCI windows: clean-room Kinect10.dll shim
│
▼
real host Kinect stack skeletonizes the synthetic depth
(MS NUI on Windows, OpenNI2 + NiTE on Linux) ─► the game
The shared engine is the OS-agnostic core/, built into libnui_core and unit-tested on Linux.
Only the thin attach/ and fallback/ layers are per-OS. One tracker feeds one contract; every
surface is a consumer of that one producer, so skeleton and depth stay identical across paths.
Status: what is verified vs blocked
Mirrors the plan's [x]/[~] state. "Verified" means executed and observed in the Linux/WSL2
build environment. [~] means the code is complete but the runtime proof is gated on hardware or an
OS this environment lacks (no Windows, no WDK, no usbip userspace, no loaded vhci-hcd).
| Capability | Surface | Status |
|---|---|---|
| OS-agnostic core (contract, mapping, synth, protocol, calibration) builds + unit-tests | core/ |
verified (CTest green) |
| Webcam -> MediaPipe pose/segmentation -> frozen IPC contract | tracker/ |
verified against a recorded video; live --source 0 needs a real camera |
| Articulated synthetic depth through a real OpenNI2 stack (moving, in-band, spread > 100 mm) | fallback/linux-openni2/ + e2e harness |
verified (depth + enumeration; VERDICT: PASS) |
| Robustness: player-lost, low-light, mask noise, tracker-crash without host crash | tracker/ + core/ |
verified (fault-injection) |
| Linux USB device-attach (OS enumerates a Kinect) | attach/linux/ |
[~] blocked: no usbip userspace / loaded vhci-hcd here. Compiles + unit-tests; needs a native-Linux host |
| Linux skeleton tracking (NiTE2) | OpenNI2 + NiTE2 | out of scope: NiTE2 is non-redistributable; supply it yourself |
| Windows device-attach (IS-1 enumerate, IS-2 MS NUI skeletonizes synthetic depth) | attach/windows/ |
[~] blocked: no Windows/WDK. Scripts + topology + signing fully specified |
Windows Kinect10.dll NUI shim (IS-3/IS-4 playability only) |
fallback/windows-nui/ |
verified loaded in DEA on the user's Windows box (real PE32/PE32+, 21 exports); the game renders our skeleton + menu cursor |
| Native Windows tracker (MF capture + Win32 GUI + ONNX BlazePose, remembers last camera/resolution) | tracker-native/ |
verified on the user's Windows box |
| DEA in-game skeleton rendering + menu hand-cursor | Windows + fallback/windows-nui/ |
verified on the user's Windows box (skeleton renders; one-arm cursor covers the screen). See docs/game-internals.md |
The authoritative skeleton/fidelity proof is DEA on Windows; the Linux OpenNI2 path proves the
depth/synthesis fidelity. The Kinect10.dll shim proves playability only and does not satisfy
IS-1 (OS enumeration) or IS-2 (real-runtime skeletonization).
Clean-room notice
All synthesis, mapping, protocol, and shim code here is written fresh. The public Kinect
NuiApi.h headers and the libfreenect USB protocol are treated as interface facts only. No GPLv3
source (KinectFaker, NiVirtualCam, NiTE2, etc.) is read or vendored. The MS Kinect 1.8 runtime,
NiTE2, and any game assets are never bundled; the docs link to their official sources.
Module map
| Path | Role |
|---|---|
core/contract/ |
Frozen, versioned IPC frame + control schema |
core/mapping/ |
NUI intrinsics, MediaPipe-33 -> Kinect-20 map, Holt smoothing |
core/synth/ |
Packed depth + player-index + color rasterizer |
core/protocol/ |
Kinect v1 virtual USB device emitter |
core/calibration/ |
One-time T-pose + mirror calibration |
tracker/ |
Python webcam -> MediaPipe pose/segmentation -> IPC (reference/Linux path) |
tracker-native/ |
Native Windows tracker: MF capture + Win32 GUI + ONNX BlazePose -> IPC |
attach/linux/ |
Linux USB attach via usbip/vhci |
attach/windows/ |
Windows virtual USB bus attach + signing scripts |
fallback/linux-openni2/ |
OpenNI2 virtual device / Linux general emulator |
fallback/windows-nui/ |
Clean-room Kinect10.dll NUI shim |
tools/e2e_linux_validation/ |
Recorded-video -> tracker -> OpenNI2 depth e2e harness |
tools/record-replay/, tools/mock-nui-host/ |
Deterministic record/replay + mock NUI host |
packaging/ |
Per-OS runnable-bundle assembly script |
tests/ |
Cross-cutting C++ (CTest) + Python (pytest) tests |
docs/ |
Setup, calibration, troubleshooting, build, native tracker, DEA game internals + RE jump-start |
Packaging
packaging/build_bundle.sh assembles a per-OS runnable bundle from the built artifacts. See
packaging/README.md.
The full plan lives in .omo/plans/webcam-kinect-emulator.md; the architecture and NUI contract
notes in .omo/design/.