Commit Graph
18 Commits
Author SHA1 Message Date
kinect-botandsisyphus-dev-ai 6b850ef958 docs: give NixOS-specific v4l2loopback setup (not generic-distro DKMS)
User is on NixOS, not a generic distro - the previous apt/pacman/dnf-only
guidance was wrong for their actual environment. On NixOS, v4l2loopback is
a clean, properly kernel-matched system config change via
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; +
boot.kernelModules, since NixOS kernelPackages always matches the exact
booted kernel - no DKMS version-mismatch risk, unlike generic distros.
Still not addable through this projects flake.nix either way: loading a
kernel module is a system-wide root action no per-project devShell can
reach. Kept the generic apt/pacman/dnf path for other readers of this doc
on non-NixOS systems.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 16:08:00 -05:00
kinect-botandsisyphus-dev-ai b3906c3bed feat(build): add scrcpy+v4l-utils to the flake for phone-camera-as-webcam
User wants to use an Android phone camera (via scrcpy) as the trackers
webcam input, piped through v4l2loopback as a normal /dev/videoN device.

Added scrcpy and v4l-utils to the devShell (scrcpyTools, wired into the
default devShell packages list) - both are portable userspace tools Nix
handles fine. v4l2loopback itself is NOT addable the same way: it is a
kernel module that needs DKMS built against the hosts exact running kernel,
which only the distros own package manager can match - a Nix-built .ko
would target whatever kernel nixpkgs pins, not necessarily what is actually
running, and could silently fail to insmod. docs/setup-linux.md step 7
documents the distro-specific kernel-module install (apt/pacman/dnf) plus
the exact modprobe + scrcpy --v4l2-sink + tracker --source wiring.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 16:05:09 -05:00
kinect-botandsisyphus-dev-ai ce877a6076 feat(build): bake the shm name into the flake, add nix run .#launch-options
"just put the shm in the nix flake" - the shm name (virtual_kinect_frames)
was only a CLI default inside tracker.py's argparse, invisible from
flake.nix; the user had to retype --shm-name, and separately hand-compute
the Z: drive path translation (/dev/shm/... -> Z:\dev\shm\...) for every
KINECT_SHIM_SHM_FILE/KINECT_SHIM_CONFIG launch-option value.

flake.nix now defines kDefaultShmName once and passes --shm-name explicitly
from the tracker app, so the shm name genuinely lives in the flake instead
of only matching the tracker's own default by coincidence. Added a new
nix run .#launch-options app that computes and prints the exact, ready-to-
paste Steam Launch Options line (KINECT_SHIM_SHM_FILE + KINECT_SHIM_CONFIG,
both Wine Z:-path-translated from the real /dev/shm path and $HOME) - no
more manual path arithmetic. Verified the path-translation logic (POSIX ->
Z:\... with slashes flipped) against the exact script content by running it
standalone, producing Z:\dev\shm\virtual_kinect_frames and
Z:\home\<user>\.config\VirtualKinect\calibration.cfg as expected.

docs/linux-wine.md updated to point at nix run .#launch-options instead of
having the reader compute the Z: paths by hand, and to drop the now-
redundant --shm-name flag from the Nix tracker invocation example.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 12:57:42 -05:00
kinect-botandsisyphus-dev-ai c08bc922b6 feat(tracker): add Linux cursor calibration, matching the Windows flow exactly
"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>
2026-11-30 12:53:45 -05:00
kinect-botandsisyphus-dev-ai d8b0db4e59 docs: document the real spice2x "Kinect bypass" mechanism
The user hit "spice2x won't launch" which turned out to be DEA's boot-time
Kinect presence check hanging then exiting cleanly after ~20s (full AVS2
boot, I/O hooks via Wine HID all succeed, then xrpc dispose with no crash
signature - easy to mistake for a launch failure). They looked for a
"Kinect bypass" option in spicecfg and couldn't find it, because it isn't a
built-in checkbox - it's a community runtime JSON patch
(github.com/JoeKoh27/danevo-patches), imported through spicecfg's Patches
tab -> Import from URL. Verified by fetching the patch repo directly.

