feat: optional x86-64 Steam client (Valve's Linux client under FEX) beside the arm64 one (#152)

An opt-in second Steam client (Steam settings, Steam client: x86-64): Valve's
x86-64 Linux client, unchanged, runs under FEX in its own home with its own
game library and the same sign-in. Linux builds run directly, so titles such
as Team Fortress 2 and Half-Life use their Linux versions; Windows games use
DroidDeck-Proton as on arm64. The arm64 client stays the default.

- droiddeck-steam-x64: FEX and the x86-64 rootfs from DroidDeck-Components
  (sha256-pinned), client install and sync from Valve's CDN, sign-in shared
  with the arm64 client, its web helper on the GPU (ANGLE GL over FEX's GL
  thunk, zink, Turnip), Proton wrappers for the arm64 client's tools,
  DroidDeck direct for Linux builds, SD-card library (x86-64/ beside the
  arm64 one), repair.
- FEX 2610 built by build-fex.yml with thunks and three patches: an openat2
  fallback without openat2 (proot), newer-clang thunkgen, MAP_32BIT
  exhaustion returning ENOMEM. libblsession resolves RESOLVE_IN_ROOT paths
  inside the root.
- Session: x86-64 gating, shortcuts and compatibility tools per client,
  logs from the client that ran.
- App: client setting with the FEX version, an x86-64 chip on the Games
  header, the active client's library, art, storage, downloads, repair,
  Offline Mode, Decky, desktop mode, optional VAC diagnostics; per-client
  state for art, the content log, repair and leftovers.
- Strings in every locale.
- Review fixes: the library cache is saved only by the newest scan; an
  abandoned session's Steam logs come from the client it recorded; distinct
  VAC console names; FEXInterpreter in CPU pinning; clearer VAC hint in
  pl, ru, uk, cs and bg.
This commit is contained in:
The412Banner authored and GitHub committed 2026-10-17 23:57:52 -04:00
1 parent ab799e6938
commit db8d1c9910
125 files changed
+4953 -263

No files matched your search

+1 -1
View File
@@ -187,7 +187,7 @@ Checked against bionic `android16-release`:
|---|---|---|
| `rseq`, `set_robust_list` | **blocked** | glibc, at the start of every thread, while all signals are blocked |
| `faccessat2` | **blocked** | glibc's `faccessat()`, which tries it on **every** call before falling back, so 2 round trips (`access()` calls the plain `faccessat` syscall directly) |
| `fchmodat2`, `openat2` | **blocked** | newer glibc, Flatpak/libglnx, FEX's rootfs lookups (`libblsession.so` turns `openat2` into `openat`) |
| `fchmodat2`, `openat2` | **blocked** | newer glibc, Flatpak/libglnx, FEX's rootfs lookups (`libblsession.so` turns `openat2` into `openat`, resolving `RESOLVE_IN_ROOT` paths component by component inside the root) |
| `setuid`, `setgid` and the rest of the family | **blocked** | Xwayland (hence `-i`) |
| `futex_waitv`, `io_uring_*`, `landlock_*` | **blocked** | Proton's fsync (droiddeck-fsync answers `futex_waitv` in `libblsession.so`), some engines |
| `clone3` | blocked before Android 15 | glibc `pthread_create` |
+433
View File
@@ -0,0 +1,433 @@
# x86-64 Steam client
Valve's x86-64 Linux Steam client, run unchanged under FEX beside the default arm64 client. It is
opt-in: Steam settings, **Steam client: x86-64** (`steamClientArch`, passed to the
session as `BL_STEAM_CLIENT_ARCH=x86_64`, applies from the next session), or the desktop menu entry
**Steam x86-64 (FEX, experimental)**. The Games tab lists the active client's games and tags its
header "x86-64" while that client's list is shown. This page records why each workaround exists and what was seen
on devices. The timeline is in `docs/progress-log.md`.
**Why.** The arm64 Linux client never runs VAC: Left 4 Dead 2 and Team Fortress 2 are refused by
VAC-secured servers ("Connection Blocked ... VAC secured server") and no client log mentions VAC. VAC
modules are x86 code. Under FEX the x86-64 client has a module it can run, as SteamLite does in Wine.
**Layout.** Everything lives in its own home, `$X64_HOME` (`BL_X64_HOME`, default `~/.droiddeck-x64`):
its own `~/.steam` links, config, libraries, x86 rootfs and log (`steam-x64.log`). Shared with the arm64
client: the sign-in, and its `config/uioverrides` (Steam's startup movie overrides), which the x86 client
links. One client runs at a time, since both use the same account; the standalone launcher shuts the
arm64 client down first.
| Command | Does |
| --- | --- |
| `droiddeck-steam-x64 [steam:// URL or client arguments]` | standalone run (the desktop menu entry) |
| `droiddeck-steam-x64 --prepare` | install and set up, then exit |
| `droiddeck-steam-x64 --exec ARGS...` | run the client binary in its environment (how the session starts it) |
| `droiddeck-steam-x64 --sync-login` | copy the newer sign-in to the other client |
| `droiddeck-steam-x64 --map-direct [--live]` | map Linux titles to DroidDeck direct |
| `droiddeck-steam-x64 --default-tool` | print the default ARM64 Proton wrapper's tool name |
| `droiddeck-steam-x64 --gpu` / `--webhelper-gpu` | exit status: client / x86 web helper on the GPU |
## Client install and update
- The first run downloads FEX (release `FEX_TAG` in Droid-Deck/DroidDeck-Components, sha256-pinned), FEX's Ubuntu 24.04 x86
rootfs (about 525 MB, 1.5 GB unpacked, sha256-pinned; the same repository's copy of FEX-Emu's 2026-08-11 image) and the client (about 600 MB) from Valve's CDN,
part by part with sha256 checks. A part-done rootfs download resumes; a finished one answers 416,
which is not a failure. `unsquashfs -no-xattrs -ignore-errors`: ownership and xattrs mean nothing in
the guest, and device nodes cannot be made and are not needed (FEX passes `/dev` through).
- Channel `steamdeck_publicbeta`, the `-clientbeta` the session starts it with. `package/beta` must
match `-clientbeta` before every start, or the client loops on rc 42 (its restart request, which the
standalone launcher honours up to five times, as `steam.sh` does).
- Before each start `x64_sync_client` brings the client to Valve's current build, downloading only the
changed parts (9 of 28 on a device). If that fails, the client updates itself.
- `.steam-enable-steamrt64-client` in the client folder opts into the SteamRT3 build
(`steamrt64/steam`). Without it the client re-executes itself in the scout environment through
`steam.sh`, whose start-up checks need what proot cannot give; the session stalled before the
interface. The client is started directly, as the session starts `steamrtarm64/steam`:
`STEAM_RUNTIME=1`, its own `steamrt64` libraries first, and the `~/.steam` links `steam.sh` makes.
- **User namespaces.** Unlike the arm64 client, this one carries pressure-vessel and refuses to start
("Steam now requires user namespaces") when `steam-runtime-check-requirements`' bwrap probe cannot
create a user namespace, which no Android app can. `STEAM_RUNTIME_STEAMRT` points at
`steamrt-shim`: Valve's runtime linked file by file with only the probe replaced (`exit 0`). proot
is the container, as for the arm64 client.
- **Re-exec after an update.** The client re-executes itself inside the SteamRT container through
`pressure-vessel-wrap` (bwrap). `STEAM_STEAMRT_RECURSION_GUARD=1` says it is already inside one; the
FEX rootfs with the client's `steamrt64` libraries is that container.
- **Starting games.** Believing itself inside the container, the client starts games and system
commands "alongside Steam" through `steam-runtime-launch-client`. Valve's asks a launcher service on
the session bus (there is none: the game ended at once), and with none on `PATH` the launch fails
(No such file). The shim's version applies `--directory`, `--env` and `--unset-env` and runs the
command.
- **Libraries.** The rootfs lacks what the SteamRT container gives the client (GTK 2 for
`steamui.so`, ...). Valve's steamrt3c platform libraries are linked into `steamrt-libs`; they ship
without soname links (pressure-vessel makes those when it builds the container), so the rootfs's
`ldconfig` adds them there. `LD_LIBRARY_PATH` beats the system folders whatever its order, so only
libraries the rootfs lacks are kept: the platform's older glibc must not shadow the rootfs's.
- **System V IPC.** Android kernels have none, and the client's tier0 gave up on start ("Function not
implemented" from `semget`; traced with a `-DDEBUG_STRACE` FEX). The session shim (`preload/*.c`) is
also built for x86-64 and i386 and preloaded through the rootfs's own `/etc/ld.so.preload`, one copy
per architecture under the multiarch folder named through glibc's `$LIB`. Without a list in the
rootfs, FEX falls through to the guest's, which names the session's arm64 preloads.
- **Tracer.** proot is a tracer, so tier0 believes a debugger is attached and breaks into it with int3
on the first failed assertion: the web helper died of SIGTRAP a second after every start.
`preload/tracer.c` exempts web helpers on purpose (Chromium traps on a status fd that is not
procfs); with `BL_WEBHELPER_HIDE_TRACER=1` only opens called from `libtier0_s.so` get the copy
without the tracer.
- **FEXServer owns the rootfs.** A FEX process takes its rootfs from FEXServer, and a server started
earlier without `FEX_ROOTFS` (any FEX run in the guest) serves none: every x86 library lookup fell
through to the arm64 guest. It is stopped while no x86 client runs.
- **`/dev/dri`.** x86 programs enumerated `/dev/dri`, found the session's KGSL node and spun on it (x86
Turnip "failed to query kernel driver version", KMS dumb-buffer ioctls in a loop); the web helper
never got a browser up. FEX looks in the rootfs first, so an empty `rootfs/dev/dri` hides the node.
- **Scout runtime.** Valve ships it as `ubuntu12_32/steam-runtime.tar.xz` and `steam.sh` unpacks it.
Since `steam.sh` is not used, `--prepare` unpacks it when its checksum changes.
- **Repair.** Repair Steam (`BL_X64_REPAIR=1`), or two starts in a row that never showed the client
(`package/droiddeck-unconfirmed`; the app clears the count once the client is on screen), removes
the install stamp so the client is reinstalled. Counts from before this was tracked are dropped
rather than taken as failed starts. `droiddeck-steam-install` removes the repair request when it is
done, so the session reads it first and both clients are repaired.
- **Stale state.** A killed client leaves `.crash`, which opens the update UI on its spinner, and
`htmlcache/Singleton*` locks, which can leave the UI blank. Both are removed while no client runs.
- **Network.** The client's connection header and Settings > Internet come from NetworkManager on the
system bus; without it the client shows no connection while downloads run. The standalone launcher
starts the session's system bus configuration and the `droiddeck-netmanager` stand-in when no
system bus is up (a desktop has none).
- **FEX settings.** The app's PERFORMANCE_TSO preset (`core/FexPreset.kt`, WinNative's default). FEX's
own defaults keep half-barrier TSO and full-precision x87, which cost every x86 program time. Values
already in the environment win.
- **Fast path.** libblfastpath, preloaded into every guest process and so into FEX, broke FEX's 32-bit
mode (SIGILL at start). It stands down when FEX is about to run a 32-bit program; 64-bit programs
keep it. `BL_X64_FP_OFF=1` turns it off for everything.
- **Diagnostics.** `BL_FEX` runs another FEX build (a `DEBUG_STRACE` one, say). `BL_FEXSERVER_LOG`
starts a FEXServer in the foreground logging there; every FEX process that logs to "server"
(`FEX_OUTPUTLOG` or an AppConfig) then has its lines tagged with its pid (file logs overwrite each
other).
## Web helper on the GPU, QAM/WSI and flicker
The client's web helper draws its whole UI. There are two:
- **The arm64 client's helper** (`droiddeck-x64-arm-webhelper`), used when both clients are the same
Steam build (unless `BL_X64_X86_WEBHELPER=1`). FEX hands the arm64 program to the CPU, so it runs
natively with the session's preloads (KGSL poll fix, fast path) and the arm64 session's GPU
settings. It talks to the client over IPC, and a helper of another build never comes up: the client
restarted it every 10 s (device: 1790721607 against 1790904859). The session therefore updates the
arm64 client's parts on the same channel first (`droiddeck-steam-install --sync
steamdeck_publicbeta`). With this helper the client itself gets the GPU: it shows every Big Picture
frame the helper draws, and in software (llvmpipe under FEX) that held the UI at about 20 fps
(`BL_X64_CLIENT_SOFTWARE=1` keeps it in software). Device: 144 fps menus.
- **The client's own x86 helper on the GPU** (`droiddeck-x64-webhelper`), otherwise: ANGLE's GL
backend through FEX's GL thunk to zink and Turnip. On ANGLE's Vulkan backend the x86 compositor
thread was the bottleneck (16 fps against 60). Never `--in-process-gpu`, the preload's default: a
GPU crash there took the whole helper down (102 restarts). `BL_X64_CEF_GPU=0` keeps it in software.
The session shim (`preload/net.c`) turns `steamrt64/steamwebhelper.sh`'s exec of `./steamwebhelper`
into `BL_X64_ARM_WEBHELPER`. Nothing in the client's folder is edited: the client checksums its files
as it starts and reinstalled itself over an edited launcher (2-3 minutes) on every start.
Quick Access Menu and flicker, x86 helper:
- Steam's compositor in the helper draws each browser window (main UI, QAM) from that window's X
pixmap. gamescope's WSI layer took the helper's zink swapchains and sent the frames to gamescope
instead: the QAM opened blank until a d-pad press and the screen behind it went black. The helper
runs with `DISABLE_GAMESCOPE_WSI=1`; games keep the layer. Not FEX: a texture-from-pixmap test
behaved the same under FEX and natively.
- gamescope sets `vk_xwayland_wait_ready=false` for its children because its layer does the waiting.
Without the layer, unfinished frames reached the compositor as black flashes (3 in 10 QAM opens,
screen-recorded and counted frame by frame). The helper sets `vk_xwayland_wait_ready=true`.
- zink's kopper swapchain still flashed on about 1 in 20 opens with the wait. With
`LIBGL_KOPPER_DISABLE=true` none did in 60 opens, at 60 fps instead of about 140 (Xwayland's
per-window timing for child windows). No flashes was chosen over frame rate.
Software path (no host thunks, or `BL_X64_SOFTWARE=1`): x86 Mesa has no driver for this GPU, so
llvmpipe for GL (the client's own window needs GLX) and the rootfs's own Vulkan ICDs (lavapipe). GLX
first failed because the desktop exports zink over the arm64 Turnip ICD; those variables are cleared.
`LIBGL_DRI3_DISABLE=1`: over DRI3 the X server hands out the GPU node and Mesa's software path then
tries KMS dumb buffers on it in a loop.
Decky's loader talks to the client's CEF debugging port. Its marker
(`.cef-enable-remote-debugging`) is kept in both clients' roots, because the session reads it from the
client it runs. The app creates it in the x86-64 root only once that client is installed: the folder
alone would then read as an installed client.
## FEX build and patches
- `tools/fex/build-in-arch.sh` runs in an Arch Linux ARM container (`menci/archlinuxarm:base-devel`)
on an arm64 runner: Arch Linux ARM has no FEX package and FEX publishes no Linux binaries. It packs
FEX and the runtime's own `unsquashfs` as `fex.tzst` (`usr/local/...`), with `fex-needed.txt` (every
needed soname must resolve in a stock guest) and `fex-files.txt`. `TUNE_CPU=none`: the default
(native) would tune for the runner's Neoverse cores, not the device.
- **Host thunks** (`FEX_THUNKS=1`): an x86 program's libvulkan, libGL, libX11, ... calls go to the
runtime's arm64 libraries (Turnip, Mesa). The host half needs the graphics development packages. The
guest half is cross-compiled with clang against an x86 sysroot of Arch x86_64 and multilib i686
packages, unpacked by pacman into their own root and never run (no scriptlets, no signature checks).
FEX's x86 toolchain files assume an x86 build machine, so on arm64 the sysroot also supplies headers,
C runtime objects and libgcc.
- **Stack protector.** Arch's clang builds the guest thunks with stack protection. The canary load in
`CallHostFunction`'s prologue (`mov %fs:0x28, %r11`) overwrote r11, which carries the host function's
address, and FEX called the canary. 9 of 521 Vulkan and 66 of 736 GL host calls (those with 7 or
more arguments) were affected, `vkCmdBindDescriptorSets` from TF2's DXVK among them; 32-bit games pass
the host address in mm0. The toolchain files add `-fno-stack-protector` (`fex-2610-r2`).
- **`vkGetDeviceProcAddr`.** FEX-2609's guest version passed a lookup of `vkGetDeviceProcAddr` itself
to the host and handed back the raw host function, so every pointer fetched through it was unlinked.
TF2's native DXVK (2.3) makes that lookup. FEX-2610 answers self-lookups in the guest (FEX-Emu/FEX
3397eb9b).
- Patches in `tools/fex/patches`:
- `0001-openat2-enosys-fallback`: our proot answers `openat2` with ENOSYS (`tools/proot/PATCHES.md`,
0008). FEX opened every rootfs path with `openat2(RESOLVE_IN_ROOT)` and fell through to the arm64
guest on anything but EXDEV; x86 bash could not find libtinfo. Since r4 the fallback resolves the
path inside the rootfs itself (absolute symlinks restart at the rootfs, as `RESOLVE_IN_ROOT` does);
before, they resolved against the arm64 guest. `libblsession.so` (`preload/robust.c`) answers
`openat2` first in practice and does the same walk for `RESOLVE_IN_ROOT` callers, so Valve's FEX-Emu
on the arm64 client gets it too. Each path component is then its own system call.
- `0002-thunkgen-newer-clang`: the container's newer clang has no `FileManager::clearStatCache()`,
which the thunk generator called after each run.
- `0003-allocator32-map32bit-exhaustion`: Counter-Strike 2 reserves the low 2 GB with `MAP_32BIT`
in shrinking sizes. FEX's `MemAllocator32Bit` met EEXIST, stepped down one page per retry and
restarted from the top forever (found with `perf_event_open` IP sampling, since proot holds
ptrace). Such a range is now skipped whole and a second exhausted scan returns `-ENOMEM`, as the
kernel does (`fex-2610-r3`).
- **`build-fex.yml`.** The build job runs third-party images and toolchains with a read-only token,
and inputs reach the shell as environment variables. A separate publish job (contents: write) runs
only on a dispatch with a tag, host thunks on and no extra `cxxflags` (diagnostic builds such as
`-DDEBUG_STRACE` stay artifacts). `droiddeck-steam-x64` pins each tag's sha256 and the archive is not
reproducible, so a tag is never rebuilt over. The release is never the repo's Latest nor a
pre-release: it is a component fetched by tag, not something users install.
- Releases so far: `fex-2609-r2` (no thunks), `fex-2609-r3` (thunks), `fex-2610-r1`, `fex-2610-r2`,
`fex-2610-r3`, `fex-2610-r4` (current: in-root resolution when openat2 is missing, exact MAP_32BIT
marking). They were built and published in The412Banner/DroidDeck; up to r3 their tags point at that
repository's `main`, from r4 at the commit each was built from.
- **Where the app gets it.** The app downloads FEX from Droid-Deck/DroidDeck-Components, where nothing is
uploaded by hand: a new tag is published by `build-fex.yml`, recorded in that repository's `fex.json`
(sha256 and size), and brought in by its `mirror-release.yml`, which refuses an archive that does not
match. `FEX_TAG` and `FEX_SHA256` in `droiddeck-steam-x64` then move to the new tag. The rootfs is
FEX-Emu's own image, unmodified: `fex-rootfs.json` there names its rootfs.fex-emu.gg link, sha256 and
size, and `mirror-upstream.yml` fetches it into the catalog's release only when both match. A newer
image is a new catalog release; `ROOTFS_URL` and `ROOTFS_SHA256` then move to it, and a device that
already unpacked one keeps it.
## DroidDeck direct for Linux games and runtimes
- Steam runs native Linux games in the Steam Linux Runtime container (pressure-vessel), which needs
bwrap and user namespaces. **DroidDeck direct** (`compatibilitytools.d/droiddeck-direct`, linux to
linux) runs them under FEX with no container. Scout titles run through Valve's scout library runtime
(`ubuntu12_32/steam-runtime/run.sh`). Titles Valve gives a newer runtime (sniper, soldier; listed in
`direct-sniper`) are built for newer libraries than scout's and run on the rootfs (Ubuntu 24.04) as
it is.
- **Mapping** (`x64_map_direct`): every game the client's appinfo cache shows with a Linux build (type
game, oslist with linux; runtime from `config/app_mappings`: SteamLinuxRuntime_sniper or _soldier,
none means scout), installed or not, so Steam downloads the Linux depots. A title on a tool chosen in
Properties keeps it, except `BL_X64_DIRECT_APPS` (Left 4 Dead 2, 550, by default), which is always
taken back. `direct-auto.json` lists what was mapped. One pass over the mapping: a 2000-title fixture
went from 16.5 s to 0.2 s with the same output.
- A game whose Windows build is installed (it ran on a Proton before) stays a Windows game on the
default Proton. Steam does not swap an installed build when the tool changes: DroidDeck direct was
handed `Launcher.exe` and the game ended at once (Borderlands 2), and getting the Linux build back
means downloading the game again.
- The client rewrites `config.vdf` from memory as it exits, so the mapping is written only while no
x86 client runs: by `--prepare`, and by the session after each exit, when the appinfo cache also
knows titles bought during the run. `--live` (the session's pass while the client runs) writes
nothing; installed Linux titles it would map go to the session's pending list.
- A new user's client has no `config.vdf` before its first start, so Steam Play's default and the
Linux titles would wait a session. `--prepare` writes the `CompatToolMapping` block alone, which the
client keeps.
- **Sniper check.** `tf.sh` reads `VERSION_CODENAME` from `/etc/os-release` and stops unless it is
`sniper`. For `direct-sniper` titles the run script runs such a script through `bash -c` with that
line replaced by `VERSION_CODENAME=sniper`.
- **HarfBuzz.** The rootfs's HarfBuzz needs a newer FreeType than a game may bring. Counter-Strike 2
ships an older `libfreetype.so.6` and no HarfBuzz: its menu text library failed to load, the game
flagged its files corrupt (a verify each start) and waited behind an error box that could not open.
Newer-runtime titles get Valve's runtime HarfBuzz (2.7) preloaded from `sniper-compat`, as they would
in its container.
- **GPU.** Games get FEX's host thunks and the session's GPU settings (Turnip, Zink), saved by the
launcher as `game-gpu.env` and rewritten whenever it runs; `game-gpu.local` is the user's, never
rewritten, and is read after it. `BL_X64_GAME_SOFTWARE=1` keeps a game in software, with
`mesa_glthread=false` (GL threading is no help with software GL under FEX).
- Source games (`hl2.sh`, `hl2_linux`, `srcds`) get `-condebug` for the VAC diagnostics.
- **Controllers.** `libfakeinput` is built for x86-64 and preloaded in the rootfs; Big Picture works
with it. The 32-bit copy crashed Left 4 Dead 2: its fake devices reach the game's own SDL2 through
udev with a missing attribute and SDL `strdup()`s the NULL (fault backtrace: strlen in libc <- `__strdup`
<- libSDL2 <- `udev_device_get_sysattr_value`). 32-bit programs get only the session shim. The
preload line names the x86_64 copy by full path, since with `$LIB` FEX falls through to the
session's own `/usr/local/lib/i386-linux-gnu` copy.
- Device: TF2 main menu at 358 fps on the GPU and about 84 fps in a match; Half-Life (32-bit) at
101 fps; Left 4 Dead 2 at 51 fps (about 11 in software).
- The arm64 client's route to x86 Linux titles, `droiddeck-fex`, is not wrapped for this client. Its
wrapper ran when the client probed its tools after logon; the arm64 client took that for an x86
program wanting FEX and installed Valve's FEX.
- `droiddeck-fex` itself (arm64 client): Valve's FEX-Emu keeps its server socket in
`$STEAM_COMPAT_DATA_PATH/fex-emu/Server` whatever `FEX_APP_DATA_LOCATION` or `FEX_SERVERSOCKETPATH`
say. Under the app's data folder that path passed the 108 bytes a socket path may have (Half-Life:
136), FEXServer never listened and the game ended at once. FEX's data folder in the runtime directory
is short enough; the one under HOME is not, so `/tmp/fex` stands in for it.
## Libraries, SD card and sharing between clients
- **Separate libraries.** With folders shared, each client could update, verify or switch the
other's games. A title with a Linux build runs as that in the x86 client and as the Windows build in
the arm64 one, so opening it in the other client switched the files and the first client downloaded
its version again (Left 4 Dead 2, 8.6 GB). Hard links do not help: switching platform makes Steam
download depot 551 anyway. A game wanted in both clients is installed in both. Folders an earlier
version shared are taken out of the x86 client's lists (written only while no x86 client runs); the
games stay in the arm64 library.
- **SD card.** The x86 client's card library is a folder inside the arm64 one (`/mnt/droiddeck-sd/x86-64`,
`GameStorage.X64_CARD_DIR`, passed as `BL_X64_STEAM_LIBRARIES`), so the install dialog offers Internal
Storage and SD card. compatdata, shadercache and runtime tools stay private, as in the arm64 card
library. FEX runs x86 programs from the noexec exFAT card. The folder appears with the client's first
session on the card and its `steamapps` with the first library write. Desktop sessions prepare it as
well: desktop mode offers the x86 client whichever is selected, and `droiddeck-steam-x64` drops
library folders it is not given. The arm64 card library may hold the arm64 copy of the same title,
so the session's installed check looks only in the x86 card folder.
- **Card downloads.** `storage.c` (no zero-filled reservation where `fallocate` is refused) and
`dircache.c` recognised only `steamrtarm64/steam`, and the x86 client wrote each download in full as
zeros first (Audiosurf: 415 MB written, 0 downloaded). After the fix: FlatOut, 1.19 GB, to the card
in 51 s.
- **Sign-in.** Before either client starts, the newer sign-in (`config/loginusers.vdf`, the login token
in `local.vdf`, `AutoLoginUser` and `RememberPassword` in `registry.vdf`) is copied to the other, so
signing in or switching accounts in one counts for both. Steam renews its token every few days and
refuses an old copy (a 3-day-old one asked for the password), so the newest is copied at every start,
never while either client runs, since each rewrites these files. A client that refused its token
rewrites `local.vdf` with an empty `ConnectCache`: newest, but copied over the other it would sign
that one out too (seen after the x86 client's "Invalid Password"), so it is never the source. The copy keeps
the time stamp, so both match until one client signs in again. The rest of `registry.vdf`
(language, skin) stays each client's.
- **App side.** The library, art picker, grid sync and boot movie follow the running client, else the
selected one; a changed client applies from the next session. Offline Mode is written to both
clients' `loginusers.vdf`; until the x86 client's first start its sign-in is the arm64 one. The log
redactor learns account names from both clients. The startup movie is staged into the x86 client's
config only once its first start has created it; `--prepare` links the arm64 `config/uioverrides`
and copies the `StartupMovie` choice.
- **Storage page.** It lists both clients' games, the x86 ones labelled; a game can be installed in
both and an id left over in several libraries. `steam://uninstall` reaches only the session's client,
so the other client's copy is uninstalled after switching clients. Tools in the x86 client's
libraries are shown as required (it runs its Linux games with Valve's runtimes). Proton tool files
live only in the arm64 root; the x86 client has wrappers. An x86 client without `config.vdf` has
never mapped a game.
## Proton for Windows titles in the x86 client
- Windows games run on the arm64 client's Protons; x86 Proton would need pressure-vessel. For each
arm64 client tool (droiddeck-proton-arm64, DroidDeck-Proton, GE-Proton, CachyOS) `--prepare` makes a
wrapper in the x86 client's `compatibilitytools.d` with the same folder and display name: Components
swaps and per-title mappings are keyed by them. In the tool name `arm64` and `aarch64` become `a64`,
because the x86 client ignores a tool named for arm64 ("for a different target platform linux
arm64"). The session runs `--prepare` again after it installs a new Proton.
- The wrapper is an x86 script under FEX. It starts `droiddeck-x64-arm-proton` through an arm64 binary
(a copy of `/usr/bin/env`), which FEX hands straight to the CPU, so Wine and the game run as from the
arm64 client: same Proton, launcher, Components swaps, per-game environment and Steam client library
(`~/.steam/sdk64`).
- `droiddeck-x64-arm-proton` drops FEX's settings and the x86 library paths and preloads, then restores
the arm64 session's environment that `droiddeck-steam-x64` saved before it built the x86 one
(`arm-session.env`: HOME, PATH, GPU, audio, input, fast path). Steam's per-game variables are not in
it. It keeps the game display Steam chose: the saved `DISPLAY=:0` hid the game window and made
DiRT Showdown exit after about 7 s. Proton takes its Steam client parts from the client's install
folder, and the x86 client's are x86, so `STEAM_COMPAT_CLIENT_INSTALL_PATH` points at the arm64 root
and `BL_X64_STEAM_ROOT` keeps the x86 one for install-script lookups.
- **Game overlay.** The x86 client preloads its own x86 overlay; the arm64 one takes its place. The
overlay marks the game's windows with the Steam app ID, and without it gamescope never shows them
(FlatOut ran and played sound behind Steam's launch screen, "steam app id: 0"). The agent also tags
untagged `steam_app_<id>` windows with `STEAM_GAME` on the game display when the x86 client runs
(DiRT 3, an added game, then reached its title screen at 144 fps).
- The x86 client's tools are not adopted as arm64 Protons: `adopt_extras` on its
`compatibilitytools.d` rewrote DroidDeck direct as a Windows tool, and Steam installed Half-Life's
Windows files. The arm64 Proton is adopted on demand at an x86 launch.
- **Default.** The newest DroidDeck-Proton, then the newest GE-Proton (aarch64), else
`droiddeck-proton-a64`. FlatOut from the card ran on DroidDeck-Proton 11-9.1 and exited on
GE-Proton11-7 (no log). With droiddeck-proton-arm64 (Proton Experimental) Xwayland never got its
window buffers back and FlatOut took the device's RAM with it (10.5 GB of dma-buf in 35 s);
GE-Proton, same game and client, stayed flat. The session asks for GE-Proton when none is installed.
`default-tool` records the default the script set; when it changes, the titles still on the old one
move along (device: 113 titles off GE-Proton11-7). A default or title the user set to another tool
keeps it. Before `default-tool` existed, the default the script set was an `-a64` wrapper at
priority 75.
- `steam-compatibility --x64` repoints entries the client aimed at a Proton it cannot start (Valve's
`proton_*` names, and `droiddeck-proton-arm64` left by an arm64 compat pass) to the default wrapper.
Tools in its own `compatibilitytools.d` are kept: the wrappers include `proton-cachyos-*-a64`, which
starts with "proton" like Valve's.
- **Added games** are written by the client the session runs and pointed at its default wrapper. The
shortcuts pass keeps the x86 client's own default and state (`droiddeck-compat` beside its Steam
folder), because the arm64 client's `state.json` lists which of that client's titles follow its
default.
- **Install scripts.** A game's own installers without a `HasRunKey` (Borderlands 2: VC++ 2005, 2008
and 2010, DirectX, .NET 4.0) are marked under `Software\Valve\Steam\Apps\<appid>` (and the
Wow6432Node view), so Steam skips them; this applies to both clients. Windows components install into
the x86 client's prefix (DiRT Showdown and DiRT 3 needed OpenAL).
## VAC findings
- x86-64 client with Linux builds: secure. Left 4 Dead 2 joined a live Quick Match game, the server
type that refuses the arm64 client; on the GPU an online server answered the A2S info query as
"Valve Left4Dead 2 US East Server", VAC=1. TF2 Casual matchmaking put it on a VAC-secured Valve
server. Half-Life's native build joined a VAC-secured server.
- x86-64 client with a Windows build (TF2 on DroidDeck-Proton): insecure. Proton reaches Steam through
the arm64 client's `steamclient.so`.
- arm64 client: Left 4 Dead 2 was blocked on both Protons; Half-Life (Windows build) joined a vac=1
GoldSrc server. Why the arm64 client fails is not established; it has no VAC module of its own to run.
- Headless VAC testing is not possible: current Steam starts the saved login from its UI.
- **VAC diagnostics** (Setup page). A Source game decides secure or insecure once, as it starts, and
says so only in its own console ("You are in insecure mode. You must restart before you can connect
to secure servers."). That console reaches a file only with `-condebug`: `<game>/<mod>/console.log`,
or `<game>/game/<mod>/console.log` for Source 2. At session start the app writes
`~/.droiddeck-vac-diagnostics` (start time, client, each console.log's length, since `-condebug`
appends). The launch wrapper (`bl_vacdiag`) then adds `-condebug` to Source titles (found by
`gameinfo.txt` or `gameinfo.gi`), flags `-insecure` in launch options and notes each launch. At the
end the session copies what each console.log gained into `vac/`, scrubbed, and writes `vac.txt`: the
game's secure/insecure lines, VAC lines in the client's logs, and which client files are present. A
stopped session keeps its own copy of the marker and launch list; a new session waits for earlier
collections, because it replaces the marker and Steam's logs.
- "Connecting to" is only an attempt. L4D2 logs it, retries, and then refuses a VAC server with a
dialog ("Connection Blocked: Please remove plug-ins before attempting to connect to a VAC secured
server") that never reaches the console. Only "Connected to" means the game got in.
- SteamLite's "INSECURE - VAC may kick" warning was our own parser reading the wrong log while the
client was secure all along. `vac.txt` therefore quotes the lines it found and says "inconclusive"
when the game never reached a server.
## Session integration, restarts and mapping
- With `BL_STEAM_CLIENT_ARCH=x86_64`, `droiddeck-session` updates the arm64 client's parts
(`droiddeck-steam-install`, then `--sync steamdeck_publicbeta`), runs `droiddeck-steam-x64 --prepare`
and starts the client with `droiddeck-steam-x64 --exec`. Steps only for the arm64 client (library
registration, the ARM64 Proton fetch, the live compat helper) are skipped; added games,
`steam-compatibility --x64`, UI scale and redistributables run for the x86 client.
- **Deck mode.** With `-steamos3` the client's SteamOS audio manager passed libpulse the NULL
operation of a failed request, and libpulse aborted the client right after start ("Assertion 'o'
failed at ../src/pulse/operation.c:136 pa_operation_get_state()", the runtime's PulseAudio 13).
`preload/pulseguard.c` (x86 builds only; the arm64 client does not hit it) answers a missing operation
as cancelled and ignores its unref and cancel. The session passes `-steamdeck -steamos3` unless
`BL_X64_DECK=0`. Switch to Desktop is expected to need no change (an x86 shell under FEX runs
`steamos-session-select`); the full switch has not been tested on a device.
- **Process names.** Under FEX a process's argv[0] is FEX and the program is its first argument. The
session's game detection, CPU pinning and the zRAM watcher read that argument. Steam pins itself and
its web helper to a few cores, so the session's CPU set is applied again every 5 s.
- **Live mapping and restarts.** While the client runs, the session's background loop runs
`steam-compatibility --x64 --live` and `droiddeck-steam-x64 --map-direct --live`, every 15 s and
only in the session's first hour (720 beats of 5 s). A title installed after that is mapped when the
client exits and takes effect from the next session. Steam reads a
mapping changed while it runs only at its next start, so changed titles go to `.bl-compat-pending`.
Once they have installed (`StateFlags` 4 in the client's root or its card folder) and no game runs,
the client is restarted once per title, at most 3 times a session.
- **After exit.** Added games, `steam-compatibility --x64` and `--map-direct` run again: the client
wrote its mapping from memory as it exited, over what the live passes set.
- The Lossless Scaling ownership probe and the Steam import watcher reach the x86 client through the
arm64 client's `steamclient.so` (`BL_STEAMCLIENT`); the watcher restarts the client with
`droiddeck-steam-x64 --exec -shutdown`.
- Steam logs and the Steam language come from the x86 client's home. On the desktop, `steam` and
`steamdeck-steam` start the selected client, and the desktop game entries list its libraries.
- The standalone launcher (desktop menu) shuts the arm64 client down first, starts the system bus and
the NetworkManager stand-in when missing, clears stale locks, pins CPUs and restarts the client on
rc 42.
## Known limits
- Experimental and opt-in; one client runs at a time.
- Windows titles in the x86 client are not VAC-secure: Proton reaches Steam through the arm64
`steamclient.so`.
- 32-bit games get no controller reader (the i386 `libfakeinput` is left out).
- 32-bit Linux titles through the arm64 client's `droiddeck-fex` still fail (not pursued).
- The x86 web helper's menus run at 60 fps without kopper.
- Counter-Strike 2 reaches its menu (and loaded Dust II at 78 fps), then Android's `lmkd` kills
DroidDeck. The game's GPU memory is pinned: KGSL `page_alloc` followed Shmem through the load, to
about 3.2 GB at the kill, with Unevictable just above it. This device's `lmkd` runs in minfree mode,
which does not count swap, while MemAvailable counted that memory as available. Paging the game out
with a root tool (`process_madvise(MADV_PAGEOUT)`) let it draw its menu, but `lmkd` still killed the
session. Not solved.
- Sharing libraries between the clients is parked.
+405
View File
@@ -7,6 +7,313 @@ the timeline, then lessons and backlog. Companion to the README (what the app *d
---
## 2026-10-16/17 - `feat/x86-64-steam-client`: web helper on the GPU, org main, review rounds
- **x86-64 web helper on the GPU** (`f603a085`): the client's own steamwebhelper runs ANGLE's GL backend
through FEX's GL thunk to zink/Turnip (ANGLE-Vulkan was CPU-bound at 16 fps). No arm64 helper needed.
- **Quick Access Menu** (`26d80895`): the QAM opened blank until a d-pad press and the screen behind it went
black. Steam's compositor draws each browser window from its X pixmap; gamescope's WSI layer took the
helper's zink swapchains, so the pixmaps never got frames. The helper now runs with
`DISABLE_GAMESCOPE_WSI=1` (games keep the layer). Not FEX: a texture-from-pixmap test behaved the same
under FEX and native, so no fex-2610-r4.
- **Black flashes** (`1b52df77`): gamescope sets `vk_xwayland_wait_ready=false` for its children; without
its layer, unfinished frames reached the compositor (3 flashes in 10 QAM opens, screen-recorded and
counted frame by frame). The helper waits for frames and presents without kopper: 0 flashes in 60 opens.
The x86-64 menus run at 60 fps on that path (Xwayland's per-window timing for child windows); the user
chose no flashes over ~140 fps.
- **Org main**: rebased twice (522e755b, then e95a4226), linear, each final tree checked equal to a plain
merge. Main's art picker, grid sync and boot movie follow the selected client (`32bbf79a`).
- **CodeRabbit** on personal PRs #68 and #69 (full review of 76 files on #69). Fixed: one Steam channel for
the x86-64 client; VAC report reads only console logs this session wrote, and a stopped session keeps its
own marker; segvlog reads stack words without faulting and opens files with raw syscalls; the x86-64
shortcuts pass no longer writes the arm64 client's compat `state.json`; DroidDeck direct mapping in one
pass (2000-title fixture: same output, 16.5 s -> 0.2 s); session stop/start handoff under one lock;
desktop sessions prepare the x86-64 card library; Decky's x86-64 marker only for an installed client;
library follows the running client; download monitor restarts on the other client's log; compat
restart reads the x86-64 card folder; CPU pinning sees FEX processes; build-fex has a read-only build
job, a separate publish job, never republishes a tag, requires thunks and tags the built commit
(`8e2751f9`..`f9de849c`). Skipped with evidence: IPC home for the probes (device: ownership probe
succeeds in x86-64 sessions); shortened `STEAM_COMPAT_DATA_PATH` (read before the override).
- **Device** (5004cf4e): TF2, Half-Life, Borderlands 2 and DiRT Showdown launch and play on the x86-64
client; the arm64 client starts. BL2/Half-Life "downloads" were Steam shader pre-caching (6.1 GB Deck
`steam_pipeline_cache.foz` for BL2), not game updates. Half-Life is the Windows build in the arm64 client
and the Linux build in the x86-64 one, in separate folders.
- **Org readiness** (2026-10-17): org main's rules are a PR with the `Build APK` check (ruleset "Protect main")
and `AGENTS.md`'s one line on comments. Comments added by the branch went from about 440 lines to under
100, each a non-obvious external constraint; the device history and reasons moved to
`docs/development/x86-64-steam-client.md` (code unchanged, checked by stripping comments from both sides).
The Steam client setting now says the library is the client's own and the sign-in is shared. Rebased
onto 83eda433 (VITURE XR); squashed as personal PR #70, `feat:` title. FEX tags r1-r3 point at personal
main, not their build commits; build-fex now tags the built commit and needs thunks to publish.
- **PR #70 review**: added Linux-only titles in the x86-64 client went to `droiddeck-fex`, a tool that
client lacks (now DroidDeck direct, and `droiddeck-fex` is retaken); pulseguard finds a libpulse loaded
RTLD_LOCAL (Wine's winepulse.so); segvlog passes faults on to the program's own handlers after logging;
Lossless's DLL search includes the x86-64 card folder; the log scrubber keeps account names when a
`loginusers.vdf` cannot be read; build-diag runs with a read-only token.
- **Org main 97f976ef** (Epic Games Launcher for Linux, #928): rebased onto it. Its new session code
launched, restarted and recovered games through `steamrtarm64/steam`, and its added-game shortcut check
read the arm64 client's Steam folder; both now use the session's client. Added games marked native are
not given a Proton by either client's shortcuts pass.
- **FEX hosted by the org**: `fex-2610-r3` is mirrored into Droid-Deck/DroidDeck-Components by its
`mirror-release.yml`, checked against a new `fex.json` catalog there (Components PR #2), and
`droiddeck-steam-x64` downloads it from there instead of The412Banner/DroidDeck.
- **FEX fex-2610-r4** (PR #71 review): without openat2 (proot) FEX opened rootfs paths with absolute
symlinks resolved against the arm64 guest, and `libblsession.so` converted every openat2 the same way
before FEX saw ENOSYS. `preload/robust.c` now resolves `RESOLVE_IN_ROOT` paths component by component
inside the root (59 cases; 100,000-path differential fuzz; new `test_openat2_preload.py`), and patch
0001 does the same in FEX. Patch 0003 marks only the host mappings that overlap a failed MAP_32BIT
range (the low-2 GB case: about a million mmap tries before, one now). Built with thunks, tagged at the
built commit, mirrored into DroidDeck-Components (PR #3). The Steam client setting names the FEX build.
The bring-up crash logger (`tools/diag`) left the branch. Device: FEX r4 downloaded on first start,
client UI in 23 s (19-33 s before), TF2 played. The first session on the new build drew no SVG fills
in Steam's UI (icons blank, outlines and text fine); a restart drew them, cause not found.
- **Added games**: the scan treated every folder of the card library as a game folder except
`steamapps`, so the x86-64 client's `x86-64/` library showed up as a custom game named "x86-64"
with the exe of a Steam title installed there (FlatOut). `AddedGames.isSteamLibraryFolder` skips it
like `steamapps` in the scan, the exe-to-folder lookup and the folder list (`AddedGamesScanTest`).
- Rebased onto org main 45513c90; squashed again for a full automated review (personal PR #72,
replacing #71).
- **PR #72 review**: grid art, the content-log monitor, the repair marker, storage leftovers and the
VAC diagnostics files are kept per client (the x86-64 client's first art sync was deleting chosen
art as "removed in Steam"); the old games-folder migration skips the x86-64 library too.
- **Which client**: the Games header shows a plain "x86-64" chip while the x86-64 client's list is
shown (on its own line in a narrow pane); nothing changes for arm64. The setting reads "Applies next
session. FEX 2610 r4" with the choices ARM64 and x86-64 (`GamesClientTagTest`).
- **Stale list**: every refresh drops the Steam-client games when they belong to another client than
the active one (a setting change, the end of a session, a resume), keeping added and store games;
the cached list records its client in the same file (`library-cache.json`, saved under one lock). The next review of PR #72 had no
findings. Device: the header chip and the removed "x86-64" entry seen on 04568806.
- **x86-64 rootfs in DroidDeck-Components**: FEX-Emu's Ubuntu 24.04 image (2026-08-11, 525,615,104
bytes, unmodified) is now fetched from Droid-Deck/DroidDeck-Components release
`fex-rootfs-ubuntu-24.04-2026-08-11` instead of rootfs.fex-emu.gg. Components PR #4 added
`fex-rootfs.json` and `mirror-upstream.yml` (fetches a catalog's upstream link, refuses it unless
sha256 and size match, checks the digest GitHub stored); its run 39084452789 brought the file in.
The sha256 the app pins is unchanged, so an unpacked rootfs is kept.
- **One cache file**: the review of that change found the list and its client marker written as two
files, so concurrent saves could pair one client's list with the other's marker. `library-cache.json`
is now one object (`client`, `games`) written by one rename under a lock; a bare list from earlier
builds reads as arm64's. Device (73e2a80b): the first start after install read the old list,
rescanned and wrote `{"client":"x86_64","games":[...]}` with the same 23 games.
- A scan reads the client it tagged the cache with (`Library.launchableGames(arch = ...)`), so a switch
during a scan cannot pair one client's games with the other's tag; a failed rename drops the cache
instead of leaving the previous list behind (`LibraryArchTest`).
- The next review of PR #72 (a2552c58) had no findings; every review thread is resolved. Device: 43f9a8a8
installed.
- Device checks on 43f9a8a8: the setting reads "Applies next session. FEX 2610 r4" with the choices
ARM64 and x86-64; picking ARM64 drops the chip and the Games tab showed the arm64 list on first
look, and back on x86-64 the chip and the x86-64 list return (the cache records each client). Two
custom games' chosen background art is kept, with the same file in both clients' grid folders.
Team Fortress 2 launched from the Games tab with the x86-64 client selected: the session started
the client, handed it app 440 and the Linux build (`tf_linux64` under FEX) took focus about 60 s
after the tap.
- **Translations**: the branch's 11 strings (the Steam client setting and its values, VAC diagnostics,
the x86-64 loading title and the Storage labels) are in all 31 other locales, after
`stores_registering` as in the English file, reusing each locale's wording for "Steam client",
"Session logs" and "Uninstall" and its formal or informal address. Every file parses, every
translation keeps its English placeholders, and no locale has a key the English file lacks.
- The translations went to PR #72 (a43217c4) for review; org main is still 45513c90, so the branch
needs no rebase before the org PR. Device: 9afb9bd5 installed.
- **Org PR**: the draft #152 from 2026-10-02 (same branch name, 12 commits, conflicting with main) is
refreshed as one commit on org main 45513c90 and marked ready, once the review of the translations
is clean. Its old head is kept at `refs/backup/20261018/x86-64-steam-client-afa479ee`.
## 2026-10-15 - `feat/x86-64-steam-client`: SD card library, ARM parity, org main, Counter-Strike 2
- **SD card library** (`3fc74f3e`): the x86-64 client had internal storage as its only library, so Steam's
install dialog never offered a place. It now has `x86-64/` inside the card library
(`/mnt/droiddeck-sd/x86-64`; compatdata, shadercache and runtime tools private like the arm64 card
library). Before building, FEX was shown to run x86 programs from the noexec exFAT card. Device: the
dialog offers Internal Storage and SD card.
- **Card downloads** (`f77113fb`): `storage.c` (no zero-filled reservation where `fallocate` is refused)
and `dircache.c` recognised only `steamrtarm64/steam`; the x86-64 client wrote each download in full as
zeros first (Audiosurf: 415 MB written, 0 downloaded). Device: FlatOut, 1.19 GB, to the card in 51 s.
- **zRAM** (`877c27eb`): the watcher read argv[0], which under FEX is FEX; it now reads FEX's first argument.
- **ARM parity** (`b0923f05`): touch layouts read the active client's files; Offline Mode is written to
both clients' `loginusers.vdf`; the Lossless Scaling ownership check runs for x86-64; Repair Steam repairs
the x86-64 client too (and two unshown starts do, like arm64; the app clears its start count). Device: no
repair on the stale 31-start count, count cleared once the client was on screen. Switch to Desktop needs
no change (Deck mode: an x86 shell under FEX runs `steamos-session-select`).
- **DroidDeck-Proton default** (`2bd752aa`): newest DroidDeck-Proton before GE-Proton; `default-tool`
records the default this script set, and on a change the titles still on it move along (device: 113 off
GE-Proton11-7). A default the user chose is kept. FlatOut from the card: in game on DroidDeck-Proton
11-9.1, exits on GE-Proton11-7 (no log).
- **Org main** merged (`714198bf`, 36 commits; strings and `steam_started` conflicts kept both sides).
A stale line from the 10-07 sync ran the live compat helper in the foreground on the arm64 restart path:
black screen after a Steam import restart (`02e7c503` matches main again).
- **VAC findings:** x86-64 client + Linux builds secure (TF2, HL, L4D2). x86-64 client + Windows build
(TF2 on DroidDeck-Proton) insecure: Proton reaches Steam through the arm64 client's `steamclient.so`.
arm64 client + L4D2 blocked on both Protons; arm64 + Half-Life (Windows) joined a vac=1 GoldSrc server.
Why the arm64 client fails is not established. Sharing libraries between the clients stays parked.
- **arm64 `droiddeck-fex`** (`a53b49ef`): Valve's FEX-Emu keeps its server socket in
`$STEAM_COMPAT_DATA_PATH/fex-emu/Server` whatever `FEX_APP_DATA_LOCATION`/`FEX_SERVERSOCKETPATH` say;
under the app's folder that path passed 108 bytes (Half-Life: 136) and FEXServer never listened. A short
path is used now. 32-bit Linux titles through it still fail (not pursued).
- **Counter-Strike 2** (Linux, newer runtime) hung at 100% of one core before loading its engine. With
ptrace taken by proot, `perf_event_open` IP sampling put the loop in FEX's `MemAllocator32Bit`: CS2
reserves the low 2 GB with `MAP_32BIT` in shrinking sizes, FEX met `EEXIST`, stepped down one page per
retry and restarted from the top for ever. **`fex-2610-r3`** (patch `0003`, `b0d316dc`): such a range is
skipped whole and a second exhausted scan returns `-ENOMEM`, as the kernel does. Next, its menu text
library failed: CS2 ships an older `libfreetype.so.6` but no HarfBuzz, and the rootfs's needs a newer
FreeType; the game flagged its files corrupt (a verify each start) and waited behind an error box that
could not open. DroidDeck direct now preloads Valve's runtime HarfBuzz (2.7) for newer-runtime titles
(`c9eb7d30`). Device with both done by hand: engine and modules loaded (5 GB) with no error, then Android
killed DroidDeck for memory while it was in the background. Not yet seen at the menu.
- **CS2 on the r3 APK** (`c9eb7d30`, no launch options): no hang, the menu text library loads, the game
client and modules load and the window resizes. Every run then ended in Android's low-memory killer:
CS2 goes from 3.5 to 5.3 GB in about 15 s and `lmkd` killed DroidDeck (adj 200, in the background
while the device was in Termux) with zRAM on and still filling (1.5 to 3.2 GB of 6 GB). This device's
`lmkd` runs in minfree mode (`persist.device_config.lmkd_native.use_minfree_levels=true`; background
apps go below about 120 MB free), which does not count swap. Proposed, not applied: switch it to the
PSI mode (`use_minfree_levels=false`, `lmkd.reinit=1`; reverted with `true`). CS2 has not been seen
at its menu yet.
- **CS2 reached its menu (14:47, DroidDeck in the foreground):** still loading, 11 fps, 11.6 GiB used.
Five seconds later `lmkd` killed nearly every app, then DroidDeck itself at adj 0 (foreground), while
swap was about 22 of 23 GB free (zRAM 6 GB with 0.9 GB used, `/data/swapfile` 16 GB almost unused).
Steam and CS2 died with the app; neither crashed on its own.
- **Root test without changing Android (lmkd left as is):** DroidDeck's zRAM watcher only pages out
`steam` and `steamwebhelper`, never the game. A root tool (`/data/local/tmp/pageout cs2 3000 <log>`)
calls `process_madvise(MADV_PAGEOUT)` on CS2's private anonymous memory whenever MemAvailable drops
below 3 GB, so free RAM stays above the killer's levels. One call per mapping in 1 GB pieces: a single
call with many ranges is capped at about 2 GB in total, and FEX reserves huge ranges, so batched calls
silently skipped most of a FEX process. With that fixed, the x86 Steam client moved 223 of 256 MB to
swap. If CS2 survives to its menu, the app version is the zRAM watcher also paging out the running
game during its load (no root).
- **Page-out result (14:59):** the tool fired at 2.9 GB available and moved 4.8 GB of CS2 to swap
(resident 5.8 → 1.5 GB). CS2 drew its full menu (2–34 fps). 27 s later `lmkd` still killed down to
DroidDeck at adj 0. Its kill record: MemFree 111 MB, Cached 6.3 GB, but **Shmem 3.4 GB and
Unevictable 3.5 GB** (Mlocked only 120 MB), swap 17 GB free. In minfree mode the "file" figure is
Cached minus Shmem, Unevictable and SwapCached, so about 0, and it kills to the foreground. After the
session died Shmem fell to 0.3 GB, so the 3.4 GB of pinned shared memory belonged to the CS2 session.
MemAvailable counted it as available, which is why the tool saw 3.7 GB of headroom 2 s before the
kill. Page-out cannot move unevictable pages.
- **Next run (15:04):** a root logger (`/data/local/tmp/shmlog.sh` → `shm-cs2.log`, every 3 s) records
MemFree / Cached / Shmem / Unevictable / Mlocked / SwapFree and every process holding more than 50 MB
of shared (`RssShmem`) or locked (`VmLck`) memory, to find who pins the 3.4 GB (FEX, the X server,
Vulkan buffers, a ramfs). No SysV shared memory on the device. Then the trigger moves from
MemAvailable to MemFree plus droppable file pages.
- **Dust II (15:27):** CS2 loaded Dust II "Training Day" (bots) at 78 fps, then was killed at 15:28:05 the
same way. From 15:25:30 Shmem and Unevictable rose from 0.25 to 3.9 / 4.0 GB, yet the largest process
mapping shared memory (an `exe`) held only about 535 MB, so about 3.3 GB is not mapped by any process.
- **Open files ruled out (15:32-15:36):** a second logger (`fdlog.sh` → `fd-cs2.log`) listed every memfd,
ashmem, deleted or tmpfs file of 20 MB or more held by the app. Only 64 MB PulseAudio memfds showed up
while Shmem reached 2.7 GB. The run was killed at 15:36:28 (Shmem 3.4 GB, Unevictable 3.5 GB).
- **Lead: GPU memory.** `/sys/class/kgsl/kgsl/page_alloc_max` reads 6.07 GB (the peak since boot), and the
driver has `max_reclaim_limit` / `page_reclaim_per_call`, i.e. a KGSL build with process reclaim, where
GPU pages are shmem-backed and stay unevictable while the process is in the foreground. That fits
memory that no process maps, that has no file, and that is freed when the session dies. Not proven.
- **Low-settings test (15:42):** `cs2_video.txt` in the x86 userdata: `gpu_mem_level` 3 → 0,
`cpu_level` 3 → 0, resolution 1024x576 → 854x480 (everything else was already at its lowest; backup
`cs2_video.txt.before-low`). A third logger (`gpulog.sh` → `gpu-cs2.log`, every 3 s) records KGSL
`page_alloc`, MemFree, Shmem, Unevictable and each process with more than 200 MB of GPU memory. If
Shmem rises with `page_alloc`, the GPU memory is what is pinned. Background apps were force-stopped
and caches dropped first (about 11 GB free).
- **GPU memory confirmed (15:47):** with low settings CS2 reached its menu at 94 fps and was killed at
15:47:59 the same way. KGSL `page_alloc` followed Shmem within 20-120 MB through the whole load
(0.23 GB at 15:44:50, 0.93 GB at 15:46:47, then +2.2 GB in 3 s, about 3.2 GB at the kill), and
Unevictable stayed about 100 MB above it. One process (`exe`, pid 23906) held nearly all of it. So the
pinned 3.4 GB is the game's GPU memory, and the low settings did not make it smaller. (The negative
values in that log were the device shell's 32-bit arithmetic; the logger now divides in awk.)
- **New page-out trigger (16:23):** the tool now acts on what lmkd's minfree mode looks at, MemFree plus
`Cached + Buffers - Shmem - Unevictable`, instead of MemAvailable (which counted the GPU memory as
free). Threshold 2500 MB, checked every 0.5 s, page-out at most once a second. The idea: push CS2's
swappable memory out early so the 3.2 GB of GPU memory fits beside it. The open-file logger was stopped.
- **Still to test:** CS2 without the kill; touch layouts, Offline Mode, Switch to Desktop, a Linux game from
the card. TF2 on the device is the Windows build after the VAC test.
## 2026-10-14 (evening) - `feat/x86-64-steam-client`: Team Fortress 2 runs (sniper check, FEX thunks)
- **Sniper check:** `tf.sh` reads `VERSION_CODENAME` from `/etc/os-release` and stops unless it is
`sniper`. DroidDeck direct cannot use Valve's sniper container (no user namespaces under Android), so
for titles in `direct-sniper` it runs such a script through `bash -c` with that line replaced by
`VERSION_CODENAME=sniper` (`92d65e3d`). Device: TF2 gets past the check and loads on the rootfs
libraries; sniper itself is not needed.
- **Then a crash at the first frames**, with both launch options (Vulkan and Legacy OpenGL). Strict FEX
memory ordering and turning off the Gamescope WSI layer changed nothing. With FEX thunks off (lavapipe,
software) TF2 reached its main menu and loaded a match at 17 fps, so the thunks were the cause; with
only the Vulkan thunk on it still crashed.
- **Cause (from a SIGSEGV report taken inside the game):** the main thread was executing Turnip's
`vk_common_CmdBindDescriptorSets` as x86 code, an address FEX never linked. FEX-2609's guest
`vkGetDeviceProcAddr` passes a lookup of `vkGetDeviceProcAddr` itself to the host and hands back the
raw host function; every pointer fetched through it is unlinked. TF2's native DXVK (2.3) makes that
lookup; the Windows games through Proton do not. FEX-2610 answers self-lookups in the guest
(FEX-Emu/FEX 3397eb9b).
- **FEX 2610** (`af49e545`): `tools/fex/build-in-arch.sh` builds FEX-2610 with the same openat2 patch and
host thunks as `fex-2609-r3`. The container's newer clang has no `FileManager::clearStatCache()`,
which the thunk generator called after each run; patch `0002` drops that call (`31d66e67`). Published
as `fex-2610-r1` on the personal repo.
- **2610 alone did not fix it.** An ARM-side signal hook in FEX (wrapping its `syscall(rt_sigaction)`)
logged no fault in Turnip, and the guest thunk's disassembly showed why: Arch's clang builds the x86
guest thunks with stack protection, and the canary load in `CallHostFunction`'s prologue
(`mov %fs:0x28, %r11`) overwrote r11, which carries the host function's address, before the thunk
stored it. FEX called the canary. 9 of 521 Vulkan and 66 of 736 GL host calls (those with 7+
arguments) were affected, `vkCmdBindDescriptorSets` among them. Windows games never reach these
thunks (they run on the arm64 Proton) and 32-bit games pass the host address in mm0.
- **`fex-2610-r2`** (`56e5a712`): the toolchain files add `-fno-stack-protector` for the guest thunks;
no guest thunk library has a canary load. The x86 client fetches it (`9cc0ebcb`). Device, stock
settings: TF2 main menu at 358 fps on the GPU, Casual matchmaking onto a VAC-secured Valve server,
in game at about 84 fps; Half-Life (32-bit, direct) runs on it. Windows games are not on this FEX:
in x86 client mode they still run on the arm64 Proton (Borderlands 2: GE-Proton11-7-aarch64), whose
own FEX translates the game.
- **Which FEX runs what in x86 client mode:** the client (`steamrt64/steam`) and every Linux game on
DroidDeck direct run on the runtime's FEX (`fex-2610-r2`); Windows games go to the arm64 Proton and
its own FEX. At each start every library game with a Linux build, installed or not, is mapped to
DroidDeck direct, so Steam downloads the Linux depots; Windows-only games stay on the default
Proton, and a game already installed as its Windows build stays there (Borderlands 2 here:
`Binaries/Win32`, depot 49521). A game new to the library mid-session is mapped at the next start.
- APK run 38670180921 (`9cc0ebcb`), signed and staged as `DroidDeck-x64-fex2610r2-9cc0ebcb.apk`.
## 2026-10-14 - `feat/x86-64-steam-client`: brought up to main; added games run through the x86-64 client
Work lives on The412Banner/DroidDeck only until it runs correctly; the org branch and draft PR #152
stay as they were (`afa479ee`).
- **Merged main (94 commits).** Main dropped the Steam channel and Deck-mode settings (#546): only the
client choice (`steamClientArch`), `activeSteamRoot` and VAC diagnostics remain. Main's web-helper
arguments (#566, `bl_webhelper_argv`) are composed with the x86 client's arm64 web-helper redirect in
`preload/net.c`. Main's single background loop (#575) now carries the x86 hooks: the client's own
compat pass (`--x64 --live`), `steamrt64` in the pinning and stale-tmp patterns, Lossless probe off for
x86, and the once-per-title restart after a new mapping. The text-strings merge had dropped three of
main's strings; main's files were taken and the six x86 strings added back.
- **Builds on the personal repo** need the pinned Debian image in a release of their own:
`ci-debian-bullseye-r1` was copied (same sha256) as a pre-release. The bullseye compilers come from
`deb.debian.org` first; `archive.debian.org` no longer serves `libmpfr6_4.1.0-3`.
- **Client update before start** (`x64_sync_client`): Valve serves one build to both clients; the x86
client is brought to it (changed parts only, 9 of 28 on device) so it can use the arm64 web helper on
the GPU from the first frame (device: 144 fps menus).
- **Web helper loop:** with main's in-process GPU arguments the x86 web helper's GPU crash took the
whole helper down (102 restarts). The x86 helper now starts with stock arguments.
- **Loading screen:** "Starting Steam x86-64", and the x86 setup and update steps reach it.
- **Added games:** written first, then pointed at the x86 client's Proton (they were mapped to the
arm64 client's tool name, which this client ignores). Windows components install into the x86
prefix (DiRT Showdown and DiRT 3 needed OpenAL).
- **Hidden game window, two causes.** The arm64 launcher loaded the saved arm session's `DISPLAY=:0`
over the game display Steam chose; it now keeps Steam's. And the game window had no `STEAM_GAME`
tag, so gamescope never listed it as focusable; the agent's focus watcher now tags untagged
`steam_app_<id>` windows on the game display when the x86 client runs. Device: DiRT 3 (added game)
at its title screen at 144 fps.
- **Parity with the arm64 client:** Steam UI scale and the Steam import watcher run for the x86 client
too (the import is untested). An SD-card library stays arm64-only: FEX cannot run Linux games from it.
- **Later the same day:**
- DiRT Showdown's ~7 s exit was the same `DISPLAY=:0` problem; it runs now.
- **Tools adopted as arm64 Protons:** main's `droiddeck-steam-shortcuts` calls `adopt_extras` on the
client's `compatibilitytools.d`; in the x86 client that rewrote DroidDeck direct as a Windows tool,
so Steam installed Half-Life's Windows files. The x86 client no longer adopts its tools, and its
preparation removes what an adoption left. The arm64 Proton is adopted on demand at an x86 launch.
- **Scout runtime:** shipped as `steam-runtime.tar.xz`; `steam.sh` unpacks it, and the x86 client
is started without it. Its preparation unpacks it now. Device: Half-Life's native Linux build at
101 fps on the GPU under FEX (32-bit), and a VAC-secured multiplayer server.
- **Install scripts:** the evaluator script is looked up in the x86 client's folder. A game's own
installers without a `HasRunKey` (Borderlands 2: VC++ 2005/2008/2010, DirectX, .NET 4.0) are now
marked under `Software\Valve\Steam\Apps\<appid>` (and the Wow6432Node view); Steam skips them.
This applies to the arm64 client too. Device: Borderlands 2 started past its install script, and
on the build that marks them itself it went straight into the game.
- **Windows components** detection follows the chosen client (in-session install watch and
`appinfo.vdf`).
- **Next:** Counter-Strike: Source, the first game on the newer (sniper) runtime path, where DroidDeck
direct runs it on the rootfs instead of the scout runtime.
- **Open:** newer-runtime Linux games (sniper) untested; the arm64 client untested on this build; the
Steam import watcher untested; an SD-card library for the x86 client deferred.
## 2026-10-10 - `feat/wincomp-auto-sources`: Windows components picked by the game's source
- **Per source** (`WinCompSources`): Steam - Steamworks Shared depots from the appmanifest or the
@@ -87,6 +394,104 @@ the timeline, then lessons and backlog. Companion to the README (what the app *d
idempotent, store and steamapps skipped, libraries empty, same-name folders), `GameStorageTest`
updated. Not yet on a device.
## 2026-10-02 - `feat/x86-64-steam-client`: Valve's x86-64 Linux client under FEX (experiment)
Why: the arm64 Linux client never runs VAC. L4D2 (and TF2 in Bannerlator) are refused by VAC
servers ("Connection Blocked ... VAC secured server") and no client log mentions VAC; VAC modules
are x86 code. The question is whether Valve's x86-64 client under FEX gets a VAC module it can run.
Branched from `feat/vac-diagnostics`. Opt-in: `bannerlator-steam-x64` (desktop menu "Steam x86-64
(FEX, experimental)") runs the client in its own home (`~/.droiddeck-x64`) with its own rootfs,
login and library. The arm64 client stays the default and is not touched.
Device-proven on the FIT (Genshin repack): **the x86-64 client runs, self-updates, renders its full
UI (software GL), logs in, shows friends, and downloads games.** VAC itself is not tested yet.
What it took, in order (each step was the next failure on device):
- **FEX for the guest** - `tools/fex/build-in-arch.sh` + `build-fex.yml` (FEX-2609, Arch Linux ARM
container, no thunks), released as `fex-2609-r2` (not Latest). Rootfs: FEX's Ubuntu 24.04 image.
- **openat2** - our proot answers it with ENOSYS; FEX opened every rootfs path with
`openat2(RESOLVE_IN_ROOT)`, fell through to the arm64 guest on anything but EXDEV, and x86 bash
could not find libtinfo. `tools/fex/patches/0001-openat2-enosys-fallback.patch`.
- **FEXServer owns the rootfs** - a server started before `FEX_ROOTFS` (any earlier FEX run) answers
every client with no rootfs. The launcher stops it first.
- **32-bit x86 died with SIGILL** - libblfastpath (the proot fast path, preloaded into every guest
process, FEX itself included) breaks FEX's 32-bit mode. `PROOT_FP_OFF=1` for FEX.
- **"Steam now requires user namespaces"** - steam-runtime-check-requirements' bwrap probe; the
arm64 client has no such probe. The SteamRT3 client (`steamrt64/steam`) is started directly, the
way the session starts `steamrtarm64/steam`, with `STEAM_RUNTIME_STEAMRT` pointing at Valve's
runtime linked file by file and only the probe replaced.
- **tier0 assertion "Function not implemented"** - semget: Android has no System V IPC. Traced with
a `-DDEBUG_STRACE` FEX (build-fex.yml `cxxflags` input, artifact only). The session shim
(`preload/*.c`) is now also built natively as `libblsession-x86_64.so`, staged, and preloaded
through the rootfs's own `/etc/ld.so.preload`.
- **re-exec into pressure-vessel after self-update** - `STEAM_STEAMRT_RECURSION_GUARD=1`.
- **libgtk-x11-2.0 missing / soname links / old glibc shadowing** - Valve's steamrt3c platform
libraries linked into `~/.droiddeck-x64/steamrt-libs`, soname links from the rootfs `ldconfig`,
and only libraries the rootfs lacks (LD_LIBRARY_PATH beats system folders whatever its order).
- **GLX failed** - the desktop exports zink over the arm64 Turnip ICD; cleared, llvmpipe used.
- **web helper died of SIGTRAP a second after start** - found with pid-tagged traces (FEX AppConfig
`OutputLog=server` + a foreground FEXServer, `BL_FEXSERVER_LOG`; file logs overwrite each other):
every web helper read `/proc/self/status` from libtier0_s.so, saw proot as a tracer, and tier0 broke
into the "debugger" with int3. `preload/tracer.c` exempts the web helper on purpose (Chromium traps
on a status fd that is not procfs); with `BL_WEBHELPER_HIDE_TRACER=1` only opens called from
libtier0_s.so get the copy.
- `SessionFiles` stages `bannerlator-steam-x64` and the x86-64 shim (they were missing from the list).
Dead ends worth remembering: headless VAC testing is impossible (current Steam starts the saved
login from its UI); `-cef-*` switches are not forwarded to the x86 web helper; the KMS
`CREATE_DUMB` errors are a red herring (40 fast ENOTTY per process); not an address-space problem
(0 ENOMEM in 618k traced syscalls, although the device is 39-bit VA).
Later the same day (device-proven unless noted):
- **Controllers**: libfakeinput is now also built for x86-64 and preloaded in the FEX rootfs; the
client registers the pad, and **Big Picture works with it** (Xbox prompts, D-pad moves focus).
- **Online**: the launcher starts the system bus and the NetworkManager stand-in like the session.
- From an audit of `bannerlator-session`: stale lock cleanup, branch sync before every start, core
re-pinning, path cache and `perms.c` for `steamrt64`, the app's FEX preset (PERFORMANCE_TSO).
- **Play button (built, not yet device-tested)**: Steam settings > Client > "Steam client: ARM64 /
x86-64 (FEX, experimental)" (`BL_STEAM_CLIENT_ARCH`). The session then starts the x86 client via
`bannerlator-steam-x64 --prepare/--exec` and gives it everything it gives the arm64 one; steps
only for the arm64 client (ARM64 Proton, mapping, seeding, Decky, steamclient.so probes) are
skipped.
- L4D2 hard-link reuse does not work: switching platform makes Steam redownload depot 551 anyway.
Evening (device-proven unless noted):
- **Play button with the x86-64 client works** (Steam settings > Client > Steam client: x86-64).
Deck mode is skipped for it: with -steamos3 its SteamOS audio manager aborts on the runtime's
PulseAudio 13 (pa_operation_get_state assertion).
- **Left 4 Dead 2 runs in the x86-64 client and joined a live online game** (Quick Match, Swamp
Fever, other players, 138 ms) - the server type that refused the arm64 client with "Connection
Blocked ... VAC secured server". Not yet hard proof of VAC (no client log line; -condebug added
for the server's secure flag). Software rendering: ~11 fps.
- What the launch needed: "DroidDeck direct", a compatibility tool running native Linux games with
Valve's scout library runtime instead of the Steam Linux Runtime container; a stand-in
steam-runtime-launch-client (the client, believing itself inside the SteamRT container, starts
every game "alongside Steam" through it, and Valve's needs a launcher service on a session bus);
i386 builds of the session shim (the i386 controller reader crashes the game and is left out for
now). A steam:// URL written to the launch dir now reaches the running client.
- **FEX with host thunks** (fex-2609-r3): FEX's Vulkan/GL/EGL/DRM/Wayland/ALSA thunks, 64- and
32-bit guests, guest halves cross-compiled against an Arch x86_64/multilib sysroot. The x86 client
uses them when installed (GPU mode, the arm64 client's ANGLE-on-Vulkan flags) - built, not yet
device-tested.
- The proot fast path now stands down in FEX only for 32-bit programs (it broke FEX's 32-bit mode).
- **On the GPU, VAC proven (19:40):** games get FEX's host thunks and the session's Turnip/Zink
settings (the client and its browser stay in software: with the thunks the browser's GPU process
dies and the client never opens a window). Left 4 Dead 2 in The Passing on an online server:
51 fps (was ~11 in software). The server answered the A2S info query as "Valve Left4Dead 2 US
East Server", VAC=1 - an official VAC-secured server, which the arm64 client is refused.
- The crash that held this up was not the GPU: the 32-bit controller reader was still preloaded
(FEX falls through to the session's own i386 copy), and the game's SDL2 strdup()s a NULL udev
attribute of its fake devices. Found with a SIGSEGV logger (tools/diag/segvlog.c).
- The Linux FEX as a component file: /sdcard/Download/FEX-2609-r2-x86-64-guest.wcp (type
FEX-Guest); the Components section does not know that type yet.
Open:
- VAC test: L4D2's native Linux build in the x86 client's own library (hard-linked from the arm64
copy, same filesystem, so only the Linux depots download). Native Linux games start inside the
Steam Linux Runtime container (pressure-vessel) - expected to need the same treatment.
- No x86 GPU driver: games render with llvmpipe. Playable needs FEX host thunks.
- Windows games in the x86 client need x86 Proton = pressure-vessel.
- One client per account: integration would be a per-title hand-off, not side by side.
## 2026-10-09 - `feat/games-add-edit`: add games from the Games tab, edit them like Steam's Properties
- **Steam ⚙ settings:** the Games section is gone (it was a feature, not a setting). Games