mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 06:15:58 +00:00
Deck mode made safe, a client-branch choice, and a battery the client can see
Deck mode passes -steamdeck alone: -steamos3 opted the install into the steamdeck_stable branch and started the restart loop Bannerlator hit on device (38996ea1). The SteamOS helpers the client calls in that mode - the two Armada found it needs under steamos-polkit-helpers and the three under /usr/bin - are staged from the apk as no-op stubs. The client branch on disk is kept in step with the one forced on the command line, and an update that cannot install stops the session after three restarts instead of looping for ever. The Steam cog gets a Client branch row: public beta (every session so far) or Steam Deck public beta, the channel Armada bootstraps from. The client reads /sys/class/power_supply/BAT<n>/; Android's supply is called battery and laid out differently, so the Quick Access Menu had no battery. BatteryComponent writes BAT0 and BAT1 from Android's battery API every five seconds - status, percentage, charge, energy, power and time to empty - into a directory bound over /sys/class/power_supply.
This commit is contained in:
1 parent
a4e59986a8
commit
2fb79735c3
14 files changed
+238
-10
No files matched your search
@@ -323,24 +323,49 @@ BUSCONF
|
||||
# desktop's launchers ask for; gamescope shows one window at a time and the game takes over.
|
||||
_bl_ui=(-gamepadui)
|
||||
[ "${BL_STEAM_UI:-}" = desktop ] && _bl_ui=()
|
||||
# SteamOS runs its own session as `steam -gamepadui -steamos3 -steamdeck`, which is the shape
|
||||
# Valve tunes Big Picture for. BL_STEAMDECK=1 (the Performance page) tries it. Off by default:
|
||||
# it also makes the client expect Deck hardware (battery, TDP controls, a Deck input device)
|
||||
# that is not here, and that cost is untested.
|
||||
# Deck mode (BL_STEAMDECK=1, the Performance page): -steamdeck is the flag that puts the Quick
|
||||
# Access Menu, the performance overlay and the Deck settings pages on screen. Only -steamdeck,
|
||||
# never -steamos3: that one makes the client manage itself as SteamOS does - it calls
|
||||
# steamos-select-branch and opts the install into the steamdeck_stable client branch, writes
|
||||
# that to package/beta, and from then on the branch on disk loses to the -clientbeta below on
|
||||
# every launch; the updater finds "installed version 0", marks an update pending and exits 42
|
||||
# to apply it, which never happens, so the client restarts for ever - under a running game,
|
||||
# taking Steam Input with it each time. (Bannerlator 38996ea1, on device.) The SteamOS helpers
|
||||
# the client calls in this mode are staged as no-op stubs under /usr/bin.
|
||||
if [ "${BL_STEAMDECK:-0}" = 1 ] && [ "${BL_STEAM_UI:-}" != desktop ]; then
|
||||
_bl_ui+=(-steamdeck -steamos3)
|
||||
echo "== steam: Deck mode on (-steamdeck -steamos3)"
|
||||
_bl_ui+=(-steamdeck)
|
||||
echo "== steam: Deck mode on (-steamdeck)"
|
||||
fi
|
||||
echo "== steam args: ${_bl_ui[*]} -clientbeta publicbeta -no-cef-sandbox -cef-force-gpu -cef-ozone-platform=x11 -cef-use-gl=angle -cef-use-angle=vulkan $*"
|
||||
# The client branch. publicbeta is what every session has run on; steamdeck_publicbeta is the
|
||||
# channel Armada bootstraps its ARM64 client from. Whatever wrote package/beta, the branch on
|
||||
# disk has to agree with the one forced here - a disagreement is the restart loop above, and
|
||||
# it is silent apart from rc=42 in this log.
|
||||
steam_channel=${BL_STEAM_CHANNEL:-publicbeta}
|
||||
steam_beta=$steam_root/package/beta
|
||||
if [ -f "$steam_beta" ] && [ "$(cat "$steam_beta" 2>/dev/null)" != "$steam_channel" ]; then
|
||||
echo "== steam: client branch on disk was '$(cat "$steam_beta" 2>/dev/null)', set to '$steam_channel' to match -clientbeta"
|
||||
echo "$steam_channel" > "$steam_beta"
|
||||
fi
|
||||
echo "== steam args: ${_bl_ui[*]} -clientbeta $steam_channel -no-cef-sandbox -cef-force-gpu -cef-ozone-platform=x11 -cef-use-gl=angle -cef-use-angle=vulkan $*"
|
||||
# An update that cannot install asks for a restart (rc=42) every time; the count is capped so a
|
||||
# session can never again loop in silence, which reads as a menu opening and closing by itself.
|
||||
steam_updates=0
|
||||
while :; do
|
||||
step "starting the Steam client${BL_STEAM_UI:+ ($BL_STEAM_UI UI)}"
|
||||
"$steam_root/steamrtarm64/steam" "${_bl_ui[@]}" -clientbeta publicbeta \
|
||||
"$steam_root/steamrtarm64/steam" "${_bl_ui[@]}" -clientbeta "$steam_channel" \
|
||||
-no-cef-sandbox -cef-force-gpu -cef-ozone-platform=x11 \
|
||||
-cef-use-gl=angle -cef-use-angle=vulkan "$@"
|
||||
rc=$?
|
||||
echo "== steam exited rc=$rc"
|
||||
collect_steam_logs
|
||||
[ "$rc" -eq 42 ] || break
|
||||
steam_updates=$((steam_updates + 1))
|
||||
if [ "$steam_updates" -ge 3 ]; then
|
||||
echo "== steam: asked to restart for an update $steam_updates times and it is not installing; the session stops here rather than loop"
|
||||
break
|
||||
fi
|
||||
# The URL arguments were acted on the first time; a restart must not repeat them.
|
||||
set --
|
||||
done
|
||||
reap_orphans
|
||||
exit "$rc"
|
||||
|
||||
Reference in new issue
Block a user