From 47e528102d1e11a3b1fac893d5d62b5c7d925040 Mon Sep 17 00:00:00 2001 From: The412Banner Date: Fri, 2 Oct 2026 16:52:53 -0400 Subject: [PATCH] x86-64 client: the controller reader for x86 programs The session's pads exist for a guest program only through libfakeinput (the FAKE_EVDEV_* rings), which was built for arm64 alone, so the x86 client saw no controller. Build it natively for x86-64 too, stage it, and preload it through the FEX rootfs next to the session shim. --- .github/workflows/build.yml | 7 ++++++- .../java/com/droiddeck/launcher/session/SessionFiles.kt | 1 + tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0c644f1b4..b4a737782e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: - PRELOAD_CACHE_VERSION: v3 + PRELOAD_CACHE_VERSION: v4 jobs: build: @@ -182,6 +182,11 @@ jobs: gcc -shared -fPIC -O2 -Wall -pthread \ -o "$D/libblsession-x86_64.so" tools/linuxfs/preload/*.c -ldl strip --strip-unneeded "$D/libblsession-x86_64.so" + # And the controller reader: the session's pads reach x86-64 programs the same way. + g++ -shared -fPIC -O2 -Wall -Wno-attributes -Wno-nonnull-compare \ + -pthread -std=c++17 -static-libstdc++ -static-libgcc -Wl,--exclude-libs,ALL \ + -o "$D/libfakeinput-x86_64.so" app/src/main/cpp/fakeinput_steam.cpp -ldl + strip --strip-unneeded "$D/libfakeinput-x86_64.so" aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \ -o "$D/libblfastpath.so" tools/proot/fastpath/fastpath.c -ldl aarch64-linux-gnu-strip --strip-unneeded "$D/libblfastpath.so" diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt index 1309ce0d70..934119073d 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt @@ -30,6 +30,7 @@ object SessionFiles { "usr/local/bin/bannerlator-game-env" to "usr/local/bin/bannerlator-game-env", "libblsession.so" to "usr/local/lib/libblsession.so", "libblsession-x86_64.so" to "usr/local/lib/x86_64-linux-gnu/libblsession.so", + "libfakeinput-x86_64.so" to "usr/local/lib/x86_64-linux-gnu/libfakeinput.so", "libfakeinput.so" to "usr/local/lib/libfakeinput.so", "libblfastpath.so" to "usr/local/lib/libblfastpath.so", "usr/local/bin/bannerlator-session" to "usr/local/bin/bannerlator-session", diff --git a/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 b/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 index 921ab1ef0a..0f75897a3c 100755 --- a/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 +++ b/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 @@ -66,6 +66,13 @@ if [ -f /usr/local/lib/x86_64-linux-gnu/libblsession.so ]; then mkdir -p "$ROOTFS/usr/local/lib" cp -f /usr/local/lib/x86_64-linux-gnu/libblsession.so "$ROOTFS/usr/local/lib/libblsession-x86_64.so" echo /usr/local/lib/libblsession-x86_64.so > "$ROOTFS/etc/ld.so.preload" + # The controller reader too: the session's pads (FAKE_EVDEV_*) exist for a program only through it. + if [ -f /usr/local/lib/x86_64-linux-gnu/libfakeinput.so ]; then + cp -f /usr/local/lib/x86_64-linux-gnu/libfakeinput.so "$ROOTFS/usr/local/lib/libfakeinput-x86_64.so" + echo /usr/local/lib/libfakeinput-x86_64.so >> "$ROOTFS/etc/ld.so.preload" + else + step "warning: no x86-64 controller reader (/usr/local/lib/x86_64-linux-gnu/libfakeinput.so); no pads in the client" + fi else step "warning: no x86-64 session shim (/usr/local/lib/x86_64-linux-gnu/libblsession.so); the client will stop on semget" : > "$ROOTFS/etc/ld.so.preload"