Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f2b009ee1 | ||
|
|
4ea677b40e | ||
|
|
6373ae8870 | ||
|
|
faa388600b | ||
|
|
0b9d8c6dde | ||
|
|
073adcc75b | ||
|
|
6c63105b13 | ||
|
|
a121f72f23 | ||
|
|
ba010139b6 | ||
|
|
0f418e5539 | ||
|
|
360658e9b5 | ||
|
|
48ab03a637 | ||
|
|
39443ef2ae | ||
|
|
b0f2a86a01 | ||
|
|
3f22994633 | ||
|
|
25e282d620 |
No files matched your search
@@ -251,11 +251,7 @@ Rick and Morty runs on the Frame via its catalog recipe (OpenVR, no Revive),
|
||||
restore = untrusted input (staged + checked first), rollback copy `<base>/saves-before-restore.tar.gz` (undo =
|
||||
`rollback: true`). PC `install/saves.py` (`<data>/save-backups/<pkg>/<ts>.tar.gz` + `.json`, keep `saves.keep`
|
||||
= 10), GUI `ui/views/saves_dialog.py` (game menu section "Saves", Frame page "Back up all saves", uninstall's
|
||||
"back up before deleting"), CLI `frameport saves backup|list|restore|undo`. Agent v101: PC folder `saves.folder`
|
||||
(Settings → Data; old folders stay listed in `saves.previous_folders`), automatic snapshots `saves.auto` (default
|
||||
off; flag `~/.local/share/frameport/save-snapshots/enabled`, Quest launchers run `_snapshot_close` in the EXIT
|
||||
trap under the launch lock, newest 3 per game on the Frame; `install/saves.sync_snapshots` imports them as
|
||||
"automatic" once, ledger `<data>/save-snapshots-synced.json`). Device-checked 2026-10-17 with BlazeRush.
|
||||
"back up before deleting"), CLI `frameport saves backup|list|restore|undo`.
|
||||
- `patches/` — **the unit of modularity**. `base.py` (Patch interface, registry), `overport.py` (overport CLI patch ids,
|
||||
discovered dynamically via `overport patches`), `frame/*.py` (one module per Frame fix), `settings.py` (FrameBridge
|
||||
adapter keys + device files as patches). Add a patch = add a module that calls `register(...)`.
|
||||
|
||||
@@ -46,7 +46,7 @@ try:
|
||||
except ImportError: # Windows: pc_revive loads this file for its VDF code only (GitHub #131)
|
||||
fcntl = None
|
||||
|
||||
AGENT_VERSION = 101
|
||||
AGENT_VERSION = 99
|
||||
HOME = os.path.expanduser("~")
|
||||
STEAM = os.path.join(HOME, ".local/share/Steam")
|
||||
ANCHORS = os.path.join(HOME, "Applications/quest-frame")
|
||||
@@ -3308,7 +3308,6 @@ stop() {{
|
||||
[[ -n "$child" ]] && kill -TERM -- "-$child" 2>/dev/null || true
|
||||
podman kill "lepton-steamlaunch-$SteamAppId" >/dev/null 2>&1 || true
|
||||
{plays_end}
|
||||
{save_snapshot}
|
||||
}}
|
||||
trap stop EXIT
|
||||
trap 'exit 130' INT
|
||||
@@ -3441,11 +3440,6 @@ def plays_lines(anchor):
|
||||
f'echo "end $(date +%s)" >>{q} 2>/dev/null || true')
|
||||
|
||||
|
||||
def snapshot_line(pkg):
|
||||
return (f"timeout -k 5 90 python3 {shlex.quote(os.path.abspath(__file__))} _snapshot_close "
|
||||
f"{shlex.quote(pkg)} >>\"$app_dir/save-snapshot.log\" 2>&1 || true")
|
||||
|
||||
|
||||
def upgrade_launchers():
|
||||
"""Give launchers written by older agents the parent watchdog, the dashboard closer and the play-session log (in
|
||||
place: a new file, so a running launcher keeps reading the old one). Returns the packages changed."""
|
||||
@@ -3504,10 +3498,6 @@ def upgrade_launchers():
|
||||
pkg = os.path.basename(os.path.dirname(path))
|
||||
new = set_config_sync_line(new, pkg, wants_config_sync(os.path.dirname(path)))
|
||||
new = set_refresh_rate_line(new, pkg)
|
||||
if "export LEPTON_ENV_FRAMEBRIDGE_CONFIG=" in new and "_snapshot_close" not in new:
|
||||
# The end log follows podman kill in stop(), while the launcher still owns fd 9.
|
||||
end = plays_lines(os.path.dirname(path))[1]
|
||||
new = new.replace(end, end + "\n " + snapshot_line(os.path.basename(os.path.dirname(path))), 1)
|
||||
if new == text:
|
||||
continue
|
||||
tmp = path + ".tmp"
|
||||
@@ -3893,8 +3883,7 @@ def write_launcher(anchor, base, pkg, title, appid, lepton, env, hw_video=False,
|
||||
cloud_dirs=cloud_dirs_line(pkg),
|
||||
video_codec=wrapper_lines(hw_video, gamepad),
|
||||
plays_start=plays_lines(anchor)[0],
|
||||
plays_end=plays_lines(anchor)[1], save_snapshot=snapshot_line(pkg),
|
||||
restart=restart_block(pkg, lepton))
|
||||
plays_end=plays_lines(anchor)[1], restart=restart_block(pkg, lepton))
|
||||
text = set_config_sync_line(text, pkg, config_sync)
|
||||
text = set_refresh_rate_line(text, pkg)
|
||||
path = os.path.join(anchor, "launch.sh")
|
||||
@@ -5727,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", "FOVE_LEVEL",
|
||||
"LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER", "VK_INSTANCE_LAYERS", "FOVE_INNER", "FOVE_OUTER",
|
||||
"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"}
|
||||
|
||||
@@ -8445,8 +8434,7 @@ def _dep_version(dep):
|
||||
return str((dep or {}).get("version") or (dep or {}).get("source_version") or "")
|
||||
|
||||
|
||||
def write_saves_tar(out, pkg, roots, dep=None, max_file=SAVES_MAX_FILE, max_total=SAVES_MAX_TOTAL,
|
||||
automatic=False):
|
||||
def write_saves_tar(out, pkg, roots, dep=None, max_file=SAVES_MAX_FILE, max_total=SAVES_MAX_TOTAL):
|
||||
"""Stream the game's saves as tar.gz to `out` (a binary file object). Returns the manifest (also the archive's
|
||||
last member, frameport-saves.json)."""
|
||||
import gzip
|
||||
@@ -8460,8 +8448,7 @@ def write_saves_tar(out, pkg, roots, dep=None, max_file=SAVES_MAX_FILE, max_tota
|
||||
f"save backup takes (that's game content, not saves)")
|
||||
manifest = {"format": SAVES_FORMAT, "package": pkg, "title": (dep or {}).get("title") or pkg,
|
||||
"version": _dep_version(dep), "created": time.time(), "agent": AGENT_VERSION,
|
||||
"automatic": automatic, "roots": sorted(roots), "max_file": max_file,
|
||||
"files": [], "dirs": [], "skipped": found["skipped"]}
|
||||
"roots": sorted(roots), "max_file": max_file, "files": [], "dirs": [], "skipped": found["skipped"]}
|
||||
gz = gzip.GzipFile(fileobj=out, mode="wb", compresslevel=6)
|
||||
with tarfile.open(fileobj=gz, mode="w|", format=tarfile.PAX_FORMAT) as tar:
|
||||
for arc, _p, s in found["dirs"]:
|
||||
@@ -8885,9 +8872,6 @@ def saves_ns_main(op, raw):
|
||||
return saves_backup_session(args, sys.stdout.buffer, sys.stderr)
|
||||
if op == "restore":
|
||||
return saves_restore_session(args, sys.stdin.buffer, sys.stdout)
|
||||
if op == "snapshot":
|
||||
print(json.dumps(create_save_snapshot(args["package"])))
|
||||
return 0
|
||||
if op == "info":
|
||||
try:
|
||||
_pkg, _dep, roots = saves_context(args)
|
||||
@@ -8899,135 +8883,10 @@ def saves_ns_main(op, raw):
|
||||
return 2
|
||||
|
||||
|
||||
SNAPSHOT_ROOT = os.path.expanduser("~/.local/share/frameport/save-snapshots")
|
||||
SNAPSHOT_NAME = re.compile(r"^[0-9]+-[a-f0-9]{64}\.tar\.gz$")
|
||||
|
||||
|
||||
def cmd_save_snapshot_settings(args):
|
||||
"""Global opt-in, read at every game exit, including when the PC is disconnected."""
|
||||
os.makedirs(SNAPSHOT_ROOT, exist_ok=True)
|
||||
flag = os.path.join(SNAPSHOT_ROOT, "enabled")
|
||||
if args.get("enabled") and not os.path.isfile(flag):
|
||||
with open(flag + ".tmp", "w") as f:
|
||||
f.write("1\n")
|
||||
os.replace(flag + ".tmp", flag)
|
||||
elif not args.get("enabled") and os.path.exists(flag):
|
||||
os.remove(flag)
|
||||
return {"enabled": os.path.isfile(flag)}
|
||||
|
||||
|
||||
def snapshot_files(pkg):
|
||||
folder = os.path.join(SNAPSHOT_ROOT, check_pkg(pkg))
|
||||
return sorted((p for p in glob.glob(os.path.join(folder, "*.tar.gz"))
|
||||
if SNAPSHOT_NAME.fullmatch(os.path.basename(p)) and not os.path.islink(p)), reverse=True)
|
||||
|
||||
|
||||
def cmd_save_snapshots(args):
|
||||
out = []
|
||||
for folder in sorted(glob.glob(os.path.join(SNAPSHOT_ROOT, "*"))):
|
||||
pkg = os.path.basename(folder)
|
||||
if not re.fullmatch(r"[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z0-9_]+)+", pkg) or os.path.islink(folder):
|
||||
continue
|
||||
for path in reversed(snapshot_files(pkg)): # oldest first: PC retention keeps the newest
|
||||
name = os.path.basename(path)
|
||||
out.append({"package": pkg, "snapshot": name, "sha256": name.split("-", 1)[1][:-7]})
|
||||
return {"snapshots": out}
|
||||
|
||||
|
||||
def create_save_snapshot(pkg):
|
||||
"""Called in the user namespace with the launch lock held; publish complete archives only."""
|
||||
pkg, dep, roots = saves_context({"package": pkg})
|
||||
if saves_running(dep):
|
||||
raise AgentError("the game is running")
|
||||
folder = os.path.join(SNAPSHOT_ROOT, pkg)
|
||||
os.makedirs(folder, exist_ok=True)
|
||||
found = collect_saves(roots)
|
||||
if sum(st.st_size for _arc, _path, st in found["files"]) > SAVES_MAX_TOTAL:
|
||||
raise AgentError("saves exceed the snapshot size limit")
|
||||
entries = []
|
||||
for arc, path, st in found["files"]:
|
||||
digest = hashlib.sha256()
|
||||
with open(path, "rb") as f:
|
||||
for chunk in iter(lambda: f.read(1 << 20), b""):
|
||||
digest.update(chunk)
|
||||
entries.append((arc, st.st_size, digest.hexdigest()))
|
||||
fingerprint = hashlib.sha256(json.dumps(entries).encode()).hexdigest()
|
||||
previous = snapshot_files(pkg)
|
||||
if previous:
|
||||
try:
|
||||
with open(previous[0] + ".json") as f:
|
||||
if json.load(f).get("fingerprint") == fingerprint:
|
||||
return {"created": False, "reason": "unchanged"}
|
||||
except (OSError, ValueError):
|
||||
pass # damaged metadata must not prevent a new backup
|
||||
part = os.path.join(folder, "snapshot.part")
|
||||
try:
|
||||
with open(part, "wb") as f:
|
||||
write_saves_tar(f, pkg, roots, dep, automatic=True)
|
||||
digest = hashlib.sha256()
|
||||
with open(part, "rb") as f:
|
||||
for chunk in iter(lambda: f.read(1 << 20), b""):
|
||||
digest.update(chunk)
|
||||
name = f"{time.time_ns()}-{digest.hexdigest()}.tar.gz"
|
||||
dest = os.path.join(folder, name)
|
||||
with open(dest + ".json", "w") as f:
|
||||
json.dump({"fingerprint": fingerprint}, f)
|
||||
os.replace(part, dest)
|
||||
for old in snapshot_files(pkg)[3:]:
|
||||
os.remove(old)
|
||||
if os.path.exists(old + ".json"):
|
||||
os.remove(old + ".json")
|
||||
return {"created": True, "snapshot": name}
|
||||
finally:
|
||||
if os.path.exists(part):
|
||||
os.remove(part)
|
||||
|
||||
|
||||
def snapshot_close(pkg):
|
||||
if not os.path.isfile(os.path.join(SNAPSHOT_ROOT, "enabled")):
|
||||
return 0
|
||||
_pkg, dep, _roots = saves_context({"package": pkg})
|
||||
# Never trust an environment variable claiming the game is stopped: verify the inherited lock itself.
|
||||
lock = os.stat(os.path.join(dep["base"], ".launch.lock"))
|
||||
inherited = os.fstat(9)
|
||||
if (lock.st_dev, lock.st_ino) != (inherited.st_dev, inherited.st_ino) or fcntl is None:
|
||||
raise AgentError("snapshot needs the launcher's lock")
|
||||
fcntl.flock(9, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
owner = as_owner()
|
||||
if owner:
|
||||
return subprocess.run(owner + [sys.executable or "python3", os.path.abspath(__file__),
|
||||
"_saves_ns", "snapshot", json.dumps({"package": pkg})],
|
||||
pass_fds=(9,)).returncode
|
||||
print(json.dumps(create_save_snapshot(pkg)))
|
||||
return 0
|
||||
|
||||
|
||||
def fetch_save_snapshot(args, out, err):
|
||||
try:
|
||||
pkg, name = check_pkg(args.get("package")), args.get("snapshot") or ""
|
||||
if not SNAPSHOT_NAME.fullmatch(name):
|
||||
raise AgentError("invalid save snapshot")
|
||||
path = os.path.join(SNAPSHOT_ROOT, pkg, name)
|
||||
if path not in snapshot_files(pkg) or os.path.islink(os.path.dirname(path)):
|
||||
raise AgentError("save snapshot no longer available")
|
||||
with open(path, "rb") as f:
|
||||
shutil.copyfileobj(f, out, 1 << 16)
|
||||
out.flush()
|
||||
err.write(json.dumps({"ok": True}) + "\n")
|
||||
return 0
|
||||
except (OSError, AgentError) as exc:
|
||||
err.write(json.dumps({"ok": False, "error": str(exc)}) + "\n")
|
||||
return 1
|
||||
|
||||
|
||||
COMMANDS = {n[4:]: f for n, f in globals().items() if n.startswith("cmd_")}
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) >= 3 and sys.argv[1] == "_snapshot_close":
|
||||
return snapshot_close(sys.argv[2])
|
||||
if len(sys.argv) >= 3 and sys.argv[1] == "_fetch_save_snapshot":
|
||||
return fetch_save_snapshot(json.loads(sys.argv[2]), sys.stdout.buffer, sys.stderr)
|
||||
if len(sys.argv) >= 2 and sys.argv[1] == "_keyboard":
|
||||
return keyboard_session(sys.stdin, sys.stdout)
|
||||
if len(sys.argv) >= 2 and sys.argv[1] == "_vr_overlay_watch":
|
||||
|
||||
@@ -8,16 +8,16 @@ d6337034fb0bdcca7ef9b7063d85b7586b8508b63b435959e8fffaba0691091c ./arm64-v8a/li
|
||||
321da502e0f8f46f0880aad39fe6b84bdef88f925164568814cf704a1b31a577 ./arm64-v8a/libfp_ovrp.so
|
||||
40defdaddcda53bd2649eb48076fae1622bfc2bfc88e9e03c94fc8b45af2a4f2 ./arm64-v8a/libfp_ovrtrace.so
|
||||
0167c2fde5dfde62897f9d85afc4fc8e97784e988b5b8df6cea8c407240b3424 ./arm64-v8a/libfp_tkeys.so
|
||||
e32f9b3222bfe2e58c193db809ac2cf54086df36fd2ec6651aa2e58308f6b39d ./arm64-v8a/libfp_vk.so
|
||||
468b97ee3c36481d939a87425b15880c7a801d16732350e1e2832b385d63f20a ./arm64-v8a/libfp_vk.so
|
||||
383054f8b3b41dde76d062c71856cd3163655e50009c08454bc1793f393ead65 ./arm64-v8a/libfpg.so
|
||||
4a13a33e112c9e4e3c5ff4337ed6e988a9e5b3602f48d654df148ef5fafbf426 ./arm64-v8a/libfpglmv.so
|
||||
36400eae4ba3807bcfcd54463daa217347032b07218792faa448d8cbbd086a0e ./arm64-v8a/libframe_xrshim.so
|
||||
19ba5ed3c4b780f5ae46251f6958f552acfc5f13c8bb39f995579593fa8990c6 ./arm64-v8a/libglshim.so
|
||||
3f0a0152e58f2e4442df654039694047d5abd02528c7ffa3ee66116ef9dbde69 ./arm64-v8a/libopenxr_loader_generic.so
|
||||
7b63b609c773b5d14b14a23e35e14e0b61a1b8f410ba74ffc9125b67c0c89373 ./arm64-v8a/libopenxr_loader_generic.so
|
||||
1feaeafad467c4cafdf2b018a4d84b0bee200c3f711697b4ce97e66a3ba256ca ./arm64-v8a/libovrplatformcompat.so
|
||||
a4ed80ae45ca90758239f152ea5a2e8c127d491e1e697ea5680db6fd7f72db07 ./arm64-v8a/libvrapi.so
|
||||
a4ed80ae45ca90758239f152ea5a2e8c127d491e1e697ea5680db6fd7f72db07 ./arm64-v8a/libvrapi_foveation.so
|
||||
ac214cb722d9e48009dac084f5b4382a91b6c4f317831f54c425e8f4ff43d6c1 ./armeabi-v7a/libopenxr_loader_generic.so
|
||||
cf09f4c503d8e42392637780ca9d7142e1f97ea41a705871c8b55e3e5a65e9d0 ./armeabi-v7a/libopenxr_loader_generic.so
|
||||
1871eae093432d277da4bc751bf5f3269dfcf11f9168260b0c3caadb0dedb19d ./dex/oculusos-stubs.dex
|
||||
b634ab5640e258563c536e658cad87080553df6f34f62269a21d554844e58bfe ./hevc/COPYING.FFmpeg
|
||||
141de01f0d40b97d4f9a720db5ab8ea442f6aa35db5272048899292884994a1c ./hevc/libstagefrighthw.so
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package: ScaredBySquares.Game
|
||||
title: Scared By Squares
|
||||
status: works
|
||||
status: unknown
|
||||
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 (confirmed in the headset by the reporter). Rebuild and reinstall the game after updating
|
||||
FramePort.'
|
||||
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.'
|
||||
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,9 +14,6 @@ xr: OpenXR
|
||||
frame:
|
||||
- frame.hw_video_decode
|
||||
- frame.unreal_skip_obb_check
|
||||
verified:
|
||||
date: '2026-10-17'
|
||||
issue: 323
|
||||
updated: '2026-10-17'
|
||||
updated: '2026-10-16'
|
||||
min_app: 1.2.1
|
||||
source_hint: Scared By Squares
|
||||
@@ -1,23 +0,0 @@
|
||||
package: com.Appnori.SummerSports
|
||||
title: Summer Sports
|
||||
status: works
|
||||
tested_version: 0.5.1
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
- frame.unity_runtime_msaa_off
|
||||
- frame.unity_gl_shim
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-17'
|
||||
known_good_sha256: 582adf5a538eb9565921cc0384e61bf113ab9215c1ad462fade82d06ad3302fa
|
||||
app: 1.2.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 96
|
||||
issue: 395
|
||||
source_hint: All in One summer Sports VR
|
||||
@@ -1,23 +0,0 @@
|
||||
package: com.BolverkGamesFlat2VR.SurvivingMarsPioneer
|
||||
title: 'Surviving Mars: Pioneer'
|
||||
status: works
|
||||
tested_version: 1.0.14
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
- frame.hw_video_decode
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
scale: 2.0
|
||||
verified:
|
||||
date: '2026-10-18'
|
||||
known_good_sha256: 3a9ff281417c219736ee10969e6ce4f7d8395472cb60718db8839d65edac4777
|
||||
app: 1.2.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 96
|
||||
issue: 399
|
||||
source_hint: Surviving Mars Pioneer
|
||||
@@ -1,24 +0,0 @@
|
||||
package: com.CarbonStudio.TheWizards
|
||||
title: The Wizards
|
||||
status: works
|
||||
tested_version: '1.11'
|
||||
engine: Unreal
|
||||
xr: VrApi
|
||||
alt_overport:
|
||||
- patch_remove_unreal_force_quit
|
||||
use_alt: true
|
||||
frame:
|
||||
- frame.unreal_thumb_touch
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
pose_time_fix: 1
|
||||
scale: 2.0
|
||||
verified:
|
||||
date: '2026-10-18'
|
||||
known_good_sha256: c1d979d746c2be941e150e948aec755d85034de829abfe30e5bf0761a49135ef
|
||||
app: 1.2.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 96
|
||||
issue: 397
|
||||
source_hint: the wizards
|
||||
@@ -1,25 +0,0 @@
|
||||
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
|
||||
@@ -1,20 +0,0 @@
|
||||
package: com.Meta4.TFBeyondReality
|
||||
title: 'Transformers Beyond Reality: Redux'
|
||||
status: unknown
|
||||
notes: Starts and runs at 72 fps in headless launch tests (2026-10-17); not yet checked in the headset. Steam's shader
|
||||
cache layer is left out and a few shaders the Frame's driver refuses are skipped, so some objects may be missing.
|
||||
details: Unreal Engine game (Binned3 allocator, GitHub issue 349). Crash 1 - the allocator's 76 GiB up-front
|
||||
reservation is refused by the Frame's kernel (frame.unreal_noreserve, suggested by analysis). Crash 2 - Unreal's
|
||||
"Shader compilation failures are Fatal." With Lepton's Fossilize layer loaded every graphics pipeline failed with
|
||||
VK_ERROR_OUT_OF_HOST_MEMORY, even a constant-colour one (not the pipeline cache, not the CPU allocator, not Valve's
|
||||
FDM/RPO layers); vk_no_fossilize takes the layer out of the game's instance. A few pipelines with the game's
|
||||
multiview vertex shaders then still fail in Turnip; vk_pipeline_fallback creates them with blank shaders.
|
||||
tested_version: 1.495.34291
|
||||
engine: Unreal
|
||||
xr: OpenXR
|
||||
adapter:
|
||||
vk_no_fossilize: 1
|
||||
vk_pipeline_fallback: 1
|
||||
verified:
|
||||
date: '2026-10-17'
|
||||
issue: 349
|
||||
@@ -1,21 +0,0 @@
|
||||
package: com.WenklyStudio.SurvivalNation
|
||||
title: Survival Nation
|
||||
status: works
|
||||
tested_version: 1.14.1
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
scale: 1.8
|
||||
verified:
|
||||
date: '2026-10-18'
|
||||
known_good_sha256: 7903dfee1c9c36d19e1c6c78a1f0ede1f0b25ce6a6065811997297e701009250
|
||||
app: 1.2.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 96
|
||||
issue: 401
|
||||
source_hint: survival nation
|
||||
@@ -1,24 +0,0 @@
|
||||
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
|
||||
@@ -1,22 +0,0 @@
|
||||
package: com.el.blackholepooldemo
|
||||
title: Black Hole Pool
|
||||
status: works
|
||||
tested_version: 5.3.2
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.vivox_audio_route
|
||||
- frame.unity_text_input
|
||||
device:
|
||||
- device.text_input_window
|
||||
adapter:
|
||||
haptic_fix: 1
|
||||
verified:
|
||||
date: '2026-10-17'
|
||||
known_good_sha256: 17c23df3813324250ec1792d8dc0488dadf0df0a7ccbe33157d88f427889a92e
|
||||
app: 1.2.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20261007.6125817'
|
||||
agent: 96
|
||||
issue: 396
|
||||
source_hint: Black Hole Pool
|
||||
@@ -1,12 +0,0 @@
|
||||
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'
|
||||
@@ -1,15 +0,0 @@
|
||||
package: org.primedgun.v2
|
||||
title: PrimedGun v2
|
||||
status: unknown
|
||||
notes: 'Without the Vulkan library rename: the game builds the library name from two pieces, so the renamed name didn''t
|
||||
exist ("libfp_vkn.so"), its renderer fell back to OpenGL and VR couldn''t start (GitHub #254). Not yet confirmed in
|
||||
the headset.'
|
||||
tested_version: 2.0.0-alpha.4
|
||||
engine: Other
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.sdl_clipboard
|
||||
frame_remove:
|
||||
- frame.vk_sanitize
|
||||
updated: '2026-10-18'
|
||||
source_hint: PrimedGun v2 Quest APK (github.com/iChris4/MetroidPrimePortVR)
|
||||
@@ -313,16 +313,6 @@ signatures:
|
||||
diagnosis: The game needs Meta's colour-space extension, which the Frame's runtime doesn't offer, and quits before
|
||||
it starts VR (for example OutRun Quest VR). FrameBridge can offer it.
|
||||
suggest: [adapter.fb_color_space]
|
||||
- id: vulkan-pipeline-refused
|
||||
# GitHub #349: with Lepton's Fossilize layer loaded every Transformers pipeline failed with -1; without it a few
|
||||
# multiview vertex shaders still fail in Turnip. Unreal ends at the first one.
|
||||
pattern: '(Shader compilation failures are Fatal|vk shim: vkCreateGraphicsPipelines failed: -\d+)'
|
||||
severity: fatal
|
||||
diagnosis: The Frame's graphics driver refused to build some of the game's shaders, and Unreal ends the game at the
|
||||
first one (for example Transformers Beyond Reality). Try leaving out Steam's shader cache layer, and skipping the
|
||||
shaders the driver still refuses (they then draw nothing).
|
||||
suggest: [adapter.vk_no_fossilize, adapter.vk_pipeline_fallback]
|
||||
supersedes: [native-crash, force-quit]
|
||||
- id: graphics-requirements-missing
|
||||
pattern: '(XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING|Failed to create XR session: -50\b|xrCreateSession[^\n]*-50\b)'
|
||||
severity: fatal
|
||||
@@ -533,12 +523,6 @@ 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
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
# 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,9 +1,5 @@
|
||||
# Controller buttons
|
||||
|
||||
> **Experimental.** The Frame's runtime accepts these bindings, but the modes haven't been tried in the headset on
|
||||
> many games yet. If buttons stop working in a game, set it back to **SteamVR default** (Game settings →
|
||||
> Controllers) and report it.
|
||||
|
||||
Quest games usually bind Quest Touch controllers. Steam Frame has a d-pad and View button on the left controller,
|
||||
and an A/B/X/Y diamond and Menu button on the right. Without a game's own Frame bindings, SteamVR maps Touch X/A
|
||||
to the bottom button and Touch Y/B to all three top buttons. View sends Touch Menu. The right X and Y therefore
|
||||
|
||||
@@ -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). 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.
|
||||
**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.
|
||||
|
||||
## Heuristics eval (2026-10-04)
|
||||
|
||||
@@ -447,34 +447,11 @@ head-pose deadline ends VR mode without a worn headset (not a game bug).
|
||||
|
||||
## Cube swapchains
|
||||
|
||||
**Cube swapchains (GitHub #107/#385, 2026-10-17):** the Frame's runtime refuses `faceCount=6`
|
||||
swapchains (-2, XR_ERROR_RUNTIME_FAILURE). `cube_standin` (default on, `native/adapter/cube_standin.c`)
|
||||
serves refused cubes with a GLES cube texture in the app's context or a Vulkan cube-compatible image.
|
||||
This prevents OVRPlugin's empty-image-list crash (Budget Cuts Ultimate; Vulkan UNDERDOGS).
|
||||
|
||||
`cube_quads` (int, default 1) now copies mip 0 into six runtime quad swapchains, replacing each cube at
|
||||
its original layer-list position. Face order is +X, -X, +Y, -Y, +Z, -Z; inward-facing quad right/up axes
|
||||
match GL cube s/t. Vulkan copies reverse rows for its top-left quad image origin. The cube orientation
|
||||
rotates the box; its centre follows the stereo view midpoint in the layer's space at displayTime
|
||||
(falls back to the space origin without valid tracking). Faces are 100 m square at 50 m distance.
|
||||
Eye visibility and layer flags are retained. Quads submitted by the game retain their order.
|
||||
|
||||
The Frame draws quads above **every** projection, regardless of order. This implementation conservatively
|
||||
drops cubes whenever any projection is submitted, including alpha projections: it supports cube-only
|
||||
loading screens with optional quad overlays, not skyboxes behind gameplay. Multiple cubes of the same
|
||||
size/format share six swapchains, using separate array slices so their images cannot overwrite one another.
|
||||
Each pool is copied once per frame. Other sizes need another six swapchains; runtime allocation refusal
|
||||
(particularly near its ~15-swapchain cap) frees partial allocations and disables that pool until reset.
|
||||
Pools are freed on stand-in creation/destruction, xrEndSession and session destruction; stand-ins are also freed at
|
||||
session destruction. Set `cube_quads=0` for the previous drop-only behaviour.
|
||||
|
||||
Look for `cube_quads: created six ... face swapchains (GLES|Vulkan)` and
|
||||
`cube_quads: submitting cube as six quads (half-size=50m, mip=0)`. Refusals log
|
||||
`cube_quads: face swapchain creation failed (result=...); dropping cube layers`; mixed frames log
|
||||
`cube_quads: skipping cube with projection; preserving scene visibility` once.
|
||||
Host math/settings/artifact checks and Android builds are available; no device test yet. Headset checks
|
||||
still needed: face seams/orientation, sRGB/alpha, GLES context availability, Vulkan synchronization and
|
||||
loading-to-gameplay transitions (HardBullet's 1024²/32² Vulkan cubes; Budget Cuts GLES).
|
||||
**Cube swapchains (GitHub #107, 2026-10-09):** the Frame's runtime refuses `faceCount=6` swapchains (-2,
|
||||
XR_ERROR_RUNTIME_FAILURE); OVRPlugin ignores that ("CreateSwapchain for eye 0: 0x0, 0 stages") and crashes in
|
||||
ovrp_EndFrame4 (memset). FrameBridge `cube_standin` (default on, `native/adapter/cube_standin.c`) serves a refused cube
|
||||
swapchain as one GL cube-map texture in the app's context (GLES only) and drops its layers. Verified headless with
|
||||
Budget Cuts Ultimate (2048² sRGB, 12 mips; runs on at ~70 fps); what the cube layer showed is simply missing.
|
||||
|
||||
## Hardware video decoding
|
||||
|
||||
@@ -741,23 +718,6 @@ can be enabled and persist after restart. Check actual runtime refresh/pacing se
|
||||
identity alone does not implement refresh-rate support. Rebuild with Quest 2 for the control: original `Oculus Quest2`,
|
||||
original Quest 2 UUID, type 9 if logged, and previous option visibility. Also smoke-test a Unity OVRPlugin game
|
||||
with the default Quest 3 choice for regressions. No device access was used during implementation.
|
||||
## Vulkan pipelines refused: Fossilize and Turnip (Transformers, #349)
|
||||
|
||||
Transformers Beyond Reality: Redux (Unreal, Vulkan) ended its first frames with Unreal's "Shader compilation failures
|
||||
are Fatal." (2026-10-17, headless on the dev Frame). `vk_pipeline_log=1` showed every graphics pipeline failing in
|
||||
pairs: the precache attempt with `VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT` (flags 0x100) answers
|
||||
`1000297000` (= VK_PIPELINE_COMPILE_REQUIRED, normal), the real compile answers `-1` (VK_ERROR_OUT_OF_HOST_MEMORY)
|
||||
in the same millisecond, and the shim never logged a single success. The dumped SPIR-V was valid (spirv-val), one
|
||||
module a constant-colour fragment shader. Ruled out in one run each: the app's VkPipelineCache, its
|
||||
VkAllocationCallbacks (retry without either/both), Valve's VALVE_rpo/VALVE_fdm_injection (`device.foveation: off`).
|
||||
Khronos' validation layer added a crash of its own (null deref in its vkCreateRenderPass2 on the game's create info,
|
||||
the shim changed nothing there): don't use it for this game. Removing `VK_LAYER_fossilize` from GraphicsEnv's debug
|
||||
layer list (`android::GraphicsEnv::setDebugLayers`, as `native/zinkfix` adds its layer) made the pipelines compile:
|
||||
360 modules instead of 10, frames submitted. Two Fossilize instances are still created by other threads before the
|
||||
engine loads the shim; they aren't the renderer's. About six pipelines with the game's multiview vertex shader
|
||||
(module 12944, ViewIndex) still fail in Turnip; a blank fragment shader alone doesn't help, blank vertex + fragment
|
||||
does. Settings `vk_no_fossilize` + `vk_pipeline_fallback` (catalog entry): headless RUNNING after 72 s at 72 fps.
|
||||
Headset check pending (some objects may be missing).
|
||||
|
||||
## Quest controller mode (`quest_buttons`, 2026-10-17)
|
||||
|
||||
|
||||
@@ -202,24 +202,13 @@ Saves stay on the Frame when you update or reinstall a game.
|
||||
|
||||
## Can I back up a game's saves?
|
||||
|
||||
Yes. Steam doesn't sync Quest games' saves, so FramePort copies them to your PC: **Back up saves** next to Play on
|
||||
the installed game's page, or **Back up all saves** on the Steam Frame page (Installed games). Close the game
|
||||
Yes. Steam doesn't sync Quest games' saves, so FramePort copies them to your PC: the game's menu (**…** on its page) →
|
||||
**Saves** → **Back up saves**, or **Back up all saves** on the Steam Frame page (Installed games). Close the game
|
||||
first. A backup holds the game's own storage (`/data/data/<package>` and `/sdcard/Android/data/<package>`), without
|
||||
caches, shader caches and large downloaded content (videos, OBBs, files over 64 MB); the job says when something was
|
||||
left out. FramePort keeps the 10 newest backups per game (Settings → Data). They're in FramePort's data folder under
|
||||
`save-backups/<package>/` (**Open backups folder** in the game's menu).
|
||||
|
||||
In **Settings → Data**, **Choose backup folder…** selects a different folder, including a local Drive or Nextcloud
|
||||
sync folder. FramePort checks that it can write there. **Use the default** resets the location. Existing backups stay
|
||||
where they are and remain listed for restoring; retention only removes old backups in the currently selected folder.
|
||||
FramePort writes local files; your cloud client handles uploading them.
|
||||
|
||||
**Back up saves when a game closes** (Settings → Data, off by default) keeps the newest three changed snapshots per
|
||||
game on the Frame, even while FramePort is closed. Connect once after changing this setting to apply it to the Frame.
|
||||
New snapshots are copied to your backup folder when FramePort connects or polls the connection, marked **automatic**,
|
||||
and count toward the same backup limit. Unchanged saves are skipped. A snapshot captures what the game wrote to disk;
|
||||
it cannot recover progress a forcibly closed game never saved.
|
||||
|
||||
**Restore saves…** puts one back: it replaces the game's saves on the Frame. The Frame keeps a copy of the saves it
|
||||
had, so **Undo last restore** in the same window takes you back. When you uninstall a game and tick *Also delete its
|
||||
saves*, FramePort backs them up first. Command line: `frameport saves backup|list|restore|undo <game>`.
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
`launch.sh` at the new folder and only then deletes the old copy; on the same filesystem it renames instead.
|
||||
Moving a game whose Lepton data holds absolute paths, or a PC VR prefix, is not yet verified on the device.
|
||||
|
||||
## Save backups (Quest games, agent v101, discussion #352)
|
||||
## Save backups (Quest games, agent v95, discussion #352)
|
||||
- A Lepton game's saves are two folders of `<base>/lepton-data`: `internal/<pkg>` (= `/data/data/<pkg>`:
|
||||
`shared_prefs/`, `files/`, `databases/`; Unreal's `files/UE4Game|UnrealGame/.../Saved` often lives here) and
|
||||
`external/Android/data/<pkg>` (= `/sdcard/Android/data/<pkg>`: Unity's `files/`, Unreal's external `Saved`). On the
|
||||
@@ -91,23 +91,6 @@
|
||||
files owned by mapped ids are readable and keep their ids, take the game's launch lock (`<base>/.launch.lock`, a
|
||||
Play meanwhile is ignored as a double launch) and refuse while its container runs. `saves_info` sizes a backup and
|
||||
reports the rollback copy, `saves_rollback_delete` removes it.
|
||||
- PC destination: `saves.folder` (empty = `<data>/save-backups`); Settings → Data has an awaited folder picker,
|
||||
a default reset and a write probe. Old destinations (`saves.previous_folders`) stay listed; switching never moves
|
||||
or deletes files. `saves.keep` defaults to 10 and prunes only the selected destination.
|
||||
- `saves.auto` defaults off. Connection and 30 s poll hooks sync its value using `save_snapshot_settings` (flag
|
||||
`~/.local/share/frameport/save-snapshots/enabled`). Updated and newly written Quest launchers call `_snapshot_close`
|
||||
after stopping the container, inside the EXIT trap, with the launch lock still held on fd 9. The worker verifies
|
||||
that fd against `<base>/.launch.lock` and passes it through `podman unshare`; another launch cannot run meanwhile.
|
||||
`timeout -k 5 90` bounds the whole worker. PC VR/Linux launchers have no snapshot step.
|
||||
- Snapshots use the same archive builder, exclusions and 64 MiB/file, 4 GiB/total limits as manual backups.
|
||||
File paths/sizes/content hashes form a fingerprint; unchanged saves skip compression. Complete snapshots are
|
||||
atomically published under `~/.local/share/frameport/save-snapshots/<pkg>/<ns>-<sha256>.tar.gz`, with fingerprint
|
||||
sidecars. The newest three per game are retained; interrupted `.part` files are overwritten on the next attempt.
|
||||
- `save_snapshots` lists immutable snapshots oldest first per game; `_fetch_save_snapshot '<json>'` streams one
|
||||
(archive stdout, result JSON stderr). PC `install/saves.sync_snapshots` runs in the background, verifies the archive
|
||||
hash and package, imports it as a normal backup marked `automatic`, and applies `saves.keep`. A local
|
||||
`<data>/save-snapshots-synced.json` digest ledger prevents reimporting snapshots after pruning or deleting backups.
|
||||
Failures leave snapshots on the Frame for the next poll. This path does no disk/SSH work in rendering.
|
||||
|
||||
## OpenXR runtime (as seen by games through overport's loader)
|
||||
- Instance extensions present include KHR_android_create_instance (must be enabled; the adapter adds it),
|
||||
@@ -124,9 +107,7 @@
|
||||
`ComposeLayerQuad` and `ComposeLayerProjection`; cube/cylinder/equirect/equirect2 exist only as enum names, so
|
||||
there is nothing to switch on. It has a layer limit ("Exceeded the layer limit"; the value is logged by
|
||||
`layer_debug` from `maxLayerCount`). The adapter emulates cylinders (strips) and, per game, equirect layers
|
||||
(`equirect_emul`, an adapter projection layer). Refused cube swapchains use GLES/Vulkan stand-ins;
|
||||
`cube_quads` (default on) copies their faces into six quads for frames without a projection
|
||||
(see DEVICE_NOTES "Cube swapchains"). Quad layers are drawn above every projection layer regardless of
|
||||
(`equirect_emul`, an adapter projection layer). Quad layers are drawn above every projection layer regardless of
|
||||
submission order (seen 2026-10-01: quads placed before 4XVR's projection layer covered it).
|
||||
- Swapchain formats: GLES `GL_SRGB8_ALPHA8` (35907) / `GL_SRGB8` (35905) only, samples = 1. Vulkan: 43 (R8G8B8A8_SRGB)
|
||||
and 50, not 37/44 (UNORM).
|
||||
@@ -437,57 +418,14 @@ 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 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`.
|
||||
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.
|
||||
|
||||
`device.foveation` enables Valve's shared Vulkan injection and suppresses competing native foveation through
|
||||
`foveation_fix=1`. Game settings stores mode, profile and test selection as a per-game library preference, outside shared recipes. This remains
|
||||
`foveation_fix=1`. Game settings stores mode, radius 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.
|
||||
@@ -514,7 +452,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.
|
||||
Preset export/migration has configuration coverage; these preset comparisons have not been device-tested here.
|
||||
The new configurable radii have configuration/build coverage; each radius has not been separately play-tested.
|
||||
|
||||
## Monitoring sources (probed 2026-10-07, SteamOS 0.4.3, kernel 6.18; used by the Monitor tab, agent `_monitor`)
|
||||
|
||||
@@ -541,7 +479,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, a runtime profile, and an advanced diagnostic switch.
|
||||
Game settings → Picture provides Default / Eye-tracked / Fixed / Off, radius, 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
|
||||
|
||||
@@ -26,7 +26,6 @@ Generated from [catalog/games](../catalog/games) by `scripts/compat_list.py`.
|
||||
| Beat Saber | Quest | ✅ Works | |
|
||||
| Beat Saber | PC VR | ✅ Works | |
|
||||
| Beat Saber (co-existence build) | Quest | ✅ Works | |
|
||||
| Black Hole Pool | Quest | ✅ Works | |
|
||||
| Blade & Sorcery: Nomad | Quest | ✅ Works | |
|
||||
| BlazeRush | Quest | ✅ Works | |
|
||||
| BodyCombat | Quest | ✅ Works | |
|
||||
@@ -118,7 +117,6 @@ 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 | |
|
||||
@@ -128,19 +126,14 @@ 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 | |
|
||||
| Stremio | Quest | ✅ Works | |
|
||||
| Summer Sports | Quest | ✅ Works | |
|
||||
| Superfly | Quest | ✅ Works | |
|
||||
| SUPERHOT VR | PC VR | ✅ Works | |
|
||||
| SUPERHOT VR | Quest | ✅ Works | |
|
||||
| Survival Nation | Quest | ✅ Works | |
|
||||
| Surviving Mars: Pioneer | Quest | ✅ Works | |
|
||||
| SynthRiders | Quest | ✅ Works | |
|
||||
| Table Troopers | Quest | ✅ Works | |
|
||||
| Taskmaster | Quest | ✅ Works | |
|
||||
| Tea For God | Quest | ✅ Works | |
|
||||
| TetrisEffect | Quest | ✅ Works | |
|
||||
@@ -151,7 +144,6 @@ Generated from [catalog/games](../catalog/games) by `scripts/compat_list.py`.
|
||||
| The Room VR | Quest | ✅ Works | |
|
||||
| The Tale of Onogoro | Quest | ✅ Works | |
|
||||
| The Walking Dead: Saints & Sinners | Quest | ✅ Works | |
|
||||
| The Wizards | Quest | ✅ Works | |
|
||||
| Time Crisis II VR (Test) | Quest | ✅ Works | |
|
||||
| Time Crisis VR (Experimental) | Quest | ✅ Works | |
|
||||
| Totally Baseball | Quest | ✅ Works | |
|
||||
@@ -212,4 +204,3 @@ 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. |
|
||||
@@ -64,14 +64,6 @@ Versions compare number by number (`1.10` > `1.9`), and a suffix sorts before th
|
||||
|
||||
To build a link from Python: `frameport.deeplink.make_link(manifest_url="https://…/my-game.json")`.
|
||||
|
||||
**Where to host the manifest.** The install page shows the manifest's name, description and icon only when the
|
||||
manifest's host lets web pages read it (CORS); otherwise it shows "A game or app" (FramePort itself reads any public
|
||||
address). On GitHub, commit the manifest to the repository and link it as a file: `https://raw.githubusercontent.com/
|
||||
<owner>/<repo>/main/my-game.json`, or the `https://github.com/<owner>/<repo>/blob/main/my-game.json` page address,
|
||||
which the page and FramePort turn into the raw address. A manifest attached to a GitHub release
|
||||
(`…/releases/download/…`) installs fine, but web pages can't read it: the page then shows the release's name from
|
||||
GitHub's API instead.
|
||||
|
||||
## On a website
|
||||
|
||||
Image version (any page):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Patches
|
||||
|
||||
Every patch and game setting FramePort knows: 186 entries in 5 groups. A game's recipe is its chosen patches and settings; tested games get theirs from the catalog ([GAMES.md](GAMES.md)), and other games get the patches FramePort suggests from its analysis. You change them on the game page under Customize.
|
||||
Every patch and game setting FramePort knows: 183 entries in 5 groups. A game's recipe is its chosen patches and settings; tested games get theirs from the catalog ([GAMES.md](GAMES.md)), and other games get the patches FramePort suggests from its analysis. You change them on the game page under Customize.
|
||||
|
||||
Each entry says what the patch does, whether it changes the APK or only the install, when FramePort suggests it, its options, the catalog games whose recipe names it and the launch-test signatures that suggest it. Patches that are on by default are on for every game, so the catalog rarely names them.
|
||||
|
||||
@@ -12,7 +12,7 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
|
||||
|
||||
- [Patches from OVRPort](#group-overport) (25)
|
||||
- [Steam Frame patches](#group-frame) (61)
|
||||
- [Game settings](#group-adapter) (77)
|
||||
- [Game settings](#group-adapter) (74)
|
||||
- [Files and settings on the Frame](#group-device) (10)
|
||||
- [PC VR (Proton and Revive)](#group-pcvr) (13)
|
||||
|
||||
@@ -39,7 +39,7 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
|
||||
| [Patch Oculus detection for Unity](#patch_oculus_unity) | `patch_oculus_unity` | Patches from OVRPort | default |
|
||||
| [Patch Oculus detection for Unreal](#patch_oculus_unreal) | `patch_oculus_unreal` | Patches from OVRPort | default |
|
||||
| [Remove localized app names](#patch_remove_localized_names) | `patch_remove_localized_names` | Patches from OVRPort | default |
|
||||
| [Remove Unreal's ForceQuit](#patch_remove_unreal_force_quit) | `patch_remove_unreal_force_quit` | Patches from OVRPort | 46 |
|
||||
| [Remove Unreal's ForceQuit](#patch_remove_unreal_force_quit) | `patch_remove_unreal_force_quit` | Patches from OVRPort | 45 |
|
||||
| [Remove uses-library](#patch_remove_uses_library) | `patch_remove_uses_library` | Patches from OVRPort | default |
|
||||
| [Remove VrApi library](#patch_remove_vrapi) | `patch_remove_vrapi` | Patches from OVRPort | |
|
||||
| [Replace application label and icon](#patch_replace_icon_label) | `patch_replace_icon_label` | Patches from OVRPort | default |
|
||||
@@ -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 | 1 |
|
||||
| [Cortopia games: don't wait for Meta's org-scoped id](#frame-cortopia_org_id) | `frame.cortopia_org_id` | Steam Frame patches | |
|
||||
| [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 | 1 |
|
||||
| [Play services: Android 11 version checks](#frame-gms_platform_version) | `frame.gms_platform_version` | Steam Frame patches | |
|
||||
| [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 | 33 |
|
||||
| [Hardware video decoding (H.264, HEVC, VP9)](#frame-hw_video_decode) | `frame.hw_video_decode` | Steam Frame patches | 31 |
|
||||
| [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,20 +73,20 @@ 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 | 1 |
|
||||
| [SDL apps: start without a clipboard service](#frame-sdl_clipboard) | `frame.sdl_clipboard` | Steam Frame patches | 6 |
|
||||
| [Photon Voice: skip Android 12 audio routing](#frame-photon_voice_audio_route) | `frame.photon_voice_audio_route` | Steam Frame patches | |
|
||||
| [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 | |
|
||||
| [Allow swapchains larger than 4096 px](#frame-swapchain_limit) | `frame.swapchain_limit` | Steam Frame patches | default |
|
||||
| [Team Beef ports: treat the Frame as a Meta headset](#frame-tbxr_vendor) | `frame.tbxr_vendor` | Steam Frame patches | 1 |
|
||||
| [Unity App UI: no Android 12 vibrator](#frame-unity_appui_vibrator) | `frame.unity_appui_vibrator` | Steam Frame patches | |
|
||||
| [GL shim for Unity (no multisampled render-to-texture)](#frame-unity_gl_shim) | `frame.unity_gl_shim` | Steam Frame patches | 26 |
|
||||
| [GL shim for Unity (no multisampled render-to-texture)](#frame-unity_gl_shim) | `frame.unity_gl_shim` | Steam Frame patches | 25 |
|
||||
| [Unity: render each eye separately (no multiview)](#frame-unity_multipass) | `frame.unity_multipass` | Steam Frame patches | 2 |
|
||||
| [Unity: disable MSAA](#frame-unity_no_msaa) | `frame.unity_no_msaa` | Steam Frame patches | 10 |
|
||||
| [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 | 32 |
|
||||
| [Make Unity text fields work](#frame-unity_text_input) | `frame.unity_text_input` | Steam Frame patches | 117 |
|
||||
| [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 |
|
||||
| [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 |
|
||||
@@ -98,10 +98,10 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
|
||||
| [Unreal: start without the OBB check](#frame-unreal_skip_obb_check) | `frame.unreal_skip_obb_check` | Steam Frame patches | 9 |
|
||||
| [Unreal: skip the OBB delivery check](#frame-unreal_skip_obb_delivery) | `frame.unreal_skip_obb_delivery` | Steam Frame patches | 1 |
|
||||
| [Unreal: bypass the stalled loading splash](#frame-unreal_splash_bypass) | `frame.unreal_splash_bypass` | Steam Frame patches | 1 |
|
||||
| [Unreal: thumb follows the capacitive touches](#frame-unreal_thumb_touch) | `frame.unreal_thumb_touch` | Steam Frame patches | 8 |
|
||||
| [Unreal: thumb follows the capacitive touches](#frame-unreal_thumb_touch) | `frame.unreal_thumb_touch` | Steam Frame patches | 7 |
|
||||
| [USB MIDI: don't poll for USB devices](#frame-usb_midi_watcher) | `frame.usb_midi_watcher` | Steam Frame patches | |
|
||||
| [Vermillion: paint canvases in the scene](#frame-vermillion_scene_canvas) | `frame.vermillion_scene_canvas` | Steam Frame patches | 1 |
|
||||
| [Vivox voice chat: skip Android 12 audio routing](#frame-vivox_audio_route) | `frame.vivox_audio_route` | Steam Frame patches | 3 |
|
||||
| [Vivox voice chat: skip Android 12 audio routing](#frame-vivox_audio_route) | `frame.vivox_audio_route` | Steam Frame patches | 2 |
|
||||
| [Vulkan: drop invalid render-pass pointers](#frame-vk_sanitize) | `frame.vk_sanitize` | Steam Frame patches | default · 1 |
|
||||
| [VrApi → OpenXR bridge](#frame-vrapi_bridge) | `frame.vrapi_bridge` | Steam Frame patches | 4 |
|
||||
| [Quiet Meta's VrApi loader (OpenXR games)](#frame-vrapi_stub) | `frame.vrapi_stub` | Steam Frame patches | 2 |
|
||||
@@ -113,7 +113,6 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
|
||||
| [Fix inside-out mixed reality](#adapter-alpha_blend_emul) | `adapter.alpha_blend_emul` | Game settings | |
|
||||
| [Use controllers](#adapter-controller_fix) | `adapter.controller_fix` | Game settings | 1 |
|
||||
| [Show Steam Frame controllers](#adapter-controller_models) | `adapter.controller_models` | Game settings | 6 |
|
||||
| [Show cube loading screens](#adapter-cube_quads) | `adapter.cube_quads` | Game settings | |
|
||||
| [Stand in for cube layers](#adapter-cube_standin) | `adapter.cube_standin` | Game settings | |
|
||||
| [Show curved menus and screens](#adapter-cylinder_strips) | `adapter.cylinder_strips` | Game settings | |
|
||||
| [Show 360° backgrounds and videos](#adapter-equirect_emul) | `adapter.equirect_emul` | Game settings | 7 |
|
||||
@@ -137,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 | 102 |
|
||||
| [Fix freezes when controllers vibrate](#adapter-haptic_fix) | `adapter.haptic_fix` | Game settings | 96 |
|
||||
| [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 |
|
||||
@@ -150,7 +149,7 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
|
||||
| [See your room](#adapter-passthrough_emul) | `adapter.passthrough_emul` | Game settings | |
|
||||
| [Steadier head tracking](#adapter-pose_consistency) | `adapter.pose_consistency` | Game settings | 2 |
|
||||
| [Pose timing diagnostics (log)](#adapter-pose_debug) | `adapter.pose_debug` | Game settings | |
|
||||
| [Fix hands lagging behind controllers](#adapter-pose_time_fix) | `adapter.pose_time_fix` | Game settings | 16 |
|
||||
| [Fix hands lagging behind controllers](#adapter-pose_time_fix) | `adapter.pose_time_fix` | Game settings | 15 |
|
||||
| [Treat newer Quest controllers as Touch](#adapter-profile_remap) | `adapter.profile_remap` | Game settings | |
|
||||
| [Animate fingers from touch](#adapter-proximity_emul) | `adapter.proximity_emul` | Game settings | |
|
||||
| [Controller buttons](#adapter-quest_buttons) | `adapter.quest_buttons` | Game settings | |
|
||||
@@ -158,7 +157,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 | 14 |
|
||||
| [Render resolution (supersampling)](#adapter-scale) | `adapter.scale` | Game settings | 9 |
|
||||
| [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 | |
|
||||
@@ -173,8 +172,6 @@ Link to an entry with its id, dots replaced by dashes: `PATCHES.md#frame-unity_t
|
||||
| [Retry refused picture formats](#adapter-swapchain_fix) | `adapter.swapchain_fix` | Game settings | |
|
||||
| [Steady controller input after focus](#adapter-sync_guard) | `adapter.sync_guard` | Game settings | 3 |
|
||||
| [Hide Vulkan foveation](#adapter-vk_hide_fdm) | `adapter.vk_hide_fdm` | Game settings | 1 |
|
||||
| [Without Steam's shader cache layer](#adapter-vk_no_fossilize) | `adapter.vk_no_fossilize` | Game settings | 1 |
|
||||
| [Skip refused graphics](#adapter-vk_pipeline_fallback) | `adapter.vk_pipeline_fallback` | Game settings | 1 |
|
||||
| [Vulkan pipeline failures (log)](#adapter-vk_pipeline_log) | `adapter.vk_pipeline_log` | Game settings | |
|
||||
| [Stop objects popping in and out](#adapter-vk_query_slots) | `adapter.vk_query_slots` | Game settings | |
|
||||
| [Vulkan shader dump (diagnostics)](#adapter-vk_shader_dump) | `adapter.vk_shader_dump` | Game settings | |
|
||||
@@ -192,7 +189,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 | 120 |
|
||||
| [Show the app's Android window (for typing)](#device-text_input_window) | `device.text_input_window` | Files and settings on the Frame | 114 |
|
||||
| [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) | |
|
||||
@@ -437,7 +434,7 @@ Stops some Unreal games from closing themselves right after starting.
|
||||
- `patch_remove_unreal_force_quit`
|
||||
- **Changes:** Changes the APK (during the OVRPort conversion).
|
||||
- **Offered (off):** Built as the alternate APK for Unreal games (use it if the game quits itself).
|
||||
- **Catalog games (46):** Asgard's Wrath 2, BARTENDER VR SIMULATOR, Breathedge VR, Carve Snowboarding, Creed, Dance Central, Espire 1: VR Operative (Quest Edition), Espire 2 and 38 more.
|
||||
- **Catalog games (45):** Asgard's Wrath 2, BARTENDER VR SIMULATOR, Breathedge VR, Carve Snowboarding, Creed, Dance Central, Espire 1: VR Operative (Quest Edition), Espire 2 and 37 more.
|
||||
- **Suggested by launch-test signatures:**
|
||||
- `force-quit` (error): The game quit itself right after starting.
|
||||
- **Source:** [patches/overport.py](../src/frameport/patches/overport.py)
|
||||
@@ -528,7 +525,6 @@ 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.
|
||||
@@ -611,7 +607,6 @@ 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)
|
||||
@@ -665,7 +660,6 @@ 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)
|
||||
@@ -693,7 +687,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 (33):** 4XVR Video Player, AugmentedEmpire, Batman: Arkham Shadow, Battlemarked, BattleTalent, Breathedge VR, Dance Central, Exploding Kittens VR and 25 more.
|
||||
- **Catalog games (31):** 4XVR Video Player, AugmentedEmpire, Batman: Arkham Shadow, Battlemarked, BattleTalent, Breathedge VR, Dance Central, Exploding Kittens VR and 23 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.
|
||||
@@ -888,7 +882,6 @@ 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)
|
||||
@@ -902,7 +895,7 @@ Lets SDL and LÖVE games start on the Frame (they'd crash looking for a clipboar
|
||||
- `frame.sdl_clipboard` · also for 2D apps
|
||||
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
|
||||
- **Suggested (on):** SDL app: it crashes at start in Lepton, which has no clipboard service.
|
||||
- **Catalog games (6):** Crisis Zone VR, Majora's Mask VR, PrimedGun v2, Time Crisis II VR (Test), Time Crisis VR (Experimental), WiiCompiled VR.
|
||||
- **Catalog games (5):** Crisis Zone VR, Majora's Mask VR, Time Crisis II VR (Test), Time Crisis VR (Experimental), WiiCompiled VR.
|
||||
- **Suggested by launch-test signatures:**
|
||||
- `sdl-no-clipboard` (fatal): The app crashed at start because the Frame's Android has no clipboard.
|
||||
- **Source:** [patches/frame/sdl_clipboard.py](../src/frameport/patches/frame/sdl_clipboard.py)
|
||||
@@ -981,7 +974,7 @@ Stops a gray or frozen screen in Unity games that turn on anti-aliasing while ru
|
||||
- `frame.unity_gl_shim`
|
||||
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
|
||||
- **Suggested (on):** Unity GLES game that may switch to MSAA at runtime: hide multisampled render-to-texture, which crashes the Frame's GL driver (for example The Room VR).
|
||||
- **Catalog games (26):** Audica, BattleSisters, Beat Saber, COMPOUND, Cosmodread, Down the Rabbit Hole, Drunkn Bar Fight, End Space and 18 more.
|
||||
- **Catalog games (25):** Audica, BattleSisters, Beat Saber, COMPOUND, Cosmodread, Down the Rabbit Hole, Drunkn Bar Fight, End Space and 17 more.
|
||||
- **Suggested by launch-test signatures:**
|
||||
- `unreal-msrtt-crash` (fatal): The game's graphics crashed a few seconds after start.
|
||||
- **Source:** [patches/frame/vrapi_bridge.py](../src/frameport/patches/frame/vrapi_bridge.py)
|
||||
@@ -1050,7 +1043,7 @@ Keeps a smoothing setting off that the game turns on itself and that can freeze
|
||||
- `frame.unity_runtime_msaa_off` · revision 2
|
||||
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
|
||||
- **Suggested (on):** GLES Unity game whose OVRManager turns 4x MSAA on at runtime: multisampled render-to-texture can hang the Frame's GPU.
|
||||
- **Catalog games (32):** Audica, BattleSisters, BattleTalent, Beat Saber, COMPOUND, Cosmodread, Down the Rabbit Hole, Drunkn Bar Fight and 24 more.
|
||||
- **Catalog games (31):** Audica, BattleSisters, BattleTalent, Beat Saber, COMPOUND, Cosmodread, Down the Rabbit Hole, Drunkn Bar Fight and 23 more.
|
||||
- **Suggested by launch-test signatures:**
|
||||
- `unity-render-crash` (fatal): The game's graphics crashed, so the picture freezes or stays gray.
|
||||
- `unity-runtime-msaa` (info): The game turns MSAA on at runtime, which can hang the Frame's GPU.
|
||||
@@ -1066,7 +1059,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 (117):** AgeOfJoy, AllInOneSports, Ancient_Dungeon, Arcsmith, Arkio, Assassin's Creed Nexus, Attack on Titan VR: Unbreakable, Audica and 109 more.
|
||||
- **Catalog games (111):** AgeOfJoy, AllInOneSports, Ancient_Dungeon, Arcsmith, Arkio, Assassin's Creed Nexus, Attack on Titan VR: Unbreakable, Audica and 103 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 -> false and isKeyboardUsingEvents (TMP) / InPlaceEditing (uGUI) -> 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.
|
||||
@@ -1224,7 +1217,7 @@ Makes the hands' thumbs follow what your thumb touches (they always pointed up:
|
||||
- `frame.unreal_thumb_touch`
|
||||
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
|
||||
- **Suggested:** not automatically; set on the game page (Customize), by a recipe or after a launch test.
|
||||
- **Catalog games (8):** Phantom: Covert Ops, Robo Recall, Star Wars: Tales from the Galaxy's Edge, The Wizards, Time Stall, Vader Immortal: Episode I, Vader Immortal: Episode II, Vader Immortal: Episode III.
|
||||
- **Catalog games (7):** Phantom: Covert Ops, Robo Recall, Star Wars: Tales from the Galaxy's Edge, Time Stall, Vader Immortal: Episode I, Vader Immortal: Episode II, Vader Immortal: Episode III.
|
||||
- **Source:** [patches/frame/unreal_thumb_touch.py](../src/frameport/patches/frame/unreal_thumb_touch.py)
|
||||
|
||||
> Unreal 4's Oculus input sets the ThumbUp axis (games animate the hand's thumb with it) from Meta's near-touch sensing, which the Frame never reports: the thumb always points up. Uses the touches instead (left X/Y/stick/thumb rest, right A/B/stick/thumb rest). Changes three instructions in OculusInput::SendControllerEvents, only where the code matches exactly (UE4 Oculus games of one engine generation, for example Vader Immortal, Robo Recall). Found by Klownicle (GitHub #49).
|
||||
@@ -1261,7 +1254,7 @@ Lets games with Vivox voice chat start on the Frame (they'd crash on an Android
|
||||
- `frame.vivox_audio_route` · also for 2D apps
|
||||
- **Changes:** Changes the APK (a rebuild and reinstall apply it).
|
||||
- **Suggested (on):** Vivox voice chat: it calls Android 12 audio methods, which Lepton (Android 11) lacks, and crashes.
|
||||
- **Catalog games (3):** Black Hole Pool, Dungeons of Eternity, Real VR Fishing.
|
||||
- **Catalog games (2):** Dungeons of Eternity, Real VR Fishing.
|
||||
- **Suggested by launch-test signatures:**
|
||||
- `vivox-api31` (fatal): The game's Vivox voice-chat SDK calls Android 12 audio-routing methods (AudioManager communication devices) without checking the Android version; Lepton runs Android 11, so the app crashes (for example Green Hell VR).
|
||||
- **Source:** [patches/frame/vivox_audio_route.py](../src/frameport/patches/frame/vivox_audio_route.py)
|
||||
@@ -1433,20 +1426,6 @@ For games that show the headset's own controllers. Takes effect after a reinstal
|
||||
|
||||
> Games that ask the headset for its controller models (Meta's runtime controller models, XR_FB_render_model) get the Steam Frame controllers instead of Quest Touch controllers. The models come from the Frame's own SteamVR and are converted on the Frame at install time. Games that ship their own controller meshes aren't affected. Turning it on needs a rebuild (it adds a small library in front of OVRPort's loader).
|
||||
|
||||
### <a id="adapter-cube_quads"></a>Show cube loading screens
|
||||
|
||||
Shows 360° cube loading screens as six panels around you. Requires stand-in cube layers. Skipped while a 3D scene is submitted.
|
||||
|
||||
- `adapter.cube_quads`
|
||||
- **Changes:** Game setting: stored in the build and on the Frame (settings.conf); can be changed without a rebuild.
|
||||
- **Suggested:** not automatically; set on the game page (Customize), by a recipe or after a launch test.
|
||||
- **Options:**
|
||||
- Value: int, default `1`.
|
||||
- Game settings → Troubleshooting → "Show cube loading screens" (advanced).
|
||||
- **Source:** [patches/settings.py](../src/frameport/patches/settings.py)
|
||||
|
||||
> Copies cube-map loading screens into six panels around the viewer (GLES and Vulkan). Mixed projection frames are skipped because the Frame draws panels above the scene. Requires cube_standin.
|
||||
|
||||
### <a id="adapter-cube_standin"></a>Stand in for cube layers
|
||||
|
||||
Keeps games running that use a 360° cube layer the Frame lacks (for example Budget Cuts Ultimate). Leave it on.
|
||||
@@ -1459,7 +1438,7 @@ Keeps games running that use a 360° cube layer the Frame lacks (for example Bud
|
||||
- Game settings → Troubleshooting → "Stand in for cube layers" (advanced).
|
||||
- **Source:** [patches/settings.py](../src/frameport/patches/settings.py)
|
||||
|
||||
> The Frame's runtime has no cube-map layers and refuses their swapchains; OVRPlugin then crashes when it submits the next frame (for example Budget Cuts Ultimate). FrameBridge serves such a swapchain itself on GLES and Vulkan; cube_quads displays its loading screens.
|
||||
> The Frame's runtime has no cube-map layers and refuses their swapchains; OVRPlugin then crashes when it submits the next frame (for example Budget Cuts Ultimate). FrameBridge serves such a swapchain itself (a GL cube map, GLES games) and drops its layers, so the game runs on without that layer.
|
||||
|
||||
### <a id="adapter-cylinder_strips"></a>Show curved menus and screens
|
||||
|
||||
@@ -1794,7 +1773,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 (102):** AgeOfJoy, Ancient_Dungeon, Attack on Titan VR: Unbreakable, Audica, AugmentedEmpire, Battlemarked, BattleSisters, BattleTalent and 94 more.
|
||||
- **Catalog games (96):** AgeOfJoy, Ancient_Dungeon, Attack on Titan VR: Unbreakable, Audica, AugmentedEmpire, Battlemarked, BattleSisters, BattleTalent and 88 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.
|
||||
@@ -1988,7 +1967,7 @@ For games whose hands trail the controllers when you move them (for example Batt
|
||||
- **Options:**
|
||||
- Value: int, default `0`.
|
||||
- Game settings → Controllers → "Fix hands lagging behind controllers" (advanced).
|
||||
- **Catalog games (16):** Battlemarked, BattleSisters, Beat Saber, Dance Central, Dungeons of Eternity, Mini Motor Racing X, OrbusVR, Phantom: Covert Ops and 8 more.
|
||||
- **Catalog games (15):** Battlemarked, BattleSisters, Beat Saber, Dance Central, Dungeons of Eternity, Mini Motor Racing X, OrbusVR, Phantom: Covert Ops and 7 more.
|
||||
- **Source:** [patches/settings.py](../src/frameport/patches/settings.py)
|
||||
|
||||
> Poses a game asks for at a CLOCK_MONOTONIC time, or more than 0.5 s before the frame's display time, are located at the same moment in the runtime's time (or now). Meta's OVRPlugin passes the monotonic clock on as the OpenXR time, which on the Frame runs seconds behind the runtime's clock, so its "now" poses (Unity's physics step, controller poses) came from the past: hands trailing the controllers (for example BattleSisters, Sniper Elite VR).
|
||||
@@ -2025,7 +2004,7 @@ For games whose hands' thumbs never move when you touch the buttons or thumbstic
|
||||
|
||||
Choose which Quest Touch buttons the Frame's face buttons send. Takes effect at the next launch.
|
||||
|
||||
- `adapter.quest_buttons` · experimental
|
||||
- `adapter.quest_buttons`
|
||||
- **Changes:** Game setting: stored in the build and on the Frame (settings.conf); can be changed without a rebuild.
|
||||
- **Suggested:** not automatically; set on the game page (Customize), by a recipe or after a launch test.
|
||||
- **Options:**
|
||||
@@ -2102,7 +2081,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 (14):** 4XVR Video Player, BlazeRush, CrazyTaxiVR, cubism, FGO VR, I Expect You To Die 2, Spectre, Survival Nation and 6 more.
|
||||
- **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.
|
||||
- **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.
|
||||
@@ -2318,40 +2297,6 @@ For Unreal Engine 5 games that crash on the Frame (for example Metro Awakening).
|
||||
|
||||
> Vulkan shim (frame.vk_sanitize): the game doesn't see VK_EXT_fragment_density_map(2). Unreal Engine 5 turns on fragment-density-map foveation when the driver offers it and expects the density map from the headset, which the Frame doesn't provide: image views and barriers for a missing image, then a crash in the Frame's Vulkan driver (for example Metro Awakening). Valve's own foveation layer isn't affected.
|
||||
|
||||
### <a id="adapter-vk_no_fossilize"></a>Without Steam's shader cache layer
|
||||
|
||||
Some games can't create any graphics with it (for example Transformers Beyond Reality).
|
||||
|
||||
- `adapter.vk_no_fossilize`
|
||||
- **Changes:** Game setting: stored in the build and on the Frame (settings.conf); can be changed without a rebuild.
|
||||
- **Suggested:** not automatically; set on the game page (Customize), by a recipe or after a launch test.
|
||||
- **Options:**
|
||||
- Value: int, default `0`.
|
||||
- Game settings → Troubleshooting → "Without Steam's shader cache layer" (advanced).
|
||||
- **Catalog games (1):** Transformers Beyond Reality: Redux.
|
||||
- **Suggested by launch-test signatures:**
|
||||
- `vulkan-pipeline-refused` (fatal): The Frame's graphics driver refused to build some of the game's shaders, and Unreal ends the game at the first one (for example Transformers Beyond Reality).
|
||||
- **Source:** [patches/settings.py](../src/frameport/patches/settings.py)
|
||||
|
||||
> Vulkan shim (frame.vk_sanitize): takes Lepton's Fossilize shader-cache layer out of the game's Vulkan layers (Android's debug layer list) when the engine loads its Vulkan library. With Fossilize loaded every graphics pipeline of Transformers Beyond Reality failed (VK_ERROR_OUT_OF_HOST_MEMORY), which Unreal treats as fatal (GitHub #349). Lepton has no switch for it; instances created before the engine loads the shim keep it.
|
||||
|
||||
### <a id="adapter-vk_pipeline_fallback"></a>Skip refused graphics
|
||||
|
||||
When the Frame's driver refuses one of the game's shaders, that object is left out instead of the game ending.
|
||||
|
||||
- `adapter.vk_pipeline_fallback`
|
||||
- **Changes:** Game setting: stored in the build and on the Frame (settings.conf); can be changed without a rebuild.
|
||||
- **Suggested:** not automatically; set on the game page (Customize), by a recipe or after a launch test.
|
||||
- **Options:**
|
||||
- Value: int, default `0`.
|
||||
- Game settings → Troubleshooting → "Skip refused graphics" (advanced).
|
||||
- **Catalog games (1):** Transformers Beyond Reality: Redux.
|
||||
- **Suggested by launch-test signatures:**
|
||||
- `vulkan-pipeline-refused` (fatal): The Frame's graphics driver refused to build some of the game's shaders, and Unreal ends the game at the first one (for example Transformers Beyond Reality).
|
||||
- **Source:** [patches/settings.py](../src/frameport/patches/settings.py)
|
||||
|
||||
> Vulkan shim (frame.vk_sanitize): a graphics pipeline the Frame's driver refuses is created again with a fragment shader that writes zero, then with a vertex shader that only sets the position as well, so the draw shows nothing instead of Unreal ending with "Shader compilation failures are Fatal." (for example a few multiview vertex shaders in Transformers Beyond Reality, GitHub #349). Logged as "retried with a blank".
|
||||
|
||||
### <a id="adapter-vk_pipeline_log"></a>Vulkan pipeline failures (log)
|
||||
|
||||
Logs graphics pipelines the Frame's driver refuses. No effect on the game.
|
||||
@@ -2526,12 +2471,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)
|
||||
- `level`: str, default empty — Runtime profile: lo, med, hi (empty = Default)
|
||||
- `radius`: float, default `0.0`, 0–0.45 — Full-resolution radius; 0 keeps the current runtime 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 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, 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.
|
||||
|
||||
### <a id="device-headset_model"></a>Headset model
|
||||
|
||||
@@ -2601,7 +2546,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 (120):** AFFECTED: The Manor, AgeOfJoy, AllInOneSports, Ancient_Dungeon, Arcsmith, Arkio, Assassin's Creed Nexus, Attack on Titan VR: Unbreakable and 112 more.
|
||||
- **Catalog games (114):** AFFECTED: The Manor, AgeOfJoy, AllInOneSports, Ancient_Dungeon, Arcsmith, Arkio, Assassin's Creed Nexus, Attack on Titan VR: Unbreakable and 106 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".
|
||||
|
||||
@@ -20,7 +20,6 @@ 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 |
|
||||
@@ -32,7 +31,6 @@ version is `catalog/triage.yaml` (used by `frameport test` / the Job screen); ke
|
||||
| A Unity Quest game stays on a loading screen or doesn't go on; `An unknown error occurred. Request failed.` from `Oculus.Platform.Request`1:OnComplete` (GitHub #346 Eleven, #360 Spectre, #368 Thief Simulator; triage `meta-request-failed`) | A Meta platform call the game waits for got no usable answer: OVRPort's platform library answers some calls without Meta's services (request id 0) and Meta's Unity wrapper drops the callback | Find the call in the stack (the game's own coroutine after `OnComplete`); a per-game fix that skips it when it isn't needed to play (e.g. an analytics id request). Calls the game needs online stay unsupported |
|
||||
| Game aborts at start: `OVRPlatform-Loader: DisplayErrorAndExit: Failed to launch SystemActivities` after an `ActivityNotFoundException` stack (GitHub #357 Breachers; triage `meta-system-activities`) | The game ships its own renamed copy of Meta's platform loader (e.g. `libovr_custom.so`), which bypasses OVRPort's dispatcher and tries to open Meta's system activities (Horizon OS) | None in general: such games are online games built on Meta's services. Serving OVRPort's dispatcher under that name is possible but unlikely to make them playable |
|
||||
| Missing sound or extra content in a game whose OBB folder has separate `*.pak` files (GitHub #61, Star Wars: Tales from the Galaxy's Edge: seasons + Wwise banks) | the game asks Meta's platform for these asset files (`ovr_AssetFile_GetList` / `DownloadById`); OVRPort's loader doesn't list them | copy every content/sound-bank PAK and use `frame.asset_files` (native/langpack lists the data's `*.pak` as installed `default` assets, IAP `free`, and answers DownloadById at once with the path; off: env FRAMEPORT_ASSET_FILES=0). Tales also needs the splash and depth-size fixes below |
|
||||
| Quest saves need a cloud folder or backups after playing (discussion #352) | Steam does not sync Quest saves | Settings → Data: choose a writable local cloud-sync folder and optionally enable **Back up saves when a game closes**, then connect to apply it. The Frame keeps three changed snapshots per game; FramePort imports them on connection/poll. Manual **Back up saves** is next to Play; Restore stays in the menu. Old backup folders remain available and are never moved silently |
|
||||
| A SideQuest backup has `apk/` and a sibling `obb/` with content/sound-bank PAKs, but the Frame only has the main OBB (GitHub #61, Tales from the Galaxy's Edge) | older scans treated that layout as loose expansion files and selected only the named OBBs; the asset-file patch then found no PAKs | the scanner chooses the OBB folder by version first, then keeps the whole sibling data folder when all its expansion files are selected for this APK; app updates repair affected library entries and refresh asset/language-pack detection. Reinstall to copy the missing files, or scan the backup again first. Folders with other packages or unselected OBB versions still send only the selected OBBs |
|
||||
| Tales from the Galaxy's Edge stops during map loading (GitHub #61): game thread in `FlushRenderingCommands` / `UEngine::LoadMap`, render thread in `FSplash::RenderFrame_RenderThread` / `ovrp_WaitToBeginFrame` / SteamVR `WaitFrame` | the separate Oculus loading splash waits for an unbegun frame while map travel waits for rendering | `frame.unreal_splash_bypass`: returns from the splash renderer, with a checked symbol, size and prologue. The last image stays visible during loading; the normal renderer and menu layers continue. Headset test with the depth-size fix: gameplay, both eyes, controller input and sound work |
|
||||
| Upper part of the intro/environment is black or clipped, but a separate menu panel is intact (GitHub #61, Tales from the Galaxy's Edge) | `FSceneRenderTargets::AllocMobileMultiViewDepth` caches the initial Android window dimensions (1920x1016/1020), leaving the depth attachment shorter than the eye color texture (1728x1728); drawing is limited by the smaller attachment | `frame.unreal_multiview_depth`: refreshes both cached depth dimensions from the current scene `BufferSize` before allocation. Checks the exported symbol, function size and surrounding instructions, then replaces only the branch that skips refresh. Keeps multiview and multisampling. Headset test: full view and gameplay work |
|
||||
@@ -109,7 +107,6 @@ version is `catalog/triage.yaml` (used by `frameport test` / the Job screen); ke
|
||||
| `xrConvert…TimeKHR` FUNCTION_UNSUPPORTED spam; VrApi bridge stalls before recenter | runtime lacks timespec conversion | current adapter emulates it |
|
||||
| Crash on the first frame, backtrace `libVkLayer_fossilize.so` ← `FVulkanRenderPass::FVulkanRenderPass` (crash logcat) | the engine leaves the pNext of unused Vulkan attachment references uninitialized; Lepton always loads Steam's Fossilize layer (guest is userdebug, so even a non-debuggable APK gets it), which follows the pointer | `frame.vk_sanitize` (default on for Unreal; Vulkan shim `libfp_vk.so`; triage `fossilize-renderpass`), for example Deadpool VR |
|
||||
| SIGABRT right after start, backtrace `libopenxr_loader.so (xrCreateSwapchain+…)` | overport's dispatcher aborts on swapchains > 4096 px ("Wrong createInfo size"); video players use 7680×3840 theater textures | `frame.swapchain_limit` (default on; guard → 16384 px; triage `swapchain-size-abort`), for example 4XVR |
|
||||
| Cube loading screen missing/frozen, `cube_standin: dropped a layer (type=1000006000)` (HardBullet #385, Budget Cuts #107) | Runtime refuses cube swapchains and composites only quad/projection layers | Rebuild with `cube_standin=1`, `cube_quads=1` (defaults): mip-0 cube faces become six inward quads. Pools reuse six swapchains per size/format, with array slices for distinct cubes. Cubes are conservatively skipped in any frame containing a projection, since Frame draws quads above it. Allocation/copy failure falls back to dropping with `cube_quads:` diagnostics. Host-tested; headset visuals pending |
|
||||
| Video/menu panel missing, log `dropped N unusable layer(s)` with cylinder (1000017000) or equirect2 (1000091000) layers | the Frame runtime lacks XR_KHR_composition_layer_cylinder/equirect(2)/cube (its SteamVR runtime only composites quad + projection layers) | adapter shows cylinders as flat strips (setting `cylinder_strips`, default on); 360° equirect layers (theaters, 360° videos): `adapter.equirect_emul` (GLES only, per game) |
|
||||
| 360° theater / 360° video black or missing (for example 4XVR) | equirect layers dropped | `adapter.equirect_emul=1`: a worker thread with a shared GLES context converts each 360° image to a cube map when it changes and draws one adapter projection layer from it for every frame with exactly that frame's views; it replaces the 360° layers in place, so the game's own projection layer (balcony, controllers, 360° videos it draws itself) stays on top. Quads can't be used: the Frame draws quad layers above every projection layer whatever the order. Log: `first 360 view ready`, `in 5 s: N 360 image update(s) … M view redraw(s)`. Upside down / mirrored / behind you: `equirect_flip` 1/2/4 (`frameport settings <pkg> equirect_flip=1`, no rebuild). Never Vulkan (a Vulkan renderer hung the Frame's GPU in AC Nexus) |
|
||||
| Fades to black don't show: you see the level loading behind a loading screen (Batman: Arkham Shadow, GitHub #197); with `layer_debug=1` launch.log shows `color scale 0.00 0.00 0.00 …` on the projection layer | the game fades by dimming its eye image with XR_KHR_composition_layer_color_scale_bias; whether the Frame's runtime applies it isn't confirmed in the headset yet | `adapter.fade_quad=1` (opt-in, `native/adapter/fade_quad.c`): FrameBridge adds a black, alpha-blended quad right after the dimmed projection layer (VIEW space, 1 m ahead, 6×6 m; opacity = 1 − scale in 16 steps from one 8×8 swapchain refilled only when the step changes: Vulkan clear / GLES clear; one swapchain per step hit XR_ERROR_LIMIT_REACHED in Batman), log `fade_quad: drawing fades over the picture`; `fade_quad=2` also removes the layer's own scale (if both show, the fade is doubled) |
|
||||
@@ -125,12 +122,11 @@ 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, 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) |
|
||||
| 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) |
|
||||
| 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 |
|
||||
| Unity game (OVRPlugin, GLES or Vulkan) crashes ~10 s in: `FrameBridge: xrCreateSwapchain … faces=6 … result=-2`, OVRPlugin `CreateSwapchain for eye 0: 0x0, 0 stages`, then render-thread SIGSEGV in memset ← libOVRPlugin ← `ovrp_EndFrame4` (libgallium/ANR follow; for example Budget Cuts Ultimate, GitHub #107); triage `cube-swapchain-refused` | The game shows a cube-map layer (OVROverlay cubemap); the Frame's runtime has no cube layers and refuses cube swapchains (XR_ERROR_RUNTIME_FAILURE); OVRPlugin doesn't check and writes into the image list it never got | FrameBridge `cube_standin` (default on): a refused cube swapchain is served as a GL cube map in the game's context or a device-local Vulkan cube image transitioned to COLOR_ATTACHMENT_OPTIMAL, and `cube_quads` displays cube-only loading screens as six quads (log `cube_standin: runtime refused …`): rebuild + reinstall. Vulkan path covers UNDERDOGS (GitHub #296); host-tested, headset verification pending |
|
||||
| Unity game (OVRPlugin, GLES or Vulkan) crashes ~10 s in: `FrameBridge: xrCreateSwapchain … faces=6 … result=-2`, OVRPlugin `CreateSwapchain for eye 0: 0x0, 0 stages`, then render-thread SIGSEGV in memset ← libOVRPlugin ← `ovrp_EndFrame4` (libgallium/ANR follow; for example Budget Cuts Ultimate, GitHub #107); triage `cube-swapchain-refused` | The game shows a cube-map layer (OVROverlay cubemap); the Frame's runtime has no cube layers and refuses cube swapchains (XR_ERROR_RUNTIME_FAILURE); OVRPlugin doesn't check and writes into the image list it never got | FrameBridge `cube_standin` (default on): a refused cube swapchain is served as a GL cube map in the game's context or a device-local Vulkan cube image transitioned to COLOR_ATTACHMENT_OPTIMAL, and its layers are dropped (log `cube_standin: runtime refused …`): rebuild + reinstall. Vulkan path covers UNDERDOGS (GitHub #296); host-tested, headset verification pending |
|
||||
| Game (Unity, GLES) freezes, `zink: DEVICE LOST` | multisampled render-to-texture hangs the GPU | `frame.unity_no_msaa`; if it persists: unfixable → PC version |
|
||||
| Unreal GLES game crashes ~3 s after start: `Fatal signal 11 … fault addr 0x10000 in tid … (RHIThread)`, `#01 … libgallium_dri.so` (GitHub #83 Star Wars Pinball VR, triage `unreal-msrtt-crash`) | Unreal's mobile MSAA renders through multisampled render-to-texture; Zink's `find_rp_state` then indexes `rendering_state_cache[6]` one past its end (sample count ≥ 32) and calls a junk hash function (0x10000). Mesa bug (no bounds check) | `frame.unreal_gl_shim` (GL shim with `gl_hide_msrtt`, multiview kept for Unreal: Unreal 4.25 only enables multiview with GL_OVR_multiview, GL_OVR_multiview2 **and** GL_OVR_multiview_multisampled_render_to_texture, so the shim keeps the last one visible for Unreal and maps glFramebufferTextureMultisampleMultiviewOVR to the single-sampled glFramebufferTextureMultiviewOVR; log `multiview multisampled render-to-texture (N samples) drawn single-sampled`) |
|
||||
| Crash with `SIGILL (ILL_ILLOPN)` and `*pc=0xd50323bf` (autiasp), for example on Unreal's HttpManager thread (GitHub #83 Star Wars Pinball VR, triage `pac-unpaired`) | The engine's OpenSSL ARMv8 assembly has autiasp without a matching paciasp (libUE4.so: 38 paciasp, 40 autiasp; Poly1305 NEON). Quest CPUs treat PAC hints as NOPs, the Frame's CPU checks them | `frame.pac_hints`: in a library with unpaired counts every paciasp/autiasp becomes a NOP (in place) |
|
||||
@@ -211,7 +207,7 @@ version is `catalog/triage.yaml` (used by `frameport test` / the Job screen); ke
|
||||
| Unity game shows a picture but the player body is frozen: no head tracking, the controllers stay on the model, no buttons, although OpenXR input works (BONELAB 1.2068, Oculus XR Plugin) | OVRPlugin reports the headset as not worn (`ovrp_GetUserPresent2` → 0) a few seconds after start, and the game's rig only follows a present user (Marrow `XRHMD.IsUserPresent` = Unity's HMD `UserPresence`) | `frame.unity_user_presence` (the Oculus XR Plugin's lookup → `libfp_ovrp.so`, reports present; log `user presence: OVRPlugin 0 …`) |
|
||||
| Unreal 5 game crashes at its first render pass, backtrace `vulkan.freedreno.so` ← `libVkLayer_fossilize.so` ← `libfp_vk.so (create_render_pass2)` (Metro Awakening) | a subpass without a depth attachment names a depth/stencil resolve attachment; the Frame's Turnip reads the missing depth attachment (NULL) | the Vulkan shim drops that resolve (always, FramePort after 0.11.0; log `dropped the depth resolve of subpass N (no depth attachment)`); triage `unreal-vulkan-driver-crash` |
|
||||
| Unreal game crashes before its first frame: SIGSEGV `fault addr 0x10` on the main thread, backtrace all `libUnreal.so` above the linker's `soinfo::call_constructors` (inside `System.loadLibrary`), right after `Parsing commandline` (GitHub #349, Transformers Beyond Reality) | The game is built with Unreal's Binned3 allocator, which reserves its whole range while the library loads: one `mmap(NULL, 76 GiB, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS)`. Quest grants it; the Frame's kernel (heuristic overcommit, mode 0) refuses a writable private mapping larger than RAM + swap, and Unreal's out-of-memory handler ("Ran out of memory allocating ...") dereferences its not-yet-created log | `frame.unreal_noreserve` (suggested from analysis `unreal_binned3`): every such anonymous read/write mmap in the engine library gets `MAP_NORESERVE` (one instruction each: `mov w3, #0x22` → `#0x4022`); triage `unreal-reserve-refused`. Found by disassembling the crash pc (the OOM handler; its UTF-16 format string) and the caller's `mov x0, #0x1300000000` |
|
||||
| Unreal Vulkan game ends on its first frames with "Shader compilation failures are Fatal." (tombstone abort message; `System.exit` / ForceQuit; the no-ForceQuit build dereferences a null pipeline instead), `vk_pipeline_log=1` shows `vkCreateGraphicsPipelines failed: -1` (for example Transformers Beyond Reality: Redux, #349) | With Lepton's Fossilize layer loaded **every** graphics pipeline failed with VK_ERROR_OUT_OF_HOST_MEMORY, even a constant-colour one; retries without the pipeline cache, without the app's CPU allocator, and without Valve's FDM/RPO layers all failed too. Without Fossilize a few multiview vertex shaders still fail in Turnip (a blank fragment shader alone doesn't help, blank vertex + fragment does) | `adapter.vk_no_fossilize=1` (Vulkan shim removes `VK_LAYER_fossilize` from GraphicsEnv's debug layer list when the engine loads it) + `adapter.vk_pipeline_fallback=1` (refused pipelines are made with blank shaders; logged "retried with a blank"); triage `vulkan-pipeline-refused`. Headless: runs at 72 fps; headset check pending. The `foveationImage = 0x0` warning (`hide_fb_foveation`) was ruled out |
|
||||
| Unreal Vulkan game fails on its first frames and OVRPlugin reports `foveationImage = 0x0, width = 0, height = 0` (for example Transformers Beyond Reality: Redux, #349) | Quest FB foveation remains advertised by OVRPort's dispatcher despite `foveation_fix=1`. This is a hypothesis for the failure, not a confirmed cause: Redux's alternate no-ForceQuit build dereferences a null graphics-pipeline-state object during Vulkan pipeline binding, not a density image | Diagnostic `adapter.hide_fb_foveation=1` (off by default, Vulkan): filters the dispatcher and runtime extension lists/instance requests, removes foveation create/image chains and refuses profile creation/updates. Rebuild with the adapter **and xrshim** artifacts, then compare first-frame survival and Unreal's original fatal log. Does not disable Valve FDM injection. Device verification pending |
|
||||
| Unreal 5 game crashes in `vulkan.freedreno.so` called straight from `libUnreal.so` right after its swapchains, or a few seconds into the first frames (Metro Awakening) | Unreal turns on fragment-density-map foveation because Turnip offers VK_EXT_fragment_density_map, then records barriers (to `FRAGMENT_DENSITY_MAP_OPTIMAL`) and image views (2D array R8G8) for a density map the Frame never provides (VK_NULL_HANDLE); Turnip dereferences it | adapter `vk_hide_fdm=1` (the game doesn't see the extension) + `vk_spec_fixes=1` (leaves out null-image barriers, refuses null-image views); triage `unreal-fdm-missing`. Found by disassembling the driver at the crash pc: the struct offsets (0x58 = VkSubpassDescription2, 0x48/0x60 = image barriers, viewType/format in registers) name the call |
|
||||
| Own-engine game crashes in `je_free` from its own library on the first frames (Roblox) | the game frees memory it doesn't own; not the Vulkan shim or the format fallback | unsupported |
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 141 KiB |
|
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 424 KiB After Width: | Height: | Size: 421 KiB |
@@ -87,7 +87,6 @@ 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)
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
// 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;
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
// 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,7 +11,26 @@
|
||||
#include <time.h>
|
||||
#include <link.h>
|
||||
#include <string.h>
|
||||
#include "audio_detour.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_metadata_queue.h"
|
||||
typedef struct {float previous,current;} MxAudioRamp;
|
||||
static uintptr_t mx_audio_base;
|
||||
@@ -30,8 +49,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;
|
||||
// The installer publishes the completed trampoline before the entry branch.
|
||||
// Keep the acquire load paired with that publication.
|
||||
// An audio thread can enter just after its prologue was patched, before
|
||||
// the installing thread publishes the completed trampoline.
|
||||
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);
|
||||
@@ -60,19 +79,15 @@ 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,&mx_audio_consume_original);
|
||||
if(!original) {
|
||||
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)) {
|
||||
__atomic_store_n(&mx_audio_base,0,__ATOMIC_RELEASE);return 1;
|
||||
}
|
||||
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)) {
|
||||
if(!mx_audio_detour(base+0x2be2c0,(void*)mx_audio_kill_experimental,kill) || !mx_audio_detour(base+0x2be7b0,(void*)mx_audio_kill_regular,kill)) {
|
||||
LOG("FrameBridge audio metadata: incomplete installation");return 1;
|
||||
}
|
||||
LOG("FrameBridge audio metadata: metadata reclamation follows current audio-frame references; Meta audio base=%p",base);
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
// 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
|
||||
@@ -1,17 +0,0 @@
|
||||
// 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));
|
||||
}
|
||||
@@ -6,13 +6,10 @@
|
||||
// Budget Cuts Ultimate's cube-map overlay, GitHub #107). Only when the runtime refused one, a cube swapchain is served
|
||||
// by the adapter instead: one GL cube-map texture or Vulkan cube-compatible image with the requested format,
|
||||
// size and mip levels. Acquire/wait/release succeed at once. The app renders or copies into it as usual; layers
|
||||
// are converted to six quad faces by cube_quads when no projection is present.
|
||||
// that use it are dropped in xrEndFrame (the runtime couldn't show them anyway).
|
||||
#define STANDIN_MAX 8
|
||||
typedef struct {
|
||||
XrSwapchain handle;
|
||||
XrSession session;
|
||||
XrSwapchainCreateInfo info;
|
||||
uint32_t slice;
|
||||
GLuint tex;
|
||||
VkDevice device;
|
||||
VkImage image;
|
||||
@@ -46,7 +43,7 @@ static int standin_vk_create(const XrSwapchainCreateInfo *info, standin_swapchai
|
||||
PFN_vkQueueWaitIdle wait_idle = (PFN_vkQueueWaitIdle)vk.GetDeviceProcAddr(vk.device, "vkQueueWaitIdle");
|
||||
if (!destroy_pool || !wait_idle) goto done;
|
||||
s->device = vk.device;
|
||||
VkImageUsageFlags usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
|
||||
VkImageUsageFlags usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
if (info->usageFlags & XR_SWAPCHAIN_USAGE_SAMPLED_BIT) usage |= VK_IMAGE_USAGE_SAMPLED_BIT;
|
||||
if (info->usageFlags & XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT) usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
|
||||
if (info->usageFlags & XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT) usage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
||||
@@ -101,7 +98,7 @@ done:
|
||||
}
|
||||
|
||||
// After the runtime refused a swapchain: serve a cube stand-in if the graphics API can supply it.
|
||||
static XrResult standin_after_failure(XrSession session, const XrSwapchainCreateInfo *info, XrSwapchain *out, XrResult result) {
|
||||
static XrResult standin_after_failure(const XrSwapchainCreateInfo *info, XrSwapchain *out, XrResult result) {
|
||||
if (XR_SUCCEEDED(result) || !cube_standin || !info || !out || info->faceCount != 6) return result;
|
||||
if (info->width != info->height || !info->width || info->arraySize > 1) return result;
|
||||
int gles = (p_eglCreateContext || emul_load_gl()) && p_eglGetCurrentContext() != EGL_NO_CONTEXT;
|
||||
@@ -112,9 +109,6 @@ static XrResult standin_after_failure(XrSession session, const XrSwapchainCreate
|
||||
if (slot >= 0) standins[slot].handle = (XrSwapchain)1; // reserved
|
||||
pthread_mutex_unlock(&standin_lock);
|
||||
if (slot < 0) { LOG("cube_standin: too many cube swapchains, the runtime's error stays"); return result; }
|
||||
cube_outputs_destroy();
|
||||
standins[slot].session = session;
|
||||
standins[slot].info = *info;
|
||||
if (!gles) {
|
||||
if (!standin_vk_create(info, &standins[slot])) {
|
||||
pthread_mutex_lock(&standin_lock);
|
||||
@@ -127,7 +121,7 @@ static XrResult standin_after_failure(XrSession session, const XrSwapchainCreate
|
||||
*out = standins[slot].handle = FAKE_HANDLE(XrSwapchain);
|
||||
pthread_mutex_unlock(&standin_lock);
|
||||
LOG("cube_standin: runtime refused a %ux%u cube swapchain (result=%d): served by FrameBridge "
|
||||
"(Vulkan cube image, %u levels); cube_quads can display its layers", info->width, info->height, result, info->mipCount);
|
||||
"(Vulkan cube image, %u levels); its cube layers are dropped", info->width, info->height, result, info->mipCount);
|
||||
return XR_SUCCESS;
|
||||
}
|
||||
GLsizei levels = info->mipCount > 1 ? (GLsizei)info->mipCount : 1;
|
||||
@@ -156,7 +150,7 @@ static XrResult standin_after_failure(XrSession session, const XrSwapchainCreate
|
||||
pthread_mutex_unlock(&standin_lock);
|
||||
*out = handle;
|
||||
LOG("cube_standin: runtime refused a %ux%u cube swapchain (result=%d): served by FrameBridge (GL cube map %u, "
|
||||
"%d levels); cube_quads can display its layers", info->width, info->height, result, tex, (int)levels);
|
||||
"%d levels); its cube layers are dropped", info->width, info->height, result, tex, (int)levels);
|
||||
return XR_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -178,7 +172,6 @@ static XrResult standin_enumerate(XrSwapchain handle, uint32_t capacity, uint32_
|
||||
}
|
||||
|
||||
static void standin_destroy(XrSwapchain handle) {
|
||||
cube_outputs_destroy();
|
||||
pthread_mutex_lock(&standin_lock);
|
||||
for (int i = 0; i < STANDIN_MAX; ++i)
|
||||
if (standins[i].handle == handle) {
|
||||
@@ -227,236 +220,3 @@ static XRAPI_ATTR XrResult XRAPI_CALL standin_get_swapchain_state(XrSwapchain sw
|
||||
if (is_standin(swapchain)) return XR_ERROR_VALIDATION_FAILURE; // no state to report (apps treat it as "unsupported")
|
||||
return real_get_swapchain_state ? real_get_swapchain_state(swapchain, state) : XR_ERROR_FUNCTION_UNSUPPORTED;
|
||||
}
|
||||
|
||||
// Six runtime swapchains per size/format. Array slices keep different stand-ins independent,
|
||||
// even when several cube layers of the same size appear in one frame.
|
||||
static struct {
|
||||
XrSession session;
|
||||
uint32_t size, slices;
|
||||
int64_t format;
|
||||
int vulkan, failed, ready;
|
||||
XrSwapchain face[6];
|
||||
} cube_pools[STANDIN_MAX], *cube_out;
|
||||
|
||||
static void cube_pool_destroy(int pool) {
|
||||
PFN_xrDestroySwapchain destroy = (PFN_xrDestroySwapchain)lookup(active_instance, "xrDestroySwapchain");
|
||||
for (int f = 0; f < 6; ++f)
|
||||
if (cube_pools[pool].face[f] && destroy) destroy(cube_pools[pool].face[f]);
|
||||
memset(&cube_pools[pool], 0, sizeof(cube_pools[pool]));
|
||||
}
|
||||
|
||||
static void cube_outputs_destroy(void) {
|
||||
for (int i = 0; i < STANDIN_MAX; ++i) cube_pool_destroy(i);
|
||||
cube_out = NULL;
|
||||
}
|
||||
|
||||
// Keep a failed key so a refused allocation/copy is diagnosed once, then falls back without retrying each frame.
|
||||
static void cube_output_disable(void) {
|
||||
XrSession session = cube_out->session;
|
||||
uint32_t size = cube_out->size;
|
||||
int64_t format = cube_out->format;
|
||||
int vulkan = cube_out->vulkan;
|
||||
cube_pool_destroy((int)(cube_out - cube_pools));
|
||||
cube_out->session = session;
|
||||
cube_out->size = size;
|
||||
cube_out->format = format;
|
||||
cube_out->vulkan = vulkan;
|
||||
cube_out->failed = 1;
|
||||
}
|
||||
|
||||
static int cube_outputs_create(XrSession session, const standin_swapchain *s) {
|
||||
int pool = -1, empty = -1;
|
||||
for (int i = 0; i < STANDIN_MAX; ++i) {
|
||||
if (!cube_pools[i].session && empty < 0) empty = i;
|
||||
if (cube_pools[i].session == session && cube_pools[i].size == s->info.width &&
|
||||
cube_pools[i].format == s->info.format && cube_pools[i].vulkan == !!s->image) pool = i;
|
||||
}
|
||||
if (pool < 0) pool = empty;
|
||||
if (pool < 0) return 0;
|
||||
cube_out = &cube_pools[pool];
|
||||
if (cube_out->failed) return 0;
|
||||
if (cube_out->face[5]) return 1;
|
||||
cube_out->slices = 0;
|
||||
for (int i = 0; i < STANDIN_MAX; ++i)
|
||||
if (standins[i].handle && standins[i].session == session && standins[i].info.width == s->info.width &&
|
||||
standins[i].info.format == s->info.format && !!standins[i].image == !!s->image)
|
||||
standins[i].slice = cube_out->slices++;
|
||||
cube_out->session = session;
|
||||
cube_out->size = s->info.width;
|
||||
cube_out->format = s->info.format;
|
||||
cube_out->vulkan = !!s->image;
|
||||
PFN_xrCreateSwapchain create = (PFN_xrCreateSwapchain)lookup(active_instance, "xrCreateSwapchain");
|
||||
XrSwapchainCreateInfo ci = {XR_TYPE_SWAPCHAIN_CREATE_INFO, NULL, 0,
|
||||
XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT | XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT,
|
||||
s->info.format, 1, s->info.width, s->info.height, 1, cube_out->slices, 1};
|
||||
for (int f = 0; f < 6; ++f) {
|
||||
XrResult r = create ? create(session, &ci, &cube_out->face[f]) : XR_ERROR_FUNCTION_UNSUPPORTED;
|
||||
if (XR_FAILED(r)) {
|
||||
cube_output_disable();
|
||||
LOG("cube_quads: face swapchain creation failed (result=%d); dropping cube layers", r);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
LOG("cube_quads: created six %ux%u face swapchains (%s)", s->info.width, s->info.height,
|
||||
s->image ? "Vulkan" : "GLES");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int cube_copy_face(const standin_swapchain *s, int face, uint32_t index, uint32_t slice) {
|
||||
PFN_xrEnumerateSwapchainImages enumerate = (PFN_xrEnumerateSwapchainImages)lookup(active_instance, "xrEnumerateSwapchainImages");
|
||||
uint32_t n = 0;
|
||||
if (!enumerate || XR_FAILED(enumerate(cube_out->face[face], 0, &n, NULL)) || index >= n) return 0;
|
||||
int ok = 0;
|
||||
if (s->image) {
|
||||
XrSwapchainImageVulkanKHR *images = calloc(n, sizeof(*images));
|
||||
if (!images) return 0;
|
||||
for (uint32_t i = 0; i < n; ++i) images[i].type = XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR;
|
||||
if (XR_SUCCEEDED(enumerate(cube_out->face[face], n, &n, (void *)images))) {
|
||||
pthread_mutex_lock(&flip_lock);
|
||||
PFN_vkQueueWaitIdle idle = (PFN_vkQueueWaitIdle)vk.GetDeviceProcAddr(vk.device, "vkQueueWaitIdle");
|
||||
VkCommandBufferBeginInfo begin = {VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, NULL,
|
||||
VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, NULL};
|
||||
if (idle && vk.ResetCommandBuffer(vk.cmd, 0) == VK_SUCCESS && vk.BeginCommandBuffer(vk.cmd, &begin) == VK_SUCCESS) {
|
||||
VkImage dst = images[index].image;
|
||||
barrier(s->image, face, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT);
|
||||
barrier(dst, slice, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, VK_ACCESS_TRANSFER_WRITE_BIT);
|
||||
int32_t size = (int32_t)s->info.width;
|
||||
// Vulkan quad v=0 is the top; GLES quad t=0 is the bottom. Reverse rows for the same pose.
|
||||
VkImageBlit blit = {{VK_IMAGE_ASPECT_COLOR_BIT, 0, (uint32_t)face, 1}, {{0, 0, 0}, {size, size, 1}},
|
||||
{VK_IMAGE_ASPECT_COLOR_BIT, 0, slice, 1}, {{0, size, 0}, {size, 0, 1}}};
|
||||
vk.CmdBlitImage(vk.cmd, s->image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst,
|
||||
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &blit, VK_FILTER_NEAREST);
|
||||
barrier(s->image, face, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
|
||||
VK_ACCESS_TRANSFER_READ_BIT, VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT);
|
||||
barrier(dst, slice, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
|
||||
VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_COLOR_ATTACHMENT_READ_BIT);
|
||||
if (vk.EndCommandBuffer(vk.cmd) == VK_SUCCESS) {
|
||||
VkSubmitInfo submit = {VK_STRUCTURE_TYPE_SUBMIT_INFO, NULL, 0, NULL, NULL, 1, &vk.cmd, 0, NULL};
|
||||
ok = vk.QueueSubmit(vk.queue, 1, &submit, VK_NULL_HANDLE) == VK_SUCCESS && idle(vk.queue) == VK_SUCCESS;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&flip_lock);
|
||||
}
|
||||
free(images);
|
||||
} else {
|
||||
if (!p_eglGetCurrentContext || p_eglGetCurrentContext() == EGL_NO_CONTEXT) return 0;
|
||||
emul_gles_image *images = calloc(n, sizeof(*images));
|
||||
if (!images) return 0;
|
||||
for (uint32_t i = 0; i < n; ++i) images[i].type = XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR;
|
||||
if (XR_SUCCEEDED(enumerate(cube_out->face[face], n, &n, (void *)images))) {
|
||||
for (int i = 0; i < 8 && p_glGetError() != GL_NO_ERROR; ++i) {}
|
||||
GLint read, draw, scissor = p_glIsEnabled(GL_SCISSOR_TEST);
|
||||
p_glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &read);
|
||||
p_glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &draw);
|
||||
GLuint fb[2];
|
||||
p_glGenFramebuffers(2, fb);
|
||||
p_glBindFramebuffer(GL_READ_FRAMEBUFFER, fb[0]);
|
||||
p_glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, s->tex, 0);
|
||||
p_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb[1]);
|
||||
if (cube_out->slices == 1)
|
||||
p_glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, images[index].image, 0);
|
||||
else p_glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, images[index].image, 0, slice);
|
||||
ok = p_glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE &&
|
||||
p_glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE;
|
||||
if (ok) {
|
||||
p_glDisable(GL_SCISSOR_TEST);
|
||||
p_glBlitFramebuffer(0, 0, s->info.width, s->info.height, 0, 0, s->info.width, s->info.height,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
ok = p_glGetError() == GL_NO_ERROR;
|
||||
p_glFlush();
|
||||
}
|
||||
if (scissor) p_glEnable(GL_SCISSOR_TEST);
|
||||
p_glBindFramebuffer(GL_READ_FRAMEBUFFER, read);
|
||||
p_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, draw);
|
||||
p_glDeleteFramebuffers(2, fb);
|
||||
}
|
||||
free(images);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
static void cube_outputs_begin(void) {
|
||||
for (int i = 0; i < STANDIN_MAX; ++i) cube_pools[i].ready = 0;
|
||||
}
|
||||
|
||||
static void cube_session_destroy(XrSession session) {
|
||||
cube_outputs_destroy();
|
||||
for (int i = 0; i < STANDIN_MAX; ++i)
|
||||
if (standins[i].session == session && standins[i].handle) standin_destroy(standins[i].handle);
|
||||
}
|
||||
|
||||
// xrEndSession may be followed by another xrBeginSession without destroying the session or app cube handles.
|
||||
static XRAPI_ATTR XrResult XRAPI_CALL cube_end_session(XrSession session) {
|
||||
cube_outputs_destroy();
|
||||
PFN_xrEndSession end = (PFN_xrEndSession)lookup(active_instance, "xrEndSession");
|
||||
return end ? end(session) : XR_ERROR_FUNCTION_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static int cube_layer_quads(XrSession session, const XrFrameEndInfo *info, uint32_t at, XrCompositionLayerQuad *out) {
|
||||
const XrCompositionLayerCubeKHR *c = (const void *)info->layers[at];
|
||||
int slot = standin_find(c->swapchain);
|
||||
if (slot < 0 || c->imageArrayIndex != 0) return 0;
|
||||
// Quads always cover projections on Frame, including alpha projections. Conservatively skip any mixed frame.
|
||||
for (uint32_t i = 0; i < info->layerCount; ++i)
|
||||
if (info->layers[i] && (info->layers[i]->type == XR_TYPE_COMPOSITION_LAYER_PROJECTION)) {
|
||||
static int logged;
|
||||
if (!logged++) LOG("cube_quads: skipping cube with projection; preserving scene visibility");
|
||||
return 0;
|
||||
}
|
||||
standin_swapchain *s = &standins[slot];
|
||||
if (s->session != session || !cube_outputs_create(session, s)) return 0;
|
||||
PFN_xrAcquireSwapchainImage acquire = (PFN_xrAcquireSwapchainImage)lookup(active_instance, "xrAcquireSwapchainImage");
|
||||
PFN_xrWaitSwapchainImage wait = (PFN_xrWaitSwapchainImage)lookup(active_instance, "xrWaitSwapchainImage");
|
||||
PFN_xrReleaseSwapchainImage release = (PFN_xrReleaseSwapchainImage)lookup(active_instance, "xrReleaseSwapchainImage");
|
||||
if (!acquire || !wait || !release) return 0;
|
||||
if (!cube_out->ready) for (int f = 0; f < 6; ++f) {
|
||||
uint32_t index;
|
||||
XrSwapchainImageAcquireInfo ai = {XR_TYPE_SWAPCHAIN_IMAGE_ACQUIRE_INFO, NULL};
|
||||
XrSwapchainImageWaitInfo wi = {XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO, NULL, XR_INFINITE_DURATION};
|
||||
XrSwapchainImageReleaseInfo ri = {XR_TYPE_SWAPCHAIN_IMAGE_RELEASE_INFO, NULL};
|
||||
if (XR_FAILED(acquire(cube_out->face[f], &ai, &index))) goto fail;
|
||||
if (XR_FAILED(wait(cube_out->face[f], &wi))) goto fail;
|
||||
int ok = 1;
|
||||
for (int k = 0; k < STANDIN_MAX && ok; ++k) {
|
||||
if (!standins[k].handle || standins[k].session != session || standins[k].info.width != s->info.width ||
|
||||
standins[k].info.format != s->info.format || !!standins[k].image != !!s->image) continue;
|
||||
int submitted = 0;
|
||||
for (uint32_t l = 0; l < info->layerCount; ++l)
|
||||
if (info->layers[l] && info->layers[l]->type == XR_TYPE_COMPOSITION_LAYER_CUBE_KHR &&
|
||||
((const XrCompositionLayerCubeKHR *)info->layers[l])->swapchain == standins[k].handle) submitted = 1;
|
||||
if (submitted) ok = cube_copy_face(&standins[k], f, index, standins[k].slice);
|
||||
}
|
||||
XrResult r = release(cube_out->face[f], &ri);
|
||||
if (!ok || XR_FAILED(r)) goto fail;
|
||||
}
|
||||
cube_out->ready = 1;
|
||||
XrVector3f centre = {0, 0, 0};
|
||||
PFN_xrLocateViews locate = (PFN_xrLocateViews)lookup(active_instance, "xrLocateViews");
|
||||
XrViewLocateInfo li = {XR_TYPE_VIEW_LOCATE_INFO, NULL, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, info->displayTime, c->space};
|
||||
XrViewState state = {XR_TYPE_VIEW_STATE};
|
||||
XrView views[2] = {{XR_TYPE_VIEW}, {XR_TYPE_VIEW}};
|
||||
uint32_t nviews;
|
||||
if (locate && XR_SUCCEEDED(locate(session, &li, &state, 2, &nviews, views)) && nviews == 2 &&
|
||||
(state.viewStateFlags & XR_VIEW_STATE_POSITION_VALID_BIT))
|
||||
centre = (XrVector3f){(views[0].pose.position.x + views[1].pose.position.x) / 2,
|
||||
(views[0].pose.position.y + views[1].pose.position.y) / 2,
|
||||
(views[0].pose.position.z + views[1].pose.position.z) / 2};
|
||||
for (int f = 0; f < 6; ++f) {
|
||||
out[f] = (XrCompositionLayerQuad){XR_TYPE_COMPOSITION_LAYER_QUAD, NULL, c->layerFlags, c->space,
|
||||
c->eyeVisibility, {cube_out->face[f], {{0, 0}, {(int32_t)s->info.width, (int32_t)s->info.height}}, s->slice},
|
||||
lm_cube_quad_pose(c->orientation, f, 50), {100, 100}};
|
||||
out[f].pose.position.x += centre.x;
|
||||
out[f].pose.position.y += centre.y;
|
||||
out[f].pose.position.z += centre.z;
|
||||
}
|
||||
{
|
||||
static int logged;
|
||||
if (!logged++) LOG("cube_quads: submitting cube as six quads (half-size=50m, mip=0)");
|
||||
}
|
||||
return 1;
|
||||
fail:
|
||||
cube_output_disable();
|
||||
LOG("cube_quads: face copy/acquire/wait/release failed; dropping cube layers");
|
||||
return 0;
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
// * drops composition layers that reference swapchains that failed to create (layer_fix);
|
||||
// * answers xrGetDisplayRefreshRateFB with the measured display rate when the runtime lacks it or reports 0 Hz
|
||||
// (session_fixes.c);
|
||||
// * serves refused cube swapchains as GL/Vulkan cube maps and emulates cube-only frames with quads (cube_standin, cube_standin.c);
|
||||
// * serves cube swapchains the runtime refuses as GL/Vulkan cube maps and drops their layers (cube_standin, cube_standin.c);
|
||||
// * optionally requests mutable-format swapchain images (mutable_fix, off by default);
|
||||
// * optionally swaps left/right images of stereo projection layers (swap_eyes, off by default);
|
||||
// * emulates XR_FB_passthrough with XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND when the runtime lacks it
|
||||
@@ -77,7 +77,6 @@ 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;
|
||||
@@ -128,7 +127,6 @@ static int frame_open;
|
||||
static int sc_acquires, sc_waits, sc_releases, sc_wait_fails; // per pacing period (layer_debug) // drop XrCompositionLayerColorScaleBiasKHR (the runtime's color pass)
|
||||
static int controller_fix = 1;
|
||||
static int swapchain_fix = 1;
|
||||
static int cube_quads = 1;
|
||||
static int cube_standin = 1; // cube swapchains the runtime refuses: served by the adapter (cube_standin.c)
|
||||
static int rect_clamp = 1;
|
||||
static int fb_color_space; // fb_color_space: offer XR_FB_color_space when the runtime lacks it (#336)
|
||||
@@ -205,7 +203,6 @@ static void read_settings(const char *path) {
|
||||
if (sscanf(line, "gl_error_clear=%f", &value) == 1) gl_error_clear = value != 0;
|
||||
if (sscanf(line, "controller_fix=%f", &value) == 1) controller_fix = value != 0;
|
||||
if (sscanf(line, "swapchain_fix=%f", &value) == 1) swapchain_fix = value != 0;
|
||||
if (sscanf(line, "cube_quads=%f", &value) == 1) cube_quads = value != 0;
|
||||
if (sscanf(line, "cube_standin=%f", &value) == 1) cube_standin = value != 0;
|
||||
if (sscanf(line, "rect_clamp=%f", &value) == 1) rect_clamp = value != 0;
|
||||
if (sscanf(line, "fb_color_space=%f", &value) == 1) fb_color_space = value != 0;
|
||||
@@ -475,7 +472,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_batman_geometry_initialize();
|
||||
mx_audio_initialize();
|
||||
XrResult result = fn(&fixed, instance);
|
||||
free(names);
|
||||
LOG("xrCreateInstance result=%d", result);
|
||||
@@ -493,7 +490,6 @@ XRAPI_ATTR XrResult XRAPI_CALL xrCreateInstance(const XrInstanceCreateInfo *info
|
||||
reset_bindings(frame_enabled);
|
||||
pthread_mutex_unlock(&bindings_lock);
|
||||
mx_audio_initialize();
|
||||
mx_batman_geometry_initialize();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -637,11 +633,9 @@ static int emul_is_virtual(XrSwapchain handle);
|
||||
static void emul_virtual_destroy(XrSwapchain handle);
|
||||
static XrResult emul_virtual_enumerate(XrSwapchain handle, uint32_t capacity, uint32_t *count, XrSwapchainImageBaseHeader *images);
|
||||
static void emul_on_acquire(XrSwapchain handle, uint32_t index);
|
||||
static XrResult standin_after_failure(XrSession session, const XrSwapchainCreateInfo *info, XrSwapchain *out, XrResult result);
|
||||
static XrResult standin_after_failure(const XrSwapchainCreateInfo *info, XrSwapchain *out, XrResult result);
|
||||
static int is_standin(XrSwapchain handle);
|
||||
static void standin_destroy(XrSwapchain handle);
|
||||
static void cube_outputs_destroy(void);
|
||||
static void cube_session_destroy(XrSession session);
|
||||
static XrResult standin_enumerate(XrSwapchain handle, uint32_t capacity, uint32_t *count, XrSwapchainImageBaseHeader *images);
|
||||
|
||||
static int known_swapchain(XrSwapchain handle) {
|
||||
@@ -745,7 +739,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrCreateSwapchain(XrSession session, const XrSwap
|
||||
snap_on_create(*swapchain, &fixed);
|
||||
return result;
|
||||
}
|
||||
if (!swapchain_fix) return standin_after_failure(session, &fixed, swapchain, result);
|
||||
if (!swapchain_fix) return standin_after_failure(&fixed, swapchain, result);
|
||||
|
||||
// Frame's runtime rejects some GLES formats (GL_RGBA8) and MSAA swapchains (overport #71).
|
||||
if (fixed.sampleCount > 1) {
|
||||
@@ -768,7 +762,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrCreateSwapchain(XrSession session, const XrSwap
|
||||
emul_on_create_swapchain(*swapchain, &fixed);
|
||||
snap_on_create(*swapchain, &fixed);
|
||||
}
|
||||
return standin_after_failure(session, &fixed, swapchain, result);
|
||||
return standin_after_failure(&fixed, swapchain, result);
|
||||
}
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrDestroySwapchain(XrSwapchain swapchain) {
|
||||
@@ -1409,7 +1403,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_batman_geometry_initialize();
|
||||
mx_audio_initialize();
|
||||
PFN_xrPollEvent fn = (PFN_xrPollEvent)lookup(instance, "xrPollEvent");
|
||||
if (!fn) return XR_ERROR_FUNCTION_UNSUPPORTED;
|
||||
if (emulate_scene && event) {
|
||||
@@ -1703,7 +1697,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrEndFrame(XrSession session, const XrFrameEndInf
|
||||
frames = 0; drift_sum = drift_max = 0;
|
||||
}
|
||||
}
|
||||
if ((!cube_standin && !layer_fix && !swap_eyes && !emulate_passthrough && !flip_quads && !flip_emul && !strip_depth && !fade_quad) || !info || !info->layerCount ||
|
||||
if ((!layer_fix && !swap_eyes && !emulate_passthrough && !flip_quads && !flip_emul && !strip_depth && !fade_quad) || !info || !info->layerCount ||
|
||||
info->layerCount > 64)
|
||||
return fn(session, info);
|
||||
if (layer_debug) { // the submitted layer list (order, flags, eyes, chained structs) whenever its shape changes
|
||||
@@ -1750,7 +1744,6 @@ XRAPI_ATTR XrResult XRAPI_CALL xrEndFrame(XrSession session, const XrFrameEndInf
|
||||
XrCompositionLayerQuad quads[64];
|
||||
XrCompositionLayerQuad fade_out; // fade_quad: at most one fade layer per frame
|
||||
int faded = 0;
|
||||
cube_outputs_begin();
|
||||
uint32_t count = 0, dropped = 0, swapped = 0, passthrough = 0;
|
||||
const XrCompositionLayerBaseHeader *surface_projections[SURF_MAX];
|
||||
int surface_projection_count = 0;
|
||||
@@ -1837,14 +1830,6 @@ XRAPI_ATTR XrResult XRAPI_CALL xrEndFrame(XrSession session, const XrFrameEndInf
|
||||
++dropped; // an emulated video surface without a frame yet
|
||||
continue;
|
||||
}
|
||||
if (cube_quads && layer->type == XR_TYPE_COMPOSITION_LAYER_CUBE_KHR &&
|
||||
count + 6 + info->layerCount - i - 1 <= 16 && count + 6 <= 64 &&
|
||||
cube_layer_quads(session, info, i, &quads[count])) {
|
||||
for (int f = 0; f < 6; ++f) kept[count + f] = (const XrCompositionLayerBaseHeader *)&quads[count + f];
|
||||
count += 6;
|
||||
++swapped;
|
||||
continue;
|
||||
}
|
||||
if (layer_uses_standin(layer)) { // a cube layer whose swapchain the runtime refused (cube_standin.c)
|
||||
static int logged;
|
||||
if (logged++ < 3) LOG("cube_standin: dropped a layer (type=%d) that shows a stand-in swapchain", layer->type);
|
||||
@@ -2335,10 +2320,6 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetInstanceProcAddr(XrInstance instance, const
|
||||
HOOK_AS(xrReleaseSwapchainImage, surf_composite_release)
|
||||
HOOK_AS(xrWaitSwapchainImage, surf_composite_wait)
|
||||
}
|
||||
if (cube_standin) {
|
||||
HOOK_AS(xrEndSession, cube_end_session)
|
||||
HOOK_AS(xrDestroySession, hook_xrDestroySession)
|
||||
}
|
||||
if (equirect_emul) {
|
||||
HOOK_AS(xrReleaseSwapchainImage, hook_xrReleaseSwapchainImage)
|
||||
HOOK_AS(xrWaitSwapchainImage, hook_xrWaitSwapchainImage)
|
||||
|
||||
@@ -42,7 +42,7 @@ typedef struct { XrStructureType type; void *next; uint32_t image; } emul_gles_i
|
||||
X(eglChooseConfig) X(eglCreatePbufferSurface) X(eglDestroySurface) X(eglGetCurrentContext) X(eglGetError) \
|
||||
X(eglQueryString)
|
||||
#define EMUL_GL_FUNCS(X) X(glFenceSync) X(glDeleteSync) X(glWaitSync) X(glClientWaitSync) X(glFlush) \
|
||||
X(glFramebufferTextureLayer) X(glIsEnabled) X(glBlitFramebuffer) X(glGenFramebuffers) X(glDeleteFramebuffers) X(glBindFramebuffer) X(glFramebufferTexture2D) X(glCheckFramebufferStatus) X(glViewport) \
|
||||
X(glGenFramebuffers) X(glDeleteFramebuffers) X(glBindFramebuffer) X(glFramebufferTexture2D) X(glCheckFramebufferStatus) X(glViewport) \
|
||||
X(glUseProgram) X(glCreateShader) X(glShaderSource) X(glCompileShader) X(glGetShaderiv) X(glGetShaderInfoLog) \
|
||||
X(glDeleteShader) X(glCreateProgram) X(glAttachShader) X(glLinkProgram) X(glGetProgramiv) X(glGetProgramInfoLog) \
|
||||
X(glGetUniformLocation) X(glUniform1i) X(glUniform1f) X(glUniform3f) X(glUniform4f) X(glUniformMatrix3fv) \
|
||||
@@ -1003,7 +1003,6 @@ static void emul_on_destroy_session(XrSession session) {
|
||||
}
|
||||
|
||||
static XRAPI_ATTR XrResult XRAPI_CALL hook_xrDestroySession(XrSession session) {
|
||||
cube_session_destroy(session);
|
||||
emul_on_destroy_session(session);
|
||||
PFN_xrDestroySession fn = (PFN_xrDestroySession)lookup(active_instance, "xrDestroySession");
|
||||
return fn ? fn(session) : XR_ERROR_FUNCTION_UNSUPPORTED;
|
||||
|
||||
@@ -88,16 +88,6 @@ static inline XrVector3f lm_glcube_dir(int face, float u, float v) {
|
||||
}
|
||||
}
|
||||
|
||||
// Cube image array order: +X,-X,+Y,-Y,+Z,-Z. Local +Z faces inward.
|
||||
// Quad right/up match GL cube s/t; Vulkan copies reverse rows to compensate its top-left image origin.
|
||||
static inline XrPosef lm_cube_quad_pose(XrQuaternionf orientation, int face, float distance) {
|
||||
static const int faces[6] = {1, 3, 4, 5, 2, 0};
|
||||
XrPosef p = lm_face_pose((XrPosef){orientation, {0, 0, 0}}, faces[face], distance);
|
||||
if (face != 2 && face != 3)
|
||||
p.orientation = lm_qmul(p.orientation, (XrQuaternionf){0, 0, 1, 0});
|
||||
return p;
|
||||
}
|
||||
|
||||
// GL's cube map lookup (OpenGL ES 3.0 spec, table 3.21): direction -> face and (s, t).
|
||||
static inline int lm_glcube_lookup(XrVector3f d, float *s, float *t) {
|
||||
float ax = fabsf(d.x), ay = fabsf(d.y), az = fabsf(d.z), sc, tc, ma;
|
||||
|
||||
@@ -106,8 +106,6 @@ static int validation; // vk_validation: add Khronos' validation layer (bu
|
||||
static int hide_fdm; // vk_hide_fdm: the game doesn't see VK_EXT_fragment_density_map(2)
|
||||
static int want_dump; // vk_shader_dump: write the game's SPIR-V modules to files/fp_vk_shaders/
|
||||
static int want_pipeline_log; // vk_pipeline_log: log failing pipeline creations (pipeline_log.h)
|
||||
static int no_fossilize; // vk_no_fossilize: take Lepton's Fossilize layer out of GraphicsEnv's list
|
||||
static int pipeline_fallback; // vk_pipeline_fallback: retry a failed graphics pipeline with blank shaders
|
||||
static char app_files[400]; // /sdcard/Android/data/<package>/files
|
||||
|
||||
static void read_settings(const char *path) {
|
||||
@@ -121,8 +119,6 @@ static void read_settings(const char *path) {
|
||||
if (!strncmp(line, "vk_spec_fixes=", 14)) spec_fixes = atoi(line + 14) != 0;
|
||||
if (!strncmp(line, "vk_shader_dump=", 15)) want_dump = atoi(line + 15) != 0;
|
||||
if (!strncmp(line, "vk_pipeline_log=", 16)) want_pipeline_log = atoi(line + 16) != 0;
|
||||
if (!strncmp(line, "vk_no_fossilize=", 16)) no_fossilize = atoi(line + 16) != 0;
|
||||
if (!strncmp(line, "vk_pipeline_fallback=", 21)) pipeline_fallback = atoi(line + 21) != 0;
|
||||
if (!strncmp(line, "vk_query_slots=", 15)) {
|
||||
int v = atoi(line + 15);
|
||||
query_slots = v == 1 ? 2 : v >= 2 && v <= 4 ? v : 1; // 1 = on (the settings dialog's switch) = 2 slots
|
||||
@@ -187,52 +183,6 @@ static uint32_t *fixed_shader(const uint32_t *code, size_t size, size_t *out_siz
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Android's loader reads GraphicsEnv's debug layer list (Lepton's gpu_debug_layers) at each vkCreateInstance; this
|
||||
// takes one layer out of it (same libgraphicsenv calls as native/zinkfix, which adds its own layer)
|
||||
struct cxx_string { size_t cap; size_t size; char *data; };
|
||||
#define GE_INSTANCE "_ZN7android11GraphicsEnv11getInstanceEv"
|
||||
#define GE_GET_LAYERS "_ZN7android11GraphicsEnv14getDebugLayersEv"
|
||||
#define GE_SET_LAYERS "_ZN7android11GraphicsEnv14setDebugLayersENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE"
|
||||
|
||||
static const char *cxx_chars(const void *s, size_t *len) {
|
||||
const unsigned char *b = s;
|
||||
if (!b) { *len = 0; return NULL; }
|
||||
if (b[0] & 1) {
|
||||
const struct cxx_string *l = s;
|
||||
*len = l->size;
|
||||
return l->data;
|
||||
}
|
||||
*len = b[0] >> 1;
|
||||
return (const char *)b + 1;
|
||||
}
|
||||
|
||||
static void drop_debug_layer(void *vk, const char *name) {
|
||||
void *(*get_instance)(void) = (void *(*)(void))dlsym(vk, GE_INSTANCE);
|
||||
const void *(*get_layers)(void *) = (const void *(*)(void *))dlsym(vk, GE_GET_LAYERS);
|
||||
void (*set_layers)(void *, struct cxx_string *) = (void (*)(void *, struct cxx_string *))dlsym(vk, GE_SET_LAYERS);
|
||||
void *env = get_instance && get_layers && set_layers ? get_instance() : NULL;
|
||||
size_t len = 0;
|
||||
const char *cur = env ? cxx_chars(get_layers(env), &len) : NULL;
|
||||
if (!env || len > 4096 || (len && !cur)) {
|
||||
LOG("vk shim: can't change the debug layer list (GraphicsEnv not found)");
|
||||
return;
|
||||
}
|
||||
char old[4097], *out = malloc(len + 16);
|
||||
if (!out) return;
|
||||
memcpy(old, cur ? cur : "", len);
|
||||
old[len] = 0;
|
||||
size_t n = 0;
|
||||
for (char *save = NULL, *tok = strtok_r(old, ":", &save); tok; tok = strtok_r(NULL, ":", &save)) {
|
||||
if (!strcmp(tok, name)) continue;
|
||||
n += (size_t)sprintf(out + n, "%s%s", n ? ":" : "", tok);
|
||||
}
|
||||
struct cxx_string tmp = {((len + 16) & ~(size_t)15) | 1, n, out};
|
||||
set_layers(env, &tmp);
|
||||
if ((tmp.cap & 1) && tmp.data == out) free(out);
|
||||
const char *now = cxx_chars(get_layers(env), &len);
|
||||
LOG("vk shim: debug layers now \"%.*s\" (without %s)", (int)len, now ? now : "", name);
|
||||
}
|
||||
|
||||
static void init(void) {
|
||||
read_all_settings();
|
||||
if (nfixes) LOG("vk shim: %d shader fix(es) configured", nfixes);
|
||||
@@ -244,7 +194,6 @@ static void init(void) {
|
||||
pl_on = 1;
|
||||
LOG("vk shim: logging failed pipeline creations and sampler Y'CbCr conversions");
|
||||
}
|
||||
if (pipeline_fallback) LOG("vk shim: failed graphics pipelines get blank shaders");
|
||||
if (spec_fixes) LOG("vk shim: Vulkan spec fixes on (depth images can be cleared, no depth resolve in shader-resolve "
|
||||
"subpasses)");
|
||||
real_vk = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
|
||||
@@ -253,18 +202,10 @@ static void init(void) {
|
||||
real_gdpa = (PFN_vkGetDeviceProcAddr)dlsym(real_vk, "vkGetDeviceProcAddr");
|
||||
real_rp2_trampoline = (PFN_vkCreateRenderPass2)dlsym(real_vk, "vkCreateRenderPass2");
|
||||
real_csm_trampoline = (PFN_vkCreateShaderModule)dlsym(real_vk, "vkCreateShaderModule");
|
||||
if (no_fossilize) drop_debug_layer(real_vk, "VK_LAYER_fossilize");
|
||||
}
|
||||
LOG("vk shim: libvulkan.so %s", real_gipa && real_gdpa ? "OK" : "MISSING");
|
||||
}
|
||||
|
||||
// The engine's first vkCreateInstance can come from another thread before any wrapped call runs init(), so the layer
|
||||
// list is changed when the engine loads this library
|
||||
__attribute__((constructor)) static void early_init(void) {
|
||||
read_all_settings();
|
||||
if (no_fossilize) pthread_once(&once, init);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- pointer checks
|
||||
|
||||
static pthread_mutex_t probe_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
@@ -927,94 +868,13 @@ static VKAPI_ATTR void VKAPI_CALL cmd_pipeline_barrier2_khr(VkCommandBuffer cb,
|
||||
|
||||
// ---------------------------------------------------------------- pipeline log (vk_pipeline_log, diagnostics)
|
||||
|
||||
// GitHub #349: Turnip fails some of Transformers' pipelines (-1 = its "ir3 variant failed"), and Unreal treats a
|
||||
// failed pipeline as fatal. A failed pipeline is retried with a fragment shader that writes zero to location 0, then
|
||||
// with a vertex shader that only writes gl_Position as well: the draw then shows nothing instead of ending the game.
|
||||
static const uint32_t FALLBACK_FS[] = {
|
||||
0x07230203, 0x00010000, 0x00070000, 0x0000000b, 0x00000000, 0x00020011, 0x00000001, 0x0003000e,
|
||||
0x00000000, 0x00000001, 0x0006000f, 0x00000004, 0x00000001, 0x6e69616d, 0x00000000, 0x00000002,
|
||||
0x00030010, 0x00000001, 0x00000007, 0x00040047, 0x00000002, 0x0000001e, 0x00000000, 0x00030016,
|
||||
0x00000003, 0x00000020, 0x00040017, 0x00000004, 0x00000003, 0x00000004, 0x0004002b, 0x00000003,
|
||||
0x00000005, 0x00000000, 0x0007002c, 0x00000004, 0x00000006, 0x00000005, 0x00000005, 0x00000005,
|
||||
0x00000005, 0x00040020, 0x00000007, 0x00000003, 0x00000004, 0x00020013, 0x00000008, 0x00030021,
|
||||
0x00000009, 0x00000008, 0x0004003b, 0x00000007, 0x00000002, 0x00000003, 0x00050036, 0x00000008,
|
||||
0x00000001, 0x00000000, 0x00000009, 0x000200f8, 0x0000000a, 0x0003003e, 0x00000002, 0x00000006,
|
||||
0x000100fd, 0x00010038,
|
||||
};
|
||||
static const uint32_t FALLBACK_VS[] = {
|
||||
0x07230203, 0x00010000, 0x00070000, 0x0000000c, 0x00000000, 0x00020011, 0x00000001, 0x0003000e,
|
||||
0x00000000, 0x00000001, 0x0006000f, 0x00000000, 0x00000001, 0x6e69616d, 0x00000000, 0x00000002,
|
||||
0x00040047, 0x00000002, 0x0000000b, 0x00000000, 0x00030016, 0x00000003, 0x00000020, 0x00040017,
|
||||
0x00000004, 0x00000003, 0x00000004, 0x0004002b, 0x00000003, 0x00000005, 0x00000000, 0x0004002b,
|
||||
0x00000003, 0x00000006, 0x3f800000, 0x0007002c, 0x00000004, 0x00000007, 0x00000005, 0x00000005,
|
||||
0x00000005, 0x00000006, 0x00040020, 0x00000008, 0x00000003, 0x00000004, 0x00020013, 0x00000009,
|
||||
0x00030021, 0x0000000a, 0x00000009, 0x0004003b, 0x00000008, 0x00000002, 0x00000003, 0x00050036,
|
||||
0x00000009, 0x00000001, 0x00000000, 0x0000000a, 0x000200f8, 0x0000000b, 0x0003003e, 0x00000002,
|
||||
0x00000007, 0x000100fd, 0x00010038,
|
||||
};
|
||||
|
||||
static pthread_mutex_t fallback_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static VkDevice fallback_device;
|
||||
static VkShaderModule fallback_module[2]; // [0] fragment, [1] vertex; kept for the device's lifetime
|
||||
|
||||
static VkShaderModule fallback_shader(VkDevice device, int vertex) {
|
||||
pthread_mutex_lock(&fallback_lock);
|
||||
if (fallback_device != device) {
|
||||
fallback_device = device; // one device per game in practice; a new one gets new modules
|
||||
fallback_module[0] = fallback_module[1] = VK_NULL_HANDLE;
|
||||
}
|
||||
if (!fallback_module[vertex]) {
|
||||
PFN_vkCreateShaderModule csm = (PFN_vkCreateShaderModule)any_fn(device, FN_CSM);
|
||||
VkShaderModuleCreateInfo mi = {VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, NULL, 0,
|
||||
vertex ? sizeof FALLBACK_VS : sizeof FALLBACK_FS,
|
||||
vertex ? FALLBACK_VS : FALLBACK_FS};
|
||||
if (csm && csm(device, &mi, NULL, &fallback_module[vertex]) != VK_SUCCESS) fallback_module[vertex] = VK_NULL_HANDLE;
|
||||
}
|
||||
VkShaderModule m = fallback_module[vertex];
|
||||
pthread_mutex_unlock(&fallback_lock);
|
||||
return m;
|
||||
}
|
||||
|
||||
static VkResult fallback_pipeline(VkDevice device, VkPipelineCache cache, const VkGraphicsPipelineCreateInfo *ci,
|
||||
const VkAllocationCallbacks *alloc, VkPipeline *out,
|
||||
PFN_vkCreateGraphicsPipelines real, VkResult failed) {
|
||||
static int logged;
|
||||
VkPipelineShaderStageCreateInfo st[6];
|
||||
memcpy(st, ci->pStages, sizeof *st * ci->stageCount);
|
||||
VkGraphicsPipelineCreateInfo p = *ci;
|
||||
p.pStages = st;
|
||||
VkResult r = failed;
|
||||
for (int pass = 0; pass < 2 && r < 0; pass++) { // 0: fragment shader only, 1: vertex shader too
|
||||
int replaced = 0;
|
||||
for (uint32_t s = 0; s < p.stageCount; s++) {
|
||||
int vertex = st[s].stage == VK_SHADER_STAGE_VERTEX_BIT;
|
||||
if (st[s].stage != VK_SHADER_STAGE_FRAGMENT_BIT && !(pass && vertex)) continue;
|
||||
VkShaderModule m = fallback_shader(device, vertex);
|
||||
if (!m) continue;
|
||||
st[s].pNext = NULL;
|
||||
st[s].flags = 0;
|
||||
st[s].module = m;
|
||||
st[s].pName = "main";
|
||||
st[s].pSpecializationInfo = NULL;
|
||||
replaced++;
|
||||
}
|
||||
if (!replaced) continue;
|
||||
r = real(device, cache, 1, &p, alloc, out);
|
||||
if (logged++ < 20)
|
||||
LOG("vk shim: failed pipeline (%d) retried with a blank %s shader: %d", failed,
|
||||
pass ? "vertex + fragment" : "fragment", r);
|
||||
}
|
||||
return r < 0 ? failed : r;
|
||||
}
|
||||
|
||||
static VKAPI_ATTR VkResult VKAPI_CALL create_graphics_pipelines(VkDevice device, VkPipelineCache cache, uint32_t count,
|
||||
const VkGraphicsPipelineCreateInfo *ci,
|
||||
const VkAllocationCallbacks *alloc, VkPipeline *out) {
|
||||
PFN_vkCreateGraphicsPipelines real = (PFN_vkCreateGraphicsPipelines)any_fn(device, FN_CGP);
|
||||
if (!real) return VK_ERROR_INITIALIZATION_FAILED;
|
||||
VkResult r = real(device, cache, count, ci, alloc, out);
|
||||
if (pl_on) pl_graphics(count, ci, out, r);
|
||||
if (pipeline_fallback && r < 0 && count == 1 && ci && ci->pStages && ci->stageCount <= 6) r = fallback_pipeline(device, cache, ci, alloc, out, real, r);
|
||||
pl_graphics(count, ci, out, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -1090,7 +950,7 @@ static PFN_vkVoidFunction wrap(const char *name) {
|
||||
case FN_EDEP: return hide_fdm ? (PFN_vkVoidFunction)vkEnumerateDeviceExtensionProperties : NULL;
|
||||
case FN_CDEV: return hide_fdm || spec_fixes ? (PFN_vkVoidFunction)vkCreateDevice : NULL;
|
||||
case FN_CIV: return spec_fixes ? (PFN_vkVoidFunction)create_image_view : NULL;
|
||||
case FN_CGP: return pl_on || pipeline_fallback ? (PFN_vkVoidFunction)create_graphics_pipelines : NULL;
|
||||
case FN_CGP: return pl_on ? (PFN_vkVoidFunction)create_graphics_pipelines : NULL;
|
||||
case FN_CCP: return pl_on ? (PFN_vkVoidFunction)create_compute_pipelines : NULL;
|
||||
case FN_CSAMP: return pl_on ? (PFN_vkVoidFunction)create_sampler : NULL;
|
||||
case FN_CDSL: return pl_on ? (PFN_vkVoidFunction)create_set_layout : NULL;
|
||||
|
||||
@@ -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", "LEVEL_CHOICES"):
|
||||
for attr in ("CHOICES", "RADIUS_CHOICES"):
|
||||
for _, label in getattr(p, attr, ()):
|
||||
texts[label] = ""
|
||||
for _, title in GROUPS: # the Game settings dialog
|
||||
|
||||
@@ -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, pkg),
|
||||
build={"sha256": fake_sha(pkg), "ok": True, "recipe_fp": recipe_fingerprint(rdict),
|
||||
"applied": sorted(p for p in rdict.get("patches") or {} if "." in p)})
|
||||
if rift:
|
||||
folder = f"D:/Games/PC VR/{title}"
|
||||
|
||||
@@ -634,16 +634,6 @@ 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:
|
||||
@@ -651,14 +641,8 @@ 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
|
||||
|
||||
@@ -240,20 +240,6 @@ 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)
|
||||
|
||||
@@ -413,5 +399,4 @@ 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,
|
||||
"monitor_settled": _monitor_settled}
|
||||
"battery": _battery, "long_upload": _long_upload, "press_keys": _press_keys}
|
||||
@@ -142,8 +142,7 @@ def main() -> int:
|
||||
# the index on the left: "This PC" scrolls the page there
|
||||
("settings-index", lambda a: a.page.run_task(a.settings_view.show_section, "pc")),
|
||||
("settings-folders", lambda a: a.page.run_task(a.settings_view.show_section, "folders")),
|
||||
("settings-installing", lambda a: a.page.run_task(a.settings_view.show_section, "installing")),
|
||||
("settings-data", lambda a: a.page.run_task(a.settings_view.show_section, "data"))]
|
||||
("settings-installing", lambda a: a.page.run_task(a.settings_view.show_section, "installing"))]
|
||||
if game:
|
||||
steps.insert(1, ("game", lambda a: a.open_game(game)))
|
||||
steps.insert(2, ("game-customize", lambda a: a.open_game(game, advanced=True)))
|
||||
|
||||
@@ -34,11 +34,6 @@
|
||||
"title": "Show Steam Frame controllers",
|
||||
"group": "Game settings"
|
||||
},
|
||||
"adapter.cube_quads": {
|
||||
"anchor": "adapter-cube_quads",
|
||||
"title": "Show cube loading screens",
|
||||
"group": "Game settings"
|
||||
},
|
||||
"adapter.cube_standin": {
|
||||
"anchor": "adapter-cube_standin",
|
||||
"title": "Stand in for cube layers",
|
||||
@@ -334,16 +329,6 @@
|
||||
"title": "Hide Vulkan foveation",
|
||||
"group": "Game settings"
|
||||
},
|
||||
"adapter.vk_no_fossilize": {
|
||||
"anchor": "adapter-vk_no_fossilize",
|
||||
"title": "Without Steam's shader cache layer",
|
||||
"group": "Game settings"
|
||||
},
|
||||
"adapter.vk_pipeline_fallback": {
|
||||
"anchor": "adapter-vk_pipeline_fallback",
|
||||
"title": "Skip refused graphics",
|
||||
"group": "Game settings"
|
||||
},
|
||||
"adapter.vk_pipeline_log": {
|
||||
"anchor": "adapter-vk_pipeline_log",
|
||||
"title": "Vulkan pipeline failures (log)",
|
||||
|
||||
@@ -91,7 +91,7 @@ import { DOWNLOADS, downloadPage, url } from '../../data/site';
|
||||
</Layout>
|
||||
|
||||
<script>
|
||||
import { githubRelease, parseInstallParams, readManifest } from '../../scripts/install-link';
|
||||
import { parseInstallParams, readManifest } from '../../scripts/install-link';
|
||||
|
||||
const page = document.querySelector<HTMLElement>('main.page')!;
|
||||
const $ = <T extends HTMLElement>(sel: string) => page.querySelector<T>(sel)!;
|
||||
@@ -114,31 +114,7 @@ import { DOWNLOADS, downloadPage, url } from '../../data/site';
|
||||
$('[data-name]').textContent = 'Cool Game';
|
||||
}
|
||||
|
||||
// a GitHub release download can't be read from a page (no CORS): name the release from GitHub's API instead
|
||||
const releaseInfo = () => {
|
||||
const rel = githubRelease(parsed.target);
|
||||
if (!rel) return;
|
||||
const api = `https://api.github.com/repos/${encodeURIComponent(rel.owner)}/${encodeURIComponent(rel.repo)}`;
|
||||
const opts: RequestInit = { credentials: 'omit', referrerPolicy: 'no-referrer' };
|
||||
const release = rel.tag ? `${api}/releases/tags/${encodeURIComponent(rel.tag)}` : `${api}/releases/latest`;
|
||||
const json = (url: string) => fetch(url, opts).then((r) => (r.ok ? r.json() : null));
|
||||
Promise.all([json(release), json(api)])
|
||||
.then(([r, repo]) => {
|
||||
const name = (typeof r?.name === 'string' && r.name.trim()) || (typeof repo?.name === 'string' && repo.name) || '';
|
||||
if (!name) return;
|
||||
$('[data-name]').textContent = name.slice(0, 200);
|
||||
document.title = `Install ${name.slice(0, 200)} with FramePort`;
|
||||
$('[data-files]').textContent = `A release of ${rel.owner}/${rel.repo}`;
|
||||
if (typeof repo?.description === 'string' && repo.description.trim()) {
|
||||
$('[data-desc]').textContent = repo.description.trim().slice(0, 2000);
|
||||
$('[data-desc]').hidden = false;
|
||||
}
|
||||
})
|
||||
.catch(() => { /* the address alone is shown */ });
|
||||
};
|
||||
|
||||
// the manifest's own name and description, when its host allows reading it from a page (CORS); GitHub file
|
||||
// pages already became their raw.githubusercontent.com address in parseInstallParams
|
||||
// the manifest's own name and description, when its host allows reading it from a page (CORS)
|
||||
if (parsed.kind === 'manifest') {
|
||||
const ctl = new AbortController();
|
||||
setTimeout(() => ctl.abort(), 6000);
|
||||
@@ -146,7 +122,7 @@ import { DOWNLOADS, downloadPage, url } from '../../data/site';
|
||||
.then((r) => (r.ok && Number(r.headers.get('content-length') ?? 0) <= 256 * 1024 ? r.json() : null))
|
||||
.then((data) => {
|
||||
const m = readManifest(data);
|
||||
if (!m) { releaseInfo(); return; }
|
||||
if (!m) return;
|
||||
$('[data-name]').textContent = m.name;
|
||||
document.title = `Install ${m.name} with FramePort`;
|
||||
$('[data-files]').textContent = m.files.join(', ');
|
||||
@@ -159,7 +135,7 @@ import { DOWNLOADS, downloadPage, url } from '../../data/site';
|
||||
img.src = m.icon;
|
||||
}
|
||||
})
|
||||
.catch(() => releaseInfo());
|
||||
.catch(() => { /* the address alone is shown */ });
|
||||
}
|
||||
|
||||
// hand the link to FramePort; if this page is still in front afterwards, FramePort probably isn't there
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import {
|
||||
DEMO_MANIFEST, checkUrl, githubRelease, isDemo, parseInstallParams, rawGithubUrl, readManifest, toFrameportLink,
|
||||
} from './install-link.ts';
|
||||
import { DEMO_MANIFEST, checkUrl, isDemo, parseInstallParams, readManifest, toFrameportLink } from './install-link.ts';
|
||||
|
||||
const MANIFEST = 'https://cdn.example.com/game.framedrop.json';
|
||||
|
||||
@@ -78,28 +76,3 @@ test('the published demo manifest previews as Cool Game', () => {
|
||||
assert.equal(m?.icon, 'https://frameport.app/demo/cool-game.svg');
|
||||
assert.deepEqual(m?.files, ['cool-game-arm64.apk']);
|
||||
});
|
||||
|
||||
test('GitHub file pages become raw.githubusercontent.com addresses (also in the frameport:// link)', () => {
|
||||
const raw = 'https://raw.githubusercontent.com/o/r/main/dir/game.json';
|
||||
for (const page of ['https://github.com/o/r/blob/main/dir/game.json', 'https://github.com/o/r/raw/main/dir/game.json',
|
||||
'https://www.github.com/o/r/blob/main/dir/game.json']) {
|
||||
assert.equal(rawGithubUrl(page), raw);
|
||||
}
|
||||
const p = parseInstallParams(`?manifest=${encodeURIComponent('https://github.com/o/r/blob/v1.2/game.json')}`);
|
||||
assert.equal(p.target, 'https://raw.githubusercontent.com/o/r/v1.2/game.json');
|
||||
assert.equal(p.link, toFrameportLink('manifest', p.target));
|
||||
// everything else is left alone: release downloads, raw addresses, other hosts
|
||||
for (const other of ['https://github.com/o/r/releases/latest/download/game.json', raw,
|
||||
'https://example.com/o/r/blob/main/game.json', 'http://github.com/o/r/blob/main/game.json']) {
|
||||
assert.equal(rawGithubUrl(other), other);
|
||||
}
|
||||
});
|
||||
|
||||
test('GitHub release downloads are recognised (for the release name from the API)', () => {
|
||||
assert.deepEqual(githubRelease('https://github.com/o/r/releases/latest/download/frameport-install.json'),
|
||||
{ owner: 'o', repo: 'r', tag: null });
|
||||
assert.deepEqual(githubRelease('https://github.com/o/r/releases/download/v0.1.0/frameport-install.json'),
|
||||
{ owner: 'o', repo: 'r', tag: 'v0.1.0' });
|
||||
assert.equal(githubRelease('https://github.com/o/r/blob/main/x.json'), null);
|
||||
assert.equal(githubRelease('https://raw.githubusercontent.com/o/r/main/x.json'), null);
|
||||
});
|
||||
@@ -68,38 +68,6 @@ export function checkUrl(text: string, what = 'link'): string | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* A GitHub file page (github.com/<owner>/<repo>/blob/<ref>/<path>, or /raw/<ref>/<path>) as the file itself on
|
||||
* raw.githubusercontent.com: a /blob/ address is an HTML page, and raw.githubusercontent.com is the GitHub address a
|
||||
* web page may read (CORS). Other addresses come back unchanged. deeplink.raw_github_url does the same in the app.
|
||||
*/
|
||||
export function rawGithubUrl(text: string): string {
|
||||
let url: URL;
|
||||
try { url = new URL(text); } catch { return text; }
|
||||
if (url.protocol !== 'https:' || !['github.com', 'www.github.com'].includes(url.hostname.toLowerCase())) return text;
|
||||
const m = url.pathname.match(/^\/([^/]+)\/([^/]+)\/(?:blob|raw)\/(.+)$/);
|
||||
if (!m) return text;
|
||||
return `https://raw.githubusercontent.com/${m[1]}/${m[2]}/${m[3]}`;
|
||||
}
|
||||
|
||||
export interface GithubRelease { owner: string; repo: string; tag: string | null }
|
||||
|
||||
/**
|
||||
* A GitHub release download (github.com/<owner>/<repo>/releases/download/<tag>/<file> or
|
||||
* …/releases/latest/download/<file>; tag null = latest), else null. Release downloads can't be read by a web page
|
||||
* (no CORS), so the page shows the release's name from GitHub's API instead of the manifest's.
|
||||
*/
|
||||
export function githubRelease(text: string): GithubRelease | null {
|
||||
let url: URL;
|
||||
try { url = new URL(text); } catch { return null; }
|
||||
if (url.protocol !== 'https:' || !['github.com', 'www.github.com'].includes(url.hostname.toLowerCase())) return null;
|
||||
const latest = url.pathname.match(/^\/([^/]+)\/([^/]+)\/releases\/latest\/download\/[^/]+$/);
|
||||
if (latest) return { owner: latest[1], repo: latest[2], tag: null };
|
||||
const tagged = url.pathname.match(/^\/([^/]+)\/([^/]+)\/releases\/download\/([^/]+)\/[^/]+$/);
|
||||
if (tagged) return { owner: tagged[1], repo: tagged[2], tag: decodeURIComponent(tagged[3]) };
|
||||
return null;
|
||||
}
|
||||
|
||||
export function toFrameportLink(kind: Kind, target: string): string {
|
||||
return `frameport://install?${kind}=${encodeURIComponent(target)}`;
|
||||
}
|
||||
@@ -107,9 +75,8 @@ export function toFrameportLink(kind: Kind, target: string): string {
|
||||
/** The page's query string → what to install, or why not. */
|
||||
export function parseInstallParams(search: string): Parsed {
|
||||
const q = new URLSearchParams(search);
|
||||
const raw = (v: string | undefined) => (v ? rawGithubUrl(v) : v);
|
||||
const manifest = raw(q.get('manifest')?.trim());
|
||||
const file = raw(q.get('url')?.trim());
|
||||
const manifest = q.get('manifest')?.trim();
|
||||
const file = q.get('url')?.trim();
|
||||
if (manifest) {
|
||||
const error = checkUrl(manifest, 'manifest address');
|
||||
if (error) return { ok: false, error };
|
||||
|
||||
@@ -864,8 +864,7 @@ def saves_list(package: str = typer.Argument(..., help="the game (package or par
|
||||
found = saves.list_backups(pkg)
|
||||
if as_json:
|
||||
typer.echo(json.dumps([{"path": str(b.path), "created": b.created, "size": b.size, "files": b.files,
|
||||
"bytes": b.bytes, "version": b.version, "skipped": b.skipped,
|
||||
"automatic": b.automatic} for b in found],
|
||||
"bytes": b.bytes, "version": b.version, "skipped": b.skipped} for b in found],
|
||||
indent=1))
|
||||
return
|
||||
if not found:
|
||||
@@ -874,8 +873,7 @@ def saves_list(package: str = typer.Argument(..., help="the game (package or par
|
||||
for i, b in enumerate(found, 1):
|
||||
when = time.strftime("%Y-%m-%d %H:%M", time.localtime(b.created))
|
||||
typer.echo(f"{i:3} {when} {b.files:5} file(s) {b.bytes / 2**20:8.1f} MiB"
|
||||
+ (f" v{b.version}" if b.version else "")
|
||||
+ (" automatic" if b.automatic else "") + f" {b.path.name}")
|
||||
+ (f" v{b.version}" if b.version else "") + f" {b.path.name}")
|
||||
|
||||
|
||||
@saves_app.command("restore")
|
||||
|
||||
@@ -185,23 +185,6 @@ def demo_manifest() -> Manifest:
|
||||
version="1.0.0", demo=True)
|
||||
|
||||
|
||||
_GITHUB_FILE_PAGE = re.compile(r"^/([^/]+)/([^/]+)/(?:blob|raw)/(.+)$")
|
||||
|
||||
|
||||
def raw_github_url(url: str) -> str:
|
||||
"""A GitHub file page (github.com/<owner>/<repo>/blob/<ref>/<path>, or /raw/…) as the file itself on
|
||||
raw.githubusercontent.com (a /blob/ address is an HTML page); anything else unchanged. The install page
|
||||
(site/src/scripts/install-link.ts rawGithubUrl) does the same."""
|
||||
try:
|
||||
parts = urlsplit(url.strip())
|
||||
except ValueError:
|
||||
return url
|
||||
if parts.scheme != "https" or (parts.hostname or "").lower() not in ("github.com", "www.github.com"):
|
||||
return url
|
||||
m = _GITHUB_FILE_PAGE.match(parts.path)
|
||||
return f"https://raw.githubusercontent.com/{m[1]}/{m[2]}/{m[3]}" if m else url
|
||||
|
||||
|
||||
def parse(text: str) -> InstallRequest:
|
||||
"""framedrop://install?…, frameport://install?…, the https://framedropvr.com/install?… button link, a manifest
|
||||
URL (…json) or a direct file URL."""
|
||||
@@ -224,12 +207,12 @@ def parse(text: str) -> InstallRequest:
|
||||
if manifest and is_demo(manifest):
|
||||
return demo_request()
|
||||
if manifest:
|
||||
return InstallRequest(manifest_url=check_url(raw_github_url(manifest), "manifest address"))
|
||||
return InstallRequest(manifest_url=check_url(manifest, "manifest address"))
|
||||
if file:
|
||||
return InstallRequest(file_url=check_url(raw_github_url(file), "file address"))
|
||||
return InstallRequest(file_url=check_url(file, "file address"))
|
||||
raise LinkError("The link doesn't say what to install (no manifest= or url=).")
|
||||
if scheme in ("https", "http"):
|
||||
url = check_url(raw_github_url(text))
|
||||
url = check_url(text)
|
||||
name = filename_of(url).lower()
|
||||
if name.endswith(".json"):
|
||||
return InstallRequest(manifest_url=url)
|
||||
|
||||
@@ -20,11 +20,9 @@ def pc_usb_addresses(frame_ip: str) -> list[str]:
|
||||
"""This PC's IPv4 addresses in the same /24 as the Frame's USB address (Windows via ipconfig, else `ip`)."""
|
||||
prefix = frame_ip.rsplit(".", 1)[0] + "."
|
||||
texts = []
|
||||
# CREATE_NO_WINDOW: the windowed Windows app flashed a console for every ipconfig run (GitHub #398)
|
||||
hidden = {"creationflags": 0x08000000} if sys.platform == "win32" else {}
|
||||
for cmd in (["ip", "-4", "-o", "addr", "show"], ["ipconfig"], ["ifconfig"], ["ipconfig.exe"]):
|
||||
try:
|
||||
texts.append(subprocess.run(cmd, capture_output=True, text=True, timeout=10, **hidden).stdout)
|
||||
texts.append(subprocess.run(cmd, capture_output=True, text=True, timeout=10).stdout)
|
||||
except (OSError, subprocess.SubprocessError):
|
||||
continue
|
||||
text = "\n".join(texts)
|
||||
|
||||
@@ -11,11 +11,9 @@ game runs. No Flet here: the GUI and the CLI share it.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
import tarfile
|
||||
import tempfile
|
||||
import time
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
@@ -47,7 +45,6 @@ class Backup:
|
||||
bytes: int = 0 # the save files' size (uncompressed)
|
||||
version: str = ""
|
||||
title: str = ""
|
||||
automatic: bool = False
|
||||
skipped: int = 0 # large files left out
|
||||
|
||||
@property
|
||||
@@ -55,39 +52,8 @@ class Backup:
|
||||
return sidecar_of(self.path)
|
||||
|
||||
|
||||
def default_root() -> Path:
|
||||
return user_data_dir() / "save-backups"
|
||||
|
||||
|
||||
def root_dir() -> Path:
|
||||
folder = library.setting("saves.folder", "")
|
||||
return Path(folder).expanduser() if folder else default_root()
|
||||
|
||||
|
||||
def writable_folder(folder: Path) -> Path:
|
||||
"""Probe actual creation, including on network/cloud mounts; don't change settings on failure."""
|
||||
folder = Path(folder).expanduser().absolute()
|
||||
try:
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
with tempfile.TemporaryFile(dir=folder) as probe:
|
||||
probe.write(b"FramePort save backup folder\n")
|
||||
probe.flush()
|
||||
except OSError as exc:
|
||||
raise SavesError(f"Cannot write save backups to {folder}: {exc}") from exc
|
||||
return folder
|
||||
|
||||
|
||||
def set_folder(folder: str | None) -> Path:
|
||||
dest = writable_folder(Path(folder) if folder else default_root())
|
||||
roots = [str(p) for p in backup_roots()]
|
||||
library.set_setting("saves.previous_folders", roots)
|
||||
library.set_setting("saves.folder", str(dest) if folder else "")
|
||||
return dest
|
||||
|
||||
|
||||
def backup_roots() -> list[Path]:
|
||||
return list(dict.fromkeys([root_dir(), default_root(),
|
||||
*(Path(p) for p in library.setting("saves.previous_folders", []))]))
|
||||
return user_data_dir() / "save-backups"
|
||||
|
||||
|
||||
def backups_dir(pkg: str) -> Path:
|
||||
@@ -130,8 +96,7 @@ def _sidecar_data(manifest: dict, archive: Path) -> dict:
|
||||
"version": manifest.get("version") or "", "title": manifest.get("title") or "",
|
||||
"files": len(files), "bytes": sum(int(f.get("size") or 0) for f in files),
|
||||
"skipped": [s for s in manifest.get("skipped") or [] if s.get("reason") in ("size", "unreadable")],
|
||||
"archive": archive.name, "agent": manifest.get("agent"),
|
||||
"automatic": bool(manifest.get("automatic"))}
|
||||
"archive": archive.name, "agent": manifest.get("agent")}
|
||||
|
||||
|
||||
def _from_sidecar(archive: Path, data: dict) -> Backup:
|
||||
@@ -139,15 +104,14 @@ def _from_sidecar(archive: Path, data: dict) -> Backup:
|
||||
created=float(data.get("created") or archive.stat().st_mtime), size=archive.stat().st_size,
|
||||
files=int(data.get("files") or 0), bytes=int(data.get("bytes") or 0),
|
||||
version=str(data.get("version") or ""), title=str(data.get("title") or ""),
|
||||
skipped=len(data.get("skipped") or []), automatic=bool(data.get("automatic")))
|
||||
skipped=len(data.get("skipped") or []))
|
||||
|
||||
|
||||
def list_backups(pkg: str) -> list[Backup]:
|
||||
"""This game's backups on this PC, newest first (a missing/broken sidecar is rebuilt from the archive)."""
|
||||
backups_dir(pkg) # validate before using the package as a path
|
||||
d = backups_dir(pkg)
|
||||
out = []
|
||||
archives = [p for root in backup_roots() for p in (root / pkg).glob("*.tar.gz")]
|
||||
for archive in sorted(archives):
|
||||
for archive in sorted(d.glob("*.tar.gz")) if d.is_dir() else []:
|
||||
if not _NAME.match(archive.name):
|
||||
continue
|
||||
try:
|
||||
@@ -155,12 +119,9 @@ def list_backups(pkg: str) -> list[Backup]:
|
||||
except (OSError, ValueError):
|
||||
try:
|
||||
data = _sidecar_data(read_manifest(archive), archive)
|
||||
sidecar_of(archive).write_text(json.dumps(data, indent=1), encoding="utf-8")
|
||||
except (OSError, ValueError):
|
||||
continue
|
||||
try:
|
||||
sidecar_of(archive).write_text(json.dumps(data, indent=1), encoding="utf-8")
|
||||
except OSError:
|
||||
pass # backups in an old read-only folder remain usable
|
||||
try:
|
||||
out.append(_from_sidecar(archive, data))
|
||||
except OSError:
|
||||
@@ -170,17 +131,17 @@ def list_backups(pkg: str) -> list[Backup]:
|
||||
|
||||
def has_backups(pkg: str) -> bool:
|
||||
try:
|
||||
backups_dir(pkg)
|
||||
d = backups_dir(pkg)
|
||||
except ValueError:
|
||||
return False
|
||||
return any(_NAME.match(p.name) for root in backup_roots() for p in (root / pkg).glob("*.tar.gz"))
|
||||
return d.is_dir() and any(_NAME.match(p.name) for p in d.glob("*.tar.gz"))
|
||||
|
||||
|
||||
def prune(pkg: str, keep: int | None = None, protect: Path | None = None) -> list[Path]:
|
||||
"""Delete all but the newest `keep` backups of a game (never `protect`). Returns the deleted archives."""
|
||||
keep = keep_count() if keep is None else max(1, keep)
|
||||
gone = []
|
||||
for b in [b for b in list_backups(pkg) if b.path.parent == backups_dir(pkg)][keep:]:
|
||||
for b in list_backups(pkg)[keep:]:
|
||||
if protect is not None and b.path == protect:
|
||||
continue
|
||||
for p in (b.path, b.sidecar):
|
||||
@@ -229,31 +190,21 @@ def _new_name(d: Path) -> Path:
|
||||
return path
|
||||
|
||||
|
||||
def backup(frame, pkg: str, reporter: Reporter | None = None, keep: int | None = None,
|
||||
snapshot: str | None = None) -> Backup:
|
||||
def backup(frame, pkg: str, reporter: Reporter | None = None, keep: int | None = None) -> Backup:
|
||||
"""Back up the game's saves from the Frame into a new archive on this PC, then keep the newest `keep`."""
|
||||
rep = reporter or Reporter()
|
||||
rep.stage("saves", "Backing up saves")
|
||||
d = writable_folder(backups_dir(pkg))
|
||||
try:
|
||||
expected = 0 if snapshot else int(info(frame, pkg).get("bytes") or 0)
|
||||
expected = int(info(frame, pkg).get("bytes") or 0)
|
||||
except Exception: # noqa: BLE001 - only for the progress bar
|
||||
expected = 0
|
||||
# Automatic imports can overlap a manual job; reserve the name before opening SSH.
|
||||
while True:
|
||||
dest = _new_name(d)
|
||||
part = dest.with_name(dest.name + ".part")
|
||||
try:
|
||||
part.touch(exist_ok=False)
|
||||
break
|
||||
except FileExistsError:
|
||||
continue
|
||||
stdout = None
|
||||
d = backups_dir(pkg)
|
||||
d.mkdir(parents=True, exist_ok=True)
|
||||
dest = _new_name(d)
|
||||
part = dest.with_name(dest.name + ".part")
|
||||
stdin, stdout, stderr = _exec(frame, "_backup_saves", {"package": pkg})
|
||||
received = 0
|
||||
digest = hashlib.sha256()
|
||||
try:
|
||||
stdin, stdout, stderr = _exec(frame, "_fetch_save_snapshot" if snapshot else "_backup_saves",
|
||||
{"package": pkg, "snapshot": snapshot})
|
||||
stdin.channel.shutdown_write()
|
||||
with open(part, "wb") as f:
|
||||
while True:
|
||||
@@ -262,7 +213,6 @@ def backup(frame, pkg: str, reporter: Reporter | None = None, keep: int | None =
|
||||
if not chunk:
|
||||
break
|
||||
f.write(chunk)
|
||||
digest.update(chunk)
|
||||
received += len(chunk)
|
||||
if expected: # compressed: an estimate, never "done" before the end
|
||||
rep.progress(min(0.95, received / expected), f"{received / 2**20:.1f} MiB")
|
||||
@@ -270,26 +220,21 @@ def backup(frame, pkg: str, reporter: Reporter | None = None, keep: int | None =
|
||||
reply = _last_json(stderr.read().decode("utf-8", "replace")) or {}
|
||||
if code or not reply.get("ok"):
|
||||
raise SavesError(reply.get("error") or f"the Frame couldn't back up the saves (exit {code})")
|
||||
if snapshot and digest.hexdigest() != snapshot.split("-", 1)[1][:-7]:
|
||||
raise SavesError("the Frame sent a damaged save snapshot (hash mismatch)")
|
||||
manifest = read_manifest(part)
|
||||
if manifest.get("package") != pkg:
|
||||
raise SavesError(f"the Frame sent saves of {manifest.get('package')}, not {pkg}")
|
||||
part.replace(dest)
|
||||
except BaseException:
|
||||
try:
|
||||
if stdout is not None:
|
||||
stdout.channel.close()
|
||||
stdout.channel.close()
|
||||
except Exception: # noqa: BLE001
|
||||
pass
|
||||
part.unlink(missing_ok=True)
|
||||
raise
|
||||
data = _sidecar_data(manifest, dest)
|
||||
if snapshot:
|
||||
data.update(automatic=True, snapshot=snapshot)
|
||||
sidecar_of(dest).write_text(json.dumps(data, indent=1), encoding="utf-8")
|
||||
result = _from_sidecar(dest, data)
|
||||
prune(pkg, keep, protect=None if snapshot else dest)
|
||||
prune(pkg, keep, protect=dest)
|
||||
rep.progress(1.0, "")
|
||||
rep.log(f"saved {result.files} file(s), {result.bytes / 2**20:.1f} MiB of saves, to {dest}"
|
||||
+ (f"; {result.skipped} large file(s) left out" if result.skipped else ""))
|
||||
@@ -354,28 +299,3 @@ def undo_restore(frame, pkg: str) -> dict:
|
||||
raise SavesError(reply.get("error") or "the Frame couldn't put the saves back")
|
||||
return reply["result"]
|
||||
|
||||
|
||||
|
||||
def sync_snapshots(frame, reporter: Reporter | None = None) -> int:
|
||||
"""Import each remote snapshot once, including after local retention has pruned its archive."""
|
||||
frame.agent("save_snapshot_settings", enabled=bool(library.setting("saves.auto", False)))
|
||||
state_path = user_data_dir() / "save-snapshots-synced.json"
|
||||
try:
|
||||
seen = set(json.loads(state_path.read_text(encoding="utf-8")))
|
||||
except (OSError, ValueError):
|
||||
seen = set()
|
||||
count = 0
|
||||
for item in frame.agent("save_snapshots").get("snapshots", []):
|
||||
pkg, name = item["package"], item["snapshot"]
|
||||
# Content digest identity is stable across reconnects and different Frames.
|
||||
identity = pkg + ":" + item["sha256"]
|
||||
if identity in seen:
|
||||
continue
|
||||
backup(frame, pkg, reporter, snapshot=name)
|
||||
seen.add(identity)
|
||||
state_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
tmp = state_path.with_suffix(".tmp")
|
||||
tmp.write_text(json.dumps(sorted(seen)), encoding="utf-8")
|
||||
tmp.replace(state_path)
|
||||
count += 1
|
||||
return count
|
||||
@@ -39,11 +39,17 @@
|
||||
", {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": "",
|
||||
@@ -52,6 +58,8 @@
|
||||
"360° pictures and video": "",
|
||||
"360° sharpness": "",
|
||||
"360° video frame rate limit": "",
|
||||
"40% radius": "",
|
||||
"45% radius": "",
|
||||
"72 Hz": "",
|
||||
"720p (recommended)": "",
|
||||
"80 Hz": "",
|
||||
@@ -200,14 +208,12 @@
|
||||
"Asset-file service bypass": "",
|
||||
"At most this many redraws per second of a 360° layer (0 = no limit). Video players need at least the video's frame rate.": "",
|
||||
"Automatic": "",
|
||||
"automatic": "",
|
||||
"Automatic ({auto:.0%})": "",
|
||||
"Automatic SteamVR performance settings (this PC)": "",
|
||||
"Back to library": "",
|
||||
"Back up all saves": "",
|
||||
"Back up its saves to this PC before deleting them": "",
|
||||
"Back up saves": "",
|
||||
"Back up saves when a game closes": "",
|
||||
"Back up saves: {title}": "",
|
||||
"Back up the signing keys ({len}) to {shown_dir} first": "",
|
||||
"Backed up the saves of {n} game": [
|
||||
@@ -274,11 +280,9 @@
|
||||
"Choose a file": "",
|
||||
"Choose a folder": "",
|
||||
"Choose a folder with Quest, Android or PC VR games. FramePort finds them and gets them ready.": "",
|
||||
"Choose backup folder…": "",
|
||||
"Choose Flat window if a phone or tablet app shows nothing in the headset, VR if a VR app opens as a flat window.": "",
|
||||
"Choose how the Frame's face buttons send Quest Touch inputs: 0 = SteamVR default, 1 = Mirror, 2 = Quest pair. Used at the next launch; SteamVR custom bindings can override it. Requires the runtime's XR_VALVE_frame_controller_interaction extension. Mapping: https://github.com/spoopyghosty0/frameport/blob/main/docs/CONTROLLERS.md": "",
|
||||
"Choose PNG, JPEG or WebP images. Missing shapes are made from the ones you choose, and FramePort never replaces them.": "",
|
||||
"Choose save backup folder": "",
|
||||
"Choose the headset identity the game sees; Quest 3 is the default.": "",
|
||||
"Choose the language for games that follow the system language. The game must include it. Apply with Update on Frame.": "",
|
||||
"Choose the OpenXR headset name and headset UUID reported to Quest games. Quest 3 is the default; Quest 2 preserves OVRPort's original answers. Requires a rebuild. Android Build.MODEL remains Lepton.": "",
|
||||
@@ -342,7 +346,6 @@
|
||||
"Cool Game went through the portal. It was only a demo: nothing was downloaded or installed.": "",
|
||||
"Copied": "",
|
||||
"Copied. Save it as a .json file, change the colors and install it.": "",
|
||||
"Copies cube-map loading screens into six panels around the viewer (GLES and Vulkan). Mixed projection frames are skipped because the Frame draws panels above the scene. Requires cube_standin.": "",
|
||||
"Copies the game and its saves to the other drive, checks the copy, then removes the old one. The game must be closed. A game on a microSD card only starts while the card is in.": "",
|
||||
"Copy": "",
|
||||
"Copy all": "",
|
||||
@@ -378,7 +381,6 @@
|
||||
"Couldn't read: {names}": "",
|
||||
"Couldn't remove the theme: {error}": "",
|
||||
"Couldn't start the live view: {exc}": "",
|
||||
"Couldn't sync save backups: {error}": "",
|
||||
"Couldn't take a screenshot: {error}": "",
|
||||
"Couldn't use {choice}: {exc}": "",
|
||||
"Counts the headset as worn, so games that only move the player while it's worn get head tracking and controls (for example BONELAB).": "",
|
||||
@@ -401,7 +403,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 (large)": "",
|
||||
"Default (30% radius)": "",
|
||||
"Default controller buttons": "",
|
||||
"Delete": "",
|
||||
"Delete {names}?": "",
|
||||
@@ -516,7 +518,6 @@
|
||||
"Every {n}": "",
|
||||
"everything in ~ (not seen by games)": "",
|
||||
"Everything is up to date": "",
|
||||
"Existing backups stay in their original folder and remain available.": "",
|
||||
"Experimental": "",
|
||||
"experimental": "",
|
||||
"Experimental bypass for a DLC manager blocked on Meta asset-file service errors at startup (e.g. PixelRipped 1995: Asset status error (code 100)). Returns an empty successful asset list and reports requested asset IDs as installed, with an empty file path. Does not supply DLC or change download requests. Enable only to test this startup failure; disable with FRAMEPORT_ASSET_FILES_STUB=0. Shares the language-pack library and needs no language packs.": "",
|
||||
@@ -868,7 +869,6 @@
|
||||
"Keeps one name for the game, so it shows the same everywhere.": "",
|
||||
"Keeps the hand and brush visible over Vermillion's painting canvas (the canvas is drawn in the scene instead of as a layer in front).": "",
|
||||
"Keeps the resolution the game saves in step with the headset's picture size (else the picture is shifted, with black borders, after a render resolution change).": "",
|
||||
"Keeps three snapshots per game on the Frame and copies new ones here when connected.": "",
|
||||
"Keeps your progress in games that file their saves under your Meta user.": "",
|
||||
"Keyboard connected to {label}.": "",
|
||||
"Keyboard disconnected: {error}": "",
|
||||
@@ -876,7 +876,6 @@
|
||||
"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": "",
|
||||
@@ -990,7 +989,6 @@
|
||||
"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": "",
|
||||
@@ -1318,7 +1316,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 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, 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. Changes apply at the next game start.": "",
|
||||
"Refresh": "",
|
||||
"Refresh rate": "",
|
||||
@@ -1498,7 +1496,6 @@
|
||||
"Show advanced settings": "",
|
||||
"Show all patches ({len} don't apply to this game)": "",
|
||||
"Show as VR or as a flat window": "",
|
||||
"Show cube loading screens": "",
|
||||
"Show curved menus and screens": "",
|
||||
"Show details": "",
|
||||
"Show hidden files": "",
|
||||
@@ -1517,7 +1514,6 @@
|
||||
"Show video panels": "",
|
||||
"Showing {len} of {n}": "",
|
||||
"Showing {shown} of {n}. Search to find others.": "",
|
||||
"Shows 360° cube loading screens as six panels around you. Requires stand-in cube layers. Skipped while a 3D scene is submitted.": "",
|
||||
"Shows 3D 360° pictures flat if they look doubled.": "",
|
||||
"Shows Batman: Arkham Shadow's cutscenes; set by that game's recipe.": "",
|
||||
"Shows each eye's picture to the other eye. For testing.": "",
|
||||
@@ -1535,21 +1531,18 @@
|
||||
"Size of text and layout. Under WSL, Automatic follows half of Windows' display scaling (150% → 125%).": "",
|
||||
"Skip for now": "",
|
||||
"Skip Meta avatars": "",
|
||||
"Skip refused graphics": "",
|
||||
"Skip this version": "",
|
||||
"Skips a Quest-only reporting step in Meta's audio library that crashes some games.": "",
|
||||
"Skips a separate data-file check when an Unreal game still hangs at startup with the content check off. Experimental; the game still needs its data.": "",
|
||||
"Skips Meta XR Audio's telemetry under x86_64 ARM translation (emulators). Not needed on the Frame, which runs games natively.": "",
|
||||
"Skips 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\".": "",
|
||||
"Some engines contain assembly (for example OpenSSL's) that checks a return-address signature it never made. The Quest's CPU ignores those checks, the Steam Frame's enforces them: the game crashes with SIGILL as soon as it uses that code, for example on its first network connection (Star Wars Pinball VR). In a library with unpaired checks, the signing and checking instructions become no-ops.": "",
|
||||
"Some engines leave the pNext of unused Vulkan attachment references uninitialized. The Frame's driver never reads it, but Lepton always loads Steam's Fossilize shader-cache layer, which follows it and crashes on the first frame (SIGSEGV in libVkLayer_fossilize.so from FVulkanRenderPass, for example Deadpool VR). Loads Vulkan through a small shim that keeps valid pointers and drops only unreadable ones or ones pointing at the wrong structure type. It also drops a depth resolve named in a subpass without a depth attachment, which crashes the Frame's driver at the first render pass (for example Metro Awakening).": "",
|
||||
"Some game folders are already set up for SteamVR: a Revive copy (LibRevive64.dll) next to the game, started by a small loader DLL (for example xinput1_3.dll) that Windows loads from the game's folder. Then FramePort starts the game program directly — like double-clicking it — instead of through its own Revive (two Revives conflict; for example the Oculus Platform check then fails). On the Frame, Wine is told to use those loader DLLs from the game folder instead of its own.": "",
|
||||
"Some games can't create any graphics with it (for example Transformers Beyond Reality).": "",
|
||||
"Some games keep content in separate files next to their OBB (for example Star Wars: Tales from the Galaxy's Edge: its seasons and sound banks) and ask Meta's platform for them as asset files. OVRPort's platform loader doesn't know them, so the game waits for content that never arrives (black screen after loading). Lists the content files shipped with the game's data (*.pak) as installed and answers their download request at once with the file's path; nothing is copied or downloaded. Shares the language-pack library.": "",
|
||||
"Some games save their render resolution in a settings file and load it after creating the headset's eye buffers; after a resolution scale change the saved size no longer matches and the picture is displaced or stretched, with black borders (for example BlazeRush's user_config.xml). FramePort writes the values its recipe names into the game's file while the game isn't running (after an install and after a Game settings change), from the Frame's own eye-buffer size times the resolution scale: w and h = the eye buffer's width and height, for example h*16/9. Only existing entries change; the previous file is kept as <file>.frameport-backup. The size is learned from the game's last start, so a file the game wrote before is corrected from the next install or settings change on.": "",
|
||||
"Some OpenGL ES engines compile every shader for multiview (both eyes in one draw, `num_views=2`) and use the same shaders to draw into ordinary single-layer framebuffers, for example a HUD or PDA screen rendered to a texture. Quest's driver draws them anyway; the Frame's driver (Mesa) follows the OVR_multiview rule and silently drops every such draw, so those panels stay black (for example Doom3Quest's HUD and PDA). Loads OpenGL ES through a small interposer (libfpglmv.so) that draws those cases with a single-view copy of the shader program (left-eye view; uniforms copied before each such draw). Eye-buffer draws are unchanged. Logs under the tag GLMV; the setting gl_mv_debug adds error checks and counters.": "",
|
||||
@@ -1711,7 +1704,7 @@
|
||||
"The Frame's battery is at {pct}% and not charging. Plug it into a strong charger — installs pause at {pause}%.": "",
|
||||
"The Frame's battery is at {pct}%, so installs are paused. Plug it in and they continue.": "",
|
||||
"The Frame's desktop password, needed only once so FramePort can add its key.": "",
|
||||
"The Frame's runtime has no cube-map layers and refuses their swapchains; OVRPlugin then crashes when it submits the next frame (for example Budget Cuts Ultimate). FrameBridge serves such a swapchain itself on GLES and Vulkan; cube_quads displays its loading screens.": "",
|
||||
"The Frame's runtime has no cube-map layers and refuses their swapchains; OVRPlugin then crashes when it submits the next frame (for example Budget Cuts Ultimate). FrameBridge serves such a swapchain itself (a GL cube map, GLES games) and drops its layers, so the game runs on without that layer.": "",
|
||||
"The Frame's Steam couldn't start {title} (error {code}). Please report it.": "",
|
||||
"The Frame's Steam didn't accept {title}, so it was added as \"Devkit Game: …\". Starting it now — put the headset on.": "",
|
||||
"The Frame's Steam library still shows the old artwork.": "",
|
||||
@@ -1924,7 +1917,6 @@
|
||||
"Use FramePort": "",
|
||||
"Use FramePort for these links": "",
|
||||
"Use global default ({mode})": "",
|
||||
"Use the default": "",
|
||||
"Use the new recipe": "",
|
||||
"Use the repack's launcher (bundled Revive)": "",
|
||||
"Use the setup command": "",
|
||||
@@ -1967,12 +1959,10 @@
|
||||
"Vulkan pipeline failures (log)": "",
|
||||
"Vulkan shader dump (diagnostics)": "",
|
||||
"Vulkan shader fixes": "",
|
||||
"Vulkan shim (frame.vk_sanitize): a graphics pipeline the Frame's driver refuses is created again with a fragment shader that writes zero, then with a vertex shader that only sets the position as well, so the draw shows nothing instead of Unreal ending with \"Shader compilation failures are Fatal.\" (for example a few multiview vertex shaders in Transformers Beyond Reality, GitHub #349). Logged as \"retried with a blank\".": "",
|
||||
"Vulkan shim (frame.vk_sanitize): logs every failing graphics/compute pipeline creation with its shader stages (named like the vk_shader_dump files), structure types and any sampler Y'CbCr conversion involved, to find the pipeline behind Unreal's \"Shader compilation failures are Fatal.\" No effect on the game.": "",
|
||||
"Vulkan shim (frame.vk_sanitize): makes two Unreal habits valid Vulkan - depth images get VK_IMAGE_USAGE_TRANSFER_DST_BIT (they are cleared with vkCmdClearDepthStencilImage) and Qualcomm shader-resolve subpasses lose an invalid depth resolve. Found with the validation layer in Into The Radius 2 (flickering models, windows behind models). Also leaves out image barriers without an image and refuses image views without one, which crash the Frame's driver (for example Metro Awakening).": "",
|
||||
"Vulkan shim (frame.vk_sanitize): on gives every occlusion query room for both eyes. In multiview passes the Frame's driver writes a zero result for the second eye into the next query, so engines that count on one slot cull visible objects (models popping in and out, for example Into The Radius 2). 0 = off, 1 = on (2 slots).": "",
|
||||
"Vulkan shim (frame.vk_sanitize): SPIR-V modules matching size + SHA-256 get words inserted at a byte offset, for example stores that initialize locals a shader reads before writing (an undefined loop counter hung the GPU in VR4's campaign). Format: <size>:<sha256>:<byte offset>:<word>,<word>,...; several separated by ';'. Comes from a game's recipe.": "",
|
||||
"Vulkan shim (frame.vk_sanitize): takes Lepton's Fossilize shader-cache layer out of the game's Vulkan layers (Android's debug layer list) when the engine loads its Vulkan library. With Fossilize loaded every graphics pipeline of Transformers Beyond Reality failed (VK_ERROR_OUT_OF_HOST_MEMORY), which Unreal treats as fatal (GitHub #349). Lepton has no switch for it; instances created before the engine loads the shim keep it.": "",
|
||||
"Vulkan shim (frame.vk_sanitize): the game doesn't see VK_EXT_fragment_density_map(2). Unreal Engine 5 turns on fragment-density-map foveation when the driver offers it and expects the density map from the headset, which the Frame doesn't provide: image views and barriers for a missing image, then a crash in the Frame's Vulkan driver (for example Metro Awakening). Valve's own foveation layer isn't affected.": "",
|
||||
"Vulkan shim (frame.vk_sanitize): writes every distinct SPIR-V module the game creates to Android/data/<package>/files/fp_vk_shaders/<size>_<sha256>.spv, with index.txt listing every creation in order with its time, to find the shader behind a GPU hang and capture it for a new vk_shader_fix. Diagnostics include the newest modules. No effect on the game.": "",
|
||||
"Vulkan: drop invalid render-pass pointers": "",
|
||||
@@ -1998,7 +1988,6 @@
|
||||
"What your Frame is ready for and what's installed": "",
|
||||
"What's new in FramePort {version}": "",
|
||||
"What's new…": "",
|
||||
"When the Frame's driver refuses one of the game's shaders, that object is left out instead of the game ending.": "",
|
||||
"Where it's installed": "",
|
||||
"Where new games go on the Frame, such as a microSD card. Installed games stay put; right-click → Move to… moves one. Cards formatted as FAT, exFAT or NTFS can't hold games.": "",
|
||||
"Where the power goes": "",
|
||||
@@ -2019,7 +2008,6 @@
|
||||
"Windows' firewall for WSL blocks the Frame. Show the setup command again and allow the change when Windows asks.": "",
|
||||
"With emulated passthrough, honours the eye layer's XR_FB_composition_layer_alpha_blend, which the Frame's runtime ignores: Unreal games keep inverted alpha and ask for inverse blending, so the room showed where the game drew and black where it should show the room (for example Star Wars: Beyond Victory). The alpha is inverted in the game's image before it is composited (Vulkan).": "",
|
||||
"Without a Meta account, OVRPort's platform library makes up a new user id at every start (ovr_GetLoggedInUserID). Games that file saves under the user id (for example Walkabout Mini Golf) then start with an empty profile each time and seem to lose all progress. Gives the game a fixed id instead, different for each game and each FramePort user.": "",
|
||||
"Without Steam's shader cache layer": "",
|
||||
"Working": "",
|
||||
"Working…": "",
|
||||
"Works": "",
|
||||
|
||||
@@ -24,7 +24,6 @@ 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 = (
|
||||
|
||||
@@ -91,14 +91,7 @@ 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
|
||||
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
|
||||
fixed = patch_dispatcher(ws.read_lib(loader), key)
|
||||
ws.put(ws.lib(loader), fixed)
|
||||
ctx.notes.append(f"{loader}: systemName={SYSTEM_NAMES[key].decode()}, HeadsetId={UUIDS[key].hex()}")
|
||||
return True
|
||||
|
||||
@@ -152,9 +152,8 @@ class UnrealNoReserve(Patch):
|
||||
if not lib or ws.abi != "arm64-v8a":
|
||||
return []
|
||||
todo, done = mmap_sites(ws.read_lib(lib))
|
||||
# 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")]
|
||||
return [("Unreal memory reservations use MAP_NORESERVE", bool(done) and not todo,
|
||||
f"{len(done)} rewritten, {len(todo)} left")]
|
||||
|
||||
|
||||
register(UnrealNoReserve)
|
||||
@@ -58,13 +58,10 @@ SETTINGS = [
|
||||
"https://github.com/spoopyghosty0/frameport/blob/main/docs/CONTROLLERS.md"),
|
||||
("swapchain_fix", "int", 1, "Swapchain format fallback",
|
||||
"Retry rejected GLES formats/MSAA with sRGB, samples=1."),
|
||||
("cube_quads", "int", 1, "Show cube layers",
|
||||
"Copies cube-map loading screens into six panels around the viewer (GLES and Vulkan). Mixed projection frames "
|
||||
"are skipped because the Frame draws panels above the scene. Requires cube_standin."),
|
||||
("cube_standin", "int", 1, "Stand-in cube swapchains",
|
||||
"The Frame's runtime has no cube-map layers and refuses their swapchains; OVRPlugin then crashes when it submits "
|
||||
"the next frame (for example Budget Cuts Ultimate). FrameBridge serves such a swapchain itself on GLES and "
|
||||
"Vulkan; cube_quads displays its loading screens."),
|
||||
"the next frame (for example Budget Cuts Ultimate). FrameBridge serves such a swapchain itself (a GL cube map, "
|
||||
"GLES games) and drops its layers, so the game runs on without that layer."),
|
||||
("surface_native", "int", 0, "Native video surfaces (Batman renderer)",
|
||||
"Plays the game's Android video surface through GPU-shared buffers and composes it as a stereo panorama (Batman: "
|
||||
"Arkham Shadow's cutscenes, see docs/SURFACE_VIDEO.md). Specific to that game's renderer: set by its recipe, not "
|
||||
@@ -248,16 +245,6 @@ SETTINGS = [
|
||||
"Vulkan shim (frame.vk_sanitize): logs every failing graphics/compute pipeline creation with its shader stages "
|
||||
"(named like the vk_shader_dump files), structure types and any sampler Y'CbCr conversion involved, to find the "
|
||||
"pipeline behind Unreal's \"Shader compilation failures are Fatal.\" No effect on the game."),
|
||||
("vk_no_fossilize", "int", 0, "Vulkan shim: without Lepton's Fossilize layer",
|
||||
"Vulkan shim (frame.vk_sanitize): takes Lepton's Fossilize shader-cache layer out of the game's Vulkan layers "
|
||||
"(Android's debug layer list) when the engine loads its Vulkan library. With Fossilize loaded every graphics "
|
||||
"pipeline of Transformers Beyond Reality failed (VK_ERROR_OUT_OF_HOST_MEMORY), which Unreal treats as fatal "
|
||||
"(GitHub #349). Lepton has no switch for it; instances created before the engine loads the shim keep it."),
|
||||
("vk_pipeline_fallback", "int", 0, "Vulkan shim: blank shaders for refused pipelines",
|
||||
"Vulkan shim (frame.vk_sanitize): a graphics pipeline the Frame's driver refuses is created again with a fragment "
|
||||
"shader that writes zero, then with a vertex shader that only sets the position as well, so the draw shows "
|
||||
"nothing instead of Unreal ending with \"Shader compilation failures are Fatal.\" (for example a few multiview "
|
||||
"vertex shaders in Transformers Beyond Reality, GitHub #349). Logged as \"retried with a blank\"."),
|
||||
("vk_validation", "int", 0, "Vulkan shim: validation layer",
|
||||
"Diagnostics: the Vulkan shim (frame.vk_sanitize) adds Khronos' validation layer to the game's instance; its "
|
||||
"findings go to launch.log. The layer library (libVkLayer_khronos_validation.so) must be in the APK."),
|
||||
@@ -318,7 +305,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."),
|
||||
"level": dict(group="picture", level="common", label="Full-resolution area",
|
||||
"radius": 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."),
|
||||
@@ -463,12 +450,6 @@ UI: dict[str, dict] = {
|
||||
help="Shows each eye's picture to the other eye. For testing.", control=("switch",)),
|
||||
"vk_pipeline_log": dict(group="troubleshooting", level="advanced", label="Vulkan pipeline failures (log)",
|
||||
help="Logs graphics pipelines the Frame's driver refuses. No effect on the game.", control=("switch",)),
|
||||
"vk_no_fossilize": dict(group="troubleshooting", level="advanced", label="Without Steam's shader cache layer",
|
||||
help="Some games can't create any graphics with it (for example Transformers Beyond Reality).",
|
||||
control=("switch",)),
|
||||
"vk_pipeline_fallback": dict(group="troubleshooting", level="advanced", label="Skip refused graphics",
|
||||
help="When the Frame's driver refuses one of the game's shaders, that object is left out instead of "
|
||||
"the game ending.", control=("switch",)),
|
||||
"vk_validation": dict(group="troubleshooting", level="advanced", label="Vulkan error checks (log)",
|
||||
help="Logs Vulkan mistakes the game makes. Needs a special test build.", control=("switch",)),
|
||||
"fb_color_space": dict(group="troubleshooting", level="advanced", label="Colour space support",
|
||||
@@ -517,9 +498,6 @@ UI: dict[str, dict] = {
|
||||
"ovrp_hold_physics": dict(group="troubleshooting", level="advanced", label="Steadier hands (older Unity)",
|
||||
help="For older Unity games whose hands trail the controllers (for example Sniper Elite "
|
||||
"VR). In others the hands lag.", control=("switch",)),
|
||||
"cube_quads": dict(group="troubleshooting", level="advanced", label="Show cube loading screens",
|
||||
help="Shows 360° cube loading screens as six panels around you. Requires stand-in cube layers. "
|
||||
"Skipped while a 3D scene is submitted.", control=("switch",)),
|
||||
"cube_standin": dict(group="troubleshooting", level="advanced", label="Stand in for cube layers",
|
||||
help="Keeps games running that use a 360° cube layer the Frame lacks (for example Budget Cuts "
|
||||
"Ultimate). Leave it on.", control=("switch",)),
|
||||
@@ -539,8 +517,6 @@ UI: dict[str, dict] = {
|
||||
# they don't work for 32-bit games on the bridge. surface_native: Batman's native video renderer hooks Vulkan
|
||||
# functions OVRPort's dispatcher doesn't know
|
||||
XRSHIM_SETTINGS = ("hide_fb_foveation", "controller_models", "haptic_fix", "surface_native")
|
||||
# shown with an "experimental" pill (Game settings, game page, CLI): not proven in the headset on many games yet
|
||||
EXPERIMENTAL_SETTINGS = ("quest_buttons",)
|
||||
|
||||
|
||||
class AdapterSetting(Patch):
|
||||
@@ -556,7 +532,6 @@ class AdapterSetting(Patch):
|
||||
self.default = default
|
||||
self.revision = REVISIONS.get(key, 1)
|
||||
self.a32 = key not in XRSHIM_SETTINGS
|
||||
self.experimental = key in EXPERIMENTAL_SETTINGS
|
||||
|
||||
@property
|
||||
def summary(self) -> str:
|
||||
@@ -643,8 +618,6 @@ class AdapterSetting(Patch):
|
||||
"vk_validation": lambda a: a.engine == "Unreal",
|
||||
"vk_pipeline_log": lambda a: a.engine in ("Unreal", "Other") and "arm64-v8a" in a.abis,
|
||||
"fb_color_space": lambda a: a.xr == "OpenXR",
|
||||
"vk_no_fossilize": lambda a: a.engine in ("Unreal", "Other") and "arm64-v8a" in a.abis,
|
||||
"vk_pipeline_fallback": lambda a: a.engine in ("Unreal", "Other") and "arm64-v8a" in a.abis,
|
||||
# wherever the Vulkan shim can be (vk_sanitize); Unreal's Vulkan builds are rarely detected as such
|
||||
"vk_shader_dump": lambda a: a.engine in ("Unreal", "Other") and "arm64-v8a" in a.abis,
|
||||
"zink_shader_fix": ap.is_gles,
|
||||
@@ -846,33 +819,23 @@ def foveation_options(params):
|
||||
mode = params.get("mode") or ""
|
||||
if mode not in ("", "tracked", "fixed", "off"):
|
||||
raise ValueError("Unknown foveation mode")
|
||||
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")
|
||||
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")
|
||||
test = params.get("test", False)
|
||||
if not isinstance(test, bool):
|
||||
raise ValueError("Foveation test mode must be a boolean")
|
||||
if (test or level) and mode not in ("tracked", "fixed"):
|
||||
if (test or radius) and mode not in ("tracked", "fixed"):
|
||||
raise ValueError("Choose Eye-tracked or Fixed before configuring foveation size or test mode")
|
||||
return mode, level, test
|
||||
return mode, radius, 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 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 "
|
||||
"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. "
|
||||
@@ -887,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("level", "str", "", "Runtime profile: lo, med, hi (empty = Default)"),
|
||||
Param("radius", "float", 0.0, "Full-resolution radius; 0 keeps the current runtime default", 0, 0.45),
|
||||
Param("test", "bool", False, "Darken lower-resolution regions (diagnostic)")]
|
||||
CHOICES = (("", "Default"), ("tracked", "Eye-tracked"),
|
||||
("fixed", "Fixed (doesn't follow the eyes)"), ("off", "Off"))
|
||||
# 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)"))
|
||||
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"))
|
||||
|
||||
def apply(self, ctx):
|
||||
from .frame.foveation import apply
|
||||
@@ -905,13 +868,11 @@ 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, level, test = foveation_options(ctx.params)
|
||||
ctx.env.pop("FOVE_INNER", None)
|
||||
ctx.env.pop("FOVE_OUTER", None)
|
||||
mode, radius, test = foveation_options(ctx.params)
|
||||
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", "FOVE_LEVEL",
|
||||
"LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER", "FOVE_INNER", "FOVE_OUTER",
|
||||
"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"):
|
||||
@@ -930,8 +891,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 level:
|
||||
ctx.env["FOVE_LEVEL"] = level
|
||||
if radius:
|
||||
ctx.env.update(FOVE_INNER=f"{radius:g}", FOVE_OUTER=f"{2 * radius:g}")
|
||||
if test:
|
||||
ctx.env["LEPTON_ENV_FRAMEPORT_FOVEATION_TEST"] = "1"
|
||||
|
||||
@@ -993,20 +954,16 @@ 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", "FOVE_LEVEL",
|
||||
"LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER", "VK_INSTANCE_LAYERS", "FOVE_INNER", "FOVE_OUTER",
|
||||
"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):
|
||||
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
|
||||
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")}
|
||||
|
||||
|
||||
def foveation_env(package, params, settings=None, baseline=None):
|
||||
|
||||
@@ -121,7 +121,6 @@ class FramePortApp:
|
||||
def __init__(self, page: ft.Page):
|
||||
from .views.library import load_filters
|
||||
|
||||
pop_dialog_skips_toasts()
|
||||
self.page = page
|
||||
self.target = None # FrameLeptonTarget when connected
|
||||
self.frame_info: dict | None = None
|
||||
@@ -2601,28 +2600,6 @@ class FramePortApp:
|
||||
"it.").format(title=game.get("title") or pkg), error=True,
|
||||
action=tr("Report a problem…"), on_action=lambda e: self.report_problem_dialog(pkg))
|
||||
|
||||
def _sync_save_snapshots(self) -> None:
|
||||
"""Connection/poll hook: disk and SSH work stay off rendering paths."""
|
||||
if getattr(self, "_save_snapshots_busy", False) or self.target is None:
|
||||
return
|
||||
target = self.target
|
||||
self._save_snapshots_busy = True
|
||||
|
||||
def work():
|
||||
from ..install import saves
|
||||
|
||||
try:
|
||||
saves.sync_snapshots(target.frame)
|
||||
self._save_snapshots_error = None
|
||||
except Exception as exc: # noqa: BLE001 - retry on the next connection poll
|
||||
applog.log.exception("syncing automatic save backups failed")
|
||||
if isinstance(exc, saves.SavesError) and str(exc) != getattr(self, "_save_snapshots_error", None):
|
||||
self._save_snapshots_error = str(exc)
|
||||
self.toast(tr("Couldn't sync save backups: {error}").format(error=str(exc)), error=True)
|
||||
finally:
|
||||
self._save_snapshots_busy = False
|
||||
self.run_bg(work)
|
||||
|
||||
def _check_sessions(self, info: dict | None) -> None:
|
||||
"""A FramePort game's play session ended since FramePort last looked (agent v70 `last_play`): fetch and triage
|
||||
its log on a background thread (pipeline.triage_session); the game page shows the result ("Last session")."""
|
||||
@@ -2776,7 +2753,6 @@ class FramePortApp:
|
||||
return False
|
||||
self.frame_info, self.frame_state = info, "connected"
|
||||
self._check_frame_restart(info)
|
||||
self._sync_save_snapshots()
|
||||
self._awake_at = 0.0 # the lock went away with the old connection's Frame session: take it again
|
||||
self.jobs.resume()
|
||||
self.toast(tr("Your Frame is back — continuing"))
|
||||
@@ -2852,7 +2828,6 @@ class FramePortApp:
|
||||
t.label = target.label
|
||||
save_target(target)
|
||||
old, self.target, self.frame_info, self.frame_state = self.target, t, info, "connected"
|
||||
self._sync_save_snapshots()
|
||||
self._check_frame_restart(info)
|
||||
self._remember_drives(t)
|
||||
if old is not None and old is not t and not self.jobs.current():
|
||||
@@ -2918,7 +2893,6 @@ class FramePortApp:
|
||||
changed = info.get("installed") != (self.frame_info or {}).get("installed") or \
|
||||
self.frame_state != "connected"
|
||||
self.frame_info, self.frame_state = info, "connected"
|
||||
self._sync_save_snapshots()
|
||||
self._check_frame_restart(info)
|
||||
self._check_sessions(info)
|
||||
if with_drives:
|
||||
@@ -3179,38 +3153,6 @@ def serialize_flet_updates() -> None:
|
||||
applog.log.warning("Flet's property writes couldn't be serialized (another Flet version?): %s", exc)
|
||||
|
||||
|
||||
def pop_dialog_skips_toasts() -> None:
|
||||
"""Make page.pop_dialog() close the topmost open pop-up, never a toast.
|
||||
|
||||
Flet 1.0 keeps toasts (SnackBars) in the same stack as dialogs and pop_dialog() closes the topmost open entry, so
|
||||
a toast that appeared while a pop-up was open was closed instead of the pop-up: an install link's question stayed
|
||||
on screen after "Download and install" (its job's "waiting for your answer" toast came just after it) while the
|
||||
download ran. Toasts close themselves or with their X. Hooks Flet internals like serialize_flet_updates: skipped
|
||||
(logged) if a Flet version moves them."""
|
||||
try:
|
||||
from flet.controls.base_page import BasePage
|
||||
|
||||
original_pop = BasePage.pop_dialog
|
||||
if getattr(original_pop, "_skips_toasts", False):
|
||||
return
|
||||
|
||||
def pop_dialog(self):
|
||||
try:
|
||||
shown = self._dialogs.controls # noqa: SLF001
|
||||
except AttributeError:
|
||||
return original_pop(self)
|
||||
dialog = next((d for d in reversed(shown) if d.open and not isinstance(d, ft.SnackBar)), None)
|
||||
if dialog is None:
|
||||
return None
|
||||
dialog.open = False
|
||||
dialog.update()
|
||||
return dialog
|
||||
pop_dialog._skips_toasts = True
|
||||
BasePage.pop_dialog = pop_dialog
|
||||
except (ImportError, AttributeError) as exc:
|
||||
applog.log.warning("pop_dialog() couldn't be kept off toasts (another Flet version?): %s", exc)
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
import sys
|
||||
|
||||
|
||||
@@ -687,11 +687,8 @@ def card(content: ft.Control, padding: int | None = None, bgcolor: str | None =
|
||||
|
||||
|
||||
def section(heading: str, *controls: ft.Control, subtitle: str | None = None,
|
||||
action: ft.Control | None = None, help: str | None = None, badge: ft.Control | None = None) -> ft.Column:
|
||||
title = with_help(h2(heading), help)
|
||||
if badge: # e.g. an "experimental" pill, right after the heading
|
||||
title = ft.Row([title, badge], spacing=T.S2, vertical_alignment=ft.CrossAxisAlignment.CENTER)
|
||||
head = ft.Row([ft.Column([title] + ([meta(subtitle)] if subtitle else []), spacing=T.px(2),
|
||||
action: ft.Control | None = None, help: str | None = None) -> ft.Column:
|
||||
head = ft.Row([ft.Column([with_help(h2(heading), help)] + ([meta(subtitle)] if subtitle else []), spacing=T.px(2),
|
||||
expand=True)]
|
||||
+ ([action] if action else []), vertical_alignment=ft.CrossAxisAlignment.CENTER)
|
||||
return ft.Column([head, *controls], spacing=T.S3)
|
||||
|
||||
@@ -268,12 +268,9 @@ class Updater:
|
||||
|
||||
def _restart_process(self) -> None:
|
||||
"""Source/wheel installs: start a fresh FramePort, then close this one."""
|
||||
# Windows: a hidden console (CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP), as the dev shortcut gives it.
|
||||
# DETACHED_PROCESS left it without one, so every console program it started (ssh, git) opened its own
|
||||
# visible terminal, and the Frame connection's ssh kept one open.
|
||||
subprocess.Popen([sys.executable, "-c", "from frameport.ui.app import main; main()"], close_fds=True,
|
||||
start_new_session=sys.platform != "win32",
|
||||
creationflags=0x08000000 | 0x00000200 if sys.platform == "win32" else 0)
|
||||
creationflags=0x00000008 if sys.platform == "win32" else 0)
|
||||
self._quit()
|
||||
|
||||
def _quit(self) -> None:
|
||||
|
||||
@@ -27,7 +27,6 @@ from ...patches.settings import (
|
||||
from .. import components as C
|
||||
from .. import theme as T
|
||||
from ..controllers import diagram, diagram_source
|
||||
from ..help import HELP
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..app import FramePortApp
|
||||
@@ -108,7 +107,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(level=env.get("FOVE_LEVEL") if env.get("FOVE_LEVEL") in ("lo", "med", "hi") else "",
|
||||
pref.update(radius=float(env.get("FOVE_INNER") or 0),
|
||||
test=env.get("LEPTON_ENV_FRAMEPORT_FOVEATION_TEST") == "1")
|
||||
_open(app, package, None, vals, pref)
|
||||
app.run_bg(load)
|
||||
@@ -134,23 +133,24 @@ def _open(app: FramePortApp, package: str, g: dict | None, values: dict, foveati
|
||||
|
||||
def foveation_change(key, value):
|
||||
foveation[key] = value
|
||||
for name in ("level", "test"):
|
||||
for name in ("radius", "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), ("level", Foveation.LEVEL_CHOICES), ("test", None))
|
||||
foveation_specs = (("mode", Foveation.CHOICES), ("radius", Foveation.RADIUS_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, ""))
|
||||
value = str(foveation.get(key, "")) if key == "mode" else f"{float(foveation.get(key) or 0):g}"
|
||||
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, e.control.value))
|
||||
on_select=lambda e, k=key: foveation_change(k, float(e.control.value) if k == "radius"
|
||||
else e.control.value))
|
||||
else:
|
||||
control = C.switch(value=bool(foveation.get(key)),
|
||||
on_change=lambda e: foveation_change("test", bool(e.control.value)))
|
||||
@@ -208,12 +208,8 @@ def _open(app: FramePortApp, package: str, g: dict | None, values: dict, foveati
|
||||
label = tr(ui["label"]) if ui.get("label") else tr(base.get(f"adapter.{key}").title)
|
||||
help_text = tr(ui["help"]) if ui.get("help") else tr(base.get(f"adapter.{key}").description)
|
||||
controls[key] = control_for(key)
|
||||
title = C.body(label, T.TEXT, weight=ft.FontWeight.W_500)
|
||||
if base.get(f"adapter.{key}").experimental:
|
||||
title = ft.Row([title, C.pill(tr("experimental"), T.WARN, tooltip=C.tip(HELP["experimental"]))],
|
||||
spacing=T.S2, wrap=True)
|
||||
line = ft.Row([
|
||||
ft.Column([title, C.meta(help_text, T.TEXT_2)],
|
||||
ft.Column([C.body(label, T.TEXT, weight=ft.FontWeight.W_500), C.meta(help_text, T.TEXT_2)],
|
||||
spacing=T.px(2), expand=True),
|
||||
controls[key]], spacing=T.S4, vertical_alignment=ft.CrossAxisAlignment.CENTER)
|
||||
rows[key] = ft.Container(ft.Column([line, controller_preview], spacing=T.S2)
|
||||
@@ -260,7 +256,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("level", None)
|
||||
foveation.pop("radius", None)
|
||||
foveation.pop("test", None)
|
||||
foveation_options(foveation)
|
||||
app.page.pop_dialog()
|
||||
|
||||
@@ -384,9 +384,8 @@ class FrameView:
|
||||
for _ in range(600): # up to 20 minutes
|
||||
if app._usb_setup is not token or app.route[0] != "frame":
|
||||
return
|
||||
# the Frame answering over the cable is what counts: this PC's address on it can be listed
|
||||
# differently (or not at all) by ipconfig, which kept the wait going forever (GitHub #398)
|
||||
if server_key(usb.FRAME_USB_IP, timeout=3):
|
||||
if usb.PC_USB_IP in usb.pc_usb_addresses(usb.FRAME_USB_IP) and server_key(usb.FRAME_USB_IP,
|
||||
timeout=3):
|
||||
break
|
||||
time.sleep(2)
|
||||
else:
|
||||
|
||||
@@ -169,10 +169,6 @@ class GameView:
|
||||
buttons.append(C.secondary(tr("Add videos"), ft.Icons.VIDEO_LIBRARY_OUTLINED,
|
||||
lambda e: app.go("files", pkg), False,
|
||||
tr("Upload videos into this player's storage on the Frame.")))
|
||||
if g.get("kind") not in ("rift", "linux") and app.frame_state == "connected" and \
|
||||
C.install_state(g, app.frame_info) in ("installed", "outdated"):
|
||||
buttons.append(C.secondary(tr("Back up saves"), ft.Icons.SAVE_ROUNDED,
|
||||
lambda e: app.backup_saves(pkg)))
|
||||
more = C.menu_button(C.menu_items(app.game_actions(pkg, quick=False)), icon=ft.Icons.MORE_HORIZ_ROUNDED,
|
||||
icon_color=T.TEXT_2, tooltip=tr("More actions"))
|
||||
# the same menu, opened from code (Library right-click → "More actions…", app.open_game_menu): a
|
||||
|
||||
@@ -30,8 +30,6 @@ def when(t: float) -> str:
|
||||
def backup_line(b: saves.Backup) -> str:
|
||||
""""12 files · 3.4 MB of saves · version 1.2" (+ large files left out)."""
|
||||
parts = [tr_n("{n} file", "{n} files", b.files), tr("{size} of saves").format(size=fmt_size(b.bytes))]
|
||||
if b.automatic:
|
||||
parts.append(tr("automatic"))
|
||||
if b.version:
|
||||
parts.append(tr("version {version}").format(version=b.version))
|
||||
if b.skipped:
|
||||
|
||||
@@ -14,7 +14,6 @@ from ...recommend import catalog
|
||||
from .. import components as C
|
||||
from .. import glyphs as G
|
||||
from .. import theme as T
|
||||
from ..help import HELP
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..app import FramePortApp
|
||||
@@ -295,40 +294,9 @@ class SettingsView:
|
||||
options=[ft.DropdownOption(str(n), str(n))
|
||||
for n in sorted({*saves.KEEP_CHOICES, saves.keep_count()})],
|
||||
on_select=changed)
|
||||
folder_label = C.meta(str(saves.root_dir()), selectable=True)
|
||||
|
||||
def choose_folder(folder):
|
||||
def work():
|
||||
try:
|
||||
dest = saves.set_folder(folder)
|
||||
folder_label.value = str(dest)
|
||||
C.update(folder_label)
|
||||
except saves.SavesError as exc:
|
||||
self.app.toast(str(exc), error=True)
|
||||
self.app.run_bg(work)
|
||||
|
||||
async def pick_folder(e):
|
||||
folder = await ft.FilePicker().get_directory_path(dialog_title=tr("Choose save backup folder"))
|
||||
if folder:
|
||||
choose_folder(folder)
|
||||
|
||||
def auto_changed(e):
|
||||
library.set_setting("saves.auto", bool(e.control.value))
|
||||
self.app._sync_save_snapshots()
|
||||
|
||||
return ft.Column([
|
||||
ft.Row([keep, C.help_icon("save_backups"),
|
||||
C.ghost(tr("Open save backups"), ft.Icons.FOLDER_OPEN_ROUNDED, open_root)],
|
||||
spacing=T.S2, wrap=True),
|
||||
folder_label,
|
||||
ft.Row([C.secondary(tr("Choose backup folder…"), ft.Icons.FOLDER_OPEN_ROUNDED, pick_folder),
|
||||
C.ghost(tr("Use the default"), ft.Icons.RESTORE_ROUNDED, lambda e: choose_folder(None))],
|
||||
spacing=T.S2, wrap=True),
|
||||
C.meta(tr("Existing backups stay in their original folder and remain available.")),
|
||||
C.switch(tr("Back up saves when a game closes"), value=bool(library.setting("saves.auto", False)),
|
||||
on_change=auto_changed),
|
||||
C.meta(tr("Keeps three snapshots per game on the Frame and copies new ones here when connected.")),
|
||||
], spacing=T.S2)
|
||||
return ft.Row([keep, C.help_icon("save_backups"),
|
||||
C.ghost(tr("Open save backups"), ft.Icons.FOLDER_OPEN_ROUNDED, open_root)],
|
||||
spacing=T.S2, wrap=True, vertical_alignment=ft.CrossAxisAlignment.CENTER)
|
||||
|
||||
def ssh_keys(self) -> ft.Control:
|
||||
"""Settings → Installing: private key files FramePort logs in with besides its own (frame.connection
|
||||
@@ -727,8 +695,7 @@ class SettingsView:
|
||||
help="library_folders"),
|
||||
"installing": C.section(tr("Installing"), C.card(self.installing(), padding=T.S4), help="launch_test"),
|
||||
"controllers": C.section(tr("Controllers"), C.card(self.controllers(), padding=T.S4),
|
||||
help="quest_buttons",
|
||||
badge=C.pill(tr("experimental"), T.WARN, tooltip=C.tip(HELP["experimental"]))),
|
||||
help="quest_buttons"),
|
||||
"tools": C.section(tr("Tools"), C.card(self.tools, padding=ft.Padding(T.S4, T.S2, T.S4, T.S2)),
|
||||
subtitle=tr("FramePort keeps its own copies; nothing is installed system-wide"),
|
||||
action=ft.Row([C.ghost(tr("Update tools"), ft.Icons.UPDATE_ROUNDED,
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
// 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");
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
// 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,¬e,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");
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
// 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");
|
||||
}
|
||||
@@ -1596,7 +1596,7 @@ def test_second_launch_while_starting_is_ignored(monkeypatch, tmp_path):
|
||||
text = a.LAUNCH_SH.format(title="T", pkg="com.x.y", app_dir=f"app_dir={base}", appid=1, lepton_q=str(lepton),
|
||||
extra_env="", cloud_dirs="true",
|
||||
watchdog=a.WATCHDOG, dashboard="true", logcat="true", single=a.SINGLE_LINE,
|
||||
plays_start="true", plays_end="true", save_snapshot="true", video_codec="",
|
||||
plays_start="true", plays_end="true", video_codec="",
|
||||
restart=a.restart_block("com.x.y", str(lepton)))
|
||||
launcher = tmp_path / "launch.sh"
|
||||
launcher.write_text(text)
|
||||
@@ -2087,8 +2087,7 @@ def test_launcher_starts_lepton_again_once_when_the_game_restarts_itself(monkeyp
|
||||
appid=2821789967, lepton_q=str(lepton), extra_env="", cloud_dirs="true",
|
||||
watchdog=a.WATCHDOG, dashboard="true",
|
||||
logcat="true", single=a.SINGLE_LINE, plays_start="true", plays_end="true",
|
||||
save_snapshot="true", video_codec="",
|
||||
restart=a.restart_block("com.Armature.SportsScramble", str(lepton)))
|
||||
video_codec="", restart=a.restart_block("com.Armature.SportsScramble", str(lepton)))
|
||||
text = text.replace("python3 " + os.path.abspath(a.__file__) + " _dashboard_worker", "true")
|
||||
launcher = tmp_path / "launch.sh"
|
||||
launcher.write_text(text)
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
"""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}
|
||||
@@ -34,21 +34,6 @@ def test_link_forms_name_the_manifest(link):
|
||||
assert deeplink.parse(link).manifest_url == MANIFEST
|
||||
|
||||
|
||||
def test_github_file_pages_become_raw_addresses():
|
||||
raw = "https://raw.githubusercontent.com/o/r/main/dir/game.json"
|
||||
for page in ("https://github.com/o/r/blob/main/dir/game.json", "https://github.com/o/r/raw/main/dir/game.json"):
|
||||
assert deeplink.raw_github_url(page) == raw
|
||||
assert deeplink.parse(page).manifest_url == raw
|
||||
assert deeplink.parse(f"https://frameport.app/install?manifest={quote(page, safe='')}").manifest_url == raw
|
||||
apk = "https://github.com/o/r/blob/v2/Game.apk"
|
||||
assert deeplink.parse(f"frameport://install?url={quote(apk, safe='')}").file_url == \
|
||||
"https://raw.githubusercontent.com/o/r/v2/Game.apk"
|
||||
# release downloads, raw addresses and other hosts stay as they are
|
||||
for other in ("https://github.com/o/r/releases/latest/download/game.json", raw,
|
||||
"https://example.com/o/r/blob/main/game.json"):
|
||||
assert deeplink.raw_github_url(other) == other
|
||||
|
||||
|
||||
def test_direct_file_links():
|
||||
url = "https://github.com/x/y/releases/download/v1/Game-arm64.apk"
|
||||
assert deeplink.parse(f"framedrop://install?url={quote(url, safe='')}").file_url == url
|
||||
|
||||
@@ -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_LEVEL"] == "lo"
|
||||
assert context({"mode": "tracked", "level": "hi"}).env["FOVE_LEVEL"] == "hi"
|
||||
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": "fixed"}).env["FDM_DEBUG"] == "enable,disable_offsets"
|
||||
assert context({"mode": "off"}).env == {
|
||||
"VK_INSTANCE_LAYERS": "", "LEPTON_ENV_DISABLE_VULKAN_FDM_INJECTION_LAYER": "1"}
|
||||
@@ -57,8 +57,9 @@ 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", "level": "1"}, {"mode": "tracked", "level": 2},
|
||||
{"mode": "off", "level": "lo"}, {"mode": "tracked", "test": "false"}])
|
||||
{"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"}])
|
||||
def test_invalid_configuration_refused(params):
|
||||
with pytest.raises(ValueError):
|
||||
foveation_options(params)
|
||||
|
||||
@@ -87,11 +87,10 @@ 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_LEVEL"] == "hi"
|
||||
assert env["FOVE_INNER"] is None and env["FOVE_OUTER"] is None
|
||||
assert env["FOVE_INNER"] == "0.2" and env["FOVE_OUTER"] == "0.4"
|
||||
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_LEVEL"] is None and off["LEPTON_ENV_FRAMEPORT_FOVEATION_TEST"] is None
|
||||
assert off["FOVE_INNER"] is None and off["LEPTON_ENV_FRAMEPORT_FOVEATION_TEST"] is None
|
||||
|
||||
|
||||
def test_resolution_label_explains_actual_effect():
|
||||
@@ -130,9 +129,8 @@ 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 == "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")))
|
||||
any(o.key == "0.3" for o in c.options))
|
||||
radius.on_select(SimpleNamespace(control=SimpleNamespace(value="0.3")))
|
||||
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))
|
||||
@@ -147,7 +145,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", "level": "med", "test": True}
|
||||
assert saved["foveation"] == {"mode": "fixed", "radius": .3, "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
|
||||
@@ -162,42 +160,3 @@ 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}]
|
||||
@@ -189,22 +189,6 @@ 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
|
||||
|
||||
|
||||
@@ -55,24 +55,6 @@ int main(void) {
|
||||
CHECK(lm_glcube_lookup(lm_glcube_dir(f, u, v), &s, &t) == f);
|
||||
CHECK(NEAR(s, (u + 1) / 2) && NEAR(t, (v + 1) / 2));
|
||||
}
|
||||
// Cube layer quads: GL image s/t basis, inward normals, rotated layer, mip-0 face order.
|
||||
for (int f = 0; f < 6; ++f) {
|
||||
XrQuaternionf rotation = lm_axis_angle(0, 1, 0, 0.71f);
|
||||
XrPosef p = lm_cube_quad_pose(rotation, f, 50);
|
||||
XrVector3f axis = lm_rotate(rotation, lm_glcube_dir(f, 0, 0));
|
||||
CHECK(VNEAR(p.position, 50 * axis.x, 50 * axis.y, 50 * axis.z));
|
||||
XrVector3f normal = lm_rotate(p.orientation, (XrVector3f){0, 0, 1});
|
||||
CHECK(VNEAR(normal, -axis.x, -axis.y, -axis.z));
|
||||
for (int x = -1; x <= 1; ++x) for (int y = -1; y <= 1; ++y) {
|
||||
XrVector3f offset = lm_rotate(p.orientation, (XrVector3f){x, y, 0});
|
||||
XrVector3f expected = lm_rotate(rotation, lm_glcube_dir(f, x, y));
|
||||
CHECK(VNEAR(expected, axis.x + offset.x, axis.y + offset.y, axis.z + offset.z));
|
||||
}
|
||||
// Vulkan reverses the image rows: source t = 1 - destination v, for the identical GL pose.
|
||||
float s, t;
|
||||
XrVector3f d = lm_glcube_dir(f, 0.4f, -0.6f);
|
||||
CHECK(lm_glcube_lookup(d, &s, &t) == f && NEAR(s, 0.7f) && NEAR(t, 0.2f));
|
||||
}
|
||||
// equirect2: full sphere, image centre (u 0.5) straight ahead (-Z), +X to the right, v 1 at the top
|
||||
float u, v;
|
||||
CHECK(lm_equirect2_uv((XrVector3f){0, 0, -1}, 2 * LM_PI, LM_PI / 2, -LM_PI / 2, &u, &v)
|
||||
|
||||
@@ -192,16 +192,6 @@ def test_controller_models_setting():
|
||||
assert "controller_models" not in adapter_settings({}) # off unless selected: existing builds are unchanged
|
||||
|
||||
|
||||
def test_cube_quads_applies_like_cube_standin():
|
||||
quads = base.get("adapter.cube_quads")
|
||||
standin = base.get("adapter.cube_standin")
|
||||
assert quads.default == 1
|
||||
for analysis in (_analysis(), _analysis(graphics="GLES or unknown (no Vulkan declaration)"),
|
||||
_analysis(abis=["armeabi-v7a"])):
|
||||
assert quads.applies(analysis) == standin.applies(analysis)
|
||||
assert adapter_settings({"adapter.cube_quads": {"value": "0"}})["cube_quads"] == 0
|
||||
|
||||
|
||||
def test_equirect_emul_setting():
|
||||
patch = base.get("adapter.equirect_emul")
|
||||
gles = dict(graphics="GLES or unknown (no Vulkan declaration)")
|
||||
@@ -708,10 +698,8 @@ def test_explicit_eye_tracked_foveation_enables_injection_without_debug_spam():
|
||||
env = install_context(r).env
|
||||
assert env["ENABLE_VULKAN_FDM_INJECTION_LAYER"] == "1"
|
||||
assert env["FDM_DEBUG"] == "enable" # no frozen gaze or per-frame logging
|
||||
assert "FOVE_LEVEL" not in env # Valve's layer ignores numbers; the size comes from the level choice (#394)
|
||||
assert env["FOVE_LEVEL"] == "2" # retain independently configured quality
|
||||
assert "VK_INSTANCE_LAYERS" not in env # keep Steam's other layers
|
||||
r.patches["device.foveation"]["level"] = "med"
|
||||
assert install_context(r).env["FOVE_LEVEL"] == "med"
|
||||
assert install_context(Recipe("com.x.game", patches={"device.foveation": {"mode": ""}})).env == {}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ static int foveation_eye_enabled, foveation_eye, foveation_fix, surface_emul, ru
|
||||
static int no_equirect, no_equirect2, no_cylinder, no_cube, fb_color_space, emulate_color_space;
|
||||
static void *android_vm;
|
||||
static void mx_audio_initialize(void) {}
|
||||
static void mx_batman_geometry_initialize(void) {}
|
||||
static int is_scene_extension(const char *name) { (void)name; return 0; }
|
||||
#include "hide_fb_foveation.h"
|
||||
#include "quest_buttons.c"
|
||||
|
||||
@@ -202,95 +202,3 @@ def test_bad_package_names_never_make_paths():
|
||||
with pytest.raises(ValueError):
|
||||
saves.backups_dir("../../etc")
|
||||
assert saves.has_backups("../x") is False
|
||||
|
||||
|
||||
def test_folder_choice_preserves_old_backups_and_prunes_only_destination(tmp_path):
|
||||
old = _fake_backup(PKG)
|
||||
cloud = tmp_path / "cloud"
|
||||
assert saves.set_folder(str(cloud)) == cloud
|
||||
assert saves.root_dir() == cloud
|
||||
assert saves.list_backups(PKG)[0].path == old
|
||||
for i in range(3):
|
||||
_fake_backup(PKG, created=time.time() + i, name=f"20261017-12000{i}.tar.gz")
|
||||
assert len(saves.prune(PKG, keep=1)) == 2
|
||||
assert old.exists()
|
||||
custom = saves.list_backups(PKG)[0].path
|
||||
saves.set_folder(None)
|
||||
assert saves.root_dir() == saves.default_root()
|
||||
assert {b.path for b in saves.list_backups(PKG)} == {old, custom}
|
||||
|
||||
|
||||
def test_unwritable_folder_refuses_setting_and_backup(tmp_path, monkeypatch):
|
||||
def refused(*args, **kwargs):
|
||||
raise PermissionError("read-only cloud folder")
|
||||
|
||||
monkeypatch.setattr(saves.tempfile, "TemporaryFile", refused)
|
||||
original = saves.root_dir()
|
||||
with pytest.raises(saves.SavesError, match="Cannot write save backups.*read-only"):
|
||||
saves.set_folder(str(tmp_path / "cloud"))
|
||||
assert saves.root_dir() == original
|
||||
with pytest.raises(saves.SavesError, match="Cannot write save backups"):
|
||||
saves.backup(object(), PKG) # refusal before contacting the Frame
|
||||
|
||||
|
||||
def test_pc_imports_snapshots_once_and_prunes_as_normal_backups(frame):
|
||||
fr, anchor, internal, external, tmp = frame
|
||||
library.set_setting("saves.auto", True)
|
||||
library.set_setting("saves.keep", 2)
|
||||
for n in range(4):
|
||||
(internal / "files/slot.sav").write_text(f"level {n}")
|
||||
p = subprocess.run([sys.executable, str(AGENT), "_saves_ns", "snapshot",
|
||||
json.dumps({"package": PKG})], env=fr.env, capture_output=True, text=True)
|
||||
assert p.returncode == 0, p.stderr
|
||||
assert len(fr.agent("save_snapshots")["snapshots"]) == 3
|
||||
assert saves.sync_snapshots(fr) == 3
|
||||
found = saves.list_backups(PKG)
|
||||
assert len(found) == 2 and all(b.automatic for b in found)
|
||||
assert all(saves.read_manifest(b.path)["automatic"] for b in found)
|
||||
assert saves.sync_snapshots(fr) == 0 # including the snapshot PC retention already pruned
|
||||
saves.delete(found[0])
|
||||
assert saves.sync_snapshots(fr) == 0
|
||||
assert fr.agent("save_snapshot_settings", enabled=False) == {"enabled": False}
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.name == "nt", reason="SteamOS launcher uses bash and flock")
|
||||
def test_launcher_snapshot_uses_inherited_lock_and_default_is_off(frame):
|
||||
import fcntl
|
||||
import shlex
|
||||
|
||||
fr, anchor, internal, external, tmp = frame
|
||||
cmd = (f'exec 9>{shlex.quote(str(anchor / ".launch.lock"))}; flock -n 9; '
|
||||
f'timeout -k 5 90 {shlex.quote(sys.executable)} {shlex.quote(str(AGENT))} _snapshot_close {PKG}')
|
||||
p = subprocess.run(["bash", "-c", cmd], env=fr.env, capture_output=True, text=True)
|
||||
assert p.returncode == 0, p.stderr
|
||||
assert fr.agent("save_snapshots")["snapshots"] == []
|
||||
fr.agent("save_snapshot_settings", enabled=True)
|
||||
with open(anchor / ".launch.lock", "w") as lock:
|
||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
blocked = subprocess.run(["bash", "-c", cmd], env=fr.env, capture_output=True, text=True)
|
||||
assert blocked.returncode != 0
|
||||
assert fr.agent("save_snapshots")["snapshots"] == []
|
||||
p = subprocess.run(["bash", "-c", cmd], env=fr.env, capture_output=True, text=True)
|
||||
assert p.returncode == 0, p.stderr
|
||||
assert len(fr.agent("save_snapshots")["snapshots"]) == 1
|
||||
assert saves.sync_snapshots(fr) == 1
|
||||
|
||||
|
||||
def test_snapshot_hash_failure_retries_and_old_import_obeys_retention(frame):
|
||||
fr, anchor, internal, external, tmp = frame
|
||||
p = subprocess.run([sys.executable, str(AGENT), "_saves_ns", "snapshot", json.dumps({"package": PKG})],
|
||||
env=fr.env, capture_output=True, text=True)
|
||||
assert p.returncode == 0, p.stderr
|
||||
item = fr.agent("save_snapshots")["snapshots"][0]
|
||||
remote = fr.home / ".local/share/frameport/save-snapshots" / PKG / item["snapshot"]
|
||||
good = remote.read_bytes()
|
||||
remote.write_bytes(b"damaged")
|
||||
with pytest.raises(saves.SavesError, match="hash mismatch"):
|
||||
saves.sync_snapshots(fr)
|
||||
assert not saves.list_backups(PKG) and not list(saves.backups_dir(PKG).glob("*.part"))
|
||||
remote.write_bytes(good)
|
||||
newer = _fake_backup(PKG, created=time.time() + 1000)
|
||||
library.set_setting("saves.keep", 1)
|
||||
assert saves.sync_snapshots(fr) == 1
|
||||
assert [b.path for b in saves.list_backups(PKG)] == [newer]
|
||||
assert saves.sync_snapshots(fr) == 0
|
||||
@@ -321,58 +321,3 @@ def test_namespace_handoff_runs_the_agent_in_podman_unshare(game, monkeypatch):
|
||||
assert seen["cmd"][:2] == ["podman", "unshare"] and seen["cmd"][3:5] == [str(AGENT), "_saves_ns"]
|
||||
assert seen["cmd"][5] == "backup" and json.loads(seen["cmd"][6]) == {"package": PKG}
|
||||
assert seen["ns"] == "1"
|
||||
|
||||
|
||||
def test_snapshots_create_and_skip_unchanged(game, monkeypatch):
|
||||
a, anchor, internal, external = game
|
||||
a.cmd_save_snapshot_settings({"enabled": True})
|
||||
assert a.create_save_snapshot(PKG)["created"]
|
||||
first = a.snapshot_files(PKG)
|
||||
monkeypatch.setattr(a, "write_saves_tar", lambda *args, **kwargs: pytest.fail("unchanged saves compressed"))
|
||||
assert a.create_save_snapshot(PKG) == {"created": False, "reason": "unchanged"}
|
||||
assert a.snapshot_files(PKG) == first
|
||||
|
||||
|
||||
def test_snapshot_pruning_and_size_limit(game, monkeypatch):
|
||||
a, anchor, internal, external = game
|
||||
for i in range(5):
|
||||
write(external / "files/SaveData.es3", f"save {i}")
|
||||
assert a.create_save_snapshot(PKG)["created"]
|
||||
paths = a.snapshot_files(PKG)
|
||||
assert len(paths) == 3
|
||||
assert len(list(Path(a.SNAPSHOT_ROOT).rglob("*.tar.gz.json"))) == 3
|
||||
manifest = manifest_of(Path(paths[0]).read_bytes())
|
||||
assert manifest["automatic"] and manifest["package"] == PKG
|
||||
monkeypatch.setattr(a, "SAVES_MAX_TOTAL", 1)
|
||||
with pytest.raises(a.AgentError, match="size limit"):
|
||||
a.create_save_snapshot(PKG)
|
||||
assert a.snapshot_files(PKG) == paths
|
||||
monkeypatch.setattr(a, "container_running", lambda _: True)
|
||||
with pytest.raises(a.AgentError, match="running"):
|
||||
a.create_save_snapshot(PKG)
|
||||
|
||||
|
||||
def test_snapshot_requires_launch_lock_and_fetch_rejects_paths(game):
|
||||
a, anchor, internal, external = game
|
||||
a.cmd_save_snapshot_settings({"enabled": True})
|
||||
with pytest.raises((OSError, a.AgentError)):
|
||||
a.snapshot_close(PKG)
|
||||
out, err = io.BytesIO(), io.StringIO()
|
||||
assert a.fetch_save_snapshot({"package": PKG, "snapshot": "../../bad"}, out, err) == 1
|
||||
assert not out.getvalue() and "invalid" in err.getvalue()
|
||||
|
||||
|
||||
def test_snapshot_launcher_template_and_upgrade(game):
|
||||
a, anchor, internal, external = game
|
||||
a.write_launcher(str(anchor), str(anchor), PKG, "Example", 123, "/usr/bin/lepton", {})
|
||||
path = anchor / "launch.sh"
|
||||
text = path.read_text()
|
||||
assert text.count("_snapshot_close") == 1
|
||||
assert "timeout -k 5 90" in text
|
||||
assert text.index("podman kill") < text.index("_snapshot_close")
|
||||
path.write_text("\n".join(line for line in text.splitlines() if "_snapshot_close" not in line) + "\n")
|
||||
assert PKG in a.upgrade_launchers()
|
||||
upgraded = path.read_text()
|
||||
assert upgraded.count("_snapshot_close") == 1
|
||||
a.upgrade_launchers()
|
||||
assert path.read_text() == upgraded
|
||||
@@ -1,78 +0,0 @@
|
||||
"""Save controls built headlessly: eligibility and dispatch, without starting Flet."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
from frameport.ui import components as C
|
||||
from frameport.ui.views.game import GameView
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind,connected,state,visible", [
|
||||
(None, True, "installed", True),
|
||||
(None, True, "outdated", True),
|
||||
(None, True, "missing", False),
|
||||
(None, False, "installed", False),
|
||||
("rift", True, "installed", False),
|
||||
("linux", True, "installed", False),
|
||||
])
|
||||
def test_game_backup_action(kind, connected, state, visible, monkeypatch):
|
||||
clicked = []
|
||||
app = SimpleNamespace(
|
||||
jobs=SimpleNamespace(busy_with=lambda _: None),
|
||||
frame_state="connected" if connected else "offline", frame_info={},
|
||||
play_options=lambda _: [], install_options=lambda _: [], game_actions=lambda *a, **kw: [],
|
||||
backup_saves=clicked.append,
|
||||
)
|
||||
view = GameView.__new__(GameView)
|
||||
view.app, view.g, view.package = app, {"package": "com.example.game", "kind": kind}, "com.example.game"
|
||||
monkeypatch.setattr(C, "install_state", lambda *args: state)
|
||||
monkeypatch.setattr(C, "is_media_player", lambda _: False)
|
||||
buttons = []
|
||||
original = C.secondary
|
||||
|
||||
def capture(label, icon=None, on_click=None, *args, **kwargs):
|
||||
buttons.append((label, on_click))
|
||||
return original(label, icon, on_click, *args, **kwargs)
|
||||
|
||||
monkeypatch.setattr(C, "secondary", capture)
|
||||
view.actions()
|
||||
backup = [fn for label, fn in buttons if label == "Back up saves"]
|
||||
assert bool(backup) == visible
|
||||
if visible:
|
||||
backup[0](None)
|
||||
assert clicked == [view.package]
|
||||
|
||||
|
||||
def test_settings_picker_is_awaited_and_reset_preserves_backups(tmp_path, monkeypatch):
|
||||
import asyncio
|
||||
|
||||
import flet as ft
|
||||
|
||||
from frameport.core import library
|
||||
from frameport.install import saves
|
||||
from frameport.ui.views.settings import SettingsView
|
||||
|
||||
cloud = tmp_path / "cloud"
|
||||
calls = []
|
||||
|
||||
class Picker:
|
||||
async def get_directory_path(self, **kwargs):
|
||||
calls.append("awaited")
|
||||
return str(cloud)
|
||||
|
||||
monkeypatch.setattr(ft, "FilePicker", Picker)
|
||||
app = SimpleNamespace(run_bg=lambda fn: fn(), toast=lambda *a, **kw: pytest.fail(str(a)),
|
||||
_sync_save_snapshots=lambda: calls.append("sync"))
|
||||
view = SettingsView(app)
|
||||
control = view.save_backups()
|
||||
folder_row = control.controls[2]
|
||||
asyncio.run(folder_row.controls[0].on_click(None))
|
||||
assert calls == ["awaited"] and saves.root_dir() == cloud
|
||||
folder_row.controls[1].on_click(None)
|
||||
assert saves.root_dir() == saves.default_root()
|
||||
assert cloud.exists()
|
||||
assert library.setting("saves.auto", False) is False
|
||||
switch = control.controls[4].controls[0].controls[1]
|
||||
switch.value = True
|
||||
switch.on_change(SimpleNamespace(control=switch))
|
||||
assert library.setting("saves.auto") is True and calls[-1] == "sync"
|
||||
@@ -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_for("com.example.other") == 2
|
||||
assert get("frame.adapter").revision == 2 and not get("frame.adapter").package_revisions
|
||||
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"),
|
||||
|
||||
@@ -378,21 +378,6 @@ def test_cube_standin_is_a_default_on_adapter_setting():
|
||||
assert [s[2] for s in SETTINGS if s[0] == "cube_standin"] == [1]
|
||||
|
||||
|
||||
def test_cube_quads_setting_and_artifacts():
|
||||
from frameport.patches.frame import artifact
|
||||
from frameport.patches.frame.adapter import settings_text
|
||||
from frameport.patches.settings import SETTINGS, UI
|
||||
|
||||
assert [s[2] for s in SETTINGS if s[0] == "cube_quads"] == [1]
|
||||
assert UI["cube_quads"]["control"] == ("switch",)
|
||||
assert b"cube_quads=1\n" in settings_text({"adapter.cube_quads": {}})
|
||||
assert b"cube_quads=0\n" in settings_text({"adapter.cube_quads": {"value": 0}})
|
||||
for abi in ("arm64-v8a", "armeabi-v7a"):
|
||||
data = artifact(abi, "libopenxr_loader_generic.so")
|
||||
assert b"cube_quads=%f" in data
|
||||
assert b"cube_quads: submitting cube as six quads" in data
|
||||
|
||||
|
||||
def test_unity_pcvr_signatures():
|
||||
"""Unity's Player.log in a PC VR launch log (agent v67): VR start-up failures and Unity's crash handler."""
|
||||
log = ("===== unity log compatdata/pfx/drive_c/users/steamuser/AppData/LocalLow/SUPERHOT Team/SUPERHOT VR/"
|
||||
|
||||
@@ -582,34 +582,6 @@ def test_serialize_survives_moved_flet_internals(monkeypatch, caplog):
|
||||
Session.patch_control, value_types.Prop.__set__ = original, original_set
|
||||
|
||||
|
||||
def test_pop_dialog_closes_the_dialog_not_a_toast(monkeypatch):
|
||||
"""An install link's question stayed open after "Download and install": its job's toast had appeared above it and
|
||||
page.pop_dialog() closed the toast instead."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
import flet as ft
|
||||
from flet.controls.base_page import BasePage
|
||||
|
||||
from frameport.ui import app
|
||||
|
||||
monkeypatch.setattr(BasePage, "pop_dialog", BasePage.pop_dialog) # restored after the test
|
||||
app.pop_dialog_skips_toasts()
|
||||
app.pop_dialog_skips_toasts() # idempotent
|
||||
|
||||
class Dialog(ft.AlertDialog):
|
||||
def update(self): # (not on a page)
|
||||
pass
|
||||
|
||||
class Toast(ft.SnackBar):
|
||||
def update(self):
|
||||
pass
|
||||
dialog, toast = Dialog(open=True), Toast(ft.Text("waiting for your answer"), open=True)
|
||||
page = SimpleNamespace(_dialogs=SimpleNamespace(controls=[dialog, toast]))
|
||||
assert BasePage.pop_dialog(page) is dialog
|
||||
assert not dialog.open and toast.open
|
||||
assert BasePage.pop_dialog(page) is None # only a toast left: nothing to close
|
||||
|
||||
|
||||
def test_property_writes_wait_for_a_patch_being_packed():
|
||||
"""A property set on a background thread (the live Frame card, job progress) while the event loop packs a patch
|
||||
changed the control's _values mid-iteration: "dictionary changed size during iteration" killed the update (a
|
||||
|
||||
@@ -64,9 +64,6 @@ 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):
|
||||
|
||||
@@ -421,17 +421,3 @@ def test_relaunch_environment_drops_the_running_apps_own_variables():
|
||||
"SERIOUS_PYTHON_SITE_PACKAGES": "x", "PYTHONHOME": "C:/Temp/serious_python_temp",
|
||||
"PYTHONPATH": "y", "USERPROFILE": "C:/Users/u", "PSModulePath": "z"})
|
||||
assert env == {"PATH": "/bin", "USERPROFILE": "C:/Users/u", "PSModulePath": "z"}
|
||||
|
||||
|
||||
def test_source_restart_keeps_a_hidden_console_on_windows(monkeypatch):
|
||||
"""DETACHED_PROCESS gave every console child (ssh) of a restarted dev install its own visible terminal."""
|
||||
from frameport.ui import updater
|
||||
|
||||
calls = []
|
||||
monkeypatch.setattr(updater.sys, "platform", "win32")
|
||||
monkeypatch.setattr(updater.subprocess, "Popen", lambda cmd, **k: calls.append(k))
|
||||
u = updater.Updater.__new__(updater.Updater)
|
||||
monkeypatch.setattr(u, "_quit", lambda: None, raising=False)
|
||||
u._restart_process()
|
||||
flags = calls[0]["creationflags"]
|
||||
assert flags & 0x08000000 and not flags & 0x00000008 # CREATE_NO_WINDOW, not DETACHED_PROCESS
|
||||
@@ -18,14 +18,6 @@ def test_pc_usb_addresses_ignores_broadcast(monkeypatch):
|
||||
assert usb.pc_usb_addresses("10.86.200.233") == ["10.86.200.234"]
|
||||
|
||||
|
||||
def test_pc_usb_addresses_runs_without_a_window_on_windows(monkeypatch):
|
||||
calls = []
|
||||
monkeypatch.setattr(usb.sys, "platform", "win32")
|
||||
monkeypatch.setattr(usb.subprocess, "run", lambda cmd, **k: calls.append(k) or SimpleNamespace(stdout=""))
|
||||
usb.pc_usb_addresses("10.86.200.233")
|
||||
assert calls and all(k.get("creationflags") == 0x08000000 for k in calls)
|
||||
|
||||
|
||||
def test_check_reports_missing_usb_link():
|
||||
frame = SimpleNamespace(agent=lambda cmd, **k: {"present": False})
|
||||
out = usb.check(frame)
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
"""vk_no_fossilize / vk_pipeline_fallback (GitHub #349): the Vulkan shim leaves Lepton's Fossilize layer out and
|
||||
creates pipelines the driver refuses with blank shaders."""
|
||||
import re
|
||||
import shutil
|
||||
import struct
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
|
||||
from frameport.patches import base
|
||||
from frameport.patches.settings import UI
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("key", ["vk_no_fossilize", "vk_pipeline_fallback"])
|
||||
def test_settings_registered_off_by_default(key):
|
||||
base.load_all()
|
||||
p = base.REGISTRY[f"adapter.{key}"]
|
||||
assert p.category == "adapter" and p.default == 0 and not p.default_on
|
||||
assert UI[key]["group"] == "troubleshooting"
|
||||
|
||||
|
||||
def test_artifact_reads_the_settings():
|
||||
so = (ROOT / "artifacts/arm64-v8a/libfp_vk.so").read_bytes()
|
||||
for s in (b"vk_no_fossilize=", b"vk_pipeline_fallback=", b"VK_LAYER_fossilize", b"retried with a blank",
|
||||
b"_ZN7android11GraphicsEnv14setDebugLayers"):
|
||||
assert s in so
|
||||
|
||||
|
||||
def _blank_shaders():
|
||||
src = (ROOT / "native/vkshim/vkshim.c").read_text()
|
||||
out = {}
|
||||
for name in ("FS", "VS"):
|
||||
body = re.search(rf"FALLBACK_{name}\[\] = \{{(.*?)\}};", src, re.S).group(1)
|
||||
words = [int(w, 16) for w in re.findall(r"0x[0-9a-f]{8}", body)]
|
||||
out[name] = struct.pack(f"<{len(words)}I", *words)
|
||||
return out
|
||||
|
||||
|
||||
def test_blank_shaders_are_valid_spirv(tmp_path):
|
||||
shaders = _blank_shaders()
|
||||
assert all(b[:4] == b"\x03\x02\x23\x07" for b in shaders.values())
|
||||
if not shutil.which("spirv-val"):
|
||||
pytest.skip("needs spirv-val")
|
||||
for name, data in shaders.items():
|
||||
f = tmp_path / f"{name}.spv"
|
||||
f.write_bytes(data)
|
||||
subprocess.run(["spirv-val", "--target-env", "vulkan1.0", str(f)], check=True)
|
||||
|
||||
|
||||
def test_triage_suggests_both_settings():
|
||||
rules = yaml.safe_load((ROOT / "catalog/triage.yaml").read_text())
|
||||
rules = rules.get("signatures", rules) if isinstance(rules, dict) else rules
|
||||
rule = next(r for r in rules if r["id"] == "vulkan-pipeline-refused")
|
||||
pat = re.compile(rule["pattern"])
|
||||
assert pat.search("E UE4: Shader compilation failures are Fatal.")
|
||||
assert pat.search("I FrameBridge: vk shim: vkCreateGraphicsPipelines failed: -1 (1 pipeline(s); failure 2)")
|
||||
assert not pat.search("I FrameBridge: vk shim: vkCreateGraphicsPipelines failed: 1000297000 (1 pipeline(s))")
|
||||
assert set(rule["suggest"]) == {"adapter.vk_no_fossilize", "adapter.vk_pipeline_fallback"}
|
||||