mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-26 00:06:02 +00:00
feat(steam): DroidDeck-Proton first, Valve's ARM64 Proton only when needed (#3217)
New Steam setting "Valve Proton only when needed", on by default. While it is on and DroidDeck-Proton has not been removed by the user:
- the app installs DroidDeck-Proton before the client first starts instead of seeding Valve's Proton Experimental (ARM64) (2.09 GB on disk, 398 MB download); a stop request cancels that download
- the session no longer asks the client for appid 4427310 at every start
- the live helper fetches it only once the default or a title is set to a tool built from it ("Proton Experimental ARM64 (Compatible)"), or while no DroidDeck-Proton build is installed
FEX and the Steam Linux Runtimes are still fetched as before. An installed copy of Valve's Proton is kept and updated. Off, or with DroidDeck-Proton declined, everything works as before (DD_VALVE_PROTON=1). Fresh install on a Pocket FIT: 8.28 GB after first Steam start and tool downloads, was 10.4 GB.
This commit is contained in:
1 parent
4df3f775e1
commit
53c1933ac8
14 files changed
+136
-11
No files matched your search
@@ -1169,7 +1169,10 @@ case $mode in
|
||||
"${DD_X64_HOME:-$HOME/.droiddeck-x64}/.local/share/Steam" &&
|
||||
echo "$DD_SHADER_PRECACHE" > "$HOME/.dd-shader-precache-applied" || true
|
||||
fi
|
||||
if [ "$steam_x64" = 0 ] && [ ! -f "$steam_root/steamapps/appmanifest_4427310.acf" ]; then
|
||||
if [ "$steam_x64" = 0 ] && [ ! -f "$steam_root/steamapps/appmanifest_4427310.acf" ] &&
|
||||
! steam-compatibility "$steam_root" --valve-proton-needed; then
|
||||
step "leaving Valve's ARM64 Proton until a title needs it"
|
||||
elif [ "$steam_x64" = 0 ] && [ ! -f "$steam_root/steamapps/appmanifest_4427310.acf" ]; then
|
||||
step "asking the client to fetch the ARM64 Proton"
|
||||
set -- "$@" steam://install/4427310
|
||||
(
|
||||
|
||||
@@ -966,6 +966,7 @@ class Helper:
|
||||
self.fex_asked = set()
|
||||
self.tools_asked = {}
|
||||
self.tools_checked = None
|
||||
self.valve_names = None
|
||||
self.vr_launch = None
|
||||
self.chooser = None
|
||||
self.controls_state = None
|
||||
@@ -1256,6 +1257,10 @@ class Helper:
|
||||
page.compat("set(%d, %s)" % (int(app), json.dumps(tool if tool is not None else "")))
|
||||
say("%s -> %s" % ("default" if app == "0" else "app %s" % app,
|
||||
tool if tool is not None else "Steam native default"))
|
||||
names = set(dict(current, **changes).values()) | {default}
|
||||
if COMPAT["uses_valve_proton"](names) and not COMPAT["uses_valve_proton"](self.valve_names or ()):
|
||||
self.tools_checked = None
|
||||
self.valve_names = names
|
||||
state.update(
|
||||
auto={app: tool for app, tool in auto.items() if tool is not COMPAT["NATIVE_CHOICE"]},
|
||||
native_choices=sorted(refused_native | {app for app, tool in auto.items() if tool is COMPAT["NATIVE_CHOICE"]}),
|
||||
@@ -1276,7 +1281,8 @@ class Helper:
|
||||
self.tools_checked = now
|
||||
if COMPAT["game_running"]():
|
||||
return
|
||||
for app, action in COMPAT["tool_downloads"](self.steam_root):
|
||||
needed = COMPAT["valve_proton_needed"](self.steam_root, self.valve_names)
|
||||
for app, action in COMPAT["tool_downloads"](self.steam_root, needed):
|
||||
if now - self.tools_asked.get(app, -TOOL_RETRY_SECONDS) < TOOL_RETRY_SECONDS:
|
||||
continue
|
||||
self.tools_asked[app] = now
|
||||
|
||||
@@ -26,6 +26,9 @@ SNIPER_APPID = "1628350"
|
||||
SLR4_APPID = "4183110"
|
||||
FEX_DEPENDENCIES = (FEX_APPID, SNIPER_APPID, SLR4_APPID)
|
||||
REQUIRED_TOOLS = (PROTON_ARM64_APPID,) + FEX_DEPENDENCIES
|
||||
# "0" = the app's "Valve Proton only when needed": Valve's ARM64 Proton is fetched only for a title or
|
||||
# default set to a tool built from it, or while no own Proton build is installed.
|
||||
VALVE_PROTON_ENV = "DD_VALVE_PROTON"
|
||||
# Linux builds that bundle an arm64 binary their launcher starts; Steamworks offers no arm64
|
||||
# launch-option architecture, so appinfo cannot say so (#1774).
|
||||
FEX_DEFAULT_APPS = frozenset({"4385780"})
|
||||
@@ -1008,11 +1011,33 @@ def manifest_flags(tokens):
|
||||
return 0
|
||||
|
||||
|
||||
def tool_downloads(steam_root):
|
||||
def valve_proton_on_demand():
|
||||
return os.environ.get(VALVE_PROTON_ENV) == "0"
|
||||
|
||||
|
||||
def uses_valve_proton(names):
|
||||
return any(name == TOOL or VALVE_DEPOTS.get(name) == SOURCES[0] for name in names if name)
|
||||
|
||||
|
||||
def valve_proton_needed(steam_root, names=None):
|
||||
if not valve_proton_on_demand():
|
||||
return True
|
||||
if not own_builds(tool_catalog(steam_root)):
|
||||
return True
|
||||
if names is None:
|
||||
names = set((read_config_mapping(os.path.join(steam_root, "config", "config.vdf")) or {}).values())
|
||||
names.add(read_json(state_path("state.json")).get("default"))
|
||||
return uses_valve_proton(names)
|
||||
|
||||
|
||||
def tool_downloads(steam_root, valve_needed=None):
|
||||
wanted = []
|
||||
for app in REQUIRED_TOOLS:
|
||||
tokens = app_manifest(steam_root, app)
|
||||
if tokens is None:
|
||||
if app == PROTON_ARM64_APPID and not (
|
||||
valve_proton_needed(steam_root) if valve_needed is None else valve_needed):
|
||||
continue
|
||||
wanted.append((app, "install"))
|
||||
elif not manifest_flags(tokens) & FULLY_INSTALLED or manifest_flags(tokens) & UPDATE_REQUIRED:
|
||||
wanted.append((app, "update"))
|
||||
@@ -1755,6 +1780,8 @@ def x64_repoint(steam_root, tool, live=False):
|
||||
|
||||
def main():
|
||||
steam_root = sys.argv[1]
|
||||
if "--valve-proton-needed" in sys.argv[2:]:
|
||||
sys.exit(0 if valve_proton_needed(steam_root) else 1)
|
||||
if "--x64" in sys.argv[2:]:
|
||||
x64_repoint(steam_root, os.environ.get("DD_COMPAT_TOOL"), "--live" in sys.argv[2:])
|
||||
return
|
||||
@@ -1773,6 +1800,7 @@ def main():
|
||||
build_tool(os.path.join(tools, name), depot, sources, name)
|
||||
print("steam-compatibility: registered %s (%s)" % (
|
||||
name, "depot %s present" % os.path.basename(depot) if depot else
|
||||
"no ARM64 Proton depot yet; fetched when a title needs it" if valve_proton_on_demand() else
|
||||
"no ARM64 Proton depot yet; the session asks the client to fetch it"))
|
||||
build_fex_tool(os.path.join(tools, FEX_TOOL))
|
||||
print("steam-compatibility: registered %s" % FEX_TOOL)
|
||||
|
||||
Reference in new issue
Block a user