Skip to content

About

SteamVR/OpenVR driver for the Pimax Crystal on Linux: display, 6DoF from the headset's own SLAM, controllers, eye tracking.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

pimax-linux

A native Linux OpenVR driver for Pimax Crystal headsets. It speaks the headset's own USB protocols directly — the DirectXR2 HID channel and the DisplayPort panel — with no Pimax Play, no PVR runtime, no Wine and no Windows.

Status: beta, version 0.2.3. One developer, one Crystal OG, exercised continuously on hardware. Display, 6DoF, controllers and eye tracking all work; the list below is honest about what does not.

Licence and disclaimer

This source code was AI generated from reverse engineering closed production software from Pimax. They do not own the code, nor do Pimax nor the author take any responsibility for hardware damage while using this code. Use at your own risk. Any issue you might have with this software should not be reported back to Pimax, because they do not support or endorse this software. All source code is licenced under GPL-3.0-or-later: any changes you distribute must be shared publicly under the same licence, and the author asks to be contacted before commercial distribution - a separate commercial licence is available if you need written consent.

Licence: GPL-3.0-or-later, full text in LICENSE. The same statement is in the header of every source file. The controller render models are Pimax's own files and are not covered by that licence; ASSETS.md lists what is ours and what is not. If you intend to distribute this commercially, contact the author first — a separate commercial licence is available, and it is the only way to obtain written consent.

What works

Area State
Display works — 2880×2880 per eye at 119.98 Hz, the only mode the EDID offers; correct stereo geometry and lens distortion
6DoF tracking works — the headset's own SLAM, decoded over HID
Controllers works — pose, all face buttons, capacitive touch, joystick, analog trigger and grip, battery, haptics
Eye tracking (Tobii) works — gaze published to SteamVR, per-wearer mapping fitted by pimax-control --measure and saved
Auto-IPD works — guided one-shot, fixation-gated, skips when the lenses have not moved
Wearing guide ("Pimax Control") works — appears on the wear event, holds through blinks, runs placement then IPD
Presence / standby works — a latch of eyes and on-head sensor drives SteamVR's standby
Audio works — the headset's DisplayPort sink and its USB microphone are found in PipeWire and published to SteamVR, which makes them the default output and input; the Auto audio toggle in the dashboard panel (and audio.autoSwitch) leaves the desktop's own default alone when off (see AUDIO.md)
IPD read/write, panel standby, shutdown works
Settings panel works — a SteamVR dashboard overlay: live state, auto-IPD on/off, audio auto-switch, gaze calibration, mapping measurement, controller pairing and haptics, headset shutdown
Chaperone and recentre SteamVR owns the universe; run Room Setup once (see below), after which SteamVR's own recentre works

Not implemented, and known:

  • VST passthrough — deliberately not implemented: the stream disables the headset's own 6DoF SLAM.

  • Brightness, lens selection, SLAM mode — no property passthrough yet.

  • Writing an eye-tracking calibration model to the device — the gaze chain works and the per-wearer mapping is fitted and stored by us, but the model itself cannot be committed to the tracker yet; see EYE-TRACKING.md for the evidence that parks it.

Out of scope, and not planned: Crystal Light / Super and K11/K10 (the p3c 65-byte path). Development is against a Crystal OG, that hardware is not available here, so the transport is not extended towards it.

Eye-tracking calibration is described in EYE-TRACKING.md.

