Performance: a switch to keep Steam's xalia helper out of the session

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 -
and where that answers ENOSYS, measured on a Galaxy Fold, it storms: 89
refusals of each in a few seconds, then a broken Wayland pipe and a session
that is gone 6-12 seconds after Big Picture appeared. Fourteen sessions in
eighteen minutes died that way on one device while the same build ran for
minutes on another.

Proton has its own gate for it, PROTON_USE_XALIA, so the switch sets that
rather than interfering with the helper. 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.
This commit is contained in:
The412Banner committed 2026-09-21 11:59:35 -04:00
1 parent d7038a2b50
commit 13c512de0b
5 files changed
+44 -5

No files matched your search

@@ -84,6 +84,7 @@ class MainActivity : ComponentActivity() {
private var gameCores by mutableStateOf<Set<Int>>(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<List<DriverRow>>(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() {
@@ -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)
@@ -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,
@@ -36,9 +36,11 @@ fun PerformanceDialog(
gameCores: Set<Int>,
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") } },