mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 15:56:01 +00:00
Merge commit 'e1a7d527fd412b6bd78833e01fe80f515e324971' into merge/main-into-non-adreno-all
# Conflicts: # .github/workflows/build.yml # app/build.gradle # app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt # app/src/main/java/com/droiddeck/launcher/gpu/DriverPairs.kt # app/src/main/java/com/droiddeck/launcher/gpu/GpuInfo.kt # app/src/main/java/com/droiddeck/launcher/gpu/TurnipDriver.java # app/src/main/java/com/droiddeck/launcher/gpu/TurnipReleases.kt # app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntime.java # app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt # app/src/main/java/com/droiddeck/launcher/session/SessionService.kt # app/src/main/res/values/strings.xml # app/src/test/java/com/droiddeck/launcher/ui/ComponentsPageProfileTest.kt # tools/build_local.sh # tools/gamescope/PATCHES.md # tools/gamescope/release.env # tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env # tools/linuxfs/preload/netif.c # tools/linuxfs/preload/opens.c # tools/release/runtime_inputs.py
This commit is contained in:
commit
e7b523d653
574 files changed
+41749
-2616
No files matched your search
@@ -13,7 +13,12 @@ fi
|
||||
export HOME=${HOME:-/root}
|
||||
mode=${1:-desktop}
|
||||
shift || true
|
||||
step() { echo "== STEP $(date -u +%H:%M:%S) $*"; }
|
||||
step() { echo "== STEP $(date -u +%H:%M:%S.%3N) $*"; }
|
||||
steam_setup_failed() {
|
||||
echo "== steam: the Steam client could not be set up (status $1)"
|
||||
[ -z "${BL_STEAM_EXIT_FILE:-}" ] || printf '%s\n' "$1" > "$BL_STEAM_EXIT_FILE"
|
||||
exit "$1"
|
||||
}
|
||||
if [ -n "${BL_LOG:-}" ] && [ -z "${BL_INSIDE:-}" ]; then
|
||||
mkdir -p "$(dirname "$BL_LOG")" 2>/dev/null
|
||||
if [ "$(stat -c %s "$BL_LOG" 2>/dev/null || echo 0)" -gt 8388608 ]; then
|
||||
@@ -308,6 +313,8 @@ export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
|
||||
mkdir -p "$XDG_DATA_HOME" "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME"
|
||||
rm -f "${XDG_RUNTIME_DIR:-/run/droiddeck}/droiddeck-steamvr/active"
|
||||
rm -f "${XDG_RUNTIME_DIR:-/run/droiddeck}/droiddeck-remote-play"
|
||||
/usr/local/bin/droiddeck-steamvr unregister >/dev/null 2>&1 || true
|
||||
if [ "$mode" = lxqt ] || [ "$mode" = desktop ]; then
|
||||
/usr/local/bin/droiddeck-desktop-bookmarks || true
|
||||
fi
|
||||
@@ -430,8 +437,15 @@ if [ -z "${BL_INSIDE:-}" ]; then
|
||||
fi
|
||||
export BL_INSIDE=1
|
||||
if [ "$mode" = steam ]; then
|
||||
if /usr/local/bin/droiddeck-pipewire start; then
|
||||
eval "$(/usr/local/bin/droiddeck-pipewire env)"
|
||||
else
|
||||
echo "== pipewire: not running; Remote Play and game recording have no picture"
|
||||
fi
|
||||
run_gamescope "${args[@]}" -- "$0" "$mode" "$@"
|
||||
exit $?
|
||||
_bl_status=$?
|
||||
/usr/local/bin/droiddeck-pipewire stop
|
||||
exit $_bl_status
|
||||
fi
|
||||
exec gamescope "${args[@]}" -- "$0" "$mode" "$@"
|
||||
fi
|
||||
@@ -487,6 +501,9 @@ case $mode in
|
||||
taskset -cp "$cores" $$ >/dev/null 2>&1 || true
|
||||
fi
|
||||
python3 /usr/local/bin/droiddeck-pad-defaults 2>&1 || true
|
||||
if [ -n "${GAMESCOPE_WAYLAND_DISPLAY:-}" ]; then
|
||||
export WAYLAND_DISPLAY= XDG_SESSION_TYPE=x11
|
||||
fi
|
||||
run_program() {
|
||||
local rc=0 child sig forwarded=0
|
||||
{ trap - INT QUIT; exec "$@"; } <&0 &
|
||||
@@ -515,6 +532,10 @@ case $mode in
|
||||
*.appimage)
|
||||
export APPIMAGE_EXTRACT_AND_RUN=1
|
||||
chmod +x "$target" 2>/dev/null
|
||||
if [ ${#fex[@]} -eq 0 ] && [ -x /usr/local/lib/droiddeck/uruntime ]; then
|
||||
export TARGET_APPIMAGE=$target
|
||||
run_program /usr/local/lib/droiddeck/uruntime "$@"
|
||||
fi
|
||||
run_program "${fex[@]}" "$target" "$@"
|
||||
;;
|
||||
*.sh)
|
||||
@@ -530,6 +551,12 @@ case $mode in
|
||||
esac
|
||||
;;
|
||||
steam)
|
||||
if [ -n "${GAMESCOPE_WAYLAND_DISPLAY:-}" ]; then
|
||||
export WAYLAND_DISPLAY= XDG_SESSION_TYPE=x11
|
||||
fi
|
||||
export MOZ_DISABLE_CONTENT_SANDBOX=1 MOZ_DISABLE_GMP_SANDBOX=1 MOZ_DISABLE_RDD_SANDBOX=1
|
||||
export MOZ_DISABLE_SOCKET_PROCESS_SANDBOX=1 MOZ_DISABLE_UTILITY_SANDBOX=1
|
||||
export MOZ_SHM_NO_SEALS=1
|
||||
steam_x64=0
|
||||
[ "${BL_STEAM_CLIENT_ARCH:-}" = x86_64 ] && steam_x64=1
|
||||
steam_cef_gpu=1
|
||||
@@ -538,10 +565,10 @@ case $mode in
|
||||
# droiddeck-steam-install removes the repair request: read it first so Repair Steam covers both clients.
|
||||
_bl_x64_repair=0
|
||||
[ -e "$HOME/.bl-steam-repair" ] && _bl_x64_repair=1
|
||||
droiddeck-steam-install || exit $?
|
||||
droiddeck-steam-install || steam_setup_failed $?
|
||||
droiddeck-steam-install --sync steamdeck_publicbeta || step "could not update the arm64 client's parts; the x86-64 client keeps its own web helper"
|
||||
step "checking the x86-64 Steam client (FEX, experimental; the first run downloads ~2 GB)"
|
||||
BL_X64_REPAIR=$_bl_x64_repair droiddeck-steam-x64 --prepare || exit $?
|
||||
BL_X64_REPAIR=$_bl_x64_repair droiddeck-steam-x64 --prepare || steam_setup_failed $?
|
||||
step "x86-64 Steam client ready"
|
||||
steam_root=${BL_X64_HOME:-$HOME/.droiddeck-x64}/.local/share/Steam
|
||||
steam_client=(droiddeck-steam-x64 --exec)
|
||||
@@ -551,7 +578,7 @@ case $mode in
|
||||
fi
|
||||
else
|
||||
step "checking the Steam client (first run downloads it, ~1-2 min with nothing on screen)"
|
||||
droiddeck-steam-install || exit $?
|
||||
droiddeck-steam-install || steam_setup_failed $?
|
||||
step "Steam client ready"
|
||||
steam_root=$XDG_DATA_HOME/Steam
|
||||
if [ -f "${BL_X64_HOME:-$HOME/.droiddeck-x64}/.local/share/Steam/local.vdf" ]; then
|
||||
@@ -778,41 +805,44 @@ case $mode in
|
||||
done < <(xprop -spy -root "${atoms[@]}" 2>/dev/null)
|
||||
) &
|
||||
steam_hold_launch() {
|
||||
_bl_launch_ready=
|
||||
local game=$1 shortcut= waited=0 status=0
|
||||
_bl_focused() { xprop -root GAMESCOPE_FOCUSED_APP 2>/dev/null | sed -n 's/.*= *//p'; }
|
||||
_bl_starting() { pgrep -f "reaper SteamLaunch AppId=$(((game >> 32) & 0xffffffff))( |$)" >/dev/null 2>&1; }
|
||||
_bl_hand_off() {
|
||||
printf '%s\n' "$game" > "$BL_LAUNCH_DIR/steam-game.tmp" && mv -f "$BL_LAUNCH_DIR/steam-game.tmp" "$BL_LAUNCH_DIR/steam-game"
|
||||
}
|
||||
_bl_end=$((SECONDS + 120))
|
||||
until [ "$(xprop -root GAMESCOPE_FOCUSED_APP 2>/dev/null | sed -n 's/.*= *//p')" = 769 ] || [ "$SECONDS" -ge "$_bl_end" ]; do
|
||||
until [ "$(_bl_focused)" = 769 ] || [ "$SECONDS" -ge "$_bl_end" ]; do
|
||||
sleep 1
|
||||
done
|
||||
# With a large library the overview can stay missing for 30+ minutes while Steam already takes the launch URL.
|
||||
_bl_overview_status=1
|
||||
_bl_overview_tries=0
|
||||
while [ "$_bl_overview_tries" -lt 2 ]; do
|
||||
if /usr/local/bin/droiddeck-agent --wait-steam-shortcut-overview "$1" 45; then
|
||||
_bl_overview_status=0
|
||||
else
|
||||
_bl_overview_status=$?
|
||||
fi
|
||||
if [ "$_bl_overview_status" -ne 1 ]; then
|
||||
break
|
||||
fi
|
||||
_bl_overview_tries=$((_bl_overview_tries + 1))
|
||||
echo "== steam: shortcut overview not ready yet (attempt $_bl_overview_tries of 2)"
|
||||
sleep 2
|
||||
# Shortcut CGameIDs are 64-bit; Steam app ids fit in 32 bits and keep the old short delay.
|
||||
[ "${#game}" -gt 10 ] && shortcut=1
|
||||
[ -n "$shortcut" ] || sleep 4
|
||||
echo "== steam: interface up; launching the requested game $game"
|
||||
_bl_hand_off
|
||||
[ -n "$shortcut" ] || return 0
|
||||
# Steam can drop a shortcut launch it gets before the shortcut's overview exists (large libraries).
|
||||
# A launch can be running before it creates its first window.
|
||||
while [ "$(_bl_focused)" = 769 ] && [ "$waited" -lt 20 ]; do
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
if [ "$_bl_overview_status" -eq 0 ]; then
|
||||
echo "== steam: shortcut overview ready; launching the requested game $1"
|
||||
_bl_launch_ready=1
|
||||
elif [ "$_bl_overview_status" -eq 3 ]; then
|
||||
echo "== steam: not a shortcut CGameID; keeping the existing launch path"
|
||||
sleep 4
|
||||
_bl_launch_ready=1
|
||||
else
|
||||
echo "== steam: shortcut overview not ready after about 90 s; launching the requested game anyway $1"
|
||||
_bl_launch_ready=1
|
||||
[ "$(_bl_focused)" = 769 ] || return 0
|
||||
if _bl_starting; then
|
||||
echo "== steam: the requested game is already starting; not launching again"
|
||||
return 0
|
||||
fi
|
||||
if [ "$_bl_launch_ready" = 1 ]; then
|
||||
echo "== steam: interface up; launching the requested game $1"
|
||||
printf '%s\n' "$1" > "$BL_LAUNCH_DIR/steam-game.tmp" && mv -f "$BL_LAUNCH_DIR/steam-game.tmp" "$BL_LAUNCH_DIR/steam-game"
|
||||
echo "== steam: the game is not in front after about 20 s; waiting for the shortcut overview"
|
||||
/usr/local/bin/droiddeck-agent --wait-steam-shortcut-overview "$game" 45 || status=$?
|
||||
if [ "$status" -eq 3 ]; then
|
||||
echo "== steam: not a shortcut CGameID; not launching again"
|
||||
elif _bl_starting; then
|
||||
echo "== steam: the requested game started while waiting; not launching again"
|
||||
elif [ "$(_bl_focused)" = 769 ]; then
|
||||
echo "== steam: launching the requested game again $game (overview status $status)"
|
||||
_bl_hand_off
|
||||
else
|
||||
echo "== steam: the game took focus while waiting; not launching again"
|
||||
fi
|
||||
}
|
||||
if [ -n "${BL_LAUNCH_DIR:-}" ] && [ -z "${BL_DESKTOP:-}" ]; then
|
||||
|
||||
Reference in new issue
Block a user