fix(bionic): put the game's logs where Share logs finds them

Shared session logs never held DroidDeck-Bionic's own log or its
graphics logs. launch.sh wrote them into the game's prefix, which Share
logs does not read, and dropped the log locations Detailed graphics logs
sets along with the rest of the guest environment.

- proton: names a game launch's folder in the session folder (the
  game's log folder when Detailed graphics logs made one, else
  games/<date>-bionic-<appid>) and passes the graphics log locations as
  Android paths.
- launch.sh: writes the game's log into that folder; the prefix's
  droiddeck-bionic.log points to it, since Share logs takes only files
  with one name. Keeps DXVK_LOG_PATH, VKD3D_LOG_FILE and MESA_LOG_FILE.
- EnhancedSessionLogShare: keeps the name droiddeck-bionic.log and
  files it with the games.
This commit is contained in:
The412Banner committed 2026-11-23 01:32:33 +00:00
1 parent f17d3ddaad
commit 49381484dd
5 files changed
+127 -6

No files matched your search

+9 -1
View File
@@ -12,10 +12,17 @@ ROOTFS=${DROIDDECK_BIONIC_ROOT:?started without DROIDDECK_BIONIC_ROOT}
APP=${ROOTFS%/linuxfs}
LINKER=/system/bin/linker64
VERSION=$(awk '{print $2}' "$TOOL/version" 2>/dev/null)
LOGS=${DROIDDECK_BIONIC_LOGS:-}
mkdir -p "$COMPAT"
LOG=$COMPAT/droiddeck-bionic.log
[ "$verb" = runinprefix ] || { [ -f "$LOG" ] && mv -f "$LOG" "$LOG.1"; }
# A game's log is written into DroidDeck's session folder (../proton names it), which Share logs takes only as a
# file with one name; the usual name here points to it, and dangles once that session's folder is removed.
[ -L "$LOG" ] && [ ! -e "$LOG" ] && rm -f "$LOG"
if [ -n "$LOGS" ] && [ ! -e "$LOG" ] && mkdir -p "$LOGS" 2>/dev/null && : >> "$LOGS/droiddeck-bionic.log" 2>/dev/null; then
ln -s "$LOGS/droiddeck-bionic.log" "$LOG" 2>/dev/null
fi
exec >> "$LOG" 2>&1
echo "$(date +%H:%M:%S) $verb $EXE ($VERSION, uid $(id -u), DISPLAY ${DISPLAY:-unset})"
@@ -36,6 +43,7 @@ for v in $(env | sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p'); do
XODUS_*|RUST_LOG) ;;
WINE_OFFSCREEN_CHECK_MS|WINE_CPU_TOPOLOGY|WINE_LARGE_ADDRESS_AWARE|WINESTEAMNOEXEC|TZ) ;;
DXVK_LOG_LEVEL|DXVK_HDR|VKD3D_DEBUG|VKD3D_SHADER_DEBUG) ;;
DXVK_LOG_PATH|VKD3D_LOG_FILE|MESA_LOG_FILE) ;;
DROIDDECK_GPU_LOAD|DROIDDECK_GPU_LOAD_DIR|DROIDDECK_VRAM_CAP|DROIDDECK_VRAM_CAP_MB|DROIDDECK_DISPLAY_DRIVER) ;;
DROIDDECK_GUEST_ROOT) ;;
VKD3D_FEATURE_LEVEL|VKD3D_SHADER_MODEL|vk_x11_strict_image_count) ;;
@@ -119,7 +127,7 @@ export WINE_LSTEAMCLIENT=${WINE_LSTEAMCLIENT:-1}
# points the Android library's shared memory there (it keeps its own in-process otherwise) and gives it the
# sem_open Android lacks (without it the game hangs once that data arrives).
export DROIDDECK_BIONIC_SHM_DIR=${APP%/files}/no_backup/guest-runtime/shm
export DXVK_LOG_PATH=$COMPAT PULSE_SERVER=unix:$APP/pulseaudio/PS0
export DXVK_LOG_PATH=${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
# The pack's imagefs libraries carry Winlator's prefix for plugins and X11 data. No FONTCONFIG_*: with the
+17
View File
@@ -36,6 +36,18 @@ zpath() {
esac
}
# Where a game launch's log goes in DroidDeck's session folder (Share logs takes that folder): the game's log folder
# when Detailed graphics logs made one (droiddeck-game-env), else a folder of its own; nothing for other verbs
session_logs() {
[ "$verb" = waitforexitandrun ] && [ -n "${DD_DEBUG_DIR:-}" ] || return 0
if [ -n "${PROTON_LOG_DIR:-}" ]; then
real "$PROTON_LOG_DIR"
else
local id=${SteamAppId:-0}
printf '%s/games/%s-bionic-%s\n' "$(real "${DD_DEBUG_DIR%/}")" "$(date +%Y-%m-%d-%H%M%S)" "${id//[^0-9]/}"
fi
}
here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
tool=$(real "$here")
compat=$(real "${STEAM_COMPAT_DATA_PATH:-$HOME/.local/share/Steam/steamapps/compatdata/0}")
@@ -76,6 +88,11 @@ case "$verb" in
done
# The HUD's GPU-load folder is a guest path; the bionic game writes to it by its Android path.
[ -n "${DROIDDECK_GPU_LOAD_DIR:-}" ] && { DROIDDECK_GPU_LOAD_DIR=$(real "$DROIDDECK_GPU_LOAD_DIR"); export DROIDDECK_GPU_LOAD_DIR; }
# So are the graphics log locations Detailed graphics logs or game debugging set for this launch.
for v in DXVK_LOG_PATH VKD3D_LOG_FILE MESA_LOG_FILE; do
[ -n "${!v:-}" ] && { printf -v "$v" '%s' "$(real "${!v}")"; export "${v?}"; }
done
DROIDDECK_BIONIC_LOGS=$(session_logs); export DROIDDECK_BIONIC_LOGS
# 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'