mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 20:45:43 +00:00
fix(bionic): DroidDeck's game settings reach bionic games like DroidDeck-Proton's
launch.sh kept only a fixed list of variables, so DroidDeck settings that DroidDeck-Proton games get were dropped: the games' TU_DEBUG (sysmem by default), MESA_NO_ERROR and DXVK_CONFIG (VRAM cap, per-game DXVK options), the Game environment entries, the Wine sync choice and Force SSBS. - proton (guest) lists the names of DroidDeck's game environment for this game (shared entries and the game's own, as droiddeck-game-env applied them) in DROIDDECK_BIONIC_KEEP; launch.sh keeps those names. - launch.sh also keeps TU_DEBUG, MESA_NO_ERROR, DXVK_CONFIG, DXVK_HUD and the sync variables. - Sync: ntsync -> userspace ntsync with esync fallback, esync -> esync, wineserver -> neither, fsync (no futex_waitv on Android) -> ntsync; PROTON_NO_NTSYNC / PROTON_NO_ESYNC / WINEESYNC=0 still turn one off. - Force SSBS (DROIDDECK_FORCE_SSBS, a glibc preload on DroidDeck-Proton) maps to bionic Wine's WINE_FORCE_SSBS. - The log names the sync, SSBS, TU_DEBUG and kept settings.
This commit is contained in:
1 parent
4453a46382
commit
aa76a79b49
2 files changed
+35
-2
No files matched your search
@@ -19,13 +19,17 @@ LOG=$COMPAT/droiddeck-bionic.log
|
||||
exec >> "$LOG" 2>&1
|
||||
echo "$(date +%H:%M:%S) $verb $EXE ($VERSION, uid $(id -u), DISPLAY ${DISPLAY:-unset})"
|
||||
|
||||
# Keep Steam's game identity and DroidDeck's input/display settings; drop the glibc guest's environment.
|
||||
# Keep Steam's game identity, DroidDeck's input/display/driver/sync settings and its game environment (the names
|
||||
# ../proton lists in DROIDDECK_BIONIC_KEEP); drop the rest of the glibc guest's environment.
|
||||
for v in $(env | sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p'); do
|
||||
case " ${DROIDDECK_BIONIC_KEEP:-} " in *" $v "*) continue ;; esac
|
||||
case "$v" in
|
||||
SteamAppId|SteamGameId|SteamOverlayGameId|SteamClientLaunch|SteamEnv|SteamAppUser|SteamUser|STEAM_COMPAT_*) ;;
|
||||
ANDROID_*|BOOTCLASSPATH|DEX2OATBOOTCLASSPATH|SYSTEMSERVERCLASSPATH|EXTERNAL_STORAGE|ASEC_MOUNTPOINT) ;;
|
||||
FAKE_*|SDL_*|BL_WIDTH|BL_HEIGHT|BL_VK_DRIVER|WINEDLLOVERRIDES) ;;
|
||||
DISPLAY|GAMESCOPE_WAYLAND_DISPLAY|FEX_*) ;;
|
||||
TU_DEBUG|MESA_NO_ERROR|DXVK_CONFIG|DXVK_HUD|DROIDDECK_FORCE_SSBS) ;;
|
||||
BL_SYNC|BL_FSYNC_FIRST|BL_SYNC_FALLBACK|PROTON_NO_ESYNC|PROTON_NO_FSYNC|PROTON_NO_NTSYNC|WINEESYNC) ;;
|
||||
*) unset "$v" 2>/dev/null ;;
|
||||
esac
|
||||
done
|
||||
@@ -53,13 +57,26 @@ export XDG_RUNTIME_DIR=$RTD DROIDDECK_WSI_BYPASS_CHECK_MS=100 GAMESCOPE_WSI_FORC
|
||||
# Wine: DXVK/VKD3D over the builtins, X11 inside gamescope (winewayland would pick DroidDeck's compositor),
|
||||
# FEX for x86 code, userspace ntsync (no /dev/ntsync on Android), Valve's Android Steam client library.
|
||||
export WINEDLLOVERRIDES="${WINEDLLOVERRIDES:+$WINEDLLOVERRIDES;}d3d9,d3d10core,d3d11,dxgi,d3d12,d3d12core=n,b;winewayland.drv=d"
|
||||
export HODLL=libwow64fex.dll WINENTSYNC=1 WINEESYNC=1 WINEDEBUG=err+all,fixme-all
|
||||
# Sync as chosen in DroidDeck (Wine sync, per-game PROTON_NO_*): ntsync is userspace ntsync (no /dev/ntsync on
|
||||
# Android) with esync as its fallback; Android has no futex_waitv, so an fsync choice runs ntsync.
|
||||
on() { case "$1" in 1|on|true|yes) return 0 ;; esac; return 1; }
|
||||
NT=1; ES=1
|
||||
[ "${BL_SYNC:-1}" = 0 ] && NT=0
|
||||
[ "${BL_FSYNC_FIRST:-0}" = 1 ] && NT=1
|
||||
[ "${BL_SYNC:-1}" = 0 ] && [ "${BL_SYNC_FALLBACK:-1}" = 0 ] && ES=0
|
||||
on "${PROTON_NO_NTSYNC:-}" && NT=0
|
||||
{ on "${PROTON_NO_ESYNC:-}" || [ "${WINEESYNC:-}" = 0 ]; } && ES=0
|
||||
export WINENTSYNC=$NT WINEESYNC=$ES
|
||||
# DroidDeck's Force SSBS (its glibc libssbs.so preload) is bionic Wine's own WINE_FORCE_SSBS
|
||||
on "${DROIDDECK_FORCE_SSBS:-}" && export WINE_FORCE_SSBS=1
|
||||
export HODLL=libwow64fex.dll WINEDEBUG=err+all,fixme-all
|
||||
# FEX: DroidDeck-Proton's defaults (its share/fex-emu/Config.json: x87 in 64-bit precision, TSO without the vector
|
||||
# and memcpy parts); droiddeck-game-env's per-game choices (FEX_* in the environment, e.g. .NET, Unity) win.
|
||||
export FEX_TSOENABLED=${FEX_TSOENABLED:-1} FEX_VECTORTSOENABLED=${FEX_VECTORTSOENABLED:-0} \
|
||||
FEX_MEMCPYSETTSOENABLED=${FEX_MEMCPYSETTSOENABLED:-0} FEX_HALFBARRIERTSOENABLED=${FEX_HALFBARRIERTSOENABLED:-1} \
|
||||
FEX_X87REDUCEDPRECISION=${FEX_X87REDUCEDPRECISION:-1} FEX_MULTIBLOCK=${FEX_MULTIBLOCK:-1} FEX_MAXINST=${FEX_MAXINST:-500}
|
||||
echo "fex $(env | grep '^FEX_' | sort | tr '\n' ' ')"
|
||||
echo "sync ntsync=$WINENTSYNC esync=$WINEESYNC ssbs=${WINE_FORCE_SSBS:-0} tu_debug=${TU_DEBUG:-} kept=${DROIDDECK_BIONIC_KEEP:-}"
|
||||
export WINESTEAMCLIENTPATH64=$ROOTFS/root/.local/share/Steam/androidarm64/libsteamclient.so
|
||||
export DXVK_LOG_PATH=$COMPAT PULSE_SERVER=unix:$APP/pulseaudio/PS0
|
||||
export ANDROID_SYSVSHM_SERVER=$COMPAT/.no-sysvshm-server # its client faults on an unset name, inside a Wine lock
|
||||
|
||||
@@ -35,6 +35,22 @@ case "$verb" in
|
||||
[ $# -gt 0 ] || exit 0
|
||||
exe=$(real "$1"); shift
|
||||
export DROIDDECK_BIONIC_ROOT="$DDNATV_ROOT"
|
||||
# DroidDeck's game environment (shared entries and this game's), already applied by droiddeck-game-env: the
|
||||
# names launch.sh keeps when it drops the rest of the guest environment.
|
||||
DROIDDECK_BIONIC_KEEP=$(python3 - "${STEAM_COMPAT_DATA_PATH:-}" 2>/dev/null <<'PY'
|
||||
import json, os, re, sys
|
||||
try:
|
||||
config = json.load(open(os.path.expanduser("~/.config/droiddeck/game-environment.json"), encoding="utf-8"))
|
||||
except (OSError, ValueError):
|
||||
sys.exit(0)
|
||||
scope = os.path.basename(sys.argv[1].rstrip("/"))
|
||||
names = set((config.get("shared") or {}).keys())
|
||||
if re.fullmatch(r"[1-9][0-9]{0,9}", scope):
|
||||
names |= set(((config.get("games") or {}).get(scope) or {}).keys())
|
||||
print(" ".join(sorted(n for n in names if re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", n) and n in os.environ)))
|
||||
PY
|
||||
)
|
||||
export DROIDDECK_BIONIC_KEEP
|
||||
exec /system/bin/sh "$tool/bionic/launch.sh" "$verb" "$compat" "$exe" "$@" ;;
|
||||
getcompatpath)
|
||||
p=$(real "${1:-}")
|
||||
|
||||
Reference in new issue
Block a user