Requirements

  • Pimax Crystal OG (34a4:0012, product P3B, protocol 21). Other models are untested and unsupported.
  • KWin on Wayland, with DRM leasing. That is the only session this has been built against and tested on. X11, XWayland and other Wayland compositors (Mutter, wlroots/Sway, Hyprland) are untested and may misbehave — see DISPLAY.md.
  • NVIDIA open kernel module with the 2Heads1OR viewport fix (nvidia-patches/, upstream PR #1262). Without it the right eye panel never scans out and both eyes show the left half.
  • To build: cmake, a C++20 compiler, and the two pinned submodules - git submodule update --init --depth 1 fetches the OpenVR headers and nlohmann/json (-DOPENVR_HEADERS=... overrides the SDK). Qt 6 Gui and librsvg are required for Pimax Control (the panel and the guide's artwork); configure with -DPIMAX_NO_GUIDE=ON to build only the driver, probe and tools with neither. libpipewire-0.3 is optional and is what lets the driver find the headset's audio endpoint; without it everything else works and audio is left to the desktop. The installer also uses rsync (or cp) and python3 for the Steam manifest edit.

Install

The package is the supported way in: it is built from the tag in an Arch container, installs everything system-wide and needs no compiler. Building from source is the fallback — for a modified tree, or to hack on the driver. packaging/aur/PKGBUILD is the recipe the package is built from, so makepkg on it gives byte-for-byte the same install.

1. Install the package (preferred).

sudo pacman -U pimax-linux-*.pkg.tar.zst     # from the release page
pimax-linux-steamvr                          # as the user who runs SteamVR

It installs the driver under /opt/pimax-linux, pimax-probe and pimax-control on PATH, and the udev rules and both systemd units system-wide — so the source steps further down are already done. pimax-edid-fix.service is triggered by udev and needs nothing enabled; enable the other one if you want the headset powered off with the machine:

sudo systemctl enable pimax-shutdown.service      # test: pimax-probe shutdown --dry-run

pimax-linux-steamvr symlinks the driver into <SteamVR>/drivers/pimax and registers Pimax Control as a startup overlay app, for SteamVR installations in ~/.steam, ~/.local/share/Steam or any library libraryfolders.vdf lists. It writes nothing into SteamVR's own settings. pimax-linux-steamvr --check reports whether the link and the registration are still in place, and --unlink removes both again; nothing needs re-running after an upgrade, because the link points at /opt.

/opt rather than /usr/lib is deliberate. SteamVR runs inside the Steam Linux Runtime container, which shares the host's /opt (with /home, /srv, /mnt, /media and /var/tmp) but supplies its own /usr — a link into /usr/lib resolves to nothing in there and the driver is skipped without an error. See docs/RELEASING.md.

2. Start SteamVR and run Room Setup once.

vrserver.txt should show [pimax] driver: HMD registered. Then, in the SteamVR status window, run Room Setup → Standing Only. The guide detects that the chaperone is uncalibrated and keeps publishing a live pose, so the headset need not be worn — SteamVR's UI asks you to put it down, and it can now be tracked while it sits there. This writes the standing zero pose that SteamVR's Recentre button rewrites; without it, recentre has nothing to act on.

Put the headset on afterwards: the wearing guide appears and walks through eye placement, then offers to tune IPD.

To stop the driver picking up the headset without stopping SteamVR, set device.startWithoutHeadset to false; to disable the guide, remove it from SteamVR's Startup Overlay Apps list.

Building from source instead

Build.

cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build -j"$(nproc)"

udev rules, EDID override and the eye tracker (root, once).

The headset needs permission rules, an EDID override, and for eye tracking a rule for the Tobii tracker that appears once the headset enables it. The EDID override is applied for you: the rule fires when the headset is plugged in and the service runs pimax-probe edidfix --apply, which only acts when the override is actually missing. It is in debugfs, so it is lost on reboot and whenever the device re-enumerates - which is exactly why the rule is on plug-in rather than on a boot timer, and why the unit carries no "once per boot" marker.

--system installs all of it and reloads udev and systemd:

./scripts/install.sh --system     # prompts for sudo

Re-plug the headset, then check:

./build/pimax-probe list       # 34a4:0012 listed without root
./build/pimax-probe edidfix    # exit 0 = override active
systemctl status pimax-edid-fix --no-pager   # what the automatic path did

If you move the headset to another display port, run sudo pimax-probe edidfix --clear afterwards - the override is per connector and would otherwise be inherited by whatever is plugged into the old port. The next plug-in then re-applies it on the new one by itself. See docs/EDID.md.

The service needs one thing: the probe at /usr/local/bin/pimax-probe, which ./scripts/install.sh --system installs. The EDID patching itself is built into the probe - no Python tool to install, no virtualenv to keep on root's path. See docs/EDID.md.

The rules grant MODE="0666" to the headset's hidraw, USB and video nodes and to the Tobii tracker. On a single-user desktop that is what makes the probe and the driver work without root; on a multi-user machine it also lets any local account open those interfaces. That is a deliberate beta trade-off while the driver is tested, not a claim that it is ideal. A 0660 rule with a pimax group is the intended follow-up; until then, do not install these rules on a shared host.

If eye tracking registers but gaze never arrives, check scripts/99-pimax-tobii.rules is installed and 2104:0220 appears once the headset is on. See docs/EYE-TRACKING.md.

Install the driver (no root).

Quit SteamVR first: replacing a library while the runtime has it mapped leaves SteamVR on the old code, and the installer checks for vrserver/vrmonitor/vrcompositor/pimax-control and refuses rather than half-install. Then:

./scripts/install.sh

It builds first, because the driver directory (build/pimax) is assembled by the build: the dist target is what copies resources/ — icons, render models, driver.vrresources — and config/ next to the library. It then verifies the installed .so, driver.vrresources and config against the build. --no-build installs whatever build/pimax already holds, which is how an edited icon or config fails to ship.

If you also want the boot-time services (EDID override, headset shutdown) from this path, re-run it as ./scripts/install.sh --system. It prompts for sudo and installs the probe to /usr/local/bin, the two documents the units reference, the three udev rules, the two systemd units, and — on a host with NVIDIA and pacman — the NVIDIA patch tree and the two pacman hooks that keep it applied. It also writes /etc/pimax-linux/nvidia.conf with allow_untested=1. It never edits SteamVR's own configuration. On a non-pacman host the hooks are skipped; the patch tree is still installed for the manual commands in DISPLAY.md. The units are installed but not enabled: enable the shutdown one with sudo systemctl enable pimax-shutdown.service if you want the headset powered off with the PC (test pimax-probe shutdown --dry-run first). The EDID unit is triggered by udev and needs no enabling.

This copies the driver into SteamVR's drivers/pimax rather than linking it, registers Pimax Control as a startup overlay app, and installs the guide's artwork. It does not modify SteamVR's settings. Start SteamVR and run Room Setup as in step 2 above.

Uninstall

The package:

pimax-linux-steamvr --unlink     # remove the driver link and the overlay registration
sudo pacman -R pimax-linux       # then the package itself

Your data stays where it is: ~/.config/pimax/ (settings), ~/.local/share/pimax/ (gaze map, calibration inputs, logs). The headset itself is untouched; firmware was never written.

A source install:

./scripts/install.sh --uninstall

It removes the driver directory from every SteamVR it can find (including libraries listed in libraryfolders.vdf), deregisters Pimax Control, removes the user probe and — with sudo — the udev rules, units, pacman hooks, /usr/local/share/pimax-linux and /etc/pimax-linux/nvidia.conf. It keeps ~/.local/share/pimax/gaze-map.json, control.log and the eye-tracking inputs: those are results and calibration data, not installation. The headset itself is untouched; firmware was never written.

Why the EDID step needs root

The Crystal's EDID carries no Microsoft HMD vendor block, so Linux enumerates it as an ordinary monitor: it appears on the desktop, and a Wayland compositor may try to drive it as a screen instead of leaving it to SteamVR. The fix is an EDID override that appends that block and drops the YCbCr modes.

Linux offers no persistent, unprivileged way to apply one. The only mechanism is the kernel's debugfs node:

/sys/kernel/debug/dri/<card>/<connector>/edid_override

That is why the work is split the way it is:

  • pimax-probe edidfix — check only. Compares what the kernel currently reports with what the patcher would write, and needs no privileges. Exit 0 means active, 3 means missing.
  • pimax-probe edidfix --apply — writes the override, so it needs root, and resets the headset so the display link comes back up and the kernel re-reads the EDID.
  • scripts/pimax-edid-fix.service — the same thing without you doing it, and not on a boot timer: a udev rule asks systemd for this unit when the headset appears (ACTION=="add"), so it is applied the first time the headset enumerates after a reboot, and again if you plug it in later. It runs as root because debugfs is root-only. There is no "once per boot" marker: the override can be lost after it was applied, so the unit re-runs, and pimax-probe edidfix only resets when the EDID actually differs.

pimax-probe needs root for nothing else. Once the udev rules are installed, every other command — info, ipd, screen, vst, shutdown, controllers — runs as your user.

The alternative, and why it is not done

A kernel-side fix would make this permanent: patch DRM so it applies the corrected EDID to this display itself, with no debugfs write, no udev rule and no unit. It is not done here, deliberately. It means carrying a patch against the kernel's EDID handling across every kernel update, rebuilding whenever the distro bumps the version, and re-verifying after each one — and when it is dropped by an update the failure is silent, appearing as "the headset is a monitor again" with nothing in the logs pointing at the cause. One volatile debugfs write each time the headset appears is a smaller thing to maintain than a patch that has to survive kernel releases.

See docs/EDID.md for how the check works and why the headset has to be reset.

Using the wearing guide

The guide is a separate app that SteamVR launches with the runtime and stops with it — nothing is run by hand. It appears only on the wear event (eyes and on-head sensor together), shows one card per state, holds through blinks, and disappears once the cycle completes until the headset is taken off and put back on.

Its artwork is editable: resources/guide/*.svg, 512×512. Render what the app will draw with:

./build/pimax-control --dump-art tmp/art

Configuration

config/pimax.json ships the tuning that works on this hardware and is the source of truth. The loader starts from Config.h defaults, applies the shipped config/pimax.json, then applies ~/.config/pimax/pimax.json on top as an override — it never replaces the shipped values. Setting PIMAX_CONFIG names one complete file and short-circuits that layering, which is what a test or a one-off experiment wants.

Groups that matter day to day:

group what it controls
display resolution, refresh rate, rotation, IPD, render scale, distortion mesh resolution, eye transforms
distortion lens curve points, chroma, field of view
tracking prediction, recentring, device pose pass-through, velocity integration, VST clearing
controller types, input profile, touch publishing, analog rate, power-off on standby/exit
eyeTracking stream id, axis signs, auto-IPD limits and tolerances
proximity unwearSeconds — how long both signals must be clear before the wearer counts as gone
audio autoSwitch — whether the driver makes the headset the default sink/source; also the panel toggle
chaperone provide = false leaves the play space to SteamVR, which is what makes Room Setup and recentre work. Setting it true makes the driver supply the play area instead: no setup prompt, but SteamVR then hides Room Setup and its recentre does nothing
display.refreshHz the panel rate; the EDID offers one mode, 119.98 Hz, so changing this does not add a mode

The configuration is read when the driver is set up, so restart SteamVR after editing it. The package's copy is /opt/pimax-linux/driver/config/pimax.json, which an upgrade replaces — put lasting changes in ~/.config/pimax/pimax.json (what the panel writes). A source tree rebuilds and re-copies it with ./scripts/install.sh; do that with SteamVR stopped.

Tools

The package puts pimax-probe and pimax-control on PATH; a source build has them in build/. The last three are build-time tools that are not packaged.

pimax-probe selftest      # math and config consistency, no hardware
pimax-probe info          # device handshake: proto, model, serial
pimax-probe display       # resolved geometry, FOV, eye positions
pimax-probe ipd 64.5      # move the lenses; bare `ipd` reads the current separation
pimax-probe ipdf 64.5     # write a float payload directly (bypasses the 58-72 mm clamp)
pimax-probe screen on|off # panel standby
pimax-probe vst 0|1       # VST stream (disables 6DoF — see the warning it prints)
pimax-probe controllers status
pimax-probe shutdown      # power the headset down; enable pimax-shutdown.service for PC shutdown
pimax-probe edidfix       # check/apply the EDID override
./build/warp_compare a.json b.json  # score two optics configurations, in degrees and pixels
./build/probe_distort             # the warp at centre and edges
./build/vr_pose_probe             # watch what the runtime believes, without the headset

pimax-probe refuses to change anything it cannot verify first, and prints the reason when it refuses.

Troubleshooting

  • Both eyes show the same half of the image — the NVIDIA 2Heads1OR fix is not applied. See nvidia-patches/.
  • "Failed to connect to headset display" and only a restart clears it — SteamVR's compositor creates its direct-mode surface about 300 ms after driver load and gives up permanently if the panel is dark. The driver wakes the panel at connect and leaves it awake at exit to keep that window closed; if it still happens, restart SteamVR. See DISPLAY.md.
  • SteamVR crashes in the compositor — set dashboard.enableLTCReflections to false in SteamVR's own steamvr.vrsettings (this is a SteamVR setting, not a key this driver reads). With it enabled, SteamVR's dashboard exhausts the compositor's 256 MiB reflection ring on this headset; that is upstream SteamVR-for-Linux #1006, not something this driver can fix.
  • The wearing guide does not appear — ~/.local/share/pimax/control.log records every wear event, card change and refusal, with the measurements that caused it. It is the first place to look.
  • Controllers connect then drop — see docs/CONTROLLERS.md; the headset's own SLAM is asymmetric between hands and a re-arm cadence is documented there.
  • Headset does not appear as a display, or appears but shows nothing — first confirm you are on KWin Wayland; that is the only session tested. Then docs/EDID.md and docs/DISPLAY.md.
  • No sound in the headset — the speakers are DisplayPort audio, not USB, and the headset mutes itself until its link is up and it is on the wearer. docs/AUDIO.md has the checks (pimax-probe audio, the audio: log lines, and where SteamVR confirms the default sink).

Documentation

file contents
ARCHITECTURE.md how the pieces fit: provider, devices, transport, display
PROTOCOL.md the HID protocols, frame by frame
CONTROLLERS.md controller report layout, inputs, touch, joystick, force, jitter
CONTROLLERS-PAIRING.md pairing and unpairing, and what the headset does and does not report
EYE-TRACKING.md Tobii session, gaze axes, auto-IPD, the wearing guide
TRACKING-6DOF.md how 6DoF comes out of the headset's own SLAM
DISPLAY.md panel, viewport, distortion, direct mode
EDID.md why the EDID override exists and what it does
SHUTDOWN.md powering the headset down with the PC
AUDIO.md why the speakers are DisplayPort audio, and how the driver hands the sink to SteamVR
CHANGELOG.md what changed in this release and what is known not to work
RELEASING.md how a release becomes a tagged snapshot on the public mirror, and the binaries
ASSETS.md which files are ours under the GPL and which are Pimax's

Why not run the Windows stack under Wine

The Windows stack is not an ordinary user-space program: PiPlayService installs kernel filter drivers, the aapvr driver is a Windows DLL loaded into vrserver, and pimax_slam.pi.dll is native Windows code. None of it crosses a Wine boundary usefully. This project instead speaks the two protocols the headset actually exposes.

Safety

The driver reads the headset and sets display state. It never writes firmware, never sends OTA commands and never contacts Pimax services. Firmware flashing is a permanent no-go: a bad image can brick the headset. powerOffHmd and rebootHmd exist in the transport and are not called; gotoSleep is the screen-standby command and is used. Headset shutdown is the only power action offered, behind an arm/commit token in the driver and a two-press confirmation in the panel.

Provenance

The protocol offsets, the DirectXR2 framing and the measured lens curve were established by reverse-engineering Pimax's own software and the headset's behaviour. Earlier community work (CustomHeadsetOpenVR, GPL-2.0) is referenced as prior art only — no source code from it is used here. The lens curve is measurement data, and only a default in config/pimax.json.

Third-party code: nlohmann/json (MIT) and the OpenVR headers (BSD-3-Clause), both pinned as submodules under third_party/ with their own licence files - see ASSETS.md.

About

SteamVR/OpenVR driver for the Pimax Crystal on Linux: display, 6DoF from the headset's own SLAM, controllers, eye tracking.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages