mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-24 19:01:43 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93689ec871 |
No files matched your search
@@ -41,10 +41,6 @@ jobs:
|
||||
python -m py_compile $(find frame/devkit-utils -type f ! -name '*.*' ! -name LICENSE) frame/devkit-utils/devkit_utils/*.py
|
||||
- name: Server tests
|
||||
run: python -m unittest discover -s tests -v
|
||||
- name: Linux Wireless Adapter doctor (read-only PC smoke)
|
||||
run: |
|
||||
python ui/frame_wireless_doctor.py --json > "$RUNNER_TEMP/linux-wireless-doctor.json"
|
||||
python -c 'import json, os; from pathlib import Path; d=json.loads((Path(os.environ["RUNNER_TEMP"]) / "linux-wireless-doctor.json").read_text()); assert d["supported"] and d["selected"] is None and d["schema"] == 1'
|
||||
- name: App syntax
|
||||
run: node --check app/main.js && node --check app/build/make-icon.js && node --check app/build/fetch-deps.js && node --check app/preload.js && node --check app/install-link.js && node --check app/updater.js
|
||||
- name: App tests
|
||||
|
||||
@@ -2,53 +2,6 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Add a Linux PC Wireless Adapter doctor in Settings and Devices, with a source
|
||||
CLI and local JSON report. Select observed hardware without assuming Valve
|
||||
IDs; inspect USB/interface presence, driver/module binding, udev/permissions,
|
||||
rfkill, channel/band and network manager evidence. Missing evidence stays
|
||||
unknown; all checks are read-only and never contact the Frame.
|
||||
[Usage and verification limits](docs/linux-wireless-adapter-doctor.md).
|
||||
|
||||
- Add Linux Tools → Steam desktop sharing: request `steam -pipewire` only after
|
||||
checking Steam is not running, or open KDE Application Permissions with
|
||||
instructions to revoke a verified Steam screen-sharing session manually. No
|
||||
automatic permission reset, Steam restart, or headset access. Frame Control
|
||||
Linux capture remains disabled; live portal behavior is unverified.
|
||||
[Usage and limits](docs/steam-pipewire.md).
|
||||
|
||||
- Use gamescope's input for the keyboard and trackpad, following the focused
|
||||
headset panel without installing an input service. Start KDE Connect only for
|
||||
accents and emoji, keeping queued text ordered and cancelling it on headset
|
||||
switches. Retain intended-headset checks before starting either control and
|
||||
prevent Unicode helper startup from deadlocking with a headset switch.
|
||||
- Keep accepted keyboard text when the Unicode queue is full: reject new batches
|
||||
before sending their clicks or keys, and count in-flight text toward the limit.
|
||||
Retain unsent text after helper failures/timeouts, report the error and resume
|
||||
it with Try again. Clean up failed workers without touching a new headset's queue.
|
||||
[Current verification and device limits](docs/evidence/pad-gamescope-2026-10-24.md).
|
||||
|
||||
- Keep media playback running when SteamVR refuses the optional theatre dark
|
||||
surround, including a retry after standby. Log the refusal and play without
|
||||
the surround. Overlay teardown attempts every owned handle and always calls
|
||||
OpenVR shutdown even if a handle fails to close.
|
||||
|
||||
- Check the desktop server's single-instance lock before starting background
|
||||
downloads, so a second server exits cleanly with the existing "already
|
||||
running" message.
|
||||
|
||||
- Recheck saved spatial layouts on SteamOS 0.5.6 / SteamVR 2.18.2 (issue #31).
|
||||
Read-only probes expose some panel geometry, but safe restoration of
|
||||
Steam/gamescope docking and positions remains unverified. Record exact API
|
||||
results and a reproducible probe; saved layouts remain unavailable.
|
||||
|
||||
- Record packaged v0.4.17 Desktop Capture succeeding on a mapped nested KDE
|
||||
compositor on a real Frame with SteamOS 0.5.6. Headset overlay visibility was
|
||||
not established; this is evidence, not a new fix or resolution of issue #73.
|
||||
|
||||
- Correct the Return to Game Mode help text: Frame Control selects the switch
|
||||
supported by the headset's SteamOS build, including `steamosctl` on current
|
||||
Frames. The button's behavior is unchanged.
|
||||
|
||||
- Distinguish an unreadable gamescope panel list from a confirmed empty list in
|
||||
Desktop Capture and Control (issue #73). Failed discovery now asks users to
|
||||
check SteamVR and report the exact message and SteamOS version, rather than
|
||||
|
||||
@@ -44,9 +44,6 @@ Live video of what the lenses show, or of the app panel in use, flat and still h
|
||||
**🔋 Battery and status**<br>
|
||||
Charge, charging watts and time left, storage, memory, temperature, Wi-Fi, and what's running.
|
||||
|
||||
For PC-side USB, driver, radio and network manager evidence, use the
|
||||
[Linux Wireless Adapter doctor](docs/linux-wireless-adapter-doctor.md).
|
||||
|
||||
For repeatable read-only battery, power-rail, temperature and fan measurements,
|
||||
use the [power and heat sampler](docs/power-and-heat.md).
|
||||
|
||||
@@ -78,8 +75,8 @@ Drag files onto the window to send them. Drop a game's .zip, folder or .exe to a
|
||||
**📸 Screenshots and recordings**<br>
|
||||
Browse the shots you take in the headset and save them to your Pictures folder, or have new ones and your Steam clips copied over automatically. Record what the headset shows, with its sound, or export Steam's clips at any length, as .mp4 files in your Videos folder ([not tested on a headset yet](docs/recording.md)).
|
||||
|
||||
**⌨️ Keyboard and trackpad**<br>
|
||||
Type and point in the headset from your computer or phone, through Valve's own input path, with nothing to install. Accents and emoji use KDE Connect, which Frame Control brings along and sets up the first time you type one. Copy text to the headset's clipboard and back again. Press T to open it.
|
||||
**⌨️ Type on the headset**<br>
|
||||
Type and point in the Frame's apps from your computer or phone, through KDE Connect, which Frame Control brings along and sets up on the Frame. Copy text to the headset's clipboard and back again. Nothing else to install, anywhere. Press T to open it.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -263,7 +260,6 @@ Frame's software fits together, all checked against a real headset and labelled
|
||||
| [Sideloading Linux and Windows games](docs/sideloading.md) | A .zip, folder or .exe as a Steam Devkit Game, runtime detection |
|
||||
| [Install links for websites](docs/web-install.md) | `frame-control://install` links and manifests, the rules, a button to paste |
|
||||
| [VR comfort and HUD](docs/vr-utilities.md) · [Steam games](docs/steam-games.md) · [VR video](docs/vr-video.md) · [WebXR in Chromium](docs/webxr-chromium.md) | Installing and buying, watching VR180/360, the Chromium build |
|
||||
| [Steam desktop sharing (Linux)](docs/steam-pipewire.md) | External Steam helper: launch with `-pipewire` after exiting Steam, or open KDE permissions to re-pick a screen manually; no automatic permission reset |
|
||||
| [PC in the headset](docs/pc-in-headset.md) | Experimental, Windows only, off until you turn it on: a whole PC screen as a panel in the Frame. Tested in a Windows VM; individual windows need a WGC-enabled build |
|
||||
| [Mac in the headset](docs/mac-in-headset.md) | Mac windows and screens as panels in the Frame, with laser and keyboard input |
|
||||
| [VR mods and custom songs](docs/mods.md) | UEVR for Unreal games from Frame Control (install, play in VR, remove), the per-game table, Beat Saber blockers |
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "frame-control",
|
||||
"version": "0.4.19",
|
||||
"version": "0.4.17",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "frame-control",
|
||||
"version": "0.4.19",
|
||||
"version": "0.4.17",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"electron": "^44.4.5",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "frame-control",
|
||||
"productName": "Frame Control",
|
||||
"version": "0.4.19",
|
||||
"version": "0.4.17",
|
||||
"description": "Desktop app for managing a Valve Steam Frame over SSH",
|
||||
"private": true,
|
||||
"main": "main.js",
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
{
|
||||
"date_utc": "2026-10-24",
|
||||
"base_commit": "de931bc",
|
||||
"issue": 73,
|
||||
"result": "Packaged Desktop Capture passed for a mapped nested KDE compositor on the real Frame; wearer-visible overlay condition was not established. Do not close #73 from this test.",
|
||||
"package": {
|
||||
"tag": "v0.4.17",
|
||||
"asset": "Frame-Control-linux-x86_64.AppImage",
|
||||
"sha256": "b1b8eb82bf73a227b2cd36e8f0ef3a2ebdf7967c5853efb08a9634f38227015d",
|
||||
"release_digest_matched": true,
|
||||
"panel_helper_matches_base": true,
|
||||
"unmodified_payload": true,
|
||||
"host": "lxso2",
|
||||
"display": "Xvfb :139",
|
||||
"flags": [
|
||||
"--no-sandbox",
|
||||
"--disable-gpu"
|
||||
],
|
||||
"private_profile_and_data": true,
|
||||
"telemetry_and_update_checks_disabled": true
|
||||
},
|
||||
"preflight": {
|
||||
"steamos_version": "0.5.6",
|
||||
"build_id": "20261015.6141207",
|
||||
"battery_percent": 99,
|
||||
"battery_status": "Not charging",
|
||||
"game_mode": true,
|
||||
"full_plasma_session": false,
|
||||
"nested_desktop_running": false,
|
||||
"nested_runtime_present": false,
|
||||
"lock_present": false,
|
||||
"steam_pid": 297826,
|
||||
"vrserver_pid": 297506,
|
||||
"vrcompositor_pid": 297620,
|
||||
"gamescope_service_invocation": "e8c1085b3bbd4e79a323b3e4a9bc6355",
|
||||
"focusable_windows": [],
|
||||
"focused_windows": []
|
||||
},
|
||||
"session": {
|
||||
"started_utc": "2026-10-24T09:43:48Z",
|
||||
"lock_acquired": true,
|
||||
"launch": [
|
||||
"systemd-run",
|
||||
"--user",
|
||||
"--unit=fc-issue73-desktop-20261024",
|
||||
"--collect",
|
||||
"--property=RuntimeMaxSec=180s",
|
||||
"--property=TimeoutStopSec=15s",
|
||||
"--property=KillMode=control-group",
|
||||
"--setenv=DISPLAY=:0",
|
||||
"--setenv=XDG_RUNTIME_DIR=/run/user/1000",
|
||||
"--setenv=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus",
|
||||
"--setenv=XDG_SESSION_TYPE=x11",
|
||||
"--setenv=XDG_CURRENT_DESKTOP=gamescope",
|
||||
"/usr/bin/steamos-nested-desktop"
|
||||
],
|
||||
"response": "Running as unit: fc-issue73-desktop-20261024.service; invocation ID: 92cff1e57c794212997d46c0a68877ec\n"
|
||||
},
|
||||
"discovery": {
|
||||
"focus": 62914560,
|
||||
"focus_display": ":0",
|
||||
"panels": [
|
||||
{
|
||||
"window": 62914560,
|
||||
"display": ":0",
|
||||
"name": "KDE Wayland Compositor - Press right control key to grab input",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"app": 0,
|
||||
"focused": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"window_evidence": {
|
||||
"xwininfo_map_state": "IsViewable",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"focused_after_show_request": true,
|
||||
"steamvr_overlay_key": "valve.steam.desktopgame.0",
|
||||
"steamvr_overlay_visibility_after_show_request": "not_visible"
|
||||
},
|
||||
"capture": {
|
||||
"repeat_utc": "2026-10-24T09:44:47.323Z",
|
||||
"route": "/api/screenshot?view=panel&window=62914560&display=%3A0",
|
||||
"http": 200,
|
||||
"content_type": "image/png",
|
||||
"content_length": 1209980,
|
||||
"source_header": "panel",
|
||||
"decoded": {
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"source": "panel",
|
||||
"selected": {
|
||||
"window": 62914560,
|
||||
"display": ":0",
|
||||
"name": "KDE Wayland Compositor - Press right control key to grab input",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"app": 0,
|
||||
"focused": true
|
||||
},
|
||||
"stamp": "9:44:48 AM",
|
||||
"badge": "Desktop \u00b7 KDE Wayland Compositor - Press right control key to grab input"
|
||||
},
|
||||
"canvas_png_bytes": 2011278,
|
||||
"first_capture_pixel_statistics": {
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"min": 2.3333333333333335,
|
||||
"max": 255,
|
||||
"hidden": false
|
||||
},
|
||||
"first_capture_click_event": {
|
||||
"isTrusted": true,
|
||||
"utc": "2026-10-24T09:44:12.738Z"
|
||||
},
|
||||
"actions": "Two Playwright locator.click() actions on the visible #shotBtn in the actual packaged Electron window; first click recorded isTrusted=true. No direct screenshot API invocation by harness."
|
||||
},
|
||||
"device_cleanup": {
|
||||
"utc": "2026-10-24T09:45:33Z",
|
||||
"before_stop": {
|
||||
"exit": 0,
|
||||
"out": "MainPID=300739\nControlGroup=/user.slice/user-1000.slice/user@1000.service/app.slice/fc-issue73-desktop-20261024.service\nActiveState=active\n",
|
||||
"err": ""
|
||||
},
|
||||
"hide_dashboard": {
|
||||
"exit": 0,
|
||||
"out": "HideDashboard",
|
||||
"err": ""
|
||||
},
|
||||
"stop_owned_unit": {
|
||||
"exit": 0,
|
||||
"out": "",
|
||||
"err": ""
|
||||
},
|
||||
"after_stop": {
|
||||
"exit": 0,
|
||||
"out": "MainPID=0\nLoadState=not-found\nActiveState=inactive\n",
|
||||
"err": ""
|
||||
},
|
||||
"desktop_processes": {
|
||||
"exit": 1,
|
||||
"out": "",
|
||||
"err": ""
|
||||
},
|
||||
"nested_runtime_exists": false,
|
||||
"session": {
|
||||
"exit": 0,
|
||||
"out": "Id=gamescope-session.target\nActiveState=active\nInvocationID=a2fee8ebf55c42c7b546390d14cd985c\n\nId=plasma-workspace-wayland.target\nActiveState=inactive\nInvocationID=\n\nId=gamescope-session.service\nActiveState=active\nInvocationID=e8c1085b3bbd4e79a323b3e4a9bc6355\n",
|
||||
"err": ""
|
||||
},
|
||||
"steam": {
|
||||
"exit": 0,
|
||||
"out": "297826 /home/steamos/.local/share/Steam/steamrtarm64/steam -cef-enable-debugging -deckard -gamepadui -steamdeck -steamos3 -vrgamepadui\n",
|
||||
"err": ""
|
||||
},
|
||||
"steamvr": {
|
||||
"exit": 0,
|
||||
"out": "297506 /opt/steamvr/bin/linuxarm64/vrserver -waitformonitor -ipccontrolfilepath /tmp/SteamVR-IPCControlFile-297420\n297620 /opt/steamvr/bin/linuxarm64/vrcompositor\n",
|
||||
"err": ""
|
||||
},
|
||||
"xprops": {
|
||||
"exit": 0,
|
||||
"out": "GAMESCOPE_FOCUSABLE_WINDOWS(CARDINAL) = \nGAMESCOPE_FOCUSED_WINDOW(CARDINAL) = \n",
|
||||
"err": ""
|
||||
},
|
||||
"battery": {
|
||||
"capacity": "99",
|
||||
"status": "Not charging"
|
||||
},
|
||||
"owned_lock_released": true
|
||||
},
|
||||
"host_cleanup": {
|
||||
"electron": {
|
||||
"pid": 1578431,
|
||||
"exists_after": false
|
||||
},
|
||||
"xvfb": {
|
||||
"pid": 1578428,
|
||||
"exists_after": false
|
||||
},
|
||||
"x_socket_absent": true
|
||||
},
|
||||
"delayed_final_readback": "2026-10-24T09:46:39Z\nshared-lock-absent\nLoadState=not-found\nActiveState=inactive\nId=gamescope-session.target\nActiveState=active\n\nId=plasma-workspace-wayland.target\nActiveState=inactive\nInvocationID=e8c1085b3bbd4e79a323b3e4a9bc6355\n297826 /home/steamos/.local/share/Steam/steamrtarm64/steam -cef-enable-debugging -deckard -gamepadui -steamdeck -steamos3 -vrgamepadui\n297506 /opt/steamvr/bin/linuxarm64/vrserver -waitformonitor -ipccontrolfilepath /tmp/SteamVR-IPCControlFile-297420\n297620 /opt/steamvr/bin/linuxarm64/vrcompositor\nnested-runtime-absent\n100\nFull\nGAMESCOPE_FOCUSABLE_WINDOWS(CARDINAL) = \nGAMESCOPE_FOCUSED_WINDOW(CARDINAL) = \n",
|
||||
"validation": {
|
||||
"focused_panel_suite": "42 tests passed in 14.805s (test_touch.py), including production-page Node behavior tests",
|
||||
"website": "2 tests passed (node --test site/test/*.test.mjs)",
|
||||
"node_panels": "Passed independently (node tests/page/desk_panels.mjs)",
|
||||
"metadata_and_links": "JSON parsed; result/cleanup assertions and relative evidence/streaming/testing links passed",
|
||||
"diff": "git diff --check passed"
|
||||
},
|
||||
"limits": [
|
||||
"SteamVR continued reporting not_visible after ShowDashboard, despite mapped X window and confirmed focus. No worn-headset visual assessment; does not establish the reporter's visible-overlay condition.",
|
||||
"SteamOS 0.5.6 only; reporter used 0.4.5 with unknown Frame Control version and no reproduction steps.",
|
||||
"Nested desktop launched with SteamOS steamos-nested-desktop from a bounded transient user unit using Steam display/session variables; not launched through a wearer's Steam UI.",
|
||||
"Extracted unchanged AppImage on a virtual X display with Chromium sandbox and GPU disabled; no FUSE, physical monitor or hardware-rendering test.",
|
||||
"No Live video, Control input or full Desktop Mode test.",
|
||||
"Nested-desktop journal included gamescope WSI/Vulkan-hook warnings. No warning was dismissed; captured compositor pixels were nonblank.",
|
||||
"Initial CDP response.body() yielded zero bytes despite successful image decode. Repeat verified Content-Length, fresh decoded image, panel selection and PNG export from canvas; the initial raw-body size is not treated as capture failure or proof.",
|
||||
"No private desktop pixels, issue screenshot or raw desktop journal committed."
|
||||
]
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
# Packaged Desktop Capture, 2026-10-24
|
||||
|
||||
Base: `de931bc`. Package: Linux x86_64 **v0.4.17**. Device: real Frame,
|
||||
SteamOS **0.5.6**, BUILD_ID **20261015.6141207**. Host: lxso2.
|
||||
[Sanitized state and response evidence](desktop-capture-packaged-2026-10-24.json).
|
||||
|
||||
## Result and issue boundary
|
||||
|
||||
The packaged app discovered the nested KDE compositor and both automated
|
||||
Desktop **Capture** button clicks succeeded. The repeat returned HTTP 200,
|
||||
`Content-Type: image/png`, `X-Capture-Source: panel`, and Content-Length
|
||||
1,209,980. The app decoded a fresh, nonblank 1920×1080 image and displayed
|
||||
the Desktop panel badge. No further product failure was reproduced or fixed.
|
||||
|
||||
This does **not** establish the full visible-desktop condition in
|
||||
[#73](https://github.com/saphid/frame-control/issues/73). `xwininfo` reported
|
||||
the desktop window `IsViewable`, and gamescope confirmed focus after
|
||||
`vrcmd --showdashboard valve.steam.desktopgame.0`. However, SteamVR still
|
||||
reported that overlay `not_visible`. There was no worn-headset visual check.
|
||||
The observation proves capture of a mapped nested compositor, not its visible
|
||||
presentation to a wearer. Do not close #73 from this evidence.
|
||||
|
||||
The issue screenshot shows a desktop panel in the headset view while Desktop
|
||||
Capture logs “no app panel is open in the headset.” The reporter used SteamOS
|
||||
0.4.5, gave no Frame Control version or reproduction steps, and has not replied
|
||||
to the maintainer's 0.4.3 update request. The duplicate page function was already
|
||||
fixed; [PR #152](https://github.com/saphid/frame-control/pull/152) subsequently
|
||||
improved unknown-state diagnostics. Its [earlier investigation](panel-discovery-2026-10-24.md)
|
||||
was blocked from starting a desktop by another task's lock. This run adds a
|
||||
current-package capture observation, without reproducing the older failure.
|
||||
|
||||
## Procedure
|
||||
|
||||
1. Read-only preflight found Game Mode active, full Plasma inactive, Steam and
|
||||
SteamVR running, battery 99%, no nested desktop/runtime and no test lock.
|
||||
2. Compared the retained AppImage's SHA-256 with the live v0.4.17 release asset
|
||||
digest: `b1b8eb82bf73a227b2cd36e8f0ef3a2ebdf7967c5853efb08a9634f38227015d`.
|
||||
Extracted an independent copy; `cmp` confirmed its `frame_touch.py` matches
|
||||
the base checkout. No payload was edited.
|
||||
3. Started the package's own AppRun, bundled server and Python on Xvfb `:139`
|
||||
with private config/cache/data/profile, telemetry and update checks disabled,
|
||||
and `--no-sandbox --disable-gpu`. Used the existing authorized `ssh frame`
|
||||
identity. T3 preview opened the package server page but does not attach to
|
||||
the existing Electron window. The literal Electron button test used the
|
||||
same Playwright-over-loopback-CDP workflow as the earlier packaged tests.
|
||||
4. Acquired `/tmp/frame-test.lock` with atomic `mkdir` and wrote an owner marker.
|
||||
Rechecked no nested runtime or Plasma was present. Started SteamOS's
|
||||
`/usr/bin/steamos-nested-desktop` in the owned transient user unit
|
||||
`fc-issue73-desktop-20261024.service`, using Steam's display/session variables.
|
||||
`RuntimeMaxSec=180s`, `TimeoutStopSec=15s` and `KillMode=control-group` bounded
|
||||
the session. This launches a desktop panel inside Game Mode; no full Desktop
|
||||
Mode switch was sent.
|
||||
5. In the actual packaged Electron window, navigated Tools → Capture & Live →
|
||||
Desktop and clicked Capture with `locator.click()`. The first click event
|
||||
recorded `isTrusted=true`. The page selected the KDE compositor on `:0`;
|
||||
the production screenshot path used window `62914560`. Requested the desktop
|
||||
dashboard, read back focus/visibility, and clicked Capture again. Recorded
|
||||
response metadata, fresh decoded image dimensions and canvas pixel range.
|
||||
No direct screenshot API call was substituted for these button clicks.
|
||||
6. Ran the packaged `frame_touch.py panels` read-only over SSH to retain its
|
||||
exact discovery result: one focused KDE compositor panel, app ID 0, 1920×1080,
|
||||
display `:0`, with no diagnostic `why` field.
|
||||
|
||||
## Cleanup and limits
|
||||
|
||||
The owned desktop session ran **09:43:48–09:45:33 UTC** (105 seconds). Hid the
|
||||
dashboard to restore its initial hidden state, stopped only the owned unit,
|
||||
and verified it was unloaded/inactive with MainPID 0. No Plasma/KWin desktop
|
||||
process or nested runtime remained; gamescope's focusable/focused lists were
|
||||
empty again. Released only this task's lock, after checking its owner marker.
|
||||
|
||||
Delayed readback at **09:46:39 UTC** confirmed the lock absent, Game Mode active,
|
||||
full Plasma inactive and the original Steam, vrserver and vrcompositor PIDs
|
||||
still running. The Game Mode service invocation was unchanged. Battery was
|
||||
99% at cleanup and 100%/Full on the delayed check. Closed both owned preview
|
||||
tabs, Electron and Xvfb; their processes and X socket were gone. No test server
|
||||
remained. No reboot, installation, security/global setting change or full
|
||||
Desktop Mode transition was performed.
|
||||
|
||||
The nested desktop journal included gamescope WSI/Vulkan-hook warnings. No
|
||||
warning was dismissed. Capture produced nonblank compositor pixels, but this
|
||||
run does not assess their usability to a wearer. Private image files stayed
|
||||
outside the repository; only state and response metadata are published.
|
||||
|
||||
The initial CDP `response.body()` read yielded zero bytes despite successful
|
||||
decoding in the page. The repeat verified the PNG Content-Length, fresh image
|
||||
dimensions/source/selection and a 2,011,278-byte PNG exported from the canvas.
|
||||
The initial raw-body measurement is a harness limitation, not evidence of a
|
||||
product capture failure. No Live video, Control input, physical monitor, FUSE
|
||||
mounting or hardware rendering was tested. Older SteamOS and other packages
|
||||
remain outside this observation.
|
||||
|
||||
## Offline verification
|
||||
|
||||
`python3 -m unittest discover -s tests -p test_touch.py -v`: **42 tests passed**,
|
||||
including the production page's Node panel behavior tests, duplicate-function
|
||||
guard, absent versus empty panel diagnostics, alternate displays, capture/input
|
||||
target validation and discovery deadlines. JSON parsing and `git diff --check`
|
||||
were also checked. No new regression test was added because this is an
|
||||
evidence-only change with no reproduced product defect.
|
||||
@@ -1,142 +0,0 @@
|
||||
# Media surround hardening: 2026-10-24
|
||||
|
||||
PR [#51](https://github.com/saphid/frame-control/pull/51), branch
|
||||
`theatre-media-surround-hardening`, merged main `2ded4c5` without rebasing.
|
||||
Both fixes remain necessary on that main: an optional-surround error escapes
|
||||
`play()`, and a non-`RuntimeError` during overlay teardown skips the remaining
|
||||
handles and OpenVR shutdown.
|
||||
|
||||
## Offline checks
|
||||
|
||||
- Focused media suite: **23 tests passed** on Linux / Python 3.12.3.
|
||||
- Final full suite: **1,381 tests, OK (15 skipped)** in 145.384 s with
|
||||
`PYTHONFAULTHANDLER=1 python3 -m unittest discover -s tests -v`.
|
||||
The service-regression module passed **33 tests**. Player/server compilation
|
||||
and `git diff --check` passed. Current macOS/Windows validation is left to CI.
|
||||
- The startup/upload, creation/setup, deferred-surround refusal and teardown
|
||||
regression tests were also run with main's player implementation: they
|
||||
failed as expected (six errors across subtests). The screen-refusal test
|
||||
passed, confirming that actual screen failures still propagate.
|
||||
- The historical macOS failure was job
|
||||
[109239733717](https://github.com/saphid/frame-control/actions/runs/36516462623/job/109239733717),
|
||||
on `dac9dbc`, Python 3.12: 619 tests, three failures in artwork resolver
|
||||
tests (`test_resolver_slot_released_when_thread_cannot_start`,
|
||||
`test_timed_out_lookups_are_capped`,
|
||||
`test_url_fetch_refuses_private_hosts_and_honours_deadline`). Media tests
|
||||
passed. Late DNS workers retained semaphore slots; the first failed
|
||||
assertion could also leak acquired slots into later tests.
|
||||
- Main already contains `8051687`'s wait-for-idle and unconditional slot
|
||||
cleanup, preserved by `d546568`. The current artwork module passed all
|
||||
**40 tests** locally. No additional artwork changes were needed.
|
||||
- The first full run completed **1,380 tests, 15 skipped**, with one failure:
|
||||
`test_a_second_server_is_refused_until_the_first_exits` observed SIGSEGV
|
||||
(`-11`) instead of exit 1. All 41 server tests passed on a focused rerun.
|
||||
Main started daemon index/TLS workers before refusing a second server;
|
||||
its existing shutdown notes document a race with OpenSSL interpreter exit.
|
||||
This crash mechanism is inferred; the first run did not retain a native
|
||||
fault trace. The subprocess assertion now retains stderr for diagnosis.
|
||||
A deterministic regression now checks that rejection starts no listener,
|
||||
cleanup sweep or background workers. It failed before moving the ownership
|
||||
check ahead of startup work and passed afterwards.
|
||||
|
||||
The surround retry now logs a refusal before discarding that cosmetic work.
|
||||
Creation, setup and first-upload failures also allow the screen to play;
|
||||
standby remains retryable, and screen errors remain fatal. Teardown tests
|
||||
exercise OpenVR errors, unexpected exceptions and a late `InterruptedError`,
|
||||
checking that all handles are attempted and shutdown runs.
|
||||
|
||||
## Earlier blocked real Frame attempt
|
||||
|
||||
Read-only SSH preflight: SteamOS **0.5.6**, BUILD_ID **20261015.6141207**;
|
||||
SteamVR server PID **297506**, compositor PID **297620**; existing media
|
||||
service `inactive/dead`, MainPID 0; battery **99%**, fuel gauge `Not charging`,
|
||||
charger `Full`. The shared lock was absent at preflight.
|
||||
|
||||
The subsequent atomic `mkdir /tmp/frame-test.lock` failed with
|
||||
`FileExistsError(17, 'File exists')`: another session acquired it in between.
|
||||
The probe stopped before uploading files, launching media, creating overlays,
|
||||
or changing any state. The foreign lock was neither modified nor released.
|
||||
All generated fixtures remained on the computer and were then removed; no
|
||||
headset cleanup was necessary. Steam/SteamVR and the prior player state were
|
||||
left alone.
|
||||
|
||||
## Follow-up real Frame smoke at the exact PR head
|
||||
|
||||
**Passed, 2026-10-24 10:35:02–10:35:23 UTC**, with byte-identical media modules
|
||||
from **`5d551a81658d9ff14f49285c28609d506cbc20aa`**. This later run resolves
|
||||
the earlier lack of fresh playback evidence. No production code changed.
|
||||
The headset was unworn. SteamOS **0.5.6**, BUILD_ID **20261015.6141207**,
|
||||
SteamVR **2.18.2**; battery **100%, Full** before and after.
|
||||
|
||||
Read-only preflight found Game Mode (`XDG_CURRENT_DESKTOP=gamescope`,
|
||||
`start-gamescope` running, no `plasmashell`), Steam/SteamVR running, no media
|
||||
overlays, and the installed media service inactive/not loaded. The test then
|
||||
acquired `/tmp/frame-test.lock` with atomic `mkdir`; it did not take over a
|
||||
foreign lock. Under the lock, those safety conditions were checked again.
|
||||
|
||||
Only generated media and the PR's four unchanged modules were uploaded, under
|
||||
the test-owned, uid-1000 directory
|
||||
`/tmp/pr51-5d551a8-4c0976a52564-utfbk_m0/`. The clip was a **12 s, 30 fps,
|
||||
960×540 half-SBS H.264** MP4 with solid red/cyan eye images and **silent AAC**.
|
||||
It was generated with FFmpeg's `color`, `hstack` and `anullsrc` sources; no
|
||||
personal or external media was used.
|
||||
|
||||
The exact `frame_media_remote.run()` Play/status/Stop path was exercised by
|
||||
importing its unmodified module and changing only its in-memory `ROOT`,
|
||||
`RUNTIME`, `STATUS` and `UNIT` constants to the isolated test locations and
|
||||
`frame-control-media-pr51-5d551a8-4c0976a52564.service`. The real
|
||||
`frame_media_player.py` ran unchanged with `--layout auto --theatre`, using
|
||||
`h264_v4l2m2m` and Pulse output. This checks the player and its systemd lifecycle;
|
||||
it does **not** reverify the HTTP/UI upload or runtime installer, nor the
|
||||
literal production unit name. The installed media runtime, log, status and
|
||||
library were preserved.
|
||||
|
||||
- First Play: `starting` → `playing` → **`ended`**, **360 frames**, **160 dropped**,
|
||||
**12.0397 s**, `running=false`. The drops were the normal unworn/standby
|
||||
`SetOverlayRaw` retry path; no fault was forced. At 60 frames, dropped was 0.
|
||||
`vrcmd --overlays` listed `framecontrol.media.surround` as **1×1 visible**
|
||||
and `framecontrol.media.screen` as **visible**. These are SteamVR metadata,
|
||||
not a wearer or eye-capture verification.
|
||||
- After EOF: unit **inactive/dead, not-found, MainPID 0**, no test player or
|
||||
decoder, and neither owned overlay remained. Stop after EOF succeeded and
|
||||
retained `ended`.
|
||||
- Second Play reached `playing`, 60 frames, 0 dropped. Explicit Stop returned
|
||||
**`stopped`, 72 frames, 0 dropped, `running=false`**. Again the unit was
|
||||
inactive/dead/not-found with MainPID 0, no player/decoder and no owned overlays.
|
||||
- The test unit's `ExecStart` and cgroup identified the unique temporary
|
||||
runtime. First-run player/decoder PIDs were **309650/309655**; second-run
|
||||
PIDs were **309805/309810**. Stop controlled only this dedicated test unit.
|
||||
Its player log was empty; no surround refusal or teardown error was logged.
|
||||
|
||||
### Uploaded SHA-256 values
|
||||
|
||||
```text
|
||||
generated_SBS.mp4 1b39cac1d3b092b89657250c817019b68e87a474976ccd44aeb38e8eee44ffca
|
||||
frame_media.py 001e3158f4c3931794846b21f1e4cb553349d9326b4db1454a01976d446ad97a
|
||||
frame_media_player.py 86b0a140ebff857c2819c74d3ac45d1897735c585d44c7360ad6f18c2ecf2645
|
||||
frame_media_remote.py b60386eb192d32594358246a4e665474c543600f2c564c2efd554ef38d7a631d
|
||||
frame_splat.py f35750926f1149c41b95617a302012406d355c0dfdd4530438b0c42ee6d55daa
|
||||
```
|
||||
|
||||
### Cleanup and limits
|
||||
|
||||
The temporary directory, including its fixture, code, bytecode, status and log,
|
||||
was removed only after verifying that its player and decoder had exited. The
|
||||
transient unit was collected. The test released only its own lock after cleanup.
|
||||
All installed media runtime file hashes, including `player.log` and
|
||||
`status.json`, were unchanged. The installed `frame-control-media.service`
|
||||
remained inactive/not loaded. Steam **297826**, vrserver **297506**,
|
||||
vrcompositor **297620**, vrdashboard **297721**, and start-gamescope **296997**
|
||||
kept the same PIDs. The pre-existing overlay key/dimension/visibility/type
|
||||
inventory matched the final inventory, and all dashboard main panels remained
|
||||
`not_visible`. No dashboard command, wake request, global setting, reboot or
|
||||
Steam/SteamVR stop was issued.
|
||||
|
||||
Cosmetic surround refusal and exceptional teardown remain **fake-tested**;
|
||||
no real refusal or teardown fault was induced. This short unworn-headset
|
||||
smoke does not verify appearance, eye isolation, comfort, audible sound/lip
|
||||
sync (the AAC was silent), sustained display performance, or the issue #28
|
||||
report of laggy 1080p video. It does not cover new H.265, photo or splat cases.
|
||||
Historical checks remain in the earlier PR #51 description and
|
||||
[media playback notes](../vr-video.md). The PR remains draft and unmerged
|
||||
for parent review and CI.
|
||||
@@ -1,178 +0,0 @@
|
||||
# Keyboard and trackpad through gamescope, 2026-10-24
|
||||
|
||||
PR: [#66](https://github.com/saphid/frame-control/pull/66), `pad-gamescope`.
|
||||
Parent/main: v0.4.18 commit `0da1fe5`. Merge commit: `1737366`, with parents
|
||||
`cba23fb` (the existing PR) and `0da1fe5` (main). No history was rewritten.
|
||||
|
||||
## Merge and implementation
|
||||
|
||||
Both `/api/input` (keyboard/trackpad) and `/api/touch` (live-view Control)
|
||||
start and poll the gamescope helper. KDE Connect starts only when Unicode
|
||||
typing needs it. The existing ordered, bounded queue and switch cancellation
|
||||
remain in place; cross-service typing order is an estimate, not an application
|
||||
acknowledgement.
|
||||
|
||||
The merge keeps main's intended-device validation and work reservation before
|
||||
a GET starts an input helper, immutable SSH routes, launch generations and
|
||||
serialized writes. Switching headsets also stops the power report and resets
|
||||
both input agents and queued typing before publishing the new route. The page
|
||||
keeps main's Tools sections, clipboard controls and single instances of the
|
||||
keyboard/trackpad and VR tools, with the PR's gamescope help text.
|
||||
|
||||
The start/status regression tests now exercise the gamescope helper for both
|
||||
endpoints. An explicit `/api/input` test checks that start and poll use that
|
||||
helper without starting KDE Connect. Existing stale/missing-headset and
|
||||
route-reservation tests remain active.
|
||||
|
||||
## Real Frame: focused click and ASCII keys received
|
||||
|
||||
Host: lxso2, `ssh frame`. SteamOS **0.5.6**, BUILD_ID **20261015.6141207**,
|
||||
SteamVR **2.18.2**. At **11:05 UTC**, Game Mode was active, full Plasma was
|
||||
inactive, Steam and SteamVR were running, battery was **99%**, and gamescope's
|
||||
focusable/focused window lists were empty. The shared test lock was absent.
|
||||
Existing X11 tools and libX11 were available; Tk could not load its library.
|
||||
|
||||
At **11:09:23 UTC**, an initial read-only preflight saw no focused window
|
||||
but activity level **0** (idle), rather than the required **3** (standby), and
|
||||
aborted before lock acquisition or input. At **11:09:57 UTC**, another task
|
||||
held the shared lock with a focused panel; that lock and panel were left alone.
|
||||
|
||||
At **11:20:22 UTC**, read-only checks found the lock absent, no focused or
|
||||
focusable windows, activity **3** and battery **98%**. The bounded probe ran at
|
||||
**11:20:37 UTC** against implementation commit `5641d3c`:
|
||||
|
||||
1. Rechecked empty focus and standby, acquired `/tmp/frame-test.lock` with
|
||||
atomic `mkdir`, wrote a unique owner marker and rechecked both conditions.
|
||||
2. Created only a disposable 640×400 X11 event-recorder window on `:0`, tagged
|
||||
with test app ID `2000999066`. It had a 45-second alarm and closed on stdin
|
||||
EOF. No existing application, full desktop or dashboard was started.
|
||||
3. Waited for gamescope to report that exact window (`62914561`) focused.
|
||||
Started the production server's `TouchAgent` over SSH; it reported ready.
|
||||
4. Called production `server.remote_touch` for positioning, then
|
||||
`server.remote_input` with a left click, `Frame66` and the Enter key button.
|
||||
Both responses reported `sent: true`. More importantly, the **window itself
|
||||
recorded ButtonPress/Release (button 1), the ASCII key events in order and
|
||||
Return**. `XLookupString` decoded exactly `Frame66\r`. The events were
|
||||
delivered through gamescope's EIS socket, not fabricated with XSendEvent.
|
||||
5. Closed the helper by EOF and waited for exit, closed the recorder, checked
|
||||
empty focus and standby, then removed only the owner-matching test lock.
|
||||
|
||||
[State and received events](pad-gamescope-2026-10-24/readback.json) and the
|
||||
[probe](pad-gamescope-2026-10-24/probe.py)/[X11 recorder](pad-gamescope-2026-10-24/recorder.py)
|
||||
are retained. The archived scripts use checkout-relative source paths; the
|
||||
recorded run used the same harness from `/tmp`. Motion records omit an unused
|
||||
field that only has meaning for key/button events.
|
||||
|
||||
Delayed readback at **11:21:46 UTC** confirmed no test lock or recorder process,
|
||||
empty focused/focusable lists, Game Mode active, full Plasma inactive, activity
|
||||
3 and battery 98%. The original Steam and vrserver PIDs were unchanged. No
|
||||
install, security/global setting change, dashboard/session switch, reset or
|
||||
reboot was performed. No headset helper or owned lock remained.
|
||||
|
||||
This establishes **focused-panel click and ASCII key delivery on `:0`**.
|
||||
It does not establish wearer-visible presentation, Unicode delivery or GUI
|
||||
interaction. The absolute-position setup reached the recorder's edge
|
||||
(639,399), rather than its centre; pixel-accurate absolute pointing is **not**
|
||||
proved by this small-window probe. The trackpad click and typed keys still
|
||||
arrived in the owned focused window. The original PR's earlier acceptance-only
|
||||
observations remain historical; this observation adds actual window events.
|
||||
|
||||
## Offline checks and remaining limits
|
||||
|
||||
- `python3 -m unittest discover -s tests -p test_input.py -v`: **58 passed**.
|
||||
- `python3 -m unittest discover -s tests -p test_touch.py -v`: **43 passed**.
|
||||
- `python3 -m unittest discover -s tests -p test_service_regressions.py -v`:
|
||||
**34 passed**.
|
||||
- `python3 -m unittest discover -s tests -v`: **1,403 ran, OK, 15 skipped**
|
||||
(Linux x86_64, Python 3.12; 150.825 seconds).
|
||||
- Full fake-Frame e2e in task-specific Docker project `frame-control-pr66`:
|
||||
**47 passed** after the lock fix (192.270 seconds). Both task containers,
|
||||
their network and all three volumes were removed afterward. The run emitted
|
||||
an unclosed test-socket ResourceWarning; the suite returned OK.
|
||||
- Node page suites: `ctrl_gestures.mjs`, `pad_queue.mjs`, `desk_panels.mjs`
|
||||
passed, using the production page functions.
|
||||
- `node --test app/test/*.test.js`: **3 test files passed**.
|
||||
- `node --test site/test/*.test.mjs`: **2 test files passed**.
|
||||
- Python compilation, desktop/site JavaScript syntax and `git diff --check`
|
||||
passed. Fake-Frame e2e and exact-head CI results are recorded in the PR after completion.
|
||||
|
||||
The first full regression run executed 1,401 tests and found two tests still
|
||||
expecting `/api/input` to start the old KDE Connect helper. They were updated
|
||||
to the intended gamescope route. The final full run includes the lazy-KDE
|
||||
regression above and the lock-order regression below. The initial restricted-sandbox input run could not open
|
||||
loopback sockets; the focused rerun with managed network access passed.
|
||||
|
||||
Review of the merged code then found a lock inversion: the Unicode worker
|
||||
held the pad-send lock while `InputAgent.start()` acquired the route lock,
|
||||
whereas a headset switch held the route lock before resetting the pad. A
|
||||
bounded subprocess regression reproduced the deadlock with the real
|
||||
`InputAgent.send/start` methods and an offline launch stub. Unicode delivery
|
||||
and resets now take the route lock before the pad lock; the route lock is
|
||||
reentrant so an agent can capture its route inside that reservation. The new
|
||||
regression passed after the fix, as did all **58 focused input tests** and
|
||||
the **1,403-test full suite** (15 skipped). The local fake-Frame suite also
|
||||
passed **47 tests after this fix**. Exact-head CI results are recorded in the PR.
|
||||
|
||||
Remaining device work requires an idle, available Frame and the shared lock:
|
||||
verify Unicode in a real text field, ordering under real typing load and
|
||||
precise absolute pointing for small panels. Worn-headset presentation,
|
||||
packaged Electron pointer lock and Windows GUI execution remain separate
|
||||
checks. Automated Windows/macOS CI does not establish those interactions.
|
||||
|
||||
|
||||
## Review round 2: queue saturation and failure recovery
|
||||
|
||||
The coordinator identified silent eviction in both `_queue_for_kde()` and the
|
||||
worker's retry path. Both sliced the oldest accepted events off at 200 entries,
|
||||
even though the page had already received `sent: true` and discarded its copy.
|
||||
|
||||
Admission now serializes concurrent requests, checks capacity before any pointer
|
||||
or keyboard send, and returns `sent: false, state: waiting` if the whole batch
|
||||
will not fit. Text stays in the bounded queue while in flight, and is removed
|
||||
only after the helper accepts it. Rejected mixed batches send no clicks; retrying
|
||||
them cannot duplicate clicks already sent by this server. The page polls until
|
||||
it can retry. Pointer input stays usable while accepted text is pending.
|
||||
|
||||
The old worker also left its worker marker and one-hour timing sentinel behind
|
||||
if `send()` raised. Failure/timeout handling now retains unsent text, clears the
|
||||
worker/timing state and exposes an error through input status. The page polls
|
||||
accepted text without requiring another keypress. **Try again** explicitly
|
||||
restarts the retained queue. Thread-start failures follow the same retention
|
||||
rule. A stale worker's exception cannot change the new route's state.
|
||||
|
||||
The proposed send-to-enqueue headset-switch race was not reachable through the
|
||||
normal HTTP switch path: `Handler.do_POST()` reserves `working(meant)` across
|
||||
both operations; `devices_post()` shares `_work_lock` and refuses a moving
|
||||
operation while work is active. Connector configuration/reconnect paths defer
|
||||
changed headsets while work runs. A production-handler regression attempts a
|
||||
switch at both send and enqueue and passes even on the previous implementation.
|
||||
No separate connector change was needed. Atomic queue admission now uses the
|
||||
existing route-before-pad lock order as well, because starting either input
|
||||
agent can capture its route synchronously.
|
||||
|
||||
Three deterministic saturation regressions fail on `215db7b` and pass with the
|
||||
fix: capacity during the typing delay, capacity during an unsuccessful-send
|
||||
retry, and two concurrent producers competing for the last slots. They check
|
||||
exact accepted event sequences, reject a mixed click/text batch before its
|
||||
pointer effects, and verify delivery exactly once after retry. Additional tests
|
||||
cover explicit recovery after timeout, helper errors, send exceptions and
|
||||
thread-start failure, stale-worker isolation, HTTP status/start behavior, and
|
||||
the production page's polling/error behavior.
|
||||
|
||||
No new active headset test was performed: this change affects host queue
|
||||
admission/recovery and status handling, not Frame event translation or injection.
|
||||
The earlier real click/ASCII evidence remains scoped to its recorded commit.
|
||||
Real Unicode, packaged Electron pointer lock, Windows GUI, wearer-visible
|
||||
presentation and precise small-window absolute positioning remain unverified.
|
||||
`sent: true` means accepted by this server, not application delivery. The queue
|
||||
is in memory; switching headsets cancels it and server exit loses it. A transport
|
||||
failure after a partial write can still make delivery ambiguous; this is not an
|
||||
end-to-end exactly-once protocol.
|
||||
|
||||
Round 2 local verification: **141 focused input/touch/service tests passed**
|
||||
(62 input, 43 touch, 36 service; 20.061 seconds), and **1,409 server tests ran, OK, 15 skipped**
|
||||
(Linux x86_64, Python 3.12, 153.198 seconds). All three production-page Node
|
||||
suites passed; app tests passed (3 files), site tests passed (2 files), Python
|
||||
compilation and `git diff --check` passed. The existing skipped tests require
|
||||
zsh, macOS/Swift or built native PC libraries. Current-head CI is tracked in
|
||||
PR #66; the previous 47-test local fake-Frame run above is historical.
|
||||
@@ -1,129 +0,0 @@
|
||||
"""Active real-Frame evidence probe: aborts unless idle, then owns the shared lock.
|
||||
|
||||
Run manually on an authorised host: python3 docs/evidence/pad-gamescope-2026-10-24/probe.py
|
||||
The recorded run used /tmp paths; archived paths are relative to this checkout.
|
||||
"""
|
||||
import base64
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import queue
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import uuid
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
data = tempfile.TemporaryDirectory(prefix='pr66-live-')
|
||||
os.environ.update(FRAME_CONTROL_DATA_DIR=data.name, FRAME_CONTROL_TELEMETRY='0', FRAME_PRIVATE_SSH='1')
|
||||
sys.path.insert(0, str(ROOT / 'ui'))
|
||||
import server
|
||||
|
||||
SSH = ['ssh', '-o', 'BatchMode=yes', '-o', 'ConnectTimeout=5', 'frame']
|
||||
owner = 'pr66-' + uuid.uuid4().hex
|
||||
result = {'time': datetime.datetime.now(datetime.timezone.utc).isoformat(), 'owner': owner,
|
||||
'base': '0da1fe5', 'route': 'production server.remote_input -> TouchAgent SSH -> frame_touch.py -> gamescope EIS',
|
||||
'events': []}
|
||||
recorder = None
|
||||
locked = False
|
||||
rows = queue.Queue()
|
||||
|
||||
def ssh(cmd):
|
||||
return subprocess.run([*SSH, cmd], capture_output=True, text=True, timeout=15, check=True).stdout
|
||||
|
||||
def focus():
|
||||
return json.loads(server.ssh('python3 - focus', stdin=(ROOT/'ui/frame_touch.py').read_text(), timeout=15))
|
||||
|
||||
def activity():
|
||||
return json.loads(ssh('/opt/steamvr/bin/linuxarm64/vrcmd --stats'))[0]['activity_level']
|
||||
|
||||
def read_rows():
|
||||
for raw in recorder.stdout:
|
||||
rows.put(json.loads(raw))
|
||||
|
||||
def collect(seconds):
|
||||
end = time.monotonic() + seconds
|
||||
while time.monotonic() < end:
|
||||
try:
|
||||
result['events'].append(rows.get(timeout=max(0.01, end-time.monotonic())))
|
||||
except queue.Empty:
|
||||
break
|
||||
|
||||
try:
|
||||
result['initial_focus'] = focus()
|
||||
result['initial_activity'] = activity()
|
||||
assert not result['initial_focus'].get('window'), 'existing focused panel; do not interrupt'
|
||||
assert result['initial_activity'] == 3, 'headset is not in standby'
|
||||
ssh('mkdir /tmp/frame-test.lock && printf %s ' + shlex.quote(owner) + ' > /tmp/frame-test.lock/owner')
|
||||
locked = True
|
||||
result['lock_acquired'] = True
|
||||
assert not focus().get('window') and activity() == 3, 'session changed during lock acquisition'
|
||||
code = base64.b64encode(Path(__file__).with_name('recorder.py').read_bytes()).decode()
|
||||
command = 'python3 -u -c ' + shlex.quote("import base64;exec(compile(base64.b64decode('" + code + "'),'pr66-recorder','exec'))")
|
||||
recorder = subprocess.Popen([*SSH, command], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, text=True)
|
||||
threading.Thread(target=read_rows, daemon=True).start()
|
||||
initial = rows.get(timeout=8)
|
||||
result['recorder'] = initial
|
||||
assert initial.get('ready'), initial
|
||||
window = initial['window']
|
||||
for _ in range(20):
|
||||
current = focus()
|
||||
if current.get('window') == window:
|
||||
break
|
||||
time.sleep(0.2)
|
||||
result['focused_panel'] = current
|
||||
assert current.get('window') == window and current.get('display') == ':0', 'owned panel did not obtain focus; no input sent'
|
||||
server.remote_input({})
|
||||
for _ in range(50):
|
||||
if server._touch.status.get('state') in ('ready', 'error'):
|
||||
break
|
||||
time.sleep(0.1)
|
||||
result['agent_status'] = dict(server._touch.status)
|
||||
assert result['agent_status'].get('state') == 'ready', result['agent_status']
|
||||
target = {'window': window, 'display': ':0'}
|
||||
assert focus().get('window') == window and activity() == 3
|
||||
result['position_response'] = server.remote_touch({'events': [dict(target, fx=0.5, fy=0.5)]})
|
||||
time.sleep(0.2)
|
||||
assert focus().get('window') == window and activity() == 3
|
||||
result['pad_response'] = server.remote_input({'events': [{'singleclick': True}, {'key': 'Frame66'}, {'specialKey': 12}]})
|
||||
collect(2)
|
||||
received = result['events']
|
||||
result['received_text'] = ''.join(e.get('text', '') for e in received if e.get('type') == 2)
|
||||
result['click_received'] = any(e.get('type') == 4 and e.get('code') == 1 and e.get('window') == window for e in received)
|
||||
result['release_received'] = any(e.get('type') == 5 and e.get('code') == 1 and e.get('window') == window for e in received)
|
||||
result['passed'] = result['click_received'] and result['release_received'] and result['received_text'] == 'Frame66\r'
|
||||
assert result['passed'], 'event recorder did not observe expected click and keys'
|
||||
except Exception as e:
|
||||
result['error'] = str(e)
|
||||
finally:
|
||||
proc = server._touch.proc
|
||||
server.reset_pad_route()
|
||||
if proc:
|
||||
try:
|
||||
proc.wait(timeout=8)
|
||||
result['input_helper_exited'] = True
|
||||
except subprocess.TimeoutExpired:
|
||||
proc.terminate()
|
||||
proc.wait(timeout=5)
|
||||
result['input_helper_terminated'] = True
|
||||
if recorder:
|
||||
recorder.stdin.close()
|
||||
recorder.wait(timeout=8)
|
||||
collect(0.2)
|
||||
result['recorder_exit'] = recorder.returncode
|
||||
result['recorder_stderr'] = recorder.stderr.read()[-1000:]
|
||||
if locked:
|
||||
result['final_focus'] = focus()
|
||||
result['final_activity'] = activity()
|
||||
ssh('test "$(cat /tmp/frame-test.lock/owner)" = ' + shlex.quote(owner)
|
||||
+ ' && rm /tmp/frame-test.lock/owner && rmdir /tmp/frame-test.lock')
|
||||
result['owned_lock_released'] = True
|
||||
Path('/tmp/pr66-live.json').write_text(json.dumps(result, indent=2) + '\n')
|
||||
print(json.dumps(result, indent=2))
|
||||
data.cleanup()
|
||||
sys.exit(0 if result.get('passed') else 1)
|
||||
@@ -1,280 +0,0 @@
|
||||
{
|
||||
"time": "2026-10-24T11:20:37.392607+00:00",
|
||||
"owner": "pr66-7c2a8e8851f449bcb0bb6a040be94d99",
|
||||
"base": "0da1fe5",
|
||||
"route": "production server.remote_input -> TouchAgent SSH -> frame_touch.py -> gamescope EIS",
|
||||
"events": [
|
||||
{
|
||||
"type": 6,
|
||||
"window": 62914561,
|
||||
"x": 320,
|
||||
"y": 200,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 6,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 4,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 1,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 5,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 1,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 50,
|
||||
"synthetic": false,
|
||||
"text": "",
|
||||
"keysym": 65505
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 41,
|
||||
"synthetic": false,
|
||||
"text": "F",
|
||||
"keysym": 70
|
||||
},
|
||||
{
|
||||
"type": 3,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 41,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 3,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 50,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 27,
|
||||
"synthetic": false,
|
||||
"text": "r",
|
||||
"keysym": 114
|
||||
},
|
||||
{
|
||||
"type": 3,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 27,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 38,
|
||||
"synthetic": false,
|
||||
"text": "a",
|
||||
"keysym": 97
|
||||
},
|
||||
{
|
||||
"type": 3,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 38,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 58,
|
||||
"synthetic": false,
|
||||
"text": "m",
|
||||
"keysym": 109
|
||||
},
|
||||
{
|
||||
"type": 3,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 58,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 26,
|
||||
"synthetic": false,
|
||||
"text": "e",
|
||||
"keysym": 101
|
||||
},
|
||||
{
|
||||
"type": 3,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 26,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 15,
|
||||
"synthetic": false,
|
||||
"text": "6",
|
||||
"keysym": 54
|
||||
},
|
||||
{
|
||||
"type": 3,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 15,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 15,
|
||||
"synthetic": false,
|
||||
"text": "6",
|
||||
"keysym": 54
|
||||
},
|
||||
{
|
||||
"type": 3,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 15,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 36,
|
||||
"synthetic": false,
|
||||
"text": "\r",
|
||||
"keysym": 65293
|
||||
},
|
||||
{
|
||||
"type": 3,
|
||||
"window": 62914561,
|
||||
"x": 639,
|
||||
"y": 399,
|
||||
"code": 36,
|
||||
"synthetic": false
|
||||
},
|
||||
{
|
||||
"cleaned": true
|
||||
}
|
||||
],
|
||||
"initial_focus": {
|
||||
"window": null
|
||||
},
|
||||
"initial_activity": 3,
|
||||
"lock_acquired": true,
|
||||
"recorder": {
|
||||
"ready": true,
|
||||
"window": 62914561,
|
||||
"pid": 317210,
|
||||
"display": ":0",
|
||||
"appid": 2000999066
|
||||
},
|
||||
"focused_panel": {
|
||||
"window": 62914561,
|
||||
"display": ":0",
|
||||
"name": "Frame Control PR66 disposable input probe",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 640,
|
||||
"height": 400,
|
||||
"root": [
|
||||
1920,
|
||||
1080
|
||||
],
|
||||
"app": 2000999066
|
||||
},
|
||||
"agent_status": {
|
||||
"state": "ready",
|
||||
"focus": 62914561
|
||||
},
|
||||
"position_response": {
|
||||
"state": "ready",
|
||||
"focus": 62914561,
|
||||
"sent": true
|
||||
},
|
||||
"pad_response": {
|
||||
"state": "ready",
|
||||
"focus": 62914561,
|
||||
"sent": true
|
||||
},
|
||||
"received_text": "Frame66\r",
|
||||
"click_received": true,
|
||||
"release_received": true,
|
||||
"passed": true,
|
||||
"input_helper_exited": true,
|
||||
"recorder_exit": 0,
|
||||
"recorder_stderr": "",
|
||||
"final_focus": {
|
||||
"window": null
|
||||
},
|
||||
"final_activity": 3,
|
||||
"owned_lock_released": true,
|
||||
"implementation_commit": "5641d3c316dfe225321f7233840cc83ff8c3f527",
|
||||
"device": {
|
||||
"steamos": "0.5.6",
|
||||
"build_id": "20261015.6141207",
|
||||
"steamvr": "2.18.2",
|
||||
"battery_before": 98,
|
||||
"battery_after": 98
|
||||
},
|
||||
"delayed_cleanup": {
|
||||
"time": "2026-10-24T11:21:46Z",
|
||||
"shared_lock_absent": true,
|
||||
"owned_recorder_absent": true,
|
||||
"game_mode": "active",
|
||||
"full_plasma": "inactive",
|
||||
"steam_pid": 297826,
|
||||
"vrserver_pid": 297506,
|
||||
"focusable_windows": [],
|
||||
"focused_windows": [],
|
||||
"activity_level": 3
|
||||
},
|
||||
"limits": [
|
||||
"No wearer or packaged Electron/GUI interaction",
|
||||
"ASCII only; Unicode and cross-service ordering not tested on device",
|
||||
"The positioning setup reached the recorder edge (639,399); pixel-accurate absolute targeting is not established by this probe"
|
||||
]
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
"""Disposable X11 event recorder used for the PR #66 focused-input observation."""
|
||||
import ctypes as C
|
||||
import json
|
||||
import os
|
||||
import select
|
||||
import signal
|
||||
import time
|
||||
|
||||
X = C.CDLL('libX11.so.6')
|
||||
P, U = C.c_void_p, C.c_ulong
|
||||
for name, restype, args in [
|
||||
('XOpenDisplay', P, [C.c_char_p]), ('XDefaultRootWindow', U, [P]),
|
||||
('XCreateSimpleWindow', U, [P, U, C.c_int, C.c_int, C.c_uint, C.c_uint, C.c_uint, U, U]),
|
||||
('XInternAtom', U, [P, C.c_char_p, C.c_int]),
|
||||
('XChangeProperty', C.c_int, [P, U, U, U, C.c_int, C.c_int, P, C.c_int]),
|
||||
('XStoreName', C.c_int, [P, U, C.c_char_p]),
|
||||
('XSelectInput', C.c_int, [P, U, C.c_long]), ('XMapWindow', C.c_int, [P, U]),
|
||||
('XFlush', C.c_int, [P]), ('XPending', C.c_int, [P]),
|
||||
('XConnectionNumber', C.c_int, [P]), ('XNextEvent', C.c_int, [P, P]),
|
||||
('XLookupString', C.c_int, [P, P, C.c_int, P, P]),
|
||||
('XDestroyWindow', C.c_int, [P, U]), ('XCloseDisplay', C.c_int, [P]),
|
||||
]:
|
||||
fn = getattr(X, name)
|
||||
fn.restype, fn.argtypes = restype, args
|
||||
|
||||
class InputEvent(C.Structure):
|
||||
_fields_ = [('type', C.c_int), ('serial', U), ('send_event', C.c_int),
|
||||
('display', P), ('window', U), ('root', U), ('subwindow', U),
|
||||
('time', U), ('x', C.c_int), ('y', C.c_int), ('x_root', C.c_int),
|
||||
('y_root', C.c_int), ('state', C.c_uint), ('code', C.c_uint),
|
||||
('same_screen', C.c_int)]
|
||||
|
||||
class Event(C.Union):
|
||||
_fields_ = [('type', C.c_int), ('input', InputEvent), ('pad', C.c_long * 24)]
|
||||
|
||||
def say(**row):
|
||||
print(json.dumps(row), flush=True)
|
||||
|
||||
def end(*_):
|
||||
raise TimeoutError('probe ended')
|
||||
|
||||
signal.signal(signal.SIGTERM, end)
|
||||
signal.signal(signal.SIGALRM, end)
|
||||
signal.alarm(45)
|
||||
d = X.XOpenDisplay(b':0')
|
||||
assert d, 'X display unavailable'
|
||||
w = 0
|
||||
try:
|
||||
w = X.XCreateSimpleWindow(d, X.XDefaultRootWindow(d), 0, 0, 640, 400, 0, 0, 0x224466)
|
||||
for name, value in [(b'STEAM_GAME', 2000999066), (b'_NET_WM_PID', os.getpid())]:
|
||||
val = U(value)
|
||||
X.XChangeProperty(d, w, X.XInternAtom(d, name, 0), 6, 32, 0, C.byref(val), 1)
|
||||
X.XStoreName(d, w, b'Frame Control PR66 disposable input probe')
|
||||
X.XSelectInput(d, w, 1 | 2 | 4 | 8 | 64 | 32768 | 2097152)
|
||||
X.XMapWindow(d, w)
|
||||
X.XFlush(d)
|
||||
say(ready=True, window=w, pid=os.getpid(), display=':0', appid=2000999066)
|
||||
while True:
|
||||
while X.XPending(d):
|
||||
event = Event()
|
||||
X.XNextEvent(d, C.byref(event))
|
||||
if event.type in (2, 3, 4, 5, 6):
|
||||
e = event.input
|
||||
row = dict(type=event.type, window=e.window, x=e.x, y=e.y,
|
||||
synthetic=bool(e.send_event))
|
||||
if event.type != 6:
|
||||
row['code'] = e.code
|
||||
if event.type == 2:
|
||||
buf, keysym = C.create_string_buffer(32), U()
|
||||
n = X.XLookupString(C.byref(e), buf, 32, C.byref(keysym), None)
|
||||
row.update(text=buf.raw[:n].decode('utf-8', 'replace'), keysym=keysym.value)
|
||||
say(**row)
|
||||
ready, _, _ = select.select([0, X.XConnectionNumber(d)], [], [], 0.2)
|
||||
if 0 in ready and not os.read(0, 1024):
|
||||
break
|
||||
except TimeoutError:
|
||||
pass
|
||||
finally:
|
||||
if w:
|
||||
X.XDestroyWindow(d, w)
|
||||
X.XCloseDisplay(d)
|
||||
say(cleaned=True)
|
||||
@@ -1,168 +0,0 @@
|
||||
# Saved panel layouts: feasibility recheck, 2026-10-24
|
||||
|
||||
Issue: [#31](https://github.com/saphid/frame-control/issues/31). Base: main
|
||||
`5b47cd3`. This investigation covers spatial save/restore for existing
|
||||
Steam/gamescope panels without another overlay application.
|
||||
|
||||
## Decision and user behavior
|
||||
|
||||
Keep saved layouts unavailable. The current Frame exposes some geometry,
|
||||
including a standing-space coordinate transform, but this investigation did
|
||||
not establish a complete dock-state snapshot or a controlled restore path for
|
||||
these panels. The existing companion/headset switcher still lists panels and
|
||||
requests focus; users arrange them with SteamVR's dashboard controls. No layout
|
||||
file, new control, overlay application or background service is added.
|
||||
|
||||
This is a limit of the investigated route, not proof that every native
|
||||
implementation is impossible. In particular, failure of
|
||||
`GetOverlayTransformAbsolute` does **not** mean all pose readback is denied.
|
||||
|
||||
## Device and read-only results
|
||||
|
||||
SteamOS **0.5.6**, BUILD_ID **20261015.6141207**; `vrcmd --version`:
|
||||
**2.18.2**. `gamescope-session.service` was active and
|
||||
`plasma-workspace.target` inactive: Game Mode. gamescope used the OpenVR backend
|
||||
and `--virtual-connector-strategy PerAppId`. Battery was 99%, Not charging,
|
||||
before the probe and 100%, Full, afterwards.
|
||||
|
||||
The [exact probe](panel-layout-2026-10-24/probe.py) loads only
|
||||
`FnTable:IVROverlay_028` from the shipped
|
||||
`/opt/steamvr/bin/linuxarm64/libopenvr_api.so`. It uses application type 3
|
||||
(`VRApplication_Background`, avoiding runtime startup) and shuts down its own
|
||||
OpenVR connection in `finally`. Initialization and interface acquisition both
|
||||
returned 0. It calls getters only, with no image capture or input injection.
|
||||
|
||||
[Raw result](panel-layout-2026-10-24/readback.json):
|
||||
|
||||
| Getter | `valve.steam.desktopgame.0` | `valve.steam.gamepadui.main` |
|
||||
|---|---|---|
|
||||
| FindOverlay | 0, Success | 0, Success |
|
||||
| Rendering process | `gamescope-wl` | `gamescope-wl` |
|
||||
| Width | 0; 2.6700000763 m | 0; 2.6670000553 m |
|
||||
| Curvature | 0; 0 | 0; 0 |
|
||||
| Transform type | 0; 5, DashboardTab | 0; 5, DashboardTab |
|
||||
| Absolute transform | 18, WrongTransformType | 18, WrongTransformType |
|
||||
| Tracked-device-relative transform | 18, WrongTransformType | 18, WrongTransformType |
|
||||
| Coordinate transform, center, standing origin | 0; identity matrix | 0; scaled/translated matrix |
|
||||
| Coordinate transform, center, seated origin | 23, RequestFailed | 23, RequestFailed |
|
||||
| Coordinate transform, center, raw origin | 23, RequestFailed | 23, RequestFailed |
|
||||
|
||||
The dashboard and both panels were reported hidden; neither panel was active.
|
||||
The standing-space matrix is the transform for the overlay point `(0.5, 0.5)`;
|
||||
it does not identify World/Dashboard/Theater/controller docking or recreate a
|
||||
dashboard frame. The Steam panel's basis has scale about 0.369. Treat neither
|
||||
that scaled matrix nor the hidden Gamescope panel's identity as a validated
|
||||
physical placement to feed to an absolute-transform setter. Visible placement,
|
||||
matrix freshness and correspondence to dashboard size were not checked by a
|
||||
wearer.
|
||||
|
||||
## API and dashboard boundary
|
||||
|
||||
The ABI and result names were checked against Valve's
|
||||
[OpenVR v2.12.14 C header](https://github.com/ValveSoftware/openvr/blob/v2.12.14/headers/openvr_capi.h)
|
||||
and [C++ interface comments](https://github.com/ValveSoftware/openvr/blob/v2.12.14/headers/openvr.h).
|
||||
That header declares `IVROverlay_028`; its SHA-256 is
|
||||
`d58a2b149e434b2b8ee25cb4253ca6157feed8092f621e78ecfed6846d35d3e4`.
|
||||
The absolute getter is explicitly limited to absolute transforms. The
|
||||
coordinate getter returns the 3D transform for a 2D overlay point. Public
|
||||
`IVROverlay_028` has no getter/setter pair for dashboard dock location or frame
|
||||
scene-graph state. The probe fails closed if that exact interface is absent.
|
||||
|
||||
Read-only inspection of the shipped dashboard
|
||||
`/opt/steamvr/resources/webinterface/dashboard/chunk~8012d0c89.js`
|
||||
(SHA-256 `937ec62c67a481f030a416099ceb98b0fe2a702aea5a0705601c6c40d4969f6d`)
|
||||
found:
|
||||
|
||||
- `dockLocation` reads an internal `_getDockLocation(frameID)` store;
|
||||
`SetDockLocation` updates that store or sends a VRLink request.
|
||||
- `m_mapLastRelativeTransformForDockLocation` keeps per-location transforms.
|
||||
World initialization requests a dashboard scene-graph transform through
|
||||
`requestSGTransform`, then updates the component's `xfTransform`.
|
||||
- The `vrcmd_dock_overlay` handler accepts `dashboard`, `lefthand`, `righthand`,
|
||||
`theater` and `world`. It selects the frame associated with the supplied key,
|
||||
**falls back to the active frame if no match exists**, sets dock location and
|
||||
may switch frame. This is not an exact pose restore or a readback response.
|
||||
|
||||
Those are observations of shipped internal code, not proof that Frame Control
|
||||
can safely access its state through a supported external API. No dashboard
|
||||
JavaScript was injected, private store edited or VRLink command sent. The
|
||||
active-frame fallback is an additional reason not to experiment with docking
|
||||
commands on a stale key.
|
||||
|
||||
The [2026-09-28 probe](../panels.md#saved-spatial-layouts-blocked-on-the-current-panel-route)
|
||||
on SteamOS 0.4.1 / SteamVR 2.18.1 recorded an absolute setter returning
|
||||
12 (`PermissionDenied`) on a temporary, test-owned gamescope panel. That setter
|
||||
result is **historical**, not a new test on 2.18.2. The newer read-only results
|
||||
above neither overturn nor reverify it.
|
||||
|
||||
## Commands, safety and cleanup
|
||||
|
||||
Read-only inspection used `ssh frame` with `BatchMode=yes` and
|
||||
`ConnectTimeout=10`, `cat /etc/os-release`, battery sysfs reads,
|
||||
`systemctl --user is-active gamescope-session.service plasma-workspace.target`,
|
||||
process inspection, and `vrcmd --version`, `--help`, `--overlays`. An initial
|
||||
`--listoverlays` attempt returned `Unknown command`; `--overlays` is the actual
|
||||
enumeration command. Dashboard sources were read/copied to local `/tmp` for
|
||||
inspection. No files were installed on the Frame.
|
||||
|
||||
Run the retained probe from the repository root, following
|
||||
[the shared-device rules](../testing.md#headset-smoke-test). Stop if the lock is
|
||||
occupied or battery is at/below 20%; never remove another task's lock:
|
||||
|
||||
```sh
|
||||
ssh -o BatchMode=yes -o ConnectTimeout=10 frame \
|
||||
'set -eu; mkdir /tmp/frame-test.lock || exit 3; trap "rmdir /tmp/frame-test.lock" EXIT; timeout 25 python3 -' \
|
||||
< docs/evidence/panel-layout-2026-10-24/probe.py
|
||||
```
|
||||
|
||||
This command acquired the lock, completed with exit 0 and released it. A
|
||||
subsequent check confirmed the lock absent, Game Mode active, and Steam,
|
||||
`vrserver` and `vrcompositor` running. The probe's only headset filesystem
|
||||
change was creating/removing that shared lock. Its Python source ran from
|
||||
stdin. There were no test panels, installs, profiles or services to remove.
|
||||
|
||||
No mutation test was essential: without verified dock/relative-frame readback,
|
||||
there was no exact original layout and bounded rollback to justify changing a
|
||||
panel. Existing user panels were never focused, shown, hidden, resized, moved
|
||||
or docked. No global settings, security, passwords, runtime processes or modes
|
||||
were changed; no reboot or reset occurred.
|
||||
|
||||
## Validation and remaining gaps
|
||||
|
||||
Existing `tests/test_panels.py` covers main-panel enumeration, hidden panels,
|
||||
focus revalidation, unavailable-runtime errors and HTTP authentication/Host/
|
||||
Origin guards. `tests/test_page_scripts.py` checks the production page's shared
|
||||
JavaScript scope. These offline checks do not prove spatial placement. The
|
||||
retained probe is evidence tooling, not a new product API; no fake layout
|
||||
backend or layout tests claiming device support were added.
|
||||
|
||||
Validation passed:
|
||||
|
||||
```sh
|
||||
python3 -m unittest discover -s tests -p test_panels.py -v # 8 passed
|
||||
python3 -m unittest discover -s tests -p test_page_scripts.py -v # 5 passed
|
||||
python3 -m py_compile docs/evidence/panel-layout-2026-10-24/probe.py
|
||||
python3 -m json.tool docs/evidence/panel-layout-2026-10-24/readback.json
|
||||
git diff --check
|
||||
```
|
||||
|
||||
The initial panel-suite attempt hit sandbox socket restrictions in four HTTP
|
||||
tests; rerunning with loopback sockets permitted passed all eight. No real
|
||||
headset connection is used by those tests. The full suite and fake Frame were
|
||||
not run for this evidence-only change.
|
||||
|
||||
Before shipping layouts, a native route still needs proof of dock state and
|
||||
relative-frame readback, authorized restore on an owned test panel with exact
|
||||
rollback, and correspondence between saved size/pose and visible placement.
|
||||
It also needs stable source identity and a fresh capture-permission/ticket
|
||||
flow when reopening viewers. Reconnect, panel recreation, reboot recovery,
|
||||
Steam-launched gameplay, controller docking and worn-headset input were not
|
||||
tested here. The existing Frame Control-owned media renderer is not proof that
|
||||
Steam/gamescope panels can be restored. No third-party overlay app was used.
|
||||
|
||||
## Announcement
|
||||
|
||||
We rechecked saved panel layouts on SteamOS 0.5.6. SteamVR exposes some panel
|
||||
geometry, but we have not verified safe restoration of Steam's panel positions
|
||||
and docking. Saved layouts remain unavailable; use SteamVR's dashboard to
|
||||
arrange panels. The panel switcher continues to list and show open panels.
|
||||
@@ -1,89 +0,0 @@
|
||||
"""Read-only issue #31 probe; pipe to `ssh frame 'timeout 25 python3 -'`.
|
||||
|
||||
Acquire /tmp/frame-test.lock first per docs/testing.md. No overlay is created,
|
||||
focused, docked or changed. Background init (3) does not start SteamVR.
|
||||
ABI: ValveSoftware/openvr v2.12.14 headers/openvr_capi.h, IVROverlay_028.
|
||||
"""
|
||||
import ctypes as C
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
H = C.c_uint64
|
||||
Matrix = C.c_float * 12
|
||||
|
||||
|
||||
class Vector2(C.Structure):
|
||||
_fields_ = [('v', C.c_float * 2)]
|
||||
|
||||
|
||||
def probe():
|
||||
vr = C.CDLL('/opt/steamvr/bin/linuxarm64/libopenvr_api.so')
|
||||
vr.VR_InitInternal2.argtypes = [C.POINTER(C.c_int), C.c_int, C.c_char_p]
|
||||
vr.VR_InitInternal2.restype = C.c_uint32
|
||||
vr.VR_GetGenericInterface.argtypes = [C.c_char_p, C.POINTER(C.c_int)]
|
||||
vr.VR_GetGenericInterface.restype = C.c_void_p
|
||||
vr.VR_ShutdownInternal.argtypes = []
|
||||
vr.VR_ShutdownInternal.restype = None
|
||||
err = C.c_int()
|
||||
vr.VR_InitInternal2(C.byref(err), 3, None)
|
||||
report = {'init_error': err.value, 'interface': 'IVROverlay_028', 'panels': []}
|
||||
if err.value:
|
||||
return report
|
||||
try:
|
||||
ptr = vr.VR_GetGenericInterface(b'FnTable:IVROverlay_028', C.byref(err))
|
||||
report['interface_error'] = err.value
|
||||
if err.value or not ptr:
|
||||
return report
|
||||
table = C.cast(ptr, C.POINTER(C.c_void_p))
|
||||
|
||||
def function(slot, result, *args):
|
||||
return C.CFUNCTYPE(result, *args)(table[slot])
|
||||
|
||||
def read(slot, handle, output_type):
|
||||
output = output_type()
|
||||
rc = function(slot, C.c_int, H, C.POINTER(output_type))(handle, C.byref(output))
|
||||
return {'rc': rc, 'value': output.value if rc == 0 else None}
|
||||
|
||||
report['dashboard_visible'] = function(68, C.c_bool)()
|
||||
for key in ('valve.steam.desktopgame.0', 'valve.steam.gamepadui.main'):
|
||||
row = {'key': key}
|
||||
report['panels'].append(row)
|
||||
handle = H()
|
||||
row['find_rc'] = function(0, C.c_int, C.c_char_p, C.POINTER(H))(
|
||||
key.encode(), C.byref(handle))
|
||||
if row['find_rc']:
|
||||
continue
|
||||
pid = function(10, C.c_uint32, H)(handle)
|
||||
row['rendering_pid'] = pid
|
||||
try:
|
||||
row['rendering_comm'] = Path('/proc/%d/comm' % pid).read_text().strip()
|
||||
except OSError:
|
||||
row['rendering_comm'] = None
|
||||
row['visible'] = function(45, C.c_bool, H)(handle)
|
||||
row['active_dashboard'] = function(69, C.c_bool, H)(handle)
|
||||
row['width_m'] = read(23, handle, C.c_float)
|
||||
row['curvature'] = read(25, handle, C.c_float)
|
||||
row['transform_type'] = read(32, handle, C.c_int)
|
||||
for name, slot, scalar in (('absolute', 34, C.c_int),
|
||||
('tracked_device_relative', 36, C.c_uint32)):
|
||||
origin = scalar()
|
||||
matrix = Matrix()
|
||||
rc = function(slot, C.c_int, H, C.POINTER(scalar), C.POINTER(Matrix))(
|
||||
handle, C.byref(origin), C.byref(matrix))
|
||||
row[name] = {'rc': rc, 'origin_or_device': origin.value if rc == 0 else None,
|
||||
'matrix': list(matrix) if rc == 0 else None}
|
||||
row['coordinate_transforms'] = []
|
||||
for origin in (0, 1, 2): # seated, standing, raw/uncalibrated
|
||||
matrix = Matrix()
|
||||
rc = function(46, C.c_int, H, C.c_int, Vector2, C.POINTER(Matrix))(
|
||||
handle, origin, Vector2((.5, .5)), C.byref(matrix))
|
||||
row['coordinate_transforms'].append({
|
||||
'tracking_origin': origin, 'coordinates': [.5, .5], 'rc': rc,
|
||||
'matrix': list(matrix) if rc == 0 else None})
|
||||
return report
|
||||
finally:
|
||||
vr.VR_ShutdownInternal()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(json.dumps(probe(), indent=2, allow_nan=False))
|
||||
@@ -1,152 +0,0 @@
|
||||
{
|
||||
"init_error": 0,
|
||||
"interface": "IVROverlay_028",
|
||||
"panels": [
|
||||
{
|
||||
"key": "valve.steam.desktopgame.0",
|
||||
"find_rc": 0,
|
||||
"rendering_pid": 297037,
|
||||
"rendering_comm": "gamescope-wl",
|
||||
"visible": false,
|
||||
"active_dashboard": false,
|
||||
"width_m": {
|
||||
"rc": 0,
|
||||
"value": 2.6700000762939453
|
||||
},
|
||||
"curvature": {
|
||||
"rc": 0,
|
||||
"value": 0.0
|
||||
},
|
||||
"transform_type": {
|
||||
"rc": 0,
|
||||
"value": 5
|
||||
},
|
||||
"absolute": {
|
||||
"rc": 18,
|
||||
"origin_or_device": null,
|
||||
"matrix": null
|
||||
},
|
||||
"tracked_device_relative": {
|
||||
"rc": 18,
|
||||
"origin_or_device": null,
|
||||
"matrix": null
|
||||
},
|
||||
"coordinate_transforms": [
|
||||
{
|
||||
"tracking_origin": 0,
|
||||
"coordinates": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"rc": 23,
|
||||
"matrix": null
|
||||
},
|
||||
{
|
||||
"tracking_origin": 1,
|
||||
"coordinates": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"rc": 0,
|
||||
"matrix": [
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"tracking_origin": 2,
|
||||
"coordinates": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"rc": 23,
|
||||
"matrix": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "valve.steam.gamepadui.main",
|
||||
"find_rc": 0,
|
||||
"rendering_pid": 297037,
|
||||
"rendering_comm": "gamescope-wl",
|
||||
"visible": false,
|
||||
"active_dashboard": false,
|
||||
"width_m": {
|
||||
"rc": 0,
|
||||
"value": 2.6670000553131104
|
||||
},
|
||||
"curvature": {
|
||||
"rc": 0,
|
||||
"value": 0.0
|
||||
},
|
||||
"transform_type": {
|
||||
"rc": 0,
|
||||
"value": 5
|
||||
},
|
||||
"absolute": {
|
||||
"rc": 18,
|
||||
"origin_or_device": null,
|
||||
"matrix": null
|
||||
},
|
||||
"tracked_device_relative": {
|
||||
"rc": 18,
|
||||
"origin_or_device": null,
|
||||
"matrix": null
|
||||
},
|
||||
"coordinate_transforms": [
|
||||
{
|
||||
"tracking_origin": 0,
|
||||
"coordinates": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"rc": 23,
|
||||
"matrix": null
|
||||
},
|
||||
{
|
||||
"tracking_origin": 1,
|
||||
"coordinates": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"rc": 0,
|
||||
"matrix": [
|
||||
0.3689989447593689,
|
||||
0.0,
|
||||
0.0008894503116607666,
|
||||
-0.5048462152481079,
|
||||
0.0,
|
||||
0.36899998784065247,
|
||||
0.0,
|
||||
1.2510287761688232,
|
||||
-0.0008894503116607666,
|
||||
0.0,
|
||||
0.3689989447593689,
|
||||
-1.1726053953170776
|
||||
]
|
||||
},
|
||||
{
|
||||
"tracking_origin": 2,
|
||||
"coordinates": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"rc": 23,
|
||||
"matrix": null
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"interface_error": 0,
|
||||
"dashboard_visible": false
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 188 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 80 KiB |
@@ -1,118 +0,0 @@
|
||||
# Linux Wireless Adapter doctor
|
||||
|
||||

|
||||
|
||||
On the **Linux PC**, open **Settings → Linux Wireless Adapter doctor**, or
|
||||
**Devices & connection → Linux Wireless Adapter doctor**. It works without a
|
||||
connected headset. Choose **Read PC device inventory**, select the intended
|
||||
USB device or wireless interface, then **Check selected device**. Nothing runs
|
||||
until requested. Re-read the inventory after reconnecting a device.
|
||||
|
||||
From a source checkout, the same collector is available without starting the
|
||||
app or its headset connection workers:
|
||||
|
||||
```sh
|
||||
python3 ui/frame_wireless_doctor.py
|
||||
python3 ui/frame_wireless_doctor.py --device net:wlan0
|
||||
python3 ui/frame_wireless_doctor.py --device usb:1-2 --json > adapter-report.json
|
||||
```
|
||||
|
||||
Use a selector actually listed on your PC. No device is selected automatically.
|
||||
All USB devices are included, including hubs and devices without a network
|
||||
interface. A product label, observed VID/PID, or a single available interface
|
||||
**does not identify Valve's adapter**. There is no trusted adapter ID table in
|
||||
this feature. Compare inventory before and after reconnecting the intended
|
||||
adapter when safe. For a USB device exposing multiple wireless interfaces,
|
||||
select the specific interface for radio/manager evidence.
|
||||
|
||||
## Evidence and limits
|
||||
|
||||
- **Presence and binding:** `/sys/bus/usb/devices` and `/sys/class/net` correlate
|
||||
USB ancestry, wireless interfaces, driver links and module links. An absent
|
||||
interface does not establish which driver should be installed. A missing
|
||||
module link may mean a built-in driver. A bound driver does not prove Steam
|
||||
streaming support.
|
||||
- **Permissions and udev:** `udevadm info --query=property` supplies a small
|
||||
allowlist of driver, ID and tag fields. If available, the report includes USB
|
||||
node mode, owner/group IDs and the current user's read/write access. Direct
|
||||
USB access is not necessarily required by kernel networking; a restrictive
|
||||
node alone is not diagnosed as the cause. No udev rules are installed or run.
|
||||
- **Radio blocks:** read-only WLAN rfkill sysfs entries are matched to the
|
||||
selected interface's PHY name. An unrelated block cannot establish that
|
||||
this adapter is blocked. Unavailable or unmatched entries remain unknown.
|
||||
- **Channel/band:** `iw dev IFACE info` provides the current channel and
|
||||
frequency where reported; `iw phy PHY info` supplies enabled frequencies.
|
||||
An idle interface may have no current channel. These observations do not
|
||||
establish the channel used by a Steam streaming session, supported regions,
|
||||
or the correct regulatory setting.
|
||||
- **Network managers:** visible `/proc/*/comm` process names show
|
||||
NetworkManager, iwd and wpa_supplicant. `nmcli` reads only the selected
|
||||
interface's general state, managed flag and driver. NetworkManager can use
|
||||
iwd or wpa_supplicant as its backend, so coexistence is not itself a conflict.
|
||||
If both backends are visible, the report suggests checking who owns this
|
||||
exact interface. It does not claim a confirmed conflict or stop services.
|
||||
Restricted process visibility and unverified backend ownership are explicit.
|
||||
|
||||
Every command uses fixed read-only arguments, no shell, closed stdin and a
|
||||
three-second timeout. Optional tools are not installed automatically. Missing
|
||||
tools, denied reads, disappearing devices, and restricted VM/container hardware
|
||||
visibility remain unknown. A successful report is a snapshot, not a hardware
|
||||
health certificate. CLI exit 0 means collection is supported, not that the
|
||||
adapter works; unsupported platforms/headset-local mode return 2, as does an
|
||||
invalid/stale selector. JSON has schema version 1.
|
||||
|
||||
The doctor never uses SSH, scans nearby Wi-Fi networks, opens a connection to
|
||||
the Frame, escalates privileges, loads drivers, changes security settings,
|
||||
changes channels, unblocks radios, changes network settings, or restarts
|
||||
services. Run it as your ordinary user, never with sudo. The app hides the
|
||||
entry on macOS, Windows and phone sessions; its API refuses collection in
|
||||
headset-local (`FRAME_LOCAL=1`) mode. The source CLI is intended only for the PC.
|
||||
|
||||
Reports stay local unless you explicitly save, copy or share them. Exported
|
||||
fields include observed USB IDs/product labels, interface names, driver names
|
||||
and permission metadata. USB serials, Wi-Fi names, MAC/IP address fields,
|
||||
credentials, process arguments and raw command output are not exported. Review
|
||||
the report before posting it: hardware labels and local paths can identify
|
||||
parts of your setup.
|
||||
|
||||
## Motivation and shipped comparison
|
||||
|
||||
[The 23 October 2026 complaint](https://x.com/ExpressGinga81/status/2113457683143741720)
|
||||
says the Wi-Fi dongle does not work on Ubuntu/Kubuntu 26.04 while SteamVR works
|
||||
under Wayland. It supplies **no adapter VID/PID, driver, logs or established
|
||||
cause**. This feature helps gather that missing evidence; it does not claim to
|
||||
fix that complaint or certify Ubuntu/Kubuntu 26.04 support.
|
||||
|
||||
Shipped **v0.4.18** has local network/gateway discovery in `frame_network.py`
|
||||
and headset connection management, but no local USB/driver/rfkill adapter
|
||||
report or adapter diagnostic UI. The existing `frame-doctor.sh` diagnoses the
|
||||
headset through SSH and is a different tool. This doctor never calls it.
|
||||
General SteamOS 3.9.5 / Frame OS 0.5.6 compatibility and OS backend transition
|
||||
notes are covered separately in
|
||||
[`docs/steamos-2026-10-compat.md`](https://github.com/saphid/frame-control/blob/9c7110c1f48d160b0fb3c3b9f658d4937bd2032d/docs/steamos-2026-10-compat.md)
|
||||
([PR #164](https://github.com/saphid/frame-control/pull/164)). Existing PC
|
||||
route/SSID diagnostics use NetworkManager's `nmcli` with an `iwgetid` SSID
|
||||
fallback, independently of whether NetworkManager uses wpa_supplicant (SteamOS
|
||||
3.9.5 new installs) or iwd (upgrades). This doctor reads actual PC evidence and
|
||||
does not infer a conflict, hardware identity or fix from those OS defaults.
|
||||
There is no adapter-specific device observation in that compatibility work.
|
||||
|
||||
## Verification
|
||||
|
||||
```sh
|
||||
python3 -m unittest discover -s tests -p test_wireless_doctor.py -v
|
||||
python3 -m unittest discover -s tests
|
||||
```
|
||||
|
||||
Tests use an explicitly synthetic USB `1234:5678`, sysfs trees, command replies
|
||||
and loopback HTTP. They cover an unbound USB device, module binding, multiple
|
||||
interfaces, PHY-matched and unrelated rfkill entries, channel parsing, manager
|
||||
coexistence, missing/denied commands, stale/injected selectors, export field
|
||||
filtering, authentication and refusal to probe in headset-local mode. The
|
||||
HTTP tests instantiate the handler without starting headset workers.
|
||||
|
||||
Linux host collection was exercised on kernel `6.8.0-139-generic`: an existing
|
||||
PC interface was visible with its `iwlwifi` binding and unblocked PHY; `iw` and
|
||||
`nmcli` were absent and reported as unavailable. This is **not a physical Steam
|
||||
Frame Wireless Adapter test**, an Ubuntu/Kubuntu 26.04 test, or a headset test.
|
||||
No Frame access is part of this work.
|
||||
+1
-18
@@ -190,24 +190,7 @@ HTTP focus is not evidence of worn-headset laser input. Follow the
|
||||
|
||||
## Saved spatial layouts: blocked on the current panel route
|
||||
|
||||
**Rechecked 2026-10-24**, SteamOS 0.5.6, BUILD_ID `20261015.6141207`,
|
||||
SteamVR 2.18.2: a read-only probe of the existing Gamescope and Steam main
|
||||
panels still reports type 5 (`DashboardTab`), and both the absolute and
|
||||
tracked-device-relative getters return 18 (`WrongTransformType`). Width and
|
||||
curvature read successfully. **Some pose readback is available:**
|
||||
`GetTransformForOverlayCoordinates` at the panel center succeeds in standing
|
||||
space; seated and raw origins return 23 (`RequestFailed`). Both panels and the
|
||||
dashboard were hidden. That matrix snapshot does not identify docking, prove
|
||||
visible placement, or establish a restore operation. The shipped dashboard
|
||||
stores dock location and relative transforms internally; no supported external
|
||||
snapshot/restore pair was established. No setters or docking commands were run
|
||||
in this recheck. See the [exact probe, results, cleanup and remaining
|
||||
gaps](evidence/panel-layout-2026-10-24.md). Saved layouts remain unavailable.
|
||||
|
||||
### Earlier mutation evidence (2026-09-28)
|
||||
|
||||
**Verified 2026-09-28**, SteamOS 0.4.1, BUILD_ID `20260925.6191901`,
|
||||
SteamVR 2.18.1, using a temporary xterm panel with
|
||||
**Verified 2026-09-28**, same build, using a temporary xterm panel with
|
||||
`STEAM_GAME=2000999031` and `FnTable:IVROverlay_028` from
|
||||
`/opt/steamvr/bin/linuxarm64/libopenvr_api.so`:
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# PC in the headset (Experimental)
|
||||
|
||||
For Steam's own Linux Wayland desktop-sharing flow, see the separate
|
||||
[Steam desktop sharing helper](steam-pipewire.md). It does not enable this
|
||||
feature on Linux.
|
||||
|
||||
**Tools → PC in the headset**, on Windows only. It's the Windows version of
|
||||
[Mac in the headset](mac-in-headset.md): a whole screen on your PC
|
||||
becomes its own SteamVR panel in the Frame. Individual windows are available only
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
# Steam desktop sharing on a Linux PC
|
||||
|
||||
**Tools → Steam desktop sharing** helps with Steam's own `steam -pipewire`
|
||||
desktop-in-headset flow on a local Wayland PC. It needs no Frame connection.
|
||||
It is separate from Frame Control's [PC in the headset](pc-in-headset.md),
|
||||
which remains disabled on Linux. Steam and the desktop portal own the capture,
|
||||
screen picker and headset flow; this helper does not provide a stream.
|
||||
|
||||
## Launch Steam with PipeWire
|
||||
|
||||
Save your game and use **Steam → Exit** first. Then click **Launch Steam with
|
||||
PipeWire**. Frame Control checks this user's local processes, finds `steam` on
|
||||
PATH, and requests `steam -pipewire`. This flag applies to that launch only.
|
||||
No Steam settings, login files or startup entries are changed. An existing
|
||||
Steam session is never stopped, signalled or silently switched.
|
||||
|
||||
If Steam or a Steam launcher/helper is running, the button explains that Steam
|
||||
must be exited first. If the process inventory cannot be read, it refuses to
|
||||
launch. It also refuses root, SSH, headless, X11 and Flatpak-sandboxed Frame
|
||||
Control sessions. Run Frame Control as your normal user in the local Wayland
|
||||
desktop with its session bus.
|
||||
|
||||
For a Flatpak-only Steam install without a `steam` command on PATH, the helper
|
||||
provides a manual command instead of choosing an installation for you. After
|
||||
exiting Steam, run `flatpak run com.valvesoftware.Steam -pipewire` in a local
|
||||
terminal. Flatpak Steam processes are included in the existing-session check.
|
||||
|
||||
A successful request is **not confirmation of a picker or stream**. Steam may
|
||||
exit or fail after the initial check, and another launcher can race the local
|
||||
process check. Do not start Steam elsewhere at the same time. If nothing opens,
|
||||
run the command yourself in a terminal to see Steam's error.
|
||||
|
||||
## Reset screen-share choice
|
||||
|
||||
Click **Reset screen-share choice…** to request KDE's **Application Permissions**
|
||||
page. This button does **not** revoke anything or report a completed reset.
|
||||
Frame Control cannot reliably map a Steam runtime display name to a
|
||||
Steam-specific portal grant or restore token across backends. It never reads,
|
||||
edits or clears the portal permission store or Steam tokens.
|
||||
|
||||
On KDE:
|
||||
|
||||
1. Open **System Settings → Applications → Application Permissions** if the
|
||||
button cannot open it.
|
||||
2. Find the entry for Steam. The Ubuntu 26.04 KDE report showed **Steam Linux
|
||||
Runtime 3.0**. That display name alone is not proof that every session there
|
||||
is safe to remove; verify the session belongs to your Steam desktop share.
|
||||
3. Under **Screen sharing**, choose **Manage 1 Session** (the count may differ).
|
||||
4. Choose **Revoke** for that verified session only. **Do not use Revoke All**
|
||||
or change another application's grants. If ownership is ambiguous, stop.
|
||||
5. Retry Steam's desktop sharing flow. The reporter saw the portal picker again
|
||||
after revoking that session. Results can differ by Steam and portal version.
|
||||
|
||||
The reported entry sometimes appeared intermittently. If it is missing, do not
|
||||
clear other entries or the whole portal store. Check again when Steam's sharing
|
||||
session is present. If **Application Permissions** itself is missing on
|
||||
Ubuntu/Kubuntu, check your distribution's `kde-config-flatpak` package: the
|
||||
reporter needed that package and a reboot before the page appeared. Frame
|
||||
Control does not install packages, reboot, request root or change security
|
||||
settings. Older KDE modules may lack this page; other desktops receive guidance
|
||||
only, with no automatic reset or guessed permission target.
|
||||
|
||||
The launcher uses `kcmshell6 --list` to verify the exact module, then
|
||||
`kcmshell6 kcm_app-permissions`. It does not substitute the older Flatpak-only
|
||||
page. A request to open the page does not prove that a window became visible.
|
||||
|
||||
## Evidence and limits
|
||||
|
||||
- User-supplied report and screenshot description:
|
||||
[ExpressGinga81's thread and replies](https://x.com/ExpressGinga81/status/2113242533530911058).
|
||||
The report describes Ubuntu 26.04 KDE, the initial picker appearing once,
|
||||
the Steam Linux Runtime 3.0 entry, and Revoke making the picker reappear.
|
||||
This is reported behavior, not a live test performed for this feature.
|
||||
- KDE upstream [`flatpak-kcm`](https://github.com/KDE/flatpak-kcm):
|
||||
`CMakeLists.txt` and `kcm_app-permissions.json` identify Application
|
||||
Permissions; `ui/SessionList.qml` distinguishes Revoke from Revoke All.
|
||||
- Automated tests mock Steam, processes and KDE commands. HTTP tests verify
|
||||
request guards, no actions on GET, and no headset work. Existing CI discovers
|
||||
these tests on Linux, macOS and Windows; they do not need a desktop portal.
|
||||
- lxso2 has no interactive Wayland/PipeWire portal for a chooser test.
|
||||
**No live chooser, revoke, Steam launch or headset display is verified here.**
|
||||
No Frame access was performed for this task, including during the hold before
|
||||
2026-10-24 13:00 UTC. The helper never invokes SSH or Frame controls.
|
||||
|
||||
## Announcement
|
||||
|
||||
Linux Wayland users can now find **Steam desktop sharing** under Tools to
|
||||
request Steam with `-pipewire` after exiting Steam, or open KDE's Application
|
||||
Permissions to revoke only a verified Steam screen-sharing session and try the
|
||||
picker again. Frame Control does not clear permissions automatically. This is
|
||||
help for Steam's own desktop-sharing flow; Frame Control's Linux capture
|
||||
feature remains disabled. Live picker behavior still needs desktop validation.
|
||||
+4
-29
@@ -154,31 +154,10 @@ two fingers to scroll, two-finger tap to right-click) plus a text field that
|
||||
types on the Frame. On a computer, clicking the pad passes your mouse and
|
||||
keyboard through to the Frame until you press Esc (⌘ is sent as Ctrl on a Mac).
|
||||
|
||||
Since Control (below), the pad goes through **gamescope's own input socket**
|
||||
([`ui/frame_touch.py`](../ui/frame_touch.py)), so it reaches whichever panel has
|
||||
focus, Steam's own menus included, and needs nothing installed on the Frame.
|
||||
Only characters that aren't on a US keyboard (accents, emoji) go through
|
||||
**KDE Connect** as below; it starts the first time you type one. (Before
|
||||
Control, everything went through KDE Connect, which is why the notes below
|
||||
describe it in detail.)
|
||||
|
||||
The server keyboard queue holds at most 200 events, including text being sent.
|
||||
A batch with an accent sends its whole keyboard part through KDE Connect, and
|
||||
later keys follow it there while typing is pending. If the batch will not fit,
|
||||
the server rejects it before sending any clicks or keys; the page keeps it and
|
||||
retries after polling. Accepted events are never evicted to make room. A timeout
|
||||
or helper failure retains unsent text and shows **Try again**; that button resumes
|
||||
the retained queue. The queue lives in memory and is lost if the server exits.
|
||||
Switching headsets cancels queued text and stops both input helpers before the
|
||||
new route is published. Both controls validate the intended headset before they
|
||||
start. Ordering between the two input services uses a typing-time estimate;
|
||||
neither service acknowledges when characters reach the application.
|
||||
|
||||
[PR #66 verification on 2026-10-24](evidence/pad-gamescope-2026-10-24.md)
|
||||
records an owned focused X11 panel receiving a click and `Frame66` plus Enter
|
||||
on a real Frame with SteamOS 0.5.6, after the shared headset became available.
|
||||
The helper, window and owner-marked lock were cleaned up. This is ASCII input
|
||||
proof, not wearer-visible, Unicode or packaged Electron GUI verification.
|
||||
It goes through **KDE Connect**, the first-party route (KDE makes the Frame's
|
||||
desktop): Frame Control's server runs [`ui/frame_input_agent.py`](../ui/frame_input_agent.py)
|
||||
on the Frame, which talks KDE Connect's own LAN protocol to the Frame's
|
||||
`kdeconnectd` as if it were a phone. KDE Connect does the typing and clicking.
|
||||
|
||||
**Verified 2026-09-28** (SteamOS 0.4.1, build 20260925.6191901):
|
||||
|
||||
@@ -316,10 +295,6 @@ How (**verified 2026-09-29**, SteamOS 0.4.1, build 20260925.6191901):
|
||||
if it persists, report the exact message and SteamOS version. The confirmed
|
||||
empty-list advice is retained when the property is present but empty.
|
||||
[2026-10-24 investigation and verification limits](evidence/panel-discovery-2026-10-24.md).
|
||||
A later [packaged v0.4.17 test on the real Frame](evidence/desktop-capture-packaged-2026-10-24.md)
|
||||
captured a mapped, focused nested KDE compositor on SteamOS 0.5.6. SteamVR
|
||||
still reported its overlay hidden, so that test does not establish the
|
||||
wearer's visible-desktop condition in #73 or justify closing it.
|
||||
- Tested from the iPhone app (Simulator): a tap on the Desktop view focused a
|
||||
text box in the panel and the text field typed into it; a trackpad move went
|
||||
exactly (+40, +25).
|
||||
|
||||
+1
-23
@@ -12,16 +12,6 @@ A fourth, a SteamOS VM, may come later ([issue #6](https://github.com/saphid/ste
|
||||
|
||||
## Unit tests
|
||||
|
||||
The gamescope keyboard/trackpad route has focused suites in `test_input.py`,
|
||||
`test_touch.py` and `test_service_regressions.py`. They cover pad translation,
|
||||
ASCII/modifier keys, Unicode queuing/retries, stale panel targets, release
|
||||
handling, route cancellation, and intended-headset start/status guards.
|
||||
`tests/page/pad_queue.mjs` and `tests/page/ctrl_gestures.mjs` execute the page's
|
||||
real queue and gesture functions in Node. These are offline tests; their
|
||||
acknowledgements do not prove that a real application received input.
|
||||
See [the 2026-10-24 PR #66 evidence](evidence/pad-gamescope-2026-10-24.md)
|
||||
for the real focused-panel click/key observation, cleanup and remaining limits.
|
||||
|
||||
The read-only power/heat sampler has fixture and transport tests in
|
||||
`tests/test_power_sample.py`. Run
|
||||
`python3 -m unittest discover -s tests -p test_power_sample.py -v`.
|
||||
@@ -175,14 +165,6 @@ Record the build, actual interaction results, cleanup and any unworn-headset
|
||||
limits alongside screenshots or logs. These are caller responsibilities; the
|
||||
smoke script below does not acquire this shared lock itself.
|
||||
|
||||
[Packaged Desktop Capture evidence, 2026-10-24](evidence/desktop-capture-packaged-2026-10-24.md)
|
||||
records v0.4.17 GUI button captures of a real mapped nested desktop on SteamOS
|
||||
0.5.6, a bounded owned user unit, and cleanup back to the original Game Mode
|
||||
state. Check X window mapping/focus and SteamVR overlay visibility separately:
|
||||
successful capture of a mapped window does not prove the desktop is visible
|
||||
to a wearer. That run's overlay stayed `not_visible`; #73 remains unverified
|
||||
for its reported visible-desktop/0.4.5 condition. Only state/log metadata is public.
|
||||
|
||||
```sh
|
||||
scripts/frame-smoke.sh # needs `ssh frame` to work without a password
|
||||
scripts/frame-smoke.sh --pair # also pairs a throwaway key: approve it in the headset
|
||||
@@ -392,11 +374,7 @@ trees on the fake Frame. None of it has run on a headset.
|
||||
|
||||
`tests/test_media.py` covers layout evidence and overrides, OU eye ordering,
|
||||
hardware-decoder command construction, malformed splats, stereo parallax and
|
||||
fake-Frame library/process ownership. It also covers optional-surround refusal
|
||||
at creation, setup, first upload and retry after standby, fatal screen refusal,
|
||||
and best-effort overlay teardown with shutdown.
|
||||
Run `python3 -m unittest discover -s tests -p test_media.py -v`.
|
||||
`tests/e2e/test_media_transfer.py` checks the real
|
||||
fake-Frame library/process ownership. `tests/e2e/test_media_transfer.py` checks the real
|
||||
HTTP/SSH upload and library listing without pretending the fake renders VR.
|
||||
Real decode timings and captured stereo output are recorded in
|
||||
[vr-video.md](vr-video.md). Generated media only; no external player required.
|
||||
|
||||
@@ -101,14 +101,6 @@ Stills and the theatre surround are re-sent after waking. Five minutes
|
||||
without an accepted frame is reported as an error. Headset-view captures
|
||||
taken during standby show a flat dark frame, not our screen.
|
||||
|
||||
**Optional surround:** if SteamVR refuses the theatre dark surround at startup
|
||||
or on a retry after standby, playback continues without it and the player log
|
||||
records `Theatre surround unavailable`. Screen errors still fail playback.
|
||||
On exit, the player attempts to destroy every owned overlay and calls OpenVR
|
||||
shutdown even if an overlay's teardown raises an exception. Refusal and
|
||||
teardown errors are covered by fake-OpenVR tests; a real surround refusal has
|
||||
not been induced safely. See the [current hardening checks](evidence/media-surround-2026-10-24.md).
|
||||
|
||||

|
||||
|
||||
**Verified failed route:** GStreamer 1.24.2's `playbin` selected
|
||||
|
||||
@@ -31,8 +31,7 @@ function page(api) {
|
||||
|
||||
// A request that fails, or reaches a link that had dropped, keeps its keys and releases.
|
||||
for (const [label, api] of [["request failed", async () => { throw new Error("offline"); }],
|
||||
["not sent", async () => ({ state: "starting", sent: false })],
|
||||
["queue full", async () => ({ state: "waiting", sent: false })]]) {
|
||||
["not sent", async () => ({ state: "starting", sent: false })]]) {
|
||||
const { pad, padSend, shown } = page(api);
|
||||
padSend({ dx: 5 }); // sent and lost: a move, fine to drop
|
||||
await new Promise(r => setTimeout(r, 0));
|
||||
@@ -46,29 +45,4 @@ for (const [label, api] of [["request failed", async () => { throw new Error("of
|
||||
fail(label + ": " + JSON.stringify(q));
|
||||
if (!shown.length || shown.at(-1).state === "ready") fail(label + ": state not shown");
|
||||
}
|
||||
// Acknowledged text is removed locally, but its pending status must reach padShow
|
||||
// so failures reported after acceptance are polled without another keypress.
|
||||
{
|
||||
const { pad, padSend, shown } = page(async () => ({ state: "ready", sent: true, queued: 1 }));
|
||||
padSend({ key: "é" });
|
||||
await new Promise(r => setTimeout(r, 0));
|
||||
if (pad.queue.length || shown.at(-1)?.queued !== 1) fail("accepted text is not polled");
|
||||
}
|
||||
|
||||
// Exercise the real status/poll function: queued text leaves pointer controls
|
||||
// usable, still polls, shows an eventual error, and does not silently retry it.
|
||||
{
|
||||
const pad = { state: "ready", queue: [] }, elements = {};
|
||||
let poll = null;
|
||||
const show = new Function("pad", "$", "PAD_STATES", "TOUCH", "padFlush", "devGen", "api",
|
||||
"setTimeout", "clearTimeout", grab("padShow") + "; return padShow;")(
|
||||
pad, id => elements[id] ||= { classList: { toggle() {} } }, {}, false, () => {}, 0,
|
||||
async () => ({ state: "error", message: "Text is retained; try again." }),
|
||||
fn => { poll = fn; return 1; }, () => { poll = null; });
|
||||
show({ state: "ready", queued: 1 });
|
||||
if (pad.state !== "ready" || !poll) fail("pending text disabled pointer or skipped poll");
|
||||
await poll();
|
||||
if (pad.state !== "error" || poll || !elements.padHint.textContent.includes("retained"))
|
||||
fail("asynchronous error not surfaced");
|
||||
}
|
||||
console.log("queue rules ok");
|
||||
@@ -1,70 +0,0 @@
|
||||
// Run the real doctor page script with a minimal DOM; no browser or hardware I/O.
|
||||
import assert from 'node:assert/strict';
|
||||
import {readFileSync} from 'node:fs';
|
||||
import vm from 'node:vm';
|
||||
class Element {
|
||||
constructor(tag) { this.tagName = tag.toUpperCase(); this.children = []; this.value = ''; this.hidden = false; this.disabled = false; this.textContent = ''; }
|
||||
append(...nodes) { this.children.push(...nodes); }
|
||||
prepend(...nodes) { this.children.unshift(...nodes); }
|
||||
replaceChildren(...nodes) { this.children = nodes; }
|
||||
get firstChild() { return this.children[0]; }
|
||||
get options() { return this.children; }
|
||||
}
|
||||
const ids = ['back','inventory','diagnose','device','message','results','json','reportSection','selection','download','copy'];
|
||||
const elements = Object.fromEntries(ids.map(id => [id,new Element(id === 'device' ? 'select' : 'div')]));
|
||||
const requests = [];
|
||||
let pending;
|
||||
const context = vm.createContext({
|
||||
document:{getElementById:id=>elements[id],createElement:tag=>new Element(tag)},
|
||||
URLSearchParams,location:{search:'?key=test-key'},
|
||||
fetch:(path,options)=>{ requests.push({path,options}); return new Promise(resolve=>{pending=resolve;}); },
|
||||
navigator:{clipboard:{writeText:async()=>{throw Error('clipboard denied');}}},
|
||||
});
|
||||
const source = readFileSync(new URL('../../ui/wireless-doctor.html',import.meta.url),'utf8');
|
||||
vm.runInContext(source.match(/<script>([\s\S]*)<\/script>/)[1],context);
|
||||
assert.equal(requests.length,0,'opening the page must not probe');
|
||||
assert.equal(elements.back.href,'/?key=test-key#devices');
|
||||
const fixture = {
|
||||
schema:1,supported:true,selected:null,
|
||||
usb:[{id:'usb:1-2',vid:'1234',pid:'5678',product:'<img src=x onerror=alert(1)>'}],
|
||||
interfaces:[{id:'net:wlan0',name:'wlan0',usb:'usb:1-2',driver:'synthetic'}],
|
||||
checks:[{id:'presence',title:'Presence',status:'ok',suggestion:'Select hardware',evidence:['Synthetic evidence']}]
|
||||
};
|
||||
let promise=elements.inventory.onclick();
|
||||
assert.equal(elements.device.disabled,true,'selection must stay fixed during a read');
|
||||
assert.equal(requests[0].path,'/api/wireless-doctor');
|
||||
assert.equal(requests[0].options.headers['X-Frame-UI'],'test-key');
|
||||
pending({ok:true,json:async()=>fixture}); await promise;
|
||||
assert.equal(elements.device.value,'','no automatic hardware choice');
|
||||
assert.equal(elements.diagnose.disabled,true);
|
||||
assert.equal(elements.device.options.length,3);
|
||||
assert.match(elements.device.options[2].textContent,/<img src=x/,'hardware labels must stay plain text');
|
||||
assert.equal(elements.device.options[2].children.length,0);
|
||||
assert.equal(elements.reportSection.hidden,false);
|
||||
assert.equal(elements.results.children.length,1);
|
||||
elements.device.value='net:wlan0'; elements.device.onchange();
|
||||
assert.equal(elements.diagnose.disabled,false);
|
||||
assert.equal(elements.results.children.length,0,'changing hardware clears the previous result');
|
||||
assert.equal(elements.reportSection.hidden,true,'cannot export an old report for a new selection');
|
||||
promise=elements.diagnose.onclick();
|
||||
assert.equal(requests[1].path,'/api/wireless-doctor?device=net%3Awlan0');
|
||||
assert.equal(elements.device.disabled,true);
|
||||
pending({ok:true,json:async()=>({...fixture,selected:'net:wlan0'})}); await promise;
|
||||
assert.equal(elements.device.value,'net:wlan0');
|
||||
assert.equal(elements.device.disabled,false);
|
||||
await elements.copy.onclick();
|
||||
assert.match(elements.message.textContent,/Clipboard unavailable/);
|
||||
promise=elements.diagnose.onclick();
|
||||
assert.equal(elements.results.children.length,0,'clear a healthy snapshot before retrying');
|
||||
assert.equal(elements.reportSection.hidden,true);
|
||||
pending({ok:false,json:async()=>({error:'Device is no longer present. Refresh and select an observed device.'})}); await promise;
|
||||
assert.match(elements.message.textContent,/no longer present/);
|
||||
assert.equal(elements.results.children.length,0);
|
||||
assert.equal(elements.reportSection.hidden,true,'failed requests cannot export stale success');
|
||||
assert.equal(elements.inventory.disabled,false,'can refresh after failure');
|
||||
promise=elements.inventory.onclick();
|
||||
pending({ok:true,json:async()=>({...fixture,supported:false,usb:[],interfaces:[]})}); await promise;
|
||||
assert.equal(elements.selection.hidden,true);
|
||||
assert.equal(elements.diagnose.disabled,true);
|
||||
assert.match(elements.message.textContent,/only on a Linux PC/);
|
||||
console.log('doctor UI: on-demand reads, explicit selection, safe labels, stale report clearing and failure recovery passed');
|
||||
@@ -1,82 +0,0 @@
|
||||
const {test} = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const vm = require('node:vm');
|
||||
const path = require('node:path');
|
||||
const html = fs.readFileSync(path.join(__dirname, '../ui/index.html'), 'utf8');
|
||||
const code = html.split('// Local Steam helper: never start')[1].split('// ---- shared destinations')[0];
|
||||
|
||||
function fixture() {
|
||||
const elements = new Map(), requests = [];
|
||||
const $ = id => {
|
||||
if (!elements.has(id)) elements.set(id, {disabled:true, textContent:''});
|
||||
return elements.get(id);
|
||||
};
|
||||
const ctx = {$, api:(url, body) => new Promise((resolve, reject) => requests.push({url, body, resolve, reject}))};
|
||||
vm.createContext(ctx);
|
||||
vm.runInContext('// never start' + code, ctx);
|
||||
return {ctx, $, requests};
|
||||
}
|
||||
|
||||
test('navigation reads status; only clicks request launch or permission UI', async () => {
|
||||
const {ctx, $, requests} = fixture();
|
||||
assert.equal(requests.length, 0);
|
||||
const load = ctx.loadSteamPipewire();
|
||||
assert.equal(requests[0].url, '/api/steam-pipewire');
|
||||
assert.equal(requests[0].body, undefined);
|
||||
requests[0].resolve({available:true, guidance:'Verify the Steam session'});
|
||||
await load;
|
||||
assert.equal($('steamPipewireLaunch').disabled, false);
|
||||
assert.equal($('steamPipewireGuidance').textContent, 'Verify the Steam session');
|
||||
const launch = $('steamPipewireLaunch').onclick();
|
||||
assert.deepEqual(JSON.parse(JSON.stringify(requests[1].body)), {action:'launch', confirmed:true});
|
||||
assert.equal($('steamPipewireReset').disabled, true);
|
||||
await $('steamPipewireReset').onclick(); // repeated action suppressed
|
||||
assert.equal(requests.length, 2);
|
||||
requests[1].reject(new Error('Exit Steam first'));
|
||||
await launch;
|
||||
assert.equal($('steamPipewireStatus').textContent, 'Exit Steam first');
|
||||
const reset = $('steamPipewireReset').onclick();
|
||||
assert.deepEqual(JSON.parse(JSON.stringify(requests[2].body)), {action:'permissions', confirmed:true});
|
||||
requests[2].resolve({reset:false, opened:true, message:'No permission was changed'});
|
||||
await reset;
|
||||
assert.equal($('steamPipewireStatus').textContent, 'No permission was changed');
|
||||
});
|
||||
|
||||
test('unsupported status and read failure keep actions disabled', async () => {
|
||||
const {ctx, $, requests} = fixture();
|
||||
const load = ctx.loadSteamPipewire();
|
||||
requests[0].resolve({available:false, reason:'Local Wayland required'});
|
||||
await load;
|
||||
assert.equal($('steamPipewireLaunch').disabled, true);
|
||||
assert.equal($('steamPipewireReset').disabled, true);
|
||||
assert.equal($('steamPipewireStatus').textContent, 'Local Wayland required');
|
||||
const retry = ctx.loadSteamPipewire();
|
||||
requests[1].reject(new Error('Unavailable'));
|
||||
await retry;
|
||||
assert.equal($('steamPipewireLaunch').disabled, true);
|
||||
});
|
||||
|
||||
test('stale status cannot overwrite an action result', async () => {
|
||||
const {ctx, $, requests} = fixture();
|
||||
const load = ctx.loadSteamPipewire();
|
||||
const reset = ctx.steamPipewireAction('permissions');
|
||||
requests[1].resolve({message:'No permission was changed'});
|
||||
await reset;
|
||||
requests[0].resolve({available:true});
|
||||
await load;
|
||||
assert.equal($('steamPipewireStatus').textContent, 'No permission was changed');
|
||||
});
|
||||
|
||||
|
||||
test('Tools navigation opens the separate Steam panel without starting PC capture', () => {
|
||||
const {workspaceFixture} = require('./workspace_fixture.cjs');
|
||||
const f = workspaceFixture();
|
||||
f.navigate('#steamPipewire');
|
||||
assert.equal(f.activePage, 'tools');
|
||||
assert.equal(f.el('steamPipewire').hidden, false);
|
||||
assert.equal(f.el('macview').hidden, true);
|
||||
assert.ok(f.calls.some(call => call[0] === 'steam-pipewire'));
|
||||
assert.ok(!f.calls.some(call => call[0] === 'macview'));
|
||||
assert.match(html, /\$\("steamPipewireLink"\)\.hidden = h.mobile \|\| h.os !== "Linux"/);
|
||||
});
|
||||
@@ -18,7 +18,6 @@ import tempfile
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
from unittest import mock
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
@@ -632,428 +631,3 @@ class PageQueue(unittest.TestCase):
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
|
||||
class PadEvents(unittest.TestCase):
|
||||
"""The trackpad and key row go through gamescope; accents and emoji go the KDE Connect way."""
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
import server
|
||||
cls.pad = staticmethod(server.pad_events)
|
||||
|
||||
def test_moves_clicks_and_scroll(self):
|
||||
out, extra = self.pad([{"dx": 3, "dy": -2}, {"singleclick": True}, {"singlehold": True},
|
||||
{"singlerelease": True}, {"scroll": True, "dy": 1}, {"rightclick": True}])
|
||||
self.assertEqual(out[0], {"dx": 3, "dy": -2})
|
||||
self.assertEqual(out[1:3], [{"button": "left", "down": True}, {"button": "left", "down": False}])
|
||||
self.assertEqual(out[3:5], [{"button": "left", "down": True}, {"button": "left", "down": False}])
|
||||
self.assertEqual(out[5], {"scroll": [0, -15]}) # up = content follows the finger
|
||||
self.assertEqual(out[6:], [{"button": "right", "down": True}, {"button": "right", "down": False}])
|
||||
self.assertEqual(extra, [])
|
||||
|
||||
def test_keys_and_modifiers(self):
|
||||
out, _ = self.pad([{"specialKey": 12}, {"specialKey": 1, "ctrl": True}, {"key": "c", "ctrl": True}])
|
||||
self.assertEqual(out[:2], [{"key": 28, "down": True}, {"key": 28, "down": False}])
|
||||
self.assertEqual([e["key"] for e in out[2:6]], [29, 14, 14, 29]) # Ctrl+Backspace
|
||||
self.assertEqual([(e["key"], e["down"]) for e in out[6:]],
|
||||
[(29, True), (46, True), (46, False), (29, False)]) # Ctrl+C
|
||||
|
||||
def test_text_stays_ascii_through_gamescope(self):
|
||||
out, slow = self.pad([{"key": "Hi "}, {"key": "there"}])
|
||||
self.assertEqual(out, [{"text": "Hi there"}])
|
||||
self.assertEqual(slow, [])
|
||||
|
||||
def test_keyboard_goes_to_kde_whole_and_in_order(self):
|
||||
events = [{"key": "a"}, {"key": "é"}, {"specialKey": 12}, {"key": "c", "ctrl": True}, {"dx": 2, "dy": 1}]
|
||||
out, slow = self.pad(events, kde=True)
|
||||
self.assertEqual(out, [{"dx": 2, "dy": 1}]) # the pointer still goes through gamescope
|
||||
self.assertEqual(slow, events[:4]) # the keyboard as sent, in order
|
||||
|
||||
def test_shifted_key_with_modifier(self):
|
||||
out, _ = self.pad([{"key": "A", "ctrl": True}])
|
||||
self.assertEqual([e["key"] for e in out], [29, 42, 30, 30, 42, 29])
|
||||
|
||||
|
||||
class PadDelivery(unittest.TestCase):
|
||||
"""remote_input's promises: "sent" means the whole batch is taken; accents go once, in order."""
|
||||
|
||||
class Agent:
|
||||
def __init__(self, sent=True, state="ready"):
|
||||
self.sent, self.state, self.got = sent, state, []
|
||||
|
||||
def send(self, events):
|
||||
if events and self.sent:
|
||||
self.got.append(events)
|
||||
return {"state": self.state, "sent": self.sent and bool(events)}
|
||||
|
||||
def setUp(self):
|
||||
import server
|
||||
self.s = server
|
||||
self.saved = (server._touch, server._input, server.KDE_WAIT)
|
||||
server._touch, server._input = self.Agent(), self.Agent()
|
||||
self.reset()
|
||||
|
||||
def tearDown(self):
|
||||
self.s._touch, self.s._input, self.s.KDE_WAIT = self.saved
|
||||
self.settle()
|
||||
self.reset()
|
||||
|
||||
def reset(self):
|
||||
self.s._kde_queue.clear()
|
||||
self.s._kde_error = None
|
||||
self.s._kde_until = self.s._typed_until = 0.0
|
||||
self.s._kde_worker[0] = None
|
||||
|
||||
def settle(self):
|
||||
worker = self.s._kde_worker[0]
|
||||
if worker:
|
||||
worker.join(5)
|
||||
|
||||
def typed(self):
|
||||
return [e for batch in self.s._input.got for e in batch]
|
||||
|
||||
def test_accent_only_batch_is_acknowledged_and_typed_once(self):
|
||||
status = self.s.remote_input({"events": [{"key": "é"}]})
|
||||
self.assertTrue(status["sent"]) # so the page doesn't send it again
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), [{"key": "é"}])
|
||||
|
||||
def test_mixed_text_stays_in_one_ordered_stream(self):
|
||||
self.s.remote_input({"events": [{"key": "aéb"}, {"specialKey": 12}]})
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), [{"key": "aéb"}, {"specialKey": 12}])
|
||||
self.assertEqual(self.s._touch.got, []) # none of it split off through gamescope
|
||||
|
||||
def test_batch_gamescope_didnt_take_is_not_queued(self):
|
||||
self.s._touch = self.Agent(sent=False, state="starting")
|
||||
status = self.s.remote_input({"events": [{"dx": 1, "dy": 1}, {"key": "é"}]})
|
||||
self.assertFalse(status["sent"]) # the page tries the whole batch again...
|
||||
self.assertEqual(self.s._kde_queue, []) # ...so the accent isn't queued twice
|
||||
|
||||
def test_waits_for_kde_connect_then_sends_without_more_input(self):
|
||||
self.s._input = self.Agent(sent=False, state="starting")
|
||||
self.s.remote_input({"events": [{"key": "é"}]})
|
||||
time.sleep(0.2)
|
||||
self.assertEqual(self.s._kde_queue, [{"key": "é"}])
|
||||
self.s._input.sent = True
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), [{"key": "é"}])
|
||||
self.assertEqual(self.s._kde_queue, [])
|
||||
|
||||
def test_later_ascii_waits_behind_a_pending_accent(self):
|
||||
self.s._input = self.Agent(sent=False, state="starting")
|
||||
self.s.remote_input({"events": [{"key": "é"}]})
|
||||
self.s.remote_input({"events": [{"key": "x"}]})
|
||||
self.assertEqual(self.s._touch.got, []) # "x" can't overtake the "é"
|
||||
self.assertEqual(self.s._kde_queue, [{"key": "é"}, {"key": "x"}])
|
||||
self.s._input.sent = True
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), [{"key": "é"}, {"key": "x"}])
|
||||
|
||||
def test_errors_and_timeout_retain_accepted_text_for_explicit_retry(self):
|
||||
events = [{"key": "é"}] * 150
|
||||
for state in ("error", "starting"):
|
||||
with self.subTest(state=state):
|
||||
self.reset()
|
||||
self.s._input = self.Agent(sent=False, state=state)
|
||||
self.s.KDE_WAIT = 0
|
||||
self.assertTrue(self.s.remote_input({"events": events})["sent"])
|
||||
self.settle()
|
||||
self.assertEqual(self.s._kde_queue, events)
|
||||
self.assertIsNone(self.s._kde_worker[0])
|
||||
self.assertEqual(self.s._kde_until, 0)
|
||||
status = self.s.pad_status({"state": "ready"})
|
||||
self.assertEqual(status["state"], "error")
|
||||
self.assertIn("retained", status["message"])
|
||||
self.assertFalse(self.s.remote_input({"events": [{"key": "x"}]})["sent"])
|
||||
self.s._input = self.Agent()
|
||||
self.s.start_pad()
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), events)
|
||||
self.assertEqual(self.s._kde_queue, [])
|
||||
self.assertIsNone(self.s._kde_error)
|
||||
|
||||
def test_worker_exception_and_start_failure_are_visible_and_retryable(self):
|
||||
for start_failure in (False, True):
|
||||
with self.subTest(start_failure=start_failure):
|
||||
self.reset()
|
||||
events = [{"key": "é"}]
|
||||
if start_failure:
|
||||
with mock.patch.object(threading.Thread, "start", side_effect=RuntimeError("no thread")):
|
||||
self.assertTrue(self.s.remote_input({"events": events})["sent"])
|
||||
else:
|
||||
with mock.patch.object(self.s._input, "send", side_effect=OSError("send failed")):
|
||||
self.assertTrue(self.s.remote_input({"events": events})["sent"])
|
||||
self.settle()
|
||||
self.assertEqual(self.s._kde_queue, events)
|
||||
self.assertIsNone(self.s._kde_worker[0])
|
||||
self.assertEqual(self.s._kde_until, 0)
|
||||
self.assertEqual(self.s.pad_status({"state": "ready"})["state"], "error")
|
||||
self.s._input = self.Agent()
|
||||
self.s.start_pad()
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), events)
|
||||
|
||||
def test_ascii_just_after_an_accent_stays_behind_it(self):
|
||||
self.s.remote_input({"events": [{"key": "é"}]})
|
||||
self.settle()
|
||||
self.s.remote_input({"events": [{"key": "x"}]}) # KDE Connect may still be typing the é
|
||||
self.settle()
|
||||
self.assertEqual(self.s._touch.got, [])
|
||||
self.assertEqual(self.typed(), [{"key": "é"}, {"key": "x"}])
|
||||
|
||||
def test_accent_just_after_gamescope_text_waits_for_it(self):
|
||||
self.s.remote_input({"events": [{"key": "x" * 50}]})
|
||||
self.assertEqual(self.s._touch.got, [[{"text": "x" * 50}]])
|
||||
start = time.time()
|
||||
self.s.remote_input({"events": [{"key": "é"}]})
|
||||
self.settle()
|
||||
self.assertGreater(time.time() - start, 0.6) # 50 keys at 16 ms, plus the margin
|
||||
self.assertEqual(self.typed(), [{"key": "é"}])
|
||||
|
||||
def test_typing_time_counts_every_key_transition(self):
|
||||
t = self.s.typing_seconds
|
||||
self.assertAlmostEqual(t([{"text": "ab"}]), 4 * 0.008)
|
||||
self.assertAlmostEqual(t([{"text": "A"}]), 4 * 0.008) # shift down, key down, key up, shift up
|
||||
self.assertAlmostEqual(t([{"text": "x" * 500}]), 8.0) # a long paste
|
||||
self.assertAlmostEqual(t([{"key": 29, "down": True}, {"dx": 3, "dy": 0}]), 0.008)
|
||||
|
||||
def test_the_margin_is_added_once_not_per_request(self):
|
||||
for _ in range(10):
|
||||
self.s.remote_input({"events": [{"key": "ab"}]})
|
||||
# ten requests of 4 transitions each: the work queues up, with no margin added per request
|
||||
self.assertLess(self.s._typed_until - time.time(), 10 * 4 * 0.008 + 0.05)
|
||||
|
||||
def hold_worker(self):
|
||||
entered, release = threading.Event(), threading.Event()
|
||||
class Gate:
|
||||
def wait(self, timeout):
|
||||
entered.set()
|
||||
if not release.wait(3):
|
||||
raise RuntimeError("test did not release worker")
|
||||
return False
|
||||
patch = mock.patch.object(self.s, "_kde_cancel", Gate())
|
||||
patch.start()
|
||||
self.addCleanup(patch.stop)
|
||||
self.addCleanup(release.set)
|
||||
return entered, release
|
||||
|
||||
def test_saturation_rejects_whole_batch_and_retry_delivers_every_accepted_event_once(self):
|
||||
entered, release = self.hold_worker()
|
||||
self.s._typed_until = time.time() + 60
|
||||
first = [{"key": "é"}] * 150
|
||||
remainder = [{"key": "ü"}] * 50
|
||||
overflow = [{"singleclick": True}, {"key": "ß"}] * 75
|
||||
self.assertTrue(self.s.remote_input({"events": first})["sent"])
|
||||
self.assertTrue(entered.wait(1)) # batch is in flight, waiting for prior ASCII
|
||||
try:
|
||||
self.assertTrue(self.s.remote_input({"events": remainder})["sent"])
|
||||
status = self.s.remote_input({"events": overflow})
|
||||
self.assertFalse(status["sent"])
|
||||
self.assertEqual(status["state"], "waiting")
|
||||
self.assertEqual(self.s._kde_queue, first + remainder)
|
||||
self.assertEqual(len(self.s._kde_queue), self.s.KDE_QUEUE_LIMIT)
|
||||
self.assertEqual(self.s._touch.got, []) # rejected clicks cannot be duplicated
|
||||
finally:
|
||||
self.s._typed_until = 0
|
||||
release.set()
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), first + remainder)
|
||||
self.assertTrue(self.s.remote_input({"events": overflow})["sent"])
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), first + remainder + [{"key": "ß"}] * 75)
|
||||
self.assertEqual(self.s._touch.got, [[e for _ in range(75) for e in (
|
||||
{"button": "left", "down": True}, {"button": "left", "down": False})]])
|
||||
|
||||
def test_retrying_batch_keeps_its_capacity_and_order(self):
|
||||
entered, release = self.hold_worker()
|
||||
self.s._input = self.Agent(sent=False, state="starting")
|
||||
first, second = [{"key": "é"}] * 150, [{"key": "ü"}] * 150
|
||||
self.assertTrue(self.s.remote_input({"events": first})["sent"])
|
||||
self.assertTrue(entered.wait(1)) # first send failed; worker is in retry delay
|
||||
try:
|
||||
self.assertFalse(self.s.remote_input({"events": second})["sent"])
|
||||
self.assertEqual(self.s._kde_queue, first)
|
||||
finally:
|
||||
self.s._input.sent = True
|
||||
release.set()
|
||||
self.settle()
|
||||
self.assertTrue(self.s.remote_input({"events": second})["sent"])
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), first + second)
|
||||
|
||||
def test_concurrent_requests_cannot_both_claim_the_last_capacity(self):
|
||||
entered, release = self.hold_worker()
|
||||
self.s._typed_until = time.time() + 60
|
||||
first = [{"key": "é"}]
|
||||
self.s.remote_input({"events": first})
|
||||
self.assertTrue(entered.wait(1))
|
||||
barrier, results = threading.Barrier(3), []
|
||||
def request(key):
|
||||
barrier.wait(2)
|
||||
batch = [{"key": key}] * 150
|
||||
results.append((batch, self.s.remote_input({"events": batch})["sent"]))
|
||||
threads = [threading.Thread(target=request, args=(key,)) for key in ("ü", "ß")]
|
||||
try:
|
||||
for thread in threads:
|
||||
thread.start()
|
||||
barrier.wait(2)
|
||||
for thread in threads:
|
||||
thread.join(2)
|
||||
self.assertFalse(thread.is_alive())
|
||||
self.assertEqual(sorted(sent for _, sent in results), [False, True])
|
||||
finally:
|
||||
self.s._typed_until = 0
|
||||
release.set()
|
||||
self.settle()
|
||||
accepted = next(batch for batch, sent in results if sent)
|
||||
rejected = next(batch for batch, sent in results if not sent)
|
||||
self.assertEqual(self.typed(), first + accepted)
|
||||
self.assertTrue(self.s.remote_input({"events": rejected})["sent"])
|
||||
self.settle()
|
||||
self.assertEqual(self.typed(), first + accepted + rejected)
|
||||
|
||||
def test_input_queued_as_the_worker_finishes_is_still_sent(self):
|
||||
for _ in range(40):
|
||||
self.reset()
|
||||
self.s._input.got.clear()
|
||||
self.s.remote_input({"events": [{"key": "é"}]})
|
||||
time.sleep(0.002)
|
||||
self.s.remote_input({"events": [{"key": "ü"}]})
|
||||
self.settle()
|
||||
self.assertEqual(self.s._kde_queue, [])
|
||||
self.assertEqual(self.typed(), [{"key": "é"}, {"key": "ü"}])
|
||||
|
||||
|
||||
class PadRoute(unittest.TestCase):
|
||||
def test_unicode_start_and_headset_switch_do_not_deadlock(self):
|
||||
# Real InputAgent.send/start takes the route lock. Race it with route(),
|
||||
# which cancels the pad worker; mocks of send() hide this lock inversion.
|
||||
# A child keeps a regression's blocked daemon threads out of this suite.
|
||||
code = r'''
|
||||
import sandbox
|
||||
import server as s
|
||||
import threading
|
||||
from unittest import mock
|
||||
|
||||
entered, release, switching = threading.Event(), threading.Event(), threading.Event()
|
||||
s._input = s.InputAgent(packages=[])
|
||||
s._input._launch = lambda *args: None # exercise real start, without any SSH
|
||||
s._touch = mock.Mock()
|
||||
send = s._input.send
|
||||
def held(events):
|
||||
entered.set()
|
||||
assert release.wait(2)
|
||||
return send(events)
|
||||
s._input.send = held
|
||||
s._power.stop = lambda *args: switching.set()
|
||||
s._queue_for_kde([{'key': 'é'}])
|
||||
worker = s._kde_worker[0]
|
||||
assert entered.wait(2), 'Unicode worker never reached send'
|
||||
switch = threading.Thread(target=s.route, args=('frame-pr66-new', []), daemon=True)
|
||||
switch.start()
|
||||
switching.wait(0.2)
|
||||
release.set()
|
||||
worker.join(2)
|
||||
switch.join(2)
|
||||
assert not worker.is_alive(), 'Unicode worker deadlocked starting input during headset switch'
|
||||
assert not switch.is_alive(), 'headset switch deadlocked cancelling Unicode input'
|
||||
assert not s._kde_queue
|
||||
'''
|
||||
env = {**os.environ, "PYTHONPATH": os.pathsep.join([str(ROOT / 'tests'), str(ROOT / 'ui')])}
|
||||
result = subprocess.run([sys.executable, '-c', code], env=env, capture_output=True,
|
||||
text=True, timeout=8)
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
|
||||
def setUp(self):
|
||||
import server
|
||||
self.s = server
|
||||
self.agents = mock.patch.multiple(server, _touch=mock.Mock(), _input=mock.Mock())
|
||||
self.agents.start()
|
||||
self.addCleanup(self.agents.stop)
|
||||
self.s._touch.send.return_value = {"state": "ready", "sent": True}
|
||||
self.s._input.send.return_value = {"state": "ready", "sent": True}
|
||||
self.s.reset_pad_route()
|
||||
self.s._touch.reset_mock(); self.s._input.reset_mock()
|
||||
self.addCleanup(self.s.reset_pad_route)
|
||||
|
||||
def switch(self):
|
||||
with mock.patch.multiple(self.s, FRAME="frame-a", HOST_OPTS=[], MUX=[], SSH=[], macview=None), \
|
||||
mock.patch.multiple(self.s.frame_android, FRAME="frame-a", SSH_OPTS=[]):
|
||||
self.s.route("frame-b", [])
|
||||
|
||||
def test_stale_worker_exception_cannot_damage_new_route(self):
|
||||
entered, release = threading.Event(), threading.Event()
|
||||
class BrokenWait:
|
||||
def wait(self, timeout):
|
||||
entered.set()
|
||||
if not release.wait(2):
|
||||
raise RuntimeError("test did not release old worker")
|
||||
raise OSError("old route wait failed")
|
||||
def set(self):
|
||||
pass # hold its exception until the new route has been published
|
||||
self.s._kde_cancel = BrokenWait()
|
||||
self.s._typed_until = time.time() + 60
|
||||
self.s.remote_input({"events": [{"key": "é"}]})
|
||||
worker = self.s._kde_worker[0]
|
||||
try:
|
||||
self.assertTrue(entered.wait(1))
|
||||
self.switch()
|
||||
marker = object()
|
||||
with self.s._kde_lock:
|
||||
self.s._kde_queue.append({"key": "new"})
|
||||
self.s._kde_worker[0] = marker
|
||||
self.s._kde_until = 42
|
||||
finally:
|
||||
release.set()
|
||||
worker.join(2)
|
||||
self.assertFalse(worker.is_alive())
|
||||
self.assertEqual(self.s._kde_queue, [{"key": "new"}])
|
||||
self.assertIs(self.s._kde_worker[0], marker)
|
||||
self.assertEqual(self.s._kde_until, 42)
|
||||
self.assertIsNone(self.s._kde_error)
|
||||
|
||||
def test_switch_stops_both_input_agents_and_discards_old_queue(self):
|
||||
self.s._kde_queue.append({"key": "old"})
|
||||
self.s._kde_until = self.s._typed_until = time.time() + 60
|
||||
cancel = self.s._kde_cancel
|
||||
self.switch()
|
||||
self.s._input.stop.assert_called_once()
|
||||
self.s._touch.stop.assert_called_once()
|
||||
self.assertEqual(self.s._kde_queue, [])
|
||||
self.assertEqual((self.s._kde_until, self.s._typed_until), (0, 0))
|
||||
self.assertTrue(cancel.is_set())
|
||||
|
||||
def test_switch_cancels_delayed_and_retrying_text_before_new_input(self):
|
||||
for delaying in (True, False):
|
||||
with self.subTest(delaying=delaying):
|
||||
waiting, cancel = threading.Event(), threading.Event()
|
||||
class ObservedCancel:
|
||||
def wait(self, timeout):
|
||||
waiting.set()
|
||||
return cancel.wait(timeout)
|
||||
def set(self):
|
||||
cancel.set()
|
||||
self.s.reset_pad_route()
|
||||
self.s._kde_cancel = ObservedCancel()
|
||||
self.s._typed_until = time.time() + 60 if delaying else 0
|
||||
self.s._input.reset_mock()
|
||||
self.s._input.send.return_value = {"state": "starting", "sent": False}
|
||||
self.s.remote_input({"events": [{"key": "é"}]})
|
||||
worker = self.s._kde_worker[0]
|
||||
self.assertTrue(waiting.wait(1), "worker never reached its cancellable delay")
|
||||
self.switch()
|
||||
worker.join(1)
|
||||
self.assertFalse(worker.is_alive())
|
||||
attempts = self.s._input.send.call_count
|
||||
self.assertEqual(attempts, 0 if delaying else 1)
|
||||
self.s._input.send.return_value = {"state": "ready", "sent": True}
|
||||
self.s.remote_input({"events": [{"key": "ü"}]})
|
||||
next_worker = self.s._kde_worker[0]
|
||||
if next_worker:
|
||||
next_worker.join(1)
|
||||
self.assertFalse(next_worker.is_alive())
|
||||
self.assertEqual(self.s._input.send.call_count, attempts + 1)
|
||||
self.assertEqual(self.s._input.send.call_args.args[0], [{"key": "ü"}])
|
||||
self.assertEqual(self.s._kde_queue, [])
|
||||
+3
-62
@@ -68,7 +68,7 @@ class Media(unittest.TestCase):
|
||||
self.assertIn('-frames:v', cmd)
|
||||
|
||||
def play_with(self, name, busy=0, on_pixels=None, sleeps=None, info=None,
|
||||
fail=None, layout='auto', on_create=None, on_call=None):
|
||||
fail=None, layout='auto'):
|
||||
"""Run the player against a fake OpenVR; returns (status, pixels calls).
|
||||
|
||||
Handle 0 is the theatre surround and 1 the screen. `fail(handle, n)` makes
|
||||
@@ -82,18 +82,11 @@ class Media(unittest.TestCase):
|
||||
write_status(path, **values)
|
||||
|
||||
class FakeOverlay:
|
||||
created = 0
|
||||
|
||||
def create(self, *a, **k):
|
||||
# Handles in creation order: surround 0, then screen 1 (theatre).
|
||||
FakeOverlay.created += 1
|
||||
if on_create:
|
||||
on_create(*a, **k)
|
||||
return FakeOverlay.created - 1
|
||||
return len(calls)
|
||||
|
||||
def call(self, *a):
|
||||
if on_call:
|
||||
on_call(*a)
|
||||
pass
|
||||
|
||||
def pixels(self, handle, data, w, h):
|
||||
calls.append((handle, w, h))
|
||||
@@ -139,58 +132,6 @@ class Media(unittest.TestCase):
|
||||
self.assertEqual(result['dropped'], 2)
|
||||
self.assertIn((0, 1, 1), calls[3:])
|
||||
|
||||
def test_theatre_surround_failure_does_not_stop_playback(self):
|
||||
def fail_surround(n):
|
||||
if n == 1: # the surround's upload is the first pixels call
|
||||
raise RuntimeError('OpenVR SetOverlayRaw failed: 11')
|
||||
result, _ = self.play_with('clip_SBS.mp4', on_pixels=fail_surround)
|
||||
self.assertEqual((result['state'], result['frames']), ('ended', 4))
|
||||
|
||||
def test_theatre_surround_creation_and_setup_failures_are_cosmetic(self):
|
||||
def fail_create(key, *a, **k):
|
||||
if key.endswith('.surround'):
|
||||
raise RuntimeError('OpenVR CreateOverlay failed: 11')
|
||||
def fail_alpha(name, *a):
|
||||
if name == 'SetOverlayAlpha':
|
||||
raise RuntimeError('OpenVR SetOverlayAlpha failed: 11')
|
||||
for hooks in ({'on_create': fail_create}, {'on_call': fail_alpha}):
|
||||
with self.subTest(hooks=hooks), patch('builtins.print') as log:
|
||||
result, calls = self.play_with('clip_SBS.mp4', **hooks)
|
||||
self.assertEqual((result['state'], result['frames']), ('ended', 4))
|
||||
self.assertEqual(sum(h == 1 for h, w, hgt in calls), 4)
|
||||
self.assertIn('Theatre surround unavailable:', log.call_args.args[0])
|
||||
|
||||
def test_theatre_surround_refusal_after_standby_is_not_retried(self):
|
||||
def refuse_retry(n):
|
||||
if n == 3: # surround busy, screen accepted, surround retry refused
|
||||
raise RuntimeError('OpenVR SetOverlayRaw failed: 11')
|
||||
with patch('builtins.print') as log:
|
||||
result, calls = self.play_with('clip_SBS.mp4', busy=1, on_pixels=refuse_retry)
|
||||
self.assertEqual((result['state'], result['frames'], result['dropped']), ('ended', 4, 0))
|
||||
self.assertEqual(sum(h == 0 for h, w, hgt in calls), 2)
|
||||
self.assertIn('Theatre surround unavailable:', log.call_args.args[0])
|
||||
|
||||
def test_screen_refusal_still_fails_playback(self):
|
||||
def refuse_screen(n):
|
||||
if n == 2:
|
||||
raise RuntimeError('OpenVR SetOverlayRaw failed: 11')
|
||||
with self.assertRaisesRegex(RuntimeError, 'SetOverlayRaw failed: 11'):
|
||||
self.play_with('clip_SBS.mp4', on_pixels=refuse_screen)
|
||||
|
||||
def test_close_attempts_every_overlay_and_shuts_down_after_teardown_errors(self):
|
||||
for error in (RuntimeError('OpenVR error'), ValueError('bad handle'),
|
||||
InterruptedError('late Stop')):
|
||||
with self.subTest(error=type(error).__name__):
|
||||
overlay = player.Overlay.__new__(player.Overlay)
|
||||
overlay.handles = [10, 20]
|
||||
overlay.vr = unittest.mock.Mock()
|
||||
overlay.call = unittest.mock.Mock(side_effect=[error, None])
|
||||
overlay.close()
|
||||
self.assertEqual(overlay.call.call_args_list, [
|
||||
unittest.mock.call('DestroyOverlay', 20),
|
||||
unittest.mock.call('DestroyOverlay', 10)])
|
||||
overlay.vr.VR_ShutdownInternal.assert_called_once_with()
|
||||
|
||||
def test_stop_mid_video_reports_stopped(self):
|
||||
result, _ = self.play_with('clip_SBS.mp4', on_pixels=lambda n: n == 3 and stop_now())
|
||||
self.assertEqual(result['state'], 'stopped')
|
||||
|
||||
@@ -9,7 +9,7 @@ import subprocess
|
||||
import unittest
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parents[1]
|
||||
STUBS = ['$', 'toggleLive', 'scrollToY', 'scroller', 'loadMacView', 'loadSteamPipewire', 'loadPanels', 'loadPanelSwitcher', 'loadBackups', 'loadStorage', 'loadPower', 'loadTitles', 'showAndroidTab',
|
||||
STUBS = ['$', 'toggleLive', 'scrollToY', 'scroller', 'loadMacView', 'loadPanels', 'loadPanelSwitcher', 'loadBackups', 'loadStorage', 'loadPower', 'loadTitles', 'showAndroidTab',
|
||||
'loadAndroid', 'loadDisplays', 'setGameSource', 'requestAnimationFrame']
|
||||
|
||||
RUN = r'''
|
||||
|
||||
@@ -296,7 +296,7 @@ class OneServer(unittest.TestCase):
|
||||
self.assertIn("Frame Control on", first.stdout.readline())
|
||||
second = subprocess.run([sys.executable, str(ROOT / "ui" / "server.py"), "--port", "0"], env=env,
|
||||
capture_output=True, text=True, timeout=60)
|
||||
self.assertEqual(second.returncode, 1, second.stderr)
|
||||
self.assertEqual(second.returncode, 1)
|
||||
self.assertIn("already running", second.stderr)
|
||||
first.terminate()
|
||||
first.wait(10)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import sandbox # noqa: F401
|
||||
import contextlib
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
@@ -20,28 +19,6 @@ import frame_agent as agent
|
||||
import frame_android as android
|
||||
|
||||
|
||||
class StartupTests(unittest.TestCase):
|
||||
def test_rejected_server_starts_no_background_work(self):
|
||||
# A losing process exits through Python teardown. Background TLS/index
|
||||
# workers there can crash it, and it must not sweep the owner's files.
|
||||
with mock.patch.object(server, 'LOCAL', False), \
|
||||
mock.patch.object(server, 'PRIVATE', False), \
|
||||
mock.patch.object(sys, 'argv', ['server.py', '--port', '0']), \
|
||||
mock.patch.object(server, 'one_server', side_effect=SystemExit('already running')), \
|
||||
mock.patch.object(server, 'LoopbackServer') as listener, \
|
||||
mock.patch.object(server, 'sweep_tmp') as sweep, \
|
||||
mock.patch.object(server.threading, 'Thread') as worker, \
|
||||
mock.patch.object(server.frame_telemetry, 'start') as telemetry, \
|
||||
mock.patch.object(server.frame_contact, 'start') as contact:
|
||||
with self.assertRaisesRegex(SystemExit, 'already running'):
|
||||
server.main()
|
||||
listener.assert_not_called()
|
||||
sweep.assert_not_called()
|
||||
worker.assert_not_called()
|
||||
telemetry.assert_not_called()
|
||||
contact.assert_not_called()
|
||||
|
||||
|
||||
class TargetTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.active = {'id': 'a', 'name': 'Headset A'}
|
||||
@@ -55,7 +32,6 @@ class TargetTests(unittest.TestCase):
|
||||
self.stack.enter_context(mock.patch.object(server, '_backfill', {'running': False, 'last': 0.0}))
|
||||
self.stack.enter_context(mock.patch.object(server.macview, 'retarget'))
|
||||
self.stack.enter_context(mock.patch.object(server._input, 'stop'))
|
||||
self.real_devices_action = server.frame_link.devices_action
|
||||
self.stack.enter_context(mock.patch.object(server.frame_link, 'devices_action', self.switch))
|
||||
|
||||
def switch(self, link, body, setup, busy):
|
||||
@@ -114,39 +90,6 @@ class TargetTests(unittest.TestCase):
|
||||
server._live_tunnels.discard(proc)
|
||||
server.route(*before)
|
||||
|
||||
def test_input_post_reserves_headset_through_send_and_enqueue(self):
|
||||
body = json.dumps({'events': [{'singleclick': True}, {'key': 'é'}]}).encode()
|
||||
handler = server.Handler.__new__(server.Handler)
|
||||
handler.path = '/api/input'
|
||||
handler.local_request = lambda: True
|
||||
handler.headers = {'Content-Length': str(len(body)), 'X-Frame-Device': 'a'}
|
||||
handler.rfile = io.BytesIO(body)
|
||||
handler.send_json, handler.send_error_json = mock.Mock(), mock.Mock()
|
||||
stages = []
|
||||
def check_switch(stage):
|
||||
self.assertEqual(server._work[0], 1)
|
||||
with self.assertRaises(server.Failure):
|
||||
server.devices_post({'action': 'use', 'id': 'b'})
|
||||
stages.append(stage)
|
||||
def send(events):
|
||||
check_switch('send')
|
||||
return {'state': 'ready', 'sent': True}
|
||||
def enqueue(events):
|
||||
check_switch('enqueue')
|
||||
self.assertEqual(events, [{'key': 'é'}])
|
||||
return True
|
||||
with mock.patch.object(server.frame_link, 'devices_action', self.real_devices_action), \
|
||||
mock.patch.object(server._touch, 'send', side_effect=send), \
|
||||
mock.patch.object(server, '_queue_for_kde', side_effect=enqueue):
|
||||
handler.do_POST()
|
||||
handler.send_error_json.assert_not_called()
|
||||
self.assertTrue(handler.send_json.call_args.args[0]['sent'])
|
||||
self.assertEqual(stages, ['send', 'enqueue'])
|
||||
self.assertEqual(self.active['id'], 'a')
|
||||
self.assertEqual(server._work[0], 0)
|
||||
server.devices_post({'action': 'use', 'id': 'b'})
|
||||
self.assertEqual(self.active['id'], 'b')
|
||||
|
||||
def test_backfill_counts_work_until_error_cleanup(self):
|
||||
entered, release = threading.Event(), threading.Event()
|
||||
writes = []
|
||||
@@ -437,9 +380,9 @@ class FinalGetStartTests(unittest.TestCase):
|
||||
self.active.update(id='b', name='Headset B')
|
||||
for name in ('input', 'touch'):
|
||||
with self.subTest(name=name):
|
||||
fresh = server.TouchAgent()
|
||||
fresh = server.InputAgent(packages=[]) if name == 'input' else server.TouchAgent()
|
||||
handler = self.handler('/api/%s?start=1' % name, 'a')
|
||||
with mock.patch.object(server, '_touch', fresh), mock.patch.object(fresh, 'start') as start:
|
||||
with mock.patch.object(server, '_' + name, fresh), mock.patch.object(fresh, 'start') as start:
|
||||
handler.do_GET()
|
||||
start.assert_not_called()
|
||||
self.assertEqual(handler.send_error_json.call_args.args[1], 409)
|
||||
@@ -448,46 +391,14 @@ class FinalGetStartTests(unittest.TestCase):
|
||||
def test_desktop_get_start_requires_an_intended_device(self):
|
||||
for name in ('input', 'touch'):
|
||||
with self.subTest(name=name):
|
||||
fresh = server.TouchAgent()
|
||||
fresh = server.InputAgent(packages=[]) if name == 'input' else server.TouchAgent()
|
||||
handler = self.handler('/api/%s?start=1' % name, None)
|
||||
with mock.patch.object(server, '_touch', fresh), mock.patch.object(fresh, 'start') as start:
|
||||
with mock.patch.object(server, '_' + name, fresh), mock.patch.object(fresh, 'start') as start:
|
||||
handler.do_GET()
|
||||
start.assert_not_called()
|
||||
self.assertEqual(handler.send_error_json.call_args.args[1], 400)
|
||||
self.assertEqual(server._work[0], 0)
|
||||
|
||||
def test_input_get_starts_and_polls_gamescope_without_starting_kde_connect(self):
|
||||
touch, kde = mock.Mock(), mock.Mock()
|
||||
touch.status = {'state': 'ready', 'focus': 7}
|
||||
touch.send.return_value = {'state': 'starting', 'sent': False}
|
||||
with mock.patch.object(server, '_touch', touch), mock.patch.object(server, '_input', kde):
|
||||
start = self.handler('/api/input?start=1', 'a')
|
||||
start.do_GET()
|
||||
touch.send.assert_called_once_with([])
|
||||
start.send_json.assert_called_once_with(touch.send.return_value)
|
||||
status = self.handler('/api/input', 'a')
|
||||
status.do_GET()
|
||||
status.send_json.assert_called_once_with(touch.status)
|
||||
kde.send.assert_not_called()
|
||||
kde.start.assert_not_called()
|
||||
|
||||
def test_input_poll_exposes_retained_text_error_and_start_retries(self):
|
||||
touch = mock.Mock(status={'state': 'ready'})
|
||||
touch.send.return_value = {'state': 'ready', 'sent': False}
|
||||
with mock.patch.object(server, '_touch', touch), \
|
||||
mock.patch.object(server, '_kde_queue', [{'key': 'é'}]), \
|
||||
mock.patch.object(server, '_kde_error', 'Text is retained; try again.'), \
|
||||
mock.patch.object(server, '_kde_worker', [None]), \
|
||||
mock.patch.object(server, '_start_kde_locked') as retry:
|
||||
status = self.handler('/api/input', 'a')
|
||||
status.do_GET()
|
||||
self.assertEqual(status.send_json.call_args.args[0]['state'], 'error')
|
||||
retry.assert_not_called() # polling never retries typing on its own
|
||||
start = self.handler('/api/input?start=1', 'a')
|
||||
start.do_GET()
|
||||
retry.assert_called_once_with()
|
||||
touch.send.assert_called_once_with([])
|
||||
|
||||
def test_get_start_validation_and_thread_registration_are_one_reservation(self):
|
||||
attempts = []
|
||||
fresh = server.TouchAgent()
|
||||
@@ -547,10 +458,10 @@ class FinalGetStartTests(unittest.TestCase):
|
||||
(None, None, '?start=1')):
|
||||
for name in ('input', 'touch'):
|
||||
with self.subTest(name=name, query=query, local=link is None):
|
||||
fresh = server.TouchAgent()
|
||||
fresh = server.InputAgent(packages=[]) if name == 'input' else server.TouchAgent()
|
||||
handler = self.handler('/api/' + name + query, meant)
|
||||
with mock.patch.object(server, 'LINK', link), mock.patch.object(server, 'LOCAL', link is None), \
|
||||
mock.patch.object(server, '_touch', fresh), mock.patch.object(fresh, 'start') as start:
|
||||
mock.patch.object(server, '_' + name, fresh), mock.patch.object(fresh, 'start') as start:
|
||||
handler.do_GET()
|
||||
self.assertEqual(start.call_count, 1 if query else 0)
|
||||
handler.send_error_json.assert_not_called()
|
||||
|
||||
@@ -1,261 +0,0 @@
|
||||
"""PC-only Steam helper tests. All app launches and KDE calls are mocked.
|
||||
No portal, interactive Wayland session, Steam installation or Frame is used.
|
||||
"""
|
||||
import sandbox # noqa: F401
|
||||
import contextlib
|
||||
import http.client
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import unittest
|
||||
from unittest import mock
|
||||
from http.server import ThreadingHTTPServer
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / 'ui'))
|
||||
import frame_steam_pipewire as helper
|
||||
import server
|
||||
|
||||
ENV = {'XDG_SESSION_TYPE': 'wayland', 'WAYLAND_DISPLAY': 'wayland-0',
|
||||
'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/mock/session-bus', 'XDG_CURRENT_DESKTOP': 'KDE'}
|
||||
|
||||
|
||||
class HelperTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.stack = contextlib.ExitStack()
|
||||
self.addCleanup(self.stack.close)
|
||||
patches = [mock.patch.dict(os.environ, ENV, clear=True),
|
||||
mock.patch.object(helper.sys, 'platform', 'linux'),
|
||||
mock.patch.object(helper.os, 'geteuid', return_value=1000, create=True),
|
||||
mock.patch.object(helper.Path, 'exists', return_value=False),
|
||||
mock.patch.object(helper, '_launch', None),
|
||||
mock.patch.object(helper, '_steam_running', return_value=False),
|
||||
mock.patch.object(helper.shutil, 'which', side_effect=lambda n: '/usr/bin/' + n),
|
||||
mock.patch.object(helper.subprocess, 'Popen'),
|
||||
mock.patch.object(helper.subprocess, 'run')]
|
||||
started = [self.stack.enter_context(p) for p in patches]
|
||||
self.running, self.which, self.spawn, self.run = started[-4:]
|
||||
self.spawn.return_value.poll.return_value = None
|
||||
self.spawn.return_value.wait.side_effect = subprocess.TimeoutExpired('app', 1)
|
||||
self.run.return_value = subprocess.CompletedProcess([], 0, 'kcm_app-permissions - Application Permissions\n', '')
|
||||
|
||||
def action(self, action):
|
||||
return helper.action({'action': action, 'confirmed': True})
|
||||
|
||||
def test_status_is_read_only(self):
|
||||
self.assertTrue(helper.status()['available'])
|
||||
self.spawn.assert_not_called()
|
||||
self.run.assert_not_called()
|
||||
self.running.assert_not_called()
|
||||
|
||||
def test_platform_and_local_session_gates(self):
|
||||
for platform in ('win32', 'darwin'):
|
||||
with self.subTest(platform=platform), mock.patch.object(helper.sys, 'platform', platform):
|
||||
self.assertFalse(helper.status()['available'])
|
||||
with self.assertRaises(helper.HelperError):
|
||||
self.action('launch')
|
||||
for change in ({'FRAME_LOCAL': '1'}, {'XDG_SESSION_TYPE': 'x11'}, {'WAYLAND_DISPLAY': ''},
|
||||
{'DBUS_SESSION_BUS_ADDRESS': ''}, {'SSH_CONNECTION': 'remote'}, {'SSH_CLIENT': 'remote'}):
|
||||
with self.subTest(change=change), mock.patch.dict(os.environ, change):
|
||||
for action in ('launch', 'permissions'):
|
||||
with self.assertRaises(helper.HelperError):
|
||||
self.action(action)
|
||||
self.spawn.assert_not_called()
|
||||
self.run.assert_not_called()
|
||||
|
||||
def test_root_and_sandbox_refused(self):
|
||||
with mock.patch.object(helper.os, 'geteuid', return_value=0):
|
||||
self.assertIn('not root', helper.status()['reason'])
|
||||
with mock.patch.object(helper.Path, 'exists', return_value=True):
|
||||
with self.assertRaisesRegex(helper.HelperError, 'sandbox'):
|
||||
self.action('launch')
|
||||
self.spawn.assert_not_called()
|
||||
|
||||
def test_only_explicit_supported_actions(self):
|
||||
for body in ({}, {'action': 'launch'}, {'action': 'permissions', 'confirmed': 'true'},
|
||||
{'action': 'delete-all', 'confirmed': True}):
|
||||
with self.subTest(body=body), self.assertRaises(helper.HelperError):
|
||||
helper.action(body)
|
||||
self.spawn.assert_not_called()
|
||||
self.run.assert_not_called()
|
||||
|
||||
def test_launch_exact_command_and_duplicate_guard(self):
|
||||
result = self.action('launch')
|
||||
self.assertTrue(result['launched'])
|
||||
self.assertIn('does not confirm', result['message'])
|
||||
self.spawn.assert_called_once_with(['/usr/bin/steam', '-pipewire'], stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
||||
start_new_session=True)
|
||||
with self.assertRaisesRegex(helper.HelperError, 'already running or starting'):
|
||||
self.action('launch')
|
||||
self.assertEqual(self.spawn.call_count, 1)
|
||||
self.run.assert_not_called()
|
||||
|
||||
def test_running_and_unknown_steam_fail_closed(self):
|
||||
self.running.return_value = True
|
||||
with self.assertRaisesRegex(helper.HelperError, 'Steam > Exit'):
|
||||
self.action('launch')
|
||||
self.running.side_effect = helper.HelperError('Cannot verify')
|
||||
with self.assertRaisesRegex(helper.HelperError, 'Cannot verify'):
|
||||
self.action('launch')
|
||||
self.spawn.assert_not_called()
|
||||
|
||||
def test_missing_launcher_does_not_guess_flatpak(self):
|
||||
self.which.side_effect = None
|
||||
self.which.return_value = None
|
||||
with self.assertRaisesRegex(helper.HelperError, 'Flatpak-only'):
|
||||
self.action('launch')
|
||||
self.spawn.assert_not_called()
|
||||
|
||||
def test_launch_error_is_not_success(self):
|
||||
self.spawn.side_effect = OSError('missing')
|
||||
with self.assertRaisesRegex(helper.HelperError, 'Could not start'):
|
||||
self.action('launch')
|
||||
|
||||
def test_immediate_application_failure_is_not_success(self):
|
||||
self.spawn.return_value.wait.side_effect = None
|
||||
self.spawn.return_value.wait.return_value = 1
|
||||
for action in ('launch', 'permissions'):
|
||||
with self.subTest(action=action), mock.patch.object(helper, '_launch', None):
|
||||
with self.assertRaisesRegex(helper.HelperError, 'exited with an error'):
|
||||
self.action(action)
|
||||
|
||||
def test_permissions_opens_only_verified_exact_module_never_resets(self):
|
||||
result = self.action('permissions')
|
||||
self.assertTrue(result['opened'])
|
||||
self.assertFalse(result['reset'])
|
||||
self.assertIn('No permission was changed', result['message'])
|
||||
self.run.assert_called_once_with(['/usr/bin/kcmshell6', '--list'], capture_output=True,
|
||||
text=True, timeout=5, stdin=subprocess.DEVNULL)
|
||||
self.assertEqual(self.spawn.call_args.args[0], ['/usr/bin/kcmshell6', 'kcm_app-permissions'])
|
||||
self.running.assert_not_called()
|
||||
|
||||
def test_wrong_module_missing_tool_and_other_desktops_only_give_guidance(self):
|
||||
for listing in ('kcm_flatpak - Flatpak Permissions', 'evil_kcm_app-permissions - nope', ''):
|
||||
self.run.return_value.stdout = listing
|
||||
result = self.action('permissions')
|
||||
self.assertFalse(result['reset'])
|
||||
self.assertFalse(result['opened'])
|
||||
self.which.side_effect = None
|
||||
self.which.return_value = None
|
||||
self.assertFalse(self.action('permissions')['opened'])
|
||||
self.which.reset_mock()
|
||||
with mock.patch.dict(os.environ, {'XDG_CURRENT_DESKTOP': 'GNOME'}):
|
||||
self.assertFalse(self.action('permissions')['opened'])
|
||||
self.which.assert_not_called()
|
||||
self.spawn.assert_not_called()
|
||||
|
||||
def test_module_listing_error_or_timeout_is_guidance_not_reset(self):
|
||||
for error in (OSError('missing'), subprocess.TimeoutExpired('kcm', 5)):
|
||||
self.run.side_effect = error
|
||||
result = self.action('permissions')
|
||||
self.assertFalse(result['opened'])
|
||||
self.assertFalse(result['reset'])
|
||||
self.assertIn('kde-config-flatpak', result['message'])
|
||||
self.spawn.assert_not_called()
|
||||
|
||||
|
||||
class ProcessTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.stack = contextlib.ExitStack()
|
||||
self.addCleanup(self.stack.close)
|
||||
self.tmp = self.stack.enter_context(tempfile.TemporaryDirectory())
|
||||
self.proc = Path(self.tmp)
|
||||
# Match the temp files' owner even when tests run as root or on Windows.
|
||||
self.stack.enter_context(mock.patch.object(helper.os, 'geteuid', return_value=self.proc.stat().st_uid, create=True))
|
||||
self.add('1', 'python', b'python\0server.py\0')
|
||||
|
||||
def add(self, pid, comm, cmdline):
|
||||
p = self.proc / pid
|
||||
p.mkdir()
|
||||
(p / 'comm').write_text(comm)
|
||||
(p / 'cmdline').write_bytes(cmdline)
|
||||
|
||||
def test_native_launcher_webhelper_and_flatpak_detected(self):
|
||||
for comm, cmd in [('steam', b'/x/steam\0'), ('bash', b'bash\0/x/steam.sh\0'),
|
||||
('steamwebhelper', b'/x/steamwebhelper\0'),
|
||||
('flatpak', b'flatpak\0run\0com.valvesoftware.Steam\0')]:
|
||||
with self.subTest(comm=comm):
|
||||
(self.proc / '1' / 'comm').write_text(comm)
|
||||
(self.proc / '1' / 'cmdline').write_bytes(cmd)
|
||||
self.assertTrue(helper._steam_running(self.proc))
|
||||
|
||||
def test_unrelated_names_are_not_steam(self):
|
||||
self.add('2', 'steamdeck-tools', b'/bin/steam-tools\0')
|
||||
self.assertFalse(helper._steam_running(self.proc))
|
||||
|
||||
def test_other_user_steam_is_not_this_users_instance(self):
|
||||
self.add('2', 'steam', b'steam\0')
|
||||
with mock.patch.object(helper.os, 'geteuid', return_value=self.proc.stat().st_uid + 1):
|
||||
self.assertFalse(helper._steam_running(self.proc))
|
||||
|
||||
def test_exited_process_is_skipped(self):
|
||||
(self.proc / '2').mkdir()
|
||||
self.assertFalse(helper._steam_running(self.proc))
|
||||
|
||||
def test_unreadable_or_missing_inventory_fails_closed(self):
|
||||
with self.assertRaisesRegex(helper.HelperError, 'Cannot verify'):
|
||||
helper._steam_running(self.proc / 'missing')
|
||||
with mock.patch.object(helper.Path, 'read_bytes', side_effect=PermissionError('denied')):
|
||||
with self.assertRaisesRegex(helper.HelperError, 'Cannot verify'):
|
||||
helper._steam_running(self.proc)
|
||||
|
||||
|
||||
class RouteTests(unittest.TestCase):
|
||||
def test_headset_and_private_servers_never_call_helper(self):
|
||||
for local, private in ((True, False), (False, True)):
|
||||
with mock.patch.object(server, 'LOCAL', local), mock.patch.object(server, 'PRIVATE', private), \
|
||||
mock.patch.object(helper, 'action') as action, mock.patch.object(helper, 'status') as status:
|
||||
self.assertFalse(server.steam_pipewire_state()['available'])
|
||||
with self.assertRaises(server.Failure):
|
||||
server.steam_pipewire_action({'action': 'launch', 'confirmed': True})
|
||||
action.assert_not_called()
|
||||
status.assert_not_called()
|
||||
|
||||
def test_http_guards_get_read_only_and_post_bypasses_headset_work(self):
|
||||
with ThreadingHTTPServer(('127.0.0.1', 0), server.Handler) as httpd:
|
||||
thread = threading.Thread(target=httpd.serve_forever, daemon=True)
|
||||
thread.start()
|
||||
try:
|
||||
def request(method, body=None, headers=None):
|
||||
conn = http.client.HTTPConnection('127.0.0.1', httpd.server_port)
|
||||
conn.request(method, '/api/steam-pipewire', json.dumps(body) if body else None, headers or {})
|
||||
reply = conn.getresponse()
|
||||
code, data = reply.status, json.loads(reply.read())
|
||||
conn.close()
|
||||
return code, data
|
||||
with mock.patch.object(server, 'LOCAL', False), mock.patch.object(server, 'PRIVATE', False), \
|
||||
mock.patch.object(server, 'working', side_effect=AssertionError('headset work')), \
|
||||
mock.patch.object(server, 'ssh', side_effect=AssertionError('Frame access')), \
|
||||
mock.patch.object(helper, 'action', return_value={'reset': False}) as action, \
|
||||
mock.patch.object(helper, 'status', return_value={'available': True}) as status:
|
||||
self.assertEqual(request('POST', {'action': 'launch'})[0], 403)
|
||||
self.assertEqual(request('GET')[0], 403)
|
||||
action.assert_not_called()
|
||||
headers = {'X-Frame-UI': server.UI_KEY, 'X-Frame-Device': 'unrelated-device'}
|
||||
self.assertEqual(request('GET', headers=headers), (200, {'available': True}))
|
||||
action.assert_not_called()
|
||||
status.assert_called_once()
|
||||
body = {'action': 'permissions', 'confirmed': True}
|
||||
self.assertEqual(request('POST', body, headers), (200, {'reset': False}))
|
||||
action.assert_called_once_with(body)
|
||||
finally:
|
||||
httpd.shutdown()
|
||||
thread.join()
|
||||
|
||||
|
||||
class PageTests(unittest.TestCase):
|
||||
@unittest.skipUnless(shutil.which('node'), 'Node exercises production page handlers')
|
||||
def test_production_page_handlers(self):
|
||||
result = subprocess.run(['node', '--test', str(ROOT / 'tests/steam_pipewire_ui.cjs')],
|
||||
capture_output=True, text=True)
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -150,14 +150,6 @@ class Apply(unittest.TestCase):
|
||||
self.assertFalse(self.t.STALE[0])
|
||||
self.assertEqual(self.said[-1][1].get("stale"), None)
|
||||
|
||||
def test_stale_survives_a_bare_release(self):
|
||||
gs = FakeGamescope()
|
||||
panel = self.t.apply(gs, {"button": "left", "down": True, "window": 99, "display": ":1"}, None)
|
||||
self.assertTrue(self.t.STALE[0])
|
||||
self.t.apply(gs, {"button": "left", "down": False}, panel) # the page's release names no panel
|
||||
self.assertTrue(self.t.STALE[0])
|
||||
self.assertEqual(self.said[-1][1].get("stale"), True)
|
||||
|
||||
def test_same_window_id_on_the_other_display_is_another_panel(self):
|
||||
gs = FakeGamescope()
|
||||
self.t.apply(gs, {"fx": 0.5, "fy": 0.5, "window": 7, "display": ":0"}, None)
|
||||
|
||||
@@ -1,287 +0,0 @@
|
||||
"""Synthetic sysfs fixtures and loopback HTTP; never require an adapter or a Frame."""
|
||||
import sandbox # noqa: F401
|
||||
import contextlib
|
||||
import http.client
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'ui'))
|
||||
import frame_wireless_doctor as wd
|
||||
|
||||
|
||||
class Parsers(unittest.TestCase):
|
||||
def test_channel_without_leaking_identifiers(self):
|
||||
for frequency, band, channel in [(2412, '2.4 GHz', 1), (5180, '5 GHz', 36), (5975, '6 GHz', 5)]:
|
||||
text = f'Interface wlan0\n addr aa:bb:cc:dd:ee:ff\n ssid private\n channel {channel} ({frequency} MHz), width: 80 MHz'
|
||||
self.assertEqual(wd.radio_info(text), dict(channel=channel, frequency_mhz=frequency, band=band))
|
||||
self.assertIsNone(wd.radio_info('Interface wlan0\n type managed\n'))
|
||||
self.assertEqual(wd.supported_frequencies('* 2412 MHz [1] (20.0 dBm)\n* 5975 MHz [5] (disabled)\n* 5180 MHz [36] (23.0 dBm)'), [2412, 5180])
|
||||
|
||||
def test_non_linux_and_headset_mode_do_not_read_or_run(self):
|
||||
for kwargs in ({'system': 'darwin'}, {'system': 'win32'}, {'system': 'linux', 'local': True}):
|
||||
with patch.object(wd, 'Reader', side_effect=AssertionError('must not probe')):
|
||||
self.assertFalse(wd.diagnose(**kwargs)['supported'])
|
||||
with patch.dict(os.environ, {'FRAME_LOCAL': '1'}), patch.object(wd, 'Reader') as reader:
|
||||
self.assertFalse(wd.diagnose(system='linux')['supported'])
|
||||
reader.assert_not_called()
|
||||
|
||||
def test_command_failure_is_not_empty_success(self):
|
||||
reader = wd.Reader()
|
||||
for error, status in [(FileNotFoundError(), 'missing'), (PermissionError(), 'unavailable'),
|
||||
(subprocess.TimeoutExpired('iw', 3), 'timeout')]:
|
||||
with patch.object(wd.subprocess, 'run', side_effect=error):
|
||||
self.assertEqual(reader.command(['iw', 'dev', 'wlan0', 'info'])['status'], status)
|
||||
with patch.object(wd.subprocess, 'run', return_value=subprocess.CompletedProcess([], 1, '', 'Operation not permitted')) as run:
|
||||
result = reader.command(['iw', 'dev', 'wlan0', 'info'])
|
||||
self.assertEqual(result['status'], 'denied')
|
||||
self.assertEqual(result['text'], '')
|
||||
self.assertEqual(run.call_args.kwargs['stdin'], subprocess.DEVNULL)
|
||||
self.assertEqual(run.call_args.kwargs['timeout'], 3)
|
||||
self.assertNotIn('shell', run.call_args.kwargs)
|
||||
|
||||
def test_read_failure_and_empty_inventory_remain_unknown(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
reader = wd.Reader(root, root, root)
|
||||
report = wd.diagnose(reader=reader, system='linux', local=False)
|
||||
checks = {c['id']: c for c in report['checks']}
|
||||
self.assertEqual(checks['presence']['status'], 'unknown')
|
||||
self.assertIn('reads', checks)
|
||||
with patch.object(Path, 'open', side_effect=PermissionError()):
|
||||
self.assertIsNone(reader.read(Path('/synthetic/denied')))
|
||||
self.assertIn('PermissionError', reader.gaps[-1])
|
||||
|
||||
|
||||
class Page(unittest.TestCase):
|
||||
@unittest.skipUnless(shutil.which('node'), 'Node is needed for real page script checks')
|
||||
def test_on_demand_selection_and_failure_recovery(self):
|
||||
result = subprocess.run(['node', str(Path(__file__).parent / 'page/wireless_doctor.mjs')],
|
||||
capture_output=True, text=True, timeout=20)
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
|
||||
|
||||
class FixtureReader(wd.Reader):
|
||||
"""Invented USB 1234:5678; it is deliberately not a claimed Valve ID."""
|
||||
def __init__(self, root):
|
||||
super().__init__(root / 'sys', root / 'dev', root / 'proc')
|
||||
self.commands = []
|
||||
self.responses = {}
|
||||
|
||||
def command(self, argv):
|
||||
self.commands.append(argv)
|
||||
return self.responses.get(argv[0], {'status': 'missing', 'detail': argv[0] + ' is not installed', 'text': ''})
|
||||
|
||||
|
||||
@unittest.skipUnless(sys.platform == 'linux', 'Linux sysfs symlink fixture')
|
||||
class LinuxEvidence(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(self.tmp.cleanup)
|
||||
self.root = Path(self.tmp.name)
|
||||
self.r = FixtureReader(self.root)
|
||||
self.usb = self.r.sysfs / 'devices/pci0000:00/usb1/1-2'
|
||||
for name, content in {'idVendor': '1234', 'idProduct': '5678', 'product': 'Synthetic adapter', 'busnum': '1', 'devnum': '2'}.items():
|
||||
self.write(self.usb / name, content)
|
||||
bus = self.r.sysfs / 'bus/usb/devices'
|
||||
bus.mkdir(parents=True)
|
||||
(bus / '1-2').symlink_to(self.usb, target_is_directory=True)
|
||||
(self.r.sysfs / 'class/net').mkdir(parents=True)
|
||||
(self.r.sysfs / 'class/rfkill').mkdir(parents=True)
|
||||
self.r.proc.mkdir(parents=True)
|
||||
self.write(self.r.dev / 'bus/usb/001/002', '')
|
||||
|
||||
def write(self, path, text):
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(text)
|
||||
|
||||
def nic(self, name='wlan0', index=0, driver=True):
|
||||
device = self.usb / f'1-2:1.{index}'
|
||||
device.mkdir(parents=True, exist_ok=True)
|
||||
net = self.r.sysfs / 'class/net' / name
|
||||
net.mkdir()
|
||||
(net / 'device').symlink_to(device, target_is_directory=True)
|
||||
(net / 'wireless').mkdir()
|
||||
self.write(net / 'operstate', 'down')
|
||||
phy = self.r.sysfs / f'devices/ieee80211/phy{index}'
|
||||
phy.mkdir(parents=True)
|
||||
(net / 'phy80211').symlink_to(phy, target_is_directory=True)
|
||||
if driver:
|
||||
binding = self.r.sysfs / 'bus/usb/drivers/synthetic_driver'
|
||||
binding.mkdir(parents=True, exist_ok=True)
|
||||
module = self.r.sysfs / 'module/synthetic_module'
|
||||
module.mkdir(parents=True, exist_ok=True)
|
||||
if not (binding / 'module').exists():
|
||||
(binding / 'module').symlink_to(module, target_is_directory=True)
|
||||
(device / 'driver').symlink_to(binding, target_is_directory=True)
|
||||
return net
|
||||
|
||||
def report(self, device='usb:1-2'):
|
||||
return wd.diagnose(device, reader=self.r, system='linux', local=False)
|
||||
|
||||
def checks(self, report):
|
||||
return {c['id']: c for c in report['checks']}
|
||||
|
||||
def test_inventory_does_not_select_or_execute_commands(self):
|
||||
self.nic()
|
||||
report = self.report(None)
|
||||
self.assertIsNone(report['selected'])
|
||||
self.assertEqual(report['usb'][0]['interfaces'], ['net:wlan0'])
|
||||
self.assertEqual(report['interfaces'][0]['usb'], 'usb:1-2')
|
||||
self.assertIn('Unverified', report['identity'])
|
||||
self.assertEqual(self.r.commands, [])
|
||||
|
||||
def test_nearest_usb_ancestor_wins_over_upstream_hub(self):
|
||||
hub = self.usb.parent / '1-1'
|
||||
hub.mkdir()
|
||||
old = self.usb
|
||||
self.usb = hub / old.name
|
||||
old.rename(self.usb)
|
||||
bus = self.r.sysfs / 'bus/usb/devices'
|
||||
(bus / '1-2').unlink()
|
||||
(bus / '1-2').symlink_to(self.usb, target_is_directory=True)
|
||||
for name, content in {'idVendor': '4321', 'idProduct': '8765', 'busnum': '1', 'devnum': '1'}.items():
|
||||
self.write(hub / name, content)
|
||||
(bus / '1-1').symlink_to(hub, target_is_directory=True)
|
||||
self.nic()
|
||||
report = self.report(None)
|
||||
self.assertEqual(report['interfaces'][0]['usb'], 'usb:1-2')
|
||||
upstream_hub = next(d for d in report['usb'] if d['port'] == '1-1')
|
||||
self.assertEqual(upstream_hub['interfaces'], [])
|
||||
|
||||
def test_unbound_usb_is_selectable_without_guessing_driver(self):
|
||||
report = self.report()
|
||||
checks = self.checks(report)
|
||||
self.assertEqual(checks['binding']['status'], 'unknown')
|
||||
self.assertIn('No wireless interface', checks['binding']['evidence'][0])
|
||||
self.assertEqual(checks['channel']['status'], 'unknown')
|
||||
self.assertNotIn('iw', [a[0] for a in self.r.commands])
|
||||
self.assertIn('1234:5678', json.dumps(report))
|
||||
|
||||
def test_selected_radio_and_all_commands_are_read_only(self):
|
||||
self.nic()
|
||||
for key, value in {'type': 'wlan', 'name': 'phy0', 'soft': '1', 'hard': '0'}.items():
|
||||
self.write(self.r.sysfs / 'class/rfkill/rfkill0' / key, value)
|
||||
for pid, name in enumerate(('NetworkManager', 'iwd', 'wpa_supplicant'), 1):
|
||||
self.write(self.r.proc / str(pid) / 'comm', name)
|
||||
self.r.responses = {
|
||||
'udevadm': dict(status='ok', detail='udevadm completed', text='ID_NET_DRIVER=synthetic_driver\nID_SERIAL=secret_serial\nTAGS=:uaccess:\n'),
|
||||
'iw': dict(status='ok', detail='iw completed', text='channel 5 (5975 MHz)\naddr aa:bb:cc:dd:ee:ff\nssid private\n* 5975 MHz [5] (23.0 dBm)'),
|
||||
'nmcli': dict(status='ok', detail='nmcli completed', text='30 (disconnected)\nyes\nsynthetic_driver\n')}
|
||||
report = self.report('net:wlan0')
|
||||
checks = self.checks(report)
|
||||
self.assertEqual(checks['binding']['status'], 'ok')
|
||||
self.assertIn('module=synthetic_module', checks['binding']['evidence'][0])
|
||||
self.assertEqual(checks['rfkill']['status'], 'warning')
|
||||
self.assertIn('6 GHz', json.dumps(checks['channel']))
|
||||
self.assertIn('coexistence alone is not a conflict', checks['managers']['suggestion'])
|
||||
self.assertIn('Both iwd and wpa_supplicant', checks['managers']['suggestion'])
|
||||
for secret in ('secret_serial', 'aa:bb:cc:dd:ee:ff', 'ssid private'):
|
||||
self.assertNotIn(secret, json.dumps(report))
|
||||
self.assertEqual(self.r.commands, [
|
||||
['udevadm', 'info', '--query=property', '--path=' + str(self.r.sysfs / 'class/net/wlan0')],
|
||||
['iw', 'dev', 'wlan0', 'info'], ['iw', 'phy', 'phy0', 'info'],
|
||||
['nmcli', '-g', 'GENERAL.STATE,GENERAL.NM-MANAGED,GENERAL.DRIVER', 'device', 'show', 'wlan0']])
|
||||
|
||||
def test_unrelated_rfkill_and_missing_tools_are_not_healthy(self):
|
||||
self.nic(driver=False)
|
||||
for key, value in {'type': 'wlan', 'name': 'phy7', 'soft': '1', 'hard': '1'}.items():
|
||||
self.write(self.r.sysfs / 'class/rfkill/rfkill7' / key, value)
|
||||
checks = self.checks(self.report())
|
||||
self.assertEqual(checks['binding']['status'], 'unknown')
|
||||
self.assertEqual(checks['rfkill']['status'], 'unknown')
|
||||
self.assertEqual(checks['permissions']['status'], 'unknown')
|
||||
self.assertEqual(checks['channel']['status'], 'unknown')
|
||||
self.r.responses['iw'] = dict(status='denied', detail='iw exited 1 (permission denied)', text='')
|
||||
self.assertIn('permission denied', json.dumps(self.checks(self.report())['channel']))
|
||||
|
||||
def test_unmanaged_interface_does_not_trigger_a_network_repair(self):
|
||||
self.nic()
|
||||
self.r.responses['nmcli'] = dict(status='ok', detail='nmcli completed', text='10 (unmanaged)\nno\nsynthetic_driver\n')
|
||||
check = self.checks(self.report())['managers']
|
||||
self.assertIn('NetworkManager managed: no', check['evidence'])
|
||||
self.assertIn('unmanaged alone is not a fault', check['suggestion'])
|
||||
self.assertIn('Do not force management on', check['suggestion'])
|
||||
|
||||
def test_multiple_interfaces_require_explicit_interface(self):
|
||||
self.nic()
|
||||
self.nic('wlan1', 1)
|
||||
checks = self.checks(self.report())
|
||||
self.assertIn('interface-selection', checks)
|
||||
self.assertEqual(checks['channel']['status'], 'unknown')
|
||||
self.assertNotIn('iw', [a[0] for a in self.r.commands])
|
||||
self.assertNotIn('interface-selection', self.checks(self.report('net:wlan1')))
|
||||
|
||||
def test_disappeared_or_injected_selector_is_rejected_before_commands(self):
|
||||
for selector in ('net:missing', 'usb:../../etc', 'net:;sudo reboot', '', ['wlan0']):
|
||||
with self.assertRaises(ValueError):
|
||||
self.report(selector)
|
||||
self.assertEqual(self.r.commands, [])
|
||||
|
||||
def test_cli_json_and_exit_contract(self):
|
||||
with patch.object(wd, 'diagnose', return_value=self.report(None)), contextlib.redirect_stdout(io.StringIO()) as out:
|
||||
self.assertEqual(wd.main(['--json']), 0)
|
||||
self.assertEqual(json.loads(out.getvalue())['schema'], 1)
|
||||
with patch.object(wd, 'diagnose', return_value={'supported': False}), contextlib.redirect_stdout(io.StringIO()):
|
||||
self.assertEqual(wd.main(['--json']), 2)
|
||||
|
||||
|
||||
class HttpBoundary(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
import server
|
||||
cls.server_module = server
|
||||
# Serve the real handler only: main() would start unrelated headset workers.
|
||||
cls.httpd = server.LoopbackServer(('127.0.0.1', 0), server.Handler)
|
||||
cls.thread = threading.Thread(target=cls.httpd.serve_forever, daemon=True)
|
||||
cls.thread.start()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
cls.httpd.shutdown()
|
||||
cls.httpd.server_close()
|
||||
cls.thread.join()
|
||||
|
||||
def request(self, path, key=True):
|
||||
conn = http.client.HTTPConnection('127.0.0.1', self.httpd.server_address[1], timeout=10)
|
||||
headers = {'X-Frame-UI': self.server_module.UI_KEY} if key else {}
|
||||
conn.request('GET', path, headers=headers)
|
||||
response = conn.getresponse()
|
||||
result = response.status, response.read()
|
||||
conn.close()
|
||||
return result
|
||||
|
||||
def test_auth_and_headset_independence(self):
|
||||
with patch.object(self.server_module, 'ssh', side_effect=AssertionError('no SSH')), \
|
||||
patch.object(self.server_module, 'working', side_effect=AssertionError('no headset lock')), \
|
||||
patch.object(wd, 'diagnose', return_value={'supported': True, 'checks': []}) as probe:
|
||||
self.assertEqual(self.request('/api/wireless-doctor', key=False)[0], 403)
|
||||
probe.assert_not_called()
|
||||
code, data = self.request('/api/wireless-doctor?device=net%3Awlan0')
|
||||
self.assertEqual(code, 200)
|
||||
self.assertTrue(json.loads(data)['supported'])
|
||||
probe.assert_called_once_with('net:wlan0', local=self.server_module.LOCAL)
|
||||
|
||||
def test_local_mode_refuses_before_collection(self):
|
||||
with patch.object(self.server_module, 'LOCAL', True), patch.object(wd, 'Reader', side_effect=AssertionError('no probes')):
|
||||
code, body = self.request('/api/wireless-doctor')
|
||||
self.assertEqual(code, 200)
|
||||
self.assertFalse(json.loads(body)['supported'])
|
||||
|
||||
def test_stale_selection_is_bad_request_and_page_is_packaged(self):
|
||||
with patch.object(wd, 'diagnose', side_effect=ValueError('Device is no longer present')):
|
||||
self.assertEqual(self.request('/api/wireless-doctor?device=net:gone')[0], 400)
|
||||
code, page = self.request('/wireless-doctor')
|
||||
self.assertEqual(code, 200)
|
||||
self.assertIn(b'No checks have run', page)
|
||||
package = json.loads((Path(__file__).resolve().parent.parent / 'app/package.json').read_text())
|
||||
filters = next(r['filter'] for r in package['build']['extraResources'] if r['from'] == '../ui')
|
||||
self.assertIn('*.py', filters)
|
||||
self.assertIn('*.html', filters)
|
||||
@@ -25,7 +25,7 @@ function workspaceFixture() {
|
||||
const context={URL,document:{querySelectorAll:s=>s==='.page'?pages:s==='#nav a'?links:controls[s]||[],title:'',body:{addEventListener(k,fn){listeners['body-'+k]=fn;}}},
|
||||
window:win,location,scroller:()=>({get scrollTop(){return win.scrollY;},scrollTo:o=>win.scrollTo(o)}),scrollToY:y=>win.scrollTo({top:y}),requestAnimationFrame:fn=>fn(),$:el,live:false,toggleLive(on){this.live=on;calls.push(['live',on]);},
|
||||
loadAndroid(){calls.push(['android']);},closeDevPop(){},metaLib:{connected:false},renderMetaApps(){},
|
||||
loadSteamPipewire(){calls.push(['steam-pipewire']);},loadMacView(){calls.push(['macview']);},loadPanelSwitcher(){calls.push(['panels']);},loadDisplays(){calls.push(['displays']);},
|
||||
loadMacView(){calls.push(['macview']);},loadPanelSwitcher(){calls.push(['panels']);},loadDisplays(){calls.push(['displays']);},
|
||||
gm:{src:'owned',dl:null,byId:new Map(),shown:0,shownBySource:{owned:0,store:0}},setGameSource(src){context.gm.src=src;},state:null,stateRead:{valid:false},online:null,devGen:0,androidApps:[],jobsRunning:0,viewGen:0,
|
||||
esc:s=>String(s??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]))};
|
||||
vm.createContext(context);
|
||||
|
||||
+10
-19
@@ -88,14 +88,12 @@ class Overlay:
|
||||
def close(self):
|
||||
# Best effort: SteamVR removes a disconnected client's overlays anyway,
|
||||
# and a teardown error must not overwrite a finished playback's status.
|
||||
try:
|
||||
for h in reversed(self.handles):
|
||||
try:
|
||||
self.call('DestroyOverlay', h)
|
||||
except Exception: # signals are already ignored here, so Stop isn't lost
|
||||
pass
|
||||
finally:
|
||||
self.vr.VR_ShutdownInternal()
|
||||
for h in reversed(self.handles):
|
||||
try:
|
||||
self.call('DestroyOverlay', h)
|
||||
except RuntimeError:
|
||||
pass
|
||||
self.vr.VR_ShutdownInternal()
|
||||
|
||||
|
||||
def probe(path):
|
||||
@@ -185,9 +183,6 @@ def play(args):
|
||||
except OverlayBusy:
|
||||
pending.insert(0, item)
|
||||
return
|
||||
except RuntimeError as e:
|
||||
# Only the cosmetic surround is queued here.
|
||||
print('Theatre surround unavailable: %s' % e, flush=True)
|
||||
|
||||
def hold(handle, data, w, h):
|
||||
"""Keep a still (photo or splat) up until Stop, retrying through standby."""
|
||||
@@ -208,14 +203,10 @@ def play(args):
|
||||
try:
|
||||
vr = Overlay()
|
||||
if args.theatre:
|
||||
try:
|
||||
surround = vr.create('framecontrol.media.surround', 40, 4, order=0)
|
||||
vr.call('SetOverlayAlpha', surround, .85)
|
||||
if not show(surround, b'\x00\x00\x00\xff', 1, 1):
|
||||
pending.append((surround, b'\x00\x00\x00\xff', 1, 1))
|
||||
except RuntimeError as e:
|
||||
# Cosmetic: play without the dark surround rather than not at all.
|
||||
print('Theatre surround unavailable: %s' % e, flush=True)
|
||||
surround = vr.create('framecontrol.media.surround', 40, 4, order=0)
|
||||
vr.call('SetOverlayAlpha', surround, .85)
|
||||
if not show(surround, b'\x00\x00\x00\xff', 1, 1):
|
||||
pending.append((surround, b'\x00\x00\x00\xff', 1, 1))
|
||||
screen = vr.create('framecontrol.media.screen', 3 if args.theatre else 1.6, 2,
|
||||
plan['layout'] != 'mono', aspect)
|
||||
if splat:
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
"""Local Linux helper for Steam's own desktop sharing; never a Frame client.
|
||||
|
||||
No portal grants/tokens are read or written. KDE owns the manual Revoke UI.
|
||||
"""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
MODULE = 'kcm_app-permissions'
|
||||
GUIDANCE = (
|
||||
'In KDE System Settings > Applications > Application Permissions, find the Steam entry '
|
||||
'(reported as Steam Linux Runtime 3.0). Under Screen sharing, choose Manage 1 Session '
|
||||
'(the count may differ), verify it belongs to Steam, then Revoke only that session. '
|
||||
'Do not use Revoke All or change another app. Retry Steam desktop sharing to choose a screen. '
|
||||
'If the entry is missing or ambiguous, stop; it can appear intermittently. '
|
||||
'If Application Permissions is missing on Ubuntu/Kubuntu, check whether your distribution '
|
||||
'provides kde-config-flatpak; the reporter needed that package and a reboot. '
|
||||
'Frame Control does not install packages or change permissions.'
|
||||
)
|
||||
_lock = threading.Lock()
|
||||
_launch = None
|
||||
|
||||
|
||||
class HelperError(RuntimeError):
|
||||
pass
|
||||
|
||||
|
||||
def unavailable():
|
||||
if sys.platform != 'linux' or os.environ.get('FRAME_LOCAL') == '1':
|
||||
return 'This helper runs on your Linux PC, not the headset.'
|
||||
if os.geteuid() == 0:
|
||||
return 'Open Frame Control as your normal desktop user, not root.'
|
||||
if Path('/.flatpak-info').exists():
|
||||
return 'This sandbox cannot verify host Steam processes. Use a terminal on your PC.'
|
||||
if os.environ.get('SSH_CONNECTION') or os.environ.get('SSH_CLIENT'):
|
||||
return 'Open Frame Control in your local Wayland desktop session, not over SSH.'
|
||||
if (os.environ.get('XDG_SESSION_TYPE', '').lower() != 'wayland'
|
||||
or not os.environ.get('WAYLAND_DISPLAY') or not os.environ.get('DBUS_SESSION_BUS_ADDRESS')):
|
||||
return 'A local Wayland desktop with its session bus is required. X11 and headless sessions are unsupported.'
|
||||
return ''
|
||||
|
||||
|
||||
def status():
|
||||
reason = unavailable()
|
||||
return {'available': not reason, 'reason': reason, 'guidance': GUIDANCE}
|
||||
|
||||
|
||||
def _steam_running(proc=Path('/proc')):
|
||||
"""Fail closed if our process inventory cannot be read. No command execution.
|
||||
|
||||
Include launch scripts and Flatpak Steam, not just the final Steam binary.
|
||||
Other users' processes are irrelevant to this user's Steam instance.
|
||||
"""
|
||||
try:
|
||||
entries = list(proc.iterdir())
|
||||
if not any(p.name.isdecimal() for p in entries):
|
||||
raise OSError('empty process inventory')
|
||||
for p in entries:
|
||||
if not p.name.isdecimal():
|
||||
continue
|
||||
try:
|
||||
if p.stat().st_uid != os.geteuid():
|
||||
continue
|
||||
comm = (p / 'comm').read_text().strip().lower()
|
||||
args = (p / 'cmdline').read_bytes().decode('utf-8', 'replace').split('\0')
|
||||
except FileNotFoundError:
|
||||
continue # a process exited while scanning
|
||||
names = {Path(a).name.lower() for a in args if a}
|
||||
if (comm in {'steam', 'steamwebhelper', 'steam.sh'}
|
||||
or names.intersection({'steam', 'steam.sh', 'steamwebhelper', 'com.valvesoftware.steam'})):
|
||||
return True
|
||||
return False
|
||||
except OSError as exc:
|
||||
raise HelperError('Cannot verify whether Steam is running. Exit Steam and launch '
|
||||
'steam -pipewire yourself from a local terminal.') from exc
|
||||
|
||||
|
||||
def _spawn(argv):
|
||||
try:
|
||||
return subprocess.Popen(argv, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL, start_new_session=True)
|
||||
except OSError as exc:
|
||||
raise HelperError('Could not start the local application. Check it is installed and opens '
|
||||
'from your desktop. No permission was changed.') from exc
|
||||
|
||||
|
||||
def _check_start(child):
|
||||
try:
|
||||
code = child.wait(timeout=1)
|
||||
except subprocess.TimeoutExpired:
|
||||
return
|
||||
if code:
|
||||
raise HelperError('The local application exited with an error. Try opening it from your '
|
||||
'desktop to see its error. No permission was changed.')
|
||||
|
||||
|
||||
def action(body):
|
||||
global _launch
|
||||
kind = body.get('action')
|
||||
if kind not in ('launch', 'permissions'):
|
||||
raise HelperError('Unknown Steam helper action.')
|
||||
if body.get('confirmed') is not True:
|
||||
raise HelperError('Use the Steam helper button to request this action explicitly.')
|
||||
reason = unavailable()
|
||||
if reason:
|
||||
raise HelperError(reason)
|
||||
with _lock:
|
||||
if kind == 'launch':
|
||||
if (_launch is not None and _launch.poll() is None) or _steam_running():
|
||||
raise HelperError('Steam is already running or starting. Exit Steam using Steam > Exit '
|
||||
'(after saving games), then click Launch Steam with PipeWire again. '
|
||||
'Frame Control will not stop it or change an existing session.')
|
||||
steam = shutil.which('steam')
|
||||
if not steam:
|
||||
raise HelperError('No steam launcher was found on PATH. For a Flatpak-only install, '
|
||||
'exit Steam and run flatpak run com.valvesoftware.Steam -pipewire '
|
||||
'yourself from a local terminal. Nothing was launched.')
|
||||
_launch = _spawn([steam, '-pipewire'])
|
||||
_check_start(_launch)
|
||||
return {'launched': True, 'message': 'Requested Steam with -pipewire for this launch only. '
|
||||
'Use Steam\'s desktop-in-headset flow; Steam and your desktop portal control the picker. '
|
||||
'This does not confirm screen sharing started.'}
|
||||
|
||||
# There is no portable verified mapping from Steam's runtime display name
|
||||
# to a portal restore token. Never guess an app ID or delete a grant.
|
||||
desktop = os.environ.get('XDG_CURRENT_DESKTOP', '').upper().split(':')
|
||||
kcm = shutil.which('kcmshell6') if 'KDE' in desktop else None
|
||||
if not kcm:
|
||||
return {'reset': False, 'opened': False, 'message': 'No permission was changed. '
|
||||
'KDE Application Permissions could not be opened automatically. ' + GUIDANCE}
|
||||
try:
|
||||
listing = subprocess.run([kcm, '--list'], capture_output=True, text=True, timeout=5,
|
||||
stdin=subprocess.DEVNULL)
|
||||
except (OSError, subprocess.TimeoutExpired):
|
||||
listing = None
|
||||
if (listing is None or listing.returncode
|
||||
or not re.search(r'^\s*' + re.escape(MODULE) + r'\s+-', listing.stdout, re.M)):
|
||||
return {'reset': False, 'opened': False, 'message': 'No permission was changed. '
|
||||
'The KDE Application Permissions module is unavailable. ' + GUIDANCE}
|
||||
child = _spawn([kcm, MODULE])
|
||||
_check_start(child)
|
||||
return {'reset': False, 'opened': True, 'message': 'Requested KDE Application Permissions. '
|
||||
'No permission was changed by Frame Control. ' + GUIDANCE}
|
||||
+1
-3
@@ -511,10 +511,8 @@ def apply(gs, event, panel):
|
||||
say("ready", focus=panel.get("window"), display=panel.get("display"), stale=True) # the page re-syncs
|
||||
STALE[0] = True
|
||||
return panel
|
||||
release = event.get("down") is False and ("button" in event or "key" in event)
|
||||
if STALE[0] and not stale and not (release and "window" not in event):
|
||||
if STALE[0] and not stale:
|
||||
# Anything that goes through (a trackpad move names no panel) means caught up: stop re-syncing.
|
||||
# A bare release doesn't: the page leaves the panel off releases, so it says nothing about focus.
|
||||
STALE[0] = False
|
||||
say("ready", focus=(panel or {}).get("window"), display=(panel or {}).get("display"))
|
||||
if "fx" in event and panel and panel.get("window"):
|
||||
|
||||
@@ -1,269 +0,0 @@
|
||||
"""Read-only Linux PC Wireless Adapter doctor. No SSH, scans or repairs.
|
||||
|
||||
Run on the PC: python3 ui/frame_wireless_doctor.py [--device net:wlan0] [--json]
|
||||
USB IDs are observations, never a claim that a device is Valve's adapter.
|
||||
"""
|
||||
import argparse
|
||||
from datetime import datetime, timezone
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import platform
|
||||
import re
|
||||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
class Reader:
|
||||
"""Bounded local reads; failures remain evidence rather than healthy defaults."""
|
||||
def __init__(self, sysfs=Path('/sys'), dev=Path('/dev'), proc=Path('/proc')):
|
||||
self.sysfs, self.dev, self.proc = Path(sysfs), Path(dev), Path(proc)
|
||||
self.gaps = []
|
||||
|
||||
def read(self, path):
|
||||
try:
|
||||
with path.open(errors='replace') as source:
|
||||
return source.read(4096).strip()
|
||||
except OSError as exc:
|
||||
self.gaps.append(f'{path}: {type(exc).__name__}')
|
||||
return None
|
||||
|
||||
def entries(self, path):
|
||||
try:
|
||||
return sorted(path.iterdir())
|
||||
except OSError as exc:
|
||||
self.gaps.append(f'{path}: {type(exc).__name__}')
|
||||
return []
|
||||
|
||||
def link(self, path):
|
||||
try:
|
||||
return path.resolve(strict=True).name
|
||||
except OSError as exc:
|
||||
if not isinstance(exc, FileNotFoundError):
|
||||
self.gaps.append(f'{path}: {type(exc).__name__}')
|
||||
return None
|
||||
|
||||
def command(self, argv):
|
||||
try:
|
||||
result = subprocess.run(argv, stdin=subprocess.DEVNULL, capture_output=True,
|
||||
text=True, errors='replace', timeout=3,
|
||||
env={**os.environ, 'LC_ALL': 'C'})
|
||||
except FileNotFoundError:
|
||||
return {'status': 'missing', 'detail': f'{argv[0]} is not installed', 'text': ''}
|
||||
except subprocess.TimeoutExpired:
|
||||
return {'status': 'timeout', 'detail': f'{argv[0]} timed out', 'text': ''}
|
||||
except OSError as exc:
|
||||
return {'status': 'unavailable', 'detail': f'{argv[0]}: {type(exc).__name__}', 'text': ''}
|
||||
if result.returncode:
|
||||
# Do not export command output that may contain SSIDs, MACs or other identifiers.
|
||||
denied = bool(re.search(r'permission|not permitted|access denied', result.stderr, re.I))
|
||||
return {'status': 'denied' if denied else 'unavailable',
|
||||
'detail': f'{argv[0]} exited {result.returncode}' + (' (permission denied)' if denied else ''),
|
||||
'text': ''}
|
||||
return {'status': 'ok', 'detail': f'{argv[0]} completed', 'text': result.stdout[:131072]}
|
||||
|
||||
|
||||
def inventory(reader):
|
||||
usb = []
|
||||
for path in reader.entries(reader.sysfs / 'bus/usb/devices'):
|
||||
# USB interface entries have no idVendor; inspect them under their parent below.
|
||||
if ':' in path.name or not (path / 'idVendor').exists():
|
||||
continue
|
||||
vid, pid = reader.read(path / 'idVendor'), reader.read(path / 'idProduct')
|
||||
bindings = []
|
||||
for child in reader.entries(path):
|
||||
if ':' in child.name:
|
||||
bindings.append({'interface': child.name, 'driver': reader.link(child / 'driver'),
|
||||
'module': reader.link(child / 'driver/module')})
|
||||
usb.append({'id': 'usb:' + path.name, 'port': path.name, 'vid': vid, 'pid': pid,
|
||||
'product': reader.read(path / 'product') if (path / 'product').exists() else None,
|
||||
'bus': reader.read(path / 'busnum'), 'number': reader.read(path / 'devnum'),
|
||||
'bindings': bindings, 'interfaces': []})
|
||||
interfaces = []
|
||||
for path in reader.entries(reader.sysfs / 'class/net'):
|
||||
if not ((path / 'wireless').exists() or (path / 'phy80211').exists()):
|
||||
continue
|
||||
try:
|
||||
device_path = (path / 'device').resolve(strict=True)
|
||||
ancestors = [device_path, *device_path.parents]
|
||||
except OSError:
|
||||
ancestors = []
|
||||
# Nearest USB ancestor: a downstream adapter must not be attributed to its hub.
|
||||
by_port = {d['port']: d for d in usb}
|
||||
parent = next((by_port[p.name] for p in ancestors if p.name in by_port), None)
|
||||
item = {'id': 'net:' + path.name, 'name': path.name,
|
||||
'usb': parent['id'] if parent else None, 'phy': reader.link(path / 'phy80211'),
|
||||
'driver': reader.link(path / 'device/driver'),
|
||||
'module': reader.link(path / 'device/driver/module'),
|
||||
'state': reader.read(path / 'operstate')}
|
||||
interfaces.append(item)
|
||||
if parent:
|
||||
parent['interfaces'].append(item['id'])
|
||||
return usb, interfaces
|
||||
|
||||
|
||||
def radio_info(text):
|
||||
"""Parse only channel facts; omit interface MAC, SSID and link identifiers."""
|
||||
match = re.search(r'channel (\d+) \((\d+) MHz\)', text)
|
||||
if not match:
|
||||
return None
|
||||
frequency = int(match[2])
|
||||
band = '2.4 GHz' if 2400 <= frequency < 2500 else '5 GHz' if 4900 <= frequency < 5925 else '6 GHz' if 5925 <= frequency <= 7125 else 'other'
|
||||
return {'channel': int(match[1]), 'frequency_mhz': frequency, 'band': band}
|
||||
|
||||
|
||||
def supported_frequencies(text):
|
||||
return sorted(set(int(n) for n in re.findall(r'\* (\d+) MHz \[\d+\](?![^\n]*disabled)', text)))
|
||||
|
||||
|
||||
def diagnose(device=None, *, reader=None, system=None, local=None):
|
||||
"""Collect only on explicit request. The server calls this outside headset work."""
|
||||
report = {'schema': 1, 'captured_at': datetime.now(timezone.utc).isoformat(), 'scope': 'Linux PC only; read-only', 'supported': False,
|
||||
'identity': 'Unverified: select hardware by its observed USB port or network interface. '
|
||||
'No trusted Steam Frame Wireless Adapter VID/PID is assumed.',
|
||||
'selected': device, 'usb': [], 'interfaces': [], 'checks': []}
|
||||
def check(key, status, title, evidence, suggestion):
|
||||
report['checks'].append(dict(id=key, status=status, title=title,
|
||||
evidence=evidence, suggestion=suggestion))
|
||||
if (system or sys.platform) != 'linux' or (os.environ.get('FRAME_LOCAL') == '1' if local is None else local):
|
||||
check('platform', 'unknown', 'Linux PC required', [],
|
||||
'Run this doctor on the Linux PC, not on the Frame or the phone server.')
|
||||
return report
|
||||
report.update(supported=True, kernel=platform.release())
|
||||
r = reader or Reader()
|
||||
usb, interfaces = inventory(r)
|
||||
report.update(usb=usb, interfaces=interfaces)
|
||||
items = usb + interfaces
|
||||
selected = next((d for d in items if d['id'] == device), None)
|
||||
if device is not None and selected is None:
|
||||
raise ValueError('Device is no longer present. Refresh and select an observed device.')
|
||||
check('presence', 'ok' if items else 'unknown', 'USB and wireless interface presence',
|
||||
[f'{len(usb)} USB devices; {len(interfaces)} wireless interfaces visible in sysfs'],
|
||||
'Select the intended adapter. USB presence alone does not establish wireless support.' if items else
|
||||
'No candidates are visible. Check the PC USB connection and whether a VM/container hides hardware; this does not prove the adapter is absent.')
|
||||
if selected is None:
|
||||
check('selection', 'unknown', 'Hardware identity needs selection', [],
|
||||
'Compare the inventory before and after reconnecting the adapter when safe. Select its USB port even if no network interface exists.')
|
||||
if r.gaps:
|
||||
check('reads', 'unknown', 'Some local evidence is unavailable', r.gaps,
|
||||
'Review unavailable paths locally; do not infer healthy hardware from missing evidence.')
|
||||
return report
|
||||
correlated = [d for d in interfaces if d['usb'] == device]
|
||||
nic = selected if device.startswith('net:') else correlated[0] if len(correlated) == 1 else None
|
||||
if len(correlated) > 1:
|
||||
check('interface-selection', 'unknown', 'More than one wireless interface',
|
||||
[d['id'] for d in correlated], 'Select a network interface for per-interface radio and ownership checks.')
|
||||
parent = selected if device.startswith('usb:') else next((d for d in usb if d['id'] == selected['usb']), None)
|
||||
names = [d['name'] for d in interfaces if parent and d['usb'] == parent['id']]
|
||||
check('binding', 'ok' if nic and nic['driver'] else 'unknown', 'Driver and module binding',
|
||||
([f"{nic['name']}: driver={nic['driver'] or 'unavailable'}, module={nic['module'] or 'unavailable (possibly built in)'}, state={nic['state'] or 'unknown'}"] if nic else ['Multiple wireless interfaces are correlated; select one explicitly.' if len(correlated) > 1 else 'No wireless interface is correlated with this USB device.']) +
|
||||
([f"USB {parent['port']} observed ID {parent['vid']}:{parent['pid']}; wireless interfaces: {', '.join(names) or 'none'}"] +
|
||||
[f"{b['interface']}: driver={b['driver'] or 'unbound'}, module={b['module'] or 'unavailable'}" for b in parent['bindings']] if parent else []),
|
||||
'A bound driver does not prove streaming support. A missing module link can mean a built-in driver.' if nic and nic['driver'] else
|
||||
'Check this observed device ID against your distribution/kernel and vendor documentation. No driver package or cause can be inferred; do not install a guessed driver or disable Secure Boot.')
|
||||
path = r.sysfs / ('class/net/' + nic['name'] if nic else 'bus/usb/devices/' + parent['port'])
|
||||
udev = r.command(['udevadm', 'info', '--query=property', '--path=' + str(path)])
|
||||
properties = [line for line in udev['text'].splitlines() if line.split('=', 1)[0] in
|
||||
('ID_NET_DRIVER', 'ID_USB_DRIVER', 'ID_VENDOR_ID', 'ID_MODEL_ID', 'TAGS', 'CURRENT_TAGS')]
|
||||
access = []
|
||||
if parent and (parent['bus'] or '').isdigit() and (parent['number'] or '').isdigit():
|
||||
node = r.dev / f"bus/usb/{int(parent['bus']):03d}/{int(parent['number']):03d}"
|
||||
try:
|
||||
st = node.stat()
|
||||
access.append(f'{node}: mode={stat.S_IMODE(st.st_mode):04o}, uid={st.st_uid}, gid={st.st_gid}, '
|
||||
f'user read={os.access(node, os.R_OK)}, write={os.access(node, os.W_OK)}')
|
||||
except OSError as exc:
|
||||
access.append(f'{node}: {type(exc).__name__}')
|
||||
check('permissions', 'info' if udev['status'] == 'ok' else 'unknown', 'Permissions and udev evidence',
|
||||
[udev['detail'], *properties, *access],
|
||||
'USB node access is only an observation; kernel networking may not require direct USB access. '
|
||||
'If Steam reports access denied for this exact device, compare the vendor/distribution udev guidance. Do not use broad chmod rules or run Steam as root.')
|
||||
blocks = []
|
||||
for entry in r.entries(r.sysfs / 'class/rfkill'):
|
||||
if r.read(entry / 'type') != 'wlan':
|
||||
continue
|
||||
phy = r.read(entry / 'name')
|
||||
blocks.append({'name': phy, 'soft': r.read(entry / 'soft'), 'hard': r.read(entry / 'hard'),
|
||||
'selected_phy': bool(nic and nic['phy'] and phy == nic['phy'])})
|
||||
relevant = [b for b in blocks if b['selected_phy']]
|
||||
blocked = any(b[k] == '1' for b in relevant for k in ('soft', 'hard'))
|
||||
complete = relevant and all(b[k] in ('0', '1') for b in relevant for k in ('soft', 'hard'))
|
||||
check('rfkill', 'warning' if blocked else 'ok' if complete else 'unknown', 'Radio blocks',
|
||||
[f"{b['name']}: soft={b['soft']}, hard={b['hard']}, selected PHY={b['selected_phy']}" for b in blocks] or ['No readable WLAN rfkill entries.'],
|
||||
'The selected PHY is blocked. Review the PC radio switch/airplane mode; a hard block may need a hardware switch.' if blocked else
|
||||
'Only a matching PHY establishes this adapter’s rfkill state. Unrelated or unavailable entries do not rule out a radio block.')
|
||||
if nic:
|
||||
iw = r.command(['iw', 'dev', nic['name'], 'info'])
|
||||
radio = radio_info(iw['text'])
|
||||
frequencies = []
|
||||
phy = nic['phy']
|
||||
if phy and re.fullmatch(r'phy\d+', phy):
|
||||
capabilities = r.command(['iw', 'phy', phy, 'info'])
|
||||
frequencies = supported_frequencies(capabilities['text'])
|
||||
else:
|
||||
capabilities = {'detail': 'No PHY identifier available'}
|
||||
check('channel', 'info' if radio else 'unknown', 'Current channel and band',
|
||||
[iw['detail'], json.dumps(radio) if radio else 'No current channel reported.',
|
||||
capabilities['detail'], f'Enabled frequencies reported by iw (MHz): {frequencies or "unavailable"}'],
|
||||
'This is local radio evidence, not proof of the Steam streaming link or supported regions. '
|
||||
'If no channel is reported the radio may be idle. Do not force a band, channel or regulatory country.')
|
||||
nm = r.command(['nmcli', '-g', 'GENERAL.STATE,GENERAL.NM-MANAGED,GENERAL.DRIVER', 'device', 'show', nic['name']])
|
||||
# These fields contain no SSIDs, addresses or credentials.
|
||||
fields = nm['text'].strip().splitlines()[:3] if nm['status'] == 'ok' else []
|
||||
nm_evidence = [f'{label}: {value}' for label, value in zip(
|
||||
('NetworkManager state', 'NetworkManager managed', 'NetworkManager driver'), fields)]
|
||||
unmanaged = len(fields) > 1 and fields[1].lower() == 'no'
|
||||
else:
|
||||
nm = {'detail': 'No correlated wireless interface; per-interface ownership unavailable'}
|
||||
nm_evidence = []
|
||||
unmanaged = False
|
||||
check('channel', 'unknown', 'Current channel and band', [], 'Select one correlated network interface to check channel/band.' if len(correlated) > 1 else 'No correlated wireless interface exists; channel/band cannot be determined.')
|
||||
processes = set()
|
||||
proc_entries = r.entries(r.proc)
|
||||
for entry in proc_entries:
|
||||
if entry.name.isdigit():
|
||||
comm = r.read(entry / 'comm')
|
||||
if comm in ('NetworkManager', 'iwd', 'wpa_supplicant'):
|
||||
processes.add(comm)
|
||||
check('managers', 'info' if proc_entries else 'unknown', 'Network manager coexistence',
|
||||
[f'Visible processes: {", ".join(sorted(processes)) or "none"}', nm['detail'], *nm_evidence],
|
||||
'NetworkManager commonly uses iwd or wpa_supplicant as its Wi-Fi backend; coexistence alone is not a conflict. '
|
||||
+ ('Both iwd and wpa_supplicant are visible. Check locally which service owns the selected interface before attributing a conflict; do not stop either automatically.' if {'iwd', 'wpa_supplicant'} <= processes else
|
||||
'Per-interface ownership by iwd/wpa_supplicant is unverified. Process absence in a restricted /proc view is inconclusive.')
|
||||
+ (' NetworkManager reports this interface unmanaged. Steam or another service may own it; unmanaged alone is not a fault. Do not force management on.' if unmanaged else ''))
|
||||
if r.gaps:
|
||||
check('reads', 'unknown', 'Some local evidence is unavailable', r.gaps[:40],
|
||||
'Review unavailable paths locally. Permission failures or disappearing devices are not evidence of an adapter fault; do not elevate this doctor.')
|
||||
check('limits', 'info', 'What this report cannot establish', [],
|
||||
'No physical adapter or Frame link test runs here. Firmware, USB stability under load, Steam support and the reported Ubuntu/Kubuntu 26.04 cause remain unverified. Review the report before sharing it.')
|
||||
return report
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
||||
parser.add_argument('--device', help='observed selector, e.g. net:wlan0 or usb:1-2; omitted lists candidates')
|
||||
parser.add_argument('--json', action='store_true', help='print structured local evidence; review before sharing')
|
||||
args = parser.parse_args(argv)
|
||||
try:
|
||||
data = diagnose(args.device)
|
||||
except ValueError as exc:
|
||||
parser.error(str(exc))
|
||||
if args.json:
|
||||
print(json.dumps(data, indent=2, ensure_ascii=False))
|
||||
else:
|
||||
print(data['scope'] + '\n' + data['identity'])
|
||||
for d in data['usb']:
|
||||
print(f" {d['id']} {d['vid']}:{d['pid']} {d['product'] or 'unnamed USB device'}")
|
||||
for d in data['interfaces']:
|
||||
print(f" {d['id']} USB={d['usb'] or 'not correlated'} driver={d['driver'] or 'unknown'}")
|
||||
for c in data['checks']:
|
||||
print(f"\n[{c['status'].upper()}] {c['title']}")
|
||||
for line in c['evidence']:
|
||||
print(' ' + line)
|
||||
print(' ' + c['suggestion'])
|
||||
return 0 if data['supported'] else 2
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
raise SystemExit(main())
|
||||
+18
-76
@@ -1270,7 +1270,6 @@
|
||||
<div class="sub sync-note" id="clipsSyncNote" hidden></div>
|
||||
<div class="hint">Clips and background recordings from Steam's game recording in the headset. Export joins one into a single <code>.mp4</code> in <code>~/Videos/SteamFrame</code>, however long it is, without re-encoding it. Recordings you make with <b>Record</b> go there too.</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="page" data-page="games">
|
||||
@@ -1431,7 +1430,7 @@
|
||||
|
||||
<div class="page" data-page="tools">
|
||||
<div class="workspace-heading"><div><a href="#tools" id="toolBack" class="workspace-link" hidden>← All tools</a><h1 id="toolTitle">Tools</h1><p id="toolSubtitle">Choose a task for your Frame.</p></div></div>
|
||||
<div id="toolDirectory"><section class="tool-group"><h2>Content & files</h2><div class="quick-routes"><a href="#transfer"><span>Send to Frame</span><small>Add files, APKs or your own games</small></a><a href="#media"><span>Media player</span><small>Play your own videos and media</small></a><a href="#linuxApps"><span>Linux apps</span><small>Install and manage desktop apps</small></a></div></section><section class="tool-group"><h2>Play & control</h2><div class="quick-routes"><a href="#capture"><span>Capture & Live</span><small>See and control the headset view</small></a><a href="#pad" title="Type on the headset (T)"><span>Type on the headset</span><small>Keyboard, trackpad and clipboard</small></a><a href="#panels"><span>Panel switcher</span><small>Bring an open panel into view</small></a><a href="#vrTools"><span>VR tools</span><small>Performance HUD and VR utilities</small></a><a href="#comfort"><span>Family & comfort</span><small>Session reminders and breaks</small></a><a href="#macview" id="macToolLink" hidden><span>Mac in the headset</span><small>Share Mac windows and displays</small></a><a href="#steamPipewire" id="steamPipewireLink" hidden><span>Steam desktop sharing</span><small>Linux: launch Steam or re-pick a screen</small></a><a href="#macview" id="pcToolLink" hidden><span>PC in the headset</span><small>Experimental: share this PC's screen</small></a></div></section><section class="tool-group"><h2>Your Frame</h2><div class="quick-routes"><a href="#powerReport"><span>Power & heat report</span><small>Read-only observation and offline downloads</small></a><a href="#storage"><span>Game storage</span><small>Free space and Steam install sizes</small></a><a href="#backup" id="backupToolLink"><span>Backup & recovery</span><small>Save games and settings, restore after a reset</small></a></div><a class="workspace-link" href="#settings">Connection, display & preferences →</a></section><section class="tool-group"><h2>Assistant</h2><a class="workspace-link" href="/assistant">Open assistant & AI agents →</a><p class="sub">Use your own model endpoint or review a proposed MCP action.</p></section></div>
|
||||
<div id="toolDirectory"><section class="tool-group"><h2>Content & files</h2><div class="quick-routes"><a href="#transfer"><span>Send to Frame</span><small>Add files, APKs or your own games</small></a><a href="#media"><span>Media player</span><small>Play your own videos and media</small></a><a href="#linuxApps"><span>Linux apps</span><small>Install and manage desktop apps</small></a></div></section><section class="tool-group"><h2>Play & control</h2><div class="quick-routes"><a href="#capture"><span>Capture & Live</span><small>See and control the headset view</small></a><a href="#pad" title="Type on the headset (T)"><span>Type on the headset</span><small>Keyboard, trackpad and clipboard</small></a><a href="#panels"><span>Panel switcher</span><small>Bring an open panel into view</small></a><a href="#vrTools"><span>VR tools</span><small>Performance HUD and VR utilities</small></a><a href="#comfort"><span>Family & comfort</span><small>Session reminders and breaks</small></a><a href="#macview" id="macToolLink" hidden><span>Mac in the headset</span><small>Share Mac windows and displays</small></a><a href="#macview" id="pcToolLink" hidden><span>PC in the headset</span><small>Experimental: share this PC's screen</small></a></div></section><section class="tool-group"><h2>Your Frame</h2><div class="quick-routes"><a href="#powerReport"><span>Power & heat report</span><small>Read-only observation and offline downloads</small></a><a href="#storage"><span>Game storage</span><small>Free space and Steam install sizes</small></a><a href="#backup" id="backupToolLink"><span>Backup & recovery</span><small>Save games and settings, restore after a reset</small></a></div><a class="workspace-link" href="#settings">Connection, display & preferences →</a></section><section class="tool-group"><h2>Assistant</h2><a class="workspace-link" href="/assistant">Open assistant & AI agents →</a><p class="sub">Use your own model endpoint or review a proposed MCP action.</p></section></div>
|
||||
<div class="grid-3" id="toolWorkspace">
|
||||
<section class="panel" id="powerReport">
|
||||
<h2>Power & heat report</h2>
|
||||
@@ -1447,23 +1446,6 @@
|
||||
<p class="hint">Open the saved HTML in your browser; it works offline and includes JSON/CSV downloads. Unknown readings are never treated as zero. Rails overlap; do not add them. Sensor accuracy is unverified. Reports include sensor paths and OS builds: review before sharing.</p>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="steamPipewire" hidden>
|
||||
<h2>Steam desktop sharing <span class="tag">Linux PC only</span></h2>
|
||||
<p>Help for Steam's own <code>steam -pipewire</code> desktop-in-headset flow on Wayland.
|
||||
Frame Control's Linux “PC in the headset” feature remains disabled. This helper needs no headset connection.</p>
|
||||
<p>Save your games and exit Steam using <b>Steam → Exit</b> before launching.
|
||||
This launch does not save a setting or restart an existing Steam session.</p>
|
||||
<div class="row"><button id="steamPipewireLaunch" disabled>Launch Steam with PipeWire</button>
|
||||
<button id="steamPipewireReset" disabled>Reset screen-share choice…</button></div>
|
||||
<p class="sub">Reset opens KDE's Application Permissions so you can revoke a verified Steam screen-sharing
|
||||
session yourself. Frame Control does not reset permissions automatically. Other desktops get guidance only.</p>
|
||||
<p id="steamPipewireGuidance">KDE System Settings → Applications → Application Permissions → Steam Linux Runtime 3.0
|
||||
→ Screen sharing → Manage 1 Session → Revoke. Verify the session belongs to Steam. Never use Revoke All.
|
||||
If the entry is missing or ambiguous, stop.</p>
|
||||
<p id="steamPipewireStatus" role="status" aria-live="polite"></p>
|
||||
<p class="sub"><a href="https://github.com/saphid/frame-control/blob/main/docs/steam-pipewire.md" target="_blank" rel="noopener">Setup, missing KDE module and limitations →</a></p>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="vrTools">
|
||||
<div class="shelf-head"><h2>VR comfort and performance</h2><span class="spacer"></span><span class="sub" id="vrUpdated">Waiting for the Frame</span></div>
|
||||
<div class="stats" id="vrMetrics"></div>
|
||||
@@ -1516,7 +1498,8 @@
|
||||
<div class="shelf-head"><h2>Keyboard and trackpad</h2><span class="sub" id="padState"></span><span class="spacer"></span>
|
||||
<button class="small" id="padOn">Turn on</button>
|
||||
</div>
|
||||
<p class="sub" id="padIntro">Use this computer's keyboard and mouse in the panel you're using in the headset.</p>
|
||||
<p class="sub" id="padIntro">Use this computer's keyboard and mouse in apps on the Frame, such as Chromium or the
|
||||
desktop's Linux apps.</p>
|
||||
<div id="padBody" hidden>
|
||||
<div class="pad-area" id="padArea" tabindex="0" role="application" aria-label="Trackpad for the Frame">
|
||||
<div class="pad-hint" id="padHint"></div>
|
||||
@@ -1539,9 +1522,10 @@
|
||||
<button data-pad-key="12" title="Enter">Enter</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="hint">Types and points in whichever panel has focus in the headset, through Valve's own input path: nothing to
|
||||
install and no internet needed. Accents and emoji go through KDE Connect, which comes with Frame Control and starts
|
||||
the first time you type one (it copies Valve's build for the Frame, 3.6 MB, into your home folder there). <a href="#" data-about>Licences</a></div>
|
||||
<div class="hint">Types and points in apps on the Frame, such as Chromium or the desktop's Linux apps; Steam's own VR menus
|
||||
don't take it. It works through KDE Connect, which comes with Frame Control: the first time, it copies Valve's build
|
||||
for the Frame (3.6 MB, 18 MB unpacked) into your home folder there and pairs with it. No internet needed, and nothing
|
||||
else to install. <a href="#" data-about>Licences</a></div>
|
||||
</div>
|
||||
<div class="shelf-head" style="margin-top:18px"><h2>Clipboard</h2></div>
|
||||
<textarea id="clipText" placeholder="Text to put on the Frame's clipboard…"></textarea>
|
||||
@@ -1754,7 +1738,7 @@
|
||||
<button class="small" id="sessionCheck">Check</button></div>
|
||||
<div class="sub" id="sessionState">Check which mode the headset is in.</div>
|
||||
<div class="row" style="margin-top:12px"><button class="small" id="sessionGame" disabled>Return to Game Mode</button></div>
|
||||
<div class="hint">Uses Valve's supported Game Mode switch for this SteamOS build.
|
||||
<div class="hint">Uses the same switch as Valve's developer tools (<code>steamos-session-select gamescope</code>).
|
||||
It closes the desktop and anything open in it. If the headset can't be reached, hold Power for 10 seconds to
|
||||
restart it; <a href="https://github.com/saphid/frame-control/blob/main/docs/backup-and-recovery.md#stuck-in-desktop-mode" target="_blank">more ways back</a>.</div>
|
||||
</section>
|
||||
@@ -1826,7 +1810,7 @@
|
||||
</div>
|
||||
<div class="page" data-page="settings">
|
||||
<div class="workspace-heading"><div><a href="#settings" id="settingsBack" class="workspace-link" hidden>← All settings</a><h1 id="settingsTitle">Settings</h1><p id="settingsSubtitle">Connection, headset controls and Frame Control preferences.</p></div></div>
|
||||
<div id="settingsDirectory" class="quick-routes"><a id="wirelessDoctorSettings" href="/wireless-doctor" hidden><span>Linux Wireless Adapter doctor</span><small>Read-only checks on this PC</small></a><a href="#devices"><span>Devices & connection</span><small>Connect a Frame or switch headsets</small></a><a href="#control"><span>Control Center</span><small>Live metrics and searchable controls</small></a><a href="#home"><span>Frame activity</span><small>Readiness, running apps and downloads</small></a><a href="#display"><span>App display & reports</span><small>Resolution, scale and compatibility</small></a><a href="#artworkSettings"><span>Library artwork</span><small>Images and artwork sources</small></a><a href="#autoSync" id="syncLink"><span>Copy to this computer</span><small>New screenshots and clips, automatically</small></a><a href="#privacy"><span>Privacy & updates</span><small>Sharing preferences and app updates</small></a><a href="#power"><span>Remote & power</span><small>Remote access, sleep and restart</small></a></div>
|
||||
<div id="settingsDirectory" class="quick-routes"><a href="#devices"><span>Devices & connection</span><small>Connect a Frame or switch headsets</small></a><a href="#control"><span>Control Center</span><small>Live metrics and searchable controls</small></a><a href="#home"><span>Frame activity</span><small>Readiness, running apps and downloads</small></a><a href="#display"><span>App display & reports</span><small>Resolution, scale and compatibility</small></a><a href="#artworkSettings"><span>Library artwork</span><small>Images and artwork sources</small></a><a href="#autoSync" id="syncLink"><span>Copy to this computer</span><small>New screenshots and clips, automatically</small></a><a href="#privacy"><span>Privacy & updates</span><small>Sharing preferences and app updates</small></a><a href="#power"><span>Remote & power</span><small>Remote access, sleep and restart</small></a></div>
|
||||
<div id="settingsWorkspace" hidden></div>
|
||||
</div>
|
||||
|
||||
@@ -1843,7 +1827,6 @@
|
||||
<div class="list" id="devList"><div class="sub">Loading…</div></div>
|
||||
<div class="hint">Frame Control talks to one headset at a time. Each can be reached at several addresses;
|
||||
it tries them all at once and uses the best one that answers on the network you're on.</div>
|
||||
<p id="wirelessDoctorLink" hidden><a href="/wireless-doctor">Linux Wireless Adapter doctor ↗</a><br><span class="sub">Read-only PC checks; works without a connected Frame.</span></p>
|
||||
<h3 style="margin-top:22px">This computer's network</h3>
|
||||
<div id="netNow" class="sub">Checking…</div>
|
||||
<div class="row" style="margin-top:8px; flex-wrap:nowrap">
|
||||
@@ -2152,11 +2135,6 @@ $("bottombar").onclick = () => {
|
||||
const HOST = { computer: "computer" };
|
||||
function applyHostWording(h) {
|
||||
Object.assign(HOST, h);
|
||||
for (const id of ["wirelessDoctorSettings", "wirelessDoctorLink"]) {
|
||||
$(id).hidden = !!h.mobile || h.os !== "Linux";
|
||||
const link = $(id).tagName === "A" ? $(id) : $(id).querySelector("a");
|
||||
link.href = "/wireless-doctor?key=" + encodeURIComponent(UI_KEY);
|
||||
}
|
||||
window.frameControlCenter?.host(h);
|
||||
$("desktopBatteryComfort").hidden = !!h.mobile || !window.frameApp?.notify;
|
||||
// The iPhone app: the server runs on the Frame, and saving goes to the phone's Photos.
|
||||
@@ -5913,47 +5891,13 @@ $("macview").onclick = async e => {
|
||||
setTimeout(loadMacView, 800);
|
||||
};
|
||||
|
||||
// Local Steam helper: never start an action on navigation or a status read.
|
||||
let steamPipewireBusy = false, steamPipewireRead = 0;
|
||||
async function loadSteamPipewire() {
|
||||
if (steamPipewireBusy) return;
|
||||
const read = ++steamPipewireRead;
|
||||
try {
|
||||
const s = await api('/api/steam-pipewire');
|
||||
if (read !== steamPipewireRead) return;
|
||||
$('steamPipewireLaunch').disabled = $('steamPipewireReset').disabled = !s.available;
|
||||
$('steamPipewireStatus').textContent = s.reason || '';
|
||||
if (s.guidance) $('steamPipewireGuidance').textContent = s.guidance;
|
||||
} catch (e) {
|
||||
if (read !== steamPipewireRead) return;
|
||||
$('steamPipewireLaunch').disabled = $('steamPipewireReset').disabled = true;
|
||||
$('steamPipewireStatus').textContent = e.message;
|
||||
}
|
||||
}
|
||||
async function steamPipewireAction(action) {
|
||||
if (steamPipewireBusy) return;
|
||||
steamPipewireBusy = true;
|
||||
steamPipewireRead++;
|
||||
$('steamPipewireLaunch').disabled = $('steamPipewireReset').disabled = true;
|
||||
try {
|
||||
const r = await api('/api/steam-pipewire', {action, confirmed: true});
|
||||
$('steamPipewireStatus').textContent = r.message;
|
||||
} catch (e) { $('steamPipewireStatus').textContent = e.message; }
|
||||
finally {
|
||||
steamPipewireBusy = false;
|
||||
$('steamPipewireLaunch').disabled = $('steamPipewireReset').disabled = false;
|
||||
}
|
||||
}
|
||||
$('steamPipewireLaunch').onclick = () => steamPipewireAction('launch');
|
||||
$('steamPipewireReset').onclick = () => steamPipewireAction('permissions');
|
||||
|
||||
// ---- shared destinations and intentional secondary workspaces ----
|
||||
const PAGES = ["apps", "games", "tools", "settings"];
|
||||
const SECONDARY_PAGES = ["home", "capture", "devices", "control"];
|
||||
const SECTION_PAGE = {library:"games", discover:"apps", android:"apps", view:"capture", shots:"capture", device:"home",
|
||||
steamPipewire:"tools", vrTools:"tools", comfort:"tools", assistant:"tools", pad:"tools", sideloaded:"games", getgames:"games", steamStore:"games", androidLibrary:"apps", appStore:"apps", linuxApps:"apps",
|
||||
vrTools:"tools", comfort:"tools", assistant:"tools", pad:"tools", sideloaded:"games", getgames:"games", steamStore:"games", androidLibrary:"apps", appStore:"apps", linuxApps:"apps",
|
||||
display:"settings", androidSettings:"settings", transfer:"tools", media:"tools", artworkSettings:"settings", autoSync:"settings", power:"settings", macview:"tools", privacy:"settings", panels:"tools", storage:"tools", powerReport:"tools", backup:"tools"};
|
||||
const TOOL_TITLES = {steamPipewire:"Steam desktop sharing", transfer:"Send to Frame", media:"Media player", artworkSettings:"Library artwork", autoSync:"Copy to this computer",
|
||||
const TOOL_TITLES = {transfer:"Send to Frame", media:"Media player", artworkSettings:"Library artwork", autoSync:"Copy to this computer",
|
||||
pad:"Type on the headset", panels:"Panel switcher", vrTools:"VR tools", comfort:"Family & comfort", androidSettings:"App display & reports",
|
||||
power:"Remote & power", macview:"Mac in the headset", privacy:"Privacy & updates", storage:"Game storage", powerReport:"Power & heat report", backup:"Backup & recovery"};
|
||||
const workspace = {source:"all", scope:"installed", apps:"installed", scroll:new Map(), key:null, hash:null, y:0};
|
||||
@@ -6059,7 +6003,6 @@ function showPage(e) {
|
||||
const host = $(kind === 'tools' ? 'toolWorkspace' : 'settingsWorkspace');
|
||||
if (activeTool && $(activeTool).parentNode !== host) host.append($(activeTool));
|
||||
}
|
||||
if (tool === 'steamPipewire') loadSteamPipewire();
|
||||
if (tool === 'macview') loadMacView();
|
||||
if (tool === 'panels') loadPanelSwitcher();
|
||||
if (tool === 'backup') loadBackups();
|
||||
@@ -6145,11 +6088,11 @@ const typesText = el => el?.matches?.('textarea, input:not([type=range], [type=c
|
||||
document.addEventListener("focusin", e => document.body.classList.toggle("typing", !!typesText(e.target)));
|
||||
document.addEventListener("focusout", () => document.body.classList.remove("typing"));
|
||||
|
||||
// ---- keyboard and trackpad: events go to the Frame through gamescope (ui/frame_touch.py); accents and emoji through KDE Connect ----
|
||||
// ---- keyboard and trackpad: events go to KDE Connect on the Frame (see ui/frame_input_agent.py) ----
|
||||
const pad = { state: "off", queue: [], sending: false, poll: null, captured: false };
|
||||
const PAD_STATES = {
|
||||
off: "", starting: "Connecting…", installing: "Setting up (first time only)…",
|
||||
pairing: "Pairing with KDE Connect…", waiting: "Waiting for queued text…", ready: "On",
|
||||
off: "", starting: "Connecting…", installing: "Setting up KDE Connect on the Frame (first time only)…",
|
||||
pairing: "Pairing with KDE Connect…", ready: "On",
|
||||
};
|
||||
// KDE Connect's specialKey numbers (plugins/mousepad in its source).
|
||||
const PAD_SPECIAL = { Backspace: 1, Tab: 2, ArrowLeft: 4, ArrowUp: 5, ArrowRight: 6, ArrowDown: 7, PageUp: 8,
|
||||
@@ -6168,14 +6111,14 @@ function padShow(status) {
|
||||
$("padArea").classList.toggle("off", !ready);
|
||||
$("padBody").hidden = pad.state === "off";
|
||||
$("padIntro").hidden = pad.state !== "off";
|
||||
$("padHint").textContent = pad.state === "error" ? status.message || "Couldn't reach the Frame."
|
||||
$("padHint").textContent = pad.state === "error" ? status.message || "Couldn't reach KDE Connect on the Frame."
|
||||
: !ready ? (busy ? PAD_STATES[pad.state] : "Turn on to use this as a trackpad for the Frame.")
|
||||
: TOUCH ? "Drag to move the pointer · tap to click · two fingers to scroll · two-finger tap to right-click"
|
||||
: pad.captured ? "Your mouse and keyboard now control the Frame. Press Esc to stop."
|
||||
: "Click here to use your mouse and keyboard on the Frame (Esc to stop), or drag like a trackpad.";
|
||||
clearTimeout(pad.poll);
|
||||
if (ready && pad.queue.length) padFlush();
|
||||
if (busy || status.queued) {
|
||||
if (busy) {
|
||||
const gen = devGen;
|
||||
pad.poll = setTimeout(async () => {
|
||||
const status = await api('/api/input').catch(e => ({state:'error', message:e.message}));
|
||||
@@ -6198,7 +6141,7 @@ function padSend(event) {
|
||||
// While it reconnects, keys and clicks wait in the queue; pointer moves would be stale.
|
||||
// A button release is always kept, so a drag never leaves the button held on the Frame.
|
||||
const room = pad.queue.length < 200 || event.singlerelease;
|
||||
const reconnecting = ["starting", "pairing", "installing", "waiting"].includes(pad.state) && room;
|
||||
const reconnecting = ["starting", "pairing", "installing"].includes(pad.state) && room;
|
||||
// Even after an error: a button pressed on the Frame must be let go once it's back.
|
||||
const release = event.singlerelease && pad.state !== "off";
|
||||
if (pad.state !== "ready" && !(reconnecting && !isMove(event)) && !release) return;
|
||||
@@ -6231,7 +6174,7 @@ async function padFlush() {
|
||||
const status = await api("/api/input", { events });
|
||||
if (gen !== devGen) return;
|
||||
if (!status.sent) padKeep(events);
|
||||
if (status.state !== "ready" || status.queued) padShow(status);
|
||||
if (status.state !== "ready") padShow(status);
|
||||
} catch (e) {
|
||||
if (gen !== devGen) return;
|
||||
padKeep(events);
|
||||
@@ -7464,7 +7407,6 @@ api("/api/host").then(h => {
|
||||
window.frameControlCenter?.host(h);
|
||||
$("macToolLink").hidden = h.mobile || h.os !== "macOS";
|
||||
$("pcToolLink").hidden = h.mobile || h.os !== "Windows";
|
||||
$("steamPipewireLink").hidden = h.mobile || h.os !== "Linux";
|
||||
if (!h.mobile && h.os === "Windows") TOOL_TITLES.macview = "PC in the headset";
|
||||
$("backupToolLink").hidden = !!h.mobile; // backups are folders on a computer
|
||||
if (h.mobile) return;
|
||||
|
||||
+15
-279
@@ -60,7 +60,6 @@ import frame_host # noqa: E402
|
||||
import frame_link # noqa: E402
|
||||
import frame_macview # noqa: E402
|
||||
import frame_pcview # noqa: E402
|
||||
import frame_steam_pipewire # noqa: E402
|
||||
import frame_media # noqa: E402
|
||||
import frame_panels # noqa: E402
|
||||
import frame_quest # noqa: E402
|
||||
@@ -70,11 +69,9 @@ import frame_report # noqa: E402
|
||||
import frame_store # noqa: E402
|
||||
import frame_telemetry # noqa: E402
|
||||
import frame_titles # noqa: E402
|
||||
import frame_touch # noqa: E402
|
||||
import frame_webinstall # noqa: E402
|
||||
import frame_vr # noqa: E402
|
||||
import frame_utilities # noqa: E402
|
||||
import frame_wireless_doctor # noqa: E402
|
||||
import frame_compat_db # noqa: E402
|
||||
|
||||
frame_host.trust_bundled_cas()
|
||||
@@ -114,9 +111,7 @@ frame_android.SSH_OPTS = SSH[1:]
|
||||
|
||||
|
||||
_power = frame_power.Observation()
|
||||
# Pad delivery reserves the route before its own locks; InputAgent.start()
|
||||
# captures that same route synchronously, so this lock must be reentrant.
|
||||
_route_lock = threading.RLock()
|
||||
_route_lock = threading.Lock()
|
||||
|
||||
|
||||
def route(alias, host_opts):
|
||||
@@ -128,10 +123,13 @@ def route(alias, host_opts):
|
||||
moved = alias != FRAME
|
||||
if moved:
|
||||
_power.stop('Headset switched; received samples retained for the previous headset')
|
||||
reset_pad = globals().get("reset_pad_route")
|
||||
if reset_pad:
|
||||
reset_pad() # cancel queued input and both agents before publishing the new route
|
||||
frame_catalog._env.clear() # the SteamOS and Lepton builds reports record are per headset
|
||||
# Invalidate launches before publishing the new route. send/stop share
|
||||
# a writer lock, so an old process cannot receive events after this.
|
||||
for name in ("_input", "_touch"):
|
||||
agent = globals().get(name)
|
||||
if agent:
|
||||
agent.stop()
|
||||
FRAME = frame_android.FRAME = alias
|
||||
HOST_OPTS = list(host_opts)
|
||||
MUX[:] = [*MUX_BASE, *HOST_OPTS]
|
||||
@@ -150,7 +148,7 @@ LINK = None # the connector (frame_link.Link); None on the Frame itself
|
||||
# install's clean-up) to the other headset.
|
||||
_work_lock = threading.Lock()
|
||||
_work = [0]
|
||||
NOT_HEADSET_WORK = {"/api/steam-pipewire", "/api/devices", "/api/contact", "/api/contact/prompt", "/api/queue"}
|
||||
NOT_HEADSET_WORK = {"/api/devices", "/api/contact", "/api/contact/prompt", "/api/queue"}
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
@@ -1501,244 +1499,12 @@ def licenses():
|
||||
return notices
|
||||
|
||||
|
||||
# KDE Connect's specialKey numbers -> Linux key codes (KEY_BACKSPACE, KEY_TAB, ...).
|
||||
PAD_KEYS = {1: 14, 2: 15, 4: 105, 5: 103, 6: 106, 7: 108, 8: 104, 9: 109, 10: 102, 11: 107, 12: 28, 13: 111, 14: 1,
|
||||
**{21 + i: code for i, code in enumerate([59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 87, 88])}}
|
||||
PAD_MODS = (("ctrl", 29), ("alt", 56), ("shift", 42), ("super", 125))
|
||||
PAD_CLICKS = {"singleclick": "left", "rightclick": "right", "middleclick": "middle"}
|
||||
PAD_NOTCH = 15 # scroll units for one wheel notch
|
||||
|
||||
|
||||
def typed_in_kde(events):
|
||||
"""Whether these events must go the KDE Connect way: they hold an accent or emoji, or
|
||||
earlier ones are queued, being sent or still being typed there (typing must stay in
|
||||
order, so it can't be split between the two ways)."""
|
||||
with _kde_lock:
|
||||
waiting = bool(_kde_queue) or time.time() < _kde_until
|
||||
return waiting or any(ch not in frame_touch.ASCII for e in events for ch in e.get("key", ""))
|
||||
|
||||
|
||||
def pad_events(events, kde=False):
|
||||
"""The trackpad's and key row's events as (gamescope events, KDE Connect events).
|
||||
|
||||
Gamescope's own input reaches every panel and needs nothing installed, but types only
|
||||
US-keyboard characters. With kde, the keyboard goes to KDE Connect as it was sent, so
|
||||
text stays in order; the pointer always goes through gamescope.
|
||||
"""
|
||||
ascii_keys = frame_touch.ASCII
|
||||
out, slow = [], []
|
||||
|
||||
def tap(code, mods):
|
||||
down = [{"key": c, "down": True} for c in mods]
|
||||
out.extend(down + [{"key": code, "down": True}, {"key": code, "down": False}]
|
||||
+ [{"key": c, "down": False} for c in reversed(mods)])
|
||||
for e in events:
|
||||
mods = [code for name, code in PAD_MODS if e.get(name)]
|
||||
if "dx" in e or "dy" in e:
|
||||
if not e.get("scroll"):
|
||||
out.append({k: e[k] for k in ("dx", "dy") if k in e})
|
||||
if e.get("scroll"):
|
||||
out.append({"scroll": [0, -(e.get("dy") or 0) * PAD_NOTCH]})
|
||||
for flag, button in PAD_CLICKS.items():
|
||||
if e.get(flag):
|
||||
out += [{"button": button, "down": True}, {"button": button, "down": False}]
|
||||
if e.get("doubleclick"):
|
||||
out += [{"button": "left", "down": d} for d in (True, False, True, False)]
|
||||
if e.get("singlehold"):
|
||||
out.append({"button": "left", "down": True})
|
||||
if e.get("singlerelease"):
|
||||
out.append({"button": "left", "down": False})
|
||||
if kde and ("key" in e or "specialKey" in e):
|
||||
slow.append({k: e[k] for k in ("key", "specialKey", "ctrl", "alt", "shift", "super") if k in e})
|
||||
continue
|
||||
if "specialKey" in e and e["specialKey"] in PAD_KEYS:
|
||||
tap(PAD_KEYS[e["specialKey"]], mods)
|
||||
if "key" in e:
|
||||
for ch in e["key"]:
|
||||
if ch not in ascii_keys:
|
||||
continue # only reached when kde is wrong; the caller checks typed_in_kde first
|
||||
elif mods:
|
||||
code, shifted = ascii_keys[ch]
|
||||
tap(code, mods + ([42] if shifted and 42 not in mods else []))
|
||||
else:
|
||||
if out and "text" in out[-1] and len(out[-1]["text"]) < 100:
|
||||
out[-1]["text"] += ch
|
||||
else:
|
||||
out.append({"text": ch})
|
||||
return out, slow
|
||||
|
||||
|
||||
def remote_input(body):
|
||||
"""{"events": [...]} sends keyboard and pointer events; {} (or none yet) just starts the agent.
|
||||
|
||||
"sent" in the answer means the whole batch is taken (the page keeps it and tries again
|
||||
if not), so the keyboard's share is queued only once that's so.
|
||||
"""
|
||||
"""{"events": [...]} sends keyboard and pointer events; {} (or none yet) just starts the agent."""
|
||||
events = body.get("events", [])
|
||||
if not isinstance(events, list) or len(events) > INPUT_BATCH_LIMIT:
|
||||
raise Failure(f"events must be a list of at most {INPUT_BATCH_LIMIT}", 400)
|
||||
events = [input_event(e) for e in events]
|
||||
# Serialize admission with other requests and the sender. Keep route -> pad
|
||||
# order: either agent may synchronously capture its route during send().
|
||||
with _route_lock, _pad_send_lock:
|
||||
touch, slow = pad_events(events, typed_in_kde(events))
|
||||
with _kde_lock:
|
||||
blocked = slow and (_kde_error or len(_kde_queue) + len(slow) > KDE_QUEUE_LIMIT)
|
||||
if blocked:
|
||||
# Refuse the WHOLE batch before sending its clicks/moves. The page
|
||||
# retains it and polls, so a retry cannot duplicate pointer events.
|
||||
return pad_status({"state": "waiting", "sent": False})
|
||||
status = _touch.send(touch)
|
||||
if touch and not status.get("sent"):
|
||||
return status
|
||||
if touch:
|
||||
_note_typed(touch)
|
||||
if slow:
|
||||
_queue_for_kde(slow)
|
||||
# Poll at least once after accepting text, even if its worker finished
|
||||
# already, so an asynchronous error is visible without another keypress.
|
||||
return pad_status({**status, "sent": True}, pending=bool(slow))
|
||||
|
||||
|
||||
# Typing KDE Connect is to do: it starts the first time it's needed, so this waits for it.
|
||||
# Nothing on the Frame says when typed text has landed, so each way holds the other back
|
||||
# for as long as what it was given should take (a short margin on a time estimate).
|
||||
_kde_queue = []
|
||||
_kde_lock = threading.Lock()
|
||||
_pad_send_lock = threading.Lock()
|
||||
_kde_worker = [None]
|
||||
_kde_error = None
|
||||
_kde_until = 0.0 # keys typed through KDE Connect should have landed by then
|
||||
_typed_until = 0.0 # when gamescope's agent will have typed everything it's been given
|
||||
_kde_route = object()
|
||||
_kde_cancel = threading.Event()
|
||||
KDE_QUEUE_LIMIT = 200
|
||||
KDE_WAIT = 90 # seconds to wait before pausing queued text for an explicit retry
|
||||
TYPING_SETTLE = 0.6 # seconds past the estimate, once
|
||||
|
||||
|
||||
def reset_pad_route():
|
||||
"""Discard input for the headset being left, including batches waiting for an agent."""
|
||||
global _kde_route, _kde_cancel, _kde_until, _typed_until, _kde_error
|
||||
with _route_lock, _pad_send_lock, _kde_lock:
|
||||
_kde_cancel.set()
|
||||
_kde_cancel = threading.Event()
|
||||
_kde_route = object()
|
||||
_kde_queue.clear()
|
||||
_kde_worker[0] = None
|
||||
_kde_error = None
|
||||
_kde_until = _typed_until = 0.0
|
||||
_input.stop()
|
||||
_touch.stop()
|
||||
|
||||
|
||||
def typing_seconds(touch):
|
||||
"""How long gamescope's agent takes over these: it sleeps 8 ms after every key transition."""
|
||||
transitions = 0
|
||||
for e in touch:
|
||||
if "text" in e:
|
||||
transitions += sum(2 + 2 * frame_touch.ASCII[ch][1] for ch in e["text"] if ch in frame_touch.ASCII)
|
||||
elif "key" in e:
|
||||
transitions += 1
|
||||
return transitions * 0.008
|
||||
|
||||
|
||||
def _note_typed(touch):
|
||||
global _typed_until
|
||||
seconds = typing_seconds(touch)
|
||||
if seconds:
|
||||
with _kde_lock: # the end of the work, which queues up; the margin is added once, where it's checked
|
||||
_typed_until = max(_typed_until, time.time()) + seconds
|
||||
|
||||
|
||||
def pad_status(status, pending=False):
|
||||
with _kde_lock:
|
||||
if _kde_error:
|
||||
return {**status, "state": "error", "message": _kde_error}
|
||||
if (_kde_queue or pending) and status.get("state") != "error":
|
||||
return {**status, "queued": len(_kde_queue) or 1}
|
||||
return status
|
||||
|
||||
|
||||
def start_pad():
|
||||
with _route_lock, _pad_send_lock:
|
||||
status = _touch.send([])
|
||||
with _kde_lock:
|
||||
if _kde_queue and _kde_worker[0] is None:
|
||||
_start_kde_locked() # explicit Try again retries retained text
|
||||
return pad_status(status)
|
||||
|
||||
|
||||
def _start_kde_locked():
|
||||
global _kde_error
|
||||
_kde_error = None
|
||||
try:
|
||||
worker = threading.Thread(target=_drain_kde, args=(_kde_route, _kde_cancel), daemon=True)
|
||||
_kde_worker[0] = worker
|
||||
worker.start()
|
||||
except Exception:
|
||||
_kde_worker[0] = None
|
||||
_kde_error = "Couldn't start queued typing. Text is retained; try again."
|
||||
|
||||
|
||||
def _queue_for_kde(events):
|
||||
with _kde_lock:
|
||||
if len(_kde_queue) + len(events) > KDE_QUEUE_LIMIT:
|
||||
return False
|
||||
_kde_queue.extend(events)
|
||||
if _kde_worker[0] is None and not _kde_error:
|
||||
_start_kde_locked()
|
||||
return True
|
||||
|
||||
|
||||
def _drain_kde(route, cancel):
|
||||
"""One sender, in order. In-flight text stays in the bounded queue until sent.
|
||||
Errors retain it for an explicit retry; only a headset switch cancels it."""
|
||||
global _kde_until, _kde_error
|
||||
deadline = time.time() + KDE_WAIT
|
||||
try:
|
||||
while True:
|
||||
with _kde_lock:
|
||||
if route is not _kde_route:
|
||||
return
|
||||
batch = _kde_queue[:INPUT_BATCH_LIMIT]
|
||||
if not batch:
|
||||
_kde_worker[0] = None
|
||||
return
|
||||
wait = _typed_until + TYPING_SETTLE - time.time()
|
||||
_kde_until = time.time() + 3600 # held while in flight
|
||||
if wait > 0 and cancel.wait(wait):
|
||||
return
|
||||
# Match route()/reset_pad_route()'s lock order. send() may start an
|
||||
# agent and take _route_lock again to capture its immutable route.
|
||||
with _route_lock, _pad_send_lock:
|
||||
with _kde_lock:
|
||||
if route is not _kde_route:
|
||||
return
|
||||
status = _input.send(batch)
|
||||
with _kde_lock:
|
||||
if route is not _kde_route:
|
||||
return
|
||||
if status.get("sent"):
|
||||
del _kde_queue[:len(batch)]
|
||||
_kde_until = time.time() + len(batch) * 0.03 + TYPING_SETTLE
|
||||
deadline = time.time() + KDE_WAIT
|
||||
continue
|
||||
_kde_until = 0.0
|
||||
if status.get("state") == "error" or time.time() > deadline:
|
||||
_kde_error = "Queued typing didn't reach the input service. Text is retained; try again."
|
||||
_kde_worker[0] = None
|
||||
return
|
||||
if cancel.wait(0.4):
|
||||
return
|
||||
except Exception:
|
||||
# A stale worker must never retire the new route's worker or alter its
|
||||
# queue/timing. Retain unsent text and let the page report/retry failure.
|
||||
with _kde_lock:
|
||||
if route is _kde_route:
|
||||
_kde_until = 0.0
|
||||
_kde_worker[0] = None
|
||||
_kde_error = "Queued typing failed. Text is retained; try again."
|
||||
return _input.send([input_event(e) for e in events])
|
||||
|
||||
|
||||
# ---- touch: the headset's panels, through gamescope's own input (frame_touch.py) ----
|
||||
@@ -3078,22 +2844,6 @@ def push_media(path):
|
||||
"id": token + "/" + name}
|
||||
|
||||
|
||||
# Local Steam helper: no headset route, SSH, or PC capture helper.
|
||||
def steam_pipewire_state():
|
||||
if LOCAL or PRIVATE:
|
||||
return {"available": False, "reason": "Open this helper in Frame Control on your Linux PC."}
|
||||
return frame_steam_pipewire.status()
|
||||
|
||||
|
||||
def steam_pipewire_action(body):
|
||||
if LOCAL or PRIVATE:
|
||||
raise Failure("Open this helper in Frame Control on your Linux PC.", 403)
|
||||
try:
|
||||
return frame_steam_pipewire.action(body)
|
||||
except frame_steam_pipewire.HelperError as exc:
|
||||
raise Failure(str(exc), 400) from exc
|
||||
|
||||
|
||||
# ---- Mac in the headset (frame_macview.py), PC in the headset (frame_pcview.py) ----
|
||||
|
||||
# The tunnel gets its own connection: the shared master's options would win
|
||||
@@ -3283,7 +3033,6 @@ def power_action(body):
|
||||
|
||||
|
||||
POST = {
|
||||
"/api/steam-pipewire": steam_pipewire_action,
|
||||
"/api/power": power_action,
|
||||
"/api/android/backup": android_backup, "/api/backup": backup_action,
|
||||
"/api/vr": vr,
|
||||
@@ -3494,15 +3243,6 @@ class Handler(BaseHTTPRequestHandler):
|
||||
elif path == "/api/agent/approval":
|
||||
token = (parse_qs(url.query).get("confirmation") or [""])[0]
|
||||
self.send_json(frame_agent.approvals.inspect(token))
|
||||
elif path == "/wireless-doctor":
|
||||
self.send_bytes((HERE / "wireless-doctor.html").read_bytes(), "text/html; charset=utf-8")
|
||||
elif path == "/api/wireless-doctor":
|
||||
# PC-only and independent of LINK/working(): never start or wait for SSH.
|
||||
args = parse_qs(url.query)
|
||||
self.send_json(frame_wireless_doctor.diagnose(
|
||||
(args.get("device") or [None])[0], local=LOCAL))
|
||||
elif path == "/api/steam-pipewire":
|
||||
self.send_json(steam_pipewire_state())
|
||||
elif path == "/api/host":
|
||||
self.send_json({"os": "SteamOS", "fileManager": None, "computer": DEVICE, "mobile": True} if LOCAL else
|
||||
{"os": frame_host.NAME, "fileManager": frame_host.FILE_MANAGER,
|
||||
@@ -3562,7 +3302,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
elif path == "/api/panels":
|
||||
self.send_json(panels())
|
||||
elif path in ("/api/touch", "/api/input"):
|
||||
agent = _touch # both controls use gamescope; KDE Connect starts only for Unicode
|
||||
agent = _touch if path == "/api/touch" else _input
|
||||
if parse_qs(url.query).get("start") == ["1"]:
|
||||
# Validate and reserve before start() captures its immutable
|
||||
# route and schedules a worker. Status-only polls stay free.
|
||||
@@ -3570,11 +3310,9 @@ class Handler(BaseHTTPRequestHandler):
|
||||
if LINK and not meant:
|
||||
raise Failure("Control start needs the intended X-Frame-Device headset", 400)
|
||||
with working(meant):
|
||||
result = start_pad() if path == "/api/input" else agent.send([])
|
||||
result = agent.send([])
|
||||
else:
|
||||
result = dict(agent.status)
|
||||
if path == "/api/input":
|
||||
result = pad_status(result)
|
||||
self.send_json(result)
|
||||
elif path == "/api/job":
|
||||
self.send_json(job_status(url.query))
|
||||
@@ -3899,11 +3637,6 @@ def main():
|
||||
help="stop cleanly when stdin closes (the app closes it on quit; "
|
||||
"Windows has no SIGTERM to catch)")
|
||||
args = ap.parse_args()
|
||||
global LINK, _ONE_SERVER
|
||||
if not LOCAL and not PRIVATE:
|
||||
# Refuse before starting daemon workers: the losing process exits through
|
||||
# Python teardown, which can race TLS work and crash instead of exit 1.
|
||||
_ONE_SERVER = one_server()
|
||||
httpd = LoopbackServer(("127.0.0.1", args.port), Handler)
|
||||
sweep_tmp()
|
||||
if os.environ.get('FRAME_COMPAT_SEARCH_REPORTS') != '0':
|
||||
@@ -3912,7 +3645,10 @@ def main():
|
||||
threading.Thread(target=apk_search.warm, daemon=True).start() # big indexes download before the first search
|
||||
frame_telemetry.start()
|
||||
frame_contact.start()
|
||||
global LINK, _ONE_SERVER
|
||||
if not LOCAL:
|
||||
if not PRIVATE: # a private server only uses the headsets (see one_server)
|
||||
_ONE_SERVER = one_server()
|
||||
LINK = frame_link.Link(frame_devices.Registry(), env_alias=FRAME if FRAME_FROM_ENV else None,
|
||||
mux_base=MUX_BASE, control=CONTROL, apply=route, explain=unreachable)
|
||||
LINK.work_lock, LINK.work = _work_lock, lambda: _work[0]
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Linux Wireless Adapter doctor · Frame Control</title>
|
||||
<style>
|
||||
:root{color-scheme:dark;--bg:#101820;--card:#1b2838;--text:#e4edf5;--sub:#acbccb;--line:#3a5065;--blue:#66c0f4;--warn:#f0c67a}
|
||||
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.55 system-ui,sans-serif}main{max-width:960px;margin:auto;padding:32px 24px 64px}a{color:var(--blue)}h1{font-size:30px;line-height:1.2;margin:20px 0 12px}h2{font-size:19px;margin:0 0 10px}p{margin:8px 0 16px}.sub{color:var(--sub)}.badge{display:inline-block;font-size:12px;letter-spacing:.05em;text-transform:uppercase;color:var(--blue);margin-bottom:8px}section{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:22px;margin:18px 0}.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}button,select{font:inherit;min-height:44px;border:1px solid var(--line);border-radius:5px;padding:9px 14px;background:#263f54;color:var(--text)}button{cursor:pointer}button.primary{background:#205b81;border-color:var(--blue)}button:disabled{opacity:.5;cursor:default}select{max-width:100%;width:100%}label{display:block;margin:16px 0 6px}pre{font:13px/1.6 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere;background:#111d29;padding:14px;border-radius:5px}.status{font-size:12px;font-weight:700;text-transform:uppercase;margin-right:10px;color:var(--blue)}.warning .status{color:var(--warn)}.unknown .status{color:var(--sub)}#message{min-height:24px}summary{cursor:pointer;min-height:40px;overflow-wrap:anywhere}:focus-visible{outline:2px solid var(--blue);outline-offset:4px}[hidden]{display:none!important}@media(max-width:540px){main{padding:20px 16px}h1{font-size:25px}section{padding:16px}.row button{flex:1}}
|
||||
</style>
|
||||
</head>
|
||||
<body><main>
|
||||
<a id="back" href="/#devices">← Devices & connection</a>
|
||||
<header><h1>Linux Wireless Adapter doctor</h1><span class="badge">This PC · Read-only · On demand</span>
|
||||
<p>Find what Linux can see before choosing a fix. This doctor reads local USB, driver, radio and network manager evidence. It does not connect to the Frame or change your system.</p></header>
|
||||
<section aria-labelledby="chooseTitle"><h2 id="chooseTitle">1. Find the adapter</h2>
|
||||
<p class="sub">The Steam Frame adapter’s hardware ID is unverified here. Nothing is selected automatically. All USB devices are listed so you can select one even when no wireless interface appears.</p>
|
||||
<button id="inventory" class="primary">Read PC device inventory</button>
|
||||
<div id="selection" hidden><label for="device">Select the device you want to check</label><select id="device"><option value="">Choose an observed device…</option></select>
|
||||
<p class="sub">Compare the list before and after reconnecting the adapter when safe. A USB name or ID alone does not confirm that it is Valve’s adapter.</p>
|
||||
<button id="diagnose" class="primary" disabled>Check selected device</button></div>
|
||||
<p id="message" role="status" aria-live="polite">No checks have run.</p></section>
|
||||
<div id="results" aria-live="polite"></div>
|
||||
<section id="reportSection" hidden aria-labelledby="reportTitle"><h2 id="reportTitle">Local evidence report</h2>
|
||||
<p class="sub">Review before sharing. The report includes observed USB IDs and product labels, interface names, driver names and local permission metadata. It excludes Wi-Fi names, MAC/IP addresses, USB serial numbers, credentials and raw command output.</p>
|
||||
<div class="row"><button id="download">Save JSON report</button><button id="copy">Copy JSON report</button></div>
|
||||
<details><summary>Review JSON</summary><pre id="json"></pre></details></section>
|
||||
<p class="sub">No repairs, root prompts, driver installs, security changes or network configuration changes. A clean report does not prove Steam streaming support or resolve the Ubuntu/Kubuntu 26.04 complaint.</p>
|
||||
</main>
|
||||
<script>
|
||||
'use strict';
|
||||
const $ = id => document.getElementById(id);
|
||||
const key = new URLSearchParams(location.search).get('key') || '1';
|
||||
$('back').href = '/?key=' + encodeURIComponent(key) + '#devices';
|
||||
let report = null;
|
||||
const make = (tag, text) => { const el = document.createElement(tag); el.textContent = text; return el; };
|
||||
function render(data) {
|
||||
report = data;
|
||||
$('json').textContent = JSON.stringify(data, null, 2);
|
||||
$('reportSection').hidden = false;
|
||||
$('results').replaceChildren();
|
||||
for (const c of data.checks) {
|
||||
const box = document.createElement('section'); box.className = c.status;
|
||||
const title = make('h2', c.title); const status = make('span', c.status + ' · '); status.className = 'status'; title.prepend(status);
|
||||
box.append(title, make('p', c.suggestion));
|
||||
if (c.evidence.length) { const d = document.createElement('details'); d.append(make('summary', 'Show evidence'), make('pre', c.evidence.join('\n'))); box.append(d); }
|
||||
$('results').append(box);
|
||||
}
|
||||
}
|
||||
async function run(device) {
|
||||
$('inventory').disabled = $('diagnose').disabled = $('device').disabled = true;
|
||||
$('message').textContent = device ? 'Reading selected device evidence…' : 'Reading PC inventory…';
|
||||
// Clear previous results first: a removed device or failed read must not leave a healthy old report.
|
||||
report = null; $('results').replaceChildren(); $('reportSection').hidden = true;
|
||||
try {
|
||||
const response = await fetch('/api/wireless-doctor' + (device ? '?device=' + encodeURIComponent(device) : ''), {headers:{'X-Frame-UI':key}});
|
||||
const data = await response.json(); if (!response.ok) throw new Error(data.error || 'Could not read local evidence');
|
||||
render(data);
|
||||
const select = $('device'); select.replaceChildren(make('option', 'Choose an observed device…')); select.firstChild.value = '';
|
||||
for (const d of [...data.interfaces, ...data.usb]) {
|
||||
const text = d.name ? `${d.id} · driver ${d.driver || 'unknown'} · ${d.usb || 'USB not correlated'}` : `${d.id} · ${d.vid || '?'}:${d.pid || '?'} · ${d.product || 'unnamed USB device'}`;
|
||||
const option = make('option', text); option.value = d.id; select.append(option);
|
||||
}
|
||||
select.value = device || ''; $('selection').hidden = !data.supported || select.options.length < 2;
|
||||
$('message').textContent = !data.supported ? 'Available only on a Linux PC.' : device ? 'Checks finished. Review evidence and limits below.' : 'Inventory read. Select the intended device to continue.';
|
||||
} catch (e) { $('message').textContent = e.message; }
|
||||
finally { $('inventory').disabled = $('device').disabled = false; $('diagnose').disabled = !$('device').value; }
|
||||
}
|
||||
$('inventory').onclick = () => run();
|
||||
$('device').onchange = () => {
|
||||
report = null; $('results').replaceChildren(); $('reportSection').hidden = true;
|
||||
$('diagnose').disabled = !$('device').value;
|
||||
$('message').textContent = $('device').value ? 'Selection changed. Check this device for fresh evidence.' : 'Choose the intended device.';
|
||||
};
|
||||
$('diagnose').onclick = () => run($('device').value);
|
||||
$('download').onclick = () => {
|
||||
if (!report) return;
|
||||
const url = URL.createObjectURL(new Blob([JSON.stringify(report, null, 2) + '\n'], {type:'application/json'}));
|
||||
const a = make('a', ''); a.href = url; a.download = 'linux-wireless-doctor.json'; a.click(); setTimeout(() => URL.revokeObjectURL(url), 1000);
|
||||
};
|
||||
$('copy').onclick = async () => {
|
||||
if (!report) return;
|
||||
try { await navigator.clipboard.writeText(JSON.stringify(report, null, 2)); $('message').textContent = 'Report copied. Review it before sharing.'; }
|
||||
catch { $('message').textContent = 'Clipboard unavailable. Use Save JSON report or select the JSON below.'; }
|
||||
};
|
||||
</script></body></html>
|
||||
Reference in new issue
Block a user