mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
tonight's Bannerlator Linux fixes carried over: the client's GPU process gets its frames back, client-interface switches, Deck mode, a GPU gate before the download
- libpci: an empty file bound over /proc/bus/pci/devices, created at session start, so Chromium's GPU process stops dying on its way up and CEF stops falling back to SwiftShader (WinNative deff1ac6 via Bannerlator 8fb668d1: 44 -> 85 fps in the Big Picture library on a OnePlus 15; not measured here yet). - Client interface, as toggles on the Performance page and lines in the device report: mesa_glthread, ZINK_DESCRIPTORS=lazy (now on by default) and MESA_NO_ERROR on; Steam Deck mode (-steamdeck -steamos3, the script builds the line) off. - A non-Adreno device is told before the runtime download that a session would be sound over a black screen, and may still go ahead. Not carried: Bannerlator's proot fixes live in its proot source, which this repo does not build (the runtime tarball ships its own); its apk-proot -i guard is moot here (the apk carries no proot); its session-log head keep is moot (Steam's logs are copied whole).
This commit is contained in:
1 parent
96d453e370
commit
95cd642745
8 files changed
+138
-8
No files matched your search
@@ -72,6 +72,10 @@ class MainActivity : ComponentActivity() {
|
||||
private var failed by mutableStateOf(false)
|
||||
private var frameGenLabel by mutableStateOf("Off")
|
||||
private var showRemove by mutableStateOf(false)
|
||||
private var showNonAdreno by mutableStateOf<LinuxRuntimeInstaller.Release?>(null)
|
||||
private var glThread by mutableStateOf(true)
|
||||
private var noGlError by mutableStateOf(true)
|
||||
private var steamDeckMode by mutableStateOf(false)
|
||||
private var showFrameGen by mutableStateOf(false)
|
||||
private var showCredits by mutableStateOf(false)
|
||||
private var showProtons by mutableStateOf(false)
|
||||
@@ -240,6 +244,15 @@ class MainActivity : ComponentActivity() {
|
||||
onRemove = { id -> ProtonExtras.tools.first { it.id == id }.let { ProtonExtras.remove(this, it) }; refreshProtons() },
|
||||
onDismiss = { showProtons = false },
|
||||
)
|
||||
showNonAdreno?.let { release ->
|
||||
ConfirmDialog(
|
||||
title = "Not an Adreno GPU",
|
||||
text = "The runtime draws with Turnip, an Adreno driver. On ${com.steamdeck.launcher.core.DeviceSupport.gpuName()} the compositor gets no usable Vulkan device and a session comes up as sound over a black screen. The download is ${"%.0f".format(release.size / 1e6)} MB.",
|
||||
confirm = "Install anyway",
|
||||
onConfirm = { showNonAdreno = null; install(release) },
|
||||
onDismiss = { showNonAdreno = null },
|
||||
)
|
||||
}
|
||||
if (showRemove) ConfirmDialog(
|
||||
title = "Remove Linux runtime",
|
||||
text = "This deletes the runtime, the Steam client inside it, and every game installed there.",
|
||||
@@ -392,11 +405,14 @@ class MainActivity : ComponentActivity() {
|
||||
PerformancePage(
|
||||
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, noXalia = noXalia,
|
||||
tuSysmem = tuSysmem, zinkLazy = zinkLazy, glThread = glThread, noGlError = noGlError, steamDeckMode = steamDeckMode, noXalia = noXalia,
|
||||
prootNoSeccomp = prootNoSeccomp, phantomWarning = phantomWarning,
|
||||
onClientOverride = { on -> SessionPrefs.setClientCpusOverride(this, on); clientOverride = on },
|
||||
onTuSysmem = { on -> SessionPrefs.setTuSysmem(this, on); tuSysmem = on },
|
||||
onZinkLazy = { on -> SessionPrefs.setZinkLazy(this, on); zinkLazy = on },
|
||||
onGlThread = { on -> SessionPrefs.setGlThread(this, on); glThread = on },
|
||||
onNoGlError = { on -> SessionPrefs.setNoGlError(this, on); noGlError = on },
|
||||
onSteamDeckMode = { on -> SessionPrefs.setSteamDeckMode(this, on); steamDeckMode = on },
|
||||
onNoXalia = { on -> SessionPrefs.setNoXalia(this, on); noXalia = on },
|
||||
onProotNoSeccomp = { on -> SessionPrefs.setProotNoSeccomp(this, on); prootNoSeccomp = on },
|
||||
onClientCore = { core, on ->
|
||||
@@ -507,6 +523,9 @@ class MainActivity : ComponentActivity() {
|
||||
/** The two masks as the dialog shows them; an empty stored list shows as every core ticked. */
|
||||
private fun refreshCores() {
|
||||
clientOverride = SessionPrefs.clientCpusOverride(this)
|
||||
glThread = SessionPrefs.glThread(this)
|
||||
noGlError = SessionPrefs.noGlError(this)
|
||||
steamDeckMode = SessionPrefs.steamDeckMode(this)
|
||||
clientCores = CpuCores.parse(SessionPrefs.clientCpus(this)).ifEmpty { CpuCores.all.toSet() }
|
||||
gameCores = CpuCores.parse(SessionPrefs.gameCpus(this)).ifEmpty { CpuCores.all.toSet() }
|
||||
tuSysmem = SessionPrefs.tuSysmem(this)
|
||||
@@ -565,6 +584,10 @@ class MainActivity : ComponentActivity() {
|
||||
Thread({ checkCatalog() }, "catalog").start()
|
||||
return
|
||||
}
|
||||
// The runtime draws with Turnip, an Adreno driver: on Mali, Xclipse or PowerVR the
|
||||
// compositor gets no usable Vulkan device and a session is sound over a black screen.
|
||||
// Said before the download, not after it; the user may still go ahead.
|
||||
if (installed == null && !com.steamdeck.launcher.core.DeviceSupport.adreno()) { showNonAdreno = release; return }
|
||||
install(release)
|
||||
}
|
||||
|
||||
|
||||
@@ -140,6 +140,10 @@ object DeviceReport {
|
||||
k(" game cores", CpuCores.restrictionOrEmpty(SessionPrefs.gameCpus(context)).ifEmpty { "every core (nothing sent)" })
|
||||
k("Turnip sysmem", SessionPrefs.tuSysmem(context))
|
||||
k("Zink lazy descriptors", SessionPrefs.zinkLazy(context))
|
||||
k("Threaded GL (glthread)", SessionPrefs.glThread(context))
|
||||
k("No GL error checks", SessionPrefs.noGlError(context))
|
||||
k("Steam Deck mode", SessionPrefs.steamDeckMode(context))
|
||||
k("FEX preset", SessionPrefs.fexPreset(context).ifEmpty { "FEX defaults" })
|
||||
k("Skip xalia", SessionPrefs.noXalia(context))
|
||||
k("proot without seccomp", SessionPrefs.prootNoSeccomp(context))
|
||||
k("DirectAudio for games", SessionPrefs.directAudio(context))
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.steamdeck.launcher.core
|
||||
|
||||
import android.os.Build
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Whether this device can draw a Linux session at all.
|
||||
*
|
||||
* The runtime draws with Turnip, an Adreno driver. On Mali, Xclipse and PowerVR the compositor
|
||||
* gets no usable Vulkan device and a session comes up as sound over a black screen - a failure
|
||||
* with nothing in it to read. The app cannot fix that, so it says so before the download rather
|
||||
* than after it. Adreno is recognised by what only Qualcomm's stack has: the KGSL node, or the
|
||||
* vendor's own Vulkan driver at its usual path.
|
||||
*/
|
||||
object DeviceSupport {
|
||||
fun adreno(): Boolean =
|
||||
File("/sys/class/kgsl/kgsl-3d0").exists() || File("/vendor/lib64/hw/vulkan.adreno.so").exists()
|
||||
|
||||
/** The chip as the device names it, for the card that explains the refusal. */
|
||||
fun gpuName(): String {
|
||||
val soc = if (Build.VERSION.SDK_INT >= 31) Build.SOC_MODEL.takeIf { it.isNotBlank() && it != Build.UNKNOWN } else null
|
||||
return soc?.let { "$it (${Build.HARDWARE})" } ?: Build.HARDWARE.ifBlank { "this GPU" }
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,30 @@ public final class LinuxRuntime {
|
||||
|
||||
// Android denies apps these; glibc, Steam and libcap read them at startup.
|
||||
File fakeProc = new File(root, "etc/bannerlator/proc");
|
||||
// libpci picks its procfs backend on whether it can read the /proc/bus/pci directory, which
|
||||
// the app can, then die()s - exit(1) on the calling process - on the devices file inside
|
||||
// it, which the app cannot. Chromium loads libpci in its GPU process to name the video
|
||||
// card, so that exit kills the process; after a few tries CEF gives up on hardware and
|
||||
// draws the rest of the session on SwiftShader: the client's interface rendered on the
|
||||
// CPU. An empty list is the truthful answer from in here - nothing the app can see is on
|
||||
// a PCI bus. Created at session start rather than shipped in the rootfs so an installed
|
||||
// runtime is fixed too, and the table's guard below binds it only when the real file
|
||||
// cannot be read, so it can never stand in front of real data. (WinNative, maxjivi05,
|
||||
// deff1ac6, via Bannerlator 8fb668d1: 44 -> 85 fps scrolling the Big Picture library on a
|
||||
// OnePlus 15, GPU-process crashes 12 -> 0.)
|
||||
File pciDevices = new File(fakeProc, "pci_devices");
|
||||
if (!pciDevices.isFile()) {
|
||||
try {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
pciDevices.getParentFile().mkdirs();
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
pciDevices.createNewFile();
|
||||
} catch (java.io.IOException e) {
|
||||
// It then fails the isFile() test below and the session runs as it did before.
|
||||
}
|
||||
}
|
||||
String[][] procFiles = {
|
||||
{"pci_devices", "/proc/bus/pci/devices"},
|
||||
{"stat", "/proc/stat"},
|
||||
{"version", "/proc/version"},
|
||||
{"loadavg", "/proc/loadavg"},
|
||||
|
||||
@@ -141,8 +141,26 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean("tuSysmem", on).apply()
|
||||
}
|
||||
|
||||
/** Zink's lazy descriptor mode (ZINK_DESCRIPTORS=lazy) for the client's GL-on-Vulkan UI. */
|
||||
fun zinkLazy(context: Context): Boolean = prefs(context).getBoolean("zinkLazy", false)
|
||||
/*
|
||||
* The client's interface is drawn Chromium -> ANGLE -> Zink -> Turnip, and that chain is what
|
||||
* limits its menus (~14 fps on an Adreno 840 while a game ran 89). These make the chain
|
||||
* cheaper rather than asking for more; the three environment switches are on by default,
|
||||
* Deck mode off. Bannerlator's LinuxTuning, carried over; none device-proven here yet.
|
||||
*/
|
||||
/** mesa_glthread=true: GL marshalled off the calling thread. */
|
||||
fun glThread(context: Context): Boolean = prefs(context).getBoolean("glThread", true)
|
||||
fun setGlThread(context: Context, on: Boolean) { prefs(context).edit().putBoolean("glThread", on).apply() }
|
||||
|
||||
/** MESA_NO_ERROR=1: no GL error checking. */
|
||||
fun noGlError(context: Context): Boolean = prefs(context).getBoolean("noGlError", true)
|
||||
fun setNoGlError(context: Context, on: Boolean) { prefs(context).edit().putBoolean("noGlError", on).apply() }
|
||||
|
||||
/** `steam -steamdeck -steamos3`: the client as SteamOS runs it. Expects Deck hardware; untested. */
|
||||
fun steamDeckMode(context: Context): Boolean = prefs(context).getBoolean("steamDeckMode", false)
|
||||
fun setSteamDeckMode(context: Context, on: Boolean) { prefs(context).edit().putBoolean("steamDeckMode", on).apply() }
|
||||
|
||||
/** Zink's lazy descriptor mode (ZINK_DESCRIPTORS=lazy) for the client's GL-on-Vulkan UI. On by default. */
|
||||
fun zinkLazy(context: Context): Boolean = prefs(context).getBoolean("zinkLazy", true)
|
||||
|
||||
fun setZinkLazy(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("zinkLazy", on).apply()
|
||||
|
||||
@@ -195,6 +195,12 @@ 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")
|
||||
// The rest of the client-interface switches (SessionPrefs): GL marshalled off the calling
|
||||
// thread, no GL error checks, and the client run as SteamOS runs it (the script reads
|
||||
// BL_STEAMDECK; it is the one that builds the command line).
|
||||
if (SessionPrefs.glThread(this)) guest.add("mesa_glthread=true")
|
||||
if (SessionPrefs.noGlError(this)) guest.add("MESA_NO_ERROR=1")
|
||||
if (SessionState.mode == MODE_STEAM) guest.add("BL_STEAMDECK=" + (if (SessionPrefs.steamDeckMode(this)) "1" else "0"))
|
||||
// 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.
|
||||
|
||||
@@ -34,12 +34,18 @@ fun PerformancePage(
|
||||
gameCores: Set<Int>,
|
||||
tuSysmem: Boolean,
|
||||
zinkLazy: Boolean,
|
||||
glThread: Boolean,
|
||||
noGlError: Boolean,
|
||||
steamDeckMode: Boolean,
|
||||
noXalia: Boolean,
|
||||
prootNoSeccomp: Boolean,
|
||||
phantomWarning: String?,
|
||||
onClientOverride: (Boolean) -> Unit,
|
||||
onTuSysmem: (Boolean) -> Unit,
|
||||
onZinkLazy: (Boolean) -> Unit,
|
||||
onGlThread: (Boolean) -> Unit,
|
||||
onNoGlError: (Boolean) -> Unit,
|
||||
onSteamDeckMode: (Boolean) -> Unit,
|
||||
onNoXalia: (Boolean) -> Unit,
|
||||
onProotNoSeccomp: (Boolean) -> Unit,
|
||||
onClientCore: (Int, Boolean) -> Unit,
|
||||
@@ -72,17 +78,34 @@ fun PerformancePage(
|
||||
coreItems, gameCores, note = "Tick or untick as many as you like; the menu stays open.", onToggle = onGameCore,
|
||||
)
|
||||
}
|
||||
SettingsGroup("Client interface") {
|
||||
ToggleRow(
|
||||
host, "glthread", "Threaded GL",
|
||||
"The client's menus are drawn Chromium → ANGLE → Zink → Turnip, and that chain is what limits them. mesa_glthread marshals GL off the calling thread, the shape of this bottleneck. On by default; none of these four is device-proven yet.",
|
||||
glThread, onChange = onGlThread,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "zink", "Zink: lazy descriptors",
|
||||
"Lazy descriptor updates is the mode Zink recommends on drivers without descriptor buffers. On by default.",
|
||||
zinkLazy, onChange = onZinkLazy,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "noglerror", "Skip GL error checks",
|
||||
"MESA_NO_ERROR: the driver stops validating every GL call. On by default.",
|
||||
noGlError, onChange = onNoGlError,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "deck", "Steam Deck mode",
|
||||
"Runs the client as SteamOS runs its own session (-steamdeck -steamos3), the shape Valve tunes Big Picture for. Off by default: the client then expects Deck hardware that is not here, and that cost is untested.",
|
||||
steamDeckMode, onChange = onSteamDeckMode,
|
||||
)
|
||||
}
|
||||
SettingsGroup("Session fixes") {
|
||||
ToggleRow(
|
||||
host, "sysmem", "Turnip: sysmem rendering",
|
||||
"Renders without the GPU's tile memory (TU_DEBUG=sysmem). A fix for an Adreno 8xx that shows corruption, and required on a 710/720/722 (set on its own there). Not a speed setting: elsewhere it COSTS frames — leave it off unless the picture is wrong.",
|
||||
tuSysmem, onChange = onTuSysmem,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "zink", "Zink: lazy descriptors",
|
||||
"The client's menus are drawn through Zink (GL on Vulkan). Lazy descriptor updates is the mode Zink recommends on drivers without descriptor buffers, and the first thing to try when the menus are slow while games are fast.",
|
||||
zinkLazy, onChange = onZinkLazy,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "xalia", "Skip Steam's xalia helper",
|
||||
"xalia is a Windows program Proton starts for gamepad navigation in Windows programs. On some devices its system calls are refused in a way it cannot cope with and the session dies seconds after Big Picture appears. Turn on if a session will not stay up.",
|
||||
|
||||
Reference in new issue
Block a user