docs/setup-windows.md step 5 and docs/troubleshooting.md now spell out the
exact mechanism (Patches tab, import URL, enable Kinect bypass, the specific
gamekdm.dll build it targets) instead of just saying "enable the Kinect
bypass option", which was accurate in substance but too vague about where
to find it.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 10:43:06 -05:00
kinect-botandsisyphus-dev-ai c4796d7dcf feat(build): fetch the pose model bundles through Nix, hash-pinned
tracker.py failed with FileNotFoundError on pose_landmarker_full.task - the
flake built the Python env fine but never fetched the .task model bundles
that docs/setup-linux.md step 2a used to curl by hand into the git-ignored
tracker/models/.

Added poseModels: a runCommand derivation that fetches all three tiers
(lite/full/heavy) via pkgs.fetchurl with sha256 hashes pinned from the real
bundles (verified by downloading and hashing each one directly, not guessed).
The google storage "latest" path can move the file it points to; fetchurl's
hash check fails loudly if it ever does, rather than silently serving a
different model.

nix run .#tracker now passes --models-dir pointing at this derivation by
default (a user-supplied --models-dir/--model after it still wins, argparse
keeps the last occurrence). nix develop also symlinks the fetched bundles
into tracker/models/ so a manual python -m tracker.tracker inside the shell
needs no separate fetch either. docs/setup-linux.md updated to note the Nix
path skips the manual model-download step too.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 10:09:14 -05:00
kinect-botandsisyphus-dev-ai fd1c9ad3e5 feat(build): add a Nix flake for a venv-free Linux build
flake.nix builds the whole project with Nix instead of a manual uv venv:

- the Python tracker as a pure Nix-built environment via uv2nix, from
  tracker/uv.lock (generated by uv lock against pyproject.tomls pins -
  numpy==2.5.5, opencv-python-headless==5.1.0.95, mediapipe==1.2.3, Python
  3.12), so the environment is an immutable Nix store path assembled from
  hash-pinned wheels, never a mutable venv or a pip install step. libglvnd
  replaces the manual libGLESv2.so.2 .deb-extraction workaround.
