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>
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>
"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>
"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>
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>
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>
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>
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>
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.
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.