diff --git a/README.md b/README.md index 8a97dd9f38..81ccb5b1bd 100644 --- a/README.md +++ b/README.md @@ -214,8 +214,13 @@ separate because they are wanted at the same time and suit different things: Both apply at the next session start. -Under the same dialog, two **driver tunables** for a runtime that renders slowly, tried one at a -time: **Turnip: sysmem rendering** (`TU_DEBUG=sysmem`, Banners-Turnip's advice for an Adreno 8xx that +Under the same dialog, **session fixes** for a device the runtime does not sit well on, tried one at +a time. **Skip Steam's xalia helper** (`PROTON_USE_XALIA=0`) is the one to reach for when a session +dies seconds after Big Picture appears: xalia is an x86 Windows program Proton starts for gamepad +navigation, it cannot load the session's preload shim under FEX, and where the vendor's seccomp +answers its `socket()` and `memfd` calls with ENOSYS it storms until the session collapses (89 +refusals then a broken pipe, in the log). It costs gamepad navigation in Windows programs that are +not games. Then two for a runtime that renders slowly: **Turnip: sysmem rendering** (`TU_DEBUG=sysmem`, Banners-Turnip's advice for an Adreno 8xx that looks glitchy or slow; a 710/720/722 gets it on its own) and **Zink: lazy descriptors** (`ZINK_DESCRIPTORS=lazy`, for Steam's menus, which Chromium draws through Zink — the first thing to try when they are slow while games are fast). The `steamdeck-tu-debug` and `steamdeck-env` files in diff --git a/app/src/main/java/com/steamdeck/launcher/MainActivity.kt b/app/src/main/java/com/steamdeck/launcher/MainActivity.kt index 2f232c8cf4..86299f83b2 100644 --- a/app/src/main/java/com/steamdeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/steamdeck/launcher/MainActivity.kt @@ -84,6 +84,7 @@ class MainActivity : ComponentActivity() { private var gameCores by mutableStateOf>(emptySet()) private var tuSysmem by mutableStateOf(false) private var zinkLazy by mutableStateOf(false) + private var noXalia by mutableStateOf(false) private var directAudio by mutableStateOf(false) private var mic by mutableStateOf(false) private var linuxRows by mutableStateOf>(emptyList()) @@ -174,10 +175,11 @@ class MainActivity : ComponentActivity() { if (showPerformance) PerformanceDialog( cores = CpuCores.all.map { c -> CoreRow(c, "cpu$c" + (CpuCores.maxGhz(c)?.let { String.format(java.util.Locale.US, " · %.1f GHz", it) } ?: "")) }, clientOverride = clientOverride, clientCores = clientCores, gameCores = gameCores, - tuSysmem = tuSysmem, zinkLazy = zinkLazy, + tuSysmem = tuSysmem, zinkLazy = zinkLazy, noXalia = noXalia, onClientOverride = { on -> SessionPrefs.setClientCpusOverride(this, on); clientOverride = on }, onTuSysmem = { on -> SessionPrefs.setTuSysmem(this, on); tuSysmem = on }, onZinkLazy = { on -> SessionPrefs.setZinkLazy(this, on); zinkLazy = on }, + onNoXalia = { on -> SessionPrefs.setNoXalia(this, on); noXalia = on }, onClientCore = { core, on -> clientCores = if (on) clientCores + core else clientCores - core SessionPrefs.setClientCpus(this, CpuCores.format(clientCores)) @@ -327,6 +329,7 @@ class MainActivity : ComponentActivity() { gameCores = CpuCores.parse(SessionPrefs.gameCpus(this)).ifEmpty { CpuCores.all.toSet() } tuSysmem = SessionPrefs.tuSysmem(this) zinkLazy = SessionPrefs.zinkLazy(this) + noXalia = SessionPrefs.noXalia(this) } private fun refreshProtons() { diff --git a/app/src/main/java/com/steamdeck/launcher/session/SessionPrefs.kt b/app/src/main/java/com/steamdeck/launcher/session/SessionPrefs.kt index 6d7579d8a8..ee21db8755 100644 --- a/app/src/main/java/com/steamdeck/launcher/session/SessionPrefs.kt +++ b/app/src/main/java/com/steamdeck/launcher/session/SessionPrefs.kt @@ -105,6 +105,20 @@ object SessionPrefs { prefs(context).edit().putString("gameCpus", list).apply() } + /** + * Whether Steam's xalia helper is kept out of the session (PROTON_USE_XALIA=0). + * + * xalia is an x86 Windows program Proton launches to give Windows programs gamepad navigation. + * Under FEX it cannot load the session's aarch64 preload shim, so its socket() and memfd calls + * reach the vendor's seccomp filter raw; where that answers ENOSYS - a Galaxy Fold, measured - + * it storms, and the session dies seconds after Big Picture appears. + */ + fun noXalia(context: Context): Boolean = prefs(context).getBoolean("noXalia", false) + + fun setNoXalia(context: Context, on: Boolean) { + prefs(context).edit().putBoolean("noXalia", on).apply() + } + /** Turnip's sysmem rendering (TU_DEBUG=sysmem) for the runtime's driver: bypasses GMEM tiling. */ fun tuSysmem(context: Context): Boolean = prefs(context).getBoolean("tuSysmem", false) diff --git a/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt b/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt index b0175dda13..0b54ab9c78 100644 --- a/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt +++ b/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt @@ -149,6 +149,10 @@ class SessionService : Service() { // the mode Zink recommends where the driver has no descriptor buffer, and what Ludashi ships // by default for its Zink path; a switch here because on one Fold the menus run at 14 fps. if (SessionPrefs.zinkLazy(this)) guest.add("ZINK_DESCRIPTORS=lazy") + // Proton's own gate for its xalia helper (its `proton` script reads this, and sets + // XALIA_SUPPORTED_ONLY itself otherwise). Off by default: xalia is Valve's, and on a device + // whose seccomp answers its syscalls normally there is no reason to take it away. + if (SessionPrefs.noXalia(this)) guest.add("PROTON_USE_XALIA=0") // Anything else, for a device that cannot be reached with a debugger: Downloads/steamdeck-env // holds KEY=VALUE lines that go into the session's environment as written, after ours, so a // line here wins. Zink and Turnip tunables (ZINK_DESCRIPTORS=lazy, MESA_*), gamescope's, diff --git a/app/src/main/java/com/steamdeck/launcher/ui/PerformanceDialog.kt b/app/src/main/java/com/steamdeck/launcher/ui/PerformanceDialog.kt index 398b3ae151..ced51d65e9 100644 --- a/app/src/main/java/com/steamdeck/launcher/ui/PerformanceDialog.kt +++ b/app/src/main/java/com/steamdeck/launcher/ui/PerformanceDialog.kt @@ -36,9 +36,11 @@ fun PerformanceDialog( gameCores: Set, tuSysmem: Boolean, zinkLazy: Boolean, + noXalia: Boolean, onClientOverride: (Boolean) -> Unit, onTuSysmem: (Boolean) -> Unit, onZinkLazy: (Boolean) -> Unit, + onNoXalia: (Boolean) -> Unit, onClientCore: (Int, Boolean) -> Unit, onGameCore: (Int, Boolean) -> Unit, onDismiss: () -> Unit, @@ -82,9 +84,9 @@ fun PerformanceDialog( HorizontalDivider() Spacer(Modifier.height(10.dp)) - Text("Driver tunables", style = MaterialTheme.typography.titleSmall) + Text("Session fixes", style = MaterialTheme.typography.titleSmall) Text( - "Two switches for a runtime that renders slowly, tried one at a time. Both apply at the next session start.", + "For a device the runtime does not sit well on, tried one at a time. All apply at the next session start.", style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant, ) @@ -110,6 +112,17 @@ fun PerformanceDialog( } Switch(checked = zinkLazy, onCheckedChange = onZinkLazy) } + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp)) { + Column(modifier = Modifier.weight(1f)) { + Text("Skip Steam's xalia helper", style = MaterialTheme.typography.bodyMedium) + Text( + "xalia is a Windows program Proton starts to give Windows programs gamepad navigation. On some devices its system calls are refused in a way it cannot cope with, and the session dies seconds after Big Picture appears — 89 refusals then a broken pipe, in the session log. Turn this on if a session will not stay up. Costs gamepad navigation in Windows programs that are not games.", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + } + Switch(checked = noXalia, onCheckedChange = onNoXalia) + } } }, confirmButton = { TextButton(onClick = onDismiss) { Text("OK") } },