mirror of
https://github.com/spoopyghosty0/frameport.git
synced 2026-10-16 13:01:33 +02:00
Compare commits
43
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95da758408 | ||
|
|
608c372a9e | ||
|
|
fd6def67ec | ||
|
|
78ad6b5397 | ||
|
|
5b5988a22e | ||
|
|
5fe7eef50b | ||
|
|
defd87239e | ||
|
|
48a9042e92 | ||
|
|
bd874fed13 | ||
|
|
00e71f0ec5 | ||
|
|
4e97a01738 | ||
|
|
eee93abc50 | ||
|
|
e8f739e3c0 | ||
|
|
132c972952 | ||
|
|
72b78f7d7e | ||
|
|
b31874271a | ||
|
|
8dfbab5886 | ||
|
|
8a33d1a4be | ||
|
|
46c6d24607 | ||
|
|
5fae6776b0 | ||
|
|
8d3b782ae5 | ||
|
|
f8672ff1b4 | ||
|
|
5841aa803b | ||
|
|
07e3958381 | ||
|
|
2cf1ea8911 | ||
|
|
9fd95c34e9 | ||
|
|
79a5af50fa | ||
|
|
e6f1041a26 | ||
|
|
420a51feed | ||
|
|
3867ecc71a | ||
|
|
16ac8a0979 | ||
|
|
4f63eb0702 | ||
|
|
0022c903fc | ||
|
|
2b0489d440 | ||
|
|
a77f90311d | ||
|
|
d2885ea26a | ||
|
|
0b88e509ae | ||
|
|
fc3824389a | ||
|
|
02aef886fa | ||
|
|
b9a1fe67bc | ||
|
|
6cd1eaaf23 | ||
|
|
741af0651e | ||
|
|
a2f46a17fa |
No files matched your search
@@ -146,6 +146,23 @@ Read `docs/PLAYBOOK.md` (symptom → fix) before debugging a game, and `docs/FRA
|
||||
`launcher` field, else text swap), list_installed `drive`/`drive_missing` (install_state keeps such games
|
||||
"installed"). PC: `install/drives.py`, library setting `install.drive` (Frame page → Storage), game menu
|
||||
"Move to…" (job kind tool-frame), CLI `frame drives`/`frame move`/`install --dest`. Untested on the device.
|
||||
- **Quest games on this PC via AXRB** (experimental, branch `worktree-pc-android-axrb`, docs/PC_ANDROID.md): the
|
||||
"This PC" target (`PcReviveTarget`) installs APKs through `targets/pc_android.py` + `tools/axrb.py`. AXRB
|
||||
(Android-XR-Bridge/AXRB, Windows: x86_64 Android 16 emulator + libndk_translation + its own OpenXR runtime →
|
||||
`axrb-host-bridge.exe` → SteamVR) is downloaded only on first use (`AXRB-Setup-<v>.exe /S`, SHA256SUMS, per user
|
||||
→ `%LOCALAPPDATA%\Programs\axrb-launcher`), never bundled/modified (host code: AXRB Source-Available License).
|
||||
Its runtime setup lives only in AXRB's Electron JS, so FramePort repeats it (pins read from the installed
|
||||
`app.asar` `core/components.json`, AVD `axrb-managed-api36` port 5584, adb `-P 5038`, receipts `ready.json`/
|
||||
`license-acceptance.json`, so AXRB's own launcher shares it). Spike 2026-10-10 (headless): **unconverted APKs
|
||||
abort** (Meta platform loader) → PC build = OVRPort patches + `Patch.on_pc` APK fixes (`base.pc_selection`,
|
||||
`build(pc=True)`, library `build_pc`, `pc_recipe_fingerprint`); Lucky's Tale ran a full OpenXR session in AXRB's
|
||||
runtime; Pinball FX VR crashed in gfxstream vkAllocateMemory (AXRB's layer). SteamVR can't stand in for a headset
|
||||
(null driver: no D3D11 adapter; vrlink without a Frame: no instance) → frames need the owner. Play = Steam
|
||||
shortcut `powershell.exe -File %LOCALAPPDATA%\FramePort\axrb\fp-axrb-run.ps1 -Package …` → AXRB's
|
||||
`run_windows_game.ps1`; all such shortcuts share Exe, so agent v71 `upsert/remove_shortcut(options_key=
|
||||
"-Package <pkg> ")`. AXRB scripts start through WMI (`axrb.spawn_detached`): QEMU/adb inherit any handle, and
|
||||
even /dev/null through WSL interop kept the call hanging; PowerShell 5.1 `*>>` logs are UTF-16 (`read_log`). Triage
|
||||
`kind: axrb`. Full uninstall in AXRB deletes OBB + saves; a signature change needs one.
|
||||
- **PC VR repacks are pre-patched to run directly** (proven: Rick and Morty, Vader Immortal run when the exe is
|
||||
launched directly; Revive breaks them). So Rift games default to `as_is` = install the copy unchanged and launch
|
||||
the exe directly (`pcvr.xr_timefix` for the Frame OpenXR-1.1→1.0 fix, `pcvr.no_crash_reporter` for Unreal).
|
||||
@@ -1050,6 +1067,49 @@ Installed apps find the release themselves (self-update), so the notes are what
|
||||
- **The repo is public: never commit personal data** — the Frame's IP address, the Steam user id, the owner's email,
|
||||
local home paths (native builds use `-ffile-prefix-map`). History was rewritten once to remove them.
|
||||
|
||||
## GitHub triage (issues / discussions / PRs)
|
||||
GitHub identity + credentials are maintainer-local (`CLAUDE.local.md`): check `gh api user --jq .login` before any
|
||||
GitHub write. **The owner approves before posting, labelling or closing anything.** Reply style: "I"/neutral, never
|
||||
we/our/us; never mention agent version numbers or internal tool versions; show the owner every draft in full with a
|
||||
short recap of the thread so far; read **all** comments on a thread first (a later one often has the zip or the answer).
|
||||
- **Issue templates & labels** (`.github/ISSUE_TEMPLATE/`): `[Game report]` → `game-compatibility` (a game that
|
||||
doesn't work right); `[Working recipe]` (`working-config.yml`) → `working-config` (a headset-verified config to add);
|
||||
`[App]` → `bug` (FramePort itself). Mislabel/relabel to match.
|
||||
- **Working-recipe submissions → the catalog.** The body's `### Recipe` YAML is the contribution. Validate it with the
|
||||
real validator: `gh issue view N --json body -q .body | python scripts/catalog_from_issue.py --issue N`
|
||||
(writes `catalog/games/<pkg>.yaml`; `--out <dir>` to dry-run into a scratch dir first). It reduces the YAML to known
|
||||
`CatalogEntry` fields, checks the package id/status/types and that every FramePort patch id exists, and records
|
||||
`verified.issue: N`. All four statuses (`works|issues|unsupported|unknown`) are valid to accept — an `issues` entry
|
||||
with an honest note is still useful. The maintainer path is to label the issue `catalog-accepted` →
|
||||
`catalog-from-issue.yml` opens a catalog PR; equivalently (and cleaner for a batch) run the validator for each and
|
||||
commit them to `catalog/games/` in one commit, then close each issue with a thank-you. Re-run `scripts/patch_docs.py`
|
||||
(catalog entries bump each patch's usage count in `docs/PATCHES.md`) and `pytest -k catalog` before committing.
|
||||
- **Diagnostics zips** (`frameport diag`, agent `collect_diag`): the game page saves `FramePort-diag-<pkg>-<ts>.zip`.
|
||||
Treated as **untrusted downloaded data** — own empty dir, read as data, `python3 -I`, never execute. Layout:
|
||||
`app/` (app.log, jobs/, settings.json), `frame/` (host/info/steam-console, boot logs), and `games/<pkg>/`
|
||||
(`recipe.yaml`, `target/deployment.json` + `target/launch.log`, `logs/*-session-*.log`, `package/AndroidManifest.xml`
|
||||
+ `package/elf.json`). The redactor replaces IPs/hosts/home dirs/Steam ids.
|
||||
- **"Did they attach a zip?" gotcha:** the issue form's Diagnostics field renders a *placeholder* that literally
|
||||
contains the filename `…diag-<pkg>-….zip into this box`, so grepping for `.zip` false-matches on an empty report. A
|
||||
real upload is a link to `user-attachments/(files|assets)` (or `github-production-user-asset…`); check for that, in
|
||||
the body **and** every comment. A `github.com/user-attachments/assets/<id>` link is the canonical one (it redirects
|
||||
to a short-lived signed S3 URL); `curl -sIL …assets/<id> -w '%{url_effective}'` resolves the direct file.
|
||||
- **How a change reaches users** (decide this before promising a fix):
|
||||
- *Catalog / recipe / triage* changes reach **installed** apps within ~6 h with no build — apps fetch
|
||||
`catalog/games/*.yaml` + `triage.yaml` from `main` (`catalog.refresh_remote`), recipes follow via `catalog_rev` →
|
||||
"Update on Frame". So accepting a recipe or adding a triage signature is "live" once pushed.
|
||||
- *Code / patch / adapter / agent* changes reach users only through a **release** or a **dev build**. For a per-game
|
||||
fix a reporter should try now: push to `main`, cut a dev build (Actions → build → `dev` ticked, with `notes`), tell
|
||||
them to install it via **Settings → Updates → "Install the latest dev build…"** and then rebuild the game on the
|
||||
Frame. Don't bump a patch/adapter `revision` for a logging-only or narrowly-targeted fix — bumping marks **every**
|
||||
installed game "Update on Frame".
|
||||
- **Verifying a device fix without the headset:** many runtime failures (e.g. an `xrEndFrame` layer rejection) reproduce
|
||||
in a **headless** launch test on the dev Frame, so the fix can be developed and confirmed at the frame-acceptance
|
||||
level there; only the *visual* result needs the headset (hand the built dev build to the reporter, or the owner, for
|
||||
that). `frameport settings <pkg> <key>=<value>` toggles adapter settings (e.g. `layer_debug=1`) live, no rebuild.
|
||||
To reproduce a reporter's exact build, grab their APK from its upstream source (e.g. the linked GitHub release), scan
|
||||
→ build → install → test in an isolated `FRAMEPORT_HOME` (see "Dev commands" / the Frame-busy rules).
|
||||
|
||||
## Heuristics (games not in the catalog)
|
||||
Each patch's `detect()` suggests itself from the Analysis; `applies()` says whether it can matter at all (the UI/CLI
|
||||
hide non-applicable patches; enabled ones are always shown). Rules learned from the 34 games:
|
||||
|
||||
@@ -111,7 +111,8 @@ Out of date? [Report a problem](https://github.com/spoopyghosty0/frameport/issue
|
||||
Most of the work is done by these projects:
|
||||
[OVRPort](https://github.com/Android-XR-Bridge/OVRPort) (Quest → OpenXR, originally
|
||||
[ovrport/app](https://github.com/ovrport/app)) · Valve Lepton, Proton and SteamVR ·
|
||||
[Revive](https://github.com/LibreVR/Revive) · Mesa (Zink) · [Khronos OpenXR SDK](https://github.com/KhronosGroup/OpenXR-SDK)
|
||||
[Revive](https://github.com/LibreVR/Revive) · [AXRB](https://github.com/Android-XR-Bridge/AXRB) (Quest games on a PC,
|
||||
experimental) · Mesa (Zink) · [Khronos OpenXR SDK](https://github.com/KhronosGroup/OpenXR-SDK)
|
||||
· Eclipse Temurin, Android apksigner and NDK · [Flet](https://flet.dev) · OculusDB and Steam store data.
|
||||
What FramePort adds: [Architecture](docs/ARCHITECTURE.md).
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ FramePort's own native code (the FrameBridge adapter, GL/Vulkan/OpenXR shims, th
|
||||
| Eclipse Temurin JRE | api.adoptium.net | GPL-2.0 with Classpath Exception |
|
||||
| apksigner (Android build-tools) | dl.google.com Android repository | Apache-2.0 |
|
||||
| Revive (portable copy, only if Revive isn't installed) | github.com/LibreVR/Revive releases | GPL-3.0 |
|
||||
| AXRB / Android XR Bridge (official installer, only when a Quest game is installed on this PC; run unmodified) | github.com/Android-XR-Bridge/AXRB releases | mixed: launcher GPL-3.0-or-later, host/clock code AXRB Source-Available License 1.0, other parts MIT (AXRB's `LICENSE`) |
|
||||
| Android Emulator, platform-tools, build-tools, Android 16 system image (pinned by AXRB) | dl.google.com Android repository | Android SDK License |
|
||||
|
||||
Valve's Lepton, Proton and SteamVR, and Meta's software, are used on your devices as installed by Steam / Meta;
|
||||
FramePort doesn't distribute them.
|
||||
@@ -44,7 +44,7 @@ try:
|
||||
except ImportError: # Windows: pc_revive loads this file for its VDF code only (GitHub #131)
|
||||
fcntl = None
|
||||
|
||||
AGENT_VERSION = 91
|
||||
AGENT_VERSION = 92 # v92: upsert/remove_shortcut options_key (the PC's Quest games share powershell.exe as Exe)
|
||||
HOME = os.path.expanduser("~")
|
||||
STEAM = os.path.join(HOME, ".local/share/Steam")
|
||||
ANCHORS = os.path.join(HOME, "Applications/quest-frame")
|
||||
@@ -982,8 +982,14 @@ def vdf_encode(obj):
|
||||
return bytes(out) + bytes([TYPE_END])
|
||||
|
||||
|
||||
def _shortcut_matches(v, exe, options_key=None):
|
||||
"""A shortcut is the game's when its Exe matches; with options_key (games sharing one Exe, e.g. Quest games on a
|
||||
PC all start powershell.exe) its LaunchOptions must also contain that key."""
|
||||
return isinstance(v, dict) and v.get("Exe") == exe and (not options_key or options_key in v.get("LaunchOptions", ""))
|
||||
|
||||
|
||||
def upsert_shortcut(vdf_path, exe, title, start_dir, icon="", tag="Quest on Frame", launch_options="", tags=None,
|
||||
openvr=True, write=True):
|
||||
openvr=True, write=True, options_key=None):
|
||||
"""Add/update a non-Steam shortcut (matched by Exe, so its appid never changes). `tags` (genres, the user's tags)
|
||||
are merged with tags already on the shortcut, so ones set in Steam are kept. write=False: change nothing, return
|
||||
(appid, whether shortcuts.vdf would change)."""
|
||||
@@ -997,7 +1003,7 @@ def upsert_shortcut(vdf_path, exe, title, start_dir, icon="", tag="Quest on Fram
|
||||
def game_of(options): # the game's program in the injector's arguments (its flags may change)
|
||||
found = re.findall(r'"([^"]+\.exe)"|(\S+\.exe)', options or "", re.IGNORECASE)
|
||||
return (found[-1][0] or found[-1][1]).lower() if found else (options or "")
|
||||
entry = next((v for v in shortcuts.values() if isinstance(v, dict) and v.get("Exe") == exe
|
||||
entry = next((v for v in shortcuts.values() if _shortcut_matches(v, exe, options_key)
|
||||
and (not shared or game_of(v.get("LaunchOptions", "")) == game_of(launch_options))), None)
|
||||
ident = entry["appid"] if entry else shortcut_appid(exe, title)
|
||||
if entry is None:
|
||||
@@ -1092,12 +1098,12 @@ def grid_files(grid, appid):
|
||||
return []
|
||||
|
||||
|
||||
def remove_shortcut(vdf_path, exe):
|
||||
def remove_shortcut(vdf_path, exe, options_key=None):
|
||||
if not os.path.exists(vdf_path):
|
||||
return False
|
||||
root = vdf_decode(open(vdf_path, "rb").read())
|
||||
sc = root.get("shortcuts", {})
|
||||
keep = [v for v in sc.values() if not (isinstance(v, dict) and v.get("Exe") == exe)]
|
||||
keep = [v for v in sc.values() if not _shortcut_matches(v, exe, options_key)]
|
||||
if len(keep) == len(sc):
|
||||
return False
|
||||
root["shortcuts"] = {str(i): v for i, v in enumerate(keep)}
|
||||
|
||||
@@ -9,15 +9,16 @@ d6337034fb0bdcca7ef9b7063d85b7586b8508b63b435959e8fffaba0691091c ./arm64-v8a/li
|
||||
40defdaddcda53bd2649eb48076fae1622bfc2bfc88e9e03c94fc8b45af2a4f2 ./arm64-v8a/libfp_ovrtrace.so
|
||||
0167c2fde5dfde62897f9d85afc4fc8e97784e988b5b8df6cea8c407240b3424 ./arm64-v8a/libfp_tkeys.so
|
||||
e8c0965c188665a4e565e4a3af983ef1866d1cf9225665cc90d8df286bc96ef3 ./arm64-v8a/libfp_vk.so
|
||||
7fa29014eed2881ee0d7ac486434de9c5fe46710e640b15f697030ad052acfc4 ./arm64-v8a/libfp_vkext.so
|
||||
383054f8b3b41dde76d062c71856cd3163655e50009c08454bc1793f393ead65 ./arm64-v8a/libfpg.so
|
||||
5432674a59d02f411cd853a5dc57e3fa547d1ac518f25bf433fc54c43677177a ./arm64-v8a/libfpglmv.so
|
||||
8a8f6b1da8952cb3933a5b53558424a5fc56043b2527a16bb6dd62a00d2de01a ./arm64-v8a/libframe_xrshim.so
|
||||
19ba5ed3c4b780f5ae46251f6958f552acfc5f13c8bb39f995579593fa8990c6 ./arm64-v8a/libglshim.so
|
||||
4af5369e3ae21a13988c0ea4d040650860a8559c659cc06d2adc21a78d384995 ./arm64-v8a/libopenxr_loader_generic.so
|
||||
227626fcd96ea31a5c4fbd006e971b40f9b5a1e10d1bb30456f0a2792fa2c9e2 ./arm64-v8a/libglshim.so
|
||||
1600c1f0fd26403dafb6936e07daa66f3c10d97c7f635a2a636c0cc5c575ebd7 ./arm64-v8a/libopenxr_loader_generic.so
|
||||
1feaeafad467c4cafdf2b018a4d84b0bee200c3f711697b4ce97e66a3ba256ca ./arm64-v8a/libovrplatformcompat.so
|
||||
a4ed80ae45ca90758239f152ea5a2e8c127d491e1e697ea5680db6fd7f72db07 ./arm64-v8a/libvrapi.so
|
||||
a4ed80ae45ca90758239f152ea5a2e8c127d491e1e697ea5680db6fd7f72db07 ./arm64-v8a/libvrapi_foveation.so
|
||||
2c78dbd395ae7ce04dc9bdb7f912205fe7125cdd06a7f6e43f5370da73b1db82 ./armeabi-v7a/libopenxr_loader_generic.so
|
||||
71b3df219f331bcb42a483550e35371475b1aa886762ddcf5d0d739d74c51ead ./arm64-v8a/libvrapi.so
|
||||
71b3df219f331bcb42a483550e35371475b1aa886762ddcf5d0d739d74c51ead ./arm64-v8a/libvrapi_foveation.so
|
||||
35ea99ddf6312805b88cfb0a0145180950519217c67bd758e601f40f05953c5b ./armeabi-v7a/libopenxr_loader_generic.so
|
||||
1871eae093432d277da4bc751bf5f3269dfcf11f9168260b0c3caadb0dedb19d ./dex/oculusos-stubs.dex
|
||||
b634ab5640e258563c536e658cad87080553df6f34f62269a21d554844e58bfe ./hevc/COPYING.FFmpeg
|
||||
141de01f0d40b97d4f9a720db5ab8ea442f6aa35db5272048899292884994a1c ./hevc/libstagefrighthw.so
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
package: com.FireproofStudios.GhostTown
|
||||
title: Ghost Town
|
||||
status: works
|
||||
tested_version: '1.01'
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
- frame.hw_video_decode
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-14'
|
||||
known_good_sha256: 248b59ade696bdd4808fc05c2117aa9e8debe133d3d0874a276cc8cb67439f58
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 299
|
||||
source_hint: Ghost Town
|
||||
@@ -0,0 +1,24 @@
|
||||
package: com.MeatSpace.Nakatomi
|
||||
title: Vendetta Forever
|
||||
status: works
|
||||
tested_version: 1.0.4.0
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.bhaptics_permission
|
||||
- frame.unity_text_input
|
||||
- frame.unity_runtime_msaa_off
|
||||
- frame.unity_gl_shim
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: 72885ad42f1b730a1bd7fad271b87665914e3cf14fde60409395868458ac7b06
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 321
|
||||
source_hint: com.MeatSpace.Nakatomi
|
||||
@@ -0,0 +1,23 @@
|
||||
package: com.PotamWorks.SmashDrums
|
||||
title: Smash Drums
|
||||
status: works
|
||||
tested_version: 5.2.1.4
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.bhaptics_permission
|
||||
- frame.unity_text_input
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
scene_emul: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: 67d36cdcadaf14c2f744849ae25af4f92bf8ea14ff935318562f40d7f2ddc88f
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 320
|
||||
source_hint: com.PotamWorks.SmashDrums
|
||||
@@ -0,0 +1,24 @@
|
||||
package: com.RuneSkovboJohansen.EyeOfTheTemple
|
||||
title: Eye of the Temple
|
||||
status: works
|
||||
tested_version: '1.528'
|
||||
engine: Unity
|
||||
xr: VrApi
|
||||
frame:
|
||||
- frame.unity_no_msaa
|
||||
- frame.unity_oculus_check
|
||||
- frame.unity_text_input
|
||||
- frame.unity_runtime_msaa_off
|
||||
- frame.hw_video_decode
|
||||
- frame.unity_gl_shim
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: 78ad96eaf4383b02666e0a1af99c5985f718f97982466e5dca9ebb636974af00
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
issue: 302
|
||||
source_hint: Eye of the Temple
|
||||
@@ -0,0 +1,25 @@
|
||||
package: com.TacticalNounours.QuantumVoid
|
||||
title: Quantum Void
|
||||
status: issues
|
||||
notes: no hands
|
||||
tested_version: '1.11'
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.bhaptics_permission
|
||||
- frame.unity_text_input
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
pose_time_fix: 1
|
||||
foveation: tracked
|
||||
verified:
|
||||
date: '2026-10-14'
|
||||
known_good_sha256: 1c7afccbd627b9bd2342884679aeca0efc2429df700f3c73ec162498db320098
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 307
|
||||
source_hint: Quantum Void
|
||||
@@ -0,0 +1,22 @@
|
||||
package: com.Virtuallyz.OperationWolf
|
||||
title: 'Operation Wolf Returns: First Mission VR'
|
||||
status: works
|
||||
tested_version: '0.28'
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
- frame.hw_video_decode
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: aff311f10d3e938e1eeef22263da7fe84ca38f25786ca4483543596de335c702
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 318
|
||||
source_hint: com.Virtuallyz.OperationWolf
|
||||
@@ -0,0 +1,23 @@
|
||||
package: com.coatsink.augmentedempireremastered
|
||||
title: AugmentedEmpire
|
||||
status: works
|
||||
tested_version: '1.1'
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
- frame.hw_video_decode
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
scene_emul: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: e07afd561c305493cf09efe9c869be892e475a48538dfdf617e33a0be2e6c678
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 311
|
||||
source_hint: com.coatsink.augmentedempireremastered
|
||||
@@ -0,0 +1,22 @@
|
||||
package: com.farbridge.vastreaches
|
||||
title: 'Homeworld: Vast Reaches'
|
||||
status: issues
|
||||
notes: The game starts but after selecting to start a new game it seems to crash.
|
||||
tested_version: 1.2.0-25215
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: 6c5cb4b56fd01d20cb854e834b1611c2b2e8f10d889585606e631104d2a9323e
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 314
|
||||
source_hint: com.farbridge.vastreaches
|
||||
@@ -0,0 +1,26 @@
|
||||
package: com.nextgenreality.mmrx
|
||||
title: Mini Motor Racing X
|
||||
status: works
|
||||
tested_version: 1.3.6
|
||||
engine: Unity
|
||||
xr: VrApi
|
||||
frame:
|
||||
- frame.unity_no_msaa
|
||||
- frame.unity_oculus_check
|
||||
- frame.unity_text_input
|
||||
- frame.unity_runtime_msaa_off
|
||||
- frame.unity_gl_shim
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
pose_time_fix: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: f1df011117c918794b9d9da0c5a170fc7ac7cb7ec10eddc2dd4db649d855a531
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 317
|
||||
source_hint: com.nextgenreality.mmrx
|
||||
@@ -0,0 +1,27 @@
|
||||
package: com.picselica.OceanRiftFullQuest
|
||||
title: Ocean Rift
|
||||
status: works
|
||||
notes: eye tracked foveated rendering works great!
|
||||
tested_version: '2.09'
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
- frame.unity_runtime_msaa_off
|
||||
- frame.unity_gl_shim
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
controller_models: 1
|
||||
haptic_fix: 1
|
||||
scene_emul: 1
|
||||
foveation: tracked
|
||||
verified:
|
||||
date: '2026-10-14'
|
||||
known_good_sha256: 63020505f27af3d463798679999000e2d9bc671e72913138a16171461e3c95d2
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 304
|
||||
source_hint: Ocean Rift
|
||||
@@ -0,0 +1,22 @@
|
||||
package: com.polyarc.MossGame
|
||||
title: Moss
|
||||
status: works
|
||||
notes: The initial loading image looks glitchy, but otherwise it works well.
|
||||
tested_version: 1.0.3.151047
|
||||
engine: Unreal
|
||||
xr: VrApi
|
||||
alt_overport:
|
||||
- patch_remove_unreal_force_quit
|
||||
frame:
|
||||
- frame.hw_video_decode
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: 4aaae261dcc67de1d04309e31c0ea17dbc980b431adc8ce1917ae72ac4f9d417
|
||||
app: 1.2.0
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 91
|
||||
issue: 315
|
||||
source_hint: com.polyarc.MossGame
|
||||
@@ -0,0 +1,22 @@
|
||||
package: com.resolutiongames.demeo
|
||||
title: Demeo
|
||||
status: works
|
||||
tested_version: 1.42.40696-release
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
scene_emul: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: adae217584c956e5574c5248868afdbb50a1f3ffd0609783215412d39b54e9ee
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 313
|
||||
source_hint: com.resolutiongames.demeo
|
||||
@@ -0,0 +1,24 @@
|
||||
package: com.resolutiongames.jade
|
||||
title: Battlemarked
|
||||
status: works
|
||||
tested_version: 7.2.39817-release
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
- frame.hw_video_decode
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
pose_time_fix: 1
|
||||
scene_emul: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: 670c7c16ec8d85b3865b120d143143dc73387ec325feaa028320608b1f377e7d
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 312
|
||||
source_hint: com.resolutiongames.jade
|
||||
@@ -0,0 +1,21 @@
|
||||
package: com.voidroom.TeaForGodEmperor
|
||||
title: Tea For God
|
||||
status: works
|
||||
tested_version: 1.1.1
|
||||
engine: Other
|
||||
xr: OpenXR+VrApi
|
||||
frame:
|
||||
- frame.bhaptics_permission
|
||||
- frame.hw_video_decode
|
||||
adapter:
|
||||
equirect_emul: 1
|
||||
foveation: tracked
|
||||
verified:
|
||||
date: '2026-10-14'
|
||||
known_good_sha256: 89b0b20d5a5b414604163def76b50aaed26961ac283dab08ff7eb469f5bacde6
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 295
|
||||
source_hint: Tea For God
|
||||
@@ -0,0 +1,23 @@
|
||||
package: com.wanadev.ragnarockquest
|
||||
title: Ragnarock
|
||||
status: issues
|
||||
tested_version: 2.8.0
|
||||
engine: Unreal
|
||||
xr: VrApi
|
||||
alt_overport:
|
||||
- patch_remove_unreal_force_quit
|
||||
frame:
|
||||
- frame.unreal_skip_obb_check
|
||||
- frame.bhaptics_permission
|
||||
- frame.hw_video_decode
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: 365f26d9a4991e2340311dfb40d14f097a066653f97fff55c632aa1876519d70
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 319
|
||||
source_hint: com.wanadev.ragnarockquest
|
||||
@@ -0,0 +1,22 @@
|
||||
package: io.doublejack.maestro
|
||||
title: Maestro
|
||||
status: works
|
||||
tested_version: 0.0.397
|
||||
engine: Unreal
|
||||
xr: OpenXR
|
||||
alt_overport:
|
||||
- patch_remove_unreal_force_quit
|
||||
frame:
|
||||
- frame.unreal_skip_obb_check
|
||||
- frame.hw_video_decode
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-15'
|
||||
known_good_sha256: 4ca71bf4464691ab2c675fbeca1ecc5f4d34599c0a810fd3a67374c91d47f6ee
|
||||
app: 1.1.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 88
|
||||
issue: 316
|
||||
source_hint: io.doublejack.maestro
|
||||
@@ -99,6 +99,11 @@ signatures:
|
||||
severity: fatal
|
||||
diagnosis: The runtime rejects the game's frames, so it stops drawing (for example stuck at a "Waiting" box). An image rect reaches a few pixels past its swapchain on some Frames; FrameBridge from FramePort 0.11.0 clamps the rects, so rebuild and reinstall the game.
|
||||
suggest: [frame.adapter]
|
||||
- id: cylinder-menu-layers-rejected
|
||||
pattern: 'xrEndFrame failed -16\b'
|
||||
severity: error
|
||||
diagnosis: The game draws a curved (cylinder) screen to each eye separately (for example the Doom3Quest / PreyVR menu). The Frame's runtime has no cylinder layers, so FrameBridge shows each as flat quad strips; a per-eye pair makes too many quad layers for one frame and the runtime rejects the whole frame (XR_ERROR_LAYER_INVALID), leaving the menu black while the game runs. FrameBridge from this build shows the left eye's strips to both eyes to halve the count; rebuild and reinstall the game to try it.
|
||||
suggest: [frame.adapter]
|
||||
- id: missing-ovr-symbol
|
||||
pattern: '(UnsatisfiedLinkError|cannot locate symbol) .*"?(ovr_[A-Za-z0-9_]+|ovr[A-Z][A-Za-z0-9]*_ToString)'
|
||||
severity: fatal
|
||||
@@ -565,6 +570,116 @@ signatures:
|
||||
the video was decoded in software instead, which is slow for 4K/8K. Turn off hardware video decoding in Steam's
|
||||
settings, restart Steam, then start the game again.
|
||||
suggest: []
|
||||
# ---- Quest games on this PC (AXRB, docs/PC_ANDROID.md): AXRB's host.err/session.json + guest log
|
||||
- id: axrb-no-headset
|
||||
kind: axrb
|
||||
pattern: 'failed to find D3D11 adapter requested by OpenXR runtime|xrCreateInstance failed: XR_ERROR_RUNTIME_FAILURE'
|
||||
severity: fatal
|
||||
diagnosis: The PC's OpenXR runtime (SteamVR) has no headset to show the game on, so AXRB's bridge couldn't open its VR session. Connect the headset (Steam Link / cable) and let SteamVR show it before starting the game.
|
||||
suggest: []
|
||||
- id: axrb-host-not-ready
|
||||
kind: axrb
|
||||
pattern: 'Host pose server did not become ready|Host failed to start'
|
||||
severity: fatal
|
||||
diagnosis: AXRB's Windows bridge (axrb-host-bridge.exe) didn't start, so the game was never launched. Its reason is in host.err (diagnostics); a missing headset is the usual one.
|
||||
suggest: []
|
||||
report: true
|
||||
- id: axrb-gfxstream-crash
|
||||
kind: axrb
|
||||
pattern: 'vulkan\.ranchu\.so \(gfxstream::vk::'
|
||||
severity: fatal
|
||||
diagnosis: The game crashed inside the Android emulator's Vulkan driver (gfxstream), reached through AXRB's runtime layer (e.g. Pinball FX VR at its first Vulkan allocations). That's AXRB's GPU path, not FramePort's build - report it to AXRB with the diagnostics.
|
||||
suggest: []
|
||||
report: true
|
||||
- id: axrb-translation-crash
|
||||
kind: axrb
|
||||
pattern: 'libndk_translation\.so \(berberis::|DEBUG\s*:.*#00 pc \S+\s+/system/lib64/libndk_translation\.so'
|
||||
severity: fatal
|
||||
diagnosis: The game crashed in Android's ARM translation (libndk_translation), which runs Quest games' arm64 code on the PC's x86 CPU (known for some Unity games, AXRB issue #9). Nothing to patch in the game; AXRB plans another translator.
|
||||
suggest: []
|
||||
# AXRB's direct mode (axrb-direct.exe, no emulator): direct.log lines are "<s> <tid> E/<tag>: ..." from the runner
|
||||
# and "E/<tag>(<tid>): ..." from the game's Android log; direct.out has AppProcess's AXRB_AOSP_* lines
|
||||
- id: axrb-direct-incomplete
|
||||
kind: axrb
|
||||
pattern: 'Direct mode installation is incomplete|Direct mode is missing |AXRB Direct is incomplete|Preparing the AOSP application failed'
|
||||
severity: fatal
|
||||
diagnosis: AXRB's direct mode is missing part of itself or of its Android system root, so the game was never started. Reinstall AXRB-Emulatorless (or rebuild the local build FRAMEPORT_AXRB_DIRECT_DIR points at), then `frameport pc install-axrb --backend direct` sets the system root up again.
|
||||
suggest: []
|
||||
- id: axrb-direct-no-vulkan
|
||||
kind: axrb
|
||||
pattern: 'vulkan-1\.dll is not installed|E/vulkan: \S+ is not available on the host'
|
||||
severity: fatal
|
||||
diagnosis: AXRB's direct mode found no usable Vulkan driver on this PC (or the driver lacks a function the game calls). Install the graphics card's current driver.
|
||||
suggest: []
|
||||
- id: axrb-direct-no-gles
|
||||
kind: axrb
|
||||
pattern: 'eglInitialize\b.*(?:fail|0x3008)|Failed to initiali[sz]e EGL|Unable to initiali[sz]e (?:EGL|the OpenGL)|EGL_BAD_DISPLAY|Unable to retrieve the default EGL display'
|
||||
# Unreal Vulkan builds probe EGL at start too (eglInitialize -> EGL_BAD_DISPLAY in direct mode), then create
|
||||
# their Vulkan device: only a session without one is a GLES game (Deadpool VR, 2026-10-15)
|
||||
unless: '(?m)I/vulkan: vkCreateDevice\(.*\) = 0$'
|
||||
severity: fatal
|
||||
diagnosis: The game draws with OpenGL ES, and AXRB's direct mode only has a Vulkan renderer. Install it for AXRB's emulator instead (the "AXRB mode on this PC" option, pc.axrb_backend backend=emulator, or `frameport install <game> --to pc --axrb-backend emulator`).
|
||||
suggest: []
|
||||
- id: axrb-direct-no-native-window
|
||||
kind: axrb
|
||||
pattern: '(?m)^AXRB_AOSP_HOST_SURFACES 0'
|
||||
unless: 'APP_CMD_INIT_WINDOW|AXRB_AOSP_TAKEN_SURFACE|AXRB\.Space|session state='
|
||||
severity: warning
|
||||
diagnosis: The game's activity got no window in AXRB's direct mode. NativeActivity games (CryEngine, other own engines) take their surface with Window.takeSurface, which AXRB's direct mode doesn't serve yet (it only hands SurfaceViews one), so they wait for APP_CMD_INIT_WINDOW forever and never start VR (The Climb 2 stopped after "Loading plug-in CryHTTP"). That's AXRB's side; AXRB's emulator may run the game.
|
||||
suggest: []
|
||||
report: true
|
||||
- id: axrb-direct-vulkan-extensions
|
||||
kind: axrb
|
||||
pattern: 'Renderer initialization[\s\S]{0,600}?CrySystem initialization failed'
|
||||
unless: 'fp_vkext: listing'
|
||||
severity: fatal
|
||||
diagnosis: CryEngine found its Vulkan device without extensions every Quest has (VK_EXT_fragment_density_map, Android's external memory) and gave up before creating it; the PC's graphics driver doesn't have them. "Vulkan - list Android's external-memory extensions (this PC)" lists them for the game in builds for this PC, and AXRB leaves them out again when the device is created.
|
||||
suggest: [frame.vk_android_extensions]
|
||||
- id: axrb-direct-unhandled-instruction
|
||||
kind: axrb
|
||||
pattern: 'fatal signal 4 \(SIGILL\)|unhandled synchronous signal 4 '
|
||||
severity: fatal
|
||||
diagnosis: AXRB's direct mode met an arm64 instruction its translator can't run (Dynarmic, or Digitalis when chosen) and the game stopped. That's AXRB's side - report it to AXRB with the diagnostics (direct.log has the instruction's address); the other translator (pc.axrb_backend translator=digitalis / dynarmic) or AXRB's emulator may get further.
|
||||
suggest: []
|
||||
report: true
|
||||
- id: axrb-direct-guest-crash
|
||||
kind: axrb
|
||||
pattern: 'E/cpu: thread \d+ \(.*\): fatal signal (?:5|6|7|11) '
|
||||
severity: fatal
|
||||
diagnosis: The game's own arm64 code crashed in AXRB's direct mode (a SIGSEGV/SIGBUS/SIGABRT, or the SIGTRAP Unity raises on a fatal error; direct.log has the backtrace by library). Often a missing Android service or a translation bug rather than the game; try the other translator (pc.axrb_backend translator=digitalis) or AXRB's emulator, and report it to AXRB with the diagnostics.
|
||||
suggest: []
|
||||
report: true
|
||||
- id: axrb-direct-host-fault
|
||||
kind: axrb
|
||||
pattern: 'E/host-fault: |E/fatal: '
|
||||
severity: fatal
|
||||
diagnosis: axrb-direct.exe itself crashed (its translator or Linux/Binder layer, not the game). That's AXRB's side - report it to AXRB with the diagnostics.
|
||||
suggest: []
|
||||
report: true
|
||||
- id: axrb-direct-java-crash
|
||||
kind: axrb
|
||||
pattern: 'E/app: the application crashed|FATAL EXCEPTION: |Runtime aborting|JNI DETECTED ERROR IN APPLICATION'
|
||||
severity: fatal
|
||||
diagnosis: The game's Java side (or Android's ART runtime under it) ended with an uncaught exception or an abort in AXRB's direct mode. direct.log / direct.err have the stack; a framework service AXRB's direct mode doesn't provide yet (Meta/Play services, account, DRM) is the usual cause.
|
||||
suggest: []
|
||||
- id: axrb-direct-missing-function
|
||||
kind: axrb
|
||||
pattern: 'guest called unknown host function|unimplemented JNI function|call to unregistered host function'
|
||||
severity: error
|
||||
diagnosis: The game called an Android/JNI function AXRB's direct mode doesn't implement yet; it may fail right after. Report it to AXRB with the diagnostics.
|
||||
suggest: []
|
||||
- id: axrb-direct-unsupported-syscall
|
||||
kind: axrb
|
||||
pattern: 'W/syscall: unimplemented syscall|W/binder: unsupported (?:command|ioctl|object type)|execve\(.*\) refused: one process image only'
|
||||
severity: warning
|
||||
diagnosis: The game asked for a Linux system call or Binder feature (or a second process) AXRB's direct mode doesn't provide. Often harmless; when the game then fails, it's the first thing to report to AXRB.
|
||||
suggest: []
|
||||
- id: axrb-direct-slow-stop
|
||||
kind: axrb
|
||||
pattern: 'the game did not close within 25 seconds'
|
||||
severity: info
|
||||
diagnosis: The game didn't finish its activity shutdown when the session ended, so AXRB stopped it; anything it hadn't saved yet may be lost.
|
||||
suggest: []
|
||||
# Launch tests run without a worn headset. Some parts give up on tracking after a while and end the VR session; what
|
||||
# the game does after that (often a crash in the GPU driver while its renderer tears down) never happens in the
|
||||
# headset. In a launch test that already had paced frames before such a line, a later exit or crash still passes,
|
||||
@@ -573,6 +688,13 @@ headless_end:
|
||||
- label: the VrApi bridge's 30 s tracking deadline
|
||||
pattern: 'EnterVrMode: no tracked head pose before deadline'
|
||||
milestones: # progress markers, in order; the furthest one reached is reported
|
||||
- {id: axrb-host, kind: axrb, pattern: 'AXRB TCP: listening', label: AXRB bridge started}
|
||||
- {id: axrb-direct-art, kind: axrb, pattern: '(?m)^AXRB_AOSP_BOOTSTRAP', label: Android runtime (ART) started (direct mode)}
|
||||
- {id: axrb-direct-activity, kind: axrb, pattern: '(?m)^AXRB_AOSP_ACTIVITY_CREATED ', label: Game activity created (direct mode)}
|
||||
- {id: axrb-runtime, kind: axrb, pattern: 'AXRB\.PoseClient|Got runtime: package: com\.axrb\.openxrruntime', label: AXRB's OpenXR runtime loaded}
|
||||
- {id: axrb-instance, kind: axrb, pattern: 'xrCreateInstance\(\) succeeded|LoaderInstance::CreateInstance succeeded', label: OpenXR instance created}
|
||||
- {id: axrb-direct-vulkan, kind: axrb, pattern: '(?m)I/vulkan: vkCreateDevice\(.*\) = 0$', label: Vulkan device created on the PC's GPU (direct mode)}
|
||||
- {id: axrb-frames, kind: axrb, pattern: 'AXRB\.Perf end-frame', label: Submitting frames}
|
||||
- {id: pcvr-launch, kind: pcvr, pattern: 'FramePort: launching|Launched injector with', label: Launcher started}
|
||||
- {id: pcvr-oculus-hmd, kind: pcvr, pattern: 'FramePort oculushmd: OculusHMDConnected event ready', label: Oculus headset event provided}
|
||||
- {id: pcvr-inject, kind: pcvr, pattern: 'Succesfully injected|Successfully injected', label: Revive injected into the game}
|
||||
|
||||
+191
-125
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,374 @@
|
||||
# Quest games on this PC (AXRB)
|
||||
|
||||
FramePort's PC target ("This PC") already runs Oculus Rift games through Revive. For Quest/Android games it uses
|
||||
**AXRB** (Android XR Bridge, github.com/Android-XR-Bridge/AXRB): an Android 16 emulator (x86_64 Google APIs image,
|
||||
WHPX) that runs arm64 games through Android's ARM translation (`libndk_translation`), with AXRB's own OpenXR runtime
|
||||
inside Android and a Windows host process (`axrb-host-bridge.exe`) that opens a real OpenXR session on the PC's
|
||||
runtime (SteamVR, Virtual Desktop, ...). FramePort only drives it: it downloads AXRB's official release when a user
|
||||
first installs a Quest game on the PC, never bundles or modifies it (AXRB's host/clock code is under the AXRB
|
||||
Source-Available License 1.0, which allows running it and interoperating through its public interfaces).
|
||||
|
||||
Status: **experimental**. AXRB is young (v1.0.4, 2026-10-06) and many games still fail in it; Steam Frame
|
||||
controllers don't work in AXRB yet (AXRB issue #20).
|
||||
|
||||
## Two backends: the emulator (1.0.4) and direct mode (2.x, "AXRB-Emulatorless")
|
||||
|
||||
AXRB's main branch (2026-10-15, launcher 2.0.0) became **AXRB-Emulatorless**: a separate program (own installer,
|
||||
app id `org.axrb.emulatorless`, `%LOCALAPPDATA%\Programs\axrb-emulatorless-launcher`, runtime
|
||||
`%LOCALAPPDATA%\AXRB-Emulatorless Runtime`, profile `%APPDATA%\AXRB-Emulatorless`) whose **direct mode** runs the
|
||||
game without an emulator: `axrb-direct.exe` translates the game's arm64 code (Dynarmic JIT; Digitalis optional) and
|
||||
runs the real AOSP ART + framework from Google's Android 16 arm64 system image, with its own Linux syscall/Binder
|
||||
layer; Vulkan goes to the Windows driver, frames and tracking through the same `axrb-host-bridge.exe`. **Vulkan only:**
|
||||
its EGL is a stub, there is no GLES renderer. Both programs can be installed side by side; FramePort keeps one
|
||||
`axrb.Install` record per backend (`backend`, `version`, app folder, AXRB's root = `resources\runtime`, runtime
|
||||
folder) and picks per game:
|
||||
|
||||
- **Choice** (`targets/pc_android.choose_backend`): `--axrb-backend direct|emulator` on `frameport install --to pc`,
|
||||
else the recipe's `pc.axrb_backend` (device category, `on_pc`: part of the PC build's selection, no-op on the
|
||||
Frame), else **direct for `graphics` Vulkan, emulator for GLES / unknown**. Unreal games never declare
|
||||
`android.hardware.vulkan`; since analysis version 20 their manifest meta-data
|
||||
`com.epicgames.{ue4,unreal}.GameActivity.bSupportsVulkan` = true makes them "Vulkan (Unreal bSupportsVulkan)"
|
||||
(UE 4.25+ Quest builds, e.g. Deadpool VR, Pinball FX VR, Myst; false or missing = GLES: Espire 1, Vader Immortal). `deployment.json` records `backend`
|
||||
and the launcher `flags`; installs from before have none (= emulator). Switching leaves the other backend's copy
|
||||
and saves alone.
|
||||
- **Per-game options** (`pc.axrb_backend` params → `run_direct_game.ps1` switches): `translator` (`dynarmic` =
|
||||
AXRB's default, `digitalis`), `precompose` (`-PrecomposeProjectionLayers`, also for the emulator's
|
||||
`run_windows_game.ps1`; also taken from AXRB's own `core/game-compatibility.json` profile for the game, e.g. The
|
||||
Climb 2), `legacy_oculus_driver` / `quest_identity` / `controllers_only` (for unconverted store APKs with older
|
||||
Oculus loaders; off by default and never taken from AXRB's profiles: FramePort always hands AXRB an OVRPort build;
|
||||
`controllers_only` only works with the legacy driver, as `prepare_art_session.py` requires).
|
||||
- **Install/upgrade** (`tools/axrb.install`): `releases/latest` when it has the backend's installer
|
||||
(`AXRB-Setup-*.exe` / `AXRB-Emulatorless-Setup-*.exe`, SHA256SUMS checked, `/S`), else the known-good release
|
||||
(`KNOWN_GOOD = {"emulator": "1.0.4"}`, `releases/tags/v1.0.4`). An install older than the known-good one is
|
||||
upgraded on use; `frameport pc install-axrb --backend … --update` upgrades to the release on offer. No 2.x release
|
||||
is published yet: **`FRAMEPORT_AXRB_DIRECT_DIR`** names a local build (AXRB's source tree after
|
||||
`scripts\build\build_direct.ps1` + the host build, its `out\direct`, or a folder laid out like the installed
|
||||
`resources\runtime`): it needs the files of AXRB's `core/direct-runtime-files.cjs` (`out\direct\axrb-direct.exe`,
|
||||
`art\axrb-bootstrap.dex`, `art\lib64\*`, `guest\lib64\*`, `guest\axrb-systemdriver.apk`) plus
|
||||
`scripts\run\run_direct_game.ps1`, `scripts\run\stop_game.ps1`, `scripts\paths.ps1`,
|
||||
`direct\tools\make_sysroot.py`, `direct\tools\prepare_art_session.py`, `out\host\bin\Release\axrb-host-bridge.exe`
|
||||
(+ `openxr_loader.dll`, `out\gpu\Release` for the GPU-share layer) and ideally `tools\python` (else Python from
|
||||
PATH). A local build is set up but never replaced. `FRAMEPORT_AXRB_DIRECT_RUNTIME` overrides the runtime folder
|
||||
(default: the launcher's `library.json` `settings.managedDirectory`, else `%LOCALAPPDATA%\AXRB-Emulatorless Runtime`).
|
||||
- **Direct setup** (`axrb.setup_direct`, what `core/direct.mjs ensureDirectSystem` does): the pinned image
|
||||
(`arm64-v8a-36_r02.zip`, 810,736,863 bytes, SHA-1 `62ad6714…`; values read from the installed `core/direct.mjs`,
|
||||
only `dl.google.com`) into its own empty folder, AXRB's `make_sysroot.py <zip> <runtime>\direct\sysroot.new --art`
|
||||
with AXRB's embedded Python, receipt `.axrb-sysroot.json` `{"digest","format"}`, rename to `sysroot`, archive
|
||||
deleted; `license-acceptance.json` like AXRB's DirectSetup. Ready = receipt matches + the key files exist and
|
||||
aren't empty + AXRB's direct files complete. Requirements: ≥ 6 GB RAM, `vulkan-1.dll` (no hypervisor, no GPU
|
||||
vendor gate).
|
||||
- **Direct install** (no adb): the PC build is copied to `%LOCALAPPDATA%\FramePort\axrb\games\<pkg>\<pkg>.apk`
|
||||
(FramePort removes its converted copies after an install; `FRAMEPORT_AXRB_LAUNCHER_DIR` moves FramePort's `axrb`
|
||||
folder, for isolated `FRAMEPORT_HOME` runs), the launch activity comes from the APK's manifest
|
||||
(`axml.launcher_activity`, `pkg/fully.qualified.Class`), the data files become AXRB's content list `assets.txt`
|
||||
(`Android/obb/<pkg>/<file>\t<Windows path>`, read-only mounts of the files where they are; WSL-only folders, which
|
||||
Windows reads only through `\\wsl$`, are copied next to the APK). AXRB's `prepare_art_session.py` turns every
|
||||
content file into one `--mount-ro` argument of `axrb-direct.exe` (with the path resolved: junctions and 8.3 names
|
||||
don't shorten it), and Batman's 90 files from a long dump folder made a 32,876-character command line (Windows'
|
||||
limit is 32,767: "The filename or extension is too long"). A list over 25,000 characters therefore goes through
|
||||
hard links in `games\<pkg>\content` (no extra space; only on the drive FramePort's folder is on), else the install
|
||||
stops with a clear message. App data and saves: `<runtime>\direct\data\data\<pkg>` and
|
||||
`direct\sdcard\Android\data\<pkg>`.
|
||||
- **Play**: Steam shortcut → `%LOCALAPPDATA%\FramePort\axrb\fp-axrb-direct.ps1 -Package … -Activity … [flags]` →
|
||||
sets `AXRB_DATA_HOME=<runtime>\output` (as AXRB's launcher does) → AXRB's `run_direct_game.ps1 -Apk -Package
|
||||
-Activity -GameName -Executable <root>\out\direct\axrb-direct.exe -DataDirectory <runtime>\direct -Sysroot
|
||||
<runtime>\direct\sysroot [-AssetList] -Translator …`. Exit 4 = host lost.
|
||||
- **Launch test**: watches `direct.out` for `AXRB_AOSP_ACTIVITY_CREATED` / `AXRB_AOSP_LIFECYCLE` (5 min for ART's
|
||||
interpreted first start), runs, then stops through AXRB's `stop_game.ps1 -ParentPid` (closes the bridge window;
|
||||
the run script lets the game pause/stop/save). Logs `<runtime>\output\logs\game\{direct.out, direct.err,
|
||||
direct.log, host.err, host.log, session.json}` (diagnostics: `axrb/direct/*`); triage signatures
|
||||
`axrb-direct-*` and milestones ART started → activity created → OpenXR → Vulkan device (`catalog/triage.yaml`).
|
||||
|
||||
**Tested end to end with a local build** (2026-10-15, AXRB `windows-android16` @ 59626ac built on the dev PC,
|
||||
`FRAMEPORT_AXRB_DIRECT_DIR` = its staged `runtime\`, the staged sysroot reached through a junction
|
||||
`<FRAMEPORT_AXRB_DIRECT_RUNTIME>\direct\sysroot`; Monado's simulated HMD, see below): scan → PC build → direct
|
||||
install → `frameport test --to pc --sim --axrb-backend direct` → launcher → AXRB's run script → bridge + runner →
|
||||
milestones → AXRB's Stop. Still untested: the 2.x NSIS installer (no release yet), `setup_direct`'s download +
|
||||
`make_sysroot.py` path, the upgrade of an installed 1.0.x, AXRB's launcher seeing FramePort-set-up runtimes.
|
||||
|
||||
### Direct-mode results (2026-10-15, Monado simulated HMD at 72 Hz, Dynarmic, no headset)
|
||||
|
||||
PC build = the catalog recipe's PC selection (OVRPort's patches + `on_pc` fixes + FrameBridge with `focus_hold=0`),
|
||||
no `pc.axrb_backend` options. "fps" = AXRB.Perf `end-frame` (game) / `host-fresh-submit` (bridge → Monado), the
|
||||
median of the last summaries. What is drawn was judged from Monado's window and AXRB's layer captures.
|
||||
|
||||
| Game (engine, graphics) | Reached | fps | Picture | Blocker / notes |
|
||||
|---|---|---|---|---|
|
||||
| Batman: Arkham Shadow 1.4.1-350961 (Unity, Vulkan; 90 content files, 27 GB) | menu (SELECT REGION) in ~25 s | 63.7 / 62.9 | stereo menu over the Batcave scene, both eyes correct | none; needed the content-list fix (command line overflow) and hard links; stop clean (activities stopped) |
|
||||
| PowerWash Simulator VR 2.5.0 (Unity 2020.3, Vulkan) | in game: the garage hub (~3-4 min; at 90 s still its loading logo) | 70.5 / 69.8 | garage in both eyes, both hands drawn at the simulated controllers | none; Meta multiplayer callbacks throw NullReferenceExceptions (no Meta services, harmless so far) |
|
||||
| LEGO Bricktales 2.1 (Unity, Vulkan, URP) | scene `Diorama_Hub_Startup` loaded (~3 min) | 72 / 72 | intro text panel ("You want to free the simulation? Follow the white rabbit.") on black, both eyes | stop slow: the game didn't finish its activity shutdown in 25 s (`axrb-direct-slow-stop`); Meta achievements fail (no Meta services, harmless) |
|
||||
| Toy Master 1.1.2 (Unity 2022.3, **GLES**) | activity created, then crash in 18 s | - | - | not a Vulkan game: "Vulkan (Unity boot.config)" came from the Oculus plugin's `xr-vulkan-*` keys; Unity: "Unable to retrieve the default EGL display!" + SIGTRAP. Automatic choice now sends such games to the emulator |
|
||||
| Marvel's Deadpool VR 1.0.40 (UE 4.27, Vulkan; `frame.vk_sanitize` in the build) | first-run LANGUAGE menu (~3 min; at 90 s still loading at 1-2 fps) | 64 (FrameBridge pacing) | game-drawn stereo menu, both eyes | none; AXRB transcodes ASTC to BC on the GPU; stop slow (`axrb-direct-slow-stop`) |
|
||||
| Pinball FX VR 1.9 (UE 5.3, Vulkan, 7 GB OBB) | 3D lobby with the Terms & Conditions panel (~4 min) | ~60 (FrameBridge pacing) | arcade hall + panel in both eyes | none of the emulator's blockers (gfxstream `vkAllocateMemory` SIGSEGV, and Refract's FRSQRTE SIGILL / ASTC layout probe / promoted extension names) showed up in direct mode (no SIGILL under Dynarmic, no ASTC or device-loss failure; AXRB stores ASTC as BC); OVRPlugin's xrPerfSettingsSetPerformanceLevelEXT unsupported (harmless) |
|
||||
| Myst 3.3.0 (UE 5.3, Vulkan) | loading screen (book), then its starfield intro | 72 | stereo, both eyes | a white splash quad at first (texture not shown yet), then normal |
|
||||
| Metro Awakening 1.0-916944 (UE 5.2, Vulkan) | splash art, then the USER DATA COLLECTION consent screen with the laser pointer | 72 | stereo, both eyes | stop slow (`axrb-direct-slow-stop`) |
|
||||
|
||||
Unreal Vulkan games: before analysis version 20 every Unreal game was "GLES or unknown" (Unreal never declares
|
||||
`android.hardware.vulkan`), so the automatic choice sent them to the emulator; now `GameActivity.bSupportsVulkan`
|
||||
picks direct mode (Myst and Metro above were installed without `--axrb-backend`). Unreal probes EGL before it
|
||||
creates its Vulkan device, which tripped `axrb-direct-no-gles`; the signature now needs no Vulkan device. None of
|
||||
the four needed a recipe change for the PC.
|
||||
|
||||
Integration bugs found and fixed on the way: AXRB's trap message never reached FramePort's log; the content list
|
||||
overflowed the command line (Batman); Unity's EGL failure and SIGTRAP weren't triaged; long sessions lost their
|
||||
start-up milestones; the boot.config Vulkan label picked direct mode for GLES games. Open, AXRB's side: the content
|
||||
list should reach `axrb-direct.exe` as a file (FramePort's hard links only work when the data is on the drive of
|
||||
FramePort's folder; drafted as an upstream issue). Needs a headset: picture and latency through SteamVR, sound,
|
||||
controllers (the simulated ones hold still), Batman beyond its region menu.
|
||||
|
||||
### VrApi-direct games (2026-10-16, direct mode, Monado simulated HMD, Dynarmic, no headset)
|
||||
|
||||
Games whose engine calls VrApi itself (no OVRPlugin), so OVRPort can't translate them: they need a `libvrapi.so`
|
||||
that translates VrApi to OpenXR. Two candidates: FramePort's `frame.vrapi_bridge` (OVRPort's translator + FramePort's
|
||||
changes) and OVRPort's own `patch_vrapi_openxr` (the unpatched translator; only in experimental CLI builds made with
|
||||
`-PwithVrApi=true`, e.g. the `OVRPort-CLI-1.2.5-experimental-5e7df52.jar` AXRB's v1.0.0/1.0.1 releases attached;
|
||||
AXRB's own profile for The Climb 2 uses it with `-PrecomposeProjectionLayers`). Only converted copies of both games
|
||||
were at hand, so the comparison swapped the one file (OVRPort's = the v1.2.5 build from the 2026-10-02 Frame tests).
|
||||
|
||||
| Game (engine, graphics) | VrApi route | Reached | fps | Picture | Blocker / notes |
|
||||
|---|---|---|---|---|---|
|
||||
| The Climb 2 2.2 (CryEngine, Vulkan VrApi) | FramePort's bridge | first-start menu (gender/skin selection) in ~60 s | 69.8 / 69.8 | menu, both hands and controllers, both eyes (AXRB layer captures + Monado's window) | needs AXRB's HostWindow fix (below, AXRB's side) + `frame.vk_android_extensions`; crash only during AXRB's stop (forgiven by triage); no `-PrecomposeProjectionLayers` needed |
|
||||
| The Climb 2 2.2 | OVRPort's translator | the same menu | 70.2 / 70.2 | identical | same blockers; passes AXRB's AHB device-extension request through unchanged (worked only because `libfp_vkext.so` lists AHB) |
|
||||
| Path of the Warrior (own engine, **GLES** VrApi) | - | not run | - | - | GLES: direct mode can't run it; the emulator (1.0.4) had a copy signed with another key installed by another test, so it wasn't replaced. OVRPort's translator can't run it anywhere (no GLES path: `cannot locate symbol "vrapi_GetTextureSwapChainHandle"`, Frame test 2026-10-02); FramePort's bridge has one |
|
||||
|
||||
**Default for PC builds: FramePort's bridge** (`frame.vrapi_bridge`, now `on_pc = True`; recipes keep it as they
|
||||
are, nothing to switch). Both translators give the same picture and frame rate in direct mode, but OVRPort's needs
|
||||
an unpublished experimental CLI (stable jars list `patch_vrapi_openxr` but fail), has no GLES path (POTW, every GLES
|
||||
VrApi game on the emulator) and lacks the device-extension filter; FramePort's is the same code the Frame builds
|
||||
use, so one recipe serves both.
|
||||
|
||||
Blockers found on the way (in order):
|
||||
1. **No window for NativeActivity** (AXRB's side, drafted upstream): CryEngine's `EngineActivity` takes its surface
|
||||
with `Window.takeSurface`; direct mode's `HostWindow.attach` only bridges SurfaceViews (`AXRB_AOSP_HOST_SURFACES
|
||||
0`), so `APP_CMD_INIT_WINDOW` never comes and the game waits after `Loading plug-in CryHTTP` (triage
|
||||
`axrb-direct-no-native-window`). A ~40-line HostWindow patch (`mTakeSurfaceCallback` → `registerSurface` +
|
||||
`surfaceCreated/Changed`, bootstrap dex rebuilt with AXRB's `build_art_bootstrap.py` into a test copy of the
|
||||
local build) fixed it. Likely the same for every NativeActivity engine.
|
||||
2. **Quest Vulkan device extensions**: CryEngine checks its list before vkCreateDevice and gave up
|
||||
(`CrySystem initialization failed!`): AXRB's runtime asks for `VK_ANDROID_external_memory_android_hardware_buffer`
|
||||
also in direct mode, and the game requires `VK_EXT_fragment_density_map` (NVIDIA's Windows driver has neither).
|
||||
The bridge now leaves runtime extensions no device offers out; `frame.vk_android_extensions` lists the missing
|
||||
Quest ones to the renderer (AXRB drops them at vkCreateDevice). Triage `axrb-direct-vulkan-extensions`.
|
||||
3. **Simulator only**: Monado's head lacks POSITION_TRACKED, so AXRB's host never made its LOCAL origin and the
|
||||
bridge never got a tracked head (empty frames, `initial recenter: head flags=0x0`) → `--sim` sets AXRB's
|
||||
`AXRB_TEST_SYNTHETIC_HMD=2`.
|
||||
4. The analysis called The Climb 2 "GLES or unknown" (no manifest declaration) → analysis 20: engines importing
|
||||
`vrapi_CreateSystemVulkan` are "Vulkan (VrApi Vulkan system)", so it goes to direct mode automatically.
|
||||
|
||||
Debugging aid: `FRAMEPORT_AXRB_TEST_ENV="AXRB_DIRECT_TRACE=syscall,vulkan;AXRB_CAPTURE_FIRST_SEQUENCE=4500"` passes
|
||||
variables to a launch test's AXRB processes (`AXRB_DIRECT_DUMP` only works in AXRB's own VM mode, not with ART).
|
||||
Needs a headset: the picture through SteamVR, controllers past the first menu (the simulated ones hold still),
|
||||
climbing, sound; and a released AXRB-Emulatorless with the window fix.
|
||||
|
||||
## Spike results (2026-10-10, Windows 11 26200, i7-14700K, RTX 4080 SUPER, 64 GB; headless)
|
||||
|
||||
| Step | Result |
|
||||
|---|---|
|
||||
| AXRB install | `AXRB-Setup-<v>.exe /S` (electron-builder one-click NSIS, per user, no UAC) → `%LOCALAPPDATA%\Programs\axrb-launcher`, 462 MB. Release assets: Setup exe + `SHA256SUMS-<v>-setup.txt` + source zip (no portable zip since 1.0.4). |
|
||||
| Runtime setup | Not scriptable through AXRB (it lives in the Electron launcher's JS), so FramePort reproduces it: 4 pinned `dl.google.com` zips from AXRB's `core/components.json` (emulator 36.5.11, platform-tools r37.0.1, build-tools 36.1, `sys-img/google_apis/x86_64-36_r07`), hash-checked, into `%LOCALAPPDATA%\AXRB Runtime\sdk`, AVD `axrb-managed-api36` written as AXRB writes it, `ready.json` / `license-acceptance.json` receipts so AXRB's own launcher sees the same runtime as set up. 2.4 GB download, ~3 min on a fast line; 26 GB on disk after one 7 GB game. |
|
||||
| Emulator boot | AXRB's `scripts\emulator\windows_android_emulator.ps1 -Action Start` (headless QEMU, AXRB clock adapter + GPU layer). First cold boot ~6 min (TSC-corrected clock cold-boots every time). ABIs `x86_64,arm64-v8a`. QEMU (`Start-Process`) and the adb server inherit the caller's handles: a pipe, a file through WSL interop, even `/dev/null` through interop (its relay stays open) all left the FramePort call hanging after the script had ended → FramePort starts AXRB scripts through WMI (`Win32_Process.Create`, hidden, nothing inherited), polls the PID and reads an `FP_EXIT <code>` line from the log. Windows PowerShell 5.1's `*>>` writes UTF-16. |
|
||||
| AXRB runtime | `adb install --no-incremental --force-queryable -r axrb-openxr-runtime-debug.apk` (0.3 s); found by the OpenXR loader through the system runtime broker. |
|
||||
| Data | `adb push` of OBB/pak files: 25-35 MB/s (7.2 GB Pinball FX VR in 5.5 min). A full uninstall (or a signature change: `INSTALL_FAILED_UPDATE_INCOMPATIBLE`) deletes the OBB folder and the saves → FramePort's stable per-game keys matter here too. |
|
||||
| **Original APK** (Pinball FX VR) | No launcher activity (Meta's VR category only), started explicitly: **SIGABRT 0.3 s after loading Meta's `libovrplatformloader.so`**. Unconverted Quest APKs don't run. |
|
||||
| **OVRPort-only build** (Lucky's Tale, Unity 2019 GLES) | OVRPort's loader → AXRB runtime → instance + session, frames submitted (2 s each without a host: the image send times out), no crash in 40 s. |
|
||||
| **OVRPort-only build** (Pinball FX VR, UE5 Vulkan) | OVRPlugin pre-init OK (AXRB reports "Oculus 67.522.0"), then exits (ForceQuit) / with the no-ForceQuit build SIGSEGV in `gfxstream vkAllocateMemory` called from AXRB's runtime Vulkan layer. Not decided headless (no host attached, see below). |
|
||||
| Host bridge | Needs an OpenXR runtime with a D3D11 adapter. Headless options all failed: SteamVR's null driver (`failed to find D3D11 adapter requested by OpenXR runtime`), `vrlink` without a headset (`xrCreateInstance` -2), Meta XR Simulator (binary download needs a Meta developer login). → frames-to-SteamVR need a real headset. |
|
||||
|
||||
**Build decision: FramePort hands AXRB an OVRPort-only build** (the recipe's OVRPort patches, no Steam Frame fixes,
|
||||
signed with the game's FramePort key). The original APK crashes; FramePort's Frame fixes (FrameBridge adapter, Lepton
|
||||
and Frame-runtime workarounds) target the Frame. The recipe's alternate (no-ForceQuit) build is used when the recipe
|
||||
says so. (Since 2026-10-15 the PC build also carries the runtime-independent APK fixes and FrameBridge, see below.)
|
||||
|
||||
## Which patches reach the build for this PC
|
||||
|
||||
One recipe serves both builds; `patches/base.pc_selection(patches, analysis)` picks the PC part (used by
|
||||
`build.build(pc=True)`, `pipeline.pc_recipe_fingerprint`, the PC deployment record and `ui/components.pc_outdated`).
|
||||
`docs/PATCHES.md` marks each kept patch "also in builds for this PC (AXRB)".
|
||||
|
||||
- **All of OVRPort's patches** (category `overport`).
|
||||
- **APK fixes that don't depend on Lepton or the Frame's runtime** (`Patch.on_pc = True`): they fix the game's own
|
||||
code or its Meta libraries, which misbehave the same way in AXRB's Android (no Meta services, not a Quest device
|
||||
model, no Horizon app): `frame.ovrplatformcompat`, `frame.ovrstubs`, `frame.swapchain_limit` (OVRPort's
|
||||
dispatcher), `frame.ovr_stable_user`, `frame.unreal_ovrp_entrypoints`, `frame.avatar_stub`, `frame.vrapi_stub`,
|
||||
`frame.metaxr_telemetry`, `frame.oculusos`, `frame.ovr_microphone`, `frame.langpacks`, `frame.asset_files`,
|
||||
`frame.asset_files_stub`, `frame.ovr_trace`, `frame.blazerush`, `frame.unity_oculus_check` (with its ovrpshim),
|
||||
`frame.unity_text_input`, `frame.unreal_quest_precompile`, `frame.unreal_quest_keymap`,
|
||||
`frame.unreal_thumb_touch`, `frame.unreal_skip_obb_check`, `frame.unreal_skip_obb_delivery`, `frame.nodebug`,
|
||||
`frame.meta_permissions`, `frame.launcher`, and `frame.vrapi_bridge` (VrApi → OpenXR through OVRPort's loader,
|
||||
so AXRB's runtime; seen working in direct mode with The Climb 2, see "VrApi-direct games" below; the bridge
|
||||
doesn't need the GL shim, but GLES games keep `frame.gl_shim` for gfxstream, see "GLES games in the emulator").
|
||||
- **Experimental on the PC, for GLES games in the emulator**: `frame.gl_shim` (only with a GLES analysis,
|
||||
`Patch.pc_keeps`; Vulkan VrApi games never get it), `frame.unity_multipass` (also added by `pc_detect`), and the
|
||||
GLES FrameBridge defaults `scale` ≤ 0.5, `scale_max=1`, `projection_only=1`.
|
||||
- **Experimental on the PC** (`on_pc = "experimental"`, kept but not yet seen working in AXRB): `frame.vk_sanitize`
|
||||
(the Vulkan shim; gfxstream / the host driver instead of Lepton's Fossilize), `frame.unity_tls_key_pool`,
|
||||
`frame.eos_keychain_loop`.
|
||||
- **PC-only APK fix** `frame.vk_android_extensions` (`pc_detect`: direct-VrApi games whose engine creates VrApi's
|
||||
Vulkan system, analysis `graphics` "Vulkan (VrApi Vulkan system)"): the renderer's
|
||||
`vkEnumerateDeviceExtensionProperties` import goes to `libfp_vkext.so`, which also lists the Quest device
|
||||
extensions the PC's driver lacks (VK_EXT_fragment_density_map, Android external memory); AXRB's vkCreateDevice
|
||||
leaves them out again.
|
||||
- **FrameBridge** (`frame.adapter`) with its settings in `lib/<abi>/libframe_settings.so`: it wraps OVRPort's loader
|
||||
the same way in AXRB (scale, haptic_fix, pose_time_fix, rect_clamp, profile_remap, ...). Left out
|
||||
(`settings.PC_DENY`): `sync_guard` (a race in the Frame's vrclient.so), `focus_hold` / `focus_hold_ms` (the
|
||||
Frame's flickering wear sensor; FrameBridge's built-in default is on, so the PC build writes `focus_hold=0`,
|
||||
`settings.PC_VALUES`), `controller_models` (models the agent converts from the Frame's SteamVR at install) and the
|
||||
settings only the GL shim / Zink shader layer read (`gl_*`, `zink_*`). `controller_fix` stays: it is the game's
|
||||
choice (0 = hand tracking) and its Touch mapping of `/valve/` and generic profiles is runtime-independent.
|
||||
FrameBridge finds `libframe_settings.so` next to its own path (dladdr); on the Frame the agent also passes the
|
||||
settings as files, in AXRB the library is the only source, so the PC build turns `extractNativeLibs` on
|
||||
(`build.extract_native_libs`; apps with `extractNativeLibs="false"` would map their libraries from base.apk).
|
||||
Without OVRPort (a 32-bit recipe) the PC build drops FrameBridge: there is no loader to wrap.
|
||||
- **PC-only:** OVRPort's `patch_disable_meta_xr_audio_telemetry` (for x86_64 ARM translation, which AXRB is) is
|
||||
never in a Steam Frame recipe (`applies()` is False); `pc_selection` adds it, given the analysis, to games with
|
||||
Meta XR Audio (`Patch.pc_detect`; AXRB's own profile turns it on for North Star).
|
||||
- **Off on the PC:** Lepton/Android 11 workarounds (clipboard, Vivox audio route, start activity, ...), the Zink/Mesa
|
||||
GL shims and shader layer, pac_hints/luajit, hardware video decoding, every `device.*` option, the 32-bit bridge.
|
||||
- TODO: `device.files` (files written into the game's storage at install) could be reproduced with `adb push` in
|
||||
`targets/pc_android.py`.
|
||||
|
||||
### FramePort end to end (same day, headless, this branch)
|
||||
|
||||
`frameport install com.playful.LuckysTale --to pc --no-library` (isolated `FRAMEPORT_HOME`): PC build (19 patches:
|
||||
OVRPort's + `frame.ovrplatformcompat`/`frame.ovrstubs`/`frame.swapchain_limit`; static checks pass without the
|
||||
FrameBridge check) → AXRB found, requirements met → emulator → AXRB runtime → `adb install` → 3.7 GB OBB in ~95 s
|
||||
(39 MB/s) → `deployment.json` + launcher script. `frameport test com.playful.LuckysTale --to pc`: launcher → AXRB run
|
||||
script → host bridge → triage `axrb-no-headset` (expected without a headset). The Steam shortcut write (needs a Steam
|
||||
restart) is unit-tested only.
|
||||
|
||||
## How FramePort drives AXRB
|
||||
|
||||
- `tools/axrb.py`: find (env `FRAMEPORT_AXRB_DIR` > installed AXRB) / install (Setup exe, SHA256SUMS checked, `/S`) /
|
||||
runtime setup (above) / requirements (WHPX via AXRB's `check_windows.ps1`, ≥ 12 GB RAM, x64).
|
||||
- Environment for every AXRB script (the installed build sets none of it itself): `AXRB_DATA_HOME=<Runtime>\output`,
|
||||
`ANDROID_AVD_HOME=<Runtime>\avd`, `ANDROID_USER_HOME=<Runtime>\android`, `ANDROID_HOME`/`ANDROID_SDK_ROOT=<Runtime>\sdk`,
|
||||
`ANDROID_ADB_SERVER_PORT=5038`, `ADB_USB_LEGACY=1`, `ADB_LOCAL_TRANSPORT_MAX_PORT=5683`, AXRB's embedded Python
|
||||
(`resources\runtime\tools\python`) first on PATH; arguments `-Sdk <Runtime>\sdk -Avd axrb-managed-api36 -Port 5584`.
|
||||
- Install: start the emulator if needed (and stop it again if FramePort started it), install the AXRB runtime APK,
|
||||
`adb install -r` the build, push OBB/data to `/sdcard/Android/obb|data/<pkg>/`, record `<data>/pc/<pkg>/deployment.json`
|
||||
(`kind: "android"`).
|
||||
- Play: a Steam shortcut runs FramePort's small launcher script (`%LOCALAPPDATA%\FramePort\axrb\fp-axrb-run.ps1`),
|
||||
which sets the environment above and calls AXRB's `scripts\run\run_windows_game.ps1` (boots the emulator when
|
||||
needed and then owns it, registers a SteamVR app identity, starts the host bridge, `am start`, waits; exit codes
|
||||
0 ok, 1 error, 3 game lost, 4 host lost; `logs\game\session.json`, `host.err`).
|
||||
- Logs for diagnostics: `<Runtime>\output\logs\game\{host.log,host.err,session.json,guest.log}`,
|
||||
`logs\emulator\emulator.std{out,err}.log`.
|
||||
|
||||
## Headset results (2026-10-10, Steam Frame streaming to the PC through Steam Link / vrlink, 96 Hz)
|
||||
|
||||
AXRB's bridge opened a SteamVR session on the Frame each time (session state up to FOCUSED, both hands active), started
|
||||
through FramePort's launcher with the emulator booted by AXRB's run script (~1 min), and shut down cleanly.
|
||||
|
||||
- **Lucky's Tale (Unity, GLES): black.** GLES games go through AXRB's raw image path (eye readback → TCP), sized
|
||||
by SteamVR's recommended resolution: 3412×3412 per eye at the owner's 250 % supersampling = 93 MB per frame,
|
||||
~10 s per frame; at a lowered resolution 2644×2644 = 56 MB, 6.6 s per frame (~8.5 MB/s). AXRB's zero-copy GPU
|
||||
path covers Vulkan games only. The ~8.5 MB/s was the transport, not the readback: see "GLES games in the
|
||||
emulator" below (adb reverse: ~100 MB/s, half-size eyes, multipass: Lucky's Tale draws at 30 fps).
|
||||
- **Pinball FX VR (UE5, Vulkan): crash 4 s after start**, the same gfxstream `vkAllocateMemory` SIGSEGV from AXRB's
|
||||
runtime layer as headless (so not a headless artefact). AXRB's side.
|
||||
|
||||
Not reached: sound, controllers. Next candidates: a Vulkan game AXRB reports playable (Deadpool VR, Batman: Arkham
|
||||
Shadow); an AXRB issue for the Pinball crash.
|
||||
|
||||
## GLES games in the emulator (2026-10-16, headless under Monado's simulated HMD)
|
||||
|
||||
AXRB 1.0.4's emulator is the only backend with GLES (direct mode's EGL is a stub). A GLES frame is read back with
|
||||
`glReadPixels` on the game's thread inside `xrEndFrame` (`runtime/src/frame_transport.cpp`), sent as raw RGBA to the
|
||||
host (two eyes per frame) and uploaded there; `xrEndFrame` returns only after the send. Measured with
|
||||
`AXRB.Perf eye-readback` / `image-send` (guest log) and `host-image-arrival` (host.err):
|
||||
|
||||
| Eye size (per eye) | Bytes/frame | Route | Send | Frame rate |
|
||||
|---|---|---|---|---|
|
||||
| 896×1007 (Monado's recommendation) | 7.2 MB | default: TCP to 10.0.2.2 (QEMU user-mode network) | 850-950 ms | 1.1 fps |
|
||||
| 448×504 (`scale=0.5`) | 1.8 MB | default | 200-230 ms | 4.4 fps |
|
||||
| 896×1008 | 7.2 MB | **adb reverse** (`debug.axrb.image_transport=adb`) | 87 ms (~83 MB/s) | 9.4 fps |
|
||||
| 640×720 (`scale=0.7`) | 3.7 MB | adb reverse | 38 ms (~96 MB/s) | 17.6 fps |
|
||||
| 448×512 (`scale=0.5`) | 1.8 MB | adb reverse | 14.5 ms (~125 MB/s) | 30.5-30.8 fps |
|
||||
|
||||
The readback itself is 1-3 ms. The default route caps at ~8 MB/s (the same rate as in the headset run above); AXRB's
|
||||
adb reverse route (AXRB sets up `adb reverse tcp:38491` anyway) is 10-15x faster. For SteamVR's resolutions the math
|
||||
stays hard: 2016² per eye = 32.5 MB/frame (~3 fps), at half size 8.1 MB (~10 fps); the owner's 2644² at half size
|
||||
14 MB (~6 fps). Lowering SteamVR's resolution for the game is what helps further (AXRB has a minimum-extent setting,
|
||||
`AXRB_MIN_EYE_EXTENT`, but no maximum).
|
||||
|
||||
What FramePort does for GLES games on this PC (all in the PC build / launcher, nothing on the Frame changes):
|
||||
- FramePort's launcher (`fp-axrb-run.ps1`) starts Android itself when it isn't running (AXRB's Start action, as the run
|
||||
script would; the run script then gets `-OwnsEmulator` and shuts it down), sets `debug.axrb.image_transport=adb`
|
||||
(`FRAMEPORT_AXRB_IMAGE_TRANSPORT=default` leaves AXRB's choice) and `debug.wm.disable_deprecated_target_sdk_dialog=1`.
|
||||
- `pc_selection` with a GLES analysis: FrameBridge `scale` at most 0.5 (FrameBridge's minimum), `scale_max=1` (the
|
||||
maximum eye size reported is the scaled one too), `projection_only=1` (see below).
|
||||
- `frame.unity_multipass` (experimental on the PC, `pc_detect` for Unity GLES + Oculus XR Plugin): gfxstream lists
|
||||
`GL_OVR_multiview2` but its encoder finds a multiview framebuffer incomplete and drops every draw
|
||||
(`GL2Encoder.cpp:s_glDrawElements … GL error 0x506 checkFramebufferCompleteness`): both eyes black.
|
||||
- `frame.gl_shim` (experimental on the PC, GLES only, `Patch.pc_keeps`): gfxstream has no
|
||||
`GL_EXT_disjoint_timer_query`; the shim lists it and hands out stand-ins ("available, 0 ns") so GLAD engines that
|
||||
call the timer queries unconditionally don't jump to NULL. Its multiview hiding also suits gfxstream.
|
||||
- FrameBridge settings without a rebuild: `frameport settings <pkg> --to pc key=value` writes
|
||||
`/sdcard/Android/data/<pkg>/files/framebridge.conf` (emulator: adb push, Android started for it if needed; direct
|
||||
mode: the file in AXRB's runtime folder); an empty value removes a key.
|
||||
|
||||
Per game (AXRB 1.0.4 emulator, Monado simulated HMD at 72 Hz, FramePort's PC build; Windows 11, RTX 4080 SUPER):
|
||||
|
||||
| Game | Build / settings | Furthest | Frame rate / time | Blocker |
|
||||
|---|---|---|---|---|
|
||||
| Lucky's Tale 1.0.55 (Unity 2019.4 + Oculus XR Plugin, GLES) | PC build + `frame.unity_multipass`, `scale=0.5`, adb route | **title scene drawn in both eyes** (Monado window captured) | 30.5-30.8 fps, image-send 14.5 ms | none headless; needs the headset (picture through SteamVR at its resolution, controllers) |
|
||||
| Accounting+ 1.24.35 (Unity 2017.4 built-in Oculus, GLES) | PC build (`frame.unity_oculus_check`), `projection_only`, old-SDK dialog off | **stance selection screen drawn in both eyes** | 10 fps, image-send 82 ms: its OVRPlugin makes 896×1024 eye buffers whatever FrameBridge's scale/max say | its quads (OVROverlay) are dropped by `projection_only` (AXRB rejects every multi-layer GLES frame with -2); eye size only shrinks with the PC runtime's resolution |
|
||||
| Path of the Warrior 21.11.10 (VrApi-direct GLES, own engine; from the `PATCHED/` copy) | VrApi bridge + GL shim (timer-query stand-ins) | VR session FOCUSED, 72 fps of empty frames, no crash in 150 s | – | under `--sim` only: Monado's simulated HMD reports position valid but not tracked, AXRB's host then never sets its LOCAL origin (`local_origin_flags` 0), so `xrLocateSpace(VIEW, LOCAL)` has no flags and the bridge's `EnterVrMode` gives up after 30 s ("no tracked head pose before deadline"). Before the stand-ins: SIGSEGV at pc 0 in `EgHalGrTimestampQueryGL` (NULL `glad_glGenQueriesEXT`). Needs a real headset run |
|
||||
| BattleSisters 1.2.4 (Unity 2019.4 built-in VR, GLES) | PC build (ovrpshim frame loop), `scale=0.5` | OpenXR session, 3 frames submitted (448×512), then UnityMain and the render thread both wait in futexes (debuggerd stacks) | – | hang after the first frames, not diagnosed yet (guest stacks are only translator frames) |
|
||||
|
||||
`--sim` notes: AXRB's opt-in host capture (`AXRB_CAPTURE_PREFIX`) only starts at sequence 2000 in 1.0.4 (hard-coded;
|
||||
`AXRB_CAPTURE_FIRST_SEQUENCE` isn't read), which GLES games at 10-30 fps don't reach in a test: use the Monado
|
||||
window captures and FrameBridge `snapshot=N`. AXRB's guest log only keeps warnings plus AXRB's own tags: read
|
||||
`adb logcat -d` for FrameBridge/OVRPlugin lines. `debuggerd -b <pid>` works from `adb shell` (stacks).
|
||||
|
||||
## Open (needs the owner + a headset)
|
||||
|
||||
- A game in the headset through SteamVR (picture, audio, controllers; Steam Frame controllers: AXRB #20).
|
||||
- Pinball FX VR's Vulkan crash with the host attached happens in the emulator only; in direct mode it reaches its lobby
|
||||
headless. Needs the headset: picture/latency through SteamVR, controllers, a table played.
|
||||
- Play from the PC's Steam library (shortcut → launcher script → AXRB).
|
||||
|
||||
## Testing without a headset (Monado's simulated HMD, 2026-10-15)
|
||||
|
||||
AXRB's host bridge needs an OpenXR session with a D3D11 binding, which SteamVR doesn't give without a headset. For
|
||||
unattended tests FramePort can run the bridge against **Monado for Windows** with Monado's simulated HMD instead,
|
||||
without changing the system's OpenXR runtime or touching SteamVR:
|
||||
|
||||
- **Monado build:** an official CI artifact of `monado/monado` (gitlab.freedesktop.org, project 2685), job `windows`
|
||||
of a `main` pipeline (there is no Windows release asset; the job's `install/` folder is the portable runtime:
|
||||
`bin\monado-service.exe`, `bin\openxr_monado.dll`, `openxr_monado.json`, SDL2/Vulkan loader DLLs). Tested build:
|
||||
pipeline 1766968, job 112793105, commit 8b259763f (`v25.1.0-917-g8b259763f`). Unpacked by hand into
|
||||
`%LOCALAPPDATA%\FramePort-dev\monado\install` (or `FRAMEPORT_MONADO_DIR`): no installer, no UAC, no registry. Its
|
||||
`share\steamvr-monado` (a SteamVR driver) is never registered.
|
||||
- **Selection per process only:** the OpenXR loader's `XR_RUNTIME_JSON=<monado>\openxr_monado.json`. HKLM's
|
||||
`ActiveRuntime` stays SteamVR. AXRB's run script registers an app identity with SteamVR whenever HKLM names SteamVR
|
||||
(an OpenVR utility client, which starts SteamVR), so under the simulator FramePort's launcher call answers that one
|
||||
`python steamvr_app_identity.py` call "failed" (the script only warns).
|
||||
- **Service settings** (`tools/xr_sim.SERVICE_ENV`): `SIMULATED_ENABLE=1` (the simulated builder; the Windows build
|
||||
only has the qwerty/remote/simulated builders, so no real device is probed), `SIMULATED_LEFT/RIGHT=ml2` (the only
|
||||
simulated controllers whose bindings cover the Vive wand profile: AXRB suggests Touch/Index/Vive, so with `simple`
|
||||
or `wmr` its hands stay inactive), `XRT_COMPOSITOR_DEFAULT_FRAMERATE=72`. Headless variant: `XRT_COMPOSITOR_NULL=1`
|
||||
+ `XRT_COMPOSITOR_NULL_FPS=72` (no window, nothing to capture).
|
||||
- **D3D11 + adapter:** Monado's D3D11 client compositor works (timeline semaphores); it renders on the discrete GPU
|
||||
(Vulkan device 0, RTX 4080 SUPER here; `XRT_COMPOSITOR_FORCE_GPU_INDEX` would change it) and asks D3D11 clients for
|
||||
that adapter's LUID, which DXGI finds.
|
||||
- **Results:** a minimal D3D11 client (`native/xrsimprobe/xr_sim_probe.cpp`, built with VS Build Tools against the
|
||||
Khronos `openxr_loader_windows` 1.1.63 release) went IDLE → READY → SYNCHRONIZED → VISIBLE → FOCUSED in 0.01 s
|
||||
and submitted 72 frames/s until it asked to exit. AXRB's host bridge (`--serve-openxr 38490 0 <title>`, no
|
||||
emulator) reached `D3D11 graphics binding ready`, session state 5 (FOCUSED), `AXRB TCP: listening on
|
||||
0.0.0.0:38490`, both controllers active with valid poses, `host-end-frame: rate=72.0/s`, its splash in both eyes.
|
||||
No game was run yet.
|
||||
- **Seeing what is drawn:** the windowed compositor ("Monado (Windowed)", 1264×681, both eyes side by side without
|
||||
distortion) can be saved with `native/xrsimprobe/xr_sim_capture.cpp` (`PrintWindow`, works behind other windows;
|
||||
`xr_sim.capture(path)`), and `--sim` also sets AXRB's own opt-in `AXRB_CAPTURE_PREFIX` (4 PPM readbacks of the
|
||||
submitted layers, 5 s apart, from frame 300) into `<data>/logs/xr-sim/`. A launch test that reached RUNNING saves
|
||||
Monado's window there too, just before it stops the game (`<time>-<pkg>-headset.bmp`, `pc_android.sim_capture`),
|
||||
and every AXRB launch test reports the frame rate from AXRB's `AXRB.Perf` summaries (game submits / bridge). Monado itself has no screenshot function;
|
||||
`XRT_WINDOW_PEEK` and `XRT_DEBUG_GUI` exist but only show windows.
|
||||
- **Use:** `frameport test <pkg> --to pc --sim` (or `FRAMEPORT_PC_XR_SIM=1`): starts `monado-service.exe` hidden
|
||||
(WMI, like AXRB's scripts; ready when its pipe `\\.\pipe\<%TEMP%>\monado_comp_ipc` exists), passes the environment to
|
||||
the AXRB launch (`pc_android.launch_test(extra_env=…)`, default `xr_sim.active_env()`), stops the service afterwards
|
||||
(an already running Monado is used and left running). Service log: `<data>/logs/xr-sim-service.log`.
|
||||
- **Limits:** the simulated head wobbles slowly and the controllers hold still with no buttons pressed, so it proves
|
||||
startup, frame submission and what is drawn, not gameplay; the windowed compositor opens a visible window on the
|
||||
desktop; frame pacing is Monado's, not a headset's.
|
||||
@@ -267,3 +267,26 @@ Scan a folder with Rift game dumps (Windows game folders) like Quest dumps; they
|
||||
| Proton game hangs at start in a headless/SSH launch; log `no driver could be loaded` / `explorer process failed to start` | no display session (DISPLAY/GAMESCOPE_WAYLAND_DISPLAY) | the Proton launch.sh takes them from the running Steam (built in) |
|
||||
| Unreal game starts (window created) then `CrashReportClient` runs | the game crashed under Proton; often no VR runtime reached it (Revive off) | keep `pcvr.revive` on (repacks' bundled LibRevive64.dll isn't loaded by itself); read the game log + crash summary in the launch log |
|
||||
| `VK_ERROR_DEVICE_LOST` under DXVK | freedreno GPU hang | `pcvr.proton_log` to capture; PC mode |
|
||||
|
||||
## Quest games on this PC (AXRB, `docs/PC_ANDROID.md`)
|
||||
|
||||
| Symptom | Cause | Fix |
|
||||
|---|---|---|
|
||||
| Unconverted Quest APK in AXRB: no launcher activity, SIGABRT ~0.3 s after `libovrplatformloader.so` loads | Meta's platform loader aborts outside a Quest | FramePort always gives AXRB its OVRPort build (the PC build: OVRPort + `on_pc` APK fixes, no Steam Frame fixes) |
|
||||
| `axrb-no-headset`: host.err `failed to find D3D11 adapter requested by OpenXR runtime` / `xrCreateInstance failed: XR_ERROR_RUNTIME_FAILURE` | SteamVR has no headset (null driver: no D3D11 adapter; vrlink with no Frame connected: no instance) | connect the headset and let SteamVR show it first; for unattended tests use Monado's simulated headset: `frameport test <pkg> --to pc --sim` (docs/PC_ANDROID.md "Testing without a headset") |
|
||||
| Testing a PC (AXRB) game without a headset: need a D3D11 OpenXR session, but SteamVR must stay untouched | SteamVR without a headset gives no D3D11 adapter / no instance | `--sim` (or `FRAMEPORT_PC_XR_SIM=1`): portable Monado for Windows, simulated HMD + `ml2` controllers, selected per process with `XR_RUNTIME_JSON` (the system runtime stays SteamVR); AXRB's SteamVR app registration is skipped; frames in `<data>/logs/xr-sim/` (AXRB_CAPTURE_PREFIX), Monado's window via `xr_sim.capture()`. Service log `<data>/logs/xr-sim-service.log` |
|
||||
| `axrb-gfxstream-crash`: SIGSEGV in `vulkan.ranchu.so (gfxstream::vk::ResourceTracker::on_vkAllocateMemory)` from `libVkLayer_AXRB_runtime.so` (Pinball FX VR, UE5 Vulkan, headless) | the emulator's Vulkan path through AXRB's runtime layer | report to AXRB with diagnostics (`axrb/*` logs); recheck with the host attached |
|
||||
| `axrb-translation-crash`: crash in `libndk_translation.so (berberis::…)` | Android's ARM translation (AXRB issue #9, some Unity games) | nothing to patch; wait for AXRB's other translator |
|
||||
| Reinstall fails `INSTALL_FAILED_UPDATE_INCOMPATIBLE`, or the game data must be copied again | a copy signed with another key was installed in AXRB (e.g. by AXRB's own launcher); a full uninstall deletes the OBB folder and saves | uninstall it in AXRB first; FramePort keeps one key per game, so its own updates keep data |
|
||||
| A FramePort call that runs an AXRB script never returns although the script ended (emulator already up) | QEMU (`Start-Process`) and the adb server inherit the caller's handles; through WSL interop even a file or /dev/null keeps the relay open | `axrb.spawn_detached` starts the script through WMI (`Win32_Process.Create`, nothing inherited) and polls its PID; exit code from the log's `FP_EXIT` line |
|
||||
| Which AXRB runs a game? (`deployment.json` `backend`) | AXRB 2.x (AXRB-Emulatorless) has a direct mode (`axrb-direct.exe`, no emulator) that only renders Vulkan; 1.0.4 is the emulator | automatic: direct for `graphics` Vulkan, emulator for GLES/unknown; `pc.axrb_backend` (backend / translator / precompose / legacy-driver options) or `frameport install <pkg> --to pc --axrb-backend direct\|emulator`; a switch leaves the other backend's copy and saves where they are |
|
||||
| `axrb-direct-no-gles`: direct.log `eglInitialize … EGL_BAD_DISPLAY` / `Unable to initialize EGL` / Unity's `Unable to retrieve the default EGL display!` | the game draws with OpenGL ES; direct mode's EGL is a stub (no GLES renderer). Not reported once a Vulkan device exists (Unreal Vulkan builds probe EGL first) | install it for the emulator (`pc.axrb_backend` backend=emulator); automatic choice already does this when the analysis says GLES |
|
||||
| `axrb-direct-incomplete`: `Direct mode installation is incomplete` / `Direct mode is missing …` / `Preparing the AOSP application failed` | a direct-mode file of AXRB is missing, or the sysroot (`<runtime>\direct\sysroot`, receipt `.axrb-sysroot.json` digest + format) isn't complete | reinstall AXRB-Emulatorless or rebuild the local build (`FRAMEPORT_AXRB_DIRECT_DIR`), then `frameport pc install-axrb --backend direct` (re-runs AXRB's `make_sysroot.py --art`) |
|
||||
| `axrb-direct-no-vulkan`: `vulkan-1.dll is not installed: the guest has no GPU` | no Windows Vulkan loader/driver | install the GPU's current driver |
|
||||
| `axrb-direct-unhandled-instruction`: `fatal signal 4 (SIGILL)` in direct.log | Dynarmic (or Digitalis) can't execute an arm64 instruction | report to AXRB with diagnostics (`axrb/direct/*`); try `pc.axrb_backend` translator=digitalis (or dynarmic) or the emulator |
|
||||
| `axrb-direct-guest-crash` (`E/cpu: thread … fatal signal 11/7/6/5`), `axrb-direct-host-fault` (`E/host-fault:` / `E/fatal:` = axrb-direct.exe itself), `axrb-direct-java-crash` (`FATAL EXCEPTION`, `Runtime aborting`) | a crash under direct mode's translator/ART; usually a missing Android service (Meta/Play/account/DRM), a translation bug or an unsupported syscall/Binder call (`axrb-direct-unsupported-syscall`, warning) | the other translator or the emulator; report to AXRB with the backtrace in direct.log |
|
||||
| `axrb-direct-no-native-window`: `AXRB_AOSP_HOST_SURFACES 0`, then nothing (The Climb 2: last line `Loading plug-in CryHTTP`, the main thread busy-polls its looper) | NativeActivity games take their surface with `Window.takeSurface`; AXRB's direct mode (`HostWindow.attach`) only bridges SurfaceViews, so `APP_CMD_INIT_WINDOW` never comes | AXRB's side (drafted upstream issue + a ~40-line HostWindow patch, tested); FramePort can't fix it in the APK. With the patched bootstrap the game gets its window (`AXRB_AOSP_TAKEN_SURFACE`) |
|
||||
| `axrb-direct-vulkan-extensions`: CryEngine `Renderer initialization` → `CrySystem initialization failed!` with no vkCreateDevice (The Climb 2, direct mode) | the PC's driver lacks Quest-only device extensions (VK_EXT_fragment_density_map is the one Climb 2 requires; Android external memory too); AXRB's runtime also asks for AHB in direct mode | `frame.vk_android_extensions` (PC builds only, added automatically for direct-VrApi Vulkan games): the renderer's `vkEnumerateDeviceExtensionProperties` import → `libfp_vkext.so`, which lists them; AXRB drops them again at vkCreateDevice. The VrApi bridge leaves runtime extensions no device has out of `vrapi_GetDeviceExtensionsVulkan` |
|
||||
| AXRB under Monado's simulator: VrApi games only submit empty frames; bridge `initial recenter: head flags=0x0`, `EnterVrMode: no tracked head pose before deadline` | Monado's simulated head lacks POSITION_TRACKED, so AXRB's host never sets up its LOCAL origin (`local_origin_flags` 0) and every pose in LOCAL has flags 0 | `--sim` sets AXRB's test-only `AXRB_TEST_SYNTHETIC_HMD=2` (fixed standing head + valid LOCAL); real headsets don't need it |
|
||||
| A direct-mode launch test ran its full time but ends in `axrb-direct-guest-crash` | the game crashed during AXRB's own stop (after `AXRB_AOSP_ACTIVITIES_STOPPED`; The Climb 2 after `ovr_Shutdown finished`) | triage turns it into the info finding `axrb-direct-crash-at-stop`; the verdict passes |
|
||||
| Direct-mode launch test: "NEVER_STARTED" although AXRB's bridge ran | direct.out never printed `AXRB_AOSP_ACTIVITY_CREATED`/`AXRB_AOSP_LIFECYCLE` (ART's first start is interpreted, `-Xint`: slow); the run script stops when the bridge loses its headset | check host.err (`axrb-no-headset`), direct.out/err; the test waits 5 min for the activity and stops through AXRB's `stop_game.ps1` (closes the bridge window, the game pauses and saves) |
|
||||
+2
-1
@@ -13,12 +13,13 @@ embeds debug paths (`-g`) and the dex depends on the d8 version, so those differ
|
||||
|---|---|---|
|
||||
| `luajit/` | `arm64-v8a/libfp_luajit.so` | Pinned upstream LuaJIT with full-width lightuserdata (`frame.luajit_pointers`). Only the verified old Lua engine's shared public functions become imports; the original xLua API 105 bindings, LuaSocket helpers and `luaopen_perflib` remain in the game. No game library is bundled. Build: `python native/build.py --only luajit`; source revision + archive SHA-256 in `luajit/build.py`, MIT notices in `luajit/COPYRIGHT` and `artifacts/licenses/LuaJIT.txt`. `runtime.c` checks GC64 and the retained `xlua_gl` global-reference offset. `smoke.c` compares a real low-address allocation with the original library's own native static pointer; the unmodified library fails only the high-address case, the patched one round-trips both exactly. Startup verified on Frame; gameplay unverified. |
|
||||
| `adapter/` | `{arm64-v8a,armeabi-v7a}/libopenxr_loader_generic.so` | **FrameBridge**: replaces overport's generic loader (which is renamed `libopenxr_loader_original.so`) and fixes Steam Frame runtime gaps. Hooks xrCreateInstance, swapchains, xrEndFrame, spaces, xrPollEvent, … everything else is forwarded by `gen_forwarders.py`-generated tail calls. `scene_emu.c` = Meta scene/spatial-entity emulation; `flip_vk.c` = Vulkan blit for VERTICAL_FLIP quads. `session_fixes.c` = per-game session fixes, all off by default and hooked only when on (`layer_debug` diagnostics, `stable_local`, `focus_hold`, aim correction `aim_pitch/aim_yaw/aim_forward`, `refresh_rate`, `proximity_emul` = finger proximity (XR_FB_touch_controller_proximity, which the Frame lacks) from the capacitive touch inputs: OVRPlugin's `hand_thumb_proximity`/`hand_trigger_proximity` actions get extra Touch bindings); `input_diag.c` = controller-input diagnostics (setting `input_diag`, off by default and hooked only when on; logs suggested interaction profiles and the runtime's answers, each hand's current profile, functions the runtime lacks and failing input/haptics/perf calls, each line once; tested on the host by `tests/test_input_diag.py`); `layer_emul_gl.c` = `equirect_emul` (GLES sessions only): 360° equirect/equirect2 layers become one adapter projection layer, drawn by a worker thread with its own EGL context shared with the app's: each 360° image is converted to a cube map only when it changes, and the view is redrawn only after a 4° head turn (GL/EGL resolved with dlopen, so Vulkan games never load them); `layer_math.h` = their pose/face math, tested on the host by `tests/test_layer_emul.py`. `render_model.c` = XR_FB_render_model emulation (setting `controller_models`, off by default): serves `files/framebridge/controller_{left,right}.glb`, which the agent converts on the Frame from SteamVR's own Frame controller render models (never shipped by FramePort); tested on the host by `tests/test_render_model.py`. Settings: `libframe_settings.so` in the APK + `settings.conf`/`framebridge.conf` on the Frame. |
|
||||
| `vrapi-bridge/` | `arm64-v8a/libvrapi.so` | VrApi → OpenXR bridge from [Android-XR-Bridge/OVRPort](https://github.com/Android-XR-Bridge/OVRPort) `native/vrapi` at 5e7df52 (GPL-3.0, `LICENSE.upstream`; unchanged upstream as of OVRPort v1.2.5, which ships the unpatched code as its opt-in `patch_vrapi_openxr` in experimental CLI builds), with our changes in `upstream-patches/`: GLES sessions + GL texture swapchains, cylinder→quad layers, GL vertical flip, UNORM↔sRGB format twins, 30 s VR-mode deadline, VALID-only recenter, loading-icon layers skipped, `vrapi_PollEvent`/`RecenterPose`/`SetDisplayRefreshRate`/`GetSystemPropertyFloatArray` (BlazeRush imports them, GitHub #57), legacy compositor debug/volume frame flags accepted, full-rate Vulkan foveation images allocated as density attachments (The Climb, GitHub #238), diagnostics behind `-DOVP_GL_DIAG`. `upstream-patches/` reproduces these sources from the fork's `native/vrapi` (checked 2026-10-06 against its latest commit); upstream PRs Android-XR-Bridge/OVRPort#3-#8, tracked in GitHub #75. |
|
||||
| `vrapi-bridge/` | `arm64-v8a/libvrapi.so` | VrApi → OpenXR bridge from [Android-XR-Bridge/OVRPort](https://github.com/Android-XR-Bridge/OVRPort) `native/vrapi` at 5e7df52 (GPL-3.0, `LICENSE.upstream`; unchanged upstream as of OVRPort v1.2.5, which ships the unpatched code as its opt-in `patch_vrapi_openxr` in experimental CLI builds), with our changes in `upstream-patches/`: GLES sessions + GL texture swapchains, cylinder→quad layers, GL vertical flip, UNORM↔sRGB format twins, 30 s VR-mode deadline, VALID-only recenter, loading-icon layers skipped, runtime device extensions no Vulkan device offers left out of `vrapi_GetDeviceExtensionsVulkan` (AXRB's runtime asks for AHB also in its direct mode; not in `upstream-patches/` yet), `vrapi_PollEvent`/`RecenterPose`/`SetDisplayRefreshRate`/`GetSystemPropertyFloatArray` (BlazeRush imports them, GitHub #57), legacy compositor debug/volume frame flags accepted, full-rate Vulkan foveation images allocated as density attachments (The Climb, GitHub #238), diagnostics behind `-DOVP_GL_DIAG`. `upstream-patches/` reproduces these sources from the fork's `native/vrapi` (checked 2026-10-06 against its latest commit); upstream PRs Android-XR-Bridge/OVRPort#3-#8, tracked in GitHub #75. |
|
||||
| `platformcompat/` | `arm64-v8a/libovrplatformcompat.so` | Real `ovrMessageType_ToString` (same fork, `native/platform`). |
|
||||
| `langpack/` | `arm64-v8a/libfp_langpack.so` | Language packs for the Meta Platform SDK (patch `frame.langpacks`, opt-in). overport's platform loader is a dispatcher in front of Meta's own loader and answers `ovr_LanguagePack_GetCurrent/SetCurrent` with `return 0` (no reply ever). This library becomes the loader's first DT_NEEDED; the loader's own exports of the 31 functions it defines are made STB_LOCAL in `.dynsym` (`elf.hide_exports`, nothing moves), so symbol lookups reach the library first. It serves `<tag>.lang` files found in the game's OBB / app files (`$FRAMEPORT_LANGPACK_DIRS` overrides the search path) through `ovr_LanguagePack_*`, `ovr_AssetFile_GetList` (the loader's list + the packs) and `ovr_AssetFile_StatusById`; its own message queue is merged into `ovr_PopMessage`, and every handle that is not ours (an address-range check) goes to the loader's original function, whose address is read at run time from the loader's in-memory `.dynsym`. With patch `frame.asset_files` (marker byte `@FPASSETS@`, or env `FRAMEPORT_ASSET_FILES=1`) it also lists the data's `*.pak` content files as installed `default` asset files and answers `ovr_AssetFile_DownloadById` for them at once (a completed `DownloadUpdate`, then the result with the path). Host-tested against a stand-in loader (`tests/test_langpack.py`, plain `cc`, no NDK); the bionic/headset side is unverified. |
|
||||
| `glshim/` | `arm64-v8a/libglshim.so` | Mesa GLSL compatibility for GLAD engines (hooks eglGetProcAddress): comments out `#pragma` before `#extension`, enables `GL_EXT_shader_implicit_conversions`, hides GL_OVR_multiview (`gl_hide_multiview`, default 1) and logs failed shaders. `-DGLSHIM_TRACE` adds per-FBO draw/error tracing. |
|
||||
| `glmv/` | `arm64-v8a/libfpglmv.so` | Single-view draws of OVR_multiview programs (patch `frame.gl_multiview_fbo`, opt-in, GitHub #77). Mesa enforces OVR_multiview's rule that a draw's program declares as many views as the draw framebuffer has; engines that compile every shader with `num_views=2` and also draw into ordinary 2D framebuffers (Doom3Quest's HUD/PDA pool) lose those draws. The engine library gets it as first DT_NEEDED (direct `gl*` imports) and its `dlopen("libGLESv3.so")` string is rewritten to `libfpglmv.so` (same length; its `qgl*` dlsym table); linked `--no-as-needed` to libGLESv3 so dlsym on its handle finds everything it doesn't wrap. It records stage sources at glLinkProgram, caches the draw framebuffer's color-attachment view count per bind, and when a multiview program draws into a 0-view framebuffer it binds a lazily built twin (`glmv_rewrite.h`: num_views layout blanked, `gl_ViewID_OVR` -> `(0u)`; attribute locations + uniform block bindings copied, default-block uniforms copied before every such draw with a shadow to skip unchanged ones), draws, rebinds the original. Logcat tag `GLMV`; `gl_mv_debug=1`. The rewriter is host-tested on Doom3Quest's 19 shaders (`tests/test_gl_multiview_fbo.py`); untested on the device. |
|
||||
| `tlskeys/` | `arm64-v8a/libfp_tkeys.so` | Thread-key pool for Unity (patch `frame.unity_tls_key_pool`, opt-in, GitHub #198; approach and the first helper by Klownicle). Bionic allows 128 pthread keys per process; Unity 6 plus large native libraries (Firebase, Gecko) and the Frame's own libraries use them up (Wander: `cannot create thread specific key for __cxa_get_globals()`). libunity.so's four key imports are renamed to `fp_tkey_create/_delete/_get/_set` (`elf.rename_imports`, same `.dynstr` bytes, versions set global) and this library is added to its DT_NEEDED: keys without a destructor become slots (512, generation-tagged, `0x40000000 + slot`) in a per-thread table under one real key; keys with a destructor and all other libraries keep real keys. Lock-free get/set. Logs `fp_tkeys: pooling Unity's thread keys` once (tag FrameBridge). Host-tested (rename); not yet run on the device. |
|
||||
| `vkext/` | `arm64-v8a/libfp_vkext.so` | Quest Vulkan device extensions for builds for this PC (patch `frame.vk_android_extensions`, never on the Frame). AXRB's direct mode gives the game the Windows driver's device, which lacks `VK_EXT_fragment_density_map` and Android's external memory; CryEngine (The Climb 2) refuses to create its device without them. The renderer's `vkEnumerateDeviceExtensionProperties` import is renamed to `fpEnumerateDeviceExtensionProperties` (same length, `elf.rename_imports`) and this library added to its DT_NEEDED: it lists the real extensions plus the missing ones; AXRB's vkCreateDevice leaves those out again. Logs `fp_vkext: listing …` (tag FrameBridge). Seen working in direct mode (2026-10-16, headless). |
|
||||
| `zinkfix/` | `arm64-v8a/libVkLayer_fp_shaderfix.so` | Shader-fix Vulkan layer `VK_LAYER_FP_shader_fix` for OpenGL ES games (patch `frame.zink_shader_fix`): sits between Zink (Mesa's GL on Vulkan) and the driver and inserts the words of `zink_shader_fix` (same format as the Vulkan shim's `vk_shader_fix`: size + SHA-256 match) into SPIR-V modules; `zink_shader_dump=1` writes every distinct module to `files/fp_spirv/`. The engine library loads it first (DT_NEEDED); its constructor puts the layer in front of Android's GraphicsEnv debug layer list (private Android 11 `getDebugLayers`/`setDebugLayers`, found through libvulkan.so's dependencies) before EGL starts, so the loader picks it up from the app's lib dir. Exports only the enumeration functions and `VK_LAYER_FP_shader_fixGet*ProcAddr` (never plain `vk*` entry points). Vader Immortal's lightspeed shaders (Klownicle, GitHub #49). |
|
||||
| `xrlayer/` | `linux-arm64/libxr_frameport_timefix.so` + `XR_APILAYER_FRAMEPORT_timefix.json` | OpenXR API layer for Windows PC VR games under Proton on the Frame (glibc aarch64, built freestanding with the NDK's clang), on by default (patch `pcvr.xr_timefix`). Retries `xrCreateInstance` as an OpenXR 1.0 app when the runtime rejects 1.1 (the Frame's SteamVR runtime does, and Proton 11's VR helper asks for 1.1). Also emulates `xrConvertTimespecTimeToTimeKHR`/`xrConvertTimeToTimespecTimeKHR` if the runtime refuses them (the Frame's Android runtime does; its Linux runtime, used by Proton, supports them as of 2026-09-29 — so this part is only a fallback; Proton's wineopenxr needs them for `XR_KHR_win32_convert_performance_counter_time`, which Revive requires) with the adapter's xrWaitFrame-calibrated offset, and drops the extension from xrCreateInstance if the runtime rejects it. Enabled per game by the Proton launch.sh (`XR_API_LAYER_PATH`, `XR_ENABLE_API_LAYERS`). `tests/test_xrlayer.py` builds it for x86_64 and drives it via ctypes. |
|
||||
| `oculushmd/` | `win-x64/fp_oculushmd.exe` | PC VR counterpart of overport's `patch_oculus_unreal` (patch `pcvr.oculus_unreal`, default for Unreal Rift games on the Frame). Unreal's OculusHMD and LibOVR's `ovr_Detect` only start when the Windows named event `OculusHMDConnected` exists and is signalled (the Oculus service creates it). `fp_oculushmd.exe <command line>` creates it (manual reset, signalled), runs the command (Revive's injector) in a job object and keeps the event until every process in the job — the game and its children — has exited (fallback without job support: 3 minutes); returns the command's exit code and logs `FramePort oculushmd: …` to stderr (launch.log). Freestanding Windows x64 console exe (no CRT, no Windows SDK): the NDK's clang + `lld-link /Brepro` with a kernel32 import library generated by `llvm-dlltool`, so it's byte-reproducible. Tested on Windows from WSL with a build whose event name is `-DEVENT_NAME=L"…"` (the Oculus service owns the real event on a PC with the Oculus app). |
|
||||
|
||||
@@ -98,6 +98,14 @@ static int foveation_eye_enabled, foveation_eye_supported;
|
||||
// hide XR_FB_space_warp: games then render every frame themselves (UE5 Application SpaceWarp flickered on the Frame,
|
||||
// e.g. Into The Radius 2; OVRPort's patch_disable_space_warp doesn't reach UE5's OpenXR plugin)
|
||||
static int hide_space_warp = 0;
|
||||
// projection_only: frames with a projection layer and more layers submit the projection layer alone (AXRB 1.0.4's
|
||||
// emulator rejects every multi-layer GLES frame with -2: its GLES path has no layer batches; Accounting+'s OVROverlay
|
||||
// quads made almost every frame fail). The other layers (menus, overlays drawn as quads) are not shown.
|
||||
static int projection_only = 0;
|
||||
// scale_max: the maximum eye size reported is the scaled recommended one too (games that size their eye buffers from
|
||||
// the maximum or scale the recommendation up: Accounting+'s Unity 2017 OVRPlugin made 896x1024 from a 448x504
|
||||
// recommendation). For AXRB's emulator, where every eye pixel is copied.
|
||||
static int scale_max = 0;
|
||||
static int strip_color_bias = 0;
|
||||
// fade_quad.c: draw colour-scale fades (fade to black) as a black quad over the picture; 2 = also remove the scale
|
||||
static int fade_quad = 0;
|
||||
@@ -175,6 +183,8 @@ static void read_settings(const char *path) {
|
||||
if (sscanf(line, "foveation_storage_fix=%f", &value) == 1) foveation_storage_fix = value != 0;
|
||||
if (sscanf(line, "foveation_eye=%f", &value) == 1) foveation_eye = value != 0;
|
||||
if (sscanf(line, "hide_space_warp=%f", &value) == 1) hide_space_warp = value != 0;
|
||||
if (sscanf(line, "projection_only=%f", &value) == 1) projection_only = value != 0;
|
||||
if (sscanf(line, "scale_max=%f", &value) == 1) scale_max = value != 0;
|
||||
if (sscanf(line, "strip_color_bias=%f", &value) == 1) strip_color_bias = (int)value;
|
||||
if (sscanf(line, "fade_quad=%f", &value) == 1) fade_quad = value > 0 ? (int)value : 0;
|
||||
if (sscanf(line, "frame_balance=%f", &value) == 1) frame_balance = value != 0;
|
||||
@@ -273,6 +283,7 @@ static void initialize(void) {
|
||||
if (proximity_emul) LOG("per-game: proximity_emul=%d (finger proximity from capacitive touch: %s)", proximity_emul,
|
||||
proximity_emul > 1 ? "thumb + index" : "thumb");
|
||||
if (hide_space_warp) LOG("per-game: hide_space_warp=1 (XR_FB_space_warp hidden, space warp info removed)");
|
||||
if (projection_only) LOG("per-game: projection_only=1 (frames with more layers submit the projection layer alone)");
|
||||
if (strip_color_bias) LOG("per-game: strip_color_bias=%d (layer color scale/bias removed)", strip_color_bias);
|
||||
if (fade_quad) LOG("per-game: fade_quad=%d (colour-scale fades drawn as a black quad%s)", fade_quad,
|
||||
fade_quad > 1 ? "; the layer's own scale removed" : "");
|
||||
@@ -459,7 +470,12 @@ XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateViewConfigurationViews(XrInstance inst
|
||||
if (h > views[i].maxImageRectHeight) h = views[i].maxImageRectHeight;
|
||||
views[i].recommendedImageRectWidth = w ? w : 1;
|
||||
views[i].recommendedImageRectHeight = h ? h : 1;
|
||||
LOG("view %u recommended %ux%u", i, views[i].recommendedImageRectWidth, views[i].recommendedImageRectHeight);
|
||||
if (scale_max && scale < 1.0f) {
|
||||
views[i].maxImageRectWidth = views[i].recommendedImageRectWidth;
|
||||
views[i].maxImageRectHeight = views[i].recommendedImageRectHeight;
|
||||
}
|
||||
LOG("view %u recommended %ux%u%s", i, views[i].recommendedImageRectWidth, views[i].recommendedImageRectHeight,
|
||||
scale_max && scale < 1.0f ? " (also the maximum)" : "");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -654,9 +670,10 @@ XRAPI_ATTR XrResult XRAPI_CALL xrCreateSwapchain(XrSession session, const XrSwap
|
||||
}
|
||||
clear_gl_errors("xrCreateSwapchain");
|
||||
XrResult result = fn(session, &fixed, swapchain);
|
||||
LOG("xrCreateSwapchain %ux%u format=%lld samples=%u array=%u faces=%u usage=0x%llx flags=0x%llx result=%d",
|
||||
LOG("xrCreateSwapchain %ux%u format=%lld samples=%u array=%u faces=%u usage=0x%llx flags=0x%llx result=%d handle=%p",
|
||||
fixed.width, fixed.height, (long long)fixed.format, fixed.sampleCount, fixed.arraySize, fixed.faceCount,
|
||||
(unsigned long long)fixed.usageFlags, (unsigned long long)fixed.createFlags, result);
|
||||
(unsigned long long)fixed.usageFlags, (unsigned long long)fixed.createFlags, result,
|
||||
(void *)(uintptr_t)(XR_SUCCEEDED(result) && swapchain ? *swapchain : 0));
|
||||
if (XR_SUCCEEDED(result)) {
|
||||
remember_swapchain(*swapchain);
|
||||
note_swapchain_size(*swapchain, fixed.width, fixed.height);
|
||||
@@ -745,7 +762,7 @@ static int cylinder_strips(const XrCompositionLayerCylinderKHR *c, XrComposition
|
||||
XrSwapchainSubImage sub = c->subImage;
|
||||
sub.imageRect = (XrRect2Di){{x0, rect.offset.y}, {x1 - x0, rect.extent.height}};
|
||||
out[i] = (XrCompositionLayerQuad){XR_TYPE_COMPOSITION_LAYER_QUAD, c->next, c->layerFlags, c->space,
|
||||
c->eyeVisibility, sub, pose, {2 * r * sinf(a / 2), height}};
|
||||
XR_EYE_VISIBILITY_BOTH, sub, pose, {2 * r * sinf(a / 2), height}};
|
||||
}
|
||||
static int logged;
|
||||
if (logged++ < 3) LOG("cylinder layer -> %d quad strips (r=%.2f angle=%.2f)", n, r, c->centralAngle);
|
||||
@@ -1606,6 +1623,20 @@ XRAPI_ATTR XrResult XRAPI_CALL xrEndFrame(XrSession session, const XrFrameEndInf
|
||||
frames = 0; drift_sum = drift_max = 0;
|
||||
}
|
||||
}
|
||||
XrFrameEndInfo single;
|
||||
if (projection_only && info && info->layerCount > 1 && info->layers) {
|
||||
for (uint32_t i = 0; i < info->layerCount; ++i) {
|
||||
const XrCompositionLayerBaseHeader *l = info->layers[i];
|
||||
if (!l || l->type != XR_TYPE_COMPOSITION_LAYER_PROJECTION) continue;
|
||||
static int logged;
|
||||
if (!logged++) LOG("projection_only: %u layers -> the projection layer alone", info->layerCount);
|
||||
single = *info;
|
||||
single.layerCount = 1;
|
||||
single.layers = &info->layers[i];
|
||||
info = &single;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((!layer_fix && !swap_eyes && !emulate_passthrough && !flip_quads && !flip_emul && !strip_depth && !fade_quad) || !info || !info->layerCount ||
|
||||
info->layerCount > 64)
|
||||
return fn(session, info);
|
||||
@@ -1706,6 +1737,14 @@ XRAPI_ATTR XrResult XRAPI_CALL xrEndFrame(XrSession session, const XrFrameEndInf
|
||||
++swapped;
|
||||
continue;
|
||||
}
|
||||
// A per-eye cylinder pair (eyeVisibility LEFT + RIGHT, e.g. Doom3Quest/PreyVR's curved menu) would expand to
|
||||
// twice the strips; the Frame's runtime composites a quad to both eyes and rejects a frame with that many
|
||||
// per-eye quad layers (XR_ERROR_LAYER_INVALID). Drop the right eye and show the left one's strips to both.
|
||||
if (layer_fix && cylinder_strips_on && no_cylinder && layer->type == XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR &&
|
||||
((const XrCompositionLayerCylinderKHR *)layer)->eyeVisibility == XR_EYE_VISIBILITY_RIGHT) {
|
||||
++dropped;
|
||||
continue;
|
||||
}
|
||||
if (layer_fix && cylinder_strips_on && no_cylinder && layer->type == XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR &&
|
||||
runtime_swapchain(((const XrCompositionLayerCylinderKHR *)layer)->subImage.swapchain)) {
|
||||
// keep the whole frame within the runtime's layer limit: every later layer still needs a slot
|
||||
|
||||
+12
-3
@@ -380,6 +380,15 @@ def build_tlskeys(tc: Path):
|
||||
"-Wl,-z,max-page-size=16384", "tlskeys.c", "-llog", "-o", ART / "arm64-v8a/libfp_tkeys.so"], cwd=src)
|
||||
|
||||
|
||||
def build_vkext(tc: Path):
|
||||
"""Android-only Vulkan device extensions listed for builds for this PC (see vkext/vkext.c, patch
|
||||
frame.vk_android_extensions)."""
|
||||
src = HERE / "vkext"
|
||||
run([exe(tc, "aarch64-linux-android29-clang"), "-shared", "-fPIC", "-O2", "-Wall", "-Wextra", "-Werror",
|
||||
"-fvisibility=hidden", f"-ffile-prefix-map={HERE}=native", "-Wl,-soname,libfp_vkext.so",
|
||||
"-Wl,-z,max-page-size=16384", "vkext.c", "-lvulkan", "-llog", "-o", ART / "arm64-v8a/libfp_vkext.so"], cwd=src)
|
||||
|
||||
|
||||
def build_luajit(tc: Path):
|
||||
run([sys.executable, HERE / "luajit/build.py", "--clang-dir", tc / "bin",
|
||||
"--out", ART / "arm64-v8a/libfp_luajit.so"])
|
||||
@@ -438,7 +447,7 @@ def write_sums():
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--only", default="adapter,bridge,compat,langpack,glshim,eglfmt,glmv,ovrtrace,dex,xrlayer,oculushmd,xrshim,vkshim,zinkfix,foveation,ovrpshim,tlskeys,luajit,vrsettings,venc,a32")
|
||||
ap.add_argument("--only", default="adapter,bridge,compat,langpack,glshim,eglfmt,glmv,ovrtrace,dex,xrlayer,oculushmd,xrshim,vkshim,zinkfix,foveation,ovrpshim,tlskeys,vkext,luajit,vrsettings,venc,a32")
|
||||
ap.add_argument("--ndk")
|
||||
args = ap.parse_args()
|
||||
parts = set(args.only.split(","))
|
||||
@@ -451,11 +460,11 @@ def main():
|
||||
"oculushmd": lambda: build_oculushmd(tc), "vkshim": lambda: build_vkshim(tc),
|
||||
"zinkfix": lambda: build_zinkfix(tc),
|
||||
"foveation": lambda: build_foveation(tc),
|
||||
"ovrpshim": lambda: build_ovrpshim(tc), "tlskeys": lambda: build_tlskeys(tc),
|
||||
"ovrpshim": lambda: build_ovrpshim(tc), "tlskeys": lambda: build_tlskeys(tc), "vkext": lambda: build_vkext(tc),
|
||||
"luajit": lambda: build_luajit(tc),
|
||||
"vrsettings": lambda: build_vrsettings(tc), "venc": lambda: build_venc(tc),
|
||||
"vroverlay_probe": lambda: build_vroverlay_probe(tc), "a32": lambda: build_a32(tc)}
|
||||
for name in ("adapter", "bridge", "compat", "langpack", "glshim", "eglfmt", "glmv", "ovrtrace", "xrshim", "vkshim", "zinkfix", "foveation", "ovrpshim", "tlskeys", "luajit", "dex", "xrlayer", "oculushmd", "vrsettings", "venc",
|
||||
for name in ("adapter", "bridge", "compat", "langpack", "glshim", "eglfmt", "glmv", "ovrtrace", "xrshim", "vkshim", "zinkfix", "foveation", "ovrpshim", "tlskeys", "vkext", "luajit", "dex", "xrlayer", "oculushmd", "vrsettings", "venc",
|
||||
"vroverlay_probe", "a32"):
|
||||
if name in parts:
|
||||
log(f"build {name}")
|
||||
|
||||
+72
-5
@@ -35,6 +35,7 @@ static const GLubyte *(*real_glGetStringi)(GLenum, GLuint);
|
||||
static void (*real_glGetIntegerv)(GLenum, GLint *);
|
||||
static __eglMustCastToProperFunctionPointerType (*real_eglGetProcAddress)(const char *);
|
||||
static pthread_once_t once = PTHREAD_ONCE_INIT;
|
||||
static int tq_used; // GPU timer-query stand-ins handed out (below): GL_GPU_DISJOINT_EXT reads answer 0
|
||||
|
||||
static int hide_multiview = -1; // -1: not set (Unity and Unreal keep multiview, everything else hides it)
|
||||
static int hide_msrtt = 1;
|
||||
@@ -628,6 +629,21 @@ static int is_hidden(const char *name) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// GL_EXT_disjoint_timer_query listed although the driver lacks it: GLAD loaders only look its functions up when the
|
||||
// extension is listed, and some engines call them unconditionally (Path of the Warrior on AXRB's emulator, whose
|
||||
// gfxstream eglGetProcAddress still returns pointers for the names); the lookups then get the stand-ins below
|
||||
// eglGetProcAddress. Decided once a context answers GL_NUM_EXTENSIONS, by whether the driver lists the extension.
|
||||
static const char TIMER_QUERY_EXT[] = "GL_EXT_disjoint_timer_query";
|
||||
static int added_timer_query = -1;
|
||||
static int add_timer_query(void) {
|
||||
if (added_timer_query < 0 && real_glGetIntegerv && real_glGetStringi) {
|
||||
GLint total = 0;
|
||||
real_glGetIntegerv(GL_NUM_EXTENSIONS, &total);
|
||||
if (total > 0) added_timer_query = !ext_supported(TIMER_QUERY_EXT);
|
||||
}
|
||||
return added_timer_query > 0;
|
||||
}
|
||||
|
||||
// Filtered index table for glGetStringi (built lazily, per process).
|
||||
static GLuint *visible;
|
||||
static GLint visible_count = -1;
|
||||
@@ -641,12 +657,17 @@ static void build_table(void) {
|
||||
const char *name = (const char *)real_glGetStringi(GL_EXTENSIONS, (GLuint)i);
|
||||
if (name && !is_hidden(name)) visible[visible_count++] = (GLuint)i;
|
||||
}
|
||||
LOG("extensions: %d of %d visible to the game", visible_count, total);
|
||||
LOG("extensions: %d of %d visible to the game%s", visible_count, total,
|
||||
add_timer_query() ? " (+ GL_EXT_disjoint_timer_query, stand-ins)" : "");
|
||||
}
|
||||
|
||||
__attribute__((visibility("default"))) void glGetIntegerv(GLenum pname, GLint *data) {
|
||||
pthread_once(&once, init);
|
||||
if (pname == GL_NUM_EXTENSIONS && data) { build_table(); if (visible_count >= 0) { *data = visible_count; return; } }
|
||||
if (pname == GL_NUM_EXTENSIONS && data) {
|
||||
build_table();
|
||||
if (visible_count >= 0) { *data = visible_count + add_timer_query(); return; }
|
||||
}
|
||||
if (pname == 0x8FBB /* GL_GPU_DISJOINT_EXT */ && tq_used && data) { *data = 0; return; }
|
||||
if (real_glGetIntegerv) real_glGetIntegerv(pname, data);
|
||||
}
|
||||
|
||||
@@ -654,7 +675,10 @@ __attribute__((visibility("default"))) const GLubyte *glGetStringi(GLenum name,
|
||||
pthread_once(&once, init);
|
||||
if (name == GL_EXTENSIONS) {
|
||||
build_table();
|
||||
if (visible_count >= 0) return index < (GLuint)visible_count ? real_glGetStringi(name, visible[index]) : NULL;
|
||||
if (visible_count >= 0) {
|
||||
if (index < (GLuint)visible_count) return real_glGetStringi(name, visible[index]);
|
||||
return index == (GLuint)visible_count && add_timer_query() ? (const GLubyte *)TIMER_QUERY_EXT : NULL;
|
||||
}
|
||||
}
|
||||
return real_glGetStringi ? real_glGetStringi(name, index) : NULL;
|
||||
}
|
||||
@@ -665,11 +689,12 @@ __attribute__((visibility("default"))) const GLubyte *glGetString(GLenum name) {
|
||||
if (name != GL_EXTENSIONS || !s) return s;
|
||||
static char *filtered;
|
||||
if (!filtered) {
|
||||
filtered = calloc(strlen((const char *)s) + 1, 1);
|
||||
filtered = calloc(strlen((const char *)s) + sizeof(TIMER_QUERY_EXT) + 2, 1);
|
||||
char *copy = strdup((const char *)s), *save = NULL;
|
||||
for (char *tok = strtok_r(copy, " ", &save); tok; tok = strtok_r(NULL, " ", &save))
|
||||
if (!is_hidden(tok)) { strcat(filtered, tok); strcat(filtered, " "); }
|
||||
free(copy);
|
||||
if (add_timer_query()) { strcat(filtered, TIMER_QUERY_EXT); strcat(filtered, " "); }
|
||||
}
|
||||
return (const GLubyte *)filtered;
|
||||
}
|
||||
@@ -794,13 +819,55 @@ EXPORT void glDrawRangeElements(GLenum m, GLuint s, GLuint e, GLsizei c, GLenum
|
||||
if (d.DrawRangeElements) d.DrawRangeElements(m, s, e, c, t, i);
|
||||
}
|
||||
|
||||
// GPU timer queries (GL_EXT_disjoint_timer_query) the driver doesn't have: GLAD engines call the function pointers
|
||||
// whether or not the extension is listed (Path of the Warrior: glad_glGenQueriesEXT NULL -> SIGSEGV at pc 0 in
|
||||
// EgHalGrTimestampQueryGL on AXRB's emulator, whose gfxstream GLES has no timer queries; Quest and the Frame have
|
||||
// them, so the stand-ins are only handed out when the real lookup fails). Every query is at once available and
|
||||
// measured 0 ns.
|
||||
static GLuint tq_next = 0x7f000000;
|
||||
static void tq_gen(GLsizei n, GLuint *ids) { for (GLsizei i = 0; ids && i < n; i++) ids[i] = __atomic_add_fetch(&tq_next, 1, __ATOMIC_RELAXED); }
|
||||
static void tq_delete(GLsizei n, const GLuint *ids) { (void)n; (void)ids; }
|
||||
static GLboolean tq_is(GLuint id) { return id > 0x7f000000; }
|
||||
static void tq_begin(GLenum target, GLuint id) { (void)target; (void)id; }
|
||||
static void tq_end(GLenum target) { (void)target; }
|
||||
static void tq_counter(GLuint id, GLenum target) { (void)id; (void)target; }
|
||||
static void tq_getiv(GLenum target, GLenum pname, GLint *v) { (void)target; (void)pname; if (v) *v = 0; }
|
||||
#define TQ_RESULT(v, pname) if (v) *(v) = (pname) == 0x8867 /* GL_QUERY_RESULT_AVAILABLE */ ? 1 : 0
|
||||
static void tq_objiv(GLuint id, GLenum pname, GLint *v) { (void)id; TQ_RESULT(v, pname); }
|
||||
static void tq_objuiv(GLuint id, GLenum pname, GLuint *v) { (void)id; TQ_RESULT(v, pname); }
|
||||
static void tq_obji64v(GLuint id, GLenum pname, GLint64 *v) { (void)id; TQ_RESULT(v, pname); }
|
||||
static void tq_objui64v(GLuint id, GLenum pname, GLuint64 *v) { (void)id; TQ_RESULT(v, pname); }
|
||||
static void tq_int64v(GLenum pname, GLint64 *v) { (void)pname; if (v) *v = 0; }
|
||||
static const struct { const char *name; void *fn; } timer_query_standins[] = {
|
||||
{"glGenQueriesEXT", (void *)tq_gen}, {"glDeleteQueriesEXT", (void *)tq_delete}, {"glIsQueryEXT", (void *)tq_is},
|
||||
{"glBeginQueryEXT", (void *)tq_begin}, {"glEndQueryEXT", (void *)tq_end},
|
||||
{"glQueryCounterEXT", (void *)tq_counter}, {"glGetQueryivEXT", (void *)tq_getiv},
|
||||
{"glGetQueryObjectivEXT", (void *)tq_objiv}, {"glGetQueryObjectuivEXT", (void *)tq_objuiv},
|
||||
{"glGetQueryObjecti64vEXT", (void *)tq_obji64v}, {"glGetQueryObjectui64vEXT", (void *)tq_objui64v},
|
||||
{"glGetInteger64vEXT", (void *)tq_int64v},
|
||||
};
|
||||
|
||||
static __eglMustCastToProperFunctionPointerType timer_query_standin(const char *name) {
|
||||
for (size_t i = 0; i < sizeof(timer_query_standins) / sizeof(timer_query_standins[0]); i++)
|
||||
if (!strcmp(name, timer_query_standins[i].name)) {
|
||||
if (!tq_used++) LOG("no GPU timer queries in this driver: %s and the other EXT query functions answer "
|
||||
"'available, 0 ns'", name);
|
||||
return (__eglMustCastToProperFunctionPointerType)timer_query_standins[i].fn;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__attribute__((visibility("default"))) __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *name) {
|
||||
pthread_once(&once, init);
|
||||
if (name && !strcmp(name, "glGetStringi")) return (__eglMustCastToProperFunctionPointerType)glGetStringi;
|
||||
if (name && !strcmp(name, "glGetString")) return (__eglMustCastToProperFunctionPointerType)glGetString;
|
||||
if (name && !strcmp(name, "glGetIntegerv")) return (__eglMustCastToProperFunctionPointerType)glGetIntegerv;
|
||||
__eglMustCastToProperFunctionPointerType fn = real_eglGetProcAddress ? real_eglGetProcAddress(name) : NULL;
|
||||
if (!fn || !name) return fn;
|
||||
if (name && (!fn || added_timer_query > 0)) {
|
||||
__eglMustCastToProperFunctionPointerType standin = timer_query_standin(name);
|
||||
if (standin || !fn) return standin;
|
||||
}
|
||||
if (!name) return fn;
|
||||
#define WRAP(sym, real, w) if (!strcmp(name, sym)) { real = (void *)fn; return (__eglMustCastToProperFunctionPointerType)w; }
|
||||
if (hide_msrtt && (!strcmp(name, "glFramebufferTexture2DMultisampleEXT") ||
|
||||
!strcmp(name, "glRenderbufferStorageMultisampleEXT"))) {
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// libfp_vkext.so (patch frame.vk_android_extensions, builds for this PC only): Android-only Vulkan device
|
||||
// extensions for engines that refuse to start without them. AXRB's direct mode hands the guest the Windows driver's
|
||||
// device extensions, which lack Android's external-memory ones and the fragment density map Quest GPUs have;
|
||||
// CryEngine (The Climb 2) then fails "Renderer initialization" before it creates a device. The engine's import of
|
||||
// vkEnumerateDeviceExtensionProperties is renamed to fpEnumerateDeviceExtensionProperties (same length,
|
||||
// elf.rename_imports), which lists the real extensions plus the missing ones of EXTRA. AXRB's vkCreateDevice leaves out requested extensions the host GPU doesn't have, so nothing
|
||||
// else changes; on a device that has them (the Frame, where the patch is never applied) the list is the same.
|
||||
#include <android/log.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
static const char* const EXTRA[] = {
|
||||
"VK_KHR_external_memory_fd",
|
||||
"VK_ANDROID_external_memory_android_hardware_buffer",
|
||||
"VK_EXT_queue_family_foreign",
|
||||
// Quest GPUs have it, desktop NVIDIA drivers don't: The Climb 2 requires it (no device without it; with it listed
|
||||
// and left out again by AXRB, the VrApi bridge's full-rate foveation stand-ins take over)
|
||||
"VK_EXT_fragment_density_map",
|
||||
};
|
||||
#define N_EXTRA (sizeof(EXTRA) / sizeof(EXTRA[0]))
|
||||
|
||||
__attribute__((visibility("default"))) VkResult fpEnumerateDeviceExtensionProperties(
|
||||
VkPhysicalDevice device, const char* layer, uint32_t* count, VkExtensionProperties* props) {
|
||||
if (layer || !count) return vkEnumerateDeviceExtensionProperties(device, layer, count, props);
|
||||
uint32_t n = 0;
|
||||
VkResult r = vkEnumerateDeviceExtensionProperties(device, NULL, &n, NULL);
|
||||
if (r != VK_SUCCESS) return r;
|
||||
VkExtensionProperties* all = calloc(n + N_EXTRA, sizeof(*all));
|
||||
if (!all) return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
r = vkEnumerateDeviceExtensionProperties(device, NULL, &n, all);
|
||||
if (r < 0) {
|
||||
free(all);
|
||||
return r;
|
||||
}
|
||||
uint32_t total = n;
|
||||
static int logged;
|
||||
for (unsigned e = 0; e < N_EXTRA; ++e) {
|
||||
int have = 0;
|
||||
for (uint32_t i = 0; i < n && !have; ++i) have = !strcmp(all[i].extensionName, EXTRA[e]);
|
||||
if (have) continue;
|
||||
strncpy(all[total].extensionName, EXTRA[e], VK_MAX_EXTENSION_NAME_SIZE - 1);
|
||||
all[total].specVersion = 1;
|
||||
if (!logged) __android_log_print(ANDROID_LOG_INFO, "FrameBridge", "fp_vkext: listing %s (not on this GPU)", EXTRA[e]);
|
||||
++total;
|
||||
}
|
||||
logged = 1;
|
||||
if (!props) {
|
||||
*count = total;
|
||||
free(all);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
const uint32_t c = *count < total ? *count : total;
|
||||
memcpy(props, all, c * sizeof(*props));
|
||||
*count = c;
|
||||
free(all);
|
||||
return c < total ? VK_INCOMPLETE : VK_SUCCESS;
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <dlfcn.h>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
namespace ovp {
|
||||
@@ -747,12 +748,68 @@ VRAPI ovrResult vrapi_GetInstanceExtensionsVulkan(char* names, uint32_t* size) {
|
||||
uint32_t capacity = names ? *size : 0;
|
||||
return xrOk(s.xr.xrGetVulkanInstanceExtensionsKHR(s.instance, s.system, capacity, size, names), "xrGetVulkanInstanceExtensionsKHR") ? Success : InvalidOperation;
|
||||
}
|
||||
// The runtime's device extensions that no Vulkan device here offers are left out (FramePort): engines like
|
||||
// CryEngine refuse to create a device when a requested extension is missing, and AXRB's runtime asks for its
|
||||
// emulator's VK_ANDROID_external_memory_android_hardware_buffer + VK_EXT_queue_family_foreign also in its direct mode,
|
||||
// where the Windows driver has neither ("CrySystem initialization failed"). Where every device has them (the Frame)
|
||||
// the list is unchanged.
|
||||
static std::string supportedDeviceExtensions(const std::string& wanted) {
|
||||
VkApplicationInfo app{VK_STRUCTURE_TYPE_APPLICATION_INFO};
|
||||
app.apiVersion = VK_API_VERSION_1_0;
|
||||
VkInstanceCreateInfo info{VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO};
|
||||
info.pApplicationInfo = &app;
|
||||
VkInstance probe = VK_NULL_HANDLE;
|
||||
if (vkCreateInstance(&info, nullptr, &probe) != VK_SUCCESS || !probe) return wanted;
|
||||
std::vector<std::string> available;
|
||||
uint32_t devices = 0;
|
||||
vkEnumeratePhysicalDevices(probe, &devices, nullptr);
|
||||
std::vector<VkPhysicalDevice> list(devices);
|
||||
if (devices && vkEnumeratePhysicalDevices(probe, &devices, list.data()) >= VK_SUCCESS) {
|
||||
for (uint32_t d = 0; d < devices; ++d) {
|
||||
uint32_t count = 0;
|
||||
vkEnumerateDeviceExtensionProperties(list[d], nullptr, &count, nullptr);
|
||||
std::vector<VkExtensionProperties> props(count);
|
||||
if (count && vkEnumerateDeviceExtensionProperties(list[d], nullptr, &count, props.data()) >= VK_SUCCESS)
|
||||
for (uint32_t i = 0; i < count; ++i) available.emplace_back(props[i].extensionName);
|
||||
}
|
||||
}
|
||||
vkDestroyInstance(probe, nullptr);
|
||||
if (available.empty()) return wanted; // nothing to judge by: keep the runtime's list
|
||||
std::string out, dropped;
|
||||
size_t start = 0;
|
||||
while (start < wanted.size()) {
|
||||
size_t end = wanted.find(' ', start);
|
||||
if (end == std::string::npos) end = wanted.size();
|
||||
std::string name = wanted.substr(start, end - start);
|
||||
if (!name.empty()) {
|
||||
std::string& to = std::find(available.begin(), available.end(), name) != available.end() ? out : dropped;
|
||||
to += (to.empty() ? "" : " ") + name;
|
||||
}
|
||||
start = end + 1;
|
||||
}
|
||||
if (!dropped.empty()) OVP_LOG("Vulkan device extensions the runtime asks for but no device offers, left out: %s", dropped.c_str());
|
||||
return out;
|
||||
}
|
||||
VRAPI ovrResult vrapi_GetDeviceExtensionsVulkan(char* names, uint32_t* size) {
|
||||
LOCK_STATE;
|
||||
if (!s.instance) return NotInitialized;
|
||||
if (!size) return InvalidParameter;
|
||||
uint32_t capacity = names ? *size : 0;
|
||||
return xrOk(s.xr.xrGetVulkanDeviceExtensionsKHR(s.instance, s.system, capacity, size, names), "xrGetVulkanDeviceExtensionsKHR") ? Success : InvalidOperation;
|
||||
static std::string filtered;
|
||||
static bool haveFiltered = false;
|
||||
if (!haveFiltered) {
|
||||
uint32_t needed = 0;
|
||||
if (!xrOk(s.xr.xrGetVulkanDeviceExtensionsKHR(s.instance, s.system, 0, &needed, nullptr), "xrGetVulkanDeviceExtensionsKHR")) return InvalidOperation;
|
||||
std::vector<char> raw(needed + 1, '\0');
|
||||
if (needed && !xrOk(s.xr.xrGetVulkanDeviceExtensionsKHR(s.instance, s.system, needed, &needed, raw.data()), "xrGetVulkanDeviceExtensionsKHR")) return InvalidOperation;
|
||||
filtered = supportedDeviceExtensions(std::string(raw.data()));
|
||||
haveFiltered = true;
|
||||
}
|
||||
const uint32_t needed = static_cast<uint32_t>(filtered.size() + 1);
|
||||
if (!names) { *size = needed; return Success; }
|
||||
if (*size < needed) { *size = needed; return InvalidParameter; }
|
||||
std::memcpy(names, filtered.c_str(), needed);
|
||||
*size = needed;
|
||||
return Success;
|
||||
}
|
||||
VRAPI ovrResult vrapi_CreateSystemVulkan(ovrSystemCreateInfoVulkan* info) {
|
||||
LOCK_STATE;
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
// xr_sim_capture: save what Monado's compositor window shows (the simulated HMD's display = both eyes as
|
||||
// the headset would get them) to a BMP, so a headset-free test can see what a game draws.
|
||||
//
|
||||
// xr_sim_capture.exe <out.bmp> [window title, default "Monado"]
|
||||
//
|
||||
// Finds the first top-level window whose title starts with the given text (Monado's own window is
|
||||
// "Monado (Windowed)", its peek window "Monado peek") and copies it with PrintWindow(PW_RENDERFULLCONTENT),
|
||||
// which also works for a window behind others. Prints "capture: <w>x<h> <file>" or "capture: fail ...".
|
||||
//
|
||||
// Build: cl /nologo /O2 xr_sim_capture.cpp /link user32.lib gdi32.lib
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <cwchar>
|
||||
#include <vector>
|
||||
|
||||
#ifndef PW_RENDERFULLCONTENT
|
||||
#define PW_RENDERFULLCONTENT 0x00000002
|
||||
#endif
|
||||
|
||||
struct Find {
|
||||
const wchar_t *prefix;
|
||||
HWND hwnd;
|
||||
};
|
||||
|
||||
static BOOL CALLBACK enum_cb(HWND h, LPARAM lp)
|
||||
{
|
||||
Find *f = (Find *)lp;
|
||||
wchar_t title[256];
|
||||
if (!IsWindowVisible(h) || GetWindowTextW(h, title, 256) <= 0)
|
||||
return TRUE;
|
||||
if (std::wcsncmp(title, f->prefix, std::wcslen(f->prefix)) == 0) {
|
||||
f->hwnd = h;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int wmain(int argc, wchar_t **argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
std::printf("usage: xr_sim_capture <out.bmp> [window title prefix]\n");
|
||||
return 1;
|
||||
}
|
||||
// Not DPI aware on purpose: Monado's window isn't either, so its client size in this process's
|
||||
// (scaled) coordinates is the size of its swapchain, which PrintWindow copies 1:1.
|
||||
Find f{argc > 2 ? argv[2] : L"Monado", nullptr};
|
||||
EnumWindows(enum_cb, (LPARAM)&f);
|
||||
if (!f.hwnd) {
|
||||
std::printf("capture: fail no window\n");
|
||||
return 2;
|
||||
}
|
||||
RECT r;
|
||||
GetClientRect(f.hwnd, &r);
|
||||
int w = r.right - r.left, h = r.bottom - r.top;
|
||||
if (w <= 0 || h <= 0) {
|
||||
std::printf("capture: fail empty window (minimised?)\n");
|
||||
return 2;
|
||||
}
|
||||
HDC wdc = GetDC(f.hwnd);
|
||||
HDC mdc = CreateCompatibleDC(wdc);
|
||||
HBITMAP bmp = CreateCompatibleBitmap(wdc, w, h);
|
||||
HGDIOBJ old = SelectObject(mdc, bmp);
|
||||
if (!PrintWindow(f.hwnd, mdc, PW_CLIENTONLY | PW_RENDERFULLCONTENT))
|
||||
BitBlt(mdc, 0, 0, w, h, wdc, 0, 0, SRCCOPY);
|
||||
SelectObject(mdc, old);
|
||||
|
||||
BITMAPINFOHEADER bi{sizeof(bi)};
|
||||
bi.biWidth = w;
|
||||
bi.biHeight = h; // bottom-up, as BMP files store it
|
||||
bi.biPlanes = 1;
|
||||
bi.biBitCount = 24;
|
||||
bi.biCompression = BI_RGB;
|
||||
int row = (w * 3 + 3) & ~3;
|
||||
std::vector<unsigned char> px((size_t)row * h);
|
||||
GetDIBits(mdc, bmp, 0, h, px.data(), (BITMAPINFO *)&bi, DIB_RGB_COLORS);
|
||||
DeleteObject(bmp);
|
||||
DeleteDC(mdc);
|
||||
ReleaseDC(f.hwnd, wdc);
|
||||
|
||||
FILE *out = _wfopen(argv[1], L"wb");
|
||||
if (!out) {
|
||||
std::printf("capture: fail cannot write\n");
|
||||
return 2;
|
||||
}
|
||||
BITMAPFILEHEADER fh{};
|
||||
fh.bfType = 0x4D42;
|
||||
fh.bfOffBits = sizeof(fh) + sizeof(bi);
|
||||
fh.bfSize = fh.bfOffBits + (DWORD)px.size();
|
||||
std::fwrite(&fh, sizeof(fh), 1, out);
|
||||
std::fwrite(&bi, sizeof(bi), 1, out);
|
||||
std::fwrite(px.data(), 1, px.size(), out);
|
||||
std::fclose(out);
|
||||
std::printf("capture: %dx%d %ls\n", w, h, argv[1]);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,343 @@
|
||||
// xr_sim_probe: the smallest D3D11 OpenXR client FramePort uses to check a headset-free OpenXR runtime
|
||||
// (Monado's simulated HMD, docs/PC_ANDROID.md "Testing without a headset") on Windows.
|
||||
//
|
||||
// Creates an instance with XR_KHR_D3D11_enable, picks the D3D11 adapter by the LUID the runtime asks for,
|
||||
// runs a session (begins it on READY), submits a projection layer every frame (each eye cleared to a
|
||||
// colour that cycles), and after <seconds> asks for the exit. Every step prints one "probe: ..." line;
|
||||
// the last line is "probe: result ok frames=N focused=0|1" or "probe: result fail ...".
|
||||
// Optional: --dump <file.bmp> saves the left eye image of frame 60 (what the client drew).
|
||||
//
|
||||
// Build (VS Build Tools x64 prompt), with the official OpenXR loader release (openxr_loader_windows):
|
||||
// cl /nologo /EHsc /O2 /I<loader>\include xr_sim_probe.cpp /link <loader>\x64\lib\openxr_loader.lib d3d11.lib dxgi.lib
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMINMAX
|
||||
#include <windows.h>
|
||||
#include <d3d11.h>
|
||||
#include <dxgi.h>
|
||||
#define XR_USE_PLATFORM_WIN32
|
||||
#define XR_USE_GRAPHICS_API_D3D11
|
||||
#include <openxr/openxr.h>
|
||||
#include <openxr/openxr_platform.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
|
||||
#define CHECK(call) \
|
||||
do { \
|
||||
XrResult r_ = (call); \
|
||||
if (XR_FAILED(r_)) { \
|
||||
std::printf("probe: result fail %s = %d\n", #call, (int)r_); \
|
||||
std::fflush(stdout); \
|
||||
std::exit(2); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static const char *state_name(XrSessionState s)
|
||||
{
|
||||
switch (s) {
|
||||
case XR_SESSION_STATE_IDLE: return "IDLE";
|
||||
case XR_SESSION_STATE_READY: return "READY";
|
||||
case XR_SESSION_STATE_SYNCHRONIZED: return "SYNCHRONIZED";
|
||||
case XR_SESSION_STATE_VISIBLE: return "VISIBLE";
|
||||
case XR_SESSION_STATE_FOCUSED: return "FOCUSED";
|
||||
case XR_SESSION_STATE_STOPPING: return "STOPPING";
|
||||
case XR_SESSION_STATE_LOSS_PENDING: return "LOSS_PENDING";
|
||||
case XR_SESSION_STATE_EXITING: return "EXITING";
|
||||
default: return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
static void save_bmp(ID3D11Device *dev, ID3D11DeviceContext *ctx, ID3D11Texture2D *tex, const char *path)
|
||||
{
|
||||
D3D11_TEXTURE2D_DESC d;
|
||||
tex->GetDesc(&d);
|
||||
d.Usage = D3D11_USAGE_STAGING;
|
||||
d.BindFlags = 0;
|
||||
d.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
|
||||
d.MiscFlags = 0;
|
||||
d.ArraySize = 1;
|
||||
d.MipLevels = 1;
|
||||
d.SampleDesc.Count = 1;
|
||||
ID3D11Texture2D *staging = nullptr;
|
||||
if (FAILED(dev->CreateTexture2D(&d, nullptr, &staging))) {
|
||||
std::printf("probe: dump failed (staging)\n");
|
||||
return;
|
||||
}
|
||||
ctx->CopySubresourceRegion(staging, 0, 0, 0, 0, tex, 0, nullptr);
|
||||
D3D11_MAPPED_SUBRESOURCE m;
|
||||
if (FAILED(ctx->Map(staging, 0, D3D11_MAP_READ, 0, &m))) {
|
||||
staging->Release();
|
||||
return;
|
||||
}
|
||||
FILE *f = std::fopen(path, "wb");
|
||||
if (f) {
|
||||
uint32_t w = d.Width, h = d.Height, row = w * 3, pad = (4 - row % 4) % 4;
|
||||
uint32_t size = 54 + (row + pad) * h;
|
||||
uint8_t hdr[54] = {'B', 'M'};
|
||||
std::memcpy(hdr + 2, &size, 4);
|
||||
hdr[10] = 54;
|
||||
hdr[14] = 40;
|
||||
std::memcpy(hdr + 18, &w, 4);
|
||||
std::memcpy(hdr + 22, &h, 4);
|
||||
hdr[26] = 1;
|
||||
hdr[28] = 24;
|
||||
std::fwrite(hdr, 1, 54, f);
|
||||
std::vector<uint8_t> line(row + pad, 0);
|
||||
for (int y = (int)h - 1; y >= 0; y--) {
|
||||
const uint8_t *src = (const uint8_t *)m.pData + (size_t)y * m.RowPitch;
|
||||
for (uint32_t x = 0; x < w; x++) { // RGBA/BGRA 8-bit formats only: good enough for a probe
|
||||
bool bgra = d.Format == DXGI_FORMAT_B8G8R8A8_UNORM || d.Format == DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
|
||||
line[x * 3 + 0] = src[x * 4 + (bgra ? 0 : 2)];
|
||||
line[x * 3 + 1] = src[x * 4 + 1];
|
||||
line[x * 3 + 2] = src[x * 4 + (bgra ? 2 : 0)];
|
||||
}
|
||||
std::fwrite(line.data(), 1, line.size(), f);
|
||||
}
|
||||
std::fclose(f);
|
||||
std::printf("probe: dumped left eye %ux%u to %s\n", w, h, path);
|
||||
}
|
||||
ctx->Unmap(staging, 0);
|
||||
staging->Release();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
double seconds = 10.0;
|
||||
const char *dump = nullptr;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (!std::strcmp(argv[i], "--dump") && i + 1 < argc)
|
||||
dump = argv[++i];
|
||||
else
|
||||
seconds = std::atof(argv[i]);
|
||||
}
|
||||
setvbuf(stdout, nullptr, _IONBF, 0);
|
||||
|
||||
const char *exts[] = {XR_KHR_D3D11_ENABLE_EXTENSION_NAME};
|
||||
XrInstanceCreateInfo ici{XR_TYPE_INSTANCE_CREATE_INFO};
|
||||
std::strcpy(ici.applicationInfo.applicationName, "xr_sim_probe");
|
||||
ici.applicationInfo.apiVersion = XR_MAKE_VERSION(1, 0, 0);
|
||||
ici.enabledExtensionCount = 1;
|
||||
ici.enabledExtensionNames = exts;
|
||||
XrInstance inst = XR_NULL_HANDLE;
|
||||
CHECK(xrCreateInstance(&ici, &inst));
|
||||
XrInstanceProperties ip{XR_TYPE_INSTANCE_PROPERTIES};
|
||||
CHECK(xrGetInstanceProperties(inst, &ip));
|
||||
std::printf("probe: runtime %s %u.%u.%u\n", ip.runtimeName, XR_VERSION_MAJOR(ip.runtimeVersion),
|
||||
XR_VERSION_MINOR(ip.runtimeVersion), XR_VERSION_PATCH(ip.runtimeVersion));
|
||||
|
||||
XrSystemGetInfo sgi{XR_TYPE_SYSTEM_GET_INFO};
|
||||
sgi.formFactor = XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY;
|
||||
XrSystemId sys;
|
||||
CHECK(xrGetSystem(inst, &sgi, &sys));
|
||||
XrSystemProperties sp{XR_TYPE_SYSTEM_PROPERTIES};
|
||||
CHECK(xrGetSystemProperties(inst, sys, &sp));
|
||||
std::printf("probe: system %s\n", sp.systemName);
|
||||
|
||||
PFN_xrGetD3D11GraphicsRequirementsKHR getReq = nullptr;
|
||||
CHECK(xrGetInstanceProcAddr(inst, "xrGetD3D11GraphicsRequirementsKHR", (PFN_xrVoidFunction *)&getReq));
|
||||
XrGraphicsRequirementsD3D11KHR req{XR_TYPE_GRAPHICS_REQUIREMENTS_D3D11_KHR};
|
||||
CHECK(getReq(inst, sys, &req));
|
||||
|
||||
IDXGIFactory1 *factory = nullptr;
|
||||
CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void **)&factory);
|
||||
IDXGIAdapter1 *adapter = nullptr;
|
||||
for (UINT i = 0; factory->EnumAdapters1(i, &adapter) != DXGI_ERROR_NOT_FOUND; i++) {
|
||||
DXGI_ADAPTER_DESC1 ad;
|
||||
adapter->GetDesc1(&ad);
|
||||
if (std::memcmp(&ad.AdapterLuid, &req.adapterLuid, sizeof(LUID)) == 0) {
|
||||
std::printf("probe: adapter %ls (luid %08lx:%08lx)\n", ad.Description, ad.AdapterLuid.HighPart,
|
||||
ad.AdapterLuid.LowPart);
|
||||
break;
|
||||
}
|
||||
adapter->Release();
|
||||
adapter = nullptr;
|
||||
}
|
||||
if (!adapter) {
|
||||
std::printf("probe: result fail no DXGI adapter with the runtime's LUID\n");
|
||||
return 2;
|
||||
}
|
||||
ID3D11Device *dev = nullptr;
|
||||
ID3D11DeviceContext *ctx = nullptr;
|
||||
D3D_FEATURE_LEVEL fl = D3D_FEATURE_LEVEL_11_0;
|
||||
if (FAILED(D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, 0, &fl, 1, D3D11_SDK_VERSION, &dev,
|
||||
nullptr, &ctx))) {
|
||||
std::printf("probe: result fail D3D11CreateDevice\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
XrGraphicsBindingD3D11KHR gb{XR_TYPE_GRAPHICS_BINDING_D3D11_KHR};
|
||||
gb.device = dev;
|
||||
XrSessionCreateInfo sci{XR_TYPE_SESSION_CREATE_INFO};
|
||||
sci.next = &gb;
|
||||
sci.systemId = sys;
|
||||
XrSession session;
|
||||
CHECK(xrCreateSession(inst, &sci, &session));
|
||||
std::printf("probe: session created\n");
|
||||
|
||||
XrReferenceSpaceCreateInfo rsci{XR_TYPE_REFERENCE_SPACE_CREATE_INFO};
|
||||
rsci.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL;
|
||||
rsci.poseInReferenceSpace.orientation.w = 1;
|
||||
XrSpace space;
|
||||
CHECK(xrCreateReferenceSpace(session, &rsci, &space));
|
||||
|
||||
uint32_t nviews = 0;
|
||||
CHECK(xrEnumerateViewConfigurationViews(inst, sys, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, 0, &nviews, nullptr));
|
||||
std::vector<XrViewConfigurationView> vcv(nviews, {XR_TYPE_VIEW_CONFIGURATION_VIEW});
|
||||
CHECK(xrEnumerateViewConfigurationViews(inst, sys, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, nviews, &nviews,
|
||||
vcv.data()));
|
||||
|
||||
uint32_t nfmt = 0;
|
||||
CHECK(xrEnumerateSwapchainFormats(session, 0, &nfmt, nullptr));
|
||||
std::vector<int64_t> fmts(nfmt);
|
||||
CHECK(xrEnumerateSwapchainFormats(session, nfmt, &nfmt, fmts.data()));
|
||||
int64_t fmt = fmts[0];
|
||||
for (int64_t f : fmts)
|
||||
if (f == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB || f == DXGI_FORMAT_R8G8B8A8_UNORM) {
|
||||
fmt = f;
|
||||
break;
|
||||
}
|
||||
|
||||
struct Eye {
|
||||
XrSwapchain sc;
|
||||
std::vector<XrSwapchainImageD3D11KHR> imgs;
|
||||
std::vector<ID3D11RenderTargetView *> rtv;
|
||||
uint32_t w, h;
|
||||
};
|
||||
std::vector<Eye> eyes(nviews);
|
||||
for (uint32_t i = 0; i < nviews; i++) {
|
||||
Eye &e = eyes[i];
|
||||
e.w = vcv[i].recommendedImageRectWidth;
|
||||
e.h = vcv[i].recommendedImageRectHeight;
|
||||
XrSwapchainCreateInfo sc{XR_TYPE_SWAPCHAIN_CREATE_INFO};
|
||||
sc.usageFlags = XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT | XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT;
|
||||
sc.format = fmt;
|
||||
sc.sampleCount = 1;
|
||||
sc.width = e.w;
|
||||
sc.height = e.h;
|
||||
sc.faceCount = 1;
|
||||
sc.arraySize = 1;
|
||||
sc.mipCount = 1;
|
||||
CHECK(xrCreateSwapchain(session, &sc, &e.sc));
|
||||
uint32_t n = 0;
|
||||
CHECK(xrEnumerateSwapchainImages(e.sc, 0, &n, nullptr));
|
||||
e.imgs.assign(n, {XR_TYPE_SWAPCHAIN_IMAGE_D3D11_KHR});
|
||||
CHECK(xrEnumerateSwapchainImages(e.sc, n, &n, (XrSwapchainImageBaseHeader *)e.imgs.data()));
|
||||
for (auto &img : e.imgs) {
|
||||
D3D11_RENDER_TARGET_VIEW_DESC rd{};
|
||||
rd.Format = (DXGI_FORMAT)fmt;
|
||||
rd.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
|
||||
ID3D11RenderTargetView *v = nullptr;
|
||||
dev->CreateRenderTargetView(img.texture, &rd, &v);
|
||||
e.rtv.push_back(v);
|
||||
}
|
||||
}
|
||||
std::printf("probe: %u views %ux%u format %lld\n", nviews, eyes[0].w, eyes[0].h, (long long)fmt);
|
||||
|
||||
bool running = false, quit = false, focused = false, exit_requested = false;
|
||||
uint64_t frames = 0, rendered = 0;
|
||||
auto t0 = std::chrono::steady_clock::now();
|
||||
while (!quit) {
|
||||
XrEventDataBuffer ev{XR_TYPE_EVENT_DATA_BUFFER};
|
||||
while (xrPollEvent(inst, &ev) == XR_SUCCESS) {
|
||||
if (ev.type == XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED) {
|
||||
auto *s = (XrEventDataSessionStateChanged *)&ev;
|
||||
double t = std::chrono::duration<double>(std::chrono::steady_clock::now() - t0).count();
|
||||
std::printf("probe: state %s at %.2f s (frames %llu)\n", state_name(s->state), t,
|
||||
(unsigned long long)frames);
|
||||
if (s->state == XR_SESSION_STATE_FOCUSED)
|
||||
focused = true;
|
||||
if (s->state == XR_SESSION_STATE_READY) {
|
||||
XrSessionBeginInfo bi{XR_TYPE_SESSION_BEGIN_INFO};
|
||||
bi.primaryViewConfigurationType = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO;
|
||||
CHECK(xrBeginSession(session, &bi));
|
||||
running = true;
|
||||
} else if (s->state == XR_SESSION_STATE_STOPPING) {
|
||||
CHECK(xrEndSession(session));
|
||||
running = false;
|
||||
} else if (s->state == XR_SESSION_STATE_EXITING || s->state == XR_SESSION_STATE_LOSS_PENDING) {
|
||||
quit = true;
|
||||
}
|
||||
} else if (ev.type == XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING) {
|
||||
quit = true;
|
||||
}
|
||||
ev = {XR_TYPE_EVENT_DATA_BUFFER};
|
||||
}
|
||||
double elapsed = std::chrono::duration<double>(std::chrono::steady_clock::now() - t0).count();
|
||||
if (!running) {
|
||||
if (elapsed > seconds + 20) { // never got READY, or never left
|
||||
std::printf("probe: result fail timeout (frames %llu)\n", (unsigned long long)frames);
|
||||
return 3;
|
||||
}
|
||||
Sleep(10);
|
||||
continue;
|
||||
}
|
||||
if (elapsed > seconds && !exit_requested) {
|
||||
std::printf("probe: requesting exit after %.2f s, frames %llu\n", elapsed, (unsigned long long)frames);
|
||||
xrRequestExitSession(session);
|
||||
exit_requested = true;
|
||||
}
|
||||
|
||||
XrFrameState fs{XR_TYPE_FRAME_STATE};
|
||||
CHECK(xrWaitFrame(session, nullptr, &fs));
|
||||
CHECK(xrBeginFrame(session, nullptr));
|
||||
std::vector<XrCompositionLayerProjectionView> pv(nviews, {XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW});
|
||||
XrCompositionLayerProjection layer{XR_TYPE_COMPOSITION_LAYER_PROJECTION};
|
||||
std::vector<XrCompositionLayerBaseHeader *> layers;
|
||||
if (fs.shouldRender) {
|
||||
std::vector<XrView> views(nviews, {XR_TYPE_VIEW});
|
||||
XrViewLocateInfo li{XR_TYPE_VIEW_LOCATE_INFO};
|
||||
li.viewConfigurationType = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO;
|
||||
li.displayTime = fs.predictedDisplayTime;
|
||||
li.space = space;
|
||||
XrViewState vs{XR_TYPE_VIEW_STATE};
|
||||
uint32_t got = 0;
|
||||
CHECK(xrLocateViews(session, &li, &vs, nviews, &got, views.data()));
|
||||
for (uint32_t i = 0; i < nviews; i++) {
|
||||
Eye &e = eyes[i];
|
||||
uint32_t idx;
|
||||
CHECK(xrAcquireSwapchainImage(e.sc, nullptr, &idx));
|
||||
XrSwapchainImageWaitInfo wi{XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO};
|
||||
wi.timeout = XR_INFINITE_DURATION;
|
||||
CHECK(xrWaitSwapchainImage(e.sc, &wi));
|
||||
float phase = (float)((frames % 120) / 120.0);
|
||||
float col[4] = {i == 0 ? phase : 0.1f, 0.2f, i == 1 ? phase : 0.1f, 1.0f};
|
||||
ctx->ClearRenderTargetView(e.rtv[idx], col);
|
||||
if (dump && i == 0 && rendered == 60)
|
||||
save_bmp(dev, ctx, e.imgs[idx].texture, dump);
|
||||
CHECK(xrReleaseSwapchainImage(e.sc, nullptr));
|
||||
pv[i].pose = views[i].pose;
|
||||
pv[i].fov = views[i].fov;
|
||||
pv[i].subImage.swapchain = e.sc;
|
||||
pv[i].subImage.imageRect = {{0, 0}, {(int32_t)e.w, (int32_t)e.h}};
|
||||
}
|
||||
layer.space = space;
|
||||
layer.viewCount = nviews;
|
||||
layer.views = pv.data();
|
||||
layers.push_back((XrCompositionLayerBaseHeader *)&layer);
|
||||
rendered++;
|
||||
}
|
||||
XrFrameEndInfo fe{XR_TYPE_FRAME_END_INFO};
|
||||
fe.displayTime = fs.predictedDisplayTime;
|
||||
fe.environmentBlendMode = XR_ENVIRONMENT_BLEND_MODE_OPAQUE;
|
||||
fe.layerCount = (uint32_t)layers.size();
|
||||
fe.layers = layers.data();
|
||||
CHECK(xrEndFrame(session, &fe));
|
||||
frames++;
|
||||
if (frames % 120 == 0)
|
||||
std::printf("probe: frames %llu rendered %llu at %.2f s\n", (unsigned long long)frames,
|
||||
(unsigned long long)rendered, elapsed);
|
||||
}
|
||||
for (auto &e : eyes)
|
||||
xrDestroySwapchain(e.sc);
|
||||
xrDestroySpace(space);
|
||||
xrDestroySession(session);
|
||||
xrDestroyInstance(inst);
|
||||
std::printf("probe: result ok frames=%llu rendered=%llu focused=%d\n", (unsigned long long)frames,
|
||||
(unsigned long long)rendered, focused ? 1 : 0);
|
||||
return 0;
|
||||
}
|
||||
@@ -276,6 +276,10 @@ def entry(p: base.Patch, games: list[str], sigs: list[tuple[str, str, str]]) ->
|
||||
facts.append("experimental")
|
||||
if not p.needs_vr:
|
||||
facts.append("also for 2D apps")
|
||||
if p.on_pc and p.category != "overport": # OVRPort's patches are all in builds for this PC
|
||||
facts.append("also in builds for this PC (AXRB" + (", experimental)" if p.on_pc == "experimental" else ")"))
|
||||
elif getattr(p, "pc_added", False):
|
||||
facts.append("builds for this PC (AXRB) add it when needed")
|
||||
rev = p.revision
|
||||
if rev > 1:
|
||||
facts.append(f"revision {rev}")
|
||||
|
||||
@@ -204,6 +204,11 @@
|
||||
"title": "Treat newer Quest controllers as Touch",
|
||||
"group": "Game settings"
|
||||
},
|
||||
"adapter.projection_only": {
|
||||
"anchor": "adapter-projection_only",
|
||||
"title": "Main picture only",
|
||||
"group": "Game settings"
|
||||
},
|
||||
"adapter.proximity_emul": {
|
||||
"anchor": "adapter-proximity_emul",
|
||||
"title": "Animate fingers from touch",
|
||||
@@ -234,6 +239,11 @@
|
||||
"title": "Sharpness",
|
||||
"group": "Game settings"
|
||||
},
|
||||
"adapter.scale_max": {
|
||||
"anchor": "adapter-scale_max",
|
||||
"title": "Cap the eye size",
|
||||
"group": "Game settings"
|
||||
},
|
||||
"adapter.scene_depth": {
|
||||
"anchor": "adapter-scene_depth",
|
||||
"title": "Room depth",
|
||||
@@ -634,6 +644,11 @@
|
||||
"title": "Vivox voice chat: skip Android 12 audio routing",
|
||||
"group": "Steam Frame patches"
|
||||
},
|
||||
"frame.vk_android_extensions": {
|
||||
"anchor": "frame-vk_android_extensions",
|
||||
"title": "Vulkan: list Android's external-memory extensions (this PC)",
|
||||
"group": "Steam Frame patches"
|
||||
},
|
||||
"frame.vk_sanitize": {
|
||||
"anchor": "frame-vk_sanitize",
|
||||
"title": "Vulkan: drop invalid render-pass pointers",
|
||||
@@ -779,6 +794,11 @@
|
||||
"title": "VrApi → OpenXR adapter (OVRPort)",
|
||||
"group": "Patches from OVRPort"
|
||||
},
|
||||
"pc.axrb_backend": {
|
||||
"anchor": "pc-axrb_backend",
|
||||
"title": "AXRB mode on this PC",
|
||||
"group": "Files and settings on the Frame"
|
||||
},
|
||||
"pcvr.launch_args": {
|
||||
"anchor": "pcvr-launch_args",
|
||||
"title": "Launch options (SteamVR or OpenXR)",
|
||||
|
||||
@@ -43,7 +43,11 @@ IL2CPP_METADATA = "assets/bin/Data/Managed/Metadata/global-metadata.dat"
|
||||
# 17: headset (the Meta headset a VR app was made for: Gear VR / Go games run through frame.a32_bridge) (2026-10)
|
||||
# 18: headset "quest" also for 32-bit apps that require 6DoF head tracking (Santa Cruz builds, e.g. Sports
|
||||
# Scramble: Touch controllers on the a32 bridge) (2026-10)
|
||||
ANALYSIS_VERSION = 19
|
||||
# 19: unreal_obb_delivery also from obfuscated DownloaderActivity predicates (#159 Medal of Honor) (2026-10)
|
||||
# 20: Unreal's Vulkan RHI from the manifest meta-data GameActivity.bSupportsVulkan (Unreal games never declare
|
||||
# android.hardware.vulkan, so every Unreal Vulkan game was "GLES or unknown"; AXRB direct mode is Vulkan only),
|
||||
# and "Vulkan (VrApi Vulkan system)" for direct-VrApi engines that import vrapi_CreateSystemVulkan (The Climb 2)
|
||||
ANALYSIS_VERSION = 20
|
||||
|
||||
|
||||
# Android versions by API level (for messages); the Frame's Lepton container runs Android 11 (API 30)
|
||||
@@ -87,6 +91,18 @@ def cryengine_project(data: bytes) -> bool:
|
||||
UE_VERIFY_OBB_KEY = ".GameActivity.bVerifyOBBOnStartUp"
|
||||
|
||||
|
||||
UE_SUPPORTS_VULKAN_KEY = ".GameActivity.bSupportsVulkan"
|
||||
|
||||
|
||||
def unreal_vulkan(meta: dict) -> bool:
|
||||
"""Unreal packaged the game with its Vulkan RHI (Project Settings > Android > Support Vulkan): UnrealBuildTool
|
||||
writes `com.epicgames.{ue4,unreal}.GameActivity.bSupportsVulkan` into the manifest, and on a Vulkan device (every
|
||||
Quest) GameActivity starts the Vulkan RHI, GLES only as a fallback. GLES-only builds write false (UE 4.21+) or
|
||||
nothing (older). Only a real boolean true counts, as GameActivity reads it with Bundle.getBoolean."""
|
||||
return any(k.startswith("com.epicgames.") and k.endswith(UE_SUPPORTS_VULKAN_KEY) and v is True
|
||||
for k, v in meta.items())
|
||||
|
||||
|
||||
def unreal_verify_obb(meta: dict) -> bool:
|
||||
"""Unreal's DownloaderActivity checks every OBB entry's CRC at the first start (a full read; on a mismatch it waits
|
||||
on an error screen). Only a real boolean counts: GameActivity reads it with Bundle.getBoolean."""
|
||||
@@ -287,12 +303,17 @@ def analyze(path: Path, deep: bool = True, data_bytes: int | None = None) -> Ana
|
||||
direct_vrapi = any("libvrapi.so" in elf.needed(b) for n, b in lib_bytes.items()
|
||||
if elf.is_elf(b) and n not in ("libOVRPlugin.so", "libvrapi.so"))
|
||||
vulkan_declared = b"android.hardware.vulkan" in manifest or _uses_feature(manifest, "android.hardware.vulkan")
|
||||
meta = axml.meta_data(manifest)
|
||||
if vulkan_declared:
|
||||
graphics = "Vulkan (declared in manifest)"
|
||||
elif engine == "Unreal" and unreal_vulkan(meta):
|
||||
graphics = "Vulkan (Unreal bSupportsVulkan)"
|
||||
elif engine == "Unity" and "vulkan" in boot.lower():
|
||||
graphics = "Vulkan (Unity boot.config)"
|
||||
elif engine == "CryEngine" and re.search(r'(?im)^\s*r_Driver\s*=\s*"?vk"?\s*(?:;.*)?$', system_cfg):
|
||||
graphics = "Vulkan (CryEngine system.cfg)"
|
||||
elif direct_vrapi and vrapi_vulkan(lib_bytes):
|
||||
graphics = "Vulkan (VrApi Vulkan system)"
|
||||
else:
|
||||
graphics = "GLES or unknown (no Vulkan declaration)"
|
||||
|
||||
@@ -323,7 +344,6 @@ def analyze(path: Path, deep: bool = True, data_bytes: int | None = None) -> Ana
|
||||
manifest_strings = axml.Axml(manifest).strings()
|
||||
features = _features(manifest)
|
||||
used_perms, _ = axml.used_and_declared_permissions(manifest)
|
||||
meta = axml.meta_data(manifest)
|
||||
return Analysis(
|
||||
package=package,
|
||||
version=version,
|
||||
@@ -519,6 +539,14 @@ def _uses_feature(manifest: bytes, feature: str) -> bool:
|
||||
OVR_TO_STRING = re.compile(r"^ovr[A-Z][A-Za-z0-9]*_ToString$")
|
||||
|
||||
|
||||
def vrapi_vulkan(lib_bytes: dict[str, bytes]) -> bool:
|
||||
"""An engine library that calls VrApi directly creates VrApi's Vulkan system (vrapi_CreateSystemVulkan): the game
|
||||
renders with Vulkan even without a manifest declaration (The Climb 2's CryEngine). GLES VrApi games (Path of the
|
||||
Warrior) never import it. Only the game's own libraries count, not libvrapi.so or OVRPlugin."""
|
||||
return any(elf.is_elf(b) and "vrapi_CreateSystemVulkan" in elf.dyn_symbols(b, False)
|
||||
for n, b in lib_bytes.items() if n not in ("libvrapi.so", "libOVRPlugin.so"))
|
||||
|
||||
|
||||
def missing_ovr_symbols(lib_bytes: dict[str, bytes]) -> set[str]:
|
||||
"""ovr_* / ovrMessageType_* / ovr<Enum>_ToString functions the game imports that the platform loader (+compat/stub
|
||||
libs) lacks."""
|
||||
|
||||
@@ -361,6 +361,25 @@ def component_filters(manifest: bytes) -> list[tuple[str, str, list[tuple[str, i
|
||||
return out
|
||||
|
||||
|
||||
def launcher_activity(manifest: bytes) -> str | None:
|
||||
""""<package>/<fully qualified class>" of the activity Android's launcher starts (MAIN + LAUNCHER; an alias
|
||||
names its targetActivity), what `cmd package resolve-activity --brief` answers; None when there is none."""
|
||||
x = Axml(manifest)
|
||||
names = x.strings()
|
||||
package = next((x.attr_str(el, "package") for el in x.elements() if el.name == "manifest"), None)
|
||||
targets = {x.attr_str(el, "name"): x.attr_str(el, "targetActivity")
|
||||
for el in x.elements() if el.name == "activity-alias"}
|
||||
if not package:
|
||||
return None
|
||||
for el, name, items in component_filters(manifest):
|
||||
found = {names[i] for _, _, i in items if i < len(names)}
|
||||
if el in ("activity", "activity-alias") and name and MAIN in found and LAUNCHER in found:
|
||||
cls = (targets.get(name) or name) if el == "activity-alias" else name
|
||||
cls = package + cls if cls.startswith(".") else cls if "." in cls else f"{package}.{cls}"
|
||||
return f"{package}/{cls}"
|
||||
return None
|
||||
|
||||
|
||||
def vr_activity(manifest: bytes) -> str | None:
|
||||
"""The activity with Meta's VR category when it isn't the launcher activity (a 2D launcher that starts the VR
|
||||
part, e.g. WiiCompiled's LauncherActivity -> QuestActivity)."""
|
||||
|
||||
+37
-7
@@ -1,11 +1,12 @@
|
||||
"""Build stage: OVRPort → Frame fixes (apk-stage patches) → sign → static validation."""
|
||||
from __future__ import annotations
|
||||
|
||||
import dataclasses
|
||||
import hashlib
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
from .apk import sign
|
||||
from .apk import axml, sign
|
||||
from .apk.workspace import ApkWorkspace
|
||||
from .core.events import Reporter
|
||||
from .core.models import Analysis, BuildResult, Recipe, SourceGame
|
||||
@@ -42,9 +43,9 @@ def apk_patches(selection: dict) -> list[base.Patch]:
|
||||
|
||||
|
||||
def apply_frame_fixes(apk_in: Path, apk_out_unsigned: Path, analysis: Analysis, recipe: Recipe,
|
||||
reporter: Reporter) -> tuple[list[str], list[dict], dict[str, str]]:
|
||||
reporter: Reporter, pc: bool = False) -> tuple[list[str], list[dict], dict[str, str]]:
|
||||
"""Apply the recipe's apk-stage patches; returns (applied ids, checks, workarounds left out because OVRPort's
|
||||
output already has the upstream fix (patches/upstream.py))."""
|
||||
output already has the upstream fix (patches/upstream.py)). pc: the build for this PC (extract_native_libs)."""
|
||||
applied, checks = [], []
|
||||
with ApkWorkspace(apk_in) as ws:
|
||||
selection = upstream.resolve(ws, recipe.patches, reporter)
|
||||
@@ -56,10 +57,26 @@ def apply_frame_fixes(apk_in: Path, apk_out_unsigned: Path, analysis: Analysis,
|
||||
reporter.log(f"applied {patch.id}" + (f" ({'; '.join(ctx.notes)})" if ctx.notes else ""))
|
||||
for name, ok, detail in patch.validate(ctx):
|
||||
checks.append({"name": name, "ok": ok, "detail": detail})
|
||||
if pc and "frame.adapter" in selection.patches and extract_native_libs(ws):
|
||||
reporter.log("AndroidManifest.xml: extractNativeLibs on (FrameBridge reads its settings next to itself)")
|
||||
ws.write(apk_out_unsigned)
|
||||
return applied, checks, selection.superseded
|
||||
|
||||
|
||||
def extract_native_libs(ws: ApkWorkspace) -> bool:
|
||||
"""Builds for this PC: have Android unpack the native libraries. FrameBridge reads lib/<abi>/libframe_settings.so
|
||||
with fopen next to its own path (dladdr); an app with extractNativeLibs="false" maps its libraries straight from
|
||||
base.apk ("base.apk!/lib/..."), where fopen finds nothing. On the Frame the agent also hands the adapter the
|
||||
settings (settings.conf via FRAMEBRIDGE_CONFIG, framebridge.conf in the game's storage), so the Frame build stays
|
||||
unchanged; in AXRB the library is the only source."""
|
||||
manifest = ws.read("AndroidManifest.xml")
|
||||
changed = axml.set_bool_attr(manifest, "application", "extractNativeLibs", True)
|
||||
if not changed or changed == manifest:
|
||||
return False
|
||||
ws.put("AndroidManifest.xml", changed)
|
||||
return True
|
||||
|
||||
|
||||
def check_a32(analysis: Analysis, recipe: Recipe) -> None:
|
||||
"""A 32-bit-only game builds only through the 32-bit bridge, and without what the bridge replaces: OVRPort and
|
||||
the 64-bit fixes would fail deep inside a tool or give an APK the Frame refuses (INSTALL_FAILED_NO_MATCHING_ABIS).
|
||||
@@ -77,9 +94,17 @@ def check_a32(analysis: Analysis, recipe: Recipe) -> None:
|
||||
|
||||
|
||||
def build(source: SourceGame, analysis: Analysis, recipe: Recipe, outdir: Path, reporter: Reporter,
|
||||
keep_work: bool = False) -> BuildResult:
|
||||
keep_work: bool = False, pc: bool = False) -> BuildResult:
|
||||
"""pc: the build for this PC (AXRB): only OVRPort's patches and the on_pc APK fixes (base.pc_selection)."""
|
||||
pkg = analysis.package
|
||||
check_a32(analysis, recipe)
|
||||
if pc:
|
||||
patches = base.pc_selection(recipe.patches, analysis)
|
||||
if not recipe.overport: # FrameBridge wraps OVRPort's loader: nothing to wrap without OVRPort
|
||||
patches = {pid: p for pid, p in patches.items()
|
||||
if pid != "frame.adapter" and not pid.startswith("adapter.")}
|
||||
recipe = dataclasses.replace(recipe, patches=patches)
|
||||
else:
|
||||
check_a32(analysis, recipe)
|
||||
work = work_dir() / pkg
|
||||
shutil.rmtree(work, ignore_errors=True)
|
||||
work.mkdir(parents=True)
|
||||
@@ -90,6 +115,9 @@ def build(source: SourceGame, analysis: Analysis, recipe: Recipe, outdir: Path,
|
||||
# Frame patches are applied on top. Its alternate build is the copy saved next to it, or (no copy) one more
|
||||
# OVRPort run for the alternate patches; the stand-ins patch relinks what that drops.
|
||||
converted = recipe.overport and analysis.is_overport_output
|
||||
if pc and converted:
|
||||
reporter.check("Original APK", None, "this copy was already converted for the Steam Frame and keeps its Frame "
|
||||
"fixes; add the game's original APK for a clean build for this PC")
|
||||
variants = [("primary", False)] + ([("alt", True)] if recipe.alt_patches and recipe.overport else [])
|
||||
alt_copy = Path(source.apk).with_name(f"{pkg}.alt-noforcequit.apk")
|
||||
results = {}
|
||||
@@ -108,7 +136,8 @@ def build(source: SourceGame, analysis: Analysis, recipe: Recipe, outdir: Path,
|
||||
shutil.copyfile(input_apk, patched)
|
||||
reporter.stage(f"Frame fixes ({variant})")
|
||||
unsigned = work / f"{pkg}.{variant}.unsigned.apk"
|
||||
applied, checks, left_out = apply_frame_fixes(patched, unsigned, analysis, recipe, reporter)
|
||||
applied, checks, left_out = apply_frame_fixes(patched, unsigned, analysis, recipe, reporter,
|
||||
**({"pc": True} if pc else {}))
|
||||
if variant == "primary":
|
||||
superseded = left_out
|
||||
patched.unlink(missing_ok=True)
|
||||
@@ -117,7 +146,8 @@ def build(source: SourceGame, analysis: Analysis, recipe: Recipe, outdir: Path,
|
||||
sign.sign(unsigned, final, pkg)
|
||||
unsigned.unlink(missing_ok=True)
|
||||
reporter.stage(f"validate ({variant})")
|
||||
checks += check_apk(final, pkg, expect_adapter=recipe.overport)
|
||||
checks += check_apk(final, pkg, expect_adapter=recipe.overport and "frame.adapter" in recipe.patches
|
||||
if pc else recipe.overport)
|
||||
for c in checks:
|
||||
reporter.check(c["name"], c["ok"], c["detail"])
|
||||
results[variant] = final
|
||||
|
||||
+61
-14
@@ -460,6 +460,18 @@ def build(package: Optional[str] = typer.Argument(None), all_: bool = typer.Opti
|
||||
raise typer.Exit(1 if failed else 0)
|
||||
|
||||
|
||||
def _set_axrb_backend(target, backend: Optional[str]) -> None:
|
||||
if backend is None:
|
||||
return
|
||||
from .tools import axrb
|
||||
|
||||
if backend not in axrb.BACKENDS:
|
||||
raise typer.BadParameter(f"--axrb-backend: {' or '.join(axrb.BACKENDS)}")
|
||||
if getattr(target, "kind", "") != "pc":
|
||||
raise typer.BadParameter("--axrb-backend needs --to pc")
|
||||
target.axrb_backend = backend
|
||||
|
||||
|
||||
@app.command()
|
||||
def install(package: Optional[str] = typer.Argument(None), all_: bool = typer.Option(False, "--all", help=ALL_HELP),
|
||||
frame: Optional[str] = typer.Option(None, help=FRAME_HELP),
|
||||
@@ -467,14 +479,19 @@ def install(package: Optional[str] = typer.Argument(None), all_: bool = typer.Op
|
||||
apk_only: bool = typer.Option(False, help="reuse game data already on the Frame"),
|
||||
force: bool = typer.Option(False, help="rebuild and reinstall even if the Frame is already current"),
|
||||
no_library: bool = typer.Option(False, help="don't add to the Steam library now"),
|
||||
to: str = typer.Option("frame", help="frame, or pc (PC VR games only: install on this PC)"),
|
||||
to: str = typer.Option("frame", help="frame, or pc (install on this PC: PC VR games through Revive, "
|
||||
"Quest games through AXRB, experimental)"),
|
||||
apk: Optional[Path] = typer.Option(None, help="install this APK instead of the last build (one game; "
|
||||
"for example a test build signed with the game's key)"),
|
||||
dest: Optional[str] = typer.Option(None, help="drive for new installs: 'internal' or a drive's path from "
|
||||
"'frameport frame drives' (default: the app's setting); "
|
||||
"installed games stay where they are")):
|
||||
"""Install games on the Frame (or PC VR games on this PC) and add them to the Steam library."""
|
||||
"installed games stay where they are"),
|
||||
axrb_backend: Optional[str] = typer.Option(None, help="with --to pc, Quest games: AXRB's 'direct' mode "
|
||||
"(no emulator, Vulkan games) or its Android 'emulator' "
|
||||
"(default: the recipe's choice, else by the game's graphics)")):
|
||||
"""Install games on the Frame (or on this PC) and add them to the Steam library."""
|
||||
target = _target(frame, password, to)
|
||||
_set_axrb_backend(target, axrb_backend)
|
||||
if dest is not None and hasattr(target, "dest"):
|
||||
target.dest = "" if dest == "internal" else dest
|
||||
pkgs = _pkgs(package, all_)
|
||||
@@ -496,17 +513,27 @@ def install(package: Optional[str] = typer.Argument(None), all_: bool = typer.Op
|
||||
def test(package: Optional[str] = typer.Argument(None), all_: bool = typer.Option(False, "--all", help=ALL_HELP),
|
||||
frame: Optional[str] = typer.Option(None, help=FRAME_HELP),
|
||||
seconds: int = typer.Option(45, help="how long the game runs before it's stopped"),
|
||||
to: str = typer.Option("frame", help="frame, or pc (PC VR games installed on this PC)")):
|
||||
to: str = typer.Option("frame", help="frame, or pc (games installed on this PC)"),
|
||||
axrb_backend: Optional[str] = typer.Option(None, help="with --to pc: check that Quest games are installed "
|
||||
"for this AXRB backend (direct or emulator)"),
|
||||
sim: bool = typer.Option(False, "--sim", help="with --to pc: use Monado's simulated headset instead of the "
|
||||
"PC's OpenXR runtime (no headset needed; also env FRAMEPORT_PC_XR_SIM=1)")):
|
||||
"""Headless launch test on the Frame (or this PC) and log triage."""
|
||||
from .tools import xr_sim
|
||||
|
||||
if sim and to != "pc":
|
||||
raise typer.BadParameter("--sim only works with --to pc")
|
||||
target = _target(frame, to=to)
|
||||
_set_axrb_backend(target, axrb_backend)
|
||||
installed = {g["package"] for g in target.installed()}
|
||||
for pkg in _pkgs(package, all_):
|
||||
if pkg not in installed:
|
||||
typer.echo(f"{pkg}: not installed on {target.label}", err=True)
|
||||
continue
|
||||
s = pipeline.test_game(pkg, target, printing_reporter(False), seconds)
|
||||
typer.echo(f"{pkg}: {s['state']} ({s['verdict']}) furthest: {s['milestone']}"
|
||||
+ (f"; suggestions: {', '.join(s['suggestions'])}" if s["suggestions"] else ""))
|
||||
with xr_sim.running(to == "pc" and xr_sim.enabled(sim), reporter=printing_reporter(False)):
|
||||
for pkg in _pkgs(package, all_):
|
||||
if pkg not in installed:
|
||||
typer.echo(f"{pkg}: not installed on {target.label}", err=True)
|
||||
continue
|
||||
s = pipeline.test_game(pkg, target, printing_reporter(False), seconds)
|
||||
typer.echo(f"{pkg}: {s['state']} ({s['verdict']}) furthest: {s['milestone']}"
|
||||
+ (f"; suggestions: {', '.join(s['suggestions'])}" if s["suggestions"] else ""))
|
||||
|
||||
|
||||
@app.command()
|
||||
@@ -557,9 +584,11 @@ def triage(logfile: Path = typer.Argument(..., help="a launch.log"),
|
||||
|
||||
@app.command()
|
||||
def settings(package: str, values: list[str] = typer.Argument(..., help="key=value pairs"),
|
||||
frame: Optional[str] = typer.Option(None, help=FRAME_HELP)):
|
||||
frame: Optional[str] = typer.Option(None, help=FRAME_HELP),
|
||||
to: str = typer.Option("frame", help="frame, or pc (a Quest game in AXRB on this PC; an empty value "
|
||||
"removes a setting)")):
|
||||
"""Change FrameBridge settings of an installed game (no rebuild), for example scale=1.2."""
|
||||
target = _target(frame)
|
||||
target = _target(frame, to=to)
|
||||
kv = dict(v.split("=", 1) for v in values)
|
||||
typer.echo(json.dumps(target.set_settings(package, kv), indent=1))
|
||||
|
||||
@@ -759,10 +788,28 @@ def frame_proton(frame: Optional[str] = typer.Option(None, help=FRAME_HELP),
|
||||
# ------------------------------------------------------------------------------------------ pc (Revive)
|
||||
@pc_app.command("info")
|
||||
def pc_info():
|
||||
"""Steam, SteamVR and Revive on this PC (JSON)."""
|
||||
"""Steam, SteamVR, Revive and AXRB (its emulator and its direct mode) on this PC (JSON)."""
|
||||
typer.echo(json.dumps(_target(None, to="pc").describe(), indent=1, default=str))
|
||||
|
||||
|
||||
@pc_app.command("install-axrb")
|
||||
def pc_install_axrb(backend: str = typer.Option("emulator", help="'emulator' (AXRB's Android emulator: Google's "
|
||||
"emulator pieces, about 2.5 GB) or 'direct' (AXRB-Emulatorless: "
|
||||
"Google's Android 16 arm64 system image, about 0.8 GB)"),
|
||||
update: bool = typer.Option(False, "--update", help="also update an installed AXRB to the "
|
||||
"newest release with an installer for this backend")):
|
||||
"""Install AXRB (Android XR Bridge, for Quest games on this PC) and set up its Android runtime. Normally done by
|
||||
the first `frameport install <quest game> --to pc`. Downloads AXRB's official installer plus Google's Android
|
||||
files. A local build (FRAMEPORT_AXRB_DIRECT_DIR / FRAMEPORT_AXRB_DIR) is set up but never replaced."""
|
||||
from .targets import pc_android
|
||||
from .tools import axrb
|
||||
|
||||
if backend not in axrb.BACKENDS:
|
||||
raise typer.BadParameter(f"--backend: {' or '.join(axrb.BACKENDS)}")
|
||||
pc_android.ensure_axrb(printing_reporter(False), backend, update=update)
|
||||
typer.echo(json.dumps(axrb.status(), indent=1, default=str))
|
||||
|
||||
|
||||
@pc_app.command("install-revive")
|
||||
def pc_install_revive():
|
||||
"""Download Revive's latest release and unpack it into FramePort's tools (no installer, no admin rights)."""
|
||||
|
||||
@@ -162,6 +162,7 @@
|
||||
"Android app": "",
|
||||
"Android app (APK)": "",
|
||||
"Android app without VR: installed unchanged and shown as a flat window": "",
|
||||
"Android emulator": "",
|
||||
"Android gives a process 128 thread keys (pthread keys, per-thread storage slots). Unity 6 takes about 40, and on the Frame the graphics and OpenXR libraries take more than on a Quest, so games with many other native libraries run out: Wander aborted at start (\"cannot create thread specific key\" in Firebase). Unity's keys without a clean-up function become slots behind one real key (libfp_tkeys.so); every other key and every other library keep real ones. Approach by Klownicle (GitHub #198).": "",
|
||||
"Android layer started": "",
|
||||
"Android VR": "",
|
||||
@@ -191,6 +192,9 @@
|
||||
"Automatic": "",
|
||||
"Automatic ({auto:.0%})": "",
|
||||
"Automatic SteamVR performance settings (this PC)": "",
|
||||
"AXRB mode on this PC": "",
|
||||
"AXRB {value} · Android emulator": "",
|
||||
"AXRB {value} · direct mode (no emulator)": "",
|
||||
"Back to library": "",
|
||||
"Back up the signing keys ({len}) to {shown_dir} first": "",
|
||||
"Banner": "",
|
||||
@@ -220,6 +224,7 @@
|
||||
"Cancel all": "",
|
||||
"canceled": "",
|
||||
"Canceled": "",
|
||||
"Cap the eye size": "",
|
||||
"Catalog": "",
|
||||
"Ceiling height for scene_emul.": "",
|
||||
"Ceiling height of the pretend room.": "",
|
||||
@@ -380,6 +385,7 @@
|
||||
"Diagnostics for frame.gl_multiview_fbo: checks for GL errors after every single-view draw of a multiview shader and logs counters every 5 seconds (tag GLMV in launch.log).": "",
|
||||
"Diagnostics: removes layer color fades. Some fades no longer show.": "",
|
||||
"Diagnostics: the Vulkan shim (frame.vk_sanitize) adds Khronos' validation layer to the game's instance; its findings go to launch.log. The layer library (libVkLayer_khronos_validation.so) must be in the APK.": "",
|
||||
"Direct mode (no emulator)": "",
|
||||
"Disable application space warp if used": "",
|
||||
"Disable controller tracking offset": "",
|
||||
"Disable Meta XR Audio telemetry": "",
|
||||
@@ -461,6 +467,7 @@
|
||||
"Experimental bypass for a failed Meta asset-file check at startup. Reports an empty asset list and installed status without a file path; does not provide DLC. Experimental.": "",
|
||||
"Experimental Vulkan mutable-format workaround.": "",
|
||||
"Experimental. Leave it off unless asked to test it.": "",
|
||||
"Experimental: runs the game on this PC in AXRB (Android XR Bridge), an Android emulator that shows Android VR games through SteamVR. The first install downloads AXRB and its Android (about 2.5 GB) and needs Windows Hypervisor Platform, an NVIDIA or AMD graphics card and 12 GB of memory. Many games don't work in AXRB yet.": "",
|
||||
"Experimental: shows HUDs, menus and other flat panels that stay black on the Frame (for example Doom3Quest's HUD and PDA).": "",
|
||||
"Extra diagnostics (log)": "",
|
||||
"Extra Lepton settings": "",
|
||||
@@ -528,6 +535,7 @@
|
||||
"For one eye looking wrong (for example a jittering right eye): logs each eye's submitted pose against a fresh one, the eye-to-eye relation and when each eye's image was released, also into framebridge.log in the game's storage (some games stop Android's log early). No effect on the game.": "",
|
||||
"For OpenGL ES games whose memory use keeps growing (e.g. Vader Immortal).": "",
|
||||
"For overlay apps (fpsVR, wrist watches and other SteamVR add-ons that draw over games instead of being a game): FramePort registers the app with the Frame's SteamVR, which draws its overlays over whatever you play there, Quest and PC VR games alike. With 'start with SteamVR' on, SteamVR starts it by itself (also after a restart); otherwise start it from the library. It isn't launch-tested (it shows nothing without a game). Ignored on this PC.": "",
|
||||
"For this PC only: run the game in AXRB's direct mode (no Android emulator) or in AXRB's Android emulator. Automatic uses direct mode for Vulkan games.": "",
|
||||
"For troubleshooting: records the game's requests to Meta's online services.": "",
|
||||
"For Unity games that crash when they turn on anti-aliasing (for example The Room VR).": "",
|
||||
"For Unreal Engine 5 games that crash on the Frame (for example Metro Awakening).": "",
|
||||
@@ -562,6 +570,7 @@
|
||||
"FramePort checks GitHub for a new version every few hours. Update now downloads and checks it, then restarts FramePort; your games and settings stay.": "",
|
||||
"FramePort downloads it and restarts as the new version. Your games and settings stay.": "",
|
||||
"FramePort found more than one program in this app. Pick the one that starts it, not a helper like a crash reporter or updater.": "",
|
||||
"FramePort installs AXRB from its official release (per user, no administrator rights) and Google's Android emulator files. AXRB is a separate program with its own licence; you can remove it later from Windows' app list.": "",
|
||||
"FramePort installs games on the Frame over your network": "",
|
||||
"FramePort installs games on the Frame over your network.": "",
|
||||
"FramePort installs the new build of {title} and leaves its game data (OBB files) on the Frame as it is, for example data you changed there. If the new version needs new game data, use a normal update instead.": "",
|
||||
@@ -594,6 +603,7 @@
|
||||
"FramePort's tools, library, artwork and your games' signing keys. Back it up: an update needs the same key, or the game must be reinstalled and loses its saves.": "",
|
||||
"frames per second": "",
|
||||
"Frames that are set up show up here by themselves.": "",
|
||||
"Frames that carry more than the game's main picture (menus or overlays as extra layers) submit the main picture alone. For runtimes that refuse such frames: AXRB's emulator on this PC rejects every multi-layer OpenGL ES frame (on by default there for GLES games). The extra layers don't show.": "",
|
||||
"Free up space": "",
|
||||
"Free up space on the Frame": "",
|
||||
"Free up space?": "",
|
||||
@@ -709,6 +719,7 @@
|
||||
"in your browser": "",
|
||||
"In your Steam library": "",
|
||||
"In your Steam library · launch settings changed — update it": "",
|
||||
"In your Steam library · patches changed — update it": "",
|
||||
"Install": "",
|
||||
"Install anyway": "",
|
||||
"Install anyway…": "",
|
||||
@@ -782,6 +793,7 @@
|
||||
"Keep the signing keys: without them, updating a game loses its saves.": "",
|
||||
"Keeps a smoothing setting off that the game turns on itself and that can freeze the Frame.": "",
|
||||
"Keeps every submitted image rect inside its swapchain. Unity can size the eye area a few pixels past the image on some Frames; SteamVR then rejects every frame (xrEndFrame -25, XR_ERROR_SWAPCHAIN_RECT_INVALID) and the game stops drawing (for example PowerWash Simulator stuck at \"Waiting\").": "",
|
||||
"Keeps games from rendering larger than the resolution scale allows.": "",
|
||||
"Keeps games running that use a 360° cube layer the Frame lacks (for example Budget Cuts Ultimate). Leave it on.": "",
|
||||
"Keeps one label so the title is stable.": "",
|
||||
"Keeps one name for the game, so it shows the same everywhere.": "",
|
||||
@@ -882,6 +894,7 @@
|
||||
"Looking for your Frame…": "",
|
||||
"Looking up the store description and screenshots…": "",
|
||||
"Low": "",
|
||||
"Main picture only": "",
|
||||
"Make Unity text fields work": "",
|
||||
"Makes BlazeRush's menus and controllers work without Meta's avatars, and lets its shader fixes take effect.": "",
|
||||
"Makes grip, trigger and touch controls reach the game's hands (it picked the empty Gear VR controls on the Frame, for example Vader Immortal).": "",
|
||||
@@ -1021,13 +1034,16 @@
|
||||
"On the Frame, open Steam's Settings (Steam button → Settings).": "",
|
||||
"On the Frame, place Revive's runtime (FramePort's Revive, or the repack's bundled LibRevive) where the game's Oculus SDK looks for LibOVRRT so it can load a VR runtime (pure runtime substitution — what Revive's LoadLibrary hook does on Windows; that hook doesn't work under Proton on the Frame). It does NOT bypass the Oculus runtime signature check: a game that verifies the runtime's signature will still refuse it. Ignored on this PC (Revive's hook handles it there).": "",
|
||||
"On this PC": "",
|
||||
"On this PC only: lets games that draw with Vulkan themselves (for example The Climb 2) start in AXRB's direct mode.": "",
|
||||
"On this PC, launch the game through Revive's OpenVR backend, which talks straight to SteamVR — the original, most reliable Revive path. On by default for PC installs. Turn it off to use Revive's newer OpenXR backend instead. Ignored on the Frame (which always uses OpenXR).": "",
|
||||
"On this PC, runs Revive through SteamVR (works with more headsets).": "",
|
||||
"On your Frame": "",
|
||||
"on: {names}": "",
|
||||
"One PC game folder": "",
|
||||
"Only for installs on this PC (AXRB): which AXRB runs the game. Automatic picks AXRB's direct mode (AXRB-Emulatorless: the game's arm64 code runs in one Windows process, no Android emulator) for Vulkan games and the Android emulator for OpenGL ES games, since direct mode has no OpenGL ES renderer yet. The other parameters are direct mode's per-game options (AXRB's run_direct_game.ps1): translator (dynarmic, AXRB's default, or digitalis), precompose (AXRB composes the game's projection layers itself; also used by the emulator), and legacy_oculus_driver / quest_identity / controllers_only for unconverted APKs with older Oculus loaders (controllers_only needs legacy_oculus_driver). The Steam Frame ignores this.": "",
|
||||
"Only if 360° pictures show wrongly.": "",
|
||||
"Only if 360° pictures show wrongly: 1 = upside down, 2 = mirrored, 4 = turned around (add values to combine).": "",
|
||||
"Only in builds for this PC (AXRB's direct mode). Direct mode gives the game the Windows graphics driver's Vulkan device, which lacks extensions every Quest has: Android's external memory (VK_KHR_external_memory_fd, VK_ANDROID_external_memory_android_hardware_buffer, VK_EXT_queue_family_foreign) and VK_EXT_fragment_density_map. Engines that call VrApi with Vulkan themselves, such as CryEngine in The Climb 2, refuse to create their device without them (\"CrySystem initialization failed\" right after \"Renderer initialization\"). The game's renderer gets them listed (libfp_vkext.so); AXRB leaves them out again when the device is created.": "",
|
||||
"Only install software from sites you trust. FramePort downloads it from {host} and installs it on your Frame.": "",
|
||||
"Only internal storage": "",
|
||||
"Open": "",
|
||||
@@ -1204,6 +1220,7 @@
|
||||
"Remove": "",
|
||||
"Remove converted copies now": "",
|
||||
"Remove from library…": "",
|
||||
"Remove from this PC": "",
|
||||
"Remove localized app names": "",
|
||||
"Remove tag": "",
|
||||
"Remove this theme": "",
|
||||
@@ -1335,6 +1352,7 @@
|
||||
"Select games to install": "",
|
||||
"Set by you.": "",
|
||||
"Set up for FramePort": "",
|
||||
"Set up Quest games on this PC?": "",
|
||||
"Set up with a USB cable": "",
|
||||
"Set up your Frame": "",
|
||||
"Sets Unity QualitySettings antiAliasing to 0. Unity's multisampled render-to-texture path can hang the Frame's GL driver ('zink: DEVICE LOST', for example Sniper Elite VR). Try it for GLES Unity games that freeze or crash the GPU.": "",
|
||||
@@ -1373,6 +1391,7 @@
|
||||
"Shows Batman: Arkham Shadow's cutscenes; set by that game's recipe.": "",
|
||||
"Shows each eye's picture to the other eye. For testing.": "",
|
||||
"Shows models whose shapes come from bone data the Frame's graphics driver misreads (for example BlazeRush's cars). Comes from a game's recipe.": "",
|
||||
"Shows only the game's main picture, without menus or overlays drawn as extra layers.": "",
|
||||
"Shows the Frame's cameras where the game expects passthrough.": "",
|
||||
"Shows the full environment when its upper part is clipped but menu panels look correct.": "",
|
||||
"Shows the headset's view with sound, whatever is running. It plays here where possible, else in mpv or your browser. Stop it when you're done: it costs the game some speed.": "",
|
||||
@@ -1389,7 +1408,7 @@
|
||||
"Skip this version": "",
|
||||
"Skips a Quest-only reporting step in Meta's audio library that crashes some games.": "",
|
||||
"Skips a separate data-file check when an Unreal game still hangs at startup with the content check off. Experimental; the game still needs its data.": "",
|
||||
"Skips Meta XR Audio's telemetry under x86_64 ARM translation (emulators). Not needed on the Frame, which runs games natively.": "",
|
||||
"Skips Meta XR Audio's telemetry under x86_64 ARM translation (emulators). Not needed on the Frame, which runs games natively; added by itself to builds for this PC (AXRB) of games with Meta XR Audio.": "",
|
||||
"Skips picture layers the Frame would refuse. Leave it on.": "",
|
||||
"Sleep": "",
|
||||
"Smooth as butter": "",
|
||||
@@ -1433,6 +1452,7 @@
|
||||
"Starts a video stream on the Frame and opens it in an mpv window.": "",
|
||||
"Starts a video stream on the Frame and opens it in your browser.": "",
|
||||
"Starts a video stream on the Frame and shows it here.": "",
|
||||
"Starts the game in SteamVR on this PC, in AXRB's Android emulator.": "",
|
||||
"Starts the game in SteamVR on this PC.": "",
|
||||
"Starts the game on the Frame while nobody wears the headset and reads the log: did it start and draw frames. It can't check the picture.": "",
|
||||
"Starts the game on the Frame — put the headset on.": "",
|
||||
@@ -1596,11 +1616,13 @@
|
||||
"This Frame isn't set up for FramePort yet. Run the setup once.": "",
|
||||
"This Frame's SSH key changed since FramePort last connected (SteamOS was reset, or another device now has its address). If it's your Frame, choose Trust the new key on the Steam Frame page.": "",
|
||||
"This game can't run on the Steam Frame.": "",
|
||||
"This game draws with OpenGL ES. AXRB's emulator copies such pictures to the PC frame by frame, so FramePort renders them at half size: expect about 30 frames per second at best, less with a high SteamVR resolution. Vulkan games don't have this limit.": "",
|
||||
"This game is marked \"Can't run\" on the Steam Frame:": "",
|
||||
"This is a website in an app: it opens in Meta's browser, which the Frame doesn't have. If nothing opens, visit the website in a browser.": "",
|
||||
"This is the example button from frameport.app. Real buttons install real games.": "",
|
||||
"this PC": "",
|
||||
"This PC": "",
|
||||
"This PC (AXRB, experimental)": "",
|
||||
"This PC (for PC VR games)": "",
|
||||
"This PC (Steam and Revive)": "",
|
||||
"This PC's disk is full. Free some space and try again.": "",
|
||||
@@ -1777,6 +1799,7 @@
|
||||
"Vulkan shim (frame.vk_sanitize): the game doesn't see VK_EXT_fragment_density_map(2). Unreal Engine 5 turns on fragment-density-map foveation when the driver offers it and expects the density map from the headset, which the Frame doesn't provide: image views and barriers for a missing image, then a crash in the Frame's Vulkan driver (for example Metro Awakening). Valve's own foveation layer isn't affected.": "",
|
||||
"Vulkan shim (frame.vk_sanitize): writes every distinct SPIR-V module the game creates to Android/data/<package>/files/fp_vk_shaders/<size>_<sha256>.spv, with index.txt listing every creation in order with its time, to find the shader behind a GPU hang and capture it for a new vk_shader_fix. Diagnostics include the newest modules. No effect on the game.": "",
|
||||
"Vulkan: drop invalid render-pass pointers": "",
|
||||
"Vulkan: list Android's external-memory extensions (this PC)": "",
|
||||
"v{remote} (updates on the next action)": "",
|
||||
"Wait for the game's GPU": "",
|
||||
"Waiting": "",
|
||||
@@ -1817,6 +1840,7 @@
|
||||
"Windows' firewall blocks the Frame from reaching FramePort. Start the setup again and allow the change when Windows asks.": "",
|
||||
"Windows' firewall blocks the Frame on public networks. Set this network to Private in Windows' network settings.": "",
|
||||
"Windows' firewall for WSL blocks the Frame. Show the setup command again and allow the change when Windows asks.": "",
|
||||
"With a resolution scale below 1, the largest eye size the game is told about is the scaled one too, for games that size their eye pictures from the maximum (for example Unity 2017 games). On by default on this PC for OpenGL ES games, whose pictures AXRB's emulator copies pixel by pixel.": "",
|
||||
"Without a Meta account, OVRPort's platform library makes up a new user id at every start (ovr_GetLoggedInUserID). Games that file saves under the user id (for example Walkabout Mini Golf) then start with an empty profile each time and seem to lose all progress. Gives the game a fixed id instead, different for each game and each FramePort user.": "",
|
||||
"Working": "",
|
||||
"Working…": "",
|
||||
|
||||
@@ -78,6 +78,9 @@ class Patch:
|
||||
needs_vr: bool = True # only matters for VR apps (hidden for Android apps without VR)
|
||||
# works on a 32-bit game through the a32 bridge (frame.a32_bridge); None = by category (works_on_a32)
|
||||
a32: bool | None = None
|
||||
# also in the build for this PC (AXRB): a fix of the APK itself, not of the Frame/Lepton; "experimental" = kept
|
||||
# there too but not yet seen working in AXRB (pc_selection treats both alike)
|
||||
on_pc: bool | str = False
|
||||
revision: int = 1 # bump when apply() writes something different: installed builds then show "Update on Frame"
|
||||
package_revisions: dict[str, int] = {} # narrower updates to otherwise shared patches
|
||||
|
||||
@@ -101,6 +104,16 @@ class Patch:
|
||||
|
||||
not_applicable_reason: str = ""
|
||||
|
||||
def pc_detect(self, analysis: Analysis) -> bool:
|
||||
"""True when the build for this PC (AXRB) needs the patch although the Steam Frame build doesn't (so it isn't
|
||||
in the recipe, which both builds share): pc_selection adds it."""
|
||||
return False
|
||||
|
||||
def pc_keeps(self, analysis: Analysis) -> bool:
|
||||
"""For an on_pc patch in the recipe: False when the build for this PC leaves it out for this game anyway
|
||||
(pc_selection, given the analysis)."""
|
||||
return True
|
||||
|
||||
def apply(self, ctx: ApkContext) -> bool: # apk stage; returns True when something changed
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -152,6 +165,39 @@ def works_on_a32(patch: Patch) -> bool:
|
||||
return patch.category not in ("overport", "frame")
|
||||
|
||||
|
||||
def pc_selection(patches: dict, analysis: Analysis | None = None) -> dict:
|
||||
"""The part of a Quest recipe that goes into the build for this PC (AXRB): OVRPort's patches, the APK fixes
|
||||
marked on_pc, FrameBridge (frame.adapter) with its settings except the Frame-only ones (settings.PC_DENY), the
|
||||
PC values of settings whose Frame default doesn't fit there (settings.PC_VALUES) and, given the analysis, the
|
||||
PC-only patches the game needs (Patch.pc_detect). The Steam Frame runtime's and Lepton's workarounds stay out;
|
||||
AXRB has its own Android and OpenXR runtime. Idempotent: a PC selection selects itself."""
|
||||
load_all()
|
||||
out = {pid: params for pid, params in patches.items()
|
||||
if pid in REGISTRY and (REGISTRY[pid].category == "overport" or REGISTRY[pid].on_pc)}
|
||||
if analysis is not None:
|
||||
out = {pid: params for pid, params in out.items() if REGISTRY[pid].pc_keeps(analysis)}
|
||||
for patch in all_patches():
|
||||
if patch.id not in out and patch.pc_detect(analysis):
|
||||
out[patch.id] = {}
|
||||
if "frame.adapter" in out:
|
||||
from .settings import PC_VALUES
|
||||
|
||||
for key, value in PC_VALUES.items():
|
||||
out[f"adapter.{key}"] = {"value": value}
|
||||
if analysis is not None and "GLES" in (analysis.graphics or ""):
|
||||
# AXRB's emulator sends GLES eye images as pixels (adb reverse, ~100 MB/s, synchronous in xrEndFrame):
|
||||
# Lucky's Tale at Monado's 896x1008 per eye 9 fps, at half size (FrameBridge's minimum) 30 fps
|
||||
scale = (out.get("adapter.scale") or {}).get("value")
|
||||
out["adapter.scale"] = {"value": min(float(scale), GLES_PC_SCALE) if scale else GLES_PC_SCALE}
|
||||
# ... and rejects every GLES frame with more than one layer (no layer batches without Vulkan)
|
||||
out["adapter.projection_only"] = {"value": 1}
|
||||
out["adapter.scale_max"] = {"value": 1} # also for games that size their eyes from the maximum
|
||||
return out
|
||||
|
||||
|
||||
GLES_PC_SCALE = 0.5 # eye-size scale for GLES games in the build for this PC (FrameBridge accepts 0.5-2.0)
|
||||
|
||||
|
||||
def all_patches() -> list[Patch]:
|
||||
load_all()
|
||||
return sorted(REGISTRY.values(), key=lambda p: (CATEGORIES.index(p.category), p.order, p.id))
|
||||
|
||||
@@ -21,6 +21,7 @@ def settings_text(recipe_patches: dict) -> bytes:
|
||||
|
||||
class FrameBridgeAdapter(Patch):
|
||||
id = "frame.adapter"
|
||||
on_pc = True
|
||||
a32 = True # also for 32-bit games on the bridge
|
||||
title = "FrameBridge OpenXR adapter"
|
||||
description = (
|
||||
|
||||
@@ -15,6 +15,7 @@ AVATAR = "libovravatarloader.so"
|
||||
|
||||
class AvatarStub(Patch):
|
||||
id = "frame.avatar_stub"
|
||||
on_pc = True
|
||||
title = "Skip Meta avatars"
|
||||
description = ("Meta's avatar library needs Meta's Horizon app, which the Frame doesn't have; it then stops the "
|
||||
"game at start (\"Failed to launch SystemActivities\", for example BlazeRush). Replaces it with a "
|
||||
|
||||
@@ -125,6 +125,7 @@ def patch_library(data: bytes) -> tuple[bytes, dict | None]:
|
||||
|
||||
class BlazeRush(Patch):
|
||||
id = "frame.blazerush"
|
||||
on_pc = True
|
||||
title = "BlazeRush: controllers without Meta avatars, own shader cache"
|
||||
description = ("BlazeRush 1.0.349 only (Klownicle's guide, GitHub #57). Its menus wait for Meta's avatar, which "
|
||||
"never comes on the Frame, before they create the game's own controllers: the second menu ignored "
|
||||
|
||||
@@ -26,6 +26,7 @@ def patch_dex(dex: Dex) -> list[str]:
|
||||
|
||||
class EosKeychainLoop(Patch):
|
||||
id = "frame.eos_keychain_loop"
|
||||
on_pc = "experimental"
|
||||
title = "Epic Online Services: stop the keychain retry loop"
|
||||
description = ("Epic Online Services (EOS) keeps its login keychain in the app's settings storage. When it can't "
|
||||
"write there, it resets the keychain and tries again without end (for example Beyond Sandbox: a "
|
||||
|
||||
@@ -68,6 +68,7 @@ EXPORTS = (
|
||||
|
||||
class LanguagePacks(Patch):
|
||||
id = "frame.langpacks"
|
||||
on_pc = True
|
||||
title = "Language packs from the game's files"
|
||||
description = ("OVRPort's platform loader answers the Meta Platform SDK's language-pack calls "
|
||||
"(ovr_LanguagePack_GetCurrent/SetCurrent) with 'no request', so a game that asks for its language "
|
||||
@@ -116,6 +117,7 @@ class LanguagePacks(Patch):
|
||||
|
||||
class AssetFiles(Patch):
|
||||
id = "frame.asset_files"
|
||||
on_pc = True
|
||||
title = "Content files from the game's data"
|
||||
description = ("Some games keep content in separate files next to their OBB (for example Star Wars: Tales from the "
|
||||
"Galaxy's Edge: its seasons and sound banks) and ask Meta's platform for them as asset files. "
|
||||
|
||||
@@ -9,6 +9,7 @@ MANIFEST = "AndroidManifest.xml"
|
||||
|
||||
class Launcher(Patch):
|
||||
id = "frame.launcher"
|
||||
on_pc = True
|
||||
a32 = True # also for 32-bit games on the bridge
|
||||
needs_vr = False
|
||||
title = "Launcher category (INFO → LAUNCHER)"
|
||||
@@ -35,6 +36,7 @@ class Launcher(Patch):
|
||||
|
||||
class NoDebuggable(Patch):
|
||||
id = "frame.nodebug"
|
||||
on_pc = True
|
||||
needs_vr = False
|
||||
title = "Clear android:debuggable"
|
||||
description = ("OVRPort marks apps debuggable; that turns on CheckJNI, which aborts some Unreal games on sloppy "
|
||||
@@ -68,6 +70,7 @@ class NoDebuggable(Patch):
|
||||
|
||||
class MetaPermissions(Patch):
|
||||
id = "frame.meta_permissions"
|
||||
on_pc = True
|
||||
title = "Declare Meta-only permissions"
|
||||
description = ("Declares com.oculus.permission.* / horizonos.permission.* that the app uses, so Android grants "
|
||||
"them at install (for example the 'use spatial data' permission of mixed-reality games like "
|
||||
|
||||
@@ -84,6 +84,7 @@ def guard_microphone(data: bytes) -> bytes | None:
|
||||
|
||||
class OvrMicrophone(Patch):
|
||||
id = "frame.ovr_microphone"
|
||||
on_pc = True
|
||||
title = "Fix crash when the game prepares the microphone"
|
||||
description = ("OVRPort's Meta platform library opens the microphone only when it's started, but answers a "
|
||||
"game's question about the microphone buffer size from that not-yet-opened stream: games that ask "
|
||||
|
||||
@@ -105,6 +105,7 @@ def _keystore(package: str) -> bytes:
|
||||
|
||||
class OvrStableUser(Patch):
|
||||
id = "frame.ovr_stable_user"
|
||||
on_pc = True
|
||||
title = "Keep the same Meta user between starts"
|
||||
description = ("Without a Meta account, OVRPort's platform library makes up a new user id at every start "
|
||||
"(ovr_GetLoggedInUserID). Games that file saves under the user id (for example Walkabout Mini "
|
||||
|
||||
@@ -23,6 +23,7 @@ def ovr_importers(ws) -> list[str]:
|
||||
|
||||
class OvrTrace(Patch):
|
||||
id = "frame.ovr_trace"
|
||||
on_pc = True
|
||||
title = "Trace Meta platform requests (diagnostics)"
|
||||
description = ("Logs every Meta Platform SDK request the game makes (user, entitlement, cloud saves, ...) and the "
|
||||
"messages that answer them, and every 10 s the requests that never got an answer (logcat tag "
|
||||
|
||||
@@ -29,6 +29,7 @@ class PlatformCompat(Patch):
|
||||
"is skipped.")
|
||||
order = 30
|
||||
default_on = True
|
||||
on_pc = True
|
||||
|
||||
def detect(self, a):
|
||||
return Suggestion(True, "Applied automatically when the OVRPort build needs it.")
|
||||
@@ -52,6 +53,7 @@ class OvrStubs(Patch):
|
||||
"'cannot locate symbol ovr_...'. Online/store features stay unavailable.")
|
||||
order = 31
|
||||
default_on = True
|
||||
on_pc = True # missing Meta platform symbols crash the game in any Android, not only on the Frame
|
||||
|
||||
def detect(self, a):
|
||||
return Suggestion(True, "Applied automatically when the OVRPort build needs it.")
|
||||
|
||||
@@ -45,6 +45,7 @@ class SwapchainLimit(Patch):
|
||||
"16384 px so the Frame's runtime (8192 px max) decides instead.")
|
||||
order = 45
|
||||
default_on = True
|
||||
on_pc = True # the guard is in OVRPort's dispatcher, which every OVRPort build carries
|
||||
|
||||
def detect(self, a):
|
||||
video = sorted(lib for lib in a.libs if lib.lower().startswith(VIDEO_LIBS))
|
||||
|
||||
@@ -51,6 +51,7 @@ def patch_metaxr_telemetry(data: bytes) -> bytes | None:
|
||||
|
||||
class MetaXrTelemetry(Patch):
|
||||
id = "frame.metaxr_telemetry"
|
||||
on_pc = True
|
||||
title = "Meta XR Audio: skip Quest telemetry class"
|
||||
description = ("Unreal builds of Meta XR Audio abort ('ClassNotFoundException com.oculus.os.AnalyticsEvent') on "
|
||||
"non-Quest devices. Patches that one JNI FindClass call so the library continues (for example NOPE "
|
||||
@@ -79,6 +80,7 @@ class MetaXrTelemetry(Patch):
|
||||
|
||||
class OculusOsStubs(Patch):
|
||||
id = "frame.oculusos"
|
||||
on_pc = True
|
||||
title = "Oculus OS telemetry class stubs"
|
||||
description = ("Adds no-op com.oculus.os.AnalyticsEvent / UnifiedTelemetryLogger classes for native code that "
|
||||
"looks them up through the app class loader (for example Nano, NOPE Challenge).")
|
||||
|
||||
@@ -73,6 +73,7 @@ def oculus_model_checks(data: bytes) -> tuple[bytes, int]:
|
||||
|
||||
class UnityOculusCheck(Patch):
|
||||
id = "frame.unity_oculus_check"
|
||||
on_pc = True
|
||||
title = "Unity: start VR without Meta's system apps"
|
||||
description = ("Unity's built-in Oculus support (Unity 2017–2019) only starts VR when Android has Meta's "
|
||||
"com.oculus.systemactivities package; without it the game runs as a 2D app (the Android home "
|
||||
|
||||
@@ -71,6 +71,14 @@ class UnityMultiPass(Il2cppReturnPatch):
|
||||
def detect(self, a):
|
||||
return None # only for a game that shows the symptom (catalog recipe or the user's choice)
|
||||
|
||||
# AXRB's emulator (gfxstream GLES) lists GL_OVR_multiview2, but its encoder finds a multiview framebuffer
|
||||
# incomplete and drops every draw into it (logcat: "GL2Encoder.cpp:s_glDrawElements ... GL error 0x506
|
||||
# checkFramebufferCompleteness"; Lucky's Tale, 2026-10-15: both eyes black). Each eye in its own pass draws.
|
||||
on_pc = "experimental"
|
||||
|
||||
def pc_detect(self, a):
|
||||
return self.applies(a) and "GLES" in a.graphics and bool((a.extra or {}).get("oculus_xr_plugin"))
|
||||
|
||||
|
||||
class UnityNoOverlayCopy(Il2cppReturnPatch):
|
||||
id = "frame.unity_no_overlay_copy"
|
||||
|
||||
@@ -147,6 +147,7 @@ class Il2cppReturnPatch(Patch):
|
||||
|
||||
class UnityTextInput(Il2cppReturnPatch):
|
||||
id = "frame.unity_text_input"
|
||||
on_pc = True
|
||||
title = "Make Unity text fields work"
|
||||
description = ("Unity's TMP_InputField / InputField wait for Android's on-screen keyboard and close themselves a "
|
||||
"frame later when there is none (Lepton has no on-screen keyboard; Meta's system keyboard does "
|
||||
|
||||
@@ -24,6 +24,7 @@ def heavy_native_libs(a) -> list[str]:
|
||||
|
||||
class UnityTlsKeyPool(Patch):
|
||||
id = "frame.unity_tls_key_pool"
|
||||
on_pc = "experimental"
|
||||
title = "Unity: share thread keys (games that run out of them)"
|
||||
description = (
|
||||
"Android gives a process 128 thread keys (pthread keys, per-thread storage slots). Unity 6 takes about 40, "
|
||||
|
||||
@@ -60,6 +60,7 @@ def patch_dex(dex: Dex, package: str) -> list[str]:
|
||||
|
||||
class UnrealSkipObbCheck(Patch):
|
||||
id = "frame.unreal_skip_obb_check"
|
||||
on_pc = True
|
||||
title = "Unreal: start without the OBB check"
|
||||
description = ("Unreal games can check their whole data file (.obb) before starting (bVerifyOBBOnStartUp). On "
|
||||
"the Frame that check's progress and error screens are invisible (Lepton runs VR games without "
|
||||
@@ -96,6 +97,7 @@ register(UnrealSkipObbCheck)
|
||||
|
||||
class UnrealSkipObbDelivery(Patch):
|
||||
id = "frame.unreal_skip_obb_delivery"
|
||||
on_pc = True
|
||||
title = "Unreal: skip the OBB delivery check"
|
||||
description = ("Unreal's Java OBB delivery check can leave a game on an invisible DownloaderActivity screen "
|
||||
"even with the manifest CRC check off (e.g. Into The Radius). Makes known Unreal "
|
||||
|
||||
@@ -49,6 +49,7 @@ def missing_lookups(lookups, plugin_exports) -> list[str]:
|
||||
|
||||
class UnrealOvrpEntrypoints(Patch):
|
||||
id = "frame.unreal_ovrp_entrypoints"
|
||||
on_pc = True
|
||||
title = "Unreal: stand-ins for OVRPlugin functions OVRPort lacks"
|
||||
description = ("Unreal's Oculus module looks up every OVRPlugin function it was built against and starts no VR "
|
||||
"when one is missing; OVRPort's OpenXR OVRPlugin lacks some old ones (for example ovrp_GetPTWNear, "
|
||||
|
||||
@@ -182,6 +182,7 @@ class _SantaCruzGate(Patch):
|
||||
|
||||
class QuestPrecompileDone(_SantaCruzGate):
|
||||
id = "frame.unreal_quest_precompile"
|
||||
on_pc = True
|
||||
title = "Unreal: don't wait for the Quest shader precompile"
|
||||
description = ("ILMxLAB's Unreal games (for example Vader Immortal) wait on their loading card until "
|
||||
"UVRUtils::GetQuestShaderPrecompilePercent reaches 100 %. The precompile only starts on a Quest "
|
||||
@@ -201,6 +202,7 @@ class QuestPrecompileDone(_SantaCruzGate):
|
||||
|
||||
class QuestKeyMap(_SantaCruzGate):
|
||||
id = "frame.unreal_quest_keymap"
|
||||
on_pc = True
|
||||
title = "Unreal: Quest controller bindings (RPOC key map)"
|
||||
description = ("ILMxLAB's Unreal games (for example Vader Immortal) bind their controls through URPOCKeyMapManager"
|
||||
"Component, which for an Oculus headset picks the Quest (\"SantaCruz\") or the Gear VR key set by "
|
||||
|
||||
@@ -138,6 +138,7 @@ def _engine(ws) -> str | None:
|
||||
|
||||
class UnrealThumbTouch(Patch):
|
||||
id = "frame.unreal_thumb_touch"
|
||||
on_pc = True
|
||||
title = "Unreal: thumb follows the capacitive touches"
|
||||
description = ("Unreal 4's Oculus input sets the ThumbUp axis (games animate the hand's thumb with it) from "
|
||||
"Meta's near-touch sensing, which the Frame never reports: the thumb always points up. Uses the "
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
"""Android-only Vulkan device extensions for builds for this PC (native/vkext): AXRB's direct mode, The Climb 2."""
|
||||
from __future__ import annotations
|
||||
|
||||
from ...analysis import elf
|
||||
from ..base import ApkContext, Patch, register
|
||||
from . import artifact
|
||||
|
||||
HELPER = "libfp_vkext.so"
|
||||
RENAMES = {"vkEnumerateDeviceExtensionProperties": "fpEnumerateDeviceExtensionProperties"}
|
||||
# not the game's renderer: XR/Meta/FramePort libraries that may import the function too
|
||||
NOT_ENGINE = ("libopenxr", "libOVR", "libovr", "libvrapi", "libfp_", "libframe", "libVkLayer", "libc++")
|
||||
|
||||
|
||||
class VulkanAndroidExtensions(Patch):
|
||||
id = "frame.vk_android_extensions"
|
||||
on_pc = True
|
||||
title = "Vulkan: list Android's external-memory extensions (this PC)"
|
||||
description = (
|
||||
"Only in builds for this PC (AXRB's direct mode). Direct mode gives the game the Windows graphics driver's "
|
||||
"Vulkan device, which lacks extensions every Quest has: Android's external memory "
|
||||
"(VK_KHR_external_memory_fd, VK_ANDROID_external_memory_android_hardware_buffer, "
|
||||
"VK_EXT_queue_family_foreign) and VK_EXT_fragment_density_map. Engines that call VrApi with Vulkan "
|
||||
"themselves, such as CryEngine in The Climb 2, refuse to create their device without them (\"CrySystem "
|
||||
"initialization failed\" right after \"Renderer initialization\"). The game's renderer gets them listed "
|
||||
"(libfp_vkext.so); AXRB leaves them out again when the device is created.")
|
||||
order = 73
|
||||
|
||||
def applies(self, a): # never in a Steam Frame recipe: its driver has these extensions
|
||||
return False
|
||||
|
||||
def pc_detect(self, a) -> bool:
|
||||
return a.direct_vrapi and a.graphics.startswith("Vulkan") and "arm64-v8a" in a.abis
|
||||
|
||||
def apply(self, ctx: ApkContext) -> bool:
|
||||
ws = ctx.ws
|
||||
if ws.abi != "arm64-v8a":
|
||||
return False
|
||||
changed = []
|
||||
for lib in ws.libs():
|
||||
if lib.startswith(NOT_ENGINE):
|
||||
continue
|
||||
data = ws.read_lib(lib)
|
||||
if not elf.is_elf(data) or not set(RENAMES) & elf.dyn_symbols(data, defined=False):
|
||||
continue
|
||||
patched, renamed = elf.rename_imports(data, RENAMES)
|
||||
if renamed:
|
||||
ws.put(ws.lib(lib), elf.add_needed(patched, HELPER))
|
||||
changed.append(lib)
|
||||
if not changed:
|
||||
return False
|
||||
ws.put(ws.lib(HELPER), artifact(ws.abi, HELPER))
|
||||
ctx.notes.append(f"{', '.join(changed)}: Vulkan device extensions through {HELPER}")
|
||||
return True
|
||||
|
||||
def validate(self, ctx: ApkContext):
|
||||
ws = ctx.ws
|
||||
if ws.abi != "arm64-v8a" or not ws.has(ws.lib(HELPER)):
|
||||
return []
|
||||
return [("Android Vulkan extensions listed", True, HELPER)]
|
||||
|
||||
|
||||
register(VulkanAndroidExtensions)
|
||||
@@ -30,6 +30,7 @@ def engine_libs(ws, analysis) -> list[str]:
|
||||
|
||||
class VulkanSanitize(Patch):
|
||||
id = "frame.vk_sanitize"
|
||||
on_pc = "experimental"
|
||||
title = "Vulkan: drop invalid render-pass pointers"
|
||||
description = ("Some engines leave the pNext of unused Vulkan attachment references uninitialized. The Frame's "
|
||||
"driver never reads it, but Lepton always loads Steam's Fossilize shader-cache layer, which follows "
|
||||
|
||||
@@ -10,6 +10,7 @@ SHIM = "libglshim.so"
|
||||
|
||||
class VrApiBridge(Patch):
|
||||
id = "frame.vrapi_bridge"
|
||||
on_pc = True # The Climb 2 renders in AXRB's direct mode (2026-10-16, headless)
|
||||
title = "VrApi → OpenXR bridge"
|
||||
description = (
|
||||
"Replaces libvrapi.so with a VrApi→OpenXR bridge (Android-XR-Bridge/OVRPort fork, GPL-3.0, patched for the "
|
||||
@@ -53,6 +54,13 @@ class GlShim(Patch):
|
||||
order = 61
|
||||
requires = ("frame.vrapi_bridge",)
|
||||
experimental = True
|
||||
# also in builds for this PC: its eglGetProcAddress wrapper hands out GPU timer-query stand-ins when the driver
|
||||
# has none (AXRB's emulator: Path of the Warrior crashed on a NULL glGenQueriesEXT), and hiding multiview helps
|
||||
# there too (gfxstream drops draws into multiview framebuffers); its GLSL fixes are additive
|
||||
on_pc = "experimental"
|
||||
|
||||
def pc_keeps(self, a):
|
||||
return "GLES" in a.graphics # Vulkan VrApi games (The Climb 2) go to AXRB's direct mode without it
|
||||
|
||||
def detect(self, a):
|
||||
if a.direct_vrapi and a.uses_glad_gl and "GLES" in a.graphics and "arm64-v8a" in a.abis:
|
||||
@@ -86,6 +94,7 @@ class GlShim(Patch):
|
||||
|
||||
|
||||
class UnityGlShim(GlShim):
|
||||
on_pc = False # its MSRTT stand-ins work around Zink; not tried in AXRB
|
||||
id = "frame.unity_gl_shim"
|
||||
title = "GL shim for Unity (no multisampled render-to-texture)"
|
||||
description = (
|
||||
@@ -109,6 +118,7 @@ class UnityGlShim(GlShim):
|
||||
|
||||
|
||||
class UnrealGlShim(GlShim):
|
||||
on_pc = False
|
||||
id = "frame.unreal_gl_shim"
|
||||
title = "GL shim for Unreal (no multisampled render-to-texture)"
|
||||
description = (
|
||||
|
||||
@@ -17,6 +17,7 @@ VRAPI = "libvrapi.so"
|
||||
|
||||
class VrApiStub(Patch):
|
||||
id = "frame.vrapi_stub"
|
||||
on_pc = True
|
||||
title = "Quiet Meta's VrApi loader (OpenXR games)"
|
||||
description = ("Some OpenXR games still ship Meta's VrApi loader and call it a few times without starting VrApi "
|
||||
"(for example Jurassic World Aftermath); Meta's loader then stops the game (\"vrapi_SetPropertyInt "
|
||||
|
||||
@@ -56,7 +56,7 @@ OVERPORT_PATCHES = [
|
||||
"builds (the stable CLI lists it but can't apply it)."),
|
||||
("patch_disable_meta_xr_audio_telemetry", "Disable Meta XR Audio telemetry", False,
|
||||
"Skips Meta XR Audio's telemetry under x86_64 ARM translation (emulators). Not needed on the Frame, which runs "
|
||||
"games natively."),
|
||||
"games natively; added by itself to builds for this PC (AXRB) of games with Meta XR Audio."),
|
||||
("patch_ac_nexus_no_appsw_72", "AC Nexus: no AppSW at 72 Hz", False,
|
||||
"Assassin's Creed Nexus (build 207706 only): turns off application space warp and runs at 72 Hz."),
|
||||
("patch_ac_nexus_no_appsw_90", "AC Nexus: no AppSW at 90 Hz", False,
|
||||
@@ -70,6 +70,8 @@ AC_NEXUS_BUILD = "MAIN.450412.207706.final" # OVRPort's AC Nexus patches check
|
||||
# patches that fail the whole overport run when used outside their game/build: a catalog recipe only gets them where
|
||||
# applies() is true (recommend/engine.py)
|
||||
STRICT = {"patch_ac_nexus_no_appsw_72", "patch_ac_nexus_no_appsw_90", "patch_vrapi_openxr"}
|
||||
# patches only builds for this PC (AXRB) get, added by base.pc_selection when the game needs them (pc_detect)
|
||||
PC_ADDED = {"patch_disable_meta_xr_audio_telemetry"}
|
||||
DEFAULT_OVERPORT = [pid for pid, _, default, _ in OVERPORT_PATCHES if default]
|
||||
|
||||
|
||||
@@ -81,6 +83,7 @@ class OverportPatch(Patch):
|
||||
self.id, self.title, self.default_on, self.description = pid, title, default, detail
|
||||
self.conflicts = CONFLICTS.get(pid, ())
|
||||
self.strict = pid in STRICT
|
||||
self.pc_added = pid in PC_ADDED
|
||||
|
||||
def detect(self, analysis: Analysis) -> Suggestion | None:
|
||||
from . import applicability as ap
|
||||
@@ -122,6 +125,13 @@ class OverportPatch(Patch):
|
||||
rule = rules.get(self.id)
|
||||
return rule(analysis) if rule else True
|
||||
|
||||
def pc_detect(self, analysis: Analysis) -> bool:
|
||||
"""The build for this PC: AXRB runs the game's arm64 code through translation on x86_64, where OVRPort's
|
||||
telemetry patch belongs (the Frame recipe never has it: applies() is False there)."""
|
||||
from . import applicability as ap
|
||||
|
||||
return self.pc_added and bool(ap.meta_audio_libs(analysis))
|
||||
|
||||
|
||||
STRINGS_URL = "https://raw.githubusercontent.com/ovrport/app/HEAD/composeApp/src/commonMain/composeResources/values/strings.xml"
|
||||
|
||||
|
||||
@@ -42,6 +42,14 @@ SETTINGS = [
|
||||
"Hides XR_FB_space_warp, so the game renders every frame itself instead of half of them plus motion vectors "
|
||||
"(Application SpaceWarp). For games whose picture flickers or smears on the Frame (for example Unreal Engine 5 "
|
||||
"games such as Into The Radius 2)."),
|
||||
("projection_only", "int", 0, "Main picture only",
|
||||
"Frames that carry more than the game's main picture (menus or overlays as extra layers) submit the main "
|
||||
"picture alone. For runtimes that refuse such frames: AXRB's emulator on this PC rejects every multi-layer "
|
||||
"OpenGL ES frame (on by default there for GLES games). The extra layers don't show."),
|
||||
("scale_max", "int", 0, "Cap the eye size",
|
||||
"With a resolution scale below 1, the largest eye size the game is told about is the scaled one too, for games "
|
||||
"that size their eye pictures from the maximum (for example Unity 2017 games). On by default on this PC for "
|
||||
"OpenGL ES games, whose pictures AXRB's emulator copies pixel by pixel."),
|
||||
("controller_fix", "int", 1, "Report Touch controllers",
|
||||
"Reports Frame controllers as Oculus Touch and hides synthetic hand tracking. Set 0 for games that require hand "
|
||||
"tracking (for example Silhouette)."),
|
||||
@@ -376,6 +384,12 @@ UI: dict[str, dict] = {
|
||||
"hide_space_warp": dict(group="troubleshooting", level="advanced", label="Turn off space warp",
|
||||
help="For games whose picture flickers or smears (for example Into The Radius 2).",
|
||||
control=("switch",)),
|
||||
"projection_only": dict(group="troubleshooting", level="advanced", label="Main picture only",
|
||||
help="Shows only the game's main picture, without menus or overlays drawn as extra layers.",
|
||||
control=("switch",)),
|
||||
"scale_max": dict(group="troubleshooting", level="advanced", label="Cap the eye size",
|
||||
help="Keeps games from rendering larger than the resolution scale allows.",
|
||||
control=("switch",)),
|
||||
"swapchain_fix": dict(group="troubleshooting", level="advanced", label="Retry refused picture formats",
|
||||
help="Lets OpenGL ES games start when the Frame refuses their picture format. Leave it on.",
|
||||
control=("switch",)),
|
||||
@@ -450,6 +464,19 @@ UI: dict[str, dict] = {
|
||||
# they don't work for 32-bit games on the bridge. surface_native: Batman's native video renderer hooks Vulkan
|
||||
# functions OVRPort's dispatcher doesn't know
|
||||
XRSHIM_SETTINGS = ("controller_models", "haptic_fix", "surface_native")
|
||||
# Settings left out of the build for this PC (AXRB, base.pc_selection); every other one rides along in
|
||||
# libframe_settings.so, since FrameBridge wraps OVRPort's loader the same way there (scale, haptic_fix, pose_time_fix,
|
||||
# rect_clamp, ...). Left out: workarounds for the Steam Frame's own runtime or headset (sync_guard: a race in the
|
||||
# Frame's vrclient.so; focus_hold: the Frame's flickering wear sensor; controller_models: models the agent converts
|
||||
# from the Frame's SteamVR at install) and settings read only by libraries the PC build doesn't get (the GL shim and
|
||||
# the Zink shader layer, which fix Mesa/Zink on the Frame). Leaving them out also keeps a change to them from marking
|
||||
# the PC build outdated. controller_fix stays: it is the game's choice (0 = hand tracking), and its Touch mapping of
|
||||
# /valve/ and generic controller profiles helps wherever SteamVR controllers show up.
|
||||
PC_DENY = frozenset({"sync_guard", "focus_hold", "focus_hold_ms", "controller_models", "zink_shader_fix",
|
||||
"zink_shader_dump", "gl_hide_msrtt", "gl_hide_multiview", "gl_int_attribs", "gl_highp_markers",
|
||||
"gl_mv_debug"})
|
||||
# PC values of settings whose built-in default is for the Frame (FrameBridge's focus_hold is on unless set to 0)
|
||||
PC_VALUES = {"focus_hold": 0}
|
||||
|
||||
|
||||
class AdapterSetting(Patch):
|
||||
@@ -465,6 +492,7 @@ class AdapterSetting(Patch):
|
||||
self.default = default
|
||||
self.revision = REVISIONS.get(key, 1)
|
||||
self.a32 = key not in XRSHIM_SETTINGS
|
||||
self.on_pc = key not in PC_DENY
|
||||
|
||||
@property
|
||||
def summary(self) -> str:
|
||||
@@ -821,6 +849,33 @@ class TextInputWindow(Patch):
|
||||
ctx.flatscreen = True
|
||||
|
||||
|
||||
class AxrbBackend(Patch):
|
||||
id = "pc.axrb_backend"
|
||||
title = "AXRB mode on this PC"
|
||||
description = ("Only for installs on this PC (AXRB): which AXRB runs the game. Automatic picks AXRB's direct mode "
|
||||
"(AXRB-Emulatorless: the game's arm64 code runs in one Windows process, no Android emulator) for "
|
||||
"Vulkan games and the Android emulator for OpenGL ES games, since direct mode has no OpenGL ES "
|
||||
"renderer yet. The other parameters are direct mode's per-game options (AXRB's "
|
||||
"run_direct_game.ps1): "
|
||||
"translator (dynarmic, AXRB's default, or digitalis), precompose (AXRB composes the game's "
|
||||
"projection layers itself; also used by the emulator), and legacy_oculus_driver / quest_identity / "
|
||||
"controllers_only for unconverted APKs with older Oculus loaders (controllers_only needs "
|
||||
"legacy_oculus_driver). The Steam Frame ignores this.")
|
||||
category = "device"
|
||||
stage = "install"
|
||||
on_pc = True # read by targets/pc_android.py; nothing on the Frame
|
||||
params = [Param("backend", "str", "", "direct or emulator (empty = automatic)"),
|
||||
Param("translator", "str", "", "dynarmic or digitalis (direct mode; empty = AXRB's default)"),
|
||||
Param("precompose", "bool", False, "AXRB composes projection layers itself"),
|
||||
Param("legacy_oculus_driver", "bool", False, "direct mode: provide com.oculus.systemdriver"),
|
||||
Param("quest_identity", "bool", False, "direct mode: report a Quest 3 device"),
|
||||
Param("controllers_only", "bool", False, "direct mode: hide hand tracking (needs legacy_oculus_driver)")]
|
||||
CHOICES = (("", "Automatic"), ("direct", "Direct mode (no emulator)"), ("emulator", "Android emulator"))
|
||||
|
||||
def install(self, ctx: InstallContext) -> None:
|
||||
pass # a choice for this PC only
|
||||
|
||||
|
||||
for _spec in SETTINGS:
|
||||
register(AdapterSetting(*_spec))
|
||||
register(DeviceFiles)
|
||||
@@ -831,3 +886,4 @@ register(SteamGamepad)
|
||||
register(TextInputWindow)
|
||||
register(DisplayMode)
|
||||
register(Foveation)
|
||||
register(AxrbBackend)
|
||||
@@ -103,6 +103,8 @@ SUMMARIES = {
|
||||
"frame.avatar_stub": "Lets games start that would stop at Meta's avatars (for example BlazeRush). No Meta "
|
||||
"avatars.",
|
||||
"frame.vrapi_bridge": "Lets games built on Meta's oldest VR interface run on the Frame.",
|
||||
"frame.vk_android_extensions": "On this PC only: lets games that draw with Vulkan themselves (for example The "
|
||||
"Climb 2) start in AXRB's direct mode.",
|
||||
"frame.blazerush": "Makes BlazeRush's menus and controllers work without Meta's avatars, and lets its shader "
|
||||
"fixes take effect.",
|
||||
"frame.a32_bridge": "Runs a 32-bit game (Gear VR, Oculus Go, early Quest) on the Frame, which only runs "
|
||||
@@ -134,6 +136,8 @@ SUMMARIES = {
|
||||
"keeps working.",
|
||||
"device.display_mode": "Choose Flat window if a phone or tablet app shows nothing in the headset, VR if a VR app "
|
||||
"opens as a flat window.",
|
||||
"pc.axrb_backend": "For this PC only: run the game in AXRB's direct mode (no Android emulator) or in AXRB's "
|
||||
"Android emulator. Automatic uses direct mode for Vulkan games.",
|
||||
"device.steam_gamepad": "Lets the game use your controllers as a gamepad instead of a pointer, for 2D games with "
|
||||
"touch controls (for example SDL games).",
|
||||
"device.lepton_env": "Extra settings for the Android container (for testing).",
|
||||
|
||||
+63
-18
@@ -376,6 +376,24 @@ def is_linux(entry: dict) -> bool:
|
||||
return entry.get("kind") == "linux"
|
||||
|
||||
|
||||
def pc_installable(entry: dict) -> bool:
|
||||
"""Can go on this PC: Rift games (Revive) and Android OpenXR games (Quest / Khronos loader; AXRB, experimental);
|
||||
not Linux/Windows/2D apps."""
|
||||
if entry.get("kind") == "rift":
|
||||
return True
|
||||
if entry.get("kind"):
|
||||
return False
|
||||
return (((entry.get("analysis") or {}).get("extra") or {}).get("vr_kind") or "quest") in ("quest", "openxr")
|
||||
|
||||
|
||||
def pc_gles(entry: dict) -> bool:
|
||||
"""A Quest game that draws with OpenGL ES: on this PC it runs in AXRB's emulator at reduced resolution and frame
|
||||
rate (eye images copied as pixels; the PC build halves the eye size). Library fields only."""
|
||||
if entry.get("kind"):
|
||||
return False
|
||||
return "GLES" in ((entry.get("analysis") or {}).get("graphics") or "")
|
||||
|
||||
|
||||
def analysis_warnings(entry: dict) -> list[str]:
|
||||
"""Blockers read from a Quest/Android game's APK, for the CLI (the game page shows them as callouts)."""
|
||||
if is_rift(entry) or is_linux(entry) or not entry.get("analysis"):
|
||||
@@ -966,6 +984,22 @@ def _build_record(entry: dict, apk: Path | None = None, superseded=None) -> dict
|
||||
"overport_stat": converter_stat}
|
||||
|
||||
|
||||
def pc_recipe_fingerprint(recipe: dict, package: str = "", analysis=None) -> str:
|
||||
"""Fingerprint of what the build for this PC contains (Frame-only patch changes don't make it outdated).
|
||||
analysis (an Analysis or its dict): also the PC-only patches the game gets (Patch.pc_detect)."""
|
||||
from .patches.base import pc_selection
|
||||
|
||||
if isinstance(analysis, dict):
|
||||
analysis = library.analysis_from_dict(analysis)
|
||||
return recipe_fingerprint(dict(recipe, patches=pc_selection(recipe.get("patches") or {}, analysis)), package)
|
||||
|
||||
|
||||
def build_key(entry: dict, pc: bool) -> str:
|
||||
"""Where a Quest game's build is recorded: "build" (Steam Frame), "build_pc" (this PC, AXRB). Installed-as-is
|
||||
games have one build for both."""
|
||||
return "build_pc" if pc and not library.recipe_from_dict(entry["recipe"]).as_is else "build"
|
||||
|
||||
|
||||
def _build_inputs_changed(entry: dict) -> bool:
|
||||
build = entry.get("build") or {}
|
||||
if not build.get("build_inputs") or build["build_inputs"] != _build_inputs(entry):
|
||||
@@ -979,7 +1013,8 @@ def _build_inputs_changed(entry: dict) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
def build_game(package: str, reporter: Reporter, outdir: Path | None = None) -> dict:
|
||||
def build_game(package: str, reporter: Reporter, outdir: Path | None = None, pc: bool = False) -> dict:
|
||||
"""pc: the build for this PC (Quest games through AXRB): OVRPort's patches without the Steam Frame fixes."""
|
||||
entry = library.game(package)
|
||||
if not is_linux(entry) and not is_rift(entry):
|
||||
check_source(entry) # fail before reanalysis or tool setup when the original files have gone
|
||||
@@ -997,16 +1032,19 @@ def build_game(package: str, reporter: Reporter, outdir: Path | None = None) ->
|
||||
recipe = library.recipe_from_dict(entry["recipe"])
|
||||
if engine.a32_recipe(a, recipe, newly=False): # saved before the bridge switched OVRPort & co. off itself
|
||||
set_recipe(package, recipe)
|
||||
out = outdir or (output_dir() / quest_dump.display_name(entry.get("name") or package))
|
||||
name = quest_dump.display_name(entry.get("name") or package)
|
||||
out = outdir or (output_dir() / (f"{name} (PC)" if pc else name))
|
||||
with _build_lock(package): # one build per game at a time: builds share the game's work folder
|
||||
res = builder.build(src, a, recipe, out, reporter)
|
||||
res = builder.build(src, a, recipe, out, reporter, **({"pc": True} if pc else {}))
|
||||
art, store_title = artwork.fetch(package, res.apk)
|
||||
build_info = {"apk": str(res.apk), "alt_apk": str(res.alt_apk) if res.alt_apk else None, "sha256": res.sha256,
|
||||
"alt_sha256": res.alt_sha256, "applied": res.applied, "checks": res.checks, "ok": res.ok,
|
||||
"overport": res.meta.get("overport"), "recipe_fp": recipe_fingerprint(entry["recipe"], package),
|
||||
"overport": res.meta.get("overport"),
|
||||
"recipe_fp": (pc_recipe_fingerprint(entry["recipe"], package, a) if pc
|
||||
else recipe_fingerprint(entry["recipe"], package)),
|
||||
"superseded": res.meta.get("superseded") or {}, "source_version": _source_version(entry),
|
||||
**_build_record(entry, res.apk, res.meta.get("superseded"))}
|
||||
library.upsert_game(package, build=build_info, title=entry.get("title") or store_title,
|
||||
library.upsert_game(package, **{build_key(entry, pc): build_info}, title=entry.get("title") or store_title,
|
||||
source_sha256=build_info["source_sha256"])
|
||||
return build_info
|
||||
|
||||
@@ -1090,14 +1128,15 @@ def install_game(package: str, target: Target, reporter: Reporter, apk_only: boo
|
||||
result["stage_seconds"] = reporter.stage_timings()
|
||||
_record_install(package, target.label, {"result": result, "time": time.time()})
|
||||
return result
|
||||
b = entry.get("build") or {}
|
||||
pc = getattr(target, "kind", "") == "pc" # Quest games on this PC (AXRB): their own build, no Frame fixes
|
||||
b = entry.get(build_key(entry, pc)) or {}
|
||||
recipe = library.recipe_from_dict(entry["recipe"])
|
||||
if not test_build and not b.get("apk"):
|
||||
build_game(package, reporter)
|
||||
if not test_build and not b.get("apk"): # never built yet (e.g. `frameport install` right after a scan)
|
||||
build_game(package, reporter, pc=pc)
|
||||
return install_game(package, target, reporter, apk_only, add_to_library)
|
||||
apk = Path(apk) if apk else Path(b["alt_apk"] if recipe.use_alt and b.get("alt_apk") else b["apk"])
|
||||
if not test_build and not apk.is_file():
|
||||
build_game(package, reporter)
|
||||
if not test_build and not apk.exists(): # the converted copy was removed after an earlier install: make it again
|
||||
build_game(package, reporter, pc=pc)
|
||||
return install_game(package, target, reporter, apk_only, add_to_library)
|
||||
if optimized and not update.rebuild:
|
||||
expected_sha = b.get("alt_sha256") if recipe.use_alt else b.get("sha256")
|
||||
@@ -1113,6 +1152,11 @@ def install_game(package: str, target: Target, reporter: Reporter, apk_only: boo
|
||||
data_dir = Path(entry["data_dir"]) if entry.get("data_dir") else None
|
||||
title = steam_title(entry)
|
||||
preserve_data = apk_only or (optimized and deployment is not None and not update.data and not force)
|
||||
if pc: # the deployment records what the build for this PC contains (pc_selection)
|
||||
from .patches.base import pc_selection
|
||||
|
||||
analysis = library.analysis_from_dict(entry["analysis"]) if entry.get("analysis") else None
|
||||
recipe = dataclasses.replace(recipe, patches=pc_selection(recipe.patches, analysis))
|
||||
result = target.install(package, title, apk, data_dir, recipe, reporter, preserve_data,
|
||||
data_files=entry.get("data_files"))
|
||||
if add_to_library: # also after a reinstall: the agent restarts Steam only when the entry changes
|
||||
@@ -1241,15 +1285,16 @@ def remove_converted_copies(package: str) -> int:
|
||||
game files the user added. Returns the bytes freed."""
|
||||
if library.setting("build.keep_copies", False):
|
||||
return 0
|
||||
b = (library.game(package) or {}).get("build") or {}
|
||||
g = library.game(package) or {}
|
||||
out, freed = output_dir().resolve(), 0
|
||||
for key in ("apk", "alt_apk"):
|
||||
p = Path(b[key]) if b.get(key) else None
|
||||
if p and p.exists() and out in p.resolve().parents:
|
||||
freed += p.stat().st_size
|
||||
p.unlink()
|
||||
if not any(p.parent.iterdir()):
|
||||
p.parent.rmdir()
|
||||
for b in (g.get("build") or {}, g.get("build_pc") or {}):
|
||||
for key in ("apk", "alt_apk"):
|
||||
p = Path(b[key]) if b.get(key) else None
|
||||
if p and p.exists() and out in p.resolve().parents:
|
||||
freed += p.stat().st_size
|
||||
p.unlink()
|
||||
if not any(p.parent.iterdir()):
|
||||
p.parent.rmdir()
|
||||
return freed
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,702 @@
|
||||
"""Quest games on this Windows PC through AXRB (tools/axrb.py): the "This PC" target's Android half.
|
||||
|
||||
Each game runs in one of AXRB's two backends (`choose_backend`): direct mode (AXRB-Emulatorless: axrb-direct.exe,
|
||||
no emulator, Vulkan only) for Vulkan games, AXRB's Android emulator for the rest; the recipe's `pc.axrb_backend`
|
||||
(or `frameport install --to pc --axrb-backend`) overrides it.
|
||||
|
||||
An install sets that AXRB up when needed (its installer + its Android runtime, downloaded only now) and records
|
||||
<data>/pc/<pkg>/deployment.json with kind "android" and the backend. The game's build for this PC is OVRPort's
|
||||
conversion without the Steam Frame fixes, signed with the game's key.
|
||||
- emulator: the emulator starts, the build is installed with adb, its OBB data pushed.
|
||||
- direct: no Android to install into: the build is copied to %LOCALAPPDATA%\\FramePort\\axrb\\games\\<pkg>, its
|
||||
data files are listed (Android path -> Windows file, mounted read-only by AXRB at the game's start) the way AXRB's
|
||||
launcher lists them, and the launch activity comes from the APK's manifest.
|
||||
Play goes through a Steam shortcut that runs FramePort's launcher script for the backend, which hands the game to
|
||||
AXRB's own run script (run_windows_game.ps1 / run_direct_game.ps1). See docs/PC_ANDROID.md.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
|
||||
from ..core import winhost
|
||||
from ..core.events import Reporter
|
||||
from ..core.models import Recipe, data_manifest
|
||||
from ..tools import axrb, xr_sim
|
||||
|
||||
KIND = "android"
|
||||
OBB_ROOT = "/sdcard/Android/obb"
|
||||
BACKEND_PATCH = "pc.axrb_backend"
|
||||
|
||||
|
||||
def powershell_win() -> str:
|
||||
return axrb.powershell_win()
|
||||
|
||||
|
||||
def shortcut_fields(dep: dict) -> tuple[str, str, str]:
|
||||
"""(Exe, StartDir, LaunchOptions) of the Steam shortcut: powershell.exe running FramePort's AXRB launcher."""
|
||||
launcher = dep["launcher_win"]
|
||||
start = '"' + launcher.rsplit("\\", 1)[0] + '\\"'
|
||||
return f'"{dep["powershell_win"]}"', start, axrb.launcher_args(launcher, dep["package"], dep["activity"],
|
||||
dep["title"], dep.get("flags") or ())
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------ backend choice
|
||||
def backend_params(recipe: Recipe | None) -> dict:
|
||||
return dict(((recipe.patches if recipe else {}) or {}).get(BACKEND_PATCH) or {})
|
||||
|
||||
|
||||
def choose_backend(recipe: Recipe | None, graphics: str = "", override: str | None = None) -> str:
|
||||
"""Which AXRB runs the game: `override` (CLI), else the recipe's pc.axrb_backend, else direct mode for Vulkan
|
||||
games and the emulator for OpenGL ES ones (direct mode has no GLES renderer; "unknown" counts as GLES).
|
||||
"Vulkan (Unity boot.config)" counts as unknown: that label comes from the Oculus XR plugin's xr-vulkan-* keys,
|
||||
which GLES builds have too (all 9 such games in the dev library; Toy Master and I Am Cat run GLES, and Toy
|
||||
Master crashed in direct mode at "Unable to retrieve the default EGL display!")."""
|
||||
for choice in (override, backend_params(recipe).get("backend")):
|
||||
if choice:
|
||||
if choice not in axrb.BACKENDS:
|
||||
raise ValueError(f"unknown AXRB backend {choice!r} (direct or emulator)")
|
||||
return choice
|
||||
graphics = graphics or ""
|
||||
return axrb.DIRECT if graphics.startswith("Vulkan") and "boot.config" not in graphics else axrb.EMULATOR
|
||||
|
||||
|
||||
def launch_flags(backend: str, params: dict, profile: dict | None = None) -> list[str]:
|
||||
"""The launcher switches for a game: the recipe's pc.axrb_backend parameters, plus AXRB's own compatibility
|
||||
profile's precomposition. AXRB's legacy-driver/Quest-identity options are only taken from the recipe (FramePort
|
||||
gives AXRB an OVRPort build, which doesn't need them)."""
|
||||
profile = profile or {}
|
||||
flags = []
|
||||
if backend == axrb.DIRECT:
|
||||
translator = params.get("translator") or ""
|
||||
if translator and translator not in axrb.TRANSLATORS:
|
||||
raise ValueError(f"unknown AXRB translator {translator!r} ({', '.join(axrb.TRANSLATORS)})")
|
||||
if translator and translator != axrb.TRANSLATORS[0]:
|
||||
flags += ["-Translator", translator]
|
||||
if params.get("precompose") or profile.get("precomposeProjectionLayers"):
|
||||
flags.append("-PrecomposeProjectionLayers")
|
||||
if backend == axrb.DIRECT:
|
||||
legacy = bool(params.get("legacy_oculus_driver"))
|
||||
if legacy:
|
||||
flags.append("-LegacyOculusDriver")
|
||||
if params.get("quest_identity"):
|
||||
flags.append("-QuestIdentity")
|
||||
if params.get("controllers_only") and legacy: # AXRB applies it through the legacy driver only
|
||||
flags.append("-ControllersOnly")
|
||||
return flags
|
||||
|
||||
|
||||
def _analysis(package: str) -> dict:
|
||||
try:
|
||||
from ..core import library
|
||||
|
||||
return (library.game(package) or {}).get("analysis") or {}
|
||||
except Exception: # noqa: BLE001 - no library (tests, a test build): automatic choice from the APK alone
|
||||
return {}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------ emulator (adb)
|
||||
def _adb_ok(r: subprocess.CompletedProcess, what: str) -> str:
|
||||
text = (r.stdout + r.stderr).strip()
|
||||
if r.returncode != 0 or "Failure" in text or "Error" in text and "Success" not in text:
|
||||
if "INSTALL_FAILED_UPDATE_INCOMPATIBLE" in text:
|
||||
raise RuntimeError(f"{what}: a copy of this game signed with another key is installed in AXRB. "
|
||||
"Uninstall it there first (that deletes its Android saves), then install again.")
|
||||
raise RuntimeError(f"{what}: {text[-400:]}")
|
||||
return text
|
||||
|
||||
|
||||
def resolve_activity(package: str) -> str:
|
||||
r = axrb.adb(["shell", "cmd", "package", "resolve-activity", "--brief", package], timeout=60)
|
||||
last = (r.stdout.strip().splitlines() or [""])[-1].strip()
|
||||
if not re.fullmatch(r"[\w.]+/[\w.$]+", last):
|
||||
raise RuntimeError(f"{package} has no launcher activity in Android (is it an OVRPort build?)")
|
||||
return last
|
||||
|
||||
|
||||
def remote_sizes(package: str) -> dict[str, int]:
|
||||
"""Sizes of the files already in the game's OBB folder in AXRB's Android (a re-install sends only the rest)."""
|
||||
r = axrb.adb(["shell", f"cd {OBB_ROOT}/{package} 2>/dev/null && find . -type f -exec stat -c '%s %n' {{}} +"],
|
||||
timeout=120)
|
||||
out = {}
|
||||
for line in r.stdout.splitlines():
|
||||
size, _, name = line.strip().partition(" ")
|
||||
if size.isdigit() and name.startswith("./"):
|
||||
out[name[2:]] = int(size)
|
||||
return out
|
||||
|
||||
|
||||
def push_data(package: str, data_dir: Path, files: list[str] | None, reporter: Reporter) -> int:
|
||||
manifest = data_manifest(data_dir, files)
|
||||
if not manifest:
|
||||
return 0
|
||||
have = remote_sizes(package)
|
||||
todo = {rel: size for rel, size in manifest.items() if have.get(rel) != size}
|
||||
total, done = sum(todo.values()) or 1, 0
|
||||
reporter.log(f"game data: {len(todo)} of {len(manifest)} files to copy ({total / 2**30:.1f} GiB)")
|
||||
for rel, size in todo.items():
|
||||
reporter.check_cancel()
|
||||
reporter.progress(done / total, f"copying game data: {rel}")
|
||||
r = axrb.adb(["push", winhost.to_windows(data_dir / rel), f"{OBB_ROOT}/{package}/{rel}"],
|
||||
timeout=600 + size / 4e6)
|
||||
_adb_ok(r, f"copying {rel}")
|
||||
done += size
|
||||
reporter.progress(1.0, "game data copied")
|
||||
return len(todo)
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------ AXRB setup
|
||||
def ensure_axrb(reporter: Reporter, backend: str = axrb.EMULATOR, update: bool = False) -> axrb.Install:
|
||||
"""AXRB for one backend and its Android runtime, installed/set up (or upgraded, see axrb.install) on first use."""
|
||||
label = "AXRB direct mode" if backend == axrb.DIRECT else "AXRB"
|
||||
have = axrb.find(backend)
|
||||
if not have or update or axrb.older(have.version, axrb.KNOWN_GOOD.get(backend)):
|
||||
reporter.stage(f"{'Update' if have else 'Download'} {label} (Android XR Bridge)")
|
||||
inst = axrb.install(lambda f: reporter.progress(f, f"downloading {label}"), reporter.check_cancel,
|
||||
backend=backend, update=update)
|
||||
reporter.check(label, True, f"{inst.version or 'local build'} at {winhost.to_windows(inst.app)}")
|
||||
if backend == axrb.DIRECT:
|
||||
info = axrb.direct_requirements()
|
||||
problems = axrb.direct_requirement_problems(info)
|
||||
if problems:
|
||||
raise RuntimeError("This PC can't run Quest games in AXRB's direct mode: " + "; ".join(problems))
|
||||
reporter.check("PC requirements (AXRB direct mode)", True,
|
||||
f"Vulkan, {info.get('memoryGB') or '?'} GB")
|
||||
state = axrb.direct_setup_state(inst)
|
||||
if state["missing_files"]:
|
||||
raise RuntimeError("AXRB's direct mode is incomplete (" + ", ".join(state["missing_files"][:4])
|
||||
+ "): reinstall or rebuild it")
|
||||
if not state["ready"]:
|
||||
reporter.stage(f"Set up AXRB's direct mode ({state['download_bytes'] / 2**30:.1f} GiB download)")
|
||||
axrb.setup_direct(inst, lambda f, name: reporter.progress(f, name), reporter.check_cancel)
|
||||
return inst
|
||||
info = axrb.requirements(inst.app)
|
||||
problems = axrb.requirement_problems(info)
|
||||
if problems:
|
||||
raise RuntimeError("This PC can't run Quest games through AXRB: " + "; ".join(problems))
|
||||
reporter.check("PC requirements (AXRB)", True, f"{info.get('gpu')}, {info.get('memoryGB')} GB")
|
||||
state = axrb.setup_state(app=inst.app)
|
||||
if state["components"] or not state["avd"]:
|
||||
reporter.stage(f"Set up AXRB's Android ({state['download_bytes'] / 2**30:.1f} GiB download)")
|
||||
axrb.setup_files(lambda f, name: reporter.progress(f, f"downloading {name}"), reporter.check_cancel,
|
||||
app=inst.app)
|
||||
return inst
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------ install
|
||||
def apk_launcher_activity(apk: Path) -> str:
|
||||
"""The launch activity from the APK's own manifest (direct mode has no Android to ask)."""
|
||||
from ..apk import axml
|
||||
|
||||
try:
|
||||
with zipfile.ZipFile(apk) as z:
|
||||
activity = axml.launcher_activity(z.read("AndroidManifest.xml"))
|
||||
except (OSError, KeyError, zipfile.BadZipFile, ValueError) as exc:
|
||||
raise RuntimeError(f"{apk.name}: the manifest could not be read ({exc})") from None
|
||||
if not activity:
|
||||
raise RuntimeError(f"{apk.name} has no launcher activity (is it an OVRPort build?)")
|
||||
return activity
|
||||
|
||||
|
||||
def _apk_versions(apk: Path) -> tuple[str | None, str | None]:
|
||||
"""(versionName, versionCode) for AXRB's compatibility profiles."""
|
||||
try:
|
||||
from pyaxmlparser import APK
|
||||
|
||||
a = APK(str(apk))
|
||||
return a.version_name, a.version_code
|
||||
except Exception: # noqa: BLE001 - only used to match AXRB's optional profiles
|
||||
return None, None
|
||||
|
||||
|
||||
CONTENT_LINKS = "content" # <game dir>\content: hard links to the game's data files (short paths)
|
||||
# axrb-direct.exe gets one "--mount-ro <guest>=<host>" argument per content file (prepare_art_session.py, which
|
||||
# resolves every path first: junctions and 8.3 names don't shorten it), and a Windows command line holds 32767
|
||||
# characters: Batman's 90 files from a long dump path didn't fit ("The filename or extension is too long": 32876
|
||||
# characters, 27028 of them content mounts). What is left for the content files next to AXRB's own arguments
|
||||
# (~5,900 characters with the dev PC's paths; more with longer runtime folders).
|
||||
MOUNT_ARGS_BUDGET = 25000
|
||||
|
||||
|
||||
def _windows_readable(path: Path) -> str | None:
|
||||
"""The Windows path of a local folder when Windows reads it directly (not through \\\\wsl$), else None."""
|
||||
try:
|
||||
w = winhost.to_windows(path)
|
||||
except ValueError:
|
||||
return None
|
||||
return None if w.startswith("\\\\") else w
|
||||
|
||||
|
||||
def mount_args_length(lines: list[str]) -> int:
|
||||
"""Characters the content files take on axrb-direct.exe's command line (quoted "--mount-ro" "<guest>=<host>")."""
|
||||
return sum(len(' "--mount-ro" ""') + len("/storage/emulated/0/") + len(line) for line in lines)
|
||||
|
||||
|
||||
def _hard_links(package: str, data_dir: Path, rels: list[str]) -> Path | None:
|
||||
"""Hard links to the data files in <game dir>\\content (no copies, no extra space), None when they can't be made
|
||||
(the data is on another drive than FramePort's folder)."""
|
||||
links = axrb.game_dir(package) / CONTENT_LINKS
|
||||
try:
|
||||
for rel in rels:
|
||||
src, dst = data_dir / rel, links / rel
|
||||
if dst.exists() and os.path.samefile(src, dst):
|
||||
continue
|
||||
dst.parent.mkdir(parents=True, exist_ok=True)
|
||||
dst.unlink(missing_ok=True)
|
||||
os.link(src, dst)
|
||||
except OSError:
|
||||
shutil.rmtree(links, ignore_errors=True)
|
||||
return None
|
||||
return links
|
||||
|
||||
|
||||
def _line(package: str, rel: str, host_win: str) -> str:
|
||||
guest = f"Android/obb/{package}/{rel}"
|
||||
# prepare_art_session.py's rules: inside the app's storage, no empty/dot parts, no backslash; one line each
|
||||
if any(part in ("", ".", "..") for part in guest.split("/")) or "\\" in guest or \
|
||||
re.search(r"[\t\r\n]", guest + host_win):
|
||||
raise RuntimeError(f"unsupported content file name: {rel}")
|
||||
return f"{guest}\t{host_win}"
|
||||
|
||||
|
||||
def asset_lines(package: str, data_dir: Path | None, files: list[str] | None, reporter: Reporter) -> list[str]:
|
||||
"""AXRB's content-file list (core/direct.mjs writeAssetList): "Android/obb/<pkg>/<file>\\t<Windows path>" per
|
||||
data file. Files stay where they are when Windows can read them, else (a WSL-only folder: \\\\wsl$ is unreliable)
|
||||
they are copied next to the APK. A list too long for axrb-direct.exe's command line goes through hard links in
|
||||
<game dir>\\content instead (same drive only), else the install stops with a clear message."""
|
||||
manifest = list(data_manifest(data_dir, files) if data_dir else {})
|
||||
base = _windows_readable(data_dir) if manifest else None
|
||||
lines = []
|
||||
for rel in manifest:
|
||||
host = data_dir / rel
|
||||
if base:
|
||||
host_win = base + "\\" + rel.replace("/", "\\")
|
||||
else:
|
||||
copy = axrb.game_dir(package) / "obb" / rel
|
||||
if not copy.is_file() or copy.stat().st_size != host.stat().st_size:
|
||||
reporter.log(f"copying {rel} to where Windows can read it")
|
||||
copy.parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copyfile(host, copy)
|
||||
host_win = winhost.to_windows(copy)
|
||||
lines.append(_line(package, rel, host_win))
|
||||
links = axrb.game_dir(package) / CONTENT_LINKS
|
||||
if base and mount_args_length(lines) > MOUNT_ARGS_BUDGET:
|
||||
made = _hard_links(package, data_dir, manifest)
|
||||
if made:
|
||||
reporter.log(f"{len(lines)} content files: listed through hard links in {made} (shorter paths)")
|
||||
short = winhost.to_windows(made)
|
||||
lines = [_line(package, rel, short + "\\" + rel.replace("/", "\\")) for rel in manifest]
|
||||
elif links.is_dir():
|
||||
shutil.rmtree(links, ignore_errors=True) # hard links of an earlier install, no longer needed
|
||||
if mount_args_length(lines) > MOUNT_ARGS_BUDGET:
|
||||
raise RuntimeError(f"{len(lines)} content files with paths this long don't fit on the command line of "
|
||||
"AXRB's direct mode; move the game's data to the drive FramePort is on, or to a folder "
|
||||
"with a shorter path")
|
||||
return lines
|
||||
|
||||
|
||||
def _install_emulator(inst: axrb.Install, package: str, apk: Path, data_dir: Path | None, apk_only: bool,
|
||||
data_files: list[str] | None, reporter: Reporter) -> tuple[str, int, Path]:
|
||||
reporter.stage("Start Android (AXRB; the first start takes several minutes)")
|
||||
started = axrb.start_emulator(app=inst.app)
|
||||
try:
|
||||
axrb.ensure_runtime_apk(app=inst.app)
|
||||
reporter.stage("Install the game into AXRB's Android")
|
||||
_adb_ok(axrb.adb(["install", "--no-incremental", "-r", winhost.to_windows(apk)], timeout=900),
|
||||
"installing the game")
|
||||
activity = resolve_activity(package)
|
||||
sent = 0 if apk_only or not data_dir else push_data(package, Path(data_dir), data_files, reporter)
|
||||
axrb.adb(["shell", "sync"], timeout=120)
|
||||
finally:
|
||||
if started:
|
||||
reporter.stage("Stop Android")
|
||||
axrb.stop_emulator(app=inst.app)
|
||||
return activity, sent, axrb.write_launcher(app=inst.app)
|
||||
|
||||
|
||||
def _install_direct(inst: axrb.Install, package: str, apk: Path, data_dir: Path | None, apk_only: bool,
|
||||
data_files: list[str] | None, reporter: Reporter) -> tuple[str, int, Path]:
|
||||
reporter.stage("Install the game for AXRB's direct mode")
|
||||
activity = apk_launcher_activity(apk)
|
||||
if activity.split("/")[0] != package:
|
||||
raise RuntimeError(f"{apk.name} is {activity.split('/')[0]}, not {package}")
|
||||
game = axrb.game_dir(package)
|
||||
game.mkdir(parents=True, exist_ok=True)
|
||||
target = game / f"{package}.apk"
|
||||
tmp = target.with_name(target.name + ".part")
|
||||
shutil.copyfile(apk, tmp) # the converted copy in FramePort's output folder is removed after an install
|
||||
tmp.replace(target)
|
||||
listed = game / "assets.txt"
|
||||
if apk_only and listed.is_file():
|
||||
sent = 0
|
||||
else:
|
||||
lines = asset_lines(package, Path(data_dir) if data_dir else None, data_files, reporter)
|
||||
listed.write_text("".join(f"{line}\n" for line in lines), encoding="utf-8")
|
||||
sent = len(lines)
|
||||
return activity, sent, axrb.write_direct_launcher(inst)
|
||||
|
||||
|
||||
def install(package: str, title: str, apk: Path, data_dir: Path | None, recipe: Recipe, reporter: Reporter,
|
||||
apk_only: bool = False, data_files: list[str] | None = None, record_dir: Path | None = None,
|
||||
appid=None, backend: str | None = None) -> dict:
|
||||
"""`backend`: an explicit choice (CLI --axrb-backend), else choose_backend from the recipe and the analysis."""
|
||||
params = backend_params(recipe)
|
||||
why = "chosen for this install" if backend else "recipe" if params.get("backend") else "automatic"
|
||||
graphics = _analysis(package).get("graphics", "")
|
||||
backend = choose_backend(recipe, graphics, backend)
|
||||
reporter.log(f"AXRB backend: {backend} ({why}{', ' + graphics if why == 'automatic' else ''})")
|
||||
try:
|
||||
before = dep_backend(json.loads((record_dir / "deployment.json").read_text(encoding="utf-8")))
|
||||
except (OSError, ValueError, TypeError, AttributeError):
|
||||
before = backend
|
||||
if before != backend: # the other backend's copy (and saves) stay where they are
|
||||
reporter.log(f"this game was installed for AXRB's {before} backend before; that copy and its saves stay "
|
||||
"there (separate from this one)")
|
||||
inst = ensure_axrb(reporter, backend)
|
||||
name, code = _apk_versions(apk)
|
||||
profile = axrb.compatibility_runtime(inst, package, name, code)
|
||||
flags = launch_flags(backend, params, profile)
|
||||
install_one = _install_direct if backend == axrb.DIRECT else _install_emulator
|
||||
activity, sent, launcher = install_one(inst, package, apk, data_dir, apk_only, data_files, reporter)
|
||||
from ..build import sha256
|
||||
from ..patches.base import pc_selection
|
||||
|
||||
dep = {"package": package, "kind": KIND, "backend": backend, "title": title, "activity": activity,
|
||||
"apk": str(apk), "sha256": sha256(apk), "launcher_win": winhost.to_windows(launcher),
|
||||
"powershell_win": powershell_win(), "flags": flags, "axrb_version": inst.version,
|
||||
"axrb_local": inst.local,
|
||||
"recipe": {"patches": sorted(pc_selection(recipe.patches)), "source": recipe.source}, "time": time.time()}
|
||||
if backend == axrb.DIRECT:
|
||||
dep["apk_win"] = winhost.to_windows(axrb.game_dir(package) / f"{package}.apk")
|
||||
dep["appid"] = appid(shortcut_fields(dep)[0], title) if appid else None
|
||||
if record_dir:
|
||||
record_dir.mkdir(parents=True, exist_ok=True)
|
||||
(record_dir / "deployment.json").write_text(json.dumps(dep, indent=2), encoding="utf-8")
|
||||
where = "AXRB's direct mode" if backend == axrb.DIRECT else "AXRB"
|
||||
verb = "listed" if backend == axrb.DIRECT else "copied"
|
||||
reporter.log(f"installed in {where} ({activity}); {sent} data files {verb}"
|
||||
+ (f"; launcher options {' '.join(flags)}" if flags else ""))
|
||||
return {"ok": True, "appid": dep["appid"], "activity": activity, "backend": backend}
|
||||
|
||||
|
||||
def dep_backend(dep: dict) -> str:
|
||||
return dep.get("backend") or axrb.EMULATOR # installs before direct mode were all emulator ones
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------ FrameBridge settings
|
||||
SETTINGS_FILE = "framebridge.conf" # FrameBridge reads /sdcard/Android/data/<pkg>/files/framebridge.conf after
|
||||
SETTING_KEY = re.compile(r"[a-z_]+") # the build's libframe_settings.so (native/adapter/frame_adapter.c)
|
||||
SETTING_VALUE = re.compile(r"-?(?:[0-9]+\.?[0-9]*|\.[0-9]+)")
|
||||
|
||||
|
||||
def merge_settings(current: dict, changes: dict) -> dict:
|
||||
"""The agent's rules (cmd_set_settings): numbers only, checked before anything is written; an empty value
|
||||
removes the key (back to the build's value)."""
|
||||
out = dict(current)
|
||||
for k, v in changes.items():
|
||||
v = str(v).strip()
|
||||
if not SETTING_KEY.fullmatch(k) or (v and not SETTING_VALUE.fullmatch(v)):
|
||||
raise ValueError(f"bad setting {k}={v}")
|
||||
if v:
|
||||
out[k] = v
|
||||
else:
|
||||
out.pop(k, None)
|
||||
return out
|
||||
|
||||
|
||||
def settings_text(settings: dict) -> str:
|
||||
return "".join(f"{k}={v}\n" for k, v in settings.items())
|
||||
|
||||
|
||||
def set_settings(dep: dict, changes: dict) -> dict:
|
||||
"""Change FrameBridge settings of a game in AXRB without a rebuild: framebridge.conf in the game's external
|
||||
files folder overrides the build's settings at the next start. Direct mode: written into AXRB's runtime folder
|
||||
(direct\\sdcard\\Android\\data\\<pkg>\\files); emulator: pushed with adb (Android is started for it when it
|
||||
isn't running, and stopped again). `dep["settings"]` is updated; the caller saves the record."""
|
||||
package = dep["package"]
|
||||
if not re.fullmatch(r"[A-Za-z0-9_.]+", package):
|
||||
raise ValueError(f"unexpected package name {package!r}")
|
||||
current = merge_settings(dep.get("settings") or {}, changes)
|
||||
text = settings_text(current)
|
||||
if dep_backend(dep) == axrb.DIRECT:
|
||||
root = axrb.direct_runtime_root()
|
||||
if not root:
|
||||
raise RuntimeError("AXRB's direct-mode runtime folder was not found")
|
||||
files = root / "direct" / "sdcard" / "Android" / "data" / package / "files"
|
||||
files.mkdir(parents=True, exist_ok=True)
|
||||
(files / SETTINGS_FILE).write_text(text, encoding="utf-8", newline="\n")
|
||||
where = str(files / SETTINGS_FILE)
|
||||
else:
|
||||
remote = f"/sdcard/Android/data/{package}/files"
|
||||
local = axrb.game_dir(package) / SETTINGS_FILE # a Windows path adb.exe can read
|
||||
local.parent.mkdir(parents=True, exist_ok=True)
|
||||
local.write_text(text, encoding="utf-8", newline="\n")
|
||||
started = axrb.start_emulator()
|
||||
try:
|
||||
axrb.adb(["shell", "mkdir", "-p", remote], timeout=60)
|
||||
if current:
|
||||
_adb_ok(axrb.adb(["push", winhost.to_windows(local), f"{remote}/{SETTINGS_FILE}"], timeout=120),
|
||||
"copying the settings")
|
||||
else:
|
||||
axrb.adb(["shell", "rm", "-f", f"{remote}/{SETTINGS_FILE}"], timeout=60)
|
||||
finally:
|
||||
if started:
|
||||
axrb.stop_emulator()
|
||||
where = f"{remote}/{SETTINGS_FILE}"
|
||||
dep["settings"] = current
|
||||
return {"settings": current, "file": where}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------ logs + tests
|
||||
EMULATOR_LOGS = (("session.json", "game/session.json", 1 << 16), ("host.err", "game/host.err", 1 << 20),
|
||||
("host.log", "game/host.log", 1 << 20), ("guest.log", "game/guest.log", 2 << 20),
|
||||
("emulator.stderr.log", "emulator/emulator.stderr.log", 1 << 18),
|
||||
("frameport-emulator-start.log", "frameport-emulator-start.log", 1 << 18))
|
||||
# run_direct_game.ps1: the runner's stdout (AXRB_AOSP_* lifecycle lines, the game's Java output) and stderr, its
|
||||
# own log (AXRB_DIRECT_LOG: "<s> <tid> E/tag: ..."), the bridge, the session record
|
||||
DIRECT_LOGS = (("session.json", "game/session.json", 1 << 16), ("host.err", "game/host.err", 1 << 20),
|
||||
("host.log", "game/host.log", 1 << 20), ("direct.log", "game/direct.log", 4 << 20),
|
||||
("direct.out", "game/direct.out", 2 << 20), ("direct.err", "game/direct.err", 1 << 20),
|
||||
("frameport-launch-test.log", "frameport-launch-test.log", 1 << 16))
|
||||
|
||||
|
||||
HEAD_TOO = ("direct.out", "direct.log")
|
||||
|
||||
|
||||
def game_logs(backend: str | None = None) -> dict[str, str]:
|
||||
"""AXRB's session logs (newest session) for triage and diagnostics. Both backends when `backend` is None: the
|
||||
direct ones then under "direct/"."""
|
||||
out = {}
|
||||
for b, files in ((axrb.EMULATOR, EMULATOR_LOGS), (axrb.DIRECT, DIRECT_LOGS)):
|
||||
if backend not in (None, b):
|
||||
continue
|
||||
root = axrb.runtime_root() if b == axrb.EMULATOR else axrb.direct_runtime_root()
|
||||
if not root:
|
||||
continue
|
||||
logs = axrb.log_dir(root)
|
||||
prefix = "direct/" if b == axrb.DIRECT and backend is None else ""
|
||||
for name, sub, limit in files:
|
||||
p = logs / sub
|
||||
if p.is_file():
|
||||
# the runner's logs keep their start (milestones) as well as their end
|
||||
out[prefix + name] = axrb.read_log(p, limit, head=limit // 4 if name in HEAD_TOO else 0)
|
||||
return out
|
||||
|
||||
|
||||
def test_env(extra_env: dict | None = None) -> dict[str, str]:
|
||||
"""Environment for a launch test's processes: `extra_env`, else the simulated headset's while one runs, plus
|
||||
FRAMEPORT_AXRB_TEST_ENV ("NAME=value;NAME=value", e.g. AXRB_DIRECT_DUMP=10 for direct mode's periodic thread
|
||||
dumps or AXRB_DIRECT_TRACE=net,files) for debugging a game that stops somewhere."""
|
||||
env = dict(xr_sim.active_env() if extra_env is None else extra_env)
|
||||
for item in os.environ.get("FRAMEPORT_AXRB_TEST_ENV", "").split(";"):
|
||||
name, sep, value = item.strip().partition("=")
|
||||
if sep and re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name):
|
||||
env[name] = value
|
||||
return env
|
||||
|
||||
|
||||
def launch_test(dep: dict, reporter: Reporter, seconds: int = 45, triage=None, extra_env: dict | None = None):
|
||||
"""Start the game through FramePort's launcher (= AXRB's run script), watch its Android process, stop it again.
|
||||
extra_env: environment for the launcher's processes; default = the simulated headset's while one runs
|
||||
(tools/xr_sim.py, `frameport test --to pc --sim`)."""
|
||||
if dep_backend(dep) == axrb.DIRECT:
|
||||
return _launch_test_direct(dep, reporter, seconds, triage, extra_env)
|
||||
reporter.stage("Launch test (this PC, AXRB)")
|
||||
package = dep["package"]
|
||||
if axrb.emulator_online() and _pid(package):
|
||||
raise RuntimeError(f"{dep['title']} is already running")
|
||||
log = axrb.log_dir() / "frameport-launch-test.log"
|
||||
log.parent.mkdir(parents=True, exist_ok=True)
|
||||
log.unlink(missing_ok=True)
|
||||
before = time.time()
|
||||
q = axrb._ps_quote
|
||||
# --- xr-sim hook (tools/xr_sim.py): env + SteamVR-registration shim before the launcher call
|
||||
sim_env = test_env(extra_env)
|
||||
pid = axrb.spawn_detached(xr_sim.launcher_prefix(sim_env) + axrb.logged(
|
||||
f"& {q(dep['launcher_win'])} -Package {q(package)} -Activity {q(dep['activity'])} "
|
||||
f"-GameName {q(dep['title'])} -CaptureGuestLog " + " ".join(dep.get("flags") or ()),
|
||||
winhost.to_windows(log)))
|
||||
seen, state, boot_deadline = False, "NEVER_STARTED", time.time() + 900 # the emulator boot comes first
|
||||
watch_end = None
|
||||
while time.time() < boot_deadline and axrb.pid_running(pid):
|
||||
reporter.check_cancel()
|
||||
time.sleep(3)
|
||||
running = axrb.emulator_online() and bool(_pid(package))
|
||||
if running and not seen:
|
||||
seen, watch_end = True, time.time() + seconds
|
||||
if seen and not running:
|
||||
state = "EXITED"
|
||||
break
|
||||
if watch_end and time.time() >= watch_end:
|
||||
state = "RUNNING"
|
||||
break
|
||||
if seen and state == "NEVER_STARTED":
|
||||
state = "EXITED"
|
||||
if state == "RUNNING":
|
||||
sim_capture(sim_env, package, reporter)
|
||||
if axrb.pid_running(pid):
|
||||
try: # AXRB's script sees the game stop, cleans up (and shuts Android down if it started it)
|
||||
axrb.adb(["shell", "am", "force-stop", package], timeout=30)
|
||||
except (axrb.AxrbError, OSError, subprocess.TimeoutExpired):
|
||||
pass
|
||||
end = time.time() + 300
|
||||
while time.time() < end and axrb.pid_running(pid):
|
||||
time.sleep(3)
|
||||
logs = game_logs(axrb.EMULATOR)
|
||||
text = "\n".join(f"===== {name}\n{body}" for name, body in logs.items()
|
||||
if name != "frameport-emulator-start.log")
|
||||
text += "\n===== launcher\n" + axrb.read_log(log, 1 << 16)
|
||||
return _report(text, state, package, before, reporter, triage, "incl. Android start")
|
||||
|
||||
|
||||
# direct.out lines AppProcess prints once the game's activity exists / once it ended (AXRB's ART bootstrap)
|
||||
DIRECT_STARTED = re.compile(r"^AXRB_AOSP_(?:ACTIVITY_CREATED|LIFECYCLE) ", re.M)
|
||||
|
||||
|
||||
def direct_state(out_text: str, launcher_running: bool) -> str | None:
|
||||
"""RUNNING-so-far / EXITED / None (not started yet) from direct.out and whether the run script still runs."""
|
||||
if DIRECT_STARTED.search(out_text):
|
||||
return "RUNNING" if launcher_running else "EXITED"
|
||||
return None if launcher_running else "NEVER_STARTED"
|
||||
|
||||
|
||||
def sim_capture(env: dict, package: str, reporter: Reporter) -> Path | None:
|
||||
"""Under the simulated headset (env names Monado's runtime): save its window, both eyes as a headset gets them,
|
||||
to the xr-sim captures folder, so a test shows what the game drew at its end. None without the simulator or the
|
||||
capture tool; a failed capture never fails the test."""
|
||||
if "XR_RUNTIME_JSON" not in (env or {}) or not xr_sim.capture_exe():
|
||||
return None
|
||||
try:
|
||||
path = xr_sim.capture(xr_sim.capture_dir() / f"{time.strftime('%Y%m%d-%H%M%S')}-{package}-headset.bmp")
|
||||
except (xr_sim.XrSimError, OSError, subprocess.SubprocessError) as exc:
|
||||
reporter.log(f"simulated headset view not saved: {exc}")
|
||||
return None
|
||||
reporter.log(f"simulated headset view: {path}")
|
||||
return path
|
||||
|
||||
|
||||
def _launch_test_direct(dep: dict, reporter: Reporter, seconds: int, triage, extra_env: dict | None = None):
|
||||
reporter.stage("Launch test (this PC, AXRB direct mode)")
|
||||
inst = axrb.find(axrb.DIRECT)
|
||||
if not inst:
|
||||
raise RuntimeError("AXRB's direct mode is not installed on this PC any more")
|
||||
package = dep["package"]
|
||||
logs = axrb.log_dir(inst.runtime)
|
||||
log = logs / "frameport-launch-test.log"
|
||||
log.parent.mkdir(parents=True, exist_ok=True)
|
||||
log.unlink(missing_ok=True)
|
||||
out = logs / "game" / "direct.out"
|
||||
before = time.time()
|
||||
q = axrb._ps_quote
|
||||
sim_env = test_env(extra_env)
|
||||
pid = axrb.spawn_detached(xr_sim.launcher_prefix(sim_env) + axrb.logged(
|
||||
f"& {q(dep['launcher_win'])} -Package {q(package)} -Activity {q(dep['activity'])} "
|
||||
f"-GameName {q(dep['title'])} " + " ".join(dep.get("flags") or ()), winhost.to_windows(log)))
|
||||
state, deadline, watch_end = "NEVER_STARTED", time.time() + 300, None # ART's first start is slow (no JIT)
|
||||
while time.time() < deadline:
|
||||
reporter.check_cancel()
|
||||
time.sleep(3)
|
||||
alive = axrb.pid_running(pid)
|
||||
fresh = out.is_file() and out.stat().st_mtime >= before - 5 # the run script rewrites it every session
|
||||
now = direct_state(axrb.read_log(out, 1 << 20, head=1 << 18) if fresh else "", alive)
|
||||
if now in ("EXITED", "NEVER_STARTED"):
|
||||
state = now
|
||||
break
|
||||
if now == "RUNNING" and not watch_end:
|
||||
watch_end, deadline = time.time() + seconds, time.time() + seconds + 5
|
||||
if watch_end and time.time() >= watch_end:
|
||||
state = "RUNNING"
|
||||
break
|
||||
if state == "RUNNING":
|
||||
sim_capture(sim_env, package, reporter)
|
||||
if axrb.pid_running(pid): # AXRB's own Stop: the bridge window closes, the game pauses, stops and saves
|
||||
try:
|
||||
axrb.stop_game(inst, pid)
|
||||
except (OSError, subprocess.TimeoutExpired):
|
||||
pass
|
||||
end = time.time() + 60
|
||||
while time.time() < end and axrb.pid_running(pid):
|
||||
time.sleep(3)
|
||||
text = "\n".join(f"===== {name}\n{body}" for name, body in game_logs(axrb.DIRECT).items()
|
||||
if name != "frameport-launch-test.log")
|
||||
text += "\n===== launcher\n" + axrb.read_log(log, 1 << 16)
|
||||
return _report(text, state, package, before, reporter, triage, "direct mode")
|
||||
|
||||
|
||||
# AXRB's runtime logs a summary of the game's frames every ~5 s: "AXRB.Perf end-frame: rate=63.7/s ..." (guest), and
|
||||
# the bridge one of what it hands the PC's OpenXR runtime: "AXRB.Perf host-fresh-submit: rate=62.9/s ..."
|
||||
PERF_RATE = re.compile(r"AXRB\.Perf (end-frame|host-fresh-submit): rate=([\d.]+)/s")
|
||||
|
||||
|
||||
def frame_rates(text: str, last: int = 6) -> dict[str, float]:
|
||||
"""{"game": fps, "host": fps}: the median of the last few AXRB.Perf summaries (the first ones include loading)."""
|
||||
seen: dict[str, list[float]] = {}
|
||||
for kind, rate in PERF_RATE.findall(text):
|
||||
seen.setdefault("game" if kind == "end-frame" else "host", []).append(float(rate))
|
||||
out = {}
|
||||
for name, rates in seen.items():
|
||||
tail = sorted(rates[-last:])
|
||||
out[name] = tail[len(tail) // 2]
|
||||
return out
|
||||
|
||||
|
||||
def _report(text: str, state: str, package: str, before: float, reporter: Reporter, triage, note: str):
|
||||
result = triage(text, state, package, kind="axrb") if triage else None
|
||||
reporter.check("Game process", state == "RUNNING", f"{state} ({round(time.time() - before)}s, {note})")
|
||||
rates = frame_rates(text)
|
||||
if rates:
|
||||
reporter.check("Frame rate", True, ", ".join(f"{k} {v:g} fps" for k, v in
|
||||
(("game submits", rates.get("game")),
|
||||
("bridge to the PC's runtime", rates.get("host"))) if v))
|
||||
if result:
|
||||
for m in result.milestones:
|
||||
reporter.check(m, True)
|
||||
for f in result.findings:
|
||||
reporter.check(f.id, None if f.severity in ("warning", "info") else False,
|
||||
f"{f.diagnosis} [{f.evidence[:160]}]")
|
||||
return result, text
|
||||
|
||||
|
||||
def _pid(package: str) -> str:
|
||||
try:
|
||||
return axrb.adb(["shell", "pidof", package], timeout=20).stdout.strip()
|
||||
except (axrb.AxrbError, OSError, subprocess.TimeoutExpired):
|
||||
return ""
|
||||
|
||||
|
||||
def uninstall(dep: dict, keep_data: bool = True) -> bool:
|
||||
"""Remove the game from AXRB (saves kept unless keep_data is False). False if AXRB isn't there."""
|
||||
if dep_backend(dep) == axrb.DIRECT:
|
||||
return _uninstall_direct(dep, keep_data)
|
||||
if not axrb.app_dir() or not axrb.adb_exe():
|
||||
return False
|
||||
started = axrb.start_emulator()
|
||||
try:
|
||||
args = ["shell", "pm", "uninstall", "-k", dep["package"]] if keep_data else ["uninstall", dep["package"]]
|
||||
r = axrb.adb(args, timeout=240)
|
||||
return "Success" in r.stdout
|
||||
finally:
|
||||
if started:
|
||||
axrb.stop_emulator()
|
||||
|
||||
|
||||
def _uninstall_direct(dep: dict, keep_data: bool) -> bool:
|
||||
"""Direct mode: FramePort's copy of the APK and its content list; with keep_data False also the game's Android
|
||||
data in AXRB's runtime folder (direct\\data\\data\\<pkg> = /data/data, direct\\sdcard\\Android\\data\\<pkg>)."""
|
||||
package = dep["package"]
|
||||
try:
|
||||
shutil.rmtree(axrb.game_dir(package), ignore_errors=True) # content\ holds hard links: the data stays
|
||||
except axrb.AxrbError:
|
||||
return False
|
||||
root = axrb.direct_runtime_root()
|
||||
if not keep_data and root:
|
||||
direct = root / "direct"
|
||||
for d in (direct / "data" / "data" / package, direct / "sdcard" / "Android" / "data" / package):
|
||||
shutil.rmtree(d, ignore_errors=True)
|
||||
return True
|
||||
@@ -1,5 +1,6 @@
|
||||
"""PC VR target: Oculus Rift games run on this Windows PC through Revive (LibOVR -> OpenXR/SteamVR), with a non-Steam
|
||||
shortcut in the local Steam library (play on the Frame by streaming from Steam/SteamVR).
|
||||
"""PC target ("This PC"): Oculus Rift games run on this Windows PC through Revive (LibOVR -> OpenXR/SteamVR), Quest
|
||||
games through AXRB (targets/pc_android.py), each with a non-Steam shortcut in the local Steam library (play on the
|
||||
Frame by streaming from Steam/SteamVR).
|
||||
|
||||
Works on native Windows and from WSL (Windows programs via interop). Revive is FramePort's portable copy
|
||||
(tools/revive.py), so nothing is installed system-wide. Nothing is copied: the shortcut points at the game folder.
|
||||
@@ -18,7 +19,9 @@ from ..core.events import Reporter
|
||||
from ..core.models import Recipe
|
||||
from ..core.paths import agent_file, localize, user_data_dir
|
||||
from ..patches.pcvr import game_args
|
||||
from ..tools import axrb
|
||||
from ..validate.triage import triage
|
||||
from . import pc_android
|
||||
from .base import PC_LABEL, Target
|
||||
|
||||
TAG = "FramePort PC VR" # marks the Steam shortcuts FramePort made (for updates and cleanup)
|
||||
@@ -61,8 +64,20 @@ def pc_dir() -> Path:
|
||||
return path
|
||||
|
||||
|
||||
def is_android(dep: dict) -> bool:
|
||||
"""A Quest game installed on this PC (AXRB), not a Rift game."""
|
||||
return dep.get("kind") == pc_android.KIND
|
||||
|
||||
|
||||
def options_key(dep: dict) -> str | None:
|
||||
"""Quest games on this PC share their shortcut Exe (powershell.exe): their shortcut is also matched by this."""
|
||||
return f"-Package {dep['package']} " if is_android(dep) else None
|
||||
|
||||
|
||||
def shortcut_fields(dep: dict) -> tuple[str, str, str]:
|
||||
"""(Exe, StartDir, LaunchOptions) for the Steam shortcut of an installed game."""
|
||||
if is_android(dep):
|
||||
return pc_android.shortcut_fields(dep)
|
||||
exe_win = dep["exe_win"]
|
||||
start = '"' + exe_win.rsplit("\\", 1)[0] + '\\"'
|
||||
extra = " ".join(dep.get("game_args") or [])
|
||||
@@ -87,6 +102,7 @@ def local_installs() -> dict[str, dict]:
|
||||
class PcReviveTarget(Target):
|
||||
kind = "pc"
|
||||
label = PC_LABEL
|
||||
axrb_backend: str | None = None # Quest games: AXRB's backend for this run (CLI --axrb-backend), None = per game
|
||||
|
||||
def __init__(self):
|
||||
if not winhost.available():
|
||||
@@ -106,6 +122,7 @@ class PcReviveTarget(Target):
|
||||
"steamvr": bool(root and winhost.app_installed(root, winhost.STEAMVR_APPID)),
|
||||
"revive": str(revive.revive_dir()) if revive.revive_dir() else None,
|
||||
"revive_version": revive.installed_version(),
|
||||
"axrb": axrb.status(),
|
||||
"installed": self.installed(),
|
||||
}
|
||||
|
||||
@@ -116,7 +133,7 @@ class PcReviveTarget(Target):
|
||||
dep = localize(json.loads(f.read_text(encoding="utf-8")))
|
||||
except (OSError, ValueError):
|
||||
continue
|
||||
dep["apk_present"] = Path(dep.get("exe_local", "")).exists()
|
||||
dep["apk_present"] = True if is_android(dep) else Path(dep.get("exe_local", "")).exists()
|
||||
out.append(dep)
|
||||
return out
|
||||
|
||||
@@ -149,7 +166,8 @@ class PcReviveTarget(Target):
|
||||
log_path = (winhost.env_path("LOCALAPPDATA") or Path("/nonexistent")) / REVIVE_LOG
|
||||
if log_path.exists():
|
||||
files["ReviveInjector.txt"] = log_path.read_text(encoding="utf-8", errors="replace")[-(2 << 20):]
|
||||
out = {"host": {"steamvr_running": winhost.steamvr_running()}, "files": files}
|
||||
files.update({f"axrb/{name}": text for name, text in pc_android.game_logs().items()})
|
||||
out = {"host": {"steamvr_running": winhost.steamvr_running(), "axrb": axrb.status()}, "files": files}
|
||||
if package:
|
||||
try:
|
||||
files["deployment.json"] = json.dumps(self._dep(package), indent=1)
|
||||
@@ -160,7 +178,12 @@ class PcReviveTarget(Target):
|
||||
|
||||
# ------------------------------------------------------------------ install
|
||||
def install(self, package, title, apk, data_dir, recipe, reporter, apk_only=False, data_files=None):
|
||||
raise NotImplementedError("Quest (APK) games install on the Steam Frame, not on the PC")
|
||||
"""A Quest game (its build for this PC) into AXRB's Android emulator."""
|
||||
if not self.steam:
|
||||
raise RuntimeError("Steam for Windows was not found on this PC")
|
||||
return pc_android.install(package, title, Path(apk), Path(data_dir) if data_dir else None, recipe, reporter,
|
||||
apk_only, data_files, record_dir=pc_dir() / package,
|
||||
appid=_vdf().shortcut_appid, backend=self.axrb_backend)
|
||||
|
||||
def install_pcvr(self, package, title, game_dir, exe, recipe: Recipe, reporter: Reporter, **extra):
|
||||
from ..tools import revive
|
||||
@@ -227,7 +250,7 @@ class PcReviveTarget(Target):
|
||||
try:
|
||||
dep = self._dep(pkg)
|
||||
exe, start, opts = shortcut_fields(dep)
|
||||
entry = library.game(pkg) or {"kind": "rift"}
|
||||
entry = library.game(pkg) or ({"package": pkg} if is_android(dep) else {"kind": "rift"})
|
||||
if not sources.has_art(pkg):
|
||||
artwork.fetch(pkg, lookup=dep.get("art_lookup"))
|
||||
art = steam_set_for(pkg)
|
||||
@@ -238,13 +261,13 @@ class PcReviveTarget(Target):
|
||||
old.unlink(missing_ok=True)
|
||||
reporter.log(f"removed the old Steam entry for {dep['title']} (its launch command changed)")
|
||||
ident = dep.get("appid") or vdf_mod.shortcut_appid(exe, dep["title"])
|
||||
icon = dep["exe_win"]
|
||||
icon = dep.get("exe_win") or ""
|
||||
if "icon" in art: # Steam wants a local path for the shortcut icon
|
||||
icon_path = grid / f"{ident}_icon.png"
|
||||
shutil.copy(art["icon"], icon_path)
|
||||
icon = winhost.to_windows(icon_path)
|
||||
got = vdf_mod.upsert_shortcut(str(vdf), exe, dep["title"], start, icon, TAG, opts,
|
||||
tags=steam_tags(entry, "pc"))
|
||||
tags=steam_tags(entry, "pc"), options_key=options_key(dep))
|
||||
for kind, f in art.items():
|
||||
suffix = {"portrait": "p", "landscape": "", "hero": "_hero", "logo": "_logo"}.get(kind)
|
||||
if suffix is None:
|
||||
@@ -274,7 +297,7 @@ class PcReviveTarget(Target):
|
||||
if not root or not dep.get("appid"):
|
||||
raise RuntimeError("Steam or the game's Steam shortcut wasn't found on this PC")
|
||||
vr = winhost.start_steamvr(root) # Revive binds to SteamVR; without it the game falls back to flatscreen
|
||||
tuning = self._tune(root, dep) if vr else None
|
||||
tuning = self._tune(root, dep) if vr and not is_android(dep) else None
|
||||
winhost.start_detached(root / "steam.exe", [f"steam://rungameid/{(int(dep['appid']) << 32) | 0x02000000}"])
|
||||
return {"package": package, "title": dep.get("title"), "steamvr": vr, "tuning": tuning}
|
||||
|
||||
@@ -293,8 +316,13 @@ class PcReviveTarget(Target):
|
||||
return result
|
||||
|
||||
def launch_test(self, package, reporter, seconds=45):
|
||||
reporter.stage("Launch test (this PC)")
|
||||
dep = self._dep(package)
|
||||
if is_android(dep):
|
||||
if self.axrb_backend and self.axrb_backend != pc_android.dep_backend(dep):
|
||||
raise RuntimeError(f"{dep['title']} is installed for AXRB's {pc_android.dep_backend(dep)} backend: "
|
||||
f"install it again with --axrb-backend {self.axrb_backend} first")
|
||||
return pc_android.launch_test(dep, reporter, seconds, triage)
|
||||
reporter.stage("Launch test (this PC)")
|
||||
image = Path(dep["exe_local"]).name
|
||||
if winhost.process_running(image):
|
||||
raise RuntimeError(f"{dep['title']} is already running")
|
||||
@@ -335,7 +363,14 @@ class PcReviveTarget(Target):
|
||||
return result, log
|
||||
|
||||
def set_settings(self, package, settings):
|
||||
return {"settings": {}}
|
||||
"""Quest games in AXRB: FrameBridge settings without a rebuild (pc_android.set_settings). Rift games have
|
||||
no FrameBridge."""
|
||||
dep = self._dep(package)
|
||||
if not is_android(dep):
|
||||
return {"settings": {}}
|
||||
result = pc_android.set_settings(dep, settings)
|
||||
self._save_dep(package, dep)
|
||||
return result
|
||||
|
||||
def uninstall(self, package, keep_data=True):
|
||||
dep = self._dep(package)
|
||||
@@ -346,9 +381,11 @@ class PcReviveTarget(Target):
|
||||
vdf = root / "userdata" / user / "config" / "shortcuts.vdf"
|
||||
was_running = winhost.stop_steam(root)
|
||||
try:
|
||||
removed = _vdf().remove_shortcut(str(vdf), shortcut_fields(dep)[0])
|
||||
removed = _vdf().remove_shortcut(str(vdf), shortcut_fields(dep)[0], options_key(dep))
|
||||
finally:
|
||||
if was_running:
|
||||
winhost.start_steam(root)
|
||||
android_removed = pc_android.uninstall(dep, keep_data) if is_android(dep) else None
|
||||
shutil.rmtree(pc_dir() / package, ignore_errors=True)
|
||||
return {"removed": True, "shortcut_removed": removed, "kept_saves": True}
|
||||
return {"removed": True, "shortcut_removed": removed, "kept_saves": keep_data or not is_android(dep),
|
||||
**({"android_removed": android_removed} if is_android(dep) else {})}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,239 @@
|
||||
"""Headset-free OpenXR on this Windows PC for unattended tests: Monado's simulated HMD (docs/PC_ANDROID.md "Testing
|
||||
without a headset").
|
||||
|
||||
A portable Monado for Windows (an official CI build of monado/monado, unpacked by hand, no installer) runs as
|
||||
monado-service.exe with the simulated builder. Only processes FramePort starts get it, through the OpenXR loader's
|
||||
XR_RUNTIME_JSON: the system's active OpenXR runtime (SteamVR) and SteamVR itself are never changed or started.
|
||||
Monado's compositor accepts D3D11 clients (XR_KHR_D3D11_enable) and asks them for the GPU it renders on (the
|
||||
discrete one), which is what AXRB's host bridge needs.
|
||||
|
||||
Off unless asked for: `--sim` on `frameport test --to pc`, or env FRAMEPORT_PC_XR_SIM=1.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
from ..core import winhost
|
||||
|
||||
ENV_FLAG = "FRAMEPORT_PC_XR_SIM"
|
||||
PIPE = "monado_comp_ipc" # Monado's IPC pipe: \\.\pipe\<its runtime dir = %TEMP%>\monado_comp_ipc
|
||||
FPS = 72 # the Quest's usual rate
|
||||
|
||||
# Monado's own settings for the service. The simulated builder only runs when asked for; "ml2" controllers are the
|
||||
# simulated ones whose bindings cover the Vive wand profile, so OpenXR apps that suggest Touch/Index/Vive bindings
|
||||
# (AXRB does) get two tracked controllers ("simple" and "wmr" ones stay inactive for them).
|
||||
SERVICE_ENV = {"SIMULATED_ENABLE": "1", "SIMULATED_LEFT": "ml2", "SIMULATED_RIGHT": "ml2",
|
||||
"XRT_COMPOSITOR_DEFAULT_FRAMERATE": str(FPS)}
|
||||
# No window at all (Monado's "null" compositor): frames are paced and accepted, nothing is shown or capturable.
|
||||
HEADLESS_ENV = {"XRT_COMPOSITOR_NULL": "1", "XRT_COMPOSITOR_NULL_FPS": str(FPS)}
|
||||
WINDOW_TITLE = "Monado" # its compositor window: "Monado (Windowed)" = the simulated HMD's display, both eyes
|
||||
|
||||
|
||||
NOT_FOUND = "Monado for Windows was not found (see docs/PC_ANDROID.md \"Testing without a headset\")"
|
||||
|
||||
|
||||
class XrSimError(RuntimeError):
|
||||
pass
|
||||
|
||||
|
||||
def enabled(flag: bool | None = None) -> bool:
|
||||
"""`--sim` given, or FRAMEPORT_PC_XR_SIM=1."""
|
||||
return bool(flag) or os.environ.get(ENV_FLAG, "").strip().lower() in ("1", "true", "yes", "on")
|
||||
|
||||
|
||||
def _dev_dir() -> Path | None:
|
||||
local = winhost.env_path("LOCALAPPDATA") if winhost.available() else None
|
||||
return local / "FramePort-dev" if local else None
|
||||
|
||||
|
||||
def monado_dir() -> Path | None:
|
||||
"""The portable Monado (folder with openxr_monado.json and bin/monado-service.exe): FRAMEPORT_MONADO_DIR, else
|
||||
%LOCALAPPDATA%\\FramePort-dev\\monado (its `install` folder as unpacked from the CI artifact). Local path."""
|
||||
bases = [Path(os.environ["FRAMEPORT_MONADO_DIR"])] if os.environ.get("FRAMEPORT_MONADO_DIR") else []
|
||||
dev = _dev_dir()
|
||||
if not bases and dev:
|
||||
bases = [dev / "monado"]
|
||||
for base in bases:
|
||||
for d in (base, base / "install"):
|
||||
if (d / "openxr_monado.json").is_file() and (d / "bin" / "monado-service.exe").is_file():
|
||||
return d
|
||||
return None
|
||||
|
||||
|
||||
def capture_exe() -> Path | None:
|
||||
"""xr_sim_capture.exe (native/xrsimprobe, built by hand): FRAMEPORT_XR_SIM_CAPTURE, else next to the dev probe."""
|
||||
if os.environ.get("FRAMEPORT_XR_SIM_CAPTURE"):
|
||||
p = Path(os.environ["FRAMEPORT_XR_SIM_CAPTURE"])
|
||||
return p if p.is_file() else None
|
||||
dev = _dev_dir()
|
||||
p = dev / "xr-sim-probe" / "xr_sim_capture.exe" if dev else None
|
||||
return p if p and p.is_file() else None
|
||||
|
||||
|
||||
def client_env(monado: Path | None = None) -> dict[str, str]:
|
||||
"""What a process FramePort starts needs to use the simulator instead of the system's runtime."""
|
||||
monado = monado or monado_dir()
|
||||
if not monado:
|
||||
raise XrSimError(NOT_FOUND)
|
||||
# AXRB_TEST_SYNTHETIC_HMD=2 (AXRB's host bridge, test-only): a fixed standing head and a valid LOCAL origin.
|
||||
# Monado's simulated head has no POSITION_TRACKED bit, so the bridge never sets up its LOCAL origin and reports
|
||||
# every head pose in LOCAL with flags 0; VrApi games (The Climb 2) then never get a tracked head and only submit
|
||||
# empty frames.
|
||||
return {"XR_RUNTIME_JSON": winhost.to_windows(monado / "openxr_monado.json"), "AXRB_TEST_SYNTHETIC_HMD": "2"}
|
||||
|
||||
|
||||
def service_env(headless: bool = False) -> dict[str, str]:
|
||||
return {**SERVICE_ENV, **(HEADLESS_ENV if headless else {})}
|
||||
|
||||
|
||||
def _ps_quote(s: str) -> str:
|
||||
return "'" + str(s).replace("'", "''") + "'"
|
||||
|
||||
|
||||
def ps_env(env: dict[str, str]) -> str:
|
||||
"""PowerShell statements that set `env` for the processes the rest of the command starts."""
|
||||
return "".join(f"$env:{k} = {_ps_quote(v)}; " for k, v in env.items())
|
||||
|
||||
|
||||
# AXRB's run script registers the game with SteamVR (steamvr_app_identity.py, an OpenVR utility client that starts
|
||||
# SteamVR) whenever the system's active OpenXR runtime is SteamVR, whatever XR_RUNTIME_JSON says. Under the simulator
|
||||
# that call is answered "failed" instead (the script only warns), so SteamVR is never started or written to.
|
||||
NO_STEAMVR_SHIM = ("function python { if (\"$args\" -match 'steamvr_app_identity\\.py') "
|
||||
"{ Write-Output 'FramePort xr-sim: SteamVR registration skipped'; "
|
||||
"$global:LASTEXITCODE = 1; return }; & python.exe @args }; ")
|
||||
|
||||
|
||||
def launcher_prefix(env: dict[str, str]) -> str:
|
||||
"""PowerShell to put before a PC launcher call so the processes it starts use the simulator (empty without)."""
|
||||
if not env:
|
||||
return ""
|
||||
return ps_env(env) + (NO_STEAMVR_SHIM if "XR_RUNTIME_JSON" in env else "")
|
||||
|
||||
|
||||
def service_command(monado: Path, log_win: str, headless: bool = False) -> str:
|
||||
"""The PowerShell command that runs monado-service.exe and waits for it; its log (Monado logs to stderr) goes to
|
||||
log_win, stdout next to it."""
|
||||
exe = winhost.to_windows(monado / "bin" / "monado-service.exe")
|
||||
return (ps_env(service_env(headless))
|
||||
+ f"$p = Start-Process -FilePath {_ps_quote(exe)} -WindowStyle Hidden -PassThru -Wait "
|
||||
f"-RedirectStandardError {_ps_quote(log_win)} -RedirectStandardOutput {_ps_quote(log_win + '.out')}; "
|
||||
"exit $p.ExitCode")
|
||||
|
||||
|
||||
def pipe_open() -> bool:
|
||||
"""Monado's service is up and takes clients."""
|
||||
r = winhost.powershell(f"[bool]([System.IO.Directory]::GetFiles('\\\\.\\pipe\\') -like {_ps_quote('*' + PIPE)})",
|
||||
timeout=30)
|
||||
return r.stdout.strip().lower().endswith("true")
|
||||
|
||||
|
||||
def log_path() -> Path:
|
||||
from ..core.paths import user_data_dir
|
||||
|
||||
return user_data_dir() / "logs" / "xr-sim-service.log"
|
||||
|
||||
|
||||
@dataclass
|
||||
class Service:
|
||||
pid: int | None # the hidden PowerShell that holds monado-service.exe; None = one we didn't start
|
||||
log: Path
|
||||
monado: Path
|
||||
capture_prefix: str | None = None # Windows path prefix for AXRB's host bridge frame captures
|
||||
|
||||
def env(self) -> dict[str, str]:
|
||||
env = client_env(self.monado)
|
||||
if self.capture_prefix: # AXRB's opt-in readback of the layers the game submits (4 PPMs, 5 s apart)
|
||||
env.update({"AXRB_CAPTURE_PREFIX": self.capture_prefix, "AXRB_CAPTURE_FIRST_SEQUENCE": "300"})
|
||||
return env
|
||||
|
||||
|
||||
_active: Service | None = None
|
||||
|
||||
|
||||
def active_env() -> dict[str, str]:
|
||||
"""XR_RUNTIME_JSON for Monado while a simulator started by `running()` is up in this process, else {}: the hook
|
||||
the PC launchers read (targets/pc_android.py)."""
|
||||
return _active.env() if _active else {}
|
||||
|
||||
|
||||
def start(headless: bool = False, wait: float = 60) -> Service:
|
||||
"""Start Monado's service hidden (nothing inherited from FramePort) and wait until its pipe is open. A service
|
||||
that is already running is used as it is (and left running by stop())."""
|
||||
monado = monado_dir()
|
||||
if not monado:
|
||||
raise XrSimError(NOT_FOUND)
|
||||
log = log_path()
|
||||
log.parent.mkdir(parents=True, exist_ok=True)
|
||||
if pipe_open():
|
||||
return Service(None, log, monado)
|
||||
log.unlink(missing_ok=True)
|
||||
from . import axrb # its WMI start: the service must not hold FramePort's (or WSL's interop) pipes
|
||||
|
||||
pid = axrb.spawn_detached(service_command(monado, winhost.to_windows(log), headless))
|
||||
end = time.time() + wait
|
||||
while time.time() < end:
|
||||
if pipe_open():
|
||||
return Service(pid, log, monado)
|
||||
text = log.read_text(errors="replace") if log.is_file() else ""
|
||||
if re.search(r"Server exiting|ERROR \[p_create_system\]", text):
|
||||
break
|
||||
time.sleep(1)
|
||||
stop(Service(pid, log, monado))
|
||||
tail = (log.read_text(errors="replace") if log.is_file() else "").strip().splitlines()[-5:]
|
||||
raise XrSimError("Monado's service didn't start" + (": " + " | ".join(tail) if tail else ""))
|
||||
|
||||
|
||||
def stop(service: Service) -> None:
|
||||
"""End the service (with its PowerShell and cmd parents) if we started it."""
|
||||
if service.pid:
|
||||
winhost.run_win([winhost.system32("taskkill.exe"), "/PID", str(service.pid), "/T", "/F"], timeout=30)
|
||||
|
||||
|
||||
def capture_dir() -> Path:
|
||||
from ..core.paths import user_data_dir
|
||||
|
||||
return user_data_dir() / "logs" / "xr-sim"
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def running(on: bool, headless: bool = False, reporter=None, captures: bool = True):
|
||||
"""Monado up for the `with` block when `on` (callers decide with enabled()), else nothing; active_env() names it
|
||||
meanwhile. With captures, AXRB's host bridge also saves a few frames of what the game submits to capture_dir()."""
|
||||
global _active
|
||||
if not on:
|
||||
yield None
|
||||
return
|
||||
if reporter:
|
||||
reporter.stage("Starting the simulated headset (Monado)")
|
||||
service = start(headless)
|
||||
if captures:
|
||||
capture_dir().mkdir(parents=True, exist_ok=True)
|
||||
service.capture_prefix = winhost.to_windows(capture_dir()) + "\\" + time.strftime("%Y%m%d-%H%M%S-")
|
||||
_active = service
|
||||
if reporter:
|
||||
reporter.log(f"Monado: {service.monado} (log {service.log})"
|
||||
+ (f"; frame captures: {capture_dir()}" if captures else ""))
|
||||
try:
|
||||
yield service
|
||||
finally:
|
||||
_active = None
|
||||
stop(service)
|
||||
|
||||
|
||||
def capture(out: Path, title: str = WINDOW_TITLE) -> Path:
|
||||
"""Save Monado's compositor window (the simulated HMD's display: both eyes as the headset gets them) as a BMP.
|
||||
Needs the windowed compositor (not headless) and xr_sim_capture.exe."""
|
||||
exe = capture_exe()
|
||||
if not exe:
|
||||
raise XrSimError("xr_sim_capture.exe was not found (native/xrsimprobe)")
|
||||
out.parent.mkdir(parents=True, exist_ok=True)
|
||||
r = winhost.run_win([str(exe), winhost.to_windows(out), title], timeout=30)
|
||||
if r.returncode != 0 or not out.is_file():
|
||||
raise XrSimError((r.stdout + r.stderr).strip() or "capture failed")
|
||||
return out
|
||||
+45
-11
@@ -987,10 +987,11 @@ class FramePortApp:
|
||||
frame_opt = (frame_label, G.FRAME, lambda e: self.install(pkg, "frame"), False, None) \
|
||||
if connected else (tr("Connect your Frame"), ft.Icons.LINK_ROUNDED, lambda e: self.go("frame"), False,
|
||||
tr("Connect your Steam Frame first."))
|
||||
if g.get("kind") != "rift":
|
||||
if not pipeline.pc_installable(g):
|
||||
return [frame_opt]
|
||||
from ..core import winhost
|
||||
|
||||
rift = g.get("kind") == "rift"
|
||||
on_pc = pkg in self.pc_installs()
|
||||
stale = on_pc and C.pc_outdated(g, self.pc_installs()[pkg])
|
||||
pc_label = (tr("Update on this PC") if stale else tr("Reinstall on this PC") if on_pc
|
||||
@@ -998,8 +999,12 @@ class FramePortApp:
|
||||
pc_opt = (pc_label,
|
||||
G.PC, lambda e: self.install(pkg, "pc"), not winhost.available(),
|
||||
tr("The launch settings changed since the install — update the Steam shortcut.") if stale else
|
||||
None if winhost.available() else tr("Needs Windows (or WSL)."))
|
||||
return [frame_opt, pc_opt] if connected or not winhost.available() else [pc_opt, frame_opt]
|
||||
tr("Needs Windows (or WSL).") if not winhost.available() else
|
||||
None if rift else C.HELP["pc_android"] + (
|
||||
"\n\n" + C.HELP["pc_android_gles"] if pipeline.pc_gles(g) else ""))
|
||||
# Quest games: the Frame stays the main place (the PC path through AXRB is experimental)
|
||||
pc_first = not connected and winhost.available() and (rift or on_pc)
|
||||
return [pc_opt, frame_opt] if pc_first else [frame_opt, pc_opt]
|
||||
|
||||
def play_options(self, g: dict) -> list[tuple]:
|
||||
"""[(label, icon, on_click, disabled, tooltip)] for where the game is installed and can be started now."""
|
||||
@@ -1008,10 +1013,11 @@ class FramePortApp:
|
||||
if self.frame_state == "connected" and C.install_state(g, self.frame_info) in ("installed", "outdated"):
|
||||
out.append((tr("Play on Frame"), ft.Icons.PLAY_ARROW_ROUNDED, lambda e: self.play(pkg, "frame"), False,
|
||||
tr("Starts the game on the Frame — put the headset on.")))
|
||||
if g.get("kind") == "rift" and pkg in self.pc_installs() and \
|
||||
if pipeline.pc_installable(g) and pkg in self.pc_installs() and \
|
||||
not ((g.get("analysis") or {}).get("extra") or {}).get("flat"):
|
||||
out.append((tr("Play on this PC"), ft.Icons.PLAY_ARROW_ROUNDED, lambda e: self.play(pkg, "pc"), False,
|
||||
tr("Starts the game in SteamVR on this PC.")))
|
||||
tr("Starts the game in SteamVR on this PC.") if g.get("kind") == "rift"
|
||||
else tr("Starts the game in SteamVR on this PC, in AXRB's Android emulator.")))
|
||||
return out
|
||||
|
||||
PLAY_COOLDOWN = 20 # s: a second Play while Steam/Lepton still start the game only gets Steam's AppError_16
|
||||
@@ -1162,7 +1168,7 @@ class FramePortApp:
|
||||
st = MenuState(
|
||||
quick=quick, connected=connected, job=busy,
|
||||
on_frame=connected and C.install_state(g, self.frame_info) in ("installed", "outdated"),
|
||||
on_pc=rift and pkg in self.pc_installs(),
|
||||
on_pc=pipeline.pc_installable(g) and pkg in self.pc_installs(),
|
||||
plays=[] if busy or not quick else enabled(self.play_options(g)),
|
||||
installs=[] if busy or not quick else enabled(self.install_options(g)),
|
||||
settings=self.has_game_settings(g), programs=rift or (linux and bool(self.linux_programs(g))),
|
||||
@@ -1267,7 +1273,7 @@ class FramePortApp:
|
||||
|
||||
games = [library.game(p) for p in pkgs]
|
||||
games = [g for g in games if g and not self.jobs.busy_with(g["package"])]
|
||||
skipped = [g for g in games if to == "pc" and g.get("kind") != "rift" or
|
||||
skipped = [g for g in games if to == "pc" and not pipeline.pc_installable(g) or
|
||||
not allow_blocked and g.get("kind") != "rift"
|
||||
and (g.get("recipe") or {}).get("status") == "unsupported"]
|
||||
games = [g for g in games if g not in skipped]
|
||||
@@ -1284,10 +1290,38 @@ class FramePortApp:
|
||||
else:
|
||||
ask_frame_oculus()
|
||||
|
||||
def ask_axrb():
|
||||
# Quest games on this PC: AXRB (+ its Android) is downloaded on first use only, after asking
|
||||
quest = [g for g in games if g.get("kind") != "rift"]
|
||||
if not quest:
|
||||
return ask_obb()
|
||||
from ..tools import axrb
|
||||
|
||||
try:
|
||||
ready = axrb.ready() # either backend set up: AXRB was already agreed to
|
||||
except Exception: # noqa: BLE001 - unknown: ask
|
||||
ready = False
|
||||
if ready:
|
||||
return ask_obb()
|
||||
pick = C.one_choice()
|
||||
|
||||
def ok(e):
|
||||
self.page.pop_dialog()
|
||||
ask_obb()
|
||||
self.page.show_dialog(C.dialog(
|
||||
tr("Set up Quest games on this PC?"),
|
||||
C.body(C.HELP["pc_android"] + "\n\n" +
|
||||
tr("FramePort installs AXRB from its official release (per user, no administrator rights) and "
|
||||
"Google's Android emulator files. AXRB is a separate program with its own licence; "
|
||||
"you can remove it later from Windows' app list.")),
|
||||
[C.ghost(tr("Cancel"), on_click=pick(cancel)),
|
||||
C.primary(tr("Download and install"), on_click=pick(ok))],
|
||||
modal=True, on_dismiss=pick(closed)))
|
||||
|
||||
def ask_frame_oculus():
|
||||
# Installing an Oculus/LibOVR Rift game on the Frame: warn that it needs Revive (which can't run there)
|
||||
if to != "frame":
|
||||
return ask_obb()
|
||||
return ask_axrb()
|
||||
oculus = [g for g in games if g.get("kind") == "rift"
|
||||
and "pcvr.revive" in (g.get("recipe") or {}).get("patches", {})]
|
||||
if not oculus:
|
||||
@@ -1541,7 +1575,7 @@ class FramePortApp:
|
||||
as_is = library.recipe_from_dict(library.game(pkg)["recipe"]).as_is
|
||||
rep.stage("Checking the game" if rift or as_is else "Patching the game")
|
||||
if rift or to != "frame":
|
||||
info = pipeline.build_game(pkg, rep)
|
||||
info = pipeline.build_game(pkg, rep, pc=to == "pc")
|
||||
if not info["ok"]:
|
||||
raise RuntimeError(tr("the game failed its checks (see the list above)"))
|
||||
rep.check_cancel()
|
||||
@@ -1625,7 +1659,7 @@ class FramePortApp:
|
||||
"""[(package, "frame" | "pc")] installs with an update ready (a newer build or changed patch settings)."""
|
||||
out = []
|
||||
frame_ok = self.frame_state == "connected"
|
||||
pc = self.pc_installs() if any(g.get("kind") == "rift" for g in library.games()) else {}
|
||||
pc = self.pc_installs()
|
||||
for g in library.games():
|
||||
pkg = g["package"]
|
||||
if self.jobs.busy_with(pkg):
|
||||
@@ -1957,7 +1991,7 @@ class FramePortApp:
|
||||
|
||||
def _diag_target(self, pkg: str | None):
|
||||
g = library.game(pkg) if pkg else None
|
||||
if g and g.get("kind") == "rift" and pkg in self.pc_installs() and \
|
||||
if g and pipeline.pc_installable(g) and pkg in self.pc_installs() and \
|
||||
C.install_state(g, self.frame_info) not in ("installed", "outdated"):
|
||||
return self._target_for("pc")
|
||||
return self.target if self.frame_state == "connected" else None
|
||||
|
||||
@@ -206,9 +206,16 @@ def recipe_changed(game: dict) -> bool:
|
||||
|
||||
|
||||
def pc_outdated(g: dict, dep: dict) -> bool:
|
||||
"""A PC install whose launch settings (pcvr patches + their parameters) differ from the game's recipe now."""
|
||||
"""A PC install whose launch settings (pcvr patches + their parameters) differ from the game's recipe now. Quest
|
||||
games (AXRB): the patches of their build for this PC."""
|
||||
installed = set((dep.get("recipe") or {}).get("patches") or [])
|
||||
want = set((g.get("recipe") or {}).get("patches") or {})
|
||||
if dep.get("kind") == "android":
|
||||
from ..core.library import analysis_from_dict
|
||||
from ..patches.base import pc_selection
|
||||
|
||||
analysis = analysis_from_dict(g["analysis"]) if g.get("analysis") else None
|
||||
return installed != set(pc_selection({p: {} for p in want}, analysis))
|
||||
from ..core.library import recipe_from_dict
|
||||
from ..patches.pcvr import game_args
|
||||
|
||||
|
||||
@@ -130,6 +130,13 @@ HELP: dict[str, str] = _Translated({
|
||||
"next time it starts.",
|
||||
"frame_summary": "Quest ✓: Lepton is installed, so Quest games can run. PC VR ✓: Proton is installed, so PC VR "
|
||||
"games can run on the Frame.",
|
||||
"pc_android": "Experimental: runs the game on this PC in AXRB (Android XR Bridge), an Android emulator that shows "
|
||||
"Android VR games through SteamVR. The first install downloads AXRB and its Android (about 2.5 GB) "
|
||||
"and needs Windows Hypervisor Platform, an NVIDIA or AMD graphics card and 12 GB of memory. Many "
|
||||
"games don't work in AXRB yet.",
|
||||
"pc_android_gles": "This game draws with OpenGL ES. AXRB's emulator copies such pictures to the PC frame by frame, "
|
||||
"so FramePort renders them at half size: expect about 30 frames per second at best, less with "
|
||||
"a high SteamVR resolution. Vulkan games don't have this limit.",
|
||||
# ---- settings
|
||||
"data_folder": "FramePort's tools, library, artwork and your games' signing keys. Back it up: an update needs the "
|
||||
"same key, or the game must be reinstalled and loses its saves.",
|
||||
|
||||
@@ -25,7 +25,7 @@ class MenuState:
|
||||
quick: bool = True # True: Library right-click (quick_menu); False: the game page's full "…" menu
|
||||
connected: bool = False # a Frame is connected
|
||||
on_frame: bool = False # installed on the Frame (current or outdated)
|
||||
on_pc: bool = False # a PC VR game installed on this PC
|
||||
on_pc: bool = False # installed on this PC (a PC VR game, or a Quest game through AXRB)
|
||||
job: bool = False # a job runs (or waits) for this game
|
||||
plays: list = field(default_factory=list) # where it can be started now [(label, icon, handler)]
|
||||
installs: list = field(default_factory=list) # install/update/reinstall options [(label, icon, handler)]
|
||||
|
||||
@@ -91,7 +91,7 @@ class GameView:
|
||||
st = C.install_state(g, app.frame_info)
|
||||
if st in ("installed", "outdated"):
|
||||
chips.append(C.install_badge(st))
|
||||
if self.rift and pkg in app.pc_installs():
|
||||
if pkg in app.pc_installs():
|
||||
chips.append(C.install_badge("on_pc"))
|
||||
actions = self.actions()
|
||||
self._wash = ft.Container(left=0, right=0, top=0, bottom=0, border_radius=T.RADIUS) # cover tint (_tint)
|
||||
@@ -269,6 +269,20 @@ class GameView:
|
||||
lambda e: app.test_game(pkg, "pc")),
|
||||
C.icon_btn(ft.Icons.DELETE_OUTLINE_ROUNDED, tr("Uninstall from this PC…"),
|
||||
lambda e: app.uninstall(pkg, "pc"))] if dep else [])))
|
||||
elif app.pc_installs().get(pkg): # a Quest game also installed on this PC (AXRB, experimental)
|
||||
dep = app.pc_installs()[pkg]
|
||||
stale = C.pc_outdated(g, dep)
|
||||
cards.append(self.target_card(
|
||||
G.PC, tr("This PC (AXRB, experimental)"),
|
||||
tr("In your Steam library · patches changed — update it") if stale else tr("In your Steam library"),
|
||||
T.WARN if stale else T.PC, (tr("AXRB {value} · direct mode (no emulator)")
|
||||
if dep.get("backend") == "direct" else
|
||||
tr("AXRB {value} · Android emulator")).format(
|
||||
value=dep.get("axrb_version") or ""),
|
||||
log_button(True) + [C.icon_btn(G.TEST, tr("Launch test on this PC"),
|
||||
lambda e: app.test_game(pkg, "pc")),
|
||||
C.icon_btn(ft.Icons.DELETE_OUTLINE_ROUNDED, tr("Remove from this PC"),
|
||||
lambda e: app.uninstall(pkg, "pc"))]))
|
||||
return C.section(tr("Where it's installed"), ft.Row(cards, spacing=T.S3), help="where")
|
||||
|
||||
def target_card(self, icon, name, line, color, sub, buttons) -> ft.Control:
|
||||
|
||||
@@ -702,7 +702,7 @@ class LibraryView:
|
||||
has_rift = any(g.get("kind") == "rift" for g in games)
|
||||
platforms = platform_filter_options(games)
|
||||
where = [("all", tr("All")), ("frame", tr("On Frame")), ("none", tr("Not installed"))]
|
||||
if has_rift:
|
||||
if has_rift or n_pc: # Quest games can be on this PC too (AXRB)
|
||||
where.insert(2, ("pc", tr("On this PC")))
|
||||
# the filters wrap onto a second line in a narrow window; count and sort stay on the right
|
||||
left = ft.Row([
|
||||
|
||||
@@ -122,9 +122,10 @@ def grid_files(grid: Path, appid) -> list[Path]:
|
||||
|
||||
|
||||
def remove_pc_shortcuts(reporter: Reporter) -> None:
|
||||
"""All PC VR shortcuts FramePort added to Windows Steam, with one Steam restart."""
|
||||
"""All PC shortcuts (PC VR and Quest games) FramePort added to Windows Steam, with one Steam restart. AXRB and
|
||||
the games inside its Android stay: AXRB is the user's program (uninstall it from Windows' app list)."""
|
||||
from .core import winhost
|
||||
from .targets.pc_revive import _vdf, local_installs, shortcut_fields
|
||||
from .targets.pc_revive import _vdf, local_installs, options_key, shortcut_fields
|
||||
|
||||
deps = local_installs()
|
||||
if not deps or not winhost.available():
|
||||
@@ -140,7 +141,7 @@ def remove_pc_shortcuts(reporter: Reporter) -> None:
|
||||
try:
|
||||
for pkg, dep in deps.items():
|
||||
exe = shortcut_fields(dep)[0]
|
||||
removed = vdf_mod.remove_shortcut(str(cfg / "shortcuts.vdf"), exe)
|
||||
removed = vdf_mod.remove_shortcut(str(cfg / "shortcuts.vdf"), exe, options_key(dep))
|
||||
for art in grid_files(cfg / "grid", dep.get("appid")):
|
||||
art.unlink(missing_ok=True)
|
||||
reporter.check(f"Steam shortcut: {dep.get('title') or pkg}", True if removed else None,
|
||||
|
||||
@@ -117,12 +117,14 @@ def split_suggestion(s: str) -> tuple[str, str | None]:
|
||||
|
||||
|
||||
def triage(log: str, state: str = "UNKNOWN", package: str | None = None, crash: str = "",
|
||||
kernel: str = "", headless: bool = False) -> TriageResult:
|
||||
kernel: str = "", headless: bool = False, kind: str | None = None) -> TriageResult:
|
||||
"""`crash` = the container's crash logcat (tombstones come from crash_dump's pid, so it isn't pid-filtered);
|
||||
`kernel` = kernel log lines of a play session ("kernel: …", GPU hangs; agent session_log); `headless` = a launch
|
||||
test (no headset worn): what happens after a `headless_end` line doesn't count against the game."""
|
||||
test (no headset worn): what happens after a `headless_end` line doesn't count against the game. `kind`: which
|
||||
signatures apply ("quest" Lepton logcat, "pcvr" Proton/Revive, "axrb" a Quest game on this PC); default from
|
||||
the package."""
|
||||
db = database()
|
||||
kind = "pcvr" if package and package.startswith("rift.") else "quest" # Proton/Revive logs vs Lepton logcat
|
||||
kind = kind or ("pcvr" if package and package.startswith("rift.") else "quest")
|
||||
lines = game_lines(log, package) if kind == "quest" else [ANSI.sub("", ln) for ln in log.splitlines()]
|
||||
lines += [ANSI.sub("", ln) for ln in crash.splitlines()]
|
||||
lines += [ANSI.sub("", ln) for ln in kernel.splitlines()]
|
||||
@@ -155,6 +157,8 @@ def triage(log: str, state: str = "UNKNOWN", package: str | None = None, crash:
|
||||
res.findings = [f for f in res.findings if f.id not in hidden]
|
||||
if headless:
|
||||
_forgive_headless_end(res, lines, db.get("headless_end") or [])
|
||||
if kind == "axrb" and state == "RUNNING":
|
||||
_forgive_axrb_stop(res, lines)
|
||||
fps = re.findall(r"pacing: ([0-9.]+) fps", text)
|
||||
if fps:
|
||||
res.fps = float(fps[-1])
|
||||
@@ -208,6 +212,37 @@ def _forgive_headless_end(res: TriageResult, lines: list[str], markers: list[dic
|
||||
lines[at].strip()[:300]))
|
||||
|
||||
|
||||
AXRB_STOPPED = re.compile(r"^AXRB_AOSP_ACTIVITIES_STOPPED")
|
||||
|
||||
|
||||
def _forgive_axrb_stop(res: TriageResult, lines: list[str]) -> None:
|
||||
"""A PC launch test in AXRB's direct mode that ran its full time ends with AXRB's own stop (stop_game.ps1: the
|
||||
activities pause and stop, AXRB_AOSP_ACTIVITIES_STOPPED). A crash after that line is the game's shutdown, not
|
||||
its play (The Climb 2: SIGSEGV in libc after "ovr_Shutdown finished"): such findings become one info finding.
|
||||
Order is judged inside direct.log, which has the guest's lines and the runner's crash report in one stream."""
|
||||
start = next((i for i, ln in enumerate(lines) if ln.startswith("===== ") and "direct.log" in ln), None)
|
||||
if start is None:
|
||||
return
|
||||
end = next((i for i in range(start + 1, len(lines)) if lines[i].startswith("===== ")), len(lines))
|
||||
section = lines[start + 1:end]
|
||||
at = next((i for i, ln in enumerate(section) if AXRB_STOPPED.match(ln.strip())), None)
|
||||
if at is None:
|
||||
return
|
||||
|
||||
def late(f: Finding) -> bool:
|
||||
i = next((i for i, ln in enumerate(section) if f.evidence and f.evidence in ln.strip()), None)
|
||||
return i is not None and i > at and f.severity == "fatal"
|
||||
|
||||
after = [f for f in res.findings if late(f)]
|
||||
if not after:
|
||||
return
|
||||
res.findings = [f for f in res.findings if f not in after]
|
||||
res.findings.append(Finding(
|
||||
"axrb-direct-crash-at-stop", "info",
|
||||
"The game ran for the whole test; it crashed only while AXRB stopped it at the end ("
|
||||
+ ", ".join(f.id for f in after) + "), which doesn't affect play.", [], section[at].strip()[:300]))
|
||||
|
||||
|
||||
def _secs(line: str) -> float | None:
|
||||
m = LOGCAT_TIME.match(line)
|
||||
return int(m[1]) * 3600 + int(m[2]) * 60 + int(m[3]) + int(m[4]) / 1000 if m else None
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
"""GL shim: stand-ins for GPU timer queries a driver lacks (AXRB's emulator: gfxstream GLES has no
|
||||
GL_EXT_disjoint_timer_query; Path of the Warrior's GLAD loader called a NULL glGenQueriesEXT)."""
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from test_blazerush import FIXTURES, ROOT, _cc, _khronos_headers
|
||||
|
||||
HOST_TEST = r'''
|
||||
#include <EGL/egl.h>
|
||||
#include <GLES3/gl3.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
typedef void *(*GPA)(const char *);
|
||||
#define CHECK(c) do { if (!(c)) { printf("FAIL line %d\n", __LINE__); return 1; } } while (0)
|
||||
int main(int argc, char **argv) {
|
||||
(void)argc;
|
||||
void *shim = dlopen(argv[1], RTLD_NOW);
|
||||
CHECK(shim);
|
||||
GPA gpa = (GPA)dlsym(shim, "eglGetProcAddress");
|
||||
void (*gen)(GLsizei, GLuint *) = (void (*)(GLsizei, GLuint *))gpa("glGenQueriesEXT");
|
||||
void (*objuiv)(GLuint, GLenum, GLuint *) = (void (*)(GLuint, GLenum, GLuint *))gpa("glGetQueryObjectuivEXT");
|
||||
void (*objui64v)(GLuint, GLenum, GLuint64 *) =
|
||||
(void (*)(GLuint, GLenum, GLuint64 *))gpa("glGetQueryObjectui64vEXT");
|
||||
void (*getiv)(GLenum, GLint *) = (void (*)(GLenum, GLint *))gpa("glGetIntegerv");
|
||||
CHECK(gen && objuiv && objui64v && gpa("glQueryCounterEXT") && gpa("glGetInteger64vEXT"));
|
||||
CHECK(!gpa("glNoSuchFunctionEXT")); // only the timer-query names get stand-ins
|
||||
GLuint ids[2] = {0, 0};
|
||||
gen(2, ids);
|
||||
CHECK(ids[0] && ids[1] && ids[0] != ids[1]);
|
||||
GLuint avail = 0; GLuint64 ns = 99;
|
||||
objuiv(ids[0], 0x8867 /* GL_QUERY_RESULT_AVAILABLE */, &avail);
|
||||
objui64v(ids[0], 0x8866 /* GL_QUERY_RESULT */, &ns);
|
||||
CHECK(avail == 1 && ns == 0);
|
||||
GLint disjoint = 7;
|
||||
getiv(0x8FBB /* GL_GPU_DISJOINT_EXT */, &disjoint);
|
||||
CHECK(disjoint == 0);
|
||||
// listed, so GLAD loaders look the functions up at all
|
||||
const GLubyte *(*gs)(GLenum) = (const GLubyte *(*)(GLenum))gpa("glGetString");
|
||||
const GLubyte *(*gsi)(GLenum, GLuint) = (const GLubyte *(*)(GLenum, GLuint))gpa("glGetStringi");
|
||||
CHECK(strstr((const char *)gs(GL_EXTENSIONS), "GL_EXT_disjoint_timer_query"));
|
||||
GLint n = 0;
|
||||
getiv(GL_NUM_EXTENSIONS, &n);
|
||||
CHECK(n > 0 && !strcmp((const char *)gsi(GL_EXTENSIONS, (GLuint)(n - 1)), "GL_EXT_disjoint_timer_query"));
|
||||
CHECK(gsi(GL_EXTENSIONS, (GLuint)n) == NULL);
|
||||
printf("OK\n");
|
||||
return 0;
|
||||
}
|
||||
'''
|
||||
|
||||
|
||||
def test_timer_query_standins(tmp_path):
|
||||
cc = _cc()
|
||||
inc = _khronos_headers(tmp_path / "include")
|
||||
src, out = FIXTURES / "src", tmp_path / "lib"
|
||||
out.mkdir()
|
||||
warn = ["-Wall", "-Wextra", "-Werror"]
|
||||
subprocess.run([cc, "-std=gnu11", *warn, "-shared", "-fPIC", "-fvisibility=hidden", "-I", str(inc),
|
||||
str(src / "glshim_fake_gles.c"), "-Wl,-soname,libglshim_fake.so", "-ldl",
|
||||
"-o", str(out / "libglshim_fake.so")], check=True)
|
||||
subprocess.run([cc, "-std=gnu11", *warn, "-Wno-unused-function", "-Wno-unused-variable",
|
||||
"-Wno-unused-but-set-variable", "-Wno-incompatible-pointer-types", "-shared", "-fPIC",
|
||||
"-fvisibility=hidden", "-DEGL_NO_X11", '-DGLSHIM_GLES_LIB="libglshim_fake.so"',
|
||||
'-DGLSHIM_EGL_LIB="libglshim_fake.so"', "-I", str(src / "host_include"), "-I", str(inc),
|
||||
str(ROOT / "native/glshim/glshim.c"), "-Wl,--no-as-needed", "-L", str(out), "-lglshim_fake",
|
||||
"-Wl,--as-needed", "-Wl,-rpath,$ORIGIN", "-ldl", "-lpthread",
|
||||
"-o", str(out / "libglshim_host.so")], check=True)
|
||||
(tmp_path / "t.c").write_text(HOST_TEST)
|
||||
subprocess.run([cc, "-std=gnu11", *warn, "-DEGL_NO_X11", "-I", str(src / "host_include"), "-I", str(inc),
|
||||
str(tmp_path / "t.c"), "-ldl", "-o", str(out / "t")], check=True)
|
||||
env = {k: v for k, v in os.environ.items() if k != "FRAMEBRIDGE_CONFIG"}
|
||||
run = subprocess.run([str(out / "t"), str(out / "libglshim_host.so")], capture_output=True, text=True, env=env)
|
||||
assert run.returncode == 0 and "OK" in run.stdout, run.stdout + run.stderr
|
||||
assert "no GPU timer queries in this driver: glGenQueriesEXT" in run.stderr
|
||||
@@ -636,6 +636,19 @@ def test_stand_ins_count_only_when_the_loader_links_them(monkeypatch):
|
||||
assert detect.missing_ovr_symbols(libs) == set()
|
||||
|
||||
|
||||
def test_vrapi_vulkan_from_engine_imports(monkeypatch):
|
||||
"""A direct-VrApi engine that creates VrApi's Vulkan system renders with Vulkan (The Climb 2's
|
||||
libCryOculusMobileVR.so); libvrapi.so's own exports and GLES engines (Path of the Warrior) don't count."""
|
||||
from frameport.analysis import detect
|
||||
|
||||
imports = {b"cry": {"vrapi_Initialize", "vrapi_CreateSystemVulkan"}, b"potw": {"vrapi_Initialize"},
|
||||
b"vrapi": {"vrapi_CreateSystemVulkan"}}
|
||||
monkeypatch.setattr(detect.elf, "is_elf", lambda d: True)
|
||||
monkeypatch.setattr(detect.elf, "dyn_symbols", lambda d, defined: set() if defined else imports[d])
|
||||
assert detect.vrapi_vulkan({"libCryOculusMobileVR.so": b"cry", "libvrapi.so": b"vrapi"})
|
||||
assert not detect.vrapi_vulkan({"libpotw.so": b"potw", "libvrapi.so": b"vrapi"})
|
||||
|
||||
|
||||
def test_start_activity_after_overport_conversion(tmp_path):
|
||||
"""OVRPort gives every MAIN activity LAUNCHER + VR categories (WiiCompiled: LauncherActivity and QuestActivity),
|
||||
so the VR activity must come from the original APK's analysis; only it may stay a launcher."""
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,43 @@
|
||||
"""GLES Quest games in the build for this PC (AXRB's emulator: eye images travel as pixels)."""
|
||||
from frameport.core.models import Analysis
|
||||
from frameport.patches import base
|
||||
|
||||
|
||||
def analysis(graphics, **extra):
|
||||
return Analysis(package="p", version="1", label="P", abis=["arm64-v8a"], engine="Unity", xr="OpenXR",
|
||||
graphics=graphics, direct_vrapi=False, libs=["libil2cpp.so"], launcher_activity=None,
|
||||
has_info_category=False, meta_permissions=[], uses_glad_gl=False, unity_msaa_levels=0,
|
||||
oculus_os_classes=False, is_overport_output=False, debuggable=False, extra=extra)
|
||||
|
||||
|
||||
def test_gles_games_get_half_size_eyes_and_multipass_on_the_pc():
|
||||
"""The PC build caps FrameBridge's scale at 0.5 for GLES (Lucky's Tale 9 -> 30 fps); Vulkan games (shared GPU
|
||||
images) keep theirs; Unity GLES + Oculus XR Plugin renders multipass (gfxstream drops multiview draws)."""
|
||||
gles, vulkan = analysis("GLES or unknown (no Vulkan declaration)", oculus_xr_plugin=True), analysis("Vulkan (x)")
|
||||
recipe = {"frame.adapter": {}, "adapter.scale": {"value": 1.2}}
|
||||
sel = base.pc_selection(recipe, gles)
|
||||
assert sel["adapter.scale"] == {"value": 0.5} and "frame.unity_multipass" in sel
|
||||
assert sel["adapter.projection_only"] == {"value": 1} # AXRB rejects multi-layer GLES frames
|
||||
assert sel["adapter.scale_max"] == {"value": 1}
|
||||
from frameport.patches.frame.adapter import settings_text
|
||||
assert b"projection_only=1" in settings_text(sel)
|
||||
assert base.pc_selection(sel, gles) == sel # idempotent
|
||||
assert base.pc_selection({"frame.adapter": {}}, gles)["adapter.scale"] == {"value": 0.5}
|
||||
assert base.pc_selection({"frame.adapter": {}, "adapter.scale": {"value": 0.6}}, gles)["adapter.scale"] == {
|
||||
"value": 0.5}
|
||||
vk = base.pc_selection(recipe, vulkan)
|
||||
assert vk["adapter.scale"] == {"value": 1.2} and "frame.unity_multipass" not in vk
|
||||
assert "adapter.projection_only" not in vk
|
||||
plain = analysis("GLES or unknown (no Vulkan declaration)", oculus_xr_plugin=False) # built-in VR: no plugin
|
||||
assert "frame.unity_multipass" not in base.pc_selection({"frame.adapter": {}}, plain)
|
||||
assert "frame.unity_multipass" not in base.pc_selection({"frame.adapter": {}}) # no analysis: the recipe only
|
||||
|
||||
|
||||
def test_pc_gles_note():
|
||||
from frameport import pipeline
|
||||
from frameport.ui.help import HELP
|
||||
|
||||
assert pipeline.pc_gles({"analysis": {"graphics": "GLES or unknown (no Vulkan declaration)"}})
|
||||
assert not pipeline.pc_gles({"analysis": {"graphics": "Vulkan (libvulkan.so)"}})
|
||||
assert not pipeline.pc_gles({"kind": "rift", "analysis": {"graphics": "GLES"}})
|
||||
assert "half size" in HELP["pc_android_gles"]
|
||||
@@ -510,3 +510,27 @@ def test_obb_and_cube_advice_describes_limits():
|
||||
advice = next(f for f in cube.findings if f.id == "cube-swapchain-refused")
|
||||
assert "GLES" in advice.diagnosis
|
||||
assert "For a Vulkan game, the current build cannot stand in" in advice.diagnosis
|
||||
|
||||
|
||||
def test_axrb_direct_crash_after_the_tests_stop_is_forgiven():
|
||||
"""The Climb 2 in AXRB's direct mode: frames for the whole test, then a SIGSEGV after AXRB's own stop."""
|
||||
log = "\n".join(["===== direct.out", "AXRB_AOSP_ACTIVITY_CREATED com.crytek.cryengine.EngineActivity",
|
||||
"===== direct.log", "AXRB_AOSP_ACTIVITY_CREATED com.crytek.cryengine.EngineActivity",
|
||||
"I/Cry( 4252): [HMD][MobileOculus] ovr_Shutdown finished", "AXRB_AOSP_ACTIVITIES_STOPPED",
|
||||
" 108.109 81152 E/cpu: thread 4262 (Main): fatal signal 11 (SIGSEGV), code 2, fault addr 52"])
|
||||
res = triage(log, "RUNNING", "com.crytek.climb2", kind="axrb")
|
||||
assert [f.id for f in res.findings] == ["axrb-direct-crash-at-stop"] and res.verdict == "pass"
|
||||
early = log.replace("AXRB_AOSP_ACTIVITIES_STOPPED\n", "") + "\nAXRB_AOSP_ACTIVITIES_STOPPED"
|
||||
late = triage(early, "RUNNING", "com.crytek.climb2", kind="axrb")
|
||||
assert "axrb-direct-guest-crash" in [f.id for f in late.findings]
|
||||
|
||||
|
||||
def test_axrb_direct_cryengine_without_android_vulkan_extensions():
|
||||
log = ("I/Cry( 4252): Renderer initialization\n"
|
||||
"I/Cry( 4252): Device Extensions to enable: VK_EXT_queue_family_foreign\n"
|
||||
"I/Cry( 4252): Messagebox: cap: Engine initialization failed! text:CrySystem initialization failed!\n"
|
||||
"AXRB_AOSP_HOST_SURFACES 0\nI/Cry( 4252): App Event: APP_CMD_INIT_WINDOW")
|
||||
ids = [f.id for f in triage(log, "EXITED", "com.crytek.climb2", kind="axrb").findings]
|
||||
assert "axrb-direct-vulkan-extensions" in ids and "axrb-direct-no-native-window" not in ids
|
||||
stuck = "AXRB_AOSP_HOST_SURFACES 0\nI/Cry( 4252): Loading plug-in CryHTTP"
|
||||
assert "axrb-direct-no-native-window" in [f.id for f in triage(stuck, "RUNNING", "p", kind="axrb").findings]
|
||||
@@ -331,7 +331,7 @@ def test_install_builds_a_game_that_was_never_built(tmp_path, monkeypatch):
|
||||
out = tmp_path / "built.apk"
|
||||
out.write_bytes(b"PK")
|
||||
|
||||
def build(package, reporter):
|
||||
def build(package, reporter, pc=False):
|
||||
library.upsert_game(package, build={"apk": str(out)})
|
||||
monkeypatch.setattr(pipeline, "build_game", build)
|
||||
monkeypatch.setattr(pipeline, "remove_converted_copies", lambda package: 0)
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
"""Unreal's Vulkan RHI from the manifest (GameActivity.bSupportsVulkan): Unreal games never declare
|
||||
android.hardware.vulkan, so they were all "GLES or unknown" and AXRB's automatic backend sent them to the emulator."""
|
||||
from __future__ import annotations
|
||||
|
||||
import zipfile
|
||||
|
||||
import pytest
|
||||
from conftest import build_axml
|
||||
|
||||
from frameport.analysis import detect
|
||||
from frameport.targets import pc_android
|
||||
from frameport.tools import axrb
|
||||
|
||||
|
||||
def _apk(tmp_path, *, key="com.epicgames.ue4.GameActivity.bSupportsVulkan", value=True, kind="bool",
|
||||
engine_lib="libUE4.so"):
|
||||
meta = []
|
||||
if key is not None:
|
||||
meta = [("start", "meta-data", [("name", "str", key), ("value", kind, value)]), ("end", "meta-data")]
|
||||
manifest = build_axml([
|
||||
("start", "manifest", [("package", "str", "com.example.unrealgame")]),
|
||||
("start", "application", []),
|
||||
("start", "meta-data", [("name", "str", "com.epicgames.ue4.GameActivity.bHasOBBFiles"), ("value", "bool", True)]),
|
||||
("end", "meta-data"),
|
||||
*meta,
|
||||
("end", "application"),
|
||||
("end", "manifest"),
|
||||
])
|
||||
p = tmp_path / "game.apk"
|
||||
with zipfile.ZipFile(p, "w") as z:
|
||||
z.writestr("AndroidManifest.xml", manifest)
|
||||
z.writestr("classes.dex", b"dex\n035\0")
|
||||
z.writestr(f"lib/arm64-v8a/{engine_lib}", b"")
|
||||
z.writestr("lib/arm64-v8a/libOVRPlugin.so", b"")
|
||||
return p
|
||||
|
||||
|
||||
@pytest.mark.parametrize("key", ["com.epicgames.ue4.GameActivity.bSupportsVulkan",
|
||||
"com.epicgames.unreal.GameActivity.bSupportsVulkan"])
|
||||
@pytest.mark.parametrize("engine_lib", ["libUE4.so", "libUnreal.so"])
|
||||
def test_unreal_vulkan_build_is_vulkan(tmp_path, key, engine_lib):
|
||||
a = detect.analyze(_apk(tmp_path, key=key, engine_lib=engine_lib), deep=False)
|
||||
assert a.engine == "Unreal"
|
||||
assert a.graphics == "Vulkan (Unreal bSupportsVulkan)"
|
||||
assert pc_android.choose_backend(None, a.graphics) == axrb.DIRECT
|
||||
|
||||
|
||||
@pytest.mark.parametrize("key,value,kind", [
|
||||
("com.epicgames.ue4.GameActivity.bSupportsVulkan", False, "bool"), # GLES-only UE 4.21+ build (Espire 1)
|
||||
(None, None, None), # UE 4.19/4.20 write nothing (Vader Immortal, Time Stall)
|
||||
("com.epicgames.ue4.GameActivity.bSupportsVulkan", "true", "str"), # not a boolean: GameActivity reads false
|
||||
("com.example.GameActivity.bSupportsVulkan", True, "bool"), # not Unreal's key
|
||||
])
|
||||
def test_gles_unreal_builds_stay_gles(tmp_path, key, value, kind):
|
||||
a = detect.analyze(_apk(tmp_path, key=key, value=value, kind=kind), deep=False)
|
||||
assert a.graphics.startswith("GLES")
|
||||
assert pc_android.choose_backend(None, a.graphics) == axrb.EMULATOR
|
||||
|
||||
|
||||
def test_key_only_counts_for_unreal(tmp_path):
|
||||
a = detect.analyze(_apk(tmp_path, engine_lib="libunity.so"), deep=False)
|
||||
assert a.engine == "Unity" and a.graphics.startswith("GLES")
|
||||
|
||||
|
||||
def test_analysis_version_bumped():
|
||||
assert detect.ANALYSIS_VERSION >= 20
|
||||
@@ -0,0 +1,159 @@
|
||||
"""Headset-free OpenXR on the PC (tools/xr_sim.py: Monado's simulated HMD) against fakes; no Windows needed."""
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from frameport.core import winhost
|
||||
from frameport.core.events import Reporter
|
||||
from frameport.tools import axrb, xr_sim
|
||||
|
||||
|
||||
def fake_monado(base: Path) -> Path:
|
||||
d = base / "install"
|
||||
(d / "bin").mkdir(parents=True)
|
||||
(d / "bin" / "monado-service.exe").write_bytes(b"MZ")
|
||||
(d / "openxr_monado.json").write_text('{"runtime": {"library_path": "bin\\\\openxr_monado.dll"}}')
|
||||
return d
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def win(monkeypatch, tmp_path):
|
||||
monkeypatch.setattr(winhost, "available", lambda: True)
|
||||
monkeypatch.setattr(winhost, "to_windows", lambda p: "W:" + str(p).replace("/", "\\"))
|
||||
monkeypatch.setattr(winhost, "env_path", lambda name: tmp_path / "Local" if name == "LOCALAPPDATA" else None)
|
||||
monkeypatch.delenv("FRAMEPORT_MONADO_DIR", raising=False)
|
||||
monkeypatch.delenv(xr_sim.ENV_FLAG, raising=False)
|
||||
monkeypatch.setattr(xr_sim, "_active", None)
|
||||
return tmp_path
|
||||
|
||||
|
||||
def test_enabled_by_flag_or_env(monkeypatch):
|
||||
monkeypatch.delenv(xr_sim.ENV_FLAG, raising=False)
|
||||
assert not xr_sim.enabled() and not xr_sim.enabled(False) and xr_sim.enabled(True)
|
||||
monkeypatch.setenv(xr_sim.ENV_FLAG, "1")
|
||||
assert xr_sim.enabled()
|
||||
|
||||
|
||||
def test_finds_the_portable_monado(win, monkeypatch):
|
||||
assert xr_sim.monado_dir() is None
|
||||
d = fake_monado(win / "Local" / "FramePort-dev" / "monado")
|
||||
assert xr_sim.monado_dir() == d
|
||||
other = fake_monado(win / "elsewhere")
|
||||
monkeypatch.setenv("FRAMEPORT_MONADO_DIR", str(other)) # the folder with `install`, or `install` itself
|
||||
assert xr_sim.monado_dir() == other
|
||||
assert xr_sim.client_env() == {"XR_RUNTIME_JSON": "W:" + str(other / "openxr_monado.json").replace("/", "\\"),
|
||||
"AXRB_TEST_SYNTHETIC_HMD": "2"} # a tracked head + LOCAL origin for AXRB
|
||||
|
||||
|
||||
def test_missing_monado_is_explained(win):
|
||||
with pytest.raises(xr_sim.XrSimError, match="Testing without a headset"):
|
||||
xr_sim.start()
|
||||
|
||||
|
||||
def test_service_command_sets_only_monados_settings(win):
|
||||
d = fake_monado(win / "m")
|
||||
cmd = xr_sim.service_command(d, r"C:\logs\svc.log")
|
||||
assert "$env:SIMULATED_ENABLE = '1'" in cmd and "$env:SIMULATED_LEFT = 'ml2'" in cmd
|
||||
assert "$env:XRT_COMPOSITOR_DEFAULT_FRAMERATE = '72'" in cmd and "XRT_COMPOSITOR_NULL" not in cmd
|
||||
assert "monado-service.exe'" in cmd and r"-RedirectStandardError 'C:\logs\svc.log'" in cmd
|
||||
assert "XR_RUNTIME_JSON" not in cmd # the service needs no loader; nothing about SteamVR either
|
||||
assert "steam" not in cmd.lower()
|
||||
assert "$env:XRT_COMPOSITOR_NULL = '1'" in xr_sim.service_command(d, "x", headless=True)
|
||||
|
||||
|
||||
def test_launcher_prefix_and_steamvr_shim():
|
||||
assert xr_sim.launcher_prefix({}) == ""
|
||||
pre = xr_sim.launcher_prefix({"XR_RUNTIME_JSON": r"C:\M\openxr_monado.json", "A": "it's"})
|
||||
assert pre.startswith(r"$env:XR_RUNTIME_JSON = 'C:\M\openxr_monado.json'; $env:A = 'it''s'; ")
|
||||
assert "steamvr_app_identity" in pre and "function python" in pre
|
||||
assert "steamvr" not in xr_sim.launcher_prefix({"A": "1"}).lower()
|
||||
|
||||
|
||||
def test_running_starts_registers_and_stops(win, monkeypatch):
|
||||
fake_monado(win / "Local" / "FramePort-dev" / "monado")
|
||||
monkeypatch.setenv("FRAMEPORT_HOME", str(win / "home"))
|
||||
calls, pipe = [], iter([False, False, True])
|
||||
monkeypatch.setattr(xr_sim, "pipe_open", lambda: next(pipe))
|
||||
monkeypatch.setattr(axrb, "spawn_detached", lambda cmd: calls.append(("spawn", cmd)) or 4242)
|
||||
monkeypatch.setattr(xr_sim.time, "sleep", lambda s: None)
|
||||
monkeypatch.setattr(winhost, "system32", lambda exe: exe)
|
||||
monkeypatch.setattr(winhost, "run_win", lambda args, timeout=30: calls.append(("run", args))
|
||||
or subprocess.CompletedProcess(args, 0, "", ""))
|
||||
assert xr_sim.active_env() == {}
|
||||
with xr_sim.running(False):
|
||||
assert xr_sim.active_env() == {} and not calls
|
||||
with xr_sim.running(True, reporter=Reporter()) as svc:
|
||||
assert svc.pid == 4242
|
||||
env = xr_sim.active_env()
|
||||
assert env["XR_RUNTIME_JSON"].endswith(r"monado\install\openxr_monado.json")
|
||||
assert env["AXRB_CAPTURE_PREFIX"].startswith("W:") and env["AXRB_CAPTURE_FIRST_SEQUENCE"] == "300"
|
||||
assert xr_sim.active_env() == {}
|
||||
assert calls[0][0] == "spawn" and "SIMULATED_ENABLE" in calls[0][1]
|
||||
assert calls[-1] == ("run", ["taskkill.exe", "/PID", "4242", "/T", "/F"])
|
||||
|
||||
|
||||
def test_a_running_service_is_used_and_left_alone(win, monkeypatch):
|
||||
fake_monado(win / "Local" / "FramePort-dev" / "monado")
|
||||
monkeypatch.setenv("FRAMEPORT_HOME", str(win / "home"))
|
||||
monkeypatch.setattr(xr_sim, "pipe_open", lambda: True)
|
||||
monkeypatch.setattr(axrb, "spawn_detached", lambda cmd: pytest.fail("started a second service"))
|
||||
monkeypatch.setattr(winhost, "run_win", lambda *a, **k: pytest.fail("stopped someone else's service"))
|
||||
with xr_sim.running(True, captures=False):
|
||||
assert set(xr_sim.active_env()) == {"XR_RUNTIME_JSON", "AXRB_TEST_SYNTHETIC_HMD"}
|
||||
|
||||
|
||||
def test_failed_start_is_cleaned_up(win, monkeypatch):
|
||||
fake_monado(win / "Local" / "FramePort-dev" / "monado")
|
||||
monkeypatch.setenv("FRAMEPORT_HOME", str(win / "home"))
|
||||
monkeypatch.setattr(xr_sim, "pipe_open", lambda: False)
|
||||
killed = []
|
||||
|
||||
def spawn(cmd):
|
||||
xr_sim.log_path().write_text("ERROR [p_create_system] no system\nServer exiting: '-1'\n")
|
||||
return 7
|
||||
|
||||
monkeypatch.setattr(axrb, "spawn_detached", spawn)
|
||||
monkeypatch.setattr(winhost, "system32", lambda exe: exe)
|
||||
monkeypatch.setattr(winhost, "run_win", lambda args, timeout=30: killed.append(args)
|
||||
or subprocess.CompletedProcess(args, 0, "", ""))
|
||||
with pytest.raises(xr_sim.XrSimError, match="Server exiting"):
|
||||
xr_sim.start()
|
||||
assert killed and killed[0][1:3] == ["/PID", "7"]
|
||||
|
||||
|
||||
def test_pc_launch_test_passes_the_simulator_on(tmp_path, monkeypatch, win):
|
||||
from frameport.targets import pc_android
|
||||
|
||||
commands = []
|
||||
monkeypatch.setattr(axrb, "spawn_detached", lambda cmd: commands.append(cmd) or 1)
|
||||
monkeypatch.setattr(axrb, "pid_running", lambda pid: False)
|
||||
monkeypatch.setattr(axrb, "emulator_online", lambda *a, **k: False)
|
||||
monkeypatch.setattr(axrb, "log_dir", lambda *a, **k: tmp_path / "logs")
|
||||
monkeypatch.setattr(pc_android, "game_logs", lambda *a, **k: {})
|
||||
dep = {"package": "com.x.game", "title": "Game", "activity": "com.x.game/.Main",
|
||||
"launcher_win": r"C:\fp\fp-axrb-run.ps1"}
|
||||
pc_android.launch_test(dep, Reporter(), seconds=1)
|
||||
assert "XR_RUNTIME_JSON" not in commands[-1] # no simulator: the launcher call is unchanged
|
||||
monkeypatch.setattr(xr_sim, "_active", xr_sim.Service(None, tmp_path / "l", fake_monado(tmp_path / "m")))
|
||||
pc_android.launch_test(dep, Reporter(), seconds=1)
|
||||
assert commands[-1].startswith("$env:XR_RUNTIME_JSON = 'W:") and "steamvr_app_identity" in commands[-1]
|
||||
assert commands[-1].index("XR_RUNTIME_JSON") < commands[-1].index("fp-axrb-run.ps1")
|
||||
pc_android.launch_test(dep, Reporter(), seconds=1, extra_env={"FOO": "1"})
|
||||
assert commands[-1].startswith("$env:FOO = '1'; ") and "XR_RUNTIME_JSON" not in commands[-1]
|
||||
|
||||
|
||||
def test_running_launch_tests_save_the_simulated_headset_view(tmp_path, monkeypatch, win):
|
||||
from frameport.targets import pc_android
|
||||
|
||||
shots = []
|
||||
monkeypatch.setattr(xr_sim, "capture_exe", lambda: tmp_path / "cap.exe")
|
||||
monkeypatch.setattr(xr_sim, "capture_dir", lambda: tmp_path / "caps")
|
||||
monkeypatch.setattr(xr_sim, "capture", lambda out: shots.append(out) or out)
|
||||
assert pc_android.sim_capture({}, "com.x.game", Reporter()) is None and not shots # no simulator
|
||||
path = pc_android.sim_capture({"XR_RUNTIME_JSON": "W:\\m.json"}, "com.x.game", Reporter())
|
||||
assert shots == [path] and path.parent == tmp_path / "caps" and path.name.endswith("-com.x.game-headset.bmp")
|
||||
monkeypatch.setattr(xr_sim, "capture", lambda out: (_ for _ in ()).throw(xr_sim.XrSimError("no window")))
|
||||
assert pc_android.sim_capture({"XR_RUNTIME_JSON": "W:\\m.json"}, "com.x.game", Reporter()) is None
|
||||
monkeypatch.setattr(xr_sim, "capture_exe", lambda: None)
|
||||
assert pc_android.sim_capture({"XR_RUNTIME_JSON": "W:\\m.json"}, "com.x.game", Reporter()) is None
|
||||
Reference in new issue
Block a user