From d8bde22d8f0d145eeed9bc648519ad7fbbb7b2d4 Mon Sep 17 00:00:00 2001 From: The412Banner <205237651+The412Banner@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:59:20 +0000 Subject: [PATCH] fix(steam): the desktop client keeps the Steam Deck channel instead of updating in a loop --- docs/development/arm64-steam-client.md | 10 ++++- .../overlay/usr/local/bin/droiddeck-session | 9 ++++- tools/tests/test_steam_desktop_launch.py | 17 ++++++++ tools/tests/test_steamrt_shim.py | 40 +++++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) diff --git a/docs/development/arm64-steam-client.md b/docs/development/arm64-steam-client.md index 9fd6ed8177..ea737ce007 100644 --- a/docs/development/arm64-steam-client.md +++ b/docs/development/arm64-steam-client.md @@ -9,7 +9,15 @@ publishes it on the Steam Deck client channels. `droiddeck-steam-install` instal - The default is `steamdeck_publicbeta` (manifest `steam_client_steamdeck_publicbeta_linuxarm64`). Valve also publishes `steam_client_steamdeck_stable_linuxarm64`. - `droiddeck-steam-install --channel` prints the channel in use. The session passes that value as - `-clientbeta` and writes it to `package/beta`. The two must match, or the client loops on rc 42. + `-clientbeta` and writes it to `package/beta` before every start, also when the file is missing. + The two must match, or the client loops on rc 42. +- Valve's client keeps a `steamdeck_*` beta only when it runs as a Steam Deck. Without `-steamdeck` it + clears the beta a few seconds after sign-in ("Client beta changed from 'steamdeck_publicbeta' to ''"), + deletes `package/beta`, downloads the desktop `steam_client_linuxarm64` client and exits with rc 42. + In the stored session logs this happened in 722 desktop UI starts and in none of 27,429 Deck mode + starts. The desktop UI therefore starts the arm64 client with `-steamdeck` too, without `-steamos3` + or `-gamepadui`. Bazzite's Desktop Mode launcher does the same to keep the update branch between + Desktop and Game Mode. - Setting: `DD_STEAM_CHANNEL`, otherwise `~/.config/droiddeck/steam-channel`, set to `beta` or `stable`. A set channel never changes on its own. - With no setting, the client falls back to `steamdeck_stable` automatically. It stays on stable diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-session b/tools/linuxfs/overlay/usr/local/bin/droiddeck-session index cced83f6f6..aa35441199 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-session +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-session @@ -1641,6 +1641,9 @@ case $mode in export STEAM_GAMESCOPE_FANCY_SCALING_SUPPORT=1 echo "== steam: Deck mode on (-steamdeck -steamos3)" fi + elif [ "$steam_x64" = 0 ]; then + _dd_ui+=(-steamdeck) + echo "== steam: desktop UI on the Steam Deck client channel (-steamdeck)" fi export STEAMOS_STEAM_SHUTDOWN_SENTINEL="$HOME/.dd-steam-shutdown" export STEAMOS_STEAM_REBOOT_SENTINEL="$HOME/.dd-steam-reboot" @@ -2033,10 +2036,12 @@ case $mode in fi while :; do rm -f "$HOME/.dd-restart-once" "$HOME/.dd-restart-lost" - 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" + _dd_beta=$(cat "$steam_beta" 2>/dev/null || true) + if [ "$_dd_beta" != "$steam_channel" ] && [ -d "${steam_beta%/*}" ]; then + echo "== steam: client branch on disk was '${_dd_beta:-missing}', set to '$steam_channel' to match -clientbeta" echo "$steam_channel" > "$steam_beta" fi + unset _dd_beta if [ -z "${_dd_counted:-}" ] && [ -z "${DD_DESKTOP:-}" ]; then echo start >> "$steam_root/package/droiddeck-unconfirmed" _dd_counted=1 diff --git a/tools/tests/test_steam_desktop_launch.py b/tools/tests/test_steam_desktop_launch.py index 4d49c9dd47..c71309645d 100644 --- a/tools/tests/test_steam_desktop_launch.py +++ b/tools/tests/test_steam_desktop_launch.py @@ -184,3 +184,20 @@ class DesktopSteamLaunchTest(unittest.TestCase): env=env, text=True) self.assertEqual('-cef-disable-gpu' in result, software) self.assertEqual('-cef-use-angle=vulkan' in result, not software) + + def test_the_arm64_desktop_client_runs_as_a_steam_deck_so_it_keeps_the_deck_channel(self): + source = (BIN / 'droiddeck-session').read_text() + setup = source[source.index(' _dd_ui=(-gamepadui)'):source.index(' export STEAMOS_STEAM_SHUTDOWN_SENTINEL=')] + cases = [ + ('0', '1', 'desktop', ['-nobigpicture', '-steamdeck']), + ('0', '', 'desktop', ['-steamdeck']), + ('0', '1', 'bigpicture', ['-gamepadui', '-steamdeck', '-steamos3']), + ('1', '1', 'desktop', ['-nobigpicture']), + ('1', '1', 'bigpicture', ['-gamepadui', '-steamdeck', '-steamos3']), + ] + for x64, desktop, ui, flags in cases: + with self.subTest(x64=x64, desktop=desktop, ui=ui): + env = dict(self.env, steam_x64=x64, DD_DESKTOP=desktop, DD_STEAM_UI=ui, DD_VKBRIDGE='0') + result = subprocess.check_output(['bash', '-c', setup + '\nprintf "%s\\n" "${_dd_ui[@]}"'], + env=env, text=True) + self.assertEqual(flags, [line for line in result.splitlines() if line.startswith('-')]) diff --git a/tools/tests/test_steamrt_shim.py b/tools/tests/test_steamrt_shim.py index 04f2a7fe06..b6041594fa 100644 --- a/tools/tests/test_steamrt_shim.py +++ b/tools/tests/test_steamrt_shim.py @@ -119,5 +119,45 @@ class SessionChannelTest(unittest.TestCase): self.assertIn('echo "$steam_channel" > "$steam_beta"', SESSION) +class SessionBetaFileTest(unittest.TestCase): + BLOCK = re.search(r'\n( +_dd_beta=\$\(cat "\$steam_beta".*?\n +unset _dd_beta\n)', SESSION, re.S).group(1) + + def run_block(self, package, existing=None): + beta = package / 'beta' + if existing is not None: + package.mkdir(parents=True) + beta.write_text(existing) + env = dict(os.environ, steam_beta=str(beta), steam_channel='steamdeck_publicbeta') + result = subprocess.run(['bash', '-uc', self.BLOCK], env=env, capture_output=True, text=True, timeout=30) + self.assertEqual(0, result.returncode, result.stderr) + return beta, result.stdout + + def test_a_branch_file_the_client_deleted_is_written_again(self): + with tempfile.TemporaryDirectory() as temp: + package = Path(temp) / 'package' + package.mkdir() + beta, out = self.run_block(package) + self.assertEqual('steamdeck_publicbeta\n', beta.read_text()) + self.assertIn("was 'missing', set to 'steamdeck_publicbeta'", out) + + def test_another_branch_is_replaced(self): + with tempfile.TemporaryDirectory() as temp: + beta, out = self.run_block(Path(temp) / 'package', 'steamdeck_stable\n') + self.assertEqual('steamdeck_publicbeta\n', beta.read_text()) + self.assertIn("was 'steamdeck_stable'", out) + + def test_the_selected_branch_is_left_alone(self): + with tempfile.TemporaryDirectory() as temp: + beta, out = self.run_block(Path(temp) / 'package', 'steamdeck_publicbeta\n') + self.assertEqual('steamdeck_publicbeta\n', beta.read_text()) + self.assertEqual('', out) + + def test_nothing_is_created_without_a_client(self): + with tempfile.TemporaryDirectory() as temp: + beta, out = self.run_block(Path(temp) / 'package') + self.assertFalse(beta.parent.exists()) + self.assertEqual('', out) + + if __name__ == '__main__': unittest.main()