Compare commits

...
Author SHA1 Message Date
spoopyghosty0 01ad5e6b97 Foveation area size: use Valve's FOVE_LEVEL presets (#394)
The old radius setting exported FOVE_INNER/FOVE_OUTER, which Lepton doesn't pass into the container and Valve's
foveation layer doesn't read, so every size looked the same. Game settings now offers Default (large) / Large /
Medium / Small, exported as FOVE_LEVEL=lo/med/hi (the layer's own preset names); saved radius choices map to the
nearest preset. The agent's launcher update accepts FOVE_LEVEL.
2026-10-17 20:56:27 -04:00
spoopyghosty0 33d306a11e Catalog: Thief Simulator unsupported (install-source check, #368)
Quits at start with the game's own "installed from unknown source" message: Lepton installs the game itself at every
start and the Frame has no Meta store app, so the check can't pass.

Closes #368
2026-10-17 18:07:45 -04:00
spoopyghosty0 8e463a55de Catalog: Scared By Squares works (confirmed in the headset, #323) 2026-10-17 17:21:52 -04:00
spoopyghosty0 faca9bf396 unreal_noreserve: a build with nothing to rewrite passes its check (#393)
The validator required at least one rewritten mmap call, so an Unreal build without the Binned3 reservation
pattern (Lies Beneath) failed to build with "0 rewritten, 0 left" once the patch was on.
2026-10-17 16:53:43 -04:00
spoopyghosty0 e0a9b5f7cb Catalog: Table Troopers (works)
Closes #391
2026-10-17 16:52:13 -04:00
spoopyghosty0 3e906d55cf Catalog: Spectre (works)
Closes #390
2026-10-17 16:51:02 -04:00
spoopyghosty0 5e668f33d3 Batman audio hooks: place stubs in verified free gaps, say which step failed
On the Frame the atomic-branch detours never installed ("installation failed"): an mmap hint isn't honoured,
so the stub landed out of B range. Stubs now go into free gaps from /proc/self/maps within +-128 MiB of the
entry, mapped with MAP_FIXED_NOREPLACE (a relocated result is rejected); no gap = no hook. Every failure logs
the target and the failing step.
2026-10-17 16:47:06 -04:00
spoopyghosty0 feb4658dde Batman audio hooks: publish detours with one atomic branch (#389, #34)
The detour helper from PR #34 (used by the metadata hook and PR #389's two geometry hooks) wrote a 16-byte
branch + literal in two steps while game threads may run the function (installation is retried from
xrPollEvent). Each hook now publishes a single aligned release-atomic AArch64 B to a stub within +-128 MiB;
the trampoline replays the one verified instruction and returns to entry+4. Every mprotect is checked;
failures before publication free the stub and trampoline and leave the function untouched; no stub in range =
no hook. Adapter artifacts rebuilt by us (the PR's binary isn't shipped).
2026-10-17 16:47:06 -04:00
Lucas-Mathieu 4ed7929b1c Include package revisions in showcase build fingerprints 2026-10-17 16:47:06 -04:00
Lucas-Mathieu 61a6b3e2b2 Keep the ELF installer regression Linux-specific 2026-10-17 16:47:06 -04:00
Lucas-Mathieu 78fc926a48 Fix Batman audio geometry input lifetime across background loading 2026-10-17 16:47:05 -04:00
spoopyghosty0 503e64367c Showcase: monitor_settled waits for the newest fake stream
The Frame card starts a stream before the Monitor tab, whose faster interval starts a new one: the hook
returned on the first stream's flag while the new one was still replaying (CI rendered 71 vs 72 fps).
Each frozen session now has its own settled flag; the hook waits for the newest one.
2026-10-17 16:42:54 -04:00
spoopyghosty0 3deb279270 Headset model: an unknown OVRPort dispatcher keeps Quest 2 instead of failing the build (#373)
Quest 3 is the default for every Quest game, but the dispatcher patch only knows OVRPort 3.4.3-aa54c3f: an
APK converted with another runtime (found with an already converted Batman copy) failed to build. It now
keeps OVRPort's Quest 2 answers and says so in the build checks.
2026-10-17 16:35:35 -04:00
spoopyghosty0 0df1212bfe Showcase: the monitor shot waits for the frozen stream's replay
The Monitor tab asks the frozen fake stream to replay its history; on CI's slower runner the shot came
halfway through, so its numbers differed between renders ("three renders, no two alike"). New hook
monitor_settled waits until the replay is done.
2026-10-17 16:34:23 -04:00
40 changed files with 1049 additions and 116 deletions

No files matched your search

+2 -2
View File
@@ -46,7 +46,7 @@ try:
except ImportError: # Windows: pc_revive loads this file for its VDF code only (GitHub #131)
fcntl = None
AGENT_VERSION = 99
AGENT_VERSION = 100
HOME = os.path.expanduser("~")
STEAM = os.path.join(HOME, ".local/share/Steam")
ANCHORS = os.path.join(HOME, "Applications/quest-frame")
@@ -5716,7 +5716,7 @@ def cmd_keep_awake(args):
FOVEATION_ENV_KEYS = {"FDM_DEBUG", "ENABLE_VULKAN_FDM_INJECTION_LAYER",
"LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER", "VK_INSTANCE_LAYERS", "FOVE_INNER", "FOVE_OUTER",
"LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER", "VK_INSTANCE_LAYERS", "FOVE_INNER", "FOVE_OUTER", "FOVE_LEVEL",
"LEPTON_ENV_FRAMEPORT_FOVEATION_TEST", "LEPTON_ENV_FRAMEPORT_CLIMB_STEREO_OFFSETS",
"LEPTON_ENV_FRAMEPORT_VRAPI_FDM_ISOLATE_MONO", "LEPTON_ENV_FRAMEPORT_VRAPI_KEEP_FOCUSED_IMAGE"}
+1 -1
View File
@@ -13,7 +13,7 @@ d6337034fb0bdcca7ef9b7063d85b7586b8508b63b435959e8fffaba0691091c ./arm64-v8a/li
4a13a33e112c9e4e3c5ff4337ed6e988a9e5b3602f48d654df148ef5fafbf426 ./arm64-v8a/libfpglmv.so
36400eae4ba3807bcfcd54463daa217347032b07218792faa448d8cbbd086a0e ./arm64-v8a/libframe_xrshim.so
19ba5ed3c4b780f5ae46251f6958f552acfc5f13c8bb39f995579593fa8990c6 ./arm64-v8a/libglshim.so
2d1726aaa8ee0ce788df1b8727bd55ab72efae749e7652f38f67e5e317b74b2f ./arm64-v8a/libopenxr_loader_generic.so
db23c2f84255bc00fca0c6aaf22188372f7d243619eded3c3654bc7f16dfcdcc ./arm64-v8a/libopenxr_loader_generic.so
1feaeafad467c4cafdf2b018a4d84b0bee200c3f711697b4ce97e66a3ba256ca ./arm64-v8a/libovrplatformcompat.so
a4ed80ae45ca90758239f152ea5a2e8c127d491e1e697ea5680db6fd7f72db07 ./arm64-v8a/libvrapi.so
a4ed80ae45ca90758239f152ea5a2e8c127d491e1e697ea5680db6fd7f72db07 ./arm64-v8a/libvrapi_foveation.so
Binary file not shown.
+7 -4
View File
@@ -1,9 +1,9 @@
package: ScaredBySquares.Game
title: Scared By Squares
status: unknown
status: works
notes: 'Showed black and dropped back to the home environment while the game kept running (sound only, GitHub 323).
Fixed in FramePort 1.2.1 and checked on the Frame without the headset (the game runs at 72 fps and SteamVR keeps it
as the running game); not yet confirmed in the headset. Rebuild and reinstall the game after updating FramePort.'
Fixed in FramePort 1.2.1 (confirmed in the headset by the reporter). Rebuild and reinstall the game after updating
FramePort.'
details: 'The game (Unreal 4.27, OpenXR) creates two controller actions named "turn" (an action mapping and an axis
mapping called Turn). The Frame''s runtime accepts the duplicate, then fails to load the input manifest it builds
from the actions ("SetXrInputConfig failed. Failed to load manifest") and treats the game as closed. FrameBridge''s
@@ -14,6 +14,9 @@ xr: OpenXR
frame:
- frame.hw_video_decode
- frame.unreal_skip_obb_check
updated: '2026-10-16'
verified:
date: '2026-10-17'
issue: 323
updated: '2026-10-17'
min_app: 1.2.1
source_hint: Scared By Squares
@@ -0,0 +1,25 @@
package: com.CortopiaStudios.Spectre
title: Spectre
status: works
notes: Works since 1.2.1 (the loading screen waited for a Meta analytics request).
tested_version: 1.0.1.1354
engine: Unity
xr: OpenXR
frame:
- frame.unity_text_input
- frame.hw_video_decode
- frame.cortopia_org_id
device:
- device.text_input_window
adapter:
haptic_fix: 1
scale: 2.0
verified:
date: '2026-10-17'
known_good_sha256: a37a5400ef58906b575f6da1649b62ac7ce024eab831fae105457c1d5d12c2de
app: 1.2.1
overport_cli: 1.2.5
frame_build: '20261007.6125817'
agent: 96
issue: 390
source_hint: Wonder
@@ -0,0 +1,24 @@
package: com.cosmorama.tabletroopers
title: Table Troopers
status: works
tested_version: 2026.40.4
engine: Unity
xr: OpenXR
frame:
- frame.gms_platform_version
- frame.photon_voice_audio_route
- frame.unity_text_input
device:
- device.text_input_window
adapter:
haptic_fix: 1
scale: 2.0
verified:
date: '2026-10-17'
known_good_sha256: b0a4b0e29855277712b580bd5507721fff137bde77b1911b34cca89c627feef1
app: 1.2.1
overport_cli: 1.2.5
frame_build: '20261007.6125817'
agent: 96
issue: 391
source_hint: Troopers
@@ -0,0 +1,12 @@
package: com.rrrgames.ThiefSimVRQuest
title: Thief Simulator
status: unsupported
notes: Quits at start with the game's own "installed from unknown source" message. Lepton installs the game itself at
every start (there is no Meta store app on the Frame), so the game never sees the Meta store as its source.
tested_version: 1.1.7.3
engine: Unity
xr: OpenXR
verified:
date: '2026-10-17'
issue: 368
updated: '2026-10-17'
+6
View File
@@ -523,6 +523,12 @@ signatures:
diagnosis: The game crashed while leaving VR, inside Valve's foveation layer when it destroys a swapchain (for example Lambda1VR). This can happen after manually quitting; it is not a startup crash and does not explain distorted geometry seen before quitting.
suggest: []
supersedes: [native-crash]
- id: batman-audio-geometry-allocation
pattern: '(?s)\A(?=.*com\.camouflaj\.manta)(?=.*Trying to allocate: [1-9][0-9]{10,}B)(?=.*MetaXRAudioUnityMemoryAllocator\.cpp)'
severity: fatal
diagnosis: "Batman's Meta XR Audio geometry loader requested tens of gigabytes while loading a scene. Its background task can outlive the UnityWebRequest that owns the input buffer. Update Batman on Frame with the current FramePort: the adapter retains a private copy until parsing finishes, for the verified Batman build. This is a game allocation crash, not evidence of a headset thermal shutdown."
suggest: [frame.adapter]
supersedes: [native-crash]
- id: native-crash
pattern: 'Fatal signal (\d+) \(SIG[A-Z]+\)'
severity: fatal
+105
View File
@@ -0,0 +1,105 @@
# Batman audio geometry input lifetime
Batman: Arkham Shadow 1.4.1 could abort while loading a save or streaming the area
around a real-time cutscene. Unity reported requests for 26,388,238,103 or
147,520,448,640 bytes through `MetaXRAudioUnityMemoryAllocator.cpp`, followed by
`SIGTRAP` on an IL2CPP worker. The first captured stack reached
`GeometricAudioMeshPreprocessor::readMeshInfo` through
`ovrAudio_AudioGeometryReadMeshMemory`.
The serialized asset on disk was intact. In one failed run its vertex count was
read as 1 instead of 17,251. The managed-code trace showed a lifetime risk:
`LoadGeometryAsync` obtains a `NativeArray<byte>.ReadOnly` from a
`UnityWebRequest` download handler, calls async-void `LoadGeometryFromMemory`,
then returns. The background task retains the pointer/length pair, but not the
request owning those bytes. Its `GC.KeepAlive` boxes the read-only view rather
than retaining the request. The trace and device test support premature source
reuse as the cause; no hardware watch established the exact freeing instruction.
## Repair and isolation
`audio_geometry_owned.h` copies the input synchronously at
`LoadGeometryFromMemory`, before `Task.Run` can outlive the request. A mutex
protects the list of copies. The original worker still parses and processes the
audio geometry; its completion wrapper removes and frees the corresponding copy.
This also handles a worker finishing before the queuing call returns. NativeArray
length/padding bits and IL2CPP's hidden method-info arguments are preserved.
Null/invalid lengths and allocation failure retain the original call. A task
that never runs retains its copy until process exit; there is no timed expiry
that could free data beneath a late worker.
`batman_audio_geometry.h` enables the repair only in `com.camouflaj.manta`, on
AArch64, after the existing audio metadata initializer verifies Meta XR Audio
Wwise build `e1619e7fb839badf0ea5ecc22d9f028d0b17c34d`. It additionally requires
IL2CPP build `1d48a41d7e9011bef5fae0c23c404c62a4e7a73c` and exact 16-byte entry
sequences at both managed hooks. Unknown builds are left untouched. The live
IL2CPP addresses are `0x2e61bb4` (queue) and `0x2e63a28` (worker); text file
offsets in this build are 0x1000 lower. These offsets must not be reused for
another game or build.
Both geometry hooks and the metadata hooks use `audio_detour.h`. After the
16-byte entry guard, only the first, naturally aligned instruction is replaced:
a release atomic store publishes an AArch64 `B` to a nearby stub. The stub's
absolute jump and the trampoline (one verified non-PC-relative instruction,
then a direct branch to entry+4) are complete, instruction-cache flushed and RX
before publication. The original-call pointer is published first. Remaining
entry instructions are unchanged, so workers already past the entry can finish
normally. `/proc/self/maps` supplies free gaps, clipped to the ranges of both
branches. Page-aligned candidates are tried outward from the target (lower
address first on equal distances) with `MAP_FIXED_NOREPLACE`; EEXIST/EINVAL
advance to the next candidate. Existing mappings are never replaced, and a
kernel that ignores the flag and relocates a mapping has that result unmapped.
If no candidate works, that hook is skipped without changing its entry. No ELF
page-slack fallback is used: zero bytes alone cannot establish that padding is
outside all section content, and the loaded program headers do not prove this.
Every mprotect result is checked. Failures before entry publication free the
mapping. If restoring RX after publication fails, the entry word is restored,
its instruction cache is flushed, and restoring RX is attempted again. The
mapping and original-call pointer must then remain valid until process exit:
a worker may already have followed the published branch. Freeing them without
quiescing those threads would introduce a use-after-unmap. A persistent kernel
mprotect failure can leave the entry page RWX. Each hook failure logs its target
and failing operation once; metadata installation is attempted once per verified
library. Allocation failure reports the closest eligible free page, last
attempted address, actual mmap result, errno and attempt count. Null closest and
zero attempts mean no eligible free gap. Protection failures identify stub RX,
entry RWX, or entry RX, including the rollback RX errno (zero means it succeeded).
This exceptional rollback cannot provide immediate reclamation or guarantee RX
when the kernel refuses it. The previous hint-based publication build failed installation on the Steam
Frame; this gap-search replacement has host validation only.
This is separate from the existing [audio metadata retirement repair](AUDIO_METADATA.md).
It does not change the decoder, acoustic processing, tracking, foveation,
resolution, refresh rate, or other games' recipes. Temporary input dumps, native
parser bypasses and redundant late copies used during investigation are not
included. Production logs are limited to installation and the first four
copy/completion pairs. No game assets are included in the repository.
The `frame.adapter` package revision increases only for Batman. Existing Batman
installs therefore offer **Update on Frame**; other games are not marked outdated
by this repair. Updating/rebuilding Batman installs the new adapter through the
normal path; no launcher script or additional option is needed.
## Validation
- Native regressions cover deferred and inline completion, source destruction
before worker execution, concurrent loads, cleanup, allocation failure,
argument preservation, and rejection of unknown build IDs/function entries.
Host C tests also cover branch-range endpoints, stub/trampoline encoding,
publication order, synthetic maps with in-range/out-of-range/absent gaps and
adjacent mappings, outward placement order, EEXIST/EINVAL fallback, rejected
relocated mmap results and mprotect failure cleanup/rollback.
- On the headset, the affected save loaded successfully with the repair. Logs
showed private copies of 2,599,300, 159,020 and 628,088 bytes made before dispatch;
each original parser completed and each copy was released. Another 180,120-byte
geometry input also completed normally.
- The game continued for over seven minutes after that load with zero allocation
failures, rejected meshes or fatal signals. Acoustic geometry was loaded, not
disabled. That device test used the ownership repair with diagnostic guards;
none of the guards rejected a mesh. The production repair omits those guards.
- The rebuilt latest adapter passes the repository checks recorded in the PR;
the device result above is for the experimental build tested before integration.
This does not establish long-term stability or resolve the separately observed
whole-headset power-offs. Those require their own power/reset investigation.
+1 -1
View File
@@ -288,7 +288,7 @@ Steam placeholder set (no Steam art at all) → fixed in artwork/steam.py.
## PR #34: Meta XR Audio metadata (Batman)
**PR #34 (merged 2026-10-04, Lucas-Mathieu):** `native/adapter/audio_metadata.h` patches Meta XR Audio Wwise (only build ID e1619e7f…, Batman: Arkham Shadow 1.4.1) so queued audio metadata isn't freed while the current audio frame references it (smoke-bomb crash). Verified headless: installs ("metadata reclamation follows …"), 72 fps; we added a once-per-second scan limit. Outside PRs: review source, rebuild `artifacts/` ourselves, merge locally (contributor's commit kept), push main.
**PR #34 (merged 2026-10-04, Lucas-Mathieu):** `native/adapter/audio_metadata.h` patches Meta XR Audio Wwise (only build ID e1619e7f…, Batman: Arkham Shadow 1.4.1) so queued audio metadata isn't freed while the current audio frame references it (smoke-bomb crash). The shared detour now publishes one aligned AArch64 branch to a range-checked nearby stub, with a one-instruction trampoline; protection failures roll back (published mappings must remain alive for in-flight threads). See [AUDIO_GEOMETRY.md](AUDIO_GEOMETRY.md) for failure limits and host validation; this publication change has not been device-tested. Original repair verified headless: installs ("metadata reclamation follows …"), 72 fps; we added a once-per-second scan limit. Outside PRs: review source, rebuild `artifacts/` ourselves, merge locally (contributor's commit kept), push main.
## Heuristics eval (2026-10-04)
+51 -8
View File
@@ -398,14 +398,57 @@ over Quest games.
Under a Quest game's **Game settings → Picture**, choose **Foveated rendering → Eye-tracked**, then **Save**.
Changes apply at the next game start.
The full-resolution area selector defaults to **Default (30% radius)**: no radius override, preserving the
runtime profile used in the headset experiments. Larger radii retain more detail and save less shading work.
Custom radii set `FOVE_INNER`; `FOVE_OUTER` is twice that value, matching the runtime's profile proportions.
The inspected runtime's built-in inner/outer pairs are 0.30/0.60, 0.25/0.50 and 0.20/0.40.
The shared-texture injection path selects profile 1: 0.30 inner radius and 0.60 outer radius.
The area selector now uses Valve's supported `FOVE_LEVEL` presets (GitHub #394; binary analysis
2026-10-17). Default leaves the runtime choice alone; on the shared injection path this is `lo`.
The old `FOVE_INNER`/`FOVE_OUTER` radius exports had no effect: Lepton does not pass them through,
and the layer does not read them. The previously documented 0.30/0.60, 0.25/0.50, 0.20/0.40
radius pairs do **not** describe the generated shared-injection density map.
The inspected arm64 `libVkLayer_VALVE_fdm_injection.so` has these semantics (virtual addresses):
- `init_fdm_fove_level` at `0x1cdf4` calls the cached option reader, then
`debug_parse_flags_option` (`0x21d74`) with table `0x27e70`: named tokens `lo` → 1,
`med` → 2, `hi` → 3. It does not call atoi/strtol. Unset, empty, unknown and numeric
strings parse to zero and retain the current profile (initialized to 1 at `0x1ce74`).
Tokens are case-sensitive and separated by non-alphanumeric/non-underscore characters;
matching values are ORed, so combinations can alias another profile. `all` also yields 3;
`help` prints the table and returns zero. Use a single preset token.
- Profile selection at `0x1918c–0x19364` uses normalized **rectangles**, not circular radii.
`lo` has a full-density center rectangle `(x=.364, y=.367, width=.295, height=.286)`
(constant at `0xe440`), then density byte `0x76` outside. `med` uses rectangles from
`0xe988`: sizes `.250×.245`, `.295×.286`, `.386×.367`, with density bytes
`0xff`, `0xa8`, `0x76` and `0x50` outside. `hi` uses `0xe9b8`: sizes
`.246×.211`, `.281×.246`, `.351×.316`, `.386×.351`, with bytes
`0xff`, `0xa8`, `0x76`, `0x50`, then `0x38` outside. Each byte is written to both
R8G8 density channels. All three retain a full-density center (`0xff`); medium/high make it smaller
and reduce peripheral density more. Coordinates are sampled on the density-map grid (`0x19378` onward).
- `FDM_DEBUG` flags `lo`/`med`/`hi` also select presets (high takes precedence), but an
explicit recognized `FOVE_LEVEL` overrides them (`0x1ce14`). `enable` gates injection;
`disable_offsets` fixes the gaze position (`0x1b6c8`), and `yflip` flips the vertical
offset (`0x1b9b8`). These three flags do not resize the profile.
- `FDM_SWAPCHAIN_SIZE` is parsed by `atoi` (`0x1c518`), clamped to nonnegative, and
seeds a known swapchain size (`0x1ccf8`). It is a size/matching hint, not a radius.
The synthetic map is square with side `ceil(size/32)` (`0x19048–0x19088`); image
association also matches this tile size (`0x16c78`). Changing render resolution changes
the pixel extent, tile quantization and potentially the matched render target/map. This can
change the visible diagnostic area without making the ignored radius exports effective;
a matched device capture is needed to establish which path a particular game used.
Per-game library preferences now store `level`. Legacy radius choices are translated on read
(and written as `level` on Save): nearest old nominal .30 → lo, .25 → med, .20 → hi,
with larger values clamped by nearest choice; zero or unknown/invalid values → Default.
This preserves approximate intent, not a claim that these presets implement those radii.
Explicit `level` wins. Obsolete radius exports are removed from managed launchers.
For device verification, hold game scene, render resolution and gaze constant; compare explicit
`lo`, `med`, `hi` across fresh game starts (Default should match lo absent another runtime override).
First use Fixed for a stable comparison, then Eye-tracked to check gaze following. Enable
**Darken coarse fragments (test)** and adapter `snapshot=N` to capture submitted eye images headlessly
every N seconds (GLES only, left eye at quarter size); compare the undarkened center and peripheral bands. Existing adapter
builds need diagnostic support installed. Turn the test and snapshots off before benchmarking.
Agent `FOVEATION_ENV_KEYS` must include `"FOVE_LEVEL"` for launcher updates via `set_settings`.
`device.foveation` enables Valve's shared Vulkan injection and suppresses competing native foveation through
`foveation_fix=1`. Game settings stores mode, radius and test selection as a per-game library preference, outside shared recipes. This remains
`foveation_fix=1`. Game settings stores mode, profile and test selection as a per-game library preference, outside shared recipes. This remains
experimental: complete images were confirmed in RE4, Batman, Deadpool, The Climb 2 and Asgard's Wrath 2,
not all Quest games or renderers. RE4 and Batman checks include title/calibration scenes; these are not
equivalent to extended gameplay coverage. Asgard gameplay was visually confirmed, without an on/off benchmark.
@@ -432,7 +475,7 @@ in Climb the same library also carries the compatibility correction.
High-resolution Deadpool samples crossed from about 45 to 90 FPS with injection enabled, but temperatures and
power rose as it rendered twice as many frames. Foveation does not guarantee lower temperature at uncapped FPS.
The new configurable radii have configuration/build coverage; each radius has not been separately play-tested.
Preset export/migration has configuration coverage; these preset comparisons have not been device-tested here.
## Monitoring sources (probed 2026-10-07, SteamOS 0.4.3, kernel 6.18; used by the Monitor tab, agent `_monitor`)
@@ -459,7 +502,7 @@ game processes without one), temperatures every 2 s, the CPU-cluster power rails
### Foveation user preferences (discussion #365)
Game settings → Picture provides Default / Eye-tracked / Fixed / Off, radius, and an advanced diagnostic switch.
Game settings → Picture provides Default / Eye-tracked / Fixed / Off, a runtime profile, and an advanced diagnostic switch.
`set_settings` (agent 98) atomically rewrites just the managed launcher exports and records them in deployment.json;
no APK rebuild, reinstall or live device intervention is needed. Changes apply at the next start. Default restores
recipe/catalog launcher defaults; explicit preferences win. One-time library migration extracts old recipe choices
+4
View File
@@ -117,6 +117,7 @@ Generated from [catalog/games](../catalog/games) by `scripts/compat_list.py`.
| Riven | Quest | ✅ Works | |
| Robo Recall | Quest | ✅ Works | |
| RUINSMAGUS | Quest | ✅ Works | |
| Scared By Squares | Quest | ✅ Works | |
| Sclerosis | Quest | ✅ Works | |
| Shadow Point | Quest | ✅ Works | |
| Shoot The Zombirds VR | Quest | ✅ Works | |
@@ -126,6 +127,7 @@ Generated from [catalog/games](../catalog/games) by `scripts/compat_list.py`.
| Sniper Elite VR | Quest | ✅ Works | |
| Sniper Elite VR: Winter Warrior | Quest | ✅ Works | |
| Space Pirate Trainer Quest | Quest | ✅ Works | |
| Spectre | Quest | ✅ Works | |
| Sports Scramble (Santa Cruz) | Quest | ✅ Works | |
| Star Wars Pinball VR | Quest | ✅ Works | |
| Star Wars: Tales from the Galaxy's Edge | Quest | ✅ Works | |
@@ -134,6 +136,7 @@ Generated from [catalog/games](../catalog/games) by `scripts/compat_list.py`.
| SUPERHOT VR | PC VR | ✅ Works | |
| SUPERHOT VR | Quest | ✅ Works | |
| SynthRiders | Quest | ✅ Works | |
| Table Troopers | Quest | ✅ Works | |
| Taskmaster | Quest | ✅ Works | |
| Tea For God | Quest | ✅ Works | |
| TetrisEffect | Quest | ✅ Works | |
@@ -204,3 +207,4 @@ Generated from [catalog/games](../catalog/games) by `scripts/compat_list.py`.
| GOLF+ | Quest | ❌ Doesn't run | Black screen. |
| HITMAN 3 VR: Reloaded | Quest | ❌ Doesn't run | Vulkan driver crash (freedreno), even without Valve layers. |
| Roblox | Quest | ❌ Doesn't run | Crashes on its first VR frame on the Frame. |
| Thief Simulator | Quest | ❌ Doesn't run | Quits at start with the game's own "installed from unknown source" message. |
+19 -15
View File
@@ -52,13 +52,13 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
| [Skip Meta avatars](#frame-avatar_stub) | `frame.avatar_stub` | Steam Frame patches | 1 |
| [bHaptics: skip the Bluetooth permission request](#frame-bhaptics_permission) | `frame.bhaptics_permission` | Steam Frame patches | 6 |
| [BlazeRush: controllers without Meta avatars, own shader cache](#frame-blazerush) | `frame.blazerush` | Steam Frame patches | 1 |
| [Cortopia games: don't wait for Meta's org-scoped id](#frame-cortopia_org_id) | `frame.cortopia_org_id` | Steam Frame patches | |
| [Cortopia games: don't wait for Meta's org-scoped id](#frame-cortopia_org_id) | `frame.cortopia_org_id` | Steam Frame patches | 1 |
| [Epic Online Services: stop the keychain retry loop](#frame-eos_keychain_loop) | `frame.eos_keychain_loop` | Steam Frame patches | |
| [OpenGL ES: multiview shaders on flat panels (HUD, menus)](#frame-gl_multiview_fbo) | `frame.gl_multiview_fbo` | Steam Frame patches | 1 |
| [GL shim (Mesa GLSL compatibility)](#frame-gl_shim) | `frame.gl_shim` | Steam Frame patches | 2 |
| [Play services: Android 11 version checks](#frame-gms_platform_version) | `frame.gms_platform_version` | Steam Frame patches | |
| [Play services: Android 11 version checks](#frame-gms_platform_version) | `frame.gms_platform_version` | Steam Frame patches | 1 |
| [Godot apps: start without a clipboard service](#frame-godot_clipboard) | `frame.godot_clipboard` | Steam Frame patches | 1 |
| [Hardware video decoding (H.264, HEVC, VP9)](#frame-hw_video_decode) | `frame.hw_video_decode` | Steam Frame patches | 31 |
| [Hardware video decoding (H.264, HEVC, VP9)](#frame-hw_video_decode) | `frame.hw_video_decode` | Steam Frame patches | 32 |
| [Language packs from the game's files](#frame-langpacks) | `frame.langpacks` | Steam Frame patches | |
| [Launcher category (INFO → LAUNCHER)](#frame-launcher) | `frame.launcher` | Steam Frame patches | default |
| [GL wrapper: OpenGL ES depth formats (Minecraft)](#frame-ltw_depth) | `frame.ltw_depth` | Steam Frame patches | default |
@@ -73,7 +73,7 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
| [Platform compat (ovrMessageType_ToString)](#frame-ovrplatformcompat) | `frame.ovrplatformcompat` | Steam Frame patches | default |
| [Stub missing Meta platform functions](#frame-ovrstubs) | `frame.ovrstubs` | Steam Frame patches | default |
| [Unpaired pointer-authentication checks](#frame-pac_hints) | `frame.pac_hints` | Steam Frame patches | 1 |
| [Photon Voice: skip Android 12 audio routing](#frame-photon_voice_audio_route) | `frame.photon_voice_audio_route` | Steam Frame patches | |
| [Photon Voice: skip Android 12 audio routing](#frame-photon_voice_audio_route) | `frame.photon_voice_audio_route` | Steam Frame patches | 1 |
| [SDL apps: start without a clipboard service](#frame-sdl_clipboard) | `frame.sdl_clipboard` | Steam Frame patches | 5 |
| [Stress Level Zero: let Unity start Vulkan itself](#frame-slz_vulkan_hooks) | `frame.slz_vulkan_hooks` | Steam Frame patches | 1 |
| [Start straight in VR (skip the 2D launcher)](#frame-start_activity) | `frame.start_activity` | Steam Frame patches | |
@@ -86,7 +86,7 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
| [Unity: skip OVROverlay layers (fades, splash screens)](#frame-unity_no_overlay_copy) | `frame.unity_no_overlay_copy` | Steam Frame patches | 2 |
| [Unity: start VR without Meta's system apps](#frame-unity_oculus_check) | `frame.unity_oculus_check` | Steam Frame patches | 14 |
| [Unity: keep MSAA off at runtime (OVRManager)](#frame-unity_runtime_msaa_off) | `frame.unity_runtime_msaa_off` | Steam Frame patches | 31 |
| [Make Unity text fields work](#frame-unity_text_input) | `frame.unity_text_input` | Steam Frame patches | 111 |
| [Make Unity text fields work](#frame-unity_text_input) | `frame.unity_text_input` | Steam Frame patches | 113 |
| [Unity: share thread keys (games that run out of them)](#frame-unity_tls_key_pool) | `frame.unity_tls_key_pool` | Steam Frame patches | 1 |
| [Unity: headset always counts as worn](#frame-unity_user_presence) | `frame.unity_user_presence` | Steam Frame patches | 1 |
| [GL shim for Unreal (no multisampled render-to-texture)](#frame-unreal_gl_shim) | `frame.unreal_gl_shim` | Steam Frame patches | 1 |
@@ -136,7 +136,7 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
| [GL shim: high-precision vertex shaders](#adapter-gl_highp_markers) | `adapter.gl_highp_markers` | Game settings | 1 |
| [GL shim: integer vertex inputs](#adapter-gl_int_attribs) | `adapter.gl_int_attribs` | Game settings | 1 |
| [Flat panel diagnostics (log)](#adapter-gl_mv_debug) | `adapter.gl_mv_debug` | Game settings | |
| [Fix freezes when controllers vibrate](#adapter-haptic_fix) | `adapter.haptic_fix` | Game settings | 96 |
| [Fix freezes when controllers vibrate](#adapter-haptic_fix) | `adapter.haptic_fix` | Game settings | 98 |
| [Vibration strength](#adapter-haptic_scale) | `adapter.haptic_scale` | Game settings | |
| [Turn off Quest Vulkan foveation](#adapter-hide_fb_foveation) | `adapter.hide_fb_foveation` | Game settings | |
| [Turn off space warp](#adapter-hide_space_warp) | `adapter.hide_space_warp` | Game settings | 5 |
@@ -156,7 +156,7 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
| [Refresh rate](#adapter-refresh_rate) | `adapter.refresh_rate` | Game settings | 3 |
| [Wait for the game's GPU](#adapter-release_wait) | `adapter.release_wait` | Game settings | |
| [Re-create play space](#adapter-respace_kick) | `adapter.respace_kick` | Game settings | |
| [Render resolution (supersampling)](#adapter-scale) | `adapter.scale` | Game settings | 9 |
| [Render resolution (supersampling)](#adapter-scale) | `adapter.scale` | Game settings | 11 |
| [Room depth](#adapter-scene_depth) | `adapter.scene_depth` | Game settings | |
| [Pretend room layout](#adapter-scene_emul) | `adapter.scene_emul` | Game settings | 12 |
| [Room height](#adapter-scene_height) | `adapter.scene_height` | Game settings | |
@@ -188,7 +188,7 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
| [Game language](#device-language) | `device.language` | Files and settings on the Frame | |
| [Extra Lepton settings](#device-lepton_env) | `device.lepton_env` | Files and settings on the Frame | 3 |
| [Controllers as a gamepad (Steam Input)](#device-steam_gamepad) | `device.steam_gamepad` | Files and settings on the Frame | |
| [Show the app's Android window (for typing)](#device-text_input_window) | `device.text_input_window` | Files and settings on the Frame | 114 |
| [Show the app's Android window (for typing)](#device-text_input_window) | `device.text_input_window` | Files and settings on the Frame | 116 |
| [Launch options (SteamVR or OpenXR)](#pcvr-launch_args) | `pcvr.launch_args` | PC VR (Proton and Revive) | 2 |
| [Provide the Oculus runtime from Revive (Frame)](#pcvr-libovr_redirect) | `pcvr.libovr_redirect` | PC VR (Proton and Revive) | |
| [No Unreal crash reporter](#pcvr-no_crash_reporter) | `pcvr.no_crash_reporter` | PC VR (Proton and Revive) | |
@@ -524,6 +524,7 @@ FramePort's layer between the game and the Steam Frame: fills in what the Frame
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
- **Suggested (on):** Required for every OpenXR/overport build on the Frame.
- **Suggested by launch-test signatures:**
- `batman-audio-geometry-allocation` (fatal): Batman's Meta XR Audio geometry loader requested tens of gigabytes while loading a scene.
- `cube-swapchain-refused` (fatal): The game asked for a cube-map swapchain (for example an OVROverlay skybox or loading cube), which the Frame's runtime doesn't have.
- `cylinder-menu-layers-rejected` (info): The runtime rejected a frame's layers once (XR_ERROR_LAYER_INVALID).
- `graphics-requirements-missing` (fatal): The game can't start VR on the Frame; rebuild it with the current FramePort.
@@ -606,6 +607,7 @@ Gets Cortopia games (for example Escaping Wonderland) past their loading screen.
- `frame.cortopia_org_id`
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
- **Suggested (on):** Cortopia's Meta platform start-up waits for an org-scoped user id that OVRPort's platform library never answers (stuck loading screen).
- **Catalog games (1):** Spectre.
- **Suggested by launch-test signatures:**
- `cortopia-org-id-wait` (error): The game waits forever on its loading screen for an answer from Meta's platform (an org-scoped user id, used as its analytics id) that OVRPort's platform library doesn't give.
- **Source:** [patches/frame/cortopia_org_id.py](../src/frameport/patches/frame/cortopia_org_id.py)
@@ -659,6 +661,7 @@ Lets games with Google Play services code start on the Frame (they'd crash at st
- `frame.gms_platform_version` · also for 2D apps
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
- **Suggested (on):** Google Play services' Android 12 checks were built in as 'always true'; on Lepton (Android 11) the game would crash at start.
- **Catalog games (1):** Table Troopers.
- **Suggested by launch-test signatures:**
- `gms-android12-call` (fatal): Google Play services' code in the game called an Android 12 method (the game was built for Android 12 and newer, so its version checks were built in as "always true") and Lepton runs Android 11; the game crashes on its GoogleApiHandler thread at start (for example Titan Isles).
- **Source:** [patches/frame/gms_platform_version.py](../src/frameport/patches/frame/gms_platform_version.py)
@@ -686,7 +689,7 @@ Plays the game's videos on the Frame's video hardware, so 4K and 8K video runs s
- `frame.hw_video_decode` · also for 2D apps
- **Changes:** Install only: written on the Frame when the game is installed; the APK isn't changed.
- **Suggested (on):** The game plays video through Android's decoders (MediaCodec, ExoPlayer or VLC): decode it on the Frame's hardware.
- **Catalog games (31):** 4XVR Video Player, AugmentedEmpire, Batman: Arkham Shadow, Battlemarked, BattleTalent, Breathedge VR, Dance Central, Exploding Kittens VR and 23 more.
- **Catalog games (32):** 4XVR Video Player, AugmentedEmpire, Batman: Arkham Shadow, Battlemarked, BattleTalent, Breathedge VR, Dance Central, Exploding Kittens VR and 24 more.
- **Source:** [patches/frame/hw_video_decode.py](../src/frameport/patches/frame/hw_video_decode.py)
> Decodes the game's videos on the Frame's hardware video decoder instead of Android's software decoders, which stutter or fall behind with 4K/8K video (for example video players, Batman: Arkham Shadow's cutscenes). Adds FramePort's codec plugin (OMX.frameport.avc/hevc/vp9.decoder) to this game's container only; the APK isn't changed. When the hardware is busy (for example Steam's own hardware video decoding is on) the video is decoded in software as before.
@@ -881,6 +884,7 @@ Stops games with Photon Voice chat from crashing on the Frame when voice chat st
- `frame.photon_voice_audio_route` · also for 2D apps
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
- **Suggested (on):** Photon Voice calls Android 12 audio methods, which Lepton (Android 11) lacks, and crashes when voice chat starts.
- **Catalog games (1):** Table Troopers.
- **Suggested by launch-test signatures:**
- `photon-voice-api31` (fatal): The game's Photon Voice microphone plugin calls Android 12 audio-routing methods (AudioManager communication devices) without checking the Android version; Lepton runs Android 11, so the app crashes when voice chat starts (for example Table Troopers at the tutorial).
- **Source:** [patches/frame/photon_voice_audio_route.py](../src/frameport/patches/frame/photon_voice_audio_route.py)
@@ -1058,7 +1062,7 @@ Lets you type into this app's text fields on the Frame (they'd close at once).
- `frame.unity_text_input` · also for 2D apps
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
- **Suggested (on):** Unity app with text fields (…): they close at once on the Frame because it has no system keyboard.
- **Catalog games (111):** AgeOfJoy, AllInOneSports, Ancient_Dungeon, Arcsmith, Arkio, Assassin's Creed Nexus, Attack on Titan VR: Unbreakable, Audica and 103 more.
- **Catalog games (113):** AgeOfJoy, AllInOneSports, Ancient_Dungeon, Arcsmith, Arkio, Assassin's Creed Nexus, Attack on Titan VR: Unbreakable, Audica and 105 more.
- **Source:** [patches/frame/unity_text_input.py](../src/frameport/patches/frame/unity_text_input.py)
> 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 this on a Quest), so a selected text field only flashes a caret. Rewrites TouchScreenKeyboardShouldBeUsed -&gt; false and isKeyboardUsingEvents (TMP) / InPlaceEditing (uGUI) -&gt; true in libil2cpp.so, found per game with Cpp2IL (downloaded on first use), so fields stay selected and take key presses: Steam's keyboard (with "Show the app window") or Type on Frame from the PC.
@@ -1772,7 +1776,7 @@ For games that freeze the Frame when a controller vibrates (for example Lucky's
- **Options:**
- Value: int, default `0`.
- Game settings → Controllers → "Fix freezes when controllers vibrate" (advanced).
- **Catalog games (96):** AgeOfJoy, Ancient_Dungeon, Attack on Titan VR: Unbreakable, Audica, AugmentedEmpire, Battlemarked, BattleSisters, BattleTalent and 88 more.
- **Catalog games (98):** AgeOfJoy, Ancient_Dungeon, Attack on Titan VR: Unbreakable, Audica, AugmentedEmpire, Battlemarked, BattleSisters, BattleTalent and 90 more.
- **Source:** [patches/settings.py](../src/frameport/patches/settings.py)
> Routes OVRPlugin through FramePort's extension shim, which turns Meta's amplitude-envelope vibrations into plain ones: OVRPort's loader reads their nanosecond duration as seconds and allocates gigabytes, freezing the Frame when the game vibrates a controller (for example Lucky's Tale's save slots, GitHub #9). Needs a rebuild.
@@ -2066,7 +2070,7 @@ Changes the game's render resolution. Higher is sharper but slower; 1.0× is the
- **Options:**
- Value: float, default `1.0` (always written).
- Game settings → Picture → "Render resolution (supersampling)": slider 0.5–2 in steps of 0.1.
- **Catalog games (9):** 4XVR Video Player, BlazeRush, CrazyTaxiVR, cubism, FGO VR, I Expect You To Die 2, The 7th Guest VR, Vampire: The Masquerade - Justice and 1 more.
- **Catalog games (11):** 4XVR Video Player, BlazeRush, CrazyTaxiVR, cubism, FGO VR, I Expect You To Die 2, Spectre, Table Troopers and 3 more.
- **Source:** [patches/settings.py](../src/frameport/patches/settings.py)
> Multiplies the recommended eye-buffer width and height (0.5–2.0). 1.5 ≈ 2.25× pixels.
@@ -2456,12 +2460,12 @@ Render less detail outside your gaze; adjust the full-resolution area or darken
- **Options:**
- `support`: bool, default `False` — Internal APK compatibility support
- `mode`: str, default empty — Catalog default: tracked, fixed or off (empty = Valve's default)
- `radius`: float, default `0.0`, 0–0.45 — Full-resolution radius; 0 keeps the current runtime default
- `level`: str, default empty — Runtime profile: lo, med, hi (empty = Default)
- `test`: bool, default `False` — Darken lower-resolution regions (diagnostic)
- **Catalog games (5):** Ocean Rift, Quantum Void, Tea For God, The 7th Guest VR, Vampire: The Masquerade - Justice.
- **Source:** [patches/settings.py](../src/frameport/patches/settings.py)
> Reduces shading away from the full-resolution area, following each eye's gaze. Default area size keeps the runtime's current profile unchanged. Custom radius is a fraction of the shorter eye-image dimension; the transition ends at twice that radius. Larger areas retain more detail but save less GPU work. Fixed stops the area following your eyes. The optional test darkens actual coarse-shaded fragments. Runtime choices are in Game settings. Tested on RE4, Deadpool and Asgard's Wrath 2. The Climb 2 gets a version-guarded private bridge at 1.0 scale; Batman gets its hash-verified allocation fix (unsupported OVRPlugin versions are refused). Other games may need additional fixes; turn this off if artifacts appear.
> Reduces shading away from the full-resolution area, following each eye's gaze. Default keeps the runtime profile unchanged. Low has the largest full-resolution center; medium and high use smaller centers and stronger peripheral detail reduction. Larger areas retain more detail but save less GPU work. Fixed stops the area following your eyes. The optional test darkens actual coarse-shaded fragments. Runtime choices are in Game settings. Tested on RE4, Deadpool and Asgard's Wrath 2. The Climb 2 gets a version-guarded private bridge at 1.0 scale; Batman gets its hash-verified allocation fix (unsupported OVRPlugin versions are refused). Other games may need additional fixes; turn this off if artifacts appear.
### <a id="device-headset_model"></a>Headset model
@@ -2531,7 +2535,7 @@ Lets typing reach this app from Steam's on-screen keyboard or your PC's keyboard
- `device.text_input_window`
- **Changes:** Install only: written on the Frame when the game is installed; the APK isn't changed.
- **Suggested (on):** App with text fields: key presses only reach a shown Android window.
- **Catalog games (114):** AFFECTED: The Manor, AgeOfJoy, AllInOneSports, Ancient_Dungeon, Arcsmith, Arkio, Assassin's Creed Nexus, Attack on Titan VR: Unbreakable and 106 more.
- **Catalog games (116):** AFFECTED: The Manor, AgeOfJoy, AllInOneSports, Ancient_Dungeon, Arcsmith, Arkio, Assassin's Creed Nexus, Attack on Titan VR: Unbreakable and 108 more.
- **Source:** [patches/settings.py](../src/frameport/patches/settings.py)
> Lepton runs VR apps headless: their Android window is never shown, so it never gets keyboard focus and no key press (Steam's on-screen keyboard, a USB/Bluetooth keyboard, Type on Frame) reaches the app's text fields. With Lepton's lepton-show-flatscreen marker the window is shown (behind the VR view, which keeps working) and Steam's keyboard opens for a selected text field. Steam lists the shown window as "Gamescope" (the Frame's compositor). Pairs with "Make Unity text fields work without a system keyboard".
+3 -1
View File
@@ -20,6 +20,7 @@ version is `catalog/triage.yaml` (used by `frameport test` / the Job screen); ke
| Conversion fails with `NoSuchElementException: Sequence is empty` in `PatcherContext.appName` (GitHub #269, Accounting+) | OVRPort assumes an application label exists; some APKs only label their activity | FramePort retries that exact failure once using a temporary APK whose application inherits the activity's label; existing labels and the original APK are kept |
| Updating a flat Android app after saving its recipe fails with `no OVRPort patches selected` (GitHub #271, Plezy) | older FramePort loads the saved recipe without restoring its unchanged-install setting or applying the flat-app build rules, then tries an empty VR conversion | update FramePort: saved recipes keep `as_is`, and flat apps still skip OVRPort; existing catalog-derived recipes refresh at the next app update. Until then, enable "Install as is" for an app whose APK needs no fixes |
| A launch test suggests a patch (for example triage `sdl-no-clipboard` → `frame.sdl_clipboard`) but the game page doesn't show it / lists it as not applicable; or a game added long ago lacks warnings newer ones get (Android version, web wrapper, missing OBB) (GitHub #104, Dramatic Shape) | the library entry was analyzed by an older FramePort: the analysis field the patch reads (`sdl_java`, `min_sdk`, `web_wrapper`, `expects_obb`, …) is missing, so `applies()` is false | entries whose `analysis.extra.analysis_version` is below `detect.ANALYSIS_VERSION` are analyzed again at the GUI's start (background) and before a build (`pipeline.refresh_analyses`); by hand: game menu → "Analyze again", then Update on Frame. An unreadable APK is marked `analysis_failed` (retried after the next version bump). Adding an analysis field: bump `ANALYSIS_VERSION` |
| Foveation full-resolution area looks identical at 10% and 45% (GitHub #394), while render resolution changes it | `FOVE_INNER`/`FOVE_OUTER` are neither passed through by Lepton nor read by Valve's layer; shared injection uses rectangular density presets | Game settings → Picture now exports named `FOVE_LEVEL=lo/med/hi`; Default preserves the runtime choice. Medium/high shrink the center and reduce peripheral density further. Legacy radius preferences map to the nearest old nominal preset. Compare Fixed + Darken coarse fragments with adapter `snapshot=N` at a fixed render resolution; see FRAME_RUNTIME.md for addresses and profile data. Agent launcher allowlist needs `FOVE_LEVEL`. |
| FDM layer loads but diagnostic logging reports `fdm_injection_CreateInstance: skipped` | Layer loading alone does not enable injection on the tested SteamOS 0.4.5 build; a skipped helper instance alone also does not establish game-wide inactivity | Opt-in `device.foveation` mode `tracked`: loads Valve's layer and sets `FDM_DEBUG=enable`. Batman probe reached foveated render passes with changing per-eye offsets. Validate graphics and matched gameplay GPU time; do not enable globally. Use `debug` only for brief diagnostics, preserving existing flags; never benchmark with debug spam. See FRAME_RUNTIME.md. |
| One eye (usually the right) shimmers or jitters in the 3D view while menus and panels look steady; pacing is clean (GitHub #69, e.g. RTCWQuest, Moss) | Valve's eye-tracked foveation layer (`VALVE_fdm_injection`) moves its low-density regions with each eye's gaze, and the right eye's gaze filter restarts often (`CEyePoseUKF R: Large dt … Bootstrapped` in `~/.local/share/Steam/logs/eyetracking.txt`) | Game settings → Picture → "Foveated rendering (Valve)": **Fixed** (`FDM_DEBUG=disable_offsets`; verify injection remains active on the installed runtime) or **Off** (`VK_INSTANCE_LAYERS=""`); catalog field `foveation:` |
| With `device.foveation` Eye-tracked/Fixed, the sharp area looks right but everything around it is black with scattered coloured blocks (menus on quads too); pacing fine (GitHub #303, Medieval Dynasty; Vampire Survivors reported the same) | Unity's Oculus XR plugin asks for SUBSAMPLED eye images (`XR_META_vulkan_swapchain_create_info`, `VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT`); under Valve's FDM their coarse areas stay in the compact subsampled layout, which the compositor reads as an ordinary image. `foveation_fix=1` only dropped the `XrSwapchainCreateInfoFoveationFB` nodes and passed the META node on. With `foveation_fix=0` + `foveation_storage_fix=1` the adapter logs `foveation_storage_fix: shared allocation SUBSAMPLED cleared` for the eye swapchains | `device.foveation` (tracked/fixed) now also sets `foveation_storage_fix=1`, which clears SUBSAMPLED whatever `foveation_fix` is (generic version of Batman's OVRPlugin allocation fix). Rebuild + reinstall (new adapter). Headless-checked only (72 fps, bit cleared); picture needs the headset |
@@ -122,7 +123,8 @@ version is `catalog/triage.yaml` (used by `frameport test` / the Job screen); ke
| PC VR game judders/stutters although the GPU keeps up; vrcompositor.txt "Timed out. N total" high or frames dropped | the game misses the headset's refresh (for example 96 Hz = 10.4 ms; Stormland's slow frames take 10.7 ms) | `pcvr.steamvr_tuning` (default on): next Play sets SteamVR per-app `preferredRefreshRate` + `motionSmoothingOverride` via `fp_vrsettings.exe` |
| Quest app keeps recentering / snapping the view when you turn your head; log shows session state 5→4→3→4→5 within a second | the Frame briefly takes focus; the app recenters on focus changes | adapter `focus_hold` (on by default; an earlier global debounce made AC Nexus stay black and was removed) |
| Video player / app finds no local videos; MediaProvider "Requested path /home/steamos/... doesn't appear under ..." | Lepton's /sdcard is a symlink to a host path, so Android's media index rejects every file | upload in the Files tab (Videos = /sdcard/Movies) and browse folders in the app |
| Batman: Arkham Shadow closes during smoke-bomb effects; later input-tree corruption | Meta XR Audio Wwise deletes queued metadata still referenced by the current audio frame, then writes through the stale pointer | FrameBridge automatically retires metadata after current-frame references disappear, for the verified AArch64 SDK build only; see [AUDIO_METADATA.md](AUDIO_METADATA.md) |
| Batman: Arkham Shadow closes during smoke-bomb effects; later input-tree corruption | Meta XR Audio Wwise deletes queued metadata still referenced by the current audio frame, then writes through the stale pointer | FrameBridge automatically retires metadata after current-frame references disappear, for the verified AArch64 SDK build only, using a single-word entry branch and nearby stub (hook skipped if no stub fits); see [AUDIO_METADATA.md](AUDIO_METADATA.md) |
| Batman: Arkham Shadow aborts loading a save/scene, with a 26–147 GB allocation through `MetaXRAudioUnityMemoryAllocator.cpp` | The asynchronous audio geometry task retains a native view without its owning UnityWebRequest; source bytes can be reused before parsing | Update Batman on Frame: the adapter copies geometry before background dispatch and releases it after the original worker completes, only for the verified Batman IL2CPP/Meta SDK builds; see [AUDIO_GEOMETRY.md](AUDIO_GEOMETRY.md) |
| Game stays on a loading or "Waiting" box although it reached FOCUSED; log `FrameBridge: xrEndFrame failed -25` then no more `pacing:` lines (for example PowerWash Simulator on some Frames, GitHub #39) | The eye image rect ends a few pixels past its swapchain (Unity rounds the swapchain width, the runtime's recommended size differs per Frame); SteamVR rejects every frame with XR_ERROR_SWAPCHAIN_RECT_INVALID | FrameBridge clamps every projection/quad image rect to its swapchain (`rect_clamp`, default on since 0.11.0; log `rect_clamp: view N image rect clamped`): rebuild + reinstall the game |
| Black from the start, `projection view 0: ... rect=0,0 0x0` then `xrEndFrame failed -25` twice and OVRPlugin "Unable to submit Oculus frame" (BattleTalent, GitHub #293; right after Unity's "Switching to the recommended level" MSAA line) | The game submits its first projection views with an empty image rect; SteamVR rejects them and OVRPlugin gives up submitting | `rect_clamp` replaces an empty rect with the whole swapchain image (log `rect_clamp: view N empty image rect -> full swapchain WxH`): rebuild + reinstall. Check the build output for a WARN from the Unity IL2CPP fixes (`frame.unity_runtime_msaa_off` etc. "code not found in this game"): turned on, they may still change nothing |
| Black flash, then the SteamVR home environment while the game keeps running (sound plays); vrserver.txt `[OpenXR] SetXrInputConfig failed. Failed to load manifest provided by SetXrInputConfig`, then the app "has exited" and reconnects as `VRApplication_OpenXRInstance`; headless launch tests pace at 10 fps (for example Scared By Squares, GitHub #323) | Two controller actions in one action set share a name (Unreal: an action mapping and an axis mapping both called "Turn"). The Frame's runtime accepts the duplicate but can't load the input manifest it builds and drops the app as a scene app | FrameBridge gives the later duplicate a free name (`action_dedup`, default on; log `action_dedup: action "turn" ("Turn") already exists in its set: created as "turn_2"`): rebuild + reinstall the game. `input_diag=1` logs every action set and action the game creates |
+1
View File
@@ -87,6 +87,7 @@ shots:
steps:
- go: monitor
- wait_for: "Processes"
- hook: monitor_settled # the history replay finished (a slow runner shot it halfway: numbers differed)
# newer screens (docs/SHOWCASE.md's gallery; the README picks what it needs)
- name: live-view # idle: a running stream shows its relay's random port and the data rate (no stable picture)
+151
View File
@@ -0,0 +1,151 @@
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#ifndef MAP_FIXED_NOREPLACE
#define MAP_FIXED_NOREPLACE 0x100000
#endif
#include <string.h>
#include <sys/mman.h>
static size_t mx_audio_page;
static int mx_audio_branch(uintptr_t from,uintptr_t to,uint32_t *word) {
if((from|to)&3)return 0;
if(to>=from) {if(to-from>=((uintptr_t)1<<27))return 0;}
else if(from-to>((uintptr_t)1<<27))return 0;
*word=0x14000000u|((uint32_t)((to-from)>>2)&0x03ffffffu);
return 1;
}
static void mx_audio_jump(unsigned char *out,uintptr_t destination) {
const uint32_t jump[2]={0x58000050u,0xd61f0200u};
memcpy(out,jump,8);memcpy(out+8,&destination,8);
}
struct mx_audio_candidate { uintptr_t address,distance; };
static int mx_audio_candidate_order(const void *a,const void *b) {
const struct mx_audio_candidate *x=a,*y=b;
if(x->distance!=y->distance)return x->distance<y->distance?-1:1;
return x->address<y->address?-1:x->address>y->address;
}
// Maps are sorted by address. Clip every free gap to the intersection of both
// branch ranges; enumerate pages, then sort outward (lower address breaks ties).
static int mx_audio_candidates(FILE *maps,uintptr_t target,
struct mx_audio_candidate **out,size_t *count,const char **failure) {
uintptr_t radius=(uintptr_t)1<<27;
uintptr_t low=target>radius?target-radius:0;
uintptr_t high=target>UINTPTR_MAX-radius?UINTPTR_MAX:target+radius;
uintptr_t cursor=low;
size_t capacity=0,line_capacity=0;char *line=NULL;
*out=NULL;*count=0;
for(;;) {
unsigned long long start,end;
*failure="read /proc/self/maps";
int eof=getline(&line,&line_capacity,maps)<0;
if(eof && (ferror(maps) || !feof(maps)))goto fail;
if(!eof && (sscanf(line,"%llx-%llx",&start,&end)!=2 || end<=start)) {*failure="parse /proc/self/maps";errno=EINVAL;goto fail;}
uintptr_t stop=eof?high:(uintptr_t)start;
if(stop>high)stop=high;
uintptr_t page=cursor;
if(page%mx_audio_page)page+=mx_audio_page-page%mx_audio_page;
for(;page<stop && stop-page>=mx_audio_page;page+=mx_audio_page) {
uint32_t word;
if(!page || !mx_audio_branch(target,page,&word) ||
!mx_audio_branch(page+20,target+4,&word))continue;
if(*count==capacity) {
size_t next=capacity?capacity*2:64;
void *p=realloc(*out,next*sizeof(**out));
if(!p){*failure="allocate stub candidates";goto fail;}
*out=p;capacity=next;
}
(*out)[(*count)++]=(struct mx_audio_candidate){page,page>target?page-target:target-page};
}
if(eof || stop==high)break;
if((uintptr_t)end>cursor)cursor=(uintptr_t)end;
if(cursor>=high)break;
}
free(line);
if(*count)qsort(*out,*count,sizeof(**out),mx_audio_candidate_order);
return 1;
fail:
{int saved=errno;free(line);free(*out);*out=NULL;*count=0;errno=saved;return 0;}
}
// Callers serialize installation. Only the verified SUB SP / STP prologues
// below may be replayed: no PC-relative instruction or branch relocation.
static void *mx_audio_detour(unsigned char *address,void *replacement,const uint32_t expected[4],void *original_slot) {
uint32_t branch;
uintptr_t target=(uintptr_t)address;
const char *failure=NULL;int failure_errno=0,rollback_errno=0;
if(target&3)failure="unaligned entry";
else if(memcmp(address,expected,16))failure="16-byte guard mismatch";
else if(expected[0]!=0xd10743ffu && expected[0]!=0xa9bd7bfdu &&
expected[0]!=0xd10243ffu && expected[0]!=0xd10183ffu)
failure="unsupported replay instruction";
if(failure) {
LOG("FrameBridge audio detour: target=%p failed: %s; entry unchanged",address,failure);
return NULL;
}
if(!mx_audio_page || (mx_audio_page&(mx_audio_page-1))) {
LOG("FrameBridge audio detour: target=%p failed: invalid page size=%zu; entry unchanged",address,mx_audio_page);
return NULL;
}
struct mx_audio_candidate *candidates=NULL;size_t count=0;
FILE *maps=fopen("/proc/self/maps","r");
if(!maps) {
LOG("FrameBridge audio detour: target=%p failed: open /proc/self/maps errno=%d; entry unchanged",address,errno);
return NULL;
}
int parsed=mx_audio_candidates(maps,target,&candidates,&count,&failure);
int parse_errno=errno;fclose(maps);
if(!parsed) {
LOG("FrameBridge audio detour: target=%p failed: %s errno=%d; entry unchanged",address,failure,parse_errno);
return NULL;
}
unsigned char *code=MAP_FAILED;void *result=MAP_FAILED,*attempt=NULL;
void *closest=count?(void*)candidates[0].address:NULL;
int map_errno=0;size_t attempts=0;
for(size_t i=0;i<count;i++) {
attempt=(void*)candidates[i].address;attempts++;
result=mmap(attempt,mx_audio_page,PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED_NOREPLACE,-1,0);
if(result==MAP_FAILED) {map_errno=errno;continue;}
// Old kernels may ignore NOREPLACE. Never accept a relocated mapping.
if(result!=attempt) {munmap(result,mx_audio_page);map_errno=0;continue;}
code=result;break;
}
free(candidates);
if(code==MAP_FAILED) {
LOG("FrameBridge audio detour: target=%p failed: stub allocation closest=%p attempted=%p mmap=%p errno=%d attempts=%zu; no safe ELF slack fallback; entry unchanged",
address,closest,attempt,result,map_errno,attempts);
return NULL;
}
uint32_t back;
if(!mx_audio_branch(target,(uintptr_t)code,&branch) ||
!mx_audio_branch((uintptr_t)code+20,target+4,&back)) {
failure="branch range validation";goto fail;
}
mx_audio_jump(code,(uintptr_t)replacement);
memcpy(code+16,expected,4);memcpy(code+20,&back,4);
__builtin___clear_cache((char*)code,(char*)code+24);
if(mprotect(code,mx_audio_page,PROT_READ|PROT_EXEC)) {failure="mprotect stub RX";failure_errno=errno;goto fail;}
unsigned char *page=(void*)(target&~(mx_audio_page-1));
if(mprotect(page,mx_audio_page,PROT_READ|PROT_WRITE|PROT_EXEC)) {failure="mprotect entry RWX";failure_errno=errno;goto fail;}
// Publish the callable original before any worker can enter the hook.
if(original_slot)__atomic_store_n((void**)original_slot,code+16,__ATOMIC_RELEASE);
__atomic_store_n((uint32_t*)address,branch,__ATOMIC_RELEASE);
__builtin___clear_cache((char*)address,(char*)address+4);
if(mprotect(page,mx_audio_page,PROT_READ|PROT_EXEC)) {
failure_errno=errno;
__atomic_store_n((uint32_t*)address,expected[0],__ATOMIC_RELEASE);
__builtin___clear_cache((char*)address,(char*)address+4);
if(mprotect(page,mx_audio_page,PROT_READ|PROT_EXEC))
rollback_errno=errno; // Cannot force the kernel to restore RX.
// A worker may already be in the stub/hook/trampoline. No grace period
// exists here, so neither the mapping nor original_slot can be retired.
LOG("FrameBridge audio detour: target=%p failed: mprotect entry RX errno=%d; rollback mprotect entry RX errno=%d; entry restored; published code retained",address,failure_errno,rollback_errno);return NULL;
}
return code+16;
fail:
munmap(code,mx_audio_page);
LOG("FrameBridge audio detour: target=%p failed: %s errno=%d; entry unchanged",address,failure,failure_errno);return NULL;
}
+54
View File
@@ -0,0 +1,54 @@
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// The source NativeArray belongs to a UnityWebRequest. Copy while its caller
// still owns that request, before async-void queues the background parser.
typedef struct MxGeometryOwned {
struct MxGeometryOwned *next;
size_t size;
unsigned char bytes[];
} MxGeometryOwned;
static pthread_mutex_t mx_geometry_owned_mutex=PTHREAD_MUTEX_INITIALIZER;
static MxGeometryOwned *mx_geometry_owned_head;
static unsigned mx_geometry_queued,mx_geometry_finished;
static void (*mx_geometry_queue_original)(void*,const void*,uint64_t,void*);
static void (*mx_geometry_worker_original)(void*,void*);
static void mx_geometry_queue(void *object,const void *data,uint64_t packed_length,void *method) {
void (*original)(void*,const void*,uint64_t,void*);
while(!(original=__atomic_load_n(&mx_geometry_queue_original,__ATOMIC_ACQUIRE)))sched_yield();
int32_t length=(int32_t)(uint32_t)packed_length;
size_t size=length>0?(size_t)length:0;
if(!data || !size || size>SIZE_MAX-sizeof(MxGeometryOwned)){original(object,data,packed_length,method);return;}
MxGeometryOwned *owned=malloc(sizeof(*owned)+size);
if(!owned){original(object,data,packed_length,method);return;}
owned->size=size;
memcpy(owned->bytes,data,size);
pthread_mutex_lock(&mx_geometry_owned_mutex);
owned->next=mx_geometry_owned_head;mx_geometry_owned_head=owned;
pthread_mutex_unlock(&mx_geometry_owned_mutex);
unsigned queued=__atomic_fetch_add(&mx_geometry_queued,1,__ATOMIC_RELAXED);
if(queued<4)LOG("FrameBridge audio geometry: owned %zu bytes before background task queued",size);
original(object,owned->bytes,packed_length,method);
}
static void mx_geometry_worker(void *closure,void *method) {
const void *data=NULL;
if(closure)memcpy(&data,(const unsigned char*)closure+16,8);
void (*original)(void*,void*);
while(!(original=__atomic_load_n(&mx_geometry_worker_original,__ATOMIC_ACQUIRE)))sched_yield();
original(closure,method);
MxGeometryOwned *finished=NULL;
pthread_mutex_lock(&mx_geometry_owned_mutex);
for(MxGeometryOwned **p=&mx_geometry_owned_head;*p;p=&(*p)->next)if((*p)->bytes==data) {
finished=*p;*p=finished->next;break;
}
pthread_mutex_unlock(&mx_geometry_owned_mutex);
if(finished) {
unsigned count=__atomic_fetch_add(&mx_geometry_finished,1,__ATOMIC_RELAXED);
if(count<4)LOG("FrameBridge audio geometry: background parse finished; releasing %zu owned bytes",finished->size);
free(finished);
}
}
+11 -26
View File
@@ -11,26 +11,7 @@
#include <time.h>
#include <link.h>
#include <string.h>
static size_t mx_audio_page;
static void *mx_audio_detour(unsigned char *address,void *replacement,const uint32_t expected[4]) {
if(memcmp(address,expected,16)) return NULL;
unsigned char *trampoline=mmap(NULL,mx_audio_page,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
if(trampoline==MAP_FAILED) return NULL;
uint32_t branch[2]={0x58000050u,0xd61f0200u}; // ldr x16, +8; br x16
memcpy(trampoline,address,16);
memcpy(trampoline+16,branch,8);
uintptr_t continuation=(uintptr_t)address+16;
memcpy(trampoline+24,&continuation,8);
__builtin___clear_cache((char*)trampoline,(char*)trampoline+32);
if(mprotect(trampoline,mx_audio_page,PROT_READ|PROT_EXEC)) return NULL;
unsigned char *page=(unsigned char*)((uintptr_t)address&~(mx_audio_page-1));
if(mprotect(page,mx_audio_page,PROT_READ|PROT_WRITE|PROT_EXEC)) return NULL;
memcpy(address,branch,8);
memcpy(address+8,&replacement,8);
__builtin___clear_cache((char*)address,(char*)address+16);
mprotect(page,mx_audio_page,PROT_READ|PROT_EXEC);
return trampoline;
}
#include "audio_detour.h"
#include "audio_metadata_queue.h"
typedef struct {float previous,current;} MxAudioRamp;
static uintptr_t mx_audio_base;
@@ -49,8 +30,8 @@ static void mx_audio_kill_experimental(void) {mx_audio_kill(1);}
static void mx_audio_kill_regular(void) {mx_audio_kill(0);}
static uint64_t mx_audio_consume(void *sink,void *main_mix,void *passthrough,const void *objects,MxAudioRamp ramp) {
const unsigned char *previous=mx_audio_objects;mx_audio_objects=objects;
// An audio thread can enter just after its prologue was patched, before
// the installing thread publishes the completed trampoline.
// The installer publishes the completed trampoline before the entry branch.
// Keep the acquire load paired with that publication.
uint64_t (*original)(void*,void*,void*,const void*,MxAudioRamp);
while(!(original=__atomic_load_n(&mx_audio_consume_original,__ATOMIC_ACQUIRE)))sched_yield();
uint64_t result=original(sink,main_mix,passthrough,objects,ramp);
@@ -79,15 +60,19 @@ static int mx_audio_find(struct dl_phdr_info *info,size_t size,void *unused) {
const uint32_t kill[4]={0xa9bd7bfd,0xf9000bf5,0xa9024ff4,0x910003fd};
unsigned char *base=(void*)info->dlpi_addr;
if(memcmp(base+0x2c8fac,consume,16) || memcmp(base+0x2be2c0,kill,16) || memcmp(base+0x2be7b0,kill,16)) {
const uintptr_t offsets[3]={0x2c8fac,0x2be2c0,0x2be7b0};
for(unsigned i=0;i<3;i++)if(memcmp(base+offsets[i],i?kill:consume,16))
LOG("FrameBridge audio detour: target=%p failed: 16-byte guard mismatch; entry unchanged",base+offsets[i]);
__atomic_store_n(&mx_audio_checked,1,__ATOMIC_RELEASE);return 1;
}
// One installation attempt per verified library, including failure paths.
__atomic_store_n(&mx_audio_checked,1,__ATOMIC_RELEASE);
__atomic_store_n(&mx_audio_base,info->dlpi_addr,__ATOMIC_RELEASE);
void *original=mx_audio_detour(base+0x2c8fac,(void*)mx_audio_consume,consume);
__atomic_store_n(&mx_audio_consume_original,original,__ATOMIC_RELEASE);
if(!__atomic_load_n(&mx_audio_consume_original,__ATOMIC_ACQUIRE)) {
void *original=mx_audio_detour(base+0x2c8fac,(void*)mx_audio_consume,consume,&mx_audio_consume_original);
if(!original) {
__atomic_store_n(&mx_audio_base,0,__ATOMIC_RELEASE);return 1;
}
if(!mx_audio_detour(base+0x2be2c0,(void*)mx_audio_kill_experimental,kill) || !mx_audio_detour(base+0x2be7b0,(void*)mx_audio_kill_regular,kill)) {
if(!mx_audio_detour(base+0x2be2c0,(void*)mx_audio_kill_experimental,kill,NULL) || !mx_audio_detour(base+0x2be7b0,(void*)mx_audio_kill_regular,kill,NULL)) {
LOG("FrameBridge audio metadata: incomplete installation");return 1;
}
LOG("FrameBridge audio metadata: metadata reclamation follows current audio-frame references; Meta audio base=%p",base);
+66
View File
@@ -0,0 +1,66 @@
// SPDX-License-Identifier: GPL-3.0-only
// Batman 1.4.1: keep the web request's native audio data alive across Task.Run.
#pragma once
#if defined(__aarch64__)
#include "audio_geometry_owned.h"
#include "batman_audio_geometry_target.h"
static int mx_geometry_checked;
static int mx_geometry_find(struct dl_phdr_info *info,size_t ignored,void *unused) {
(void)ignored;(void)unused;
if(!strstr(info->dlpi_name,"/libil2cpp.so"))return 0;
int match=0;
for(unsigned i=0;i<info->dlpi_phnum;i++)if(info->dlpi_phdr[i].p_type==PT_NOTE) {
const unsigned char *p=(void*)(info->dlpi_addr+info->dlpi_phdr[i].p_vaddr);
const unsigned char *end=p+info->dlpi_phdr[i].p_memsz;
while(p+sizeof(Elf64_Nhdr)<=end) {
const Elf64_Nhdr *note=(const void*)p;
const unsigned char *name=p+sizeof(*note),*desc=name+((note->n_namesz+3)&~3u);
const unsigned char *next=desc+((note->n_descsz+3)&~3u);
if(next>end || next<=p)break;
if(note->n_type==NT_GNU_BUILD_ID && note->n_namesz==4 && !memcmp(name,"GNU",4) &&
mx_geometry_matches_id(desc,note->n_descsz))match=1;
p=next;
}
}
__atomic_store_n(&mx_geometry_checked,1,__ATOMIC_RELEASE);
if(!match)return 1;
unsigned char *base=(void*)info->dlpi_addr;
// Live VAs, not the file offsets printed by the managed-code dump.
unsigned char *queue=base+0x2e61bb4,*worker=base+0x2e63a28;
if(!mx_geometry_matches_entries(queue,worker)) {
if(memcmp(queue,mx_geometry_queue_entry,16))
LOG("FrameBridge audio detour: target=%p failed: 16-byte guard mismatch; entry unchanged",queue);
if(memcmp(worker,mx_geometry_worker_entry,16))
LOG("FrameBridge audio detour: target=%p failed: 16-byte guard mismatch; entry unchanged",worker);
return 1;
}
// Hook the completion boundary first so every queued copy has a consumer.
void *original=mx_audio_detour(worker,(void*)mx_geometry_worker,mx_geometry_worker_entry,&mx_geometry_worker_original);
if(!original)return 1;
original=mx_audio_detour(queue,(void*)mx_geometry_queue,mx_geometry_queue_entry,&mx_geometry_queue_original);
LOG("FrameBridge audio geometry: Batman async input lifetime %s",original?"installed":"not installed");
return 1;
}
static pthread_mutex_t mx_geometry_install_mutex=PTHREAD_MUTEX_INITIALIZER;
static void mx_batman_geometry_initialize(void) {
// The metadata initializer already verified the Meta SDK build/prologues.
// Keep this independent of its early-out: IL2CPP may be loaded afterwards.
if(__atomic_load_n(&mx_geometry_checked,__ATOMIC_ACQUIRE) ||
!__atomic_load_n(&mx_audio_base,__ATOMIC_ACQUIRE))return;
if(pthread_mutex_trylock(&mx_geometry_install_mutex))return;
if(!mx_geometry_checked) {
static time_t last_scan;
struct timespec now;clock_gettime(CLOCK_MONOTONIC,&now);
if(now.tv_sec!=last_scan) {
last_scan=now.tv_sec;
char package[64]={0};FILE *cmd=fopen("/proc/self/cmdline","rb");
if(cmd){(void)fread(package,1,sizeof(package)-1,cmd);fclose(cmd);}
if(strcmp(package,"com.camouflaj.manta"))__atomic_store_n(&mx_geometry_checked,1,__ATOMIC_RELEASE);
else dl_iterate_phdr(mx_geometry_find,NULL);
}
}
pthread_mutex_unlock(&mx_geometry_install_mutex);
}
#else
static void mx_batman_geometry_initialize(void) {}
#endif
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <stdint.h>
#include <stddef.h>
#include <string.h>
static const unsigned char mx_geometry_il2cpp_id[20]={
0x1d,0x48,0xa4,0x1d,0x7e,0x90,0x11,0xbe,0xf5,0xfa,0xe0,0xc2,0x3c,0x40,0x4c,0x62,0xa4,0xe7,0xa7,0x3c
};
static const uint32_t mx_geometry_queue_entry[4]={0xd10243ff,0xa9065ffe,0xa90757f6,0xa9084ff4};
static const uint32_t mx_geometry_worker_entry[4]={0xd10183ff,0xa90267fe,0xa9035ff8,0xa90457f6};
static int mx_geometry_matches_id(const void *id,size_t size) {
return size==sizeof(mx_geometry_il2cpp_id) && !memcmp(id,mx_geometry_il2cpp_id,size);
}
static int mx_geometry_matches_entries(const void *queue,const void *worker) {
return !memcmp(queue,mx_geometry_queue_entry,sizeof(mx_geometry_queue_entry)) &&
!memcmp(worker,mx_geometry_worker_entry,sizeof(mx_geometry_worker_entry));
}
+4 -3
View File
@@ -77,6 +77,7 @@ static void fb_log(const char *fmt, ...) {
}
#define LOG(...) fb_log(__VA_ARGS__)
#include "audio_metadata.h"
#include "batman_audio_geometry.h"
#include "surface_views.h"
static void *loader;
@@ -469,7 +470,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrCreateInstance(const XrInstanceCreateInfo *info
}
no_equirect = !has_equirect; no_equirect2 = !has_equirect2; no_cylinder = !has_cylinder; no_cube = !has_cube;
free(available);
mx_audio_initialize();
mx_audio_initialize(); mx_batman_geometry_initialize();
XrResult result = fn(&fixed, instance);
free(names);
LOG("xrCreateInstance result=%d", result);
@@ -481,7 +482,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrCreateInstance(const XrInstanceCreateInfo *info
LOG("color_space: emulating XR_FB_color_space; REC709 SDR compatibility, no colour conversion");
}
}
if (XR_SUCCEEDED(result)) { active_instance = *instance; mx_audio_initialize(); }
if (XR_SUCCEEDED(result)) { active_instance = *instance; mx_audio_initialize(); mx_batman_geometry_initialize(); }
return result;
}
@@ -1394,7 +1395,7 @@ static XrSession focused_session = XR_NULL_HANDLE;
static int kicks_pending = -1; // -1: not yet armed
XRAPI_ATTR XrResult XRAPI_CALL xrPollEvent(XrInstance instance, XrEventDataBuffer *event) {
mx_audio_initialize();
mx_audio_initialize(); mx_batman_geometry_initialize();
PFN_xrPollEvent fn = (PFN_xrPollEvent)lookup(instance, "xrPollEvent");
if (!fn) return XR_ERROR_FUNCTION_UNSUPPORTED;
if (emulate_scene && event) {
+1 -1
View File
@@ -56,7 +56,7 @@ def from_data() -> dict:
for t in (p.title, p.description, p.summary):
if t:
texts[t] = ""
for attr in ("CHOICES", "RADIUS_CHOICES"):
for attr in ("CHOICES", "LEVEL_CHOICES"):
for _, label in getattr(p, attr, ()):
texts[label] = ""
for _, title in GROUPS: # the Game settings dialog
+1 -1
View File
@@ -92,7 +92,7 @@ def _entry(spec: dict, tech: dict, now: float) -> dict:
rdict = library.recipe_to_dict(recipe)
fields = dict(title=title, name=title, data_bytes=tech.get("data_bytes") or 0, analysis=a.to_dict(),
recipe=rdict, suggested=rdict, status=recipe.status, added=now - DAY * spec.get("added", 30),
build={"sha256": fake_sha(pkg), "ok": True, "recipe_fp": recipe_fingerprint(rdict),
build={"sha256": fake_sha(pkg), "ok": True, "recipe_fp": recipe_fingerprint(rdict, pkg),
"applied": sorted(p for p in rdict.get("patches") or {} if "." in p)})
if rift:
folder = f"D:/Games/PC VR/{title}"
+16
View File
@@ -634,6 +634,16 @@ class FrozenMonitorSession(FakeMonitorSession):
"""The fake stream for still pictures: the two minutes of history, then nothing new (every render of a page shows
the same numbers, whenever the screenshot is taken)."""
# the newest session (the Monitor tab's faster interval starts a new one after the Frame card's) and whether it
# has replayed its history; the monitor_settled hook waits for that, else a slow machine shot the page halfway
# through the replay (set_modules("all") asks for the replay again)
LATEST: FrozenMonitorSession | None = None
def __init__(self, *args, **kwargs):
self.settled = threading.Event()
FrozenMonitorSession.LATEST = self
super().__init__(*args, **kwargs)
def _run(self) -> None:
self.t = 0
while not self.closed:
@@ -641,8 +651,14 @@ class FrozenMonitorSession(FakeMonitorSession):
self.on_sample(self._sample())
self.t += 1
else:
self.settled.set()
time.sleep(0.2)
def set_modules(self, m):
if m == "all":
self.settled.clear()
return super().set_modules(m)
class LiveMonitorSession(FakeMonitorSession):
"""The fake stream, livelier for videos: a sample every 0.6 s and a steady frame rate with a short, shallow dip
+16 -1
View File
@@ -240,6 +240,20 @@ def _monitor_details(session) -> None:
fakes.open_monitor_details(session.app)
def _monitor_settled(session, timeout: float = 30) -> None:
"""Still pictures of the Monitor: wait until the frozen stream has replayed its history (then one more second
for the page to draw the last sample)."""
end = time.monotonic() + timeout
while time.monotonic() < end: # the newest session, settled, and still the newest a moment later
session_ = fakes.FrozenMonitorSession.LATEST
if session_ is None:
time.sleep(0.2)
elif session_.settled.wait(max(0.0, end - time.monotonic())):
time.sleep(1)
if fakes.FrozenMonitorSession.LATEST is session_ and session_.settled.is_set():
return
def _type_tab(session) -> None:
fakes.open_type_tab(session.app)
@@ -399,4 +413,5 @@ HOOKS = {"fake_install": _fake_install, "wait_jobs": _wait_jobs, "held_install":
"settings_section": _settings_section, "first_run": _first_run, "pairing_done": _pairing_done,
"frame_asks": _frame_asks,
"easter_eggs": _easter_eggs, "fps_dip": _fps_dip, "perfect_pacing": _perfect_pacing,
"battery": _battery, "long_upload": _long_upload, "press_keys": _press_keys}
"battery": _battery, "long_upload": _long_upload, "press_keys": _press_keys,
"monitor_settled": _monitor_settled}
+5 -10
View File
@@ -39,17 +39,11 @@
", {n} screenshots": "",
"0 = the size of your play area.": "",
"10 games on the Frame. It's getting cozy in there.": "",
"10% radius": "",
"100 games on the Frame. The Frame thanks you.": "",
"108 Hz": "",
"120 Hz": "",
"144 Hz": "",
"15% radius": "",
"20% radius": "",
"25% radius": "",
"30% radius": "",
"32-bit ARM bridge (Gear VR / Go games)": "",
"35% radius": "",
"360p (lightest)": "",
"360° (equirect) layers, for example a video player's virtual theater or 360° videos (for example 4XVR), which the Frame's runtime lacks, are drawn by a background thread into a layer behind the game's own picture: the 360° image is converted only when it changes (a theater once, a 360° video once per video frame) and the view is drawn for each frame's head pose. GLES games only; without it these layers are missing (black).": "",
"360° 3D": "",
@@ -58,8 +52,6 @@
"360° pictures and video": "",
"360° sharpness": "",
"360° video frame rate limit": "",
"40% radius": "",
"45% radius": "",
"72 Hz": "",
"720p (recommended)": "",
"80 Hz": "",
@@ -392,7 +384,7 @@
"Declares Meta's permissions some mixed-reality games ask for, so they don't stop.": "",
"Decodes the game's videos on the Frame's hardware video decoder instead of Android's software decoders, which stutter or fall behind with 4K/8K video (for example video players, Batman: Arkham Shadow's cutscenes). Adds FramePort's codec plugin (OMX.frameport.avc/hevc/vp9.decoder) to this game's container only; the APK isn't changed. When the hardware is busy (for example Steam's own hardware video decoding is on) the video is decoded in software as before.": "",
"Default": "",
"Default (30% radius)": "",
"Default (large)": "",
"Delete": "",
"Delete {names}?": "",
"Delete {n} items…": "",
@@ -864,6 +856,7 @@
"kshoji's USB MIDI driver (Unity MIDI plugins, for example PianoVision) polls Android's USB service for MIDI devices; the Frame's Android has no USB service, so the app crashes a few seconds after start (NullPointerException on MidiDeviceConnectionWatchThread). The poll returns at once instead, so no USB MIDI device is ever found (an in-place edit of classes.dex).": "",
"Language": "",
"Language packs from the game's files": "",
"Large": "",
"Large files upload together using OpenSSH when available. Default: 3. Lower this on a busy network.": "",
"Larger areas retain more detail but save less GPU work.": "",
"Last build": "",
@@ -977,6 +970,7 @@
"Marks the game as a VR app so headsets show it as one.": "",
"Maximum": "",
"Maximum size in pixels of each face of the cube the 360° image is converted to (256–2730). Higher is sharper but uses more GPU memory.": "",
"Medium (saves more)": "",
"Memory": "",
"Memory used by everything on the Frame. \"Waiting\" is how often programs waited for memory in the last 10 s; when it climbs, the Frame may freeze or close a game.": "",
"Menus and screens": "",
@@ -1301,7 +1295,7 @@
"Reconnect": "",
"Recreate spaces after the first frames (diagnostic).": "",
"Reduce motion": "",
"Reduces shading away from the full-resolution area, following each eye's gaze. Default area size keeps the runtime's current profile unchanged. Custom radius is a fraction of the shorter eye-image dimension; the transition ends at twice that radius. Larger areas retain more detail but save less GPU work. Fixed stops the area following your eyes. The optional test darkens actual coarse-shaded fragments. Runtime choices are in Game settings. Tested on RE4, Deadpool and Asgard's Wrath 2. The Climb 2 gets a version-guarded private bridge at 1.0 scale; Batman gets its hash-verified allocation fix (unsupported OVRPlugin versions are refused). Other games may need additional fixes; turn this off if artifacts appear.": "",
"Reduces shading away from the full-resolution area, following each eye's gaze. Default keeps the runtime profile unchanged. Low has the largest full-resolution center; medium and high use smaller centers and stronger peripheral detail reduction. Larger areas retain more detail but save less GPU work. Fixed stops the area following your eyes. The optional test darkens actual coarse-shaded fragments. Runtime choices are in Game settings. Tested on RE4, Deadpool and Asgard's Wrath 2. The Climb 2 gets a version-guarded private bridge at 1.0 scale; Batman gets its hash-verified allocation fix (unsupported OVRPlugin versions are refused). Other games may need additional fixes; turn this off if artifacts appear.": "",
"Reduces shading away from the full-resolution area. Changes apply at the next game start.": "",
"Refresh": "",
"Refresh rate": "",
@@ -1522,6 +1516,7 @@
"Skips Meta XR Audio's telemetry under x86_64 ARM translation (emulators). Not needed on the Frame, which runs games natively.": "",
"Skips picture layers the Frame would refuse. Leave it on.": "",
"Sleep": "",
"Small (saves most)": "",
"Smooth as butter": "",
"software encoder": "",
"Some apps open a flat Android launcher that then starts a separate VR activity (for example WiiCompiled). Shown with Lepton's flat window, that window stays in view after the VR part starts. This makes the VR activity the one Lepton starts (its LAUNCHER category), so the app opens in VR with no flat window. Everything only the launcher does (choosing or importing content) is skipped: turn it off for a run when you need the launcher, and turn off \"Show the app's Android window\".": "",
+1
View File
@@ -24,6 +24,7 @@ def settings_text(recipe_patches: dict) -> bytes:
class FrameBridgeAdapter(Patch):
id = "frame.adapter"
package_revisions = {"com.camouflaj.manta": 3} # above revision 2: Batman builds before #389 are outdated
a32 = True # also for 32-bit games on the bridge
title = "FrameBridge OpenXR adapter"
description = (
+8 -1
View File
@@ -91,7 +91,14 @@ class HeadsetModel(Patch):
if not ws.has(ws.lib(loader)):
ctx.checks.append((self.id, None, "No OVRPort dispatcher; only FrameBridge's systemName override applies."))
return False
fixed = patch_dispatcher(ws.read_lib(loader), key)
try:
fixed = patch_dispatcher(ws.read_lib(loader), key)
except ValueError:
# Quest 3 is everyone's default: an APK converted with another OVRPort runtime (e.g. an already converted
# copy) keeps OVRPort's Quest 2 answers instead of failing its build
ctx.checks.append((self.id, None, "This OVRPort dispatcher isn't a known build; the game keeps seeing a "
"Quest 2 (only FrameBridge's systemName override applies)."))
return False
ws.put(ws.lib(loader), fixed)
ctx.notes.append(f"{loader}: systemName={SYSTEM_NAMES[key].decode()}, HeadsetId={UUIDS[key].hex()}")
return True
@@ -152,8 +152,9 @@ class UnrealNoReserve(Patch):
if not lib or ws.abi != "arm64-v8a":
return []
todo, done = mmap_sites(ws.read_lib(lib))
return [("Unreal memory reservations use MAP_NORESERVE", bool(done) and not todo,
f"{len(done)} rewritten, {len(todo)} left")]
# nothing to rewrite (an engine build without these reservations, e.g. Lies Beneath, GitHub #393) passes
return [("Unreal memory reservations use MAP_NORESERVE", not todo,
f"{len(done)} rewritten, {len(todo)} left" if todo or done else "none in this build")]
register(UnrealNoReserve)
+37 -21
View File
@@ -300,7 +300,7 @@ REFRESH_CHOICES = [(0.0, "Game's choice"), *((float(hz), f"{hz} Hz") for hz in (
FOVEATION_UI = {
"mode": dict(group="picture", level="common", label="Foveated rendering (Valve)",
help="Reduces shading away from the full-resolution area. Changes apply at the next game start."),
"radius": dict(group="picture", level="common", label="Full-resolution area",
"level": dict(group="picture", level="common", label="Full-resolution area",
help="Larger areas retain more detail but save less GPU work."),
"test": dict(group="picture", level="advanced", label="Darken coarse fragments (test)",
help="Diagnostic only; do not use for benchmarking."),
@@ -809,23 +809,33 @@ def foveation_options(params):
mode = params.get("mode") or ""
if mode not in ("", "tracked", "fixed", "off"):
raise ValueError("Unknown foveation mode")
radius = float(params.get("radius") or 0)
if not math.isfinite(radius) or (radius != 0 and not 0.05 <= radius <= 0.45):
raise ValueError("Full-resolution radius must be Default (0), or 0.05–0.45")
level = params.get("level", "")
if "level" not in params and params.get("radius"):
# Old radius exports never reached the layer. Preserve intent with a supported
# preset; unknown legacy values restore Default. No numeric FOVE_LEVEL values.
try:
radius = float(params["radius"])
except (ValueError, TypeError):
radius = 0
if math.isfinite(radius) and 0.05 <= radius <= 0.45:
level = min(((.30, "lo"), (.25, "med"), (.20, "hi")),
key=lambda pair: abs(pair[0] - radius))[1]
if level not in ("", "lo", "med", "hi"):
raise ValueError("Unknown foveation profile")
test = params.get("test", False)
if not isinstance(test, bool):
raise ValueError("Foveation test mode must be a boolean")
if (test or radius) and mode not in ("tracked", "fixed"):
if (test or level) and mode not in ("tracked", "fixed"):
raise ValueError("Choose Eye-tracked or Fixed before configuring foveation size or test mode")
return mode, radius, test
return mode, level, test
class Foveation(Patch):
id = "device.foveation"
title = "Foveated rendering (Valve)"
description = ("Reduces shading away from the full-resolution area, following each eye's gaze. "
"Default area size keeps the runtime's current profile unchanged. Custom radius is a fraction "
"of the shorter eye-image dimension; the transition ends at twice that radius. Larger areas "
"Default keeps the runtime profile unchanged. Low has the largest full-resolution center; medium and high "
"use smaller centers and stronger peripheral detail reduction. Larger areas "
"retain more detail but save less GPU work. Fixed stops the area following your eyes. "
"The optional test darkens actual coarse-shaded fragments. Runtime choices are in Game settings. "
"Tested on RE4, Deadpool and Asgard's Wrath 2. "
@@ -840,13 +850,13 @@ class Foveation(Patch):
experimental = True
params = [Param("support", "bool", False, "Internal APK compatibility support"),
Param("mode", "str", "", "Catalog default: tracked, fixed or off (empty = Valve's default)"),
Param("radius", "float", 0.0, "Full-resolution radius; 0 keeps the current runtime default", 0, 0.45),
Param("level", "str", "", "Runtime profile: lo, med, hi (empty = Default)"),
Param("test", "bool", False, "Darken lower-resolution regions (diagnostic)")]
CHOICES = (("", "Default"), ("tracked", "Eye-tracked"),
("fixed", "Fixed (doesn't follow the eyes)"), ("off", "Off"))
RADIUS_CHOICES = (("0", "Default (30% radius)"), ("0.1", "10% radius"), ("0.15", "15% radius"),
("0.2", "20% radius"), ("0.25", "25% radius"), ("0.3", "30% radius"),
("0.35", "35% radius"), ("0.4", "40% radius"), ("0.45", "45% radius"))
# Valve's layer starts at lo when FOVE_LEVEL is unset, so Default is the large area
LEVEL_CHOICES = (("", "Default (large)"), ("lo", "Large"), ("med", "Medium (saves more)"),
("hi", "Small (saves most)"))
def apply(self, ctx):
from .frame.foveation import apply
@@ -858,11 +868,13 @@ class Foveation(Patch):
def install(self, ctx: InstallContext) -> None:
# runs after device.lepton_env (install_context), so this choice wins over a recipe's VK_INSTANCE_LAYERS
mode, radius, test = foveation_options(ctx.params)
mode, level, test = foveation_options(ctx.params)
ctx.env.pop("FOVE_INNER", None)
ctx.env.pop("FOVE_OUTER", None)
if not mode:
return
for key in ("FDM_DEBUG", "ENABLE_VULKAN_FDM_INJECTION_LAYER",
"LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER", "FOVE_INNER", "FOVE_OUTER",
"LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER", "FOVE_INNER", "FOVE_OUTER", "FOVE_LEVEL",
"LEPTON_ENV_FRAMEPORT_FOVEATION_TEST", "LEPTON_ENV_FRAMEPORT_CLIMB_STEREO_OFFSETS",
"LEPTON_ENV_FRAMEPORT_VRAPI_FDM_ISOLATE_MONO",
"LEPTON_ENV_FRAMEPORT_VRAPI_KEEP_FOCUSED_IMAGE"):
@@ -881,8 +893,8 @@ class Foveation(Patch):
ctx.env.update(LEPTON_ENV_FRAMEPORT_CLIMB_STEREO_OFFSETS="1",
LEPTON_ENV_FRAMEPORT_VRAPI_FDM_ISOLATE_MONO="1",
LEPTON_ENV_FRAMEPORT_VRAPI_KEEP_FOCUSED_IMAGE="1")
if radius:
ctx.env.update(FOVE_INNER=f"{radius:g}", FOVE_OUTER=f"{2 * radius:g}")
if level:
ctx.env["FOVE_LEVEL"] = level
if test:
ctx.env["LEPTON_ENV_FRAMEPORT_FOVEATION_TEST"] = "1"
@@ -944,16 +956,20 @@ register(Foveation)
FOVEATION_ENV_KEYS = ("FDM_DEBUG", "ENABLE_VULKAN_FDM_INJECTION_LAYER",
"LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER", "VK_INSTANCE_LAYERS", "FOVE_INNER", "FOVE_OUTER",
"LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER", "VK_INSTANCE_LAYERS", "FOVE_INNER", "FOVE_OUTER", "FOVE_LEVEL",
"LEPTON_ENV_FRAMEPORT_FOVEATION_TEST", "LEPTON_ENV_FRAMEPORT_CLIMB_STEREO_OFFSETS",
"LEPTON_ENV_FRAMEPORT_VRAPI_FDM_ISOLATE_MONO", "LEPTON_ENV_FRAMEPORT_VRAPI_KEEP_FOCUSED_IMAGE")
def foveation_preference(entry):
if "foveation" in entry:
return dict(entry["foveation"])
params = ((entry.get("recipe") or {}).get("patches") or {}).get("device.foveation") or {}
return {k: v for k, v in params.items() if k in ("mode", "radius", "test")}
params = entry.get("foveation") if "foveation" in entry else (
((entry.get("recipe") or {}).get("patches") or {}).get("device.foveation") or {})
pref = {k: v for k, v in params.items() if k in ("mode", "level", "radius", "test")}
if "radius" in pref:
_, level, _ = foveation_options(pref)
pref.pop("radius")
pref["level"] = level
return pref
def foveation_env(package, params, settings=None, baseline=None):
+6 -7
View File
@@ -103,7 +103,7 @@ def show_adapter_dialog(app: FramePortApp, package: str) -> None:
if env.get("ENABLE_VULKAN_FDM_INJECTION_LAYER") == "1" else "")
pref = {"mode": mode}
if mode in ("tracked", "fixed"):
pref.update(radius=float(env.get("FOVE_INNER") or 0),
pref.update(level=env.get("FOVE_LEVEL") if env.get("FOVE_LEVEL") in ("lo", "med", "hi") else "",
test=env.get("LEPTON_ENV_FRAMEPORT_FOVEATION_TEST") == "1")
_open(app, package, None, vals, pref)
app.run_bg(load)
@@ -122,24 +122,23 @@ def _open(app: FramePortApp, package: str, g: dict | None, values: dict, foveati
def foveation_change(key, value):
foveation[key] = value
for name in ("radius", "test"):
for name in ("level", "test"):
if name in foveation_rows:
foveation_rows[name].visible = (foveation.get("mode") in ("tracked", "fixed") and
(name != "test" or advanced["on"]))
C.update(foveation_rows[name])
foveation_specs = (("mode", Foveation.CHOICES), ("radius", Foveation.RADIUS_CHOICES), ("test", None))
foveation_specs = (("mode", Foveation.CHOICES), ("level", Foveation.LEVEL_CHOICES), ("test", None))
for key, choices in (foveation_specs if not g or g.get("kind", "quest") == "quest" else ()):
ui = FOVEATION_UI[key]
if choices:
value = str(foveation.get(key, "")) if key == "mode" else f"{float(foveation.get(key) or 0):g}"
value = str(foveation.get(key, ""))
choices = list(choices)
if value not in [str(v) for v, _ in choices]:
choices.append((value, value))
control = C.dropdown(value=value, width=T.px(220),
options=[ft.DropdownOption(key=str(v), text=tr(label)) for v, label in choices],
on_select=lambda e, k=key: foveation_change(k, float(e.control.value) if k == "radius"
else e.control.value))
on_select=lambda e, k=key: foveation_change(k, e.control.value))
else:
control = C.switch(value=bool(foveation.get(key)),
on_change=lambda e: foveation_change("test", bool(e.control.value)))
@@ -232,7 +231,7 @@ def _open(app: FramePortApp, package: str, g: dict | None, values: dict, foveati
def save(e):
if foveation.get("mode", "") not in ("tracked", "fixed"):
foveation.pop("radius", None)
foveation.pop("level", None)
foveation.pop("test", None)
foveation_options(foveation)
app.page.pop_dialog()
+135
View File
@@ -0,0 +1,135 @@
// SPDX-License-Identifier: GPL-3.0-only
#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <sys/mman.h>
static _Alignas(4096) unsigned char entry[4096],arena[4096];
static unsigned maps,unmaps,protects,logs,fail_at;
static int outside,missing,restore_fails;
static uintptr_t hints[3];
static char last_log[1024];
static void *slot;
static const uint32_t expected[4]={0xd10243ff,0xa9065ffe,0xa90757f6,0xa9084ff4};
static void *fake_mmap(void *hint,size_t size,int prot,int flags,int fd,off_t offset) {
(void)size;(void)prot;(void)fd;(void)offset;
assert(flags & 0x100000);
if(!missing)assert(hint==arena);
assert(maps<3);hints[maps]=(uintptr_t)hint;
maps++;
if(missing){errno=maps==1?EEXIST:maps==2?EINVAL:ENOMEM;return MAP_FAILED;}
return outside?(void*)((uintptr_t)entry+0x10000000):arena;
}
static int fake_munmap(void *p,size_t size) {
(void)p;assert(size==4096);unmaps++;return 0;
}
static int fake_mprotect(void *p,size_t size,int prot) {
assert(size==4096);protects++;
if(protects==1) {
assert(p==arena && prot==(PROT_READ|PROT_EXEC));
assert(!memcmp(entry,expected,16));
}
if(protects==3) {
assert(p==entry && prot==(PROT_READ|PROT_EXEC));
assert(slot==arena+16); // original is available when entry goes live
assert(*(uint32_t*)entry!=expected[0]);
assert(!memcmp(entry+4,expected+1,12));
}
if(protects==4)assert(!memcmp(entry,expected,16));
if(protects==fail_at || (restore_fails && protects>=3)){errno=EACCES;return -1;}
return 0;
}
static FILE *fake_fopen(const char *path,const char *mode) {
(void)path;(void)mode;
FILE *f=tmpfile();assert(f);
fprintf(f,"0-%llx r-xp\n%llx-ffffffffffffffff r-xp\n",
(unsigned long long)(uintptr_t)arena,
(unsigned long long)((uintptr_t)arena+(missing?12288:4096)));
rewind(f);return f;
}
static void test_log(const char *format,...) {
char message[1024];va_list ap;va_start(ap,format);
vsnprintf(message,sizeof(message),format,ap);va_end(ap);
assert(strstr(message,"target="));strcpy(last_log,message);logs++;
}
#define fopen fake_fopen
#define mmap fake_mmap
#define munmap fake_munmap
#define mprotect fake_mprotect
#define LOG(...) test_log(__VA_ARGS__)
#include "audio_detour.h"
static void reset(void) {
maps=unmaps=protects=0;fail_at=0;outside=missing=restore_fails=0;slot=NULL;
memcpy(entry,expected,16);memset(arena,0,sizeof(arena));mx_audio_page=4096;
}
static void gap_test(const char *text,uintptr_t target,size_t expected_count,uintptr_t first) {
FILE *f=tmpfile();assert(f);fputs(text,f);rewind(f);
struct mx_audio_candidate *c=NULL;size_t n=0;
const char *failure=NULL;
assert(mx_audio_candidates(f,target,&c,&n,&failure));fclose(f);
assert(n==expected_count);if(n)assert(c[0].address==first);
for(size_t i=0;i<n;i++){uint32_t w;assert(mx_audio_branch(target,c[i].address,&w));assert(mx_audio_branch(c[i].address+20,target+4,&w));}
free(c);
}
int main(void) {
mx_audio_page=4096;
gap_test("0-10000000 r-xp\n10003000-ffffffffffffffff r-xp\n",0x10001000,3,0x10001000);
gap_test("0-10000000 r-xp\n10001000-10002000 r-xp\n10002000-ffffffffffffffff r-xp\n",0x10002000,1,0x10000000);
gap_test("0-20000000 r-xp\n20001000-ffffffffffffffff r-xp\n",0x10000000,0,0);
gap_test("0-10000000 r-xp\n10000000-ffffffffffffffff r-xp\n",0x10000000,0,0);
gap_test("0-18000000 r-xp\n18001000-ffffffffffffffff r-xp\n",0x10000004,0,0);
uint32_t b;
assert(mx_audio_branch(0x10000000,0x10000000,&b) && b==0x14000000);
assert(mx_audio_branch(0x10000000,0x17fffffc,&b) && b==0x15ffffff);
assert(mx_audio_branch(0x10000000,0x08000000,&b) && b==0x16000000);
assert(mx_audio_branch(0x10000004,0x10000000,&b) && b==0x17ffffff);
assert(!mx_audio_branch(0x10000000,0x18000000,&b));
assert(!mx_audio_branch(0x10000004,0x08000000,&b));
assert(!mx_audio_branch(1,4,&b) && !mx_audio_branch(4,1,&b));
reset();
assert(mx_audio_detour(entry,(void*)0x123456789abcdef0ULL,expected,&slot)==arena+16);
uint32_t jump[2]={0x58000050,0xd61f0200};uintptr_t destination;
assert(!memcmp(arena,jump,8));memcpy(&destination,arena+8,8);
assert(destination==0x123456789abcdef0ULL);
assert(*(uint32_t*)(arena+16)==expected[0]);
assert(mx_audio_branch((uintptr_t)arena+20,(uintptr_t)entry+4,&b));
assert(*(uint32_t*)(arena+20)==b && maps==1 && !unmaps && protects==3);
for(unsigned failure=1;failure<=3;failure++) {
reset();fail_at=failure;
assert(!mx_audio_detour(entry,(void*)16,expected,&slot));
assert(strstr(last_log,failure==1?"mprotect stub RX":failure==2?"mprotect entry RWX":"mprotect entry RX"));
assert(strstr(last_log,"errno=13"));
assert(!memcmp(entry,expected,16));
assert(unmaps==(failure<3?1u:0u));
assert(slot==(failure<3?NULL:arena+16));
assert(protects==(failure==3?4:failure));
}
reset();restore_fails=1;
assert(!mx_audio_detour(entry,(void*)16,expected,&slot));
assert(!memcmp(entry,expected,16) && !unmaps && protects==4 && slot==arena+16);
reset();outside=1;
assert(!mx_audio_detour(entry,(void*)16,expected,&slot));
assert(maps==1 && unmaps==maps && !protects && !memcmp(entry,expected,16));
reset();missing=1;
assert(!mx_audio_detour(entry,(void*)16,expected,&slot));
assert(maps==3 && !unmaps && !protects && !memcmp(entry,expected,16));
for(unsigned i=1;i<3;i++) {
uintptr_t t=(uintptr_t)entry;
uintptr_t a=hints[i-1]>t?hints[i-1]-t:t-hints[i-1];
uintptr_t b=hints[i]>t?hints[i]-t:t-hints[i];
assert(a<=b && hints[i]!=hints[i-1]);
}
assert(strstr(last_log,"errno=12 attempts=3"));
reset();entry[4]^=1;
assert(!mx_audio_detour(entry,(void*)16,expected,&slot) && !maps);
assert(strstr(last_log,"16-byte guard mismatch"));
reset();uint32_t bad[4]={0x10000000,0,0,0};memcpy(entry,bad,16);
assert(!mx_audio_detour(entry,(void*)16,bad,&slot) && !maps);
assert(strstr(last_log,"unsupported replay instruction"));
assert(logs==8);
puts("PASS: maps gaps, outward NOREPLACE retries, branch limits, stub/trampoline, publication order, failure diagnostics/cleanup/rollback, guards");
}
+47
View File
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: GPL-3.0-only
#define _GNU_SOURCE
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
#include <link.h>
#include <string.h>
#define LOG(...) ((void)0)
static uintptr_t mx_audio_base;
static unsigned detours,scans;
static void *mx_audio_detour(unsigned char *address,void *replacement,const uint32_t expected[4],void *slot) {
(void)slot;assert(replacement && !memcmp(address,expected,16));detours++;return (void*)1;
}
static int fake_iterate(int (*callback)(struct dl_phdr_info*,size_t,void*),void *data) {
(void)callback;(void)data;scans++;return 0;
}
#define dl_iterate_phdr fake_iterate
// Exercise the AArch64-only installer as C without executing ARM instructions.
#ifndef __aarch64__
#define __aarch64__ 1
#endif
#include "batman_audio_geometry.h"
int main(void) {
mx_batman_geometry_initialize();assert(!scans && !detours); // unverified Meta SDK
mx_audio_base=1;
mx_batman_geometry_initialize();assert(!scans && !detours && mx_geometry_checked); // another package
unsigned char *base=calloc(1,0x2e63a28+32);assert(base);
Elf64_Phdr phdr={.p_type=PT_NOTE,.p_vaddr=256,.p_memsz=36};
struct dl_phdr_info info={.dlpi_addr=(uintptr_t)base,.dlpi_name="/lib/libil2cpp.so",
.dlpi_phdr=&phdr,.dlpi_phnum=1};
Elf64_Nhdr note={.n_namesz=4,.n_descsz=20,.n_type=NT_GNU_BUILD_ID};
memcpy(base+256,&note,sizeof(note));memcpy(base+268,"GNU",4);
memcpy(base+272,mx_geometry_il2cpp_id,20);
memcpy(base+0x2e61bb4,mx_geometry_queue_entry,16);
memcpy(base+0x2e63a28,mx_geometry_worker_entry,16);
base[272]^=1;mx_geometry_find(&info,sizeof(info),NULL);assert(!detours); // other build
base[272]^=1;base[0x2e63a28]^=1;
mx_geometry_find(&info,sizeof(info),NULL);assert(!detours); // changed worker
base[0x2e63a28]^=1;base[0x2e61bb4]^=1;
mx_geometry_find(&info,sizeof(info),NULL);assert(!detours); // changed queue
base[0x2e61bb4]^=1;
mx_geometry_find(&info,sizeof(info),NULL);assert(detours==2); // only the exact pair is hooked
free(base);
puts("PASS: other package/SDK/build/entries skipped; matching binary hooks both boundaries");
}
+84
View File
@@ -0,0 +1,84 @@
// SPDX-License-Identifier: GPL-3.0-only
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <pthread.h>
#define LOG(...) ((void)0)
static int fail_allocation;
static _Atomic unsigned allocations,releases;
static void *test_alloc(size_t size) {
if(fail_allocation)return NULL;
allocations++;return malloc(size);
}
static void test_free(void *p) {releases++;free(p);}
#define malloc test_alloc
#define free test_free
#include "audio_geometry_owned.h"
#undef malloc
#undef free
#include "batman_audio_geometry_target.h"
typedef struct {
unsigned char header[16];
const void *data;
uint64_t length;
int immediate;
const void *source;
} Closure;
static void original_worker(void *context,void *method) {
Closure *closure=context;
assert(method==(void*)42 && closure->length==UINT64_C(0x123400000040));
assert(closure->data!=closure->source);
for(unsigned i=0;i<64;i++)assert(((const unsigned char*)closure->data)[i]==(unsigned char)i);
}
static void original_queue(void *object,const void *data,uint64_t length,void *method) {
Closure *closure=object;
assert(method==(void*)42);
closure->data=data;closure->length=length;
if(closure->immediate)mx_geometry_worker(closure,method);
}
static void *concurrent_load(void *unused) {
(void)unused;
for(unsigned n=0;n<100;n++) {
unsigned char source[64];for(unsigned i=0;i<64;i++)source[i]=(unsigned char)i;
Closure closure={.immediate=1,.source=source};
mx_geometry_queue(&closure,source,UINT64_C(0x123400000040),(void*)42);
}
return NULL;
}
int main(void) {
mx_geometry_queue_original=original_queue;mx_geometry_worker_original=original_worker;
unsigned char source[64];for(unsigned i=0;i<64;i++)source[i]=(unsigned char)i;
Closure closure={.source=source};
mx_geometry_queue(&closure,source,UINT64_C(0x123400000040),(void*)42);
assert(mx_geometry_owned_head && closure.data!=source && allocations==1 && releases==0);
memset(source,0xff,sizeof(source)); // download handler's source goes away before the task runs
mx_geometry_worker(&closure,(void*)42);
assert(!mx_geometry_owned_head && allocations==releases);
for(unsigned i=0;i<64;i++)source[i]=(unsigned char)i;
closure.immediate=1;
mx_geometry_queue(&closure,source,UINT64_C(0x123400000040),(void*)42);
assert(!mx_geometry_owned_head && allocations==releases); // task finishes before queue() returns
fail_allocation=1;closure.immediate=0;
mx_geometry_queue(&closure,source,64,(void*)42);
assert(closure.data==source && !mx_geometry_owned_head); // preserve original call on allocation failure
fail_allocation=0;
mx_geometry_queue(&closure,NULL,0,(void*)42);
assert(!closure.data && !mx_geometry_owned_head);
mx_geometry_queue(&closure,source,UINT32_MAX,(void*)42); // negative NativeArray length: unchanged
assert(closure.data==source && !mx_geometry_owned_head);
pthread_t threads[4];
for(unsigned i=0;i<4;i++)assert(!pthread_create(&threads[i],NULL,concurrent_load,NULL));
for(unsigned i=0;i<4;i++)assert(!pthread_join(threads[i],NULL));
assert(!mx_geometry_owned_head && mx_geometry_queued==mx_geometry_finished);
assert(mx_geometry_matches_id(mx_geometry_il2cpp_id,20));
unsigned char wrong_id[20];memcpy(wrong_id,mx_geometry_il2cpp_id,20);wrong_id[0]^=1;
assert(!mx_geometry_matches_id(wrong_id,20) && !mx_geometry_matches_id(wrong_id,19));
assert(mx_geometry_matches_entries(mx_geometry_queue_entry,mx_geometry_worker_entry));
uint32_t wrong_entry[4];memcpy(wrong_entry,mx_geometry_queue_entry,16);wrong_entry[3]^=1;
assert(!mx_geometry_matches_entries(wrong_entry,mx_geometry_worker_entry));
assert(!mx_geometry_matches_entries(mx_geometry_queue_entry,wrong_entry));
puts("PASS: deferred/inline/concurrent ownership, cleanup, ABI arguments, fallback and target guards");
}
+55
View File
@@ -0,0 +1,55 @@
"""Batman audio ownership and the scope of the adapter update."""
import os
import shutil
import subprocess
import sys
from pathlib import Path
import pytest
@pytest.mark.parametrize("fixture", ["audio_geometry_test.c", "audio_geometry_target_test.c", "audio_detour_test.c"])
def test_audio_geometry_native(tmp_path, fixture):
cc = shutil.which("cc") or shutil.which("gcc") or shutil.which("clang")
if not cc or os.name == "nt":
pytest.skip("Native ownership regression requires a POSIX C compiler with pthreads")
if fixture == "audio_geometry_target_test.c" and sys.platform != "linux":
pytest.skip("Installer regression models Linux ELF loading")
root = Path(__file__).resolve().parents[1]
binary = tmp_path / "audio-geometry-test"
subprocess.run([cc, "-std=c11", "-Wall", "-Wextra", "-Werror", "-pthread",
"-I", str(root / "native/adapter"),
str(root / "tests/fixtures/src" / fixture), "-o", str(binary)], check=True)
subprocess.run([str(binary)], check=True)
def test_audio_geometry_update_outdates_batman_only(monkeypatch):
from frameport.patches.base import get, recipe_fingerprint
patch = get("frame.adapter")
recipe = {"patches": {"frame.adapter": {}}}
packages = ("com.camouflaj.manta", "com.Armature.VR4", "com.crytek.climb2", "com.example.other")
current = {p: recipe_fingerprint(recipe, p) for p in packages}
assert patch.revision_for(packages[0]) == 3
assert all(patch.revision_for(p) == 2 for p in packages[1:])
monkeypatch.setattr(patch, "package_revisions", {})
assert current[packages[0]] != recipe_fingerprint(recipe, packages[0])
assert all(current[p] == recipe_fingerprint(recipe, p) for p in packages[1:])
def test_audio_geometry_allocation_triage_is_specific_to_batman():
from frameport.validate.triage import triage
log = ("package com.camouflaj.manta\n"
"E Unity : Could not allocate memory: System out of memory!\n"
"E Unity : Trying to allocate: 26388238103B with 16 alignment. MemoryLabel: NativePlugin\n"
"E Unity : Allocation happened at: MetaXRAudioUnityMemoryAllocator.cpp\n"
"F libc : Fatal signal 5 (SIGTRAP)\n")
result = triage(log, "EXITED")
finding = next(f for f in result.findings if f.id == "batman-audio-geometry-allocation")
assert finding.severity == "fatal" and finding.suggest == ["frame.adapter"]
assert "native-crash" not in {f.id for f in result.findings}
for ordinary in (log.replace("com.camouflaj.manta", "com.example.other"),
log.replace("26388238103B", "4096B"),
log.replace("MetaXRAudioUnityMemoryAllocator.cpp", "OtherAllocator.cpp")):
assert "batman-audio-geometry-allocation" not in {f.id for f in triage(ordinary, "EXITED").findings}
+4 -5
View File
@@ -45,8 +45,8 @@ def test_injection_keeps_swapchains_ordinary():
def test_custom_size_and_fixed_mode_and_reset():
assert context({"mode": "tracked", "test": True}).env["LEPTON_ENV_FRAMEPORT_FOVEATION_TEST"] == "1"
assert "LEPTON_ENV_FRAMEPORT_FOVEATION_TEST" not in context({"mode": "tracked"}).env
assert context({"mode": "tracked", "radius": 0.35}).env["FOVE_INNER"] == "0.35"
assert context({"mode": "tracked", "radius": 0.35}).env["FOVE_OUTER"] == "0.7"
assert context({"mode": "tracked", "radius": 0.35}).env["FOVE_LEVEL"] == "lo"
assert context({"mode": "tracked", "level": "hi"}).env["FOVE_LEVEL"] == "hi"
assert context({"mode": "fixed"}).env["FDM_DEBUG"] == "enable,disable_offsets"
assert context({"mode": "off"}).env == {
"VK_INSTANCE_LAYERS": "", "LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER": "1"}
@@ -57,9 +57,8 @@ def test_custom_size_and_fixed_mode_and_reset():
@pytest.mark.parametrize("params", [
{"mode": "bad"}, {"mode": "off", "test": True}, {"mode": "", "radius": 0.2},
{"mode": "tracked", "radius": float("nan")}, {"mode": "tracked", "radius": float("inf")},
{"mode": "tracked", "radius": -1}, {"mode": "tracked", "radius": 0.01},
{"mode": "tracked", "radius": 0.5}, {"mode": "tracked", "test": "false"}])
{"mode": "tracked", "level": "1"}, {"mode": "tracked", "level": 2},
{"mode": "off", "level": "lo"}, {"mode": "tracked", "test": "false"}])
def test_invalid_configuration_refused(params):
with pytest.raises(ValueError):
foveation_options(params)
+46 -5
View File
@@ -87,10 +87,11 @@ def test_catalog_defaults_survive_and_explicit_choice_wins():
def test_radius_test_and_off_reset_managed_exports():
env = foveation_env("test.game", {"mode": "fixed", "radius": .2, "test": True})
assert env["FOVE_INNER"] == "0.2" and env["FOVE_OUTER"] == "0.4"
assert env["FOVE_LEVEL"] == "hi"
assert env["FOVE_INNER"] is None and env["FOVE_OUTER"] is None
assert env["LEPTON_ENV_FRAMEPORT_FOVEATION_TEST"] == "1"
off = foveation_env("test.game", {"mode": "off"}, baseline={k: v for k, v in env.items() if v})
assert off["FOVE_INNER"] is None and off["LEPTON_ENV_FRAMEPORT_FOVEATION_TEST"] is None
assert off["FOVE_LEVEL"] is None and off["LEPTON_ENV_FRAMEPORT_FOVEATION_TEST"] is None
def test_resolution_label_explains_actual_effect():
@@ -129,8 +130,9 @@ def test_game_dialog_saves_personal_choice_without_touching_recipe(monkeypatch):
any(o.key == "tracked" for o in c.options))
mode.on_select(SimpleNamespace(control=SimpleNamespace(value="fixed")))
radius = next(c for c in controls if isinstance(c, ft.Dropdown) and
any(o.key == "0.3" for o in c.options))
radius.on_select(SimpleNamespace(control=SimpleNamespace(value="0.3")))
any(o.key == "med" for o in c.options))
assert [(o.key, o.text) for o in radius.options] == list(ad.Foveation.LEVEL_CHOICES)
radius.on_select(SimpleNamespace(control=SimpleNamespace(value="med")))
advanced_row = next(c for c in controls if isinstance(c, ft.Row) and c.data == "switch" and
any(getattr(t, "value", None) == "Show advanced settings" for t in walk(c)))
advanced = next(c for c in walk(advanced_row) if isinstance(c, ft.Switch))
@@ -145,7 +147,7 @@ def test_game_dialog_saves_personal_choice_without_touching_recipe(monkeypatch):
save = dialogs[-1].actions[-1]
save.on_click(None)
saved = library.game("test.game")
assert saved["foveation"] == {"mode": "fixed", "radius": .3, "test": True}
assert saved["foveation"] == {"mode": "fixed", "level": "med", "test": True}
assert saved["recipe"] == game["recipe"]
ad._open(app, "test.game", saved, ad.recipe_values(saved))
mode = next(c for c in walk(dialogs[-1]) if isinstance(c, ft.Dropdown) and
@@ -160,3 +162,42 @@ def test_adapter_build_prepares_internal_foveation_support():
from frameport.build import apk_patches
assert "device.foveation" in [p.id for p in apk_patches({"frame.adapter": {}})]
assert "device.foveation" not in [p.id for p in apk_patches({"frame.launcher": {}})]
@pytest.mark.parametrize("radius,level", [(0, ""), (.1, "hi"), (.2, "hi"), (.25, "med"),
(.3, "lo"), (.45, "lo"), ("unknown", ""), (float("nan"), ""), (.9, "")])
def test_legacy_radius_read_migrates_without_mutating_storage(radius, level):
entry = {"foveation": {"mode": "tracked", "radius": radius}}
before = dict(entry["foveation"])
assert foveation_preference(entry) == {"mode": "tracked", "level": level}
assert entry["foveation"] == before
env = foveation_env("test.game", entry["foveation"])
assert env["FOVE_LEVEL"] == (level or None)
assert env["FOVE_INNER"] is None and env["FOVE_OUTER"] is None
@pytest.mark.parametrize("level", ["", "lo", "med", "hi"])
def test_supported_level_exports_and_explicit_level_wins(level):
env = foveation_env("test.game", {"mode": "tracked", "level": level, "radius": .2})
assert env["FOVE_LEVEL"] == (level or None)
assert env["FDM_DEBUG"] == "enable"
def test_default_removes_obsolete_radius_exports_and_legacy_recipe_reads():
env = foveation_env("test.game", {"mode": ""}, baseline={"FOVE_INNER": ".4", "FOVE_OUTER": ".8"})
assert env["FOVE_INNER"] is None and env["FOVE_OUTER"] is None
entry = {"recipe": {"patches": {"device.foveation": {"mode": "fixed", "radius": .25}}}}
assert foveation_preference(entry) == {"mode": "fixed", "level": "med"}
@pytest.mark.parametrize("level,expected", [("hi", "hi"), ("1", ""), (None, "")])
def test_installed_only_dialog_reads_supported_level(monkeypatch, level, expected):
from frameport.ui.views import adapter_dialog as ad
monkeypatch.setattr(library, "game", lambda package: None)
received = []
monkeypatch.setattr(ad, "_open", lambda *args: received.append(args[-1]))
target = SimpleNamespace(set_settings=lambda *args: {"settings": {}, "foveation_env": {
"ENABLE_VULKAN_FDM_INJECTION_LAYER": "1", "FDM_DEBUG": "enable", "FOVE_LEVEL": level}})
app = SimpleNamespace(target=target, run_bg=lambda fn: fn())
ad.show_adapter_dialog(app, "test.game")
assert received == [{"mode": "tracked", "level": expected, "test": False}]
+16
View File
@@ -189,6 +189,22 @@ def test_dispatcher_rejects_unknown_and_partial_matches():
assert patch_dispatcher(b'unknown runtime', 'quest2') == b'unknown runtime'
def test_unknown_dispatcher_keeps_quest2_instead_of_failing_the_build():
"""Quest 3 is the default for every Quest game: an APK converted with another OVRPort runtime (found with an
already converted Batman copy) must still build, keeping OVRPort's Quest 2 answers."""
from types import SimpleNamespace
from frameport.patches import base
base.load_all()
put = []
ws = SimpleNamespace(lib=lambda n: n, has=lambda p: True, read_lib=lambda n: b"another runtime",
put=lambda p, d: put.append(p))
ctx = SimpleNamespace(analysis=SimpleNamespace(vr_kind="quest", extra={}), params={}, ws=ws, checks=[], notes=[])
assert base.get("device.headset_model").apply(ctx) is False
assert not put and ctx.checks and "Quest 2" in ctx.checks[0][2]
def test_real_dispatcher_when_available():
import os
+1 -1
View File
@@ -13,7 +13,7 @@ def test_video_patches_outdate_only_the_recipes_that_gain_them():
from frameport.ui.components import install_state
# revision 2 (#365) adds the dormant foveation diagnostic to every build; this test is about the package check
assert get("frame.adapter").revision == 2 and not get("frame.adapter").package_revisions
assert get("frame.adapter").revision_for("com.example.other") == 2
before = {"patches": {"frame.adapter": {}}}
after = {"patches": {"frame.adapter": {}, "frame.hw_video_decode": {}, "adapter.surface_native": {"value": 1}}}
for package, recipe, expected in (("com.camouflaj.manta", after, "outdated"),
+3
View File
@@ -64,6 +64,9 @@ def test_other_mmap_calls_are_left_alone(tmp_path, kwargs):
ctx = context(tmp_path, data)
with ctx.ws:
assert not nr.UnrealNoReserve().apply(ctx)
# nothing to rewrite is not a failed build (GitHub #393: Lies Beneath failed "0 rewritten, 0 left")
name, ok, detail = nr.UnrealNoReserve().validate(ctx)[0]
assert ok and detail == "none in this build"
def test_call_to_another_function_is_left_alone(monkeypatch):