mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
feat(bionic): DroidDeck-Bionic compatibility tool (Wine on Android's libc, no proot)
DroidDeck-Bionic is a Steam compatibility tool that runs the game itself with Android's own libc (bionic) instead of glibc inside proot. Steam, the stores and the session stay on DroidDeck's Linux side unchanged; only the game process leaves proot. It is listed in the Proton list only when "Run without proot" is on, and it is shipped as a pre-release runtime pack (DroidDeck-Bionic-12.8-rNN on Droid-Deck/DroidDeck-Proton), never as the default for other users. Runtime pack (tools/bionic-runtime, .github/workflows/build-bionic-runtime.yml) - CI builds an aarch64 bionic pack: the Wine layer from The412Banner/proton-wine (bionic build), an exec shim, launcher (tool/launch.sh + proton verbs run, runinprefix, waitforexitandrun), gamescope's WSI layer (patches 0117 + 0119), DroidDeck's GPU-load layer, fake input (fakeinput_steam.cpp), GStreamer plugins, Zink/Fast OpenGL Mesa, DXVK, VKD3D-Proton, D7VK and FEX (ARM64EC). - Games run on gamescope's X server; Steam store games reach DroidDeck's Steam (lsteamclient), Steam Input works (shared /dev/shm via libsteamshm), and Steam Cloud maps Windows save folders (tool name contains "Proton"). - DroidDeck's game settings, game-environment fixes, in-game layers and DXVK / VKD3D / FEX choices reach bionic games the same way they reach DroidDeck-Proton games (DD_* setting names). - Prefixes stay compatible both ways with DroidDeck-Proton: dead links are removed, the tool's .NET stubs and comctl32 v6 survive Wine updates, a stale FEX code cache from another FEX build is cleared, drive Z: is the whole device. - Store launches: Xbox (Windows exe path + Xbox runtime environment), GOG and Epic (.bat launchers, games that rename their process). App changes (all additive) - ProtonExtras / ProtonMenu / ExperimentalProtons / droiddeck-proton-extra: DroidDeck-Bionic pre-releases are checked and listed only with Run without proot on, in their own row (not under Experimental); updates replace the older build and carry the default tool and per-game picks over; deleting a tool removes links inside it, never what they point to. - ProtonDefault: a default or game pick left on an older bionic build moves to the installed one; bionic picks start on DroidDeck-Proton when Run without proot is off. - ComponentsManager / ComponentUpdates / ComponentUpdater / ComponentsPage / SessionOverlay: FEX components for DroidDeck-Bionic (bionic-stable on DroidDeck-Components); each tool is offered only FEX builds that fit it. - SessionService: DROIDDECK_DISPLAY_DRIVER tells bionic games which Turnip the display uses when the chosen runtime driver has no Android build. - steam-compatibility: with proot on, a launch sent to a DroidDeck-Bionic tool goes to the newest DroidDeck-Proton (picks stay as set); glibc FEX rows are never applied to a DroidDeck-Bionic tool. - droiddeck-game-env: Steam's install-script evaluator is skipped when its scripts only run processes already marked as done. Tests - New: ComponentsBionicFexTest; extended ComponentsRepublishTest, ExperimentalProtonsTest, ProtonDefaultTest, ProtonExtrasTest, test_game_environment.py, test_proton_extra.py. Device testing (Pocket FIT, Adreno 750; Pocket FIT Elite, Adreno 830) - Steam (Brawlhalla online, Left 4 Dead 2 controller, Black Ops II, Steam Cloud), Xbox, GOG, Epic and Amazon games run; saves carry both ways between DroidDeck-Bionic and DroidDeck-Proton on Xbox, GOG, Epic and Amazon. - Not tested: EA, Ubisoft, Battle.net (no owned game / not signed in).
This commit is contained in:
1 parent
6ef8e2274e
commit
dca443e3aa
40 files changed
+2829
-68
No files matched your search
@@ -861,18 +861,49 @@ def scripts_digest(scripts):
|
||||
return digest.hexdigest()
|
||||
|
||||
|
||||
def only_guarded_runs(items):
|
||||
# True when every action in the scripts is a "run process" entry. With all their hasrunkeys set, Steam's
|
||||
# evaluator would run nothing, so the scripts need no run even when Steam has rewritten the file (its
|
||||
# SteamID, language, install path or order change between launches).
|
||||
found = False
|
||||
for _, entries in items:
|
||||
if not isinstance(entries, list):
|
||||
return False
|
||||
for _, entry in entries:
|
||||
if not isinstance(entry, list):
|
||||
return False
|
||||
for _, block in entry:
|
||||
if not isinstance(block, list):
|
||||
continue
|
||||
for section, actions in block:
|
||||
if section.lower() != "run process" or not isinstance(actions, list):
|
||||
return False
|
||||
for _, action in actions:
|
||||
if not isinstance(action, list) or not any(
|
||||
isinstance(v, str) and re.fullmatch(r"process [0-9]+", n.lower()) for n, v in action):
|
||||
return False
|
||||
found = True
|
||||
return found
|
||||
|
||||
|
||||
def install_scripts_done(scripts, env):
|
||||
prefix = Path(env.get("STEAM_COMPAT_DATA_PATH", "/nonexistent")) / "pfx"
|
||||
try:
|
||||
if (prefix / INSTALL_STAMP).read_text().strip() != scripts_digest(scripts):
|
||||
return False
|
||||
keys = set()
|
||||
keys, parsed = set(), []
|
||||
for path in scripts:
|
||||
keys |= run_keys(read_vdf(Path(path).read_text(encoding="utf-8", errors="replace")))
|
||||
parsed.append(read_vdf(Path(path).read_text(encoding="utf-8", errors="replace")))
|
||||
keys |= run_keys(parsed[-1])
|
||||
values = registry_values(prefix / "system.reg")
|
||||
except (OSError, ValueError):
|
||||
return False
|
||||
return bool(keys) and all(has_run(key, value, values) for key, value in keys)
|
||||
if not keys or not all(has_run(key, value, values) for key, value in keys):
|
||||
return False
|
||||
try:
|
||||
if (prefix / INSTALL_STAMP).read_text().strip() == scripts_digest(scripts):
|
||||
return True
|
||||
except OSError:
|
||||
pass
|
||||
return all(only_guarded_runs(items) for items in parsed)
|
||||
|
||||
|
||||
def record_install_scripts(digest, env):
|
||||
|
||||
@@ -13,8 +13,10 @@ RELEASES = "https://api.github.com/repos/%s/releases"
|
||||
SOURCES = {
|
||||
"ge": ("GloriousEggroll/proton-ge-custom", re.compile(r"aarch64\.tar\.(gz|xz)$")),
|
||||
"cachyos": ("CachyOS/proton-cachyos", re.compile(r"arm64\.tar\.(gz|xz)$")),
|
||||
"droiddeck": ("Droid-Deck/DroidDeck-Proton", re.compile(r"aarch64\.tar\.(gz|xz)$")),
|
||||
"droiddeck": ("Droid-Deck/DroidDeck-Proton", re.compile(r"^DroidDeck-Proton-.*aarch64\.tar\.(gz|xz)$")),
|
||||
"bionic": ("Droid-Deck/DroidDeck-Proton", re.compile(r"^DroidDeck-Bionic-.*aarch64\.tar\.(gz|xz)$")),
|
||||
}
|
||||
PRERELEASES = {"bionic"}
|
||||
USER_AGENT = "droiddeck-proton-extra"
|
||||
NEED_BYTES = 4 * 1024 * 1024 * 1024
|
||||
|
||||
@@ -33,7 +35,7 @@ def fetch_json(url):
|
||||
def pick_asset(source):
|
||||
repo, pattern = SOURCES[source]
|
||||
for release in fetch_json(RELEASES % repo + "?per_page=15"):
|
||||
if release.get("draft") or release.get("prerelease"):
|
||||
if release.get("draft") or (release.get("prerelease") and source not in PRERELEASES):
|
||||
continue
|
||||
assets = {a["name"]: a["browser_download_url"] for a in release.get("assets", ())}
|
||||
for name in sorted(assets):
|
||||
|
||||
@@ -187,6 +187,9 @@ dd_components() {
|
||||
# The selected system PowerVR runtime supplies DXVK at launch. Keep saved selections
|
||||
# for a later manual-driver session without rewriting this Proton's bundled files now.
|
||||
[ "$comp" = dxvk ] && [ -n "${DROIDDECK_POWERVR_RUNTIME:-}" ] && continue
|
||||
# DroidDeck-Bionic loads only Android-built FEX unix libraries: -bionic packages or its own saved copy.
|
||||
# A row without such a source (a glibc package, or a removal) is skipped and the tool keeps its FEX files.
|
||||
if [ "$comp" = fex ] && [[ "$cm_tool" == DroidDeck-Bionic* ]] && [[ "${src,,}" != *bionic* ]]; then continue; fi
|
||||
cm_rows+=("$comp"$'\\t'"$rel"$'\\t'"$sum"$'\\t'"$src")
|
||||
[ "$src" != "-" ] && [ -f "$base/$rel" ] && cm_files+=("$base/$rel")
|
||||
done <<< "$cm_selected"
|
||||
@@ -290,6 +293,21 @@ dd_vacdiag() {
|
||||
}
|
||||
"""
|
||||
|
||||
# DroidDeck-Bionic runs only without proot. With proot on, a launch Steam sends to a DroidDeck-Bionic tool goes to the
|
||||
# newest DroidDeck-Proton's wrapper before anything else runs, as if that Proton had been picked; the picks stay as set.
|
||||
DD_BIONIC_PROOT_FALLBACK = """
|
||||
if [ -f "$here/bionic/launch.sh" ] && [ -z "${DDNATV_ROOT:-}" ]; then
|
||||
dd_fallback=$(cd "$here/.." 2>/dev/null && for d in DroidDeck-Proton*; do
|
||||
[ -x "$d/droiddeck-proton-wrap" ] && [ ! -e "$d/bionic/launch.sh" ] || continue
|
||||
v=${d#DroidDeck-Proton}; printf '%s\\t%s/%s\\n' "${v#[ -]}" "$PWD" "$d"
|
||||
done | sort -V | tail -n 1 | cut -f 2-)
|
||||
if [ -n "$dd_fallback" ]; then
|
||||
echo "droiddeck-proton: DroidDeck-Bionic needs Run without proot; this launch uses ${dd_fallback##*/}" >&2
|
||||
exec "$dd_fallback/droiddeck-proton-wrap" "$verb" "$@"
|
||||
fi
|
||||
fi
|
||||
"""
|
||||
|
||||
DD_DRIVER_QUERY_SKIP = """
|
||||
case "$verb:${1##*/}:${STEAM_COMPAT_DATA_PATH%/}" in
|
||||
run:d3ddriverquery64.exe:*/compatdata/0 | run:d3ddriverquery.exe:*/compatdata/0)
|
||||
@@ -487,7 +505,7 @@ dd_run ${DD_TASKSET:-} /usr/local/bin/droiddeck-game-env "$DD_STORE_PROTON" "$ve
|
||||
def extra_wrapper_sh(entry_point):
|
||||
return (EXTRA_WRAPPER_SH % entry_point).replace(
|
||||
'here=$(dirname "$0")',
|
||||
'here=$(dirname "$0")\n' + DD_DRIVER_QUERY_SKIP + DD_DESKTOP_GPU_SETUP + DD_DIRECTAUDIO_SETUP + DD_GAME_CPUS_SETUP
|
||||
'here=$(dirname "$0")\n' + DD_BIONIC_PROOT_FALLBACK + DD_DRIVER_QUERY_SKIP + DD_DESKTOP_GPU_SETUP + DD_DIRECTAUDIO_SETUP + DD_GAME_CPUS_SETUP
|
||||
+ DD_IDTECH3_SETUP + DD_VACDIAG_SETUP + DD_COMPONENTS_SETUP + DD_LIBPATH_SETUP + DD_STORE_SETUP, 1)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user