- the OS-agnostic core + CTest suite via cmake (nix run .#core-test).
- the Windows shim + native tracker cross-compiled via nixpkgs mingw-w64
  (pkgsCross.mingwW64/mingw32; nix run .#shim-build), with CXX32/CXX64/CXX_WIN
  wired to the build scripts override hooks.

nix run .#tracker runs the tracker directly; nix develop gives a shell with
everything for manual work. docs/setup-linux.md documents the Nix path as
the lead option, keeping the uv/venv path as the no-Nix fallback.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 10:00:15 -05:00
kinect-botandsisyphus-dev-ai 2ea8fc4aa6 feat(shim): bridge the Wine-hosted shim to the native Linux tracker via a file-backed shared-memory mapping
Wine mf.dll stubs out MFEnumDeviceSources for video capture (confirmed in
Wine upstream source), so tracker-native/kinect-tracker.exe always sees zero
cameras and null-derefs when run under Wine. Rather than chase that Wine
limitation, let the already-verified native-Linux Python tracker (tracker/,
full V4L2 access) feed the Wine-hosted shim directly.

FrameSource gains open_file() (CreateFileW + file-backed CreateFileMappingW
+ MapViewOfFile), selected via a new KINECT_SHIM_SHM_FILE env var checked
first in VirtualKinectSensor::Initialize, falling back to the existing
anonymous named-section path when unset. The Linux tracker publishes through
multiprocessing.shared_memory, which on Linux is backed by a real file at
/dev/shm/<name>; through Wines default Z: drive that is reachable from
inside Wine as Z:\dev\shm\<name>, so both sides map the same tmpfs file
with no Wine camera support needed at all.

Builds clean for both x86/x64 (fallback/windows-nui/build.sh). New runbook
in docs/linux-wine.md; linked from README and docs/troubleshooting.md.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 10:00:06 -05:00
kinect-bot 48eb19dd43 fix(calibration): gesture wording matches derivation (todo 9); restore build.sh exec bit 2026-11-27 04:10:29 -05:00
kinect-bot ee6781ef31 feat(release): wave 3 landed - preflight, docs refresh, limitations 2026-11-27 03:49:56 -05:00
kinect-bot 710c4f23e5 feat(release): wave 1 landed - tuning/calibration, model+ORT distribution, licensing, 2P experiment+probe 2026-11-27 03:05:51 -05:00
kinect-bot 8cc94da668 docs: add docs/game-internals.md (how DEA consumes the Kinect: skeleton validity gate, the Flash/libafp menu-cursor PhIZ, two-player, in-process introspection) + a full RE/decompilation jump-start (Ghidra gkproj, ifstools+bemaniutils afp toolchain, real-Kinect datasets, key addresses). Refresh README + native-tracker for the native tracker, working DEA, and new features. 2026-11-27 01:09:11 -05:00
kinect-bot 31178f1675 feat(tracker-native): native Windows app - MF camera + Win32 GUI + shm publish
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python root tests (pytest, no tracker deps) (push) Canceled after 0s
ci / Python tracker (pytest, tracker/.venv) (push) Canceled after 0s
win_camera: Media Foundation device + native-resolution enumeration and RGB32
capture. win_main: plain Win32 GUI (device/resolution dropdowns, Start/Stop,
StretchDIBits live preview with mask+landmark overlay) + CreateFileMappingW on
kinect_virtual_frames + a worker thread wiring capture -> PoseEstimator
(bootstrap+track) -> FramePipeline -> publish. build_win.sh cross-compiles a
static kinect-tracker.exe with MinGW-w64 x64 (ORT header needs
-D_stdcall=__stdcall; x64 ignores the calling convention so the win ORT DLL ABI
matches). PoseEstimator path made ORTCHAR_T/wchar-portable; M_PI -> local const.
Builds clean; exe is PE32+ GUI x86-64.
2026-11-25 19:00:38 -05:00
kinect-bot 290283d8c0 docs(tracker-native): architecture for the zero-Python native tracker
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python root tests (pytest, no tracker deps) (push) Canceled after 0s
ci / Python tracker (pytest, tracker/.venv) (push) Canceled after 0s
Single native kinect-tracker.exe: Media Foundation camera enum/capture,
Dear ImGui (Win32+D3D11) device/resolution picker + live preview, pose +
segmentation via ONNX Runtime using the real MediaPipe BlazePose weights
converted from the .task TFLite bundle, native shm writer reusing the
existing C++ core (contract/mapping/synth). No Python, no committed binaries.
2026-11-25 18:23:06 -05:00
kinect-bot b4397e6151 fix(qa): conftest root-venv ignore + calibration doc honesty + deterministic player-lost test (final-wave 22/23/24; F1-F4 pass, F5 [~])
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python root tests (pytest, no tracker deps) (push) Canceled after 0s
ci / Python tracker (pytest, tracker/.venv) (push) Canceled after 0s
2026-11-25 06:25:25 -05:00
kinect-bot 39876fa97b docs(setup): README + linux/windows setup + calibration/troubleshooting + packaging (wave 11; todo 18 done)
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python root tests (pytest, no tracker deps) (push) Canceled after 0s
ci / Python tracker (pytest, tracker/.venv) (push) Canceled after 0s
2026-11-25 06:10:54 -05:00
kinect-bot e6d4e510d3 feat(contract,spikes): frozen IPC data contract + Linux/Windows spikes (wave 2)
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python tracker (pytest) (push) Canceled after 0s
2026-11-25 03:54:41 -05:00
kinect-botandsisyphus-dev-ai b38c7bcd82 chore(scaffold): project layout, cross-platform build, CI
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python tracker (pytest) (push) Canceled after 0s
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-25 03:23:45 -05:00