Files
DroidDeck/.github/workflows/build-bionic-runtime.yml
T
The412Banner 59397f0ef9 feat(bionic): dd-directcontroller, XInput from the pad state for games started without Steam (#3792)
Two problems with games set to "Start without Steam" on DroidDeck-Bionic.

1. launch.sh set WINE_LSTEAMCLIENT=1 for every launch, so Wine replaced any steamclient(64).dll
   a game loads with lsteamclient, DroidDeck's bridge to its Steam client. A game started
   without Steam has no Steam client behind it; one that brings its own steamclient64.dll (a
   Steam emulator such as gbe_fork's ColdClient loader) quit after its splash screen because
   SteamAPI_Init failed. With DROIDDECK_NO_STEAM on, launch.sh now sets WINE_LSTEAMCLIENT=0
   unless the player set a value.

2. Wine's xinput reads the HID reports winebus makes from the evdev events fakeinput replays
   out of each controller ring, through a queue per handle. A game that reads them slower than
   the pad reports gets old stick positions: in Halo: The Master Chief Collection the character
   kept moving for a second or two after the stick was let go (vibration off in DroidDeck and
   in the game changed nothing).

dd-directcontroller (tools/bionic-runtime/dd-directcontroller) is an XInput DLL set
(xinput1_1..1_4, 9_1_0, uap; ARM64X for system32, i386 for syswow64) that answers
XInputGetState from the snapshot of the whole pad FakeInputWriter keeps in each ring file's
header (sequence-locked, read with 32-bit loads only). XInputSetState returns at once; a worker
thread hands rumble changes to a renamed copy of Wine's builtin xinput1_4
(dd-directcontroller-wine-xinput.dll), so rumble keeps DroidDeck's force-feedback path without
Wine's lock holding up a game thread. A pass-through mode sends every call to that copy. A
background thread reads the mode file every 250 ms ('1' direct, '0' pass-through) and does the
once-a-second ring and pad-node checks, so a game thread never waits on a file. Based on
Bannerlator's direct XInput DLL (GPL-3.0).

- launch.sh copies the DLLs into the prefix (replacing the links to the tool's builtins, never
  writing through them), sets xinput*=n,b and writes the mode file next to the controller
  folder (DD_DIRECTCONTROLLER_CONTROL) when the game is set to start without Steam;
  DD_DIRECTCONTROLLER=0 starts it in pass-through, and a game no longer set to start without
  Steam gets Wine's links back. DROIDDECK_NO_STEAM is kept in the environment it passes on.
- tools/bionic-runtime/build.sh builds and checks the DLLs (export tables of both ARM64X views,
  imports, no TLS directory, version resource) with a pinned llvm-mingw and runs the host test
  of the ring reader; the workflow caches the toolchain.
- App: a "Direct controller" switch under Controller > Device settings in the session menu,
  shown while the running game uses dd-directcontroller. It writes the mode file, so the game
  moves between the pad state and Wine's own xinput at once, and saves the choice for the game
  (DD_DIRECTCONTROLLER=0). A session deletes the mode file at start, so only a launch that uses
  dd-directcontroller brings the switch back. Translated in every language.


Review fixes: synchronized setting save; the DLL pins itself before its worker threads; pass-through forwards XInputPowerOffController; launch.sh keeps a native XInput DLL that is neither Wine's nor ours; switch requests run in order; XInputEnable reaches Wine's xinput when there is no rumble worker.
2026-12-06 04:16:37 -05:00

41 lines
1.4 KiB
YAML

name: Build bionic runtime pack and DroidDeck-Bionic tool
on:
push:
paths:
- 'tools/bionic-runtime/**'
- 'tools/gamescope/patches/0117-wsi-cache-present-bypass-check.patch'
- 'tools/gamescope/patches/0119-wsi-default-images-under-limiter.patch'
- 'app/src/main/cpp/fakeinput_steam.cpp'
- 'tools/gpuload/**'
- '.github/workflows/build-bionic-runtime.yml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Host tools
run: |
set -euo pipefail
sudo apt-get update -qq
sudo apt-get install -y -qq --no-install-recommends libwayland-bin libwayland-dev libx11-dev libx11-xcb-dev \
libxcb1-dev libxcb-composite0-dev libglm-dev zstd
- name: llvm-mingw for dd-directcontroller
uses: actions/cache@v4
with:
path: ~/.cache/llvm-mingw-bylaws-20250920
key: llvm-mingw-bylaws-20250920-x86_64
- name: Build
run: |
set -euo pipefail
export NDK="${ANDROID_NDK_LATEST_HOME:-${ANDROID_NDK_HOME:-$ANDROID_NDK_ROOT}}"
export BUILD_NUMBER=${{ github.run_number }}
tools/bionic-runtime/build.sh "$RUNNER_TEMP/bionic-runtime" "$PWD/out"
- uses: actions/upload-artifact@v4
with:
name: droiddeck-bionic-runtime-${{ github.sha }}
path: out/*