chore: consistent code branding (#2800)

* chore: consistent code branding

* fix: carry legacy overrides, queues and live sync rows across the rename

* fix: keep queued legacy overrides on a failed rename and separate merged queue entries
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-17 23:31:26 -05:00
1 parent ad9348879d
commit eabcfc7b74
229 files changed
+2584 -2468

No files matched your search

+5 -5
View File
@@ -195,17 +195,17 @@ jobs:
app/src/main/assets/linuxfs
!app/src/main/assets/linuxfs/usr/local/lib/droiddeck-comet
!app/src/main/assets/linuxfs/usr/local/lib/droiddeck-xbox
!app/src/main/assets/linuxfs/i386/libblsession.so
!app/src/main/assets/linuxfs/i386/libddsession.so
!app/src/main/assets/linuxfs/i386/libfakeinput.so
!app/src/main/assets/linuxfs/i386/libfaultreport.so
!app/src/main/assets/linuxfs/libblaudit.so
!app/src/main/assets/linuxfs/libblfastpath.so
!app/src/main/assets/linuxfs/libddaudit.so
!app/src/main/assets/linuxfs/libddfastpath.so
!app/src/main/assets/linuxfs/libddnatv-hook.so
!app/src/main/assets/linuxfs/libblsession.so
!app/src/main/assets/linuxfs/libddsession.so
!app/src/main/assets/linuxfs/libfakeinput.so
!app/src/main/assets/linuxfs/libssbs.so
!app/src/main/assets/linuxfs/usr/local/bin/droiddeck-clipboard
!app/src/main/assets/linuxfs/x86_64/libblsession.so
!app/src/main/assets/linuxfs/x86_64/libddsession.so
!app/src/main/assets/linuxfs/x86_64/libfakeinput.so
!app/src/main/assets/linuxfs/x86_64/libfaultreport.so
!app/src/main/assets/linuxfs/x86_64/libvulkan-thunk.so
+2 -2
View File
@@ -75,8 +75,8 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
- x86 programs linking OpenSSL 3 use the copy in the [Steam Linux Runtime 4.0](https://gitlab.steamos.cloud/steamrt/steamrt). x86 Linux games get the `/etc/asound.conf` that [pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools) writes.
- `WriteProcessMemory` hooks fall back to `/proc/<pid>/mem` the way [Wine](https://gitlab.winehq.org/wine/wine)'s `server/ptrace.c` did before Wine 11.
- Windows programs on noexec storage get executable copies of their image pages, following [@yujikaido](https://github.com/yujikaido)'s finding in [droiddeck-rp4pro](https://github.com/yujikaido/droiddeck-rp4pro) that Wine's own processes need the noexec shim.
- Wine write watches use userfaultfd support in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/ntdll/unix/virtual.c` (LGPL-2.1-or-later). libblsession supplies the arm64 syscall number and answers `PAGEMAP_SCAN` from `/proc/self/pagemap`.
- libblsession runs Wine's arm64 `SIGUSR2` context handler (`dlls/ntdll/unix/signal_arm64.c`, LGPL-2.1-or-later) in place on a frame laid out like [Linux](https://github.com/torvalds/linux)'s `arch/arm64/kernel/signal.c`, and serves `fill_vm_counters` in `dlls/ntdll/unix/process.c` the kernel's own `/proc/<pid>/status`.
- Wine write watches use userfaultfd support in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/ntdll/unix/virtual.c` (LGPL-2.1-or-later). libddsession supplies the arm64 syscall number and answers `PAGEMAP_SCAN` from `/proc/self/pagemap`.
- libddsession runs Wine's arm64 `SIGUSR2` context handler (`dlls/ntdll/unix/signal_arm64.c`, LGPL-2.1-or-later) in place on a frame laid out like [Linux](https://github.com/torvalds/linux)'s `arch/arm64/kernel/signal.c`, and serves `fill_vm_counters` in `dlls/ntdll/unix/process.c` the kernel's own `/proc/<pid>/status`.
- droiddeck-ntsync follows the [Linux](https://github.com/torvalds/linux) ntsync semantics in `Documentation/userspace-api/ntsync.rst` (GPL-2.0).
- The proot fast path orders bindings like [PRoot](https://github.com/proot-me/proot)'s `path/binding.c` (GPL-2.0-or-later).
- DiRT 3 and DiRT Showdown keep their telemetry socket the way RoccoC's DiRTTelemetryErrorFix (MIT) does, based on the fix by Carsten Gottschling.
+1 -1
View File
@@ -2312,7 +2312,7 @@ __attribute__((visibility("hidden"))) static int inject_uevent(const char *actio
const char *subsystem, const char *devname,
unsigned major, unsigned minor) {
using inject_fn = int (*)(const char *, const char *, const char *, const char *, unsigned, unsigned);
static auto inject = reinterpret_cast<inject_fn>(dlsym(RTLD_DEFAULT, "bl_udevmon_inject"));
static auto inject = reinterpret_cast<inject_fn>(dlsym(RTLD_DEFAULT, "dd_udevmon_inject"));
return inject ? inject(action, devpath, subsystem, devname, major, minor) : -1;
}
+1 -1
View File
@@ -26,7 +26,7 @@ add_library(droiddeckwayland SHARED
generated/linux-dmabuf-v1-protocol.c
generated/wayland-android-protocol.c
generated/viewporter-protocol.c
generated/banner-desktop-v1-protocol.c
generated/droiddeck-desktop-v1-protocol.c
generated/presentation-time-protocol.c
generated/pointer-constraints-unstable-v1-protocol.c
generated/relative-pointer-unstable-v1-protocol.c
@@ -38,7 +38,7 @@
extern const struct wl_interface wl_surface_interface;
static const struct wl_interface *banner_desktop_v1_types[] = {
static const struct wl_interface *droiddeck_desktop_v1_types[] = {
NULL,
&wl_surface_interface,
&wl_surface_interface,
@@ -47,16 +47,16 @@ static const struct wl_interface *banner_desktop_v1_types[] = {
NULL,
};
static const struct wl_message banner_desktop_v1_requests[] = {
{ "destroy", "", banner_desktop_v1_types + 0 },
{ "set_desktop", "o", banner_desktop_v1_types + 1 },
{ "set_window", "ouii", banner_desktop_v1_types + 2 },
{ "set_zorder", "a", banner_desktop_v1_types + 0 },
static const struct wl_message droiddeck_desktop_v1_requests[] = {
{ "destroy", "", droiddeck_desktop_v1_types + 0 },
{ "set_desktop", "o", droiddeck_desktop_v1_types + 1 },
{ "set_window", "ouii", droiddeck_desktop_v1_types + 2 },
{ "set_zorder", "a", droiddeck_desktop_v1_types + 0 },
};
WL_PRIVATE const struct wl_interface banner_desktop_v1_interface = {
"banner_desktop_v1", 1,
4, banner_desktop_v1_requests,
WL_PRIVATE const struct wl_interface droiddeck_desktop_v1_interface = {
"droiddeck_desktop_v1", 1,
4, droiddeck_desktop_v1_requests,
0, NULL,
};
@@ -1,6 +1,6 @@
#ifndef BANNER_DESKTOP_V1_SERVER_PROTOCOL_H
#define BANNER_DESKTOP_V1_SERVER_PROTOCOL_H
#ifndef DROIDDECK_DESKTOP_V1_SERVER_PROTOCOL_H
#define DROIDDECK_DESKTOP_V1_SERVER_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
@@ -14,7 +14,7 @@ struct wl_client;
struct wl_resource;
/*
* @section page_copyright_banner_desktop_v1 Copyright
* @section page_copyright_droiddeck_desktop_v1 Copyright
*
* Copyright 2026 The412Banner
*
@@ -42,15 +42,15 @@ struct wl_resource;
struct banner_desktop_v1;
struct droiddeck_desktop_v1;
struct wl_surface;
#ifndef BANNER_DESKTOP_V1_INTERFACE
#define BANNER_DESKTOP_V1_INTERFACE
extern const struct wl_interface banner_desktop_v1_interface;
#ifndef DROIDDECK_DESKTOP_V1_INTERFACE
#define DROIDDECK_DESKTOP_V1_INTERFACE
extern const struct wl_interface droiddeck_desktop_v1_interface;
#endif
struct banner_desktop_v1_interface {
struct droiddeck_desktop_v1_interface {
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
void (*set_desktop)(struct wl_client *client,
@@ -68,10 +68,10 @@ struct banner_desktop_v1_interface {
};
#define BANNER_DESKTOP_V1_DESTROY_SINCE_VERSION 1
#define BANNER_DESKTOP_V1_SET_DESKTOP_SINCE_VERSION 1
#define BANNER_DESKTOP_V1_SET_WINDOW_SINCE_VERSION 1
#define BANNER_DESKTOP_V1_SET_ZORDER_SINCE_VERSION 1
#define DROIDDECK_DESKTOP_V1_DESTROY_SINCE_VERSION 1
#define DROIDDECK_DESKTOP_V1_SET_DESKTOP_SINCE_VERSION 1
#define DROIDDECK_DESKTOP_V1_SET_WINDOW_SINCE_VERSION 1
#define DROIDDECK_DESKTOP_V1_SET_ZORDER_SINCE_VERSION 1
#ifdef __cplusplus
}
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="banner_desktop_v1">
<protocol name="droiddeck_desktop_v1">
<copyright>
Copyright 2026 The412Banner
@@ -23,7 +23,7 @@
DEALINGS IN THE SOFTWARE.
</copyright>
<interface name="banner_desktop_v1" version="1">
<interface name="droiddeck_desktop_v1" version="1">
<description summary="Windows virtual desktop layout">
Each Wine process is a separate Wayland client, so a Windows virtual
desktop can't be built from subsurfaces. Instead the process that owns
@@ -24,7 +24,7 @@
#include "sc_layer.h"
#include "ahb_swapchain.h"
#include "viewporter-server-protocol.h"
#include "banner-desktop-v1-server-protocol.h"
#include "droiddeck-desktop-v1-server-protocol.h"
#include "presentation-time-server-protocol.h"
#include "pointer-constraints-unstable-v1-server-protocol.h"
#include "relative-pointer-unstable-v1-server-protocol.h"
@@ -79,7 +79,7 @@ static void open_session_log(void) {
localtime_r(&now, &tm);
strftime(stamp, sizeof(stamp), "%Y-%m-%d_%H-%M-%S", &tm);
const char *given = getenv("BL_WAYLAND_LOG");
const char *given = getenv("DD_WAYLAND_LOG");
if (given && *given) {
snprintf(path, sizeof(path), "%s", given);
} else {
@@ -1796,14 +1796,14 @@ static void desktop_set_zorder(struct wl_client *c, struct wl_resource *r, struc
apply_zorder();
schedule_render();
}
static const struct banner_desktop_v1_interface desktop_impl = {
static const struct droiddeck_desktop_v1_interface desktop_impl = {
.destroy = desktop_destroy_req,
.set_desktop = desktop_set_desktop,
.set_window = desktop_set_window,
.set_zorder = desktop_set_zorder,
};
static void bind_desktop(struct wl_client *c, void *data, uint32_t ver, uint32_t id) {
struct wl_resource *r = wl_resource_create(c, &banner_desktop_v1_interface, ver, id);
struct wl_resource *r = wl_resource_create(c, &droiddeck_desktop_v1_interface, ver, id);
wl_resource_set_implementation(r, &desktop_impl, NULL, NULL);
}
@@ -4083,7 +4083,7 @@ int droiddeck_wayland_run(void) {
wl_global_create(display, &zwp_linux_dmabuf_v1_interface, 4, NULL, bind_dmabuf);
droiddeck_android_wlegl_init(display);
wl_global_create(display, &wl_seat_interface, 9, NULL, bind_seat);
wl_global_create(display, &banner_desktop_v1_interface, 1, NULL, bind_desktop);
wl_global_create(display, &droiddeck_desktop_v1_interface, 1, NULL, bind_desktop);
wl_global_create(display, &wp_presentation_interface, 2, NULL, bind_presentation);
wl_global_create(display, &zwp_pointer_constraints_v1_interface, 1, NULL, bind_pointer_constraints);
wl_global_create(display, &zwp_relative_pointer_manager_v1_interface, 1, NULL, bind_relative_pointer_manager);
@@ -2745,7 +2745,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
val waylandLog = File(SessionPaths.beginOrCurrent(this), "wayland.log")
WaylandCompositor.setSessionLogFile(waylandLog)
try {
android.system.Os.setenv("BL_WAYLAND_LOG", waylandLog.path, true)
android.system.Os.setenv("DD_WAYLAND_LOG", waylandLog.path, true)
} catch (e: Exception) {
Log.w(TAG, "could not point the compositor's log at $waylandLog", e)
}
@@ -58,7 +58,8 @@ object AgentEnv {
fun override(context: Context, name: String): JSONObject = synchronized(lock) {
AgentAccess.requireCommands(context)
if (NAME.matchEntire(name) == null || name in setOf(".", "..")) throw AgentException("INVALID_NAME", "Override names are letters, digits, '.', '_' and '-'")
if (name == "libblfastpath.so" && (SessionState.running || SessionState.guestPid > 0 || SessionState.phase == SessionPhase.STOPPING)) {
if (name == LEGACY_FAST_PATH) throw AgentException("INVALID_NAME", "The fast-path library is now $FAST_PATH")
if (name == "libddfastpath.so" && (SessionState.running || SessionState.guestPid > 0 || SessionState.phase == SessionPhase.STOPPING)) {
throw AgentException("SESSION_ACTIVE", "Stop the session before installing a fast-path library")
}
val source = File(inbox(context), name)
@@ -73,7 +74,7 @@ object AgentEnv {
staged.delete()
throw AgentException("OVERRIDE_FAILED", "Could not stage the override")
}
if (name == "libblfastpath.so" && !arm64SharedLibrary(staged)) {
if (name == "libddfastpath.so" && !arm64SharedLibrary(staged)) {
staged.delete()
throw AgentException("INVALID_LIBRARY", "The fast path must be a 64-bit little-endian ARM64 ELF shared library")
}
@@ -86,7 +87,7 @@ object AgentEnv {
state.put("pendingOverrides", JSONArray(merge(strings(state.optJSONArray("pendingOverrides")), listOf(name))))
save(context, state)
state.put("installed", "$GUEST_BIN/$name")
if (name == "libblfastpath.so") {
if (name == "libddfastpath.so") {
val digest = MessageDigest.getInstance("SHA-256")
target.inputStream().use { input ->
val buffer = ByteArray(65536)
@@ -103,10 +104,10 @@ object AgentEnv {
fun fastPathLibrary(context: Context): String = synchronized(lock) {
if (!AgentAccess.commandsAllowed(context)) return@synchronized ProotFastPath.LIBRARY
if ("libblfastpath.so" !in strings(load(context).optJSONArray("activeOverrides"))) return@synchronized ProotFastPath.LIBRARY
val file = File(bin(context), "libblfastpath.so")
if ("libddfastpath.so" !in strings(load(context).optJSONArray("activeOverrides"))) return@synchronized ProotFastPath.LIBRARY
val file = File(bin(context), "libddfastpath.so")
if (!file.isFile || Files.isSymbolicLink(file.toPath())) return@synchronized ProotFastPath.LIBRARY
"$GUEST_BIN/libblfastpath.so"
"$GUEST_BIN/libddfastpath.so"
}
private fun arm64SharedLibrary(file: File): Boolean = file.inputStream().use { input ->
@@ -129,13 +130,18 @@ object AgentEnv {
}
val state = load(context)
val active = strings(state.optJSONArray("pending"))
val overrides = strings(state.optJSONArray("pendingOverrides"))
val queued = strings(state.optJSONArray("pendingOverrides"))
val legacy = File(bin(context), LEGACY_FAST_PATH)
val stranded = FAST_PATH in queued && legacy.isFile && !File(bin(context), FAST_PATH).exists() &&
!legacy.renameTo(File(bin(context), FAST_PATH))
if (stranded) Log.w(TAG, "could not rename the queued $LEGACY_FAST_PATH; it stays queued for the next session")
val overrides = if (stranded) queued - FAST_PATH else queued
bin(context).listFiles()
?.filter { it.name !in overrides }?.forEach { it.delete() }
?.filter { it.name !in overrides && !(stranded && it.name == LEGACY_FAST_PATH) }?.forEach { it.delete() }
val lines = strings(state.optJSONArray("persistent")) + active
val withPath = if (overrides.none { it != "libblfastpath.so" }) lines else lines + "PATH=$GUEST_BIN:${pathOf(lines)}"
val withPath = if (overrides.none { it != "libddfastpath.so" }) lines else lines + "PATH=$GUEST_BIN:${pathOf(lines)}"
state.put("active", JSONArray(active)).put("pending", JSONArray())
state.put("activeOverrides", JSONArray(overrides)).put("pendingOverrides", JSONArray())
state.put("activeOverrides", JSONArray(overrides)).put("pendingOverrides", JSONArray(if (stranded) listOf(FAST_PATH) else emptyList()))
save(context, state)
if (withPath.isNotEmpty()) Log.i(TAG, "agent environment keys for this session: ${withPath.map { it.substringBefore('=') }}")
withPath
@@ -158,6 +164,9 @@ object AgentEnv {
save(context, state)
}
private const val FAST_PATH = "libddfastpath.so"
private const val LEGACY_FAST_PATH = "libblfastpath.so"
private fun pathOf(lines: List<String>) =
lines.lastOrNull { it.startsWith("PATH=") }?.substringAfter('=')?.takeIf { it.isNotBlank() } ?: LinuxRuntime.GUEST_PATH
@@ -186,6 +195,9 @@ object AgentEnv {
for (key in listOf("pending", "active", "persistent", "pendingOverrides", "activeOverrides")) {
if (!state.has(key)) state.put(key, JSONArray())
}
for (key in listOf("pendingOverrides", "activeOverrides")) {
state.put(key, JSONArray(strings(state.optJSONArray(key)).map { if (it == LEGACY_FAST_PATH) FAST_PATH else it }.distinct()))
}
return state
}
@@ -23,6 +23,7 @@ object GameEnvironment {
)
fun validName(name: String) = namePattern.matches(name)
fun currentName(name: String) = if (name.startsWith("BL_")) "DD_" + name.removePrefix("BL_") else name
fun supported(name: String) = name !in unused && !name.startsWith("BOX64_") && !name.startsWith("BOX86_")
fun validValue(value: String) = '\u0000' !in value && value.length <= 8192
fun validScope(scope: String) = scope.isEmpty() || (Regex("[1-9][0-9]*").matches(scope) && scope.toLongOrNull()?.let { it in 1..4294967295L } == true)
@@ -97,14 +98,14 @@ object GameEnvironment {
val syncBackends = listOf(SessionPrefs.SYNC_NTSYNC, SessionPrefs.SYNC_FSYNC, SessionPrefs.SYNC_ESYNC, SessionPrefs.SYNC_WINESERVER)
val syncKeys = listOf("BL_SYNC", "BL_FSYNC_FIRST", "BL_SYNC_FALLBACK", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC", "PROTON_NO_NTSYNC", "WINEESYNC")
val syncKeys = listOf("DD_SYNC", "DD_FSYNC_FIRST", "DD_SYNC_FALLBACK", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC", "PROTON_NO_NTSYNC", "WINEESYNC")
fun syncEnvironment(backend: String): Map<String, String> {
require(backend in syncBackends) { "unknown sync $backend" }
return buildMap {
put("BL_SYNC", if (backend == SessionPrefs.SYNC_NTSYNC) "1" else "0")
put("BL_FSYNC_FIRST", if (backend == SessionPrefs.SYNC_FSYNC) "1" else "0")
put("BL_SYNC_FALLBACK", if (backend == SessionPrefs.SYNC_WINESERVER) "0" else "1")
put("DD_SYNC", if (backend == SessionPrefs.SYNC_NTSYNC) "1" else "0")
put("DD_FSYNC_FIRST", if (backend == SessionPrefs.SYNC_FSYNC) "1" else "0")
put("DD_SYNC_FALLBACK", if (backend == SessionPrefs.SYNC_WINESERVER) "0" else "1")
if (backend == SessionPrefs.SYNC_FSYNC) put("PROTON_NO_ESYNC", "1")
}
}
@@ -20,7 +20,7 @@ object GameEnvironmentOptions {
Option("PROTON_NO_NTSYNC", "1", R.string.game_env_no_ntsync, Type.TOGGLE, listOf("0", "1")),
Option("PROTON_NO_ESYNC", "1", R.string.game_env_no_esync, Type.TOGGLE, listOf("0", "1")),
Option("PROTON_NO_FSYNC", "1", R.string.game_env_no_fsync, Type.TOGGLE, listOf("0", "1")),
Option("BL_FSYNC_FIRST", "1", R.string.game_env_fsync_first, Type.TOGGLE, listOf("0", "1")),
Option("DD_FSYNC_FIRST", "1", R.string.game_env_fsync_first, Type.TOGGLE, listOf("0", "1")),
Option("DXVK_HUD", "fps", R.string.game_env_hud, Type.MULTIPLE, listOf("scale=0.5", "scale=0.7", "opacity=0.5", "opacity=0.7", "devinfo", "fps", "frametimes", "submissions", "drawcalls", "pipelines", "descriptors", "memory", "gpuload", "version", "api", "cs", "compiler", "samplers")),
Option("DXVK_CONFIG", "dxvk.maxFrameRate = 60", R.string.game_env_dxvk_config, Type.TEXT),
Option("VKD3D_FRAME_RATE", "60", R.string.game_env_vkd3d_limit, Type.NUMBER),
@@ -12,7 +12,7 @@ import java.util.function.Supplier;
public final class LinuxVulkanDriver {
private static final String TAG = "LinuxVulkanDriver";
public static final String ENV = "BL_VK_DRIVER";
public static final String ENV = "DD_VK_DRIVER";
public static final String HELP_TEXT =
"The driver the Steam client, the games it launches and the desktop's programs render on, "
@@ -256,12 +256,12 @@ public final class SystemVulkanDriver {
if (xclipse) environment.add("DROIDDECK_HYBRIS_DXVK=dxvk-2.6.2");
// The Android driver has a render node, but no KMS primary node. SDL presents
// through the wrapper's Wayland Vulkan swapchain instead of a KMS-style path.
environment.add("BL_GAMESCOPE_BACKEND=sdl");
environment.add("DD_GAMESCOPE_BACKEND=sdl");
// The Android pvr kernel accepts Vulkan DMA-BUF imports but rejects PRIME GEM handles.
environment.add("BL_POWERVR_DRM_HANDLES=1");
environment.add("BL_POWERVR_RENDER_NODE=" + node);
environment.add("DD_POWERVR_DRM_HANDLES=1");
environment.add("DD_POWERVR_RENDER_NODE=" + node);
// Inner Gamescope/Xwayland lacks the bridge's Android-buffer WSI protocols.
environment.add("BL_STEAM_GL_PRESENT=1");
environment.add("DD_STEAM_GL_PRESENT=1");
// Only actual Proton game launches use the bundled DXVK and X11 WSI layer.
environment.add("DROIDDECK_POWERVR_RUNTIME=" + directory.getPath());
}
@@ -275,7 +275,7 @@ internal class GameFrameFeed(
private const val INFO_NS = 500_000_000L
private const val SHIFT_NS = 1_000_000_000L
private const val SHIFT_RECHECK_NS = 100_000_000L
private const val CLOCK_CONTROL_PATH = "tmp/.bl-clock"
private const val CLOCK_CONTROL_PATH = "tmp/.dd-clock"
fun forRoot(root: File) = GameFrameFeed(File(root, HudFrames.PATH), clockControl = File(root, CLOCK_CONTROL_PATH))
@@ -21,6 +21,10 @@ object LegacyNames {
"etc/bannerlator-network.json" to "etc/droiddeck-network.json",
"etc/bannerlator-wifi-scan-request" to "etc/droiddeck-wifi-scan-request",
)
private val RETIRED_FILES = listOf("libblsession.so", "libblfastpath.so", "libblaudit.so").map { "usr/local/lib/$it" } +
listOf("x86_64", "i386").map { "usr/local/lib/droiddeck-fex/$it/libblsession.so" }
private const val LEGACY_MARKER = ".bl-"
private val QUEUED_MARKERS = setOf(".bl-proton-extra", ".bl-steam-urls")
private val MENU_REWRITES = listOf(
Triple("usr/local/share/applications", "/usr/local/bin/bannerlator-", "/usr/local/bin/droiddeck-"),
Triple("usr/share/applications", "Exec=env APPIMAGE_EXTRACT_AND_RUN=1 /opt/appimages/",
@@ -38,6 +42,20 @@ object LegacyNames {
fun migrateRootfs(root: File) {
migrateEtc(root)
for ((old, new) in MOVED_FILES) move(File(root, old), File(root, new))
for (path in RETIRED_FILES) File(root, path).delete()
File(root, "root").listFiles { f -> f.name.startsWith(LEGACY_MARKER) }?.forEach {
val target = File(it.parentFile, ".dd-" + it.name.removePrefix(LEGACY_MARKER))
if (it.name in QUEUED_MARKERS && it.isFile && !isLink(it) && target.isFile && !isLink(target)) {
val queued = it.readText()
if (queued.isNotBlank()) {
val separator = if (target.length() > 0 && !target.readText().endsWith("\n")) "\n" else ""
target.appendText(separator + if (queued.endsWith("\n")) queued else queued + "\n")
}
FileUtils.delete(it)
} else {
move(it, target)
}
}
linkScripts(root)
rewriteMenuEntries(root)
}
@@ -9,7 +9,7 @@ import java.security.MessageDigest
object ProotFastPath {
private const val TAG = "ProotFastPath"
const val LIBRARY = "/usr/local/lib/libblfastpath.so"
const val LIBRARY = "/usr/local/lib/libddfastpath.so"
const val MAX_BINDS = 256
fun allows(preference: Boolean, noSeccomp: Boolean, source: String, nativeUserland: Boolean = false): Boolean =
@@ -315,11 +315,11 @@ object BottomDesktop {
main.post { if (generation == guestGeneration) watchIme(imeDir) }
val binds = LinuxRuntime.binds(context, current.sessionRoot, runtime, Environment.getExternalStorageDirectory(), current.binds)
val guest = ArrayList(current.guest).apply {
add("BL_WIDTH=$width")
add("BL_HEIGHT=$height")
add("BL_DEBUG_DIR=" + dir.path)
add("BL_TOP_SESSION=" + SessionState.mode)
add("BL_IME_DIR=" + imeDir.path)
add("DD_WIDTH=$width")
add("DD_HEIGHT=$height")
add("DD_DEBUG_DIR=" + dir.path)
add("DD_TOP_SESSION=" + SessionState.mode)
add("DD_IME_DIR=" + imeDir.path)
add(SCRIPT)
}
val command = if (current.nativeUserland) {
@@ -440,7 +440,7 @@ object EsyncPacks {
fun enabled(context: Context): Boolean = SessionPrefs.syncFallback(context) || try {
GameEnvironmentStore.read(context).let { config ->
(listOf(config.shared) + config.games.values).any { it["BL_SYNC_FALLBACK"] == "1" }
(listOf(config.shared) + config.games.values).any { it["DD_SYNC_FALLBACK"] == "1" }
}
} catch (t: Throwable) {
false
@@ -57,8 +57,8 @@ object FexCatalog {
}
fun environment(build: Build, sources: List<String> = DownloadSource.candidates(build.url)): List<String> = listOf(
"BL_FEX_TAG=${build.tag}",
"BL_FEX_SHA256=${build.sha256}",
"BL_FEX_URLS=" + sources.joinToString(" "),
"DD_FEX_TAG=${build.tag}",
"DD_FEX_SHA256=${build.sha256}",
"DD_FEX_URLS=" + sources.joinToString(" "),
)
}
@@ -29,7 +29,8 @@ object GameEnvironmentStore {
require(GameEnvironment.validName(name))
val entry = value.get(name)
require(entry == JSONObject.NULL || entry is String && GameEnvironment.validValue(entry))
put(name, if (entry == JSONObject.NULL) null else entry as String)
val current = GameEnvironment.currentName(name)
if (current == name || !value.has(current)) put(current, if (entry == JSONObject.NULL) null else entry as String)
}
}
val games = json.optJSONObject("games")
@@ -52,10 +53,9 @@ object GameEnvironmentStore {
@Synchronized
fun save(context: Context, config: GameEnvironment.Config) {
val json = encode(config)
decode(json)
write(File(context.filesDir, SETTINGS), json.toString())
publish(context, config)
val normalized = decode(encode(config))
write(File(context.filesDir, SETTINGS), encode(normalized).toString())
publish(context, normalized)
}
@Synchronized
@@ -34,8 +34,8 @@ object GraphicsReport {
/** The guest keys the report repeats: everything that decides which Vulkan driver loads. */
private val ENV_PREFIXES = listOf(
"VK_", "BL_VK", "BL_DRM", "BL_VKBRIDGE", "VKBRIDGE", "MESA_", "GALLIUM_", "ZINK", "TU_", "PANVK",
"DROIDDECK_POWERVR", "DROIDDECK_HYBRIS", "BL_GAME_LOGS", "LIBGL_", "GAMESCOPE_DISABLE", "XWAYLAND",
"VK_", "DD_VK", "DD_DRM", "DD_VKBRIDGE", "VKBRIDGE", "MESA_", "GALLIUM_", "ZINK", "TU_", "PANVK",
"DROIDDECK_POWERVR", "DROIDDECK_HYBRIS", "DD_GAME_LOGS", "LIBGL_", "GAMESCOPE_DISABLE", "XWAYLAND",
)
/** Per-game graphics logs and the guest's Vulkan summary: on for a non-Adreno GPU, or by Setup's switch. */
@@ -37,7 +37,7 @@ object ProtonExtras {
)
private fun home(context: Context) = File(LinuxRuntime.rootDir(context), "root")
private fun requests(context: Context) = File(home(context), ".bl-proton-extra")
private fun requests(context: Context) = File(home(context), ".dd-proton-extra")
private fun toolsDir(context: Context) = File(home(context), ".local/share/Steam/compatibilitytools.d")
private fun releasesFile(context: Context) = File(context.filesDir, "proton-extras.json")
private fun latestFile(context: Context) = File(context.filesDir, "proton-latest.json")
@@ -68,7 +68,7 @@ object QuestExperimental {
appendLine("driverMode=${SessionPrefs.gpuDriverMode(context)}")
appendLine("androidDriver=${SessionPrefs.androidDriver(context)}")
appendLine("steamSurfaceControlWorkaround=${SessionPrefs.hdr(context, "steam")}")
appendLine("GPUOBJ fallback installed in Android driver and ARM64 libblsession")
appendLine("GPUOBJ fallback installed in Android driver and ARM64 libddsession")
appendLine("Experimental Quest 2/3/3S compatibility; 2D panel application")
}
Log.i(TAG, report)
@@ -109,11 +109,11 @@ object SessionFiles {
"usr/local/bin/droiddeck-steam-compat" to "usr/local/bin/droiddeck-steam-compat",
"usr/local/bin/droiddeck-steam-taskset" to "usr/local/libexec/droiddeck-steam/taskset",
"usr/local/bin/droiddeck-fex" to "usr/local/bin/droiddeck-fex",
"libblsession.so" to "usr/local/lib/libblsession.so",
"libddsession.so" to "usr/local/lib/libddsession.so",
"libfakeinput.so" to "usr/local/lib/libfakeinput.so",
"libblfastpath.so" to "usr/local/lib/libblfastpath.so",
"libddfastpath.so" to "usr/local/lib/libddfastpath.so",
"libddnatv-hook.so" to "usr/lib/libddnatv-hook.so",
"libblaudit.so" to "usr/local/lib/libblaudit.so",
"libddaudit.so" to "usr/local/lib/libddaudit.so",
"libssbs.so" to "usr/local/lib/libssbs.so",
"usr/local/bin/droiddeck-session" to "usr/local/bin/droiddeck-session",
"usr/local/bin/droiddeck-fonts" to "usr/local/bin/droiddeck-fonts",
@@ -238,7 +238,7 @@ object SessionFiles {
"usr/local/lib/droiddeck-gpuload/VK_LAYER_DROIDDECK_vram_cap.json" to "usr/share/vulkan/implicit_layer.d/droiddeck_vram_cap.json",
)
val fexPreloads = listOf("x86_64", "i386").flatMap { arch ->
listOf("libblsession.so", "libfakeinput.so", "libfaultreport.so").map { "$arch/$it" to "usr/local/lib/droiddeck-fex/$arch/$it" }
listOf("libddsession.so", "libfakeinput.so", "libfaultreport.so").map { "$arch/$it" to "usr/local/lib/droiddeck-fex/$arch/$it" }
} + listOf("libvulkan-thunk.so", "libwebkitinput.so").map { "x86_64/$it" to "usr/local/lib/droiddeck-fex/x86_64/$it" }
// The Mali compatibility layer (tools/venus/layer, David Cimo): an implicit Vulkan layer that
// fills in the features DXVK requires and Mali lacks. Idle outside Wine and on GPUs that have them.
@@ -315,7 +315,7 @@ object SessionFiles {
for (pack in SERVICE_PACKS.keys) stageStoreService(context, root, pack, ledger)
ledger.save()
for (old in arrayOf("aarch64-unix", "aarch64-windows", "i386-windows")) File(root, "$DIRECTAUDIO_DIR/lib/wine/$old").deleteRecursively()
val preload = StringBuilder("/usr/local/lib/libblsession.so\n")
val preload = StringBuilder("/usr/local/lib/libddsession.so\n")
if (!File(Environment.getExternalStorageDirectory(), NO_PAD_SWITCH).exists()) {
preload.append("/usr/local/lib/libfakeinput.so\n")
}
@@ -694,7 +694,7 @@ object SessionPrefs {
}
private fun shaderPrecacheApplied(context: Context) =
java.io.File(com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context), "root/.bl-shader-precache-applied")
java.io.File(com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context), "root/.dd-shader-precache-applied")
fun pendingShaderPrecache(context: Context): Boolean? {
val prefs = prefs(context)
@@ -612,7 +612,7 @@ class SessionService : Service() {
stopSession(-1, gen)
return
}
if (steamHere) guest.add("BL_EPIC_APP_ID=" + com.droiddeck.launcher.stores.epic.EpicClient.shortcutAppId)
if (steamHere) guest.add("DD_EPIC_APP_ID=" + com.droiddeck.launcher.stores.epic.EpicClient.shortcutAppId)
val fastPathAt = guest.size
val pulse = SessionEvents.step("audio") { startAudio(guest, sessionDir, directAudioPack) }
@@ -624,36 +624,36 @@ class SessionService : Service() {
val encoder = VideoEncodeBridge(File(filesDir, "venc/venc.sock"))
encoder.attach(this)
components.add(encoder)
guest.add("BL_VENC_SOCKET=" + encoder.socket.absolutePath)
guest.add("DD_VENC_SOCKET=" + encoder.socket.absolutePath)
}
com.droiddeck.launcher.gpu.ClockLogComponent(File(sessionDir, "clocks.log")).let {
it.attach(this)
components.add(it)
}
guest.add("BL_WIDTH=" + size.first)
guest.add("BL_HEIGHT=" + size.second)
guest.add("DD_WIDTH=" + size.first)
guest.add("DD_HEIGHT=" + size.second)
if (noSteamGame()) runCatching {
val scope = NoSteamLaunch.scopeOf(SessionState.program, SessionState.programArgs) { NoSteamLaunch.battleNetTitleScope(this, it) }
NoSteamLaunch.resolution(GameEnvironmentStore.read(this), scope, size)
}.onFailure { Log.w(TAG, "game resolution", it) }.getOrNull()?.let { (w, h) ->
guest.add("BL_GAME_WIDTH=$w")
guest.add("BL_GAME_HEIGHT=$h")
guest.add("DD_GAME_WIDTH=$w")
guest.add("DD_GAME_HEIGHT=$h")
Log.i(TAG, "game resolution: ${w}x$h on a ${size.first}x${size.second} output")
}
if (SessionState.followScreen || size.first < size.second ||
SessionPrefs.orientation(this) == android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER)
guest.add("BL_FOLLOW_OUTPUT=1")
guest.add("DD_FOLLOW_OUTPUT=1")
if (SessionState.hdr) {
guest.add("BL_HDR=1")
guest.add("DD_HDR=1")
guest.add("DXVK_HDR=1")
Log.i(TAG, "hdr: gamescope --hdr-enabled, DXVK_HDR=1")
}
guest.add("DROIDDECK_WSI_BYPASS_CHECK_MS=100")
guest.add("WINE_OFFSCREEN_CHECK_MS=100")
guest.add("BL_REFRESH=" + Math.round(SessionState.refreshHz))
guest.add("BL_LOG=" + sessionLog.path)
guest.add("BL_DEBUG_DIR=" + sessionDir.path)
guest.add("DD_REFRESH=" + Math.round(SessionState.refreshHz))
guest.add("DD_LOG=" + sessionLog.path)
guest.add("DD_DEBUG_DIR=" + sessionDir.path)
if (EnhancedDiagnostics.isActive(this, sessionDir)) guest.add("DROIDDECK_ENHANCED_DIAGNOSTICS=1")
val fakeInputDir = File(sessionRoot, "dev/input").apply { mkdirs() }
@@ -666,7 +666,7 @@ class SessionService : Service() {
SessionEvents.step("controller-sync") { SessionState.padBridge?.syncConnectedControllers() }
}
val noSteamGame = noSteamGame()
if (noSteamGame) guest.add("BL_PIN_CORES=0")
if (noSteamGame) guest.add("DD_PIN_CORES=0")
if ((steamHere || SessionState.program == NoSteamLaunch.EPIC) && com.droiddeck.launcher.stores.epic.EpicClient.read(this).installed) {
runCatching { SessionEvents.step("epic-library") { com.droiddeck.launcher.stores.epic.EpicClientLibrary.sync(this) } }
.onFailure { Log.w(TAG, "Epic library sync failed", it) }
@@ -676,17 +676,19 @@ class SessionService : Service() {
if (steamHere || noSteamGame) {
val added = SessionEvents.step("added-games-scan") { com.droiddeck.launcher.frontend.AddedGames.scan(this) }
val listing = SessionEvents.step("added-games-listing") { com.droiddeck.launcher.frontend.AddedGames.writeListing(this, added) }
guest.add("BL_ADDED_GAMES=" + listing.path)
if (OfflineMode.enabled(this)) guest.add("BL_STEAM_OFFLINE=1")
if (com.droiddeck.launcher.gpu.Lossless.owned(this)) guest.add("BL_LOSSLESS_OWNED=1")
guest.add("DD_ADDED_GAMES=" + listing.path)
if (OfflineMode.enabled(this)) guest.add("DD_STEAM_OFFLINE=1")
if (com.droiddeck.launcher.gpu.Lossless.owned(this)) guest.add("DD_LOSSLESS_OWNED=1")
if (added.isNotEmpty()) Log.i(TAG, "added games: " + added.joinToString { "${it.name} (${it.exe.name})" })
}
guest.add("DD_LAUNCH_DIR=" + sessionRoot.path)
// Proton builds up to 11.12 report X11 text fields under this name.
guest.add("BL_LAUNCH_DIR=" + sessionRoot.path)
GameStorage.effective(this)?.let { guest.add("BL_LIBRARY_LABEL=" + it.label.replace('"', ' ')) }
if (SessionState.mode == MODE_STEAM && SessionState.steamUi == "desktop") guest.add("BL_STEAM_UI=desktop")
GameStorage.effective(this)?.let { guest.add("DD_LIBRARY_LABEL=" + it.label.replace('"', ' ')) }
if (SessionState.mode == MODE_STEAM && SessionState.steamUi == "desktop") guest.add("DD_STEAM_UI=desktop")
// Detailed graphics logs: per-game logs and the guest's Vulkan summary (a GPU that is not
// an Adreno, or Setup's switch), and graphics-report.txt for every session.
if (GraphicsReport.detailed(this)) guest.add("BL_GAME_LOGS=1")
if (GraphicsReport.detailed(this)) guest.add("DD_GAME_LOGS=1")
SessionEvents.step("graphics-report") { GraphicsReport.begin(this, sessionDir, guest) }
val shellGuest = ArrayList(guest).apply {
add("SHELL=/bin/bash")
@@ -873,8 +875,8 @@ class SessionService : Service() {
if (!pulse.setSinkSuspended(false)) Log.w(TAG, "could not resume audio sink")
if (!pulse.setMicSuspended(false)) Log.w(TAG, "could not resume microphone source")
},
zramControl = File(filesDir, "${LinuxRuntime.DIR}/tmp/.bl-zram"),
clockControl = File(filesDir, "${LinuxRuntime.DIR}/tmp/.bl-clock"),
zramControl = File(filesDir, "${LinuxRuntime.DIR}/tmp/.dd-zram"),
clockControl = File(filesDir, "${LinuxRuntime.DIR}/tmp/.dd-clock"),
mapClockControl = { WaylandCompositor.nativeSetClockControl(it.path) },
pagedOut = { processes, unacknowledged, residentKb, swapKb, swapBeforeKb, millis ->
Log.i(TAG, "paged out $processes processes ($unacknowledged unacknowledged) in $millis ms: " +
@@ -943,16 +945,16 @@ class SessionService : Service() {
} else {
guest.add("LANG=C.UTF-8")
}
guest.add("BL_STEAM_LANGUAGE=" + SteamLanguage.forLocale(
guest.add("DD_STEAM_LANGUAGE=" + SteamLanguage.forLocale(
com.droiddeck.launcher.core.AppLanguage.effective(this),
com.droiddeck.launcher.core.AppLanguage.system(this).country,
))
guest.add("TZ=" + java.util.TimeZone.getDefault().id)
if (SessionState.mode == MODE_STEAM) SessionPrefs.pendingShaderPrecache(this)?.let { guest.add("BL_SHADER_PRECACHE=" + if (it) "1" else "0") }
if (SessionState.mode == MODE_STEAM) SessionPrefs.pendingShaderPrecache(this)?.let { guest.add("DD_SHADER_PRECACHE=" + if (it) "1" else "0") }
guest.add("XDG_RUNTIME_DIR=" + LinuxRuntime.GUEST_RUNTIME_DIR)
guest.add("XDG_SESSION_TYPE=wayland")
guest.add("WAYLAND_DISPLAY=wayland-0")
guest.add("BL_ANDROID_CLIPBOARD=" + File(filesDir, "session/android-clipboard").path)
guest.add("DD_ANDROID_CLIPBOARD=" + File(filesDir, "session/android-clipboard").path)
guest.add("GAMESCOPE_FORCE_GENERAL_QUEUE=1")
guest.add("MESA_LOADER_DRIVER_OVERRIDE=zink")
guest.add("GALLIUM_DRIVER=zink")
@@ -981,7 +983,7 @@ class SessionService : Service() {
guest.add("XWAYLAND_NO_GLAMOR=1")
Log.w(TAG, "xwayland: the last session's Xwayland crashed; glamor off for this one (XWAYLAND_NO_GLAMOR=1)")
}
if (!com.droiddeck.launcher.core.DeviceSupport.adreno()) guest.add("BL_RAISE_NOFILE=1")
if (!com.droiddeck.launcher.core.DeviceSupport.adreno()) guest.add("DD_RAISE_NOFILE=1")
if (!com.droiddeck.launcher.core.DeviceSupport.adreno()) {
val kernel = System.getProperty("os.version").orEmpty()
val old = kernelBefore(kernel, 6, 6)
@@ -995,11 +997,11 @@ class SessionService : Service() {
if (SessionPrefs.steamGpuCompositing(this)) {
Log.i(TAG, "steam: GPU web compositing (Setup's \"Steam interface: GPU drawing\")")
} else {
guest.add("BL_STEAM_SOFT_COMPOSITING=1")
guest.add("DD_STEAM_SOFT_COMPOSITING=1")
Log.i(TAG, "steam: software web compositing for the open driver pair (GPU raster kept)")
}
guest.add("BL_OPEN_DRIVER=1")
LinuxRuntime.gpuStandIn(this)?.takeIf { it == LinuxRuntime.MALI_DEVICE }?.let { guest.add("BL_DRM_STANDIN=$it") }
guest.add("DD_OPEN_DRIVER=1")
LinuxRuntime.gpuStandIn(this)?.takeIf { it == LinuxRuntime.MALI_DEVICE }?.let { guest.add("DD_DRM_STANDIN=$it") }
}
val tuOverride = tuDebugOverride()
val tuDriver = sysmemDriver(linuxDriverId)
@@ -1013,10 +1015,10 @@ class SessionService : Service() {
guest.add("MESA_DISK_CACHE_DATABASE=1")
guest.addAll(GpuStatsComponent.guestEnv(LinuxRuntime.rootDir(this)))
guest.add("GLIBC_TUNABLES=glibc.pthread.rseq=0:glibc.malloc.top_pad=16777216")
if (SessionState.mode == MODE_STEAM) guest.add("BL_MANGOAPP=" + (if (SessionPrefs.mangoapp(this)) "1" else "0"))
if (SessionState.mode == MODE_STEAM) guest.add("DD_MANGOAPP=" + (if (SessionPrefs.mangoapp(this)) "1" else "0"))
SessionState.steamClientArch = if (steamHere) SessionPrefs.steamClientArch(this) else null
SessionState.steamClientArch?.let { arch ->
guest.add("BL_STEAM_CLIENT_ARCH=$arch")
guest.add("DD_STEAM_CLIENT_ARCH=$arch")
SessionPaths.current()?.let {
SessionArtifacts.recordClient(it, arch)
SessionArtifacts.markSteamLogs(it, File(SessionPrefs.steamRoot(this, arch), "logs"))
@@ -1024,23 +1026,23 @@ class SessionService : Service() {
}
FexCatalog.cached(this)?.let { guest.addAll(FexCatalog.environment(it)) }
if (SessionState.mode == MODE_STEAM) {
guest.add("BL_GAMESCOPE_STRETCH_16X9=" + (if (SessionPrefs.stretch16x9(this)) "1" else "0"))
guest.add("DD_GAMESCOPE_STRETCH_16X9=" + (if (SessionPrefs.stretch16x9(this)) "1" else "0"))
}
if (SessionPrefs.noXalia(this)) guest.add("PROTON_USE_XALIA=0")
guest.add("BL_SYNC=" + (if (SessionPrefs.fastSync(this)) "1" else "0"))
guest.add("BL_SYNC_FALLBACK=" + (if (SessionPrefs.syncFallback(this)) "1" else "0"))
guest.add("BL_FSYNC_FIRST=" + (if (SessionPrefs.fsyncFirst(this)) "1" else "0"))
guest.add("BL_PACE_CORES=" + (if (SessionPrefs.paceCores(this)) "1" else "0"))
guest.add("BL_GAMESCOPE_REALTIME=" + (if (SessionPrefs.gamescopeRealtime(this)) "1" else "0"))
if (SessionPrefs.cursorComposite(this)) guest.add("BL_CURSOR_COMPOSITE=1")
guest.add("DD_SYNC=" + (if (SessionPrefs.fastSync(this)) "1" else "0"))
guest.add("DD_SYNC_FALLBACK=" + (if (SessionPrefs.syncFallback(this)) "1" else "0"))
guest.add("DD_FSYNC_FIRST=" + (if (SessionPrefs.fsyncFirst(this)) "1" else "0"))
guest.add("DD_PACE_CORES=" + (if (SessionPrefs.paceCores(this)) "1" else "0"))
guest.add("DD_GAMESCOPE_REALTIME=" + (if (SessionPrefs.gamescopeRealtime(this)) "1" else "0"))
if (SessionPrefs.cursorComposite(this)) guest.add("DD_CURSOR_COMPOSITE=1")
relativeMouseForSession().takeIf { it != 0 }?.let { guest.add("gamescope_relative_mouse=$it") }
if (com.droiddeck.launcher.core.ZramSupport.supported()) {
guest.add("BL_ZRAM=1")
if (steamHere) SessionPrefs.ramCapMb(this).takeIf { it > 0 }?.let { guest.add("BL_RAM_CAP_MB=$it") }
if (!SessionPrefs.zramClient(this)) guest.add("BL_ZRAM_CLIENT=0")
if (!SessionPrefs.zramIdle(this)) guest.add("BL_ZRAM_IDLE=0")
guest.add("DD_ZRAM=1")
if (steamHere) SessionPrefs.ramCapMb(this).takeIf { it > 0 }?.let { guest.add("DD_RAM_CAP_MB=$it") }
if (!SessionPrefs.zramClient(this)) guest.add("DD_ZRAM_CLIENT=0")
if (!SessionPrefs.zramIdle(this)) guest.add("DD_ZRAM_IDLE=0")
}
SessionPrefs.vramCapMb(this).takeIf { it > 0 }?.let { guest.add("BL_VRAM_MB=$it") }
SessionPrefs.vramCapMb(this).takeIf { it > 0 }?.let { guest.add("DD_VRAM_MB=$it") }
guest.add("AUDIO_DIRECT_DECAY=0")
val extra = extraEnv() + agentEnvironment
guest.addAll(TurnipEnvironment.gameEnvironment(tuOverride, tuDriver, SessionPrefs.tuSysmem(this), extra))
@@ -1049,10 +1051,10 @@ class SessionService : Service() {
com.droiddeck.launcher.gpu.TpUbwcHint.forThisDevice(this)?.let { guest.add("${com.droiddeck.launcher.gpu.TpUbwcHint.ENV}=$it") }
val clientPinned = steamHere && SessionPrefs.clientCpusOverride(this)
if (clientPinned) {
guest.add("BL_CLIENT_CPUS=" + CpuCores.listOrAll(SessionPrefs.clientCpus(this)))
guest.add("DD_CLIENT_CPUS=" + CpuCores.listOrAll(SessionPrefs.clientCpus(this)))
}
CpuCores.gameLaunchList(SessionPrefs.gameCpus(this), clientPinned)
.takeIf { it.isNotEmpty() }?.let { guest.add("BL_GAME_CPUS=$it") }
.takeIf { it.isNotEmpty() }?.let { guest.add("DD_GAME_CPUS=$it") }
}
private fun startVkBridge(guest: MutableList<String>, sessionDir: File) {
@@ -1061,16 +1063,16 @@ class SessionService : Service() {
val bridge = com.droiddeck.launcher.gpu.VkBridgeComponent(socket, File(sessionDir, "vkbridge-server.log"))
bridge.attach(this)
components.add(bridge)
guest.add("BL_VKBRIDGE=1")
if (SessionPrefs.steamGpuCompositing(this)) guest.add("BL_STEAM_GPU_COMPOSITING=1")
guest.add("DD_VKBRIDGE=1")
if (SessionPrefs.steamGpuCompositing(this)) guest.add("DD_STEAM_GPU_COMPOSITING=1")
SessionPrefs.linuxDriver(this).takeIf { it.isNotEmpty() }
?.let { runCatching { LinuxVulkanDriver.resolveIcdPath(this, it) }.getOrNull() }
?.let { guest.add("BL_VKBRIDGE_FALLBACK_ICD=$it") }
?.let { guest.add("DD_VKBRIDGE_FALLBACK_ICD=$it") }
guest.add("VKBRIDGE_SOCKET=" + socket.path)
guest.add("VKBRIDGE_CLIENT_LOG=" + File(sessionDir, "vkbridge-client.log").path)
guest.add("VKBRIDGE_MODE=" + SessionPrefs.vkBridgeMode(this))
LinuxRuntime.gpuStandIn(this)?.let { node ->
guest.add("BL_DRM_STANDIN=$node")
guest.add("DD_DRM_STANDIN=$node")
LinuxRuntime.deviceNumbers(node)?.let { guest.add("VKBRIDGE_DRM_RENDER=$it") }
}
Log.i(TAG, "vkbridge: on (${com.droiddeck.launcher.core.DeviceSupport.gpuName(this)}, ${SessionPrefs.vkBridgeMode(this)} mode), socket $socket")
@@ -1084,7 +1086,7 @@ class SessionService : Service() {
SessionPrefs.directAudio(this)
val wantsMic = SessionPrefs.micEnabled(this) &&
checkSelfPermission(android.Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED
guest.add("BL_MIC_ENABLED=" + if (wantsMic) "1" else "0")
guest.add("DD_MIC_ENABLED=" + if (wantsMic) "1" else "0")
guest.add("AUDIO_DIRECT_MIC=" + if (wantsMic) "1" else "0")
val audioDir = File(filesDir, "directaudio").apply { mkdirs() }
val relaySocket = File(audioDir, "relay.sock")
@@ -1112,7 +1114,7 @@ class SessionService : Service() {
components.add(relay)
}
if (wantsDirectAudio) {
guest.add("BL_DIRECTAUDIO=/" + SessionFiles.DIRECTAUDIO_DIR)
guest.add("DD_DIRECTAUDIO=/" + SessionFiles.DIRECTAUDIO_DIR)
guest.add("AUDIO_DIRECT_RELAY=" + relaySocket.absolutePath)
val lowLatency = com.droiddeck.launcher.audio.DirectAudioTiming.lowLatencyOutput()
val timing = com.droiddeck.launcher.audio.DirectAudioTiming.environment(lowLatency)
@@ -1268,9 +1270,9 @@ class SessionService : Service() {
)
if (device != null) {
val envAt = guest.indexOf(LinuxRuntime.SESSION_SCRIPT).takeIf { it >= 0 } ?: guest.size
guest.add(envAt, "BL_STORAGE_DIAGNOSTICS=1")
guest.add(envAt + 1, "BL_STORAGE_DEVICE=$device")
guest.add(envAt + 2, "BL_STORAGE_LOG=${File(sessionDir, "storage.log").absolutePath}")
guest.add(envAt, "DD_STORAGE_DIAGNOSTICS=1")
guest.add(envAt + 1, "DD_STORAGE_DEVICE=$device")
guest.add(envAt + 2, "DD_STORAGE_LOG=${File(sessionDir, "storage.log").absolutePath}")
} else {
Log.w(TAG, "storage diagnostics: selected library could not be identified; metadata snapshot only")
}
@@ -1415,7 +1417,7 @@ class SessionService : Service() {
val listing = File(filesDir, "session/steam-libraries-x64.json").apply { parentFile?.mkdirs() }
listing.writeText(x64Libraries.toString())
val envAt = guest.indexOf(LinuxRuntime.SESSION_SCRIPT).takeIf { it >= 0 } ?: guest.size
guest.add(envAt, "BL_X64_STEAM_LIBRARIES=" + listing.path)
guest.add(envAt, "DD_X64_STEAM_LIBRARIES=" + listing.path)
} catch (e: Exception) {
Log.w(TAG, "x86-64 steam library: the list could not be written; internal storage alone this session", e)
}
@@ -1425,7 +1427,7 @@ class SessionService : Service() {
for ((path, label) in libraries) json.put(org.json.JSONObject().put("path", path).put("label", label.replace('"', ' ').replace('\\', ' ')))
listing.writeText(json.toString())
val envAt = guest.indexOf(LinuxRuntime.SESSION_SCRIPT).takeIf { it >= 0 } ?: guest.size
guest.add(envAt, "BL_STEAM_LIBRARIES=" + listing.path)
guest.add(envAt, "DD_STEAM_LIBRARIES=" + listing.path)
} catch (e: Exception) {
Log.w(TAG, "steam library: the list could not be written; the card alone this session", e)
}
@@ -1446,7 +1448,7 @@ class SessionService : Service() {
}
listing.writeText(volumes.toString())
val envAt = guest.indexOf(LinuxRuntime.SESSION_SCRIPT).takeIf { it >= 0 } ?: guest.size
guest.add(envAt, "BL_DESKTOP_VOLUMES=" + listing.path)
guest.add(envAt, "DD_DESKTOP_VOLUMES=" + listing.path)
} catch (e: Exception) {
Log.w(TAG, "desktop volumes: the list could not be written", e)
}
@@ -286,7 +286,7 @@ internal class SessionSuspendController(
}
val targets = records.values.filter { record ->
try {
File(procRoot, "${record.pid}/maps").useLines { lines -> lines.any { it.endsWith("/libblsession.so") } }
File(procRoot, "${record.pid}/maps").useLines { lines -> lines.any { it.endsWith("/libddsession.so") } }
} catch (_: IOException) {
false
}
@@ -115,7 +115,7 @@ internal class SteamDownloadMonitor {
val steam = File(home, ".local/share/Steam")
val stamped = File(steam, "package/droiddeck-installed").isFile ||
File(steam, "package/bannerlator-installed").isFile
return !(stamped && File(steam, "steamrtarm64/steam").isFile) || File(home, ".bl-steam-repair").exists()
return !(stamped && File(steam, "steamrtarm64/steam").isFile) || File(home, ".dd-steam-repair").exists()
}
internal fun manifests(runtimeRoot: File, mounts: Map<String, File>): List<File> {
@@ -6,7 +6,7 @@ import java.io.File
object SteamRepair {
private fun home(context: Context) = File(LinuxRuntime.rootDir(context), "root")
private fun request(context: Context) = File(home(context), ".bl-steam-repair")
private fun request(context: Context) = File(home(context), ".dd-steam-repair")
private fun unconfirmed(context: Context) = File(home(context), ".local/share/Steam/package/droiddeck-unconfirmed")
private fun x64Unconfirmed(context: Context) = File(home(context), ".droiddeck-x64/.local/share/Steam/package/droiddeck-unconfirmed")
@@ -102,7 +102,7 @@ class VenusComponent(private val logFile: File?) : SessionPart() {
// (Steam's GL, Xwayland's glamor) requires robustness2's nullDescriptor, which the
// layer stands in for. The session script checks it and falls back to llvmpipe.
"DROIDDECK_MALI_COMPAT=1",
"BL_VENUS=1",
"DD_VENUS=1",
// gamescope's composite layout without immutable YCbCr samplers from the start
// (patch 0930): a Mali-G615 refused every composite pipeline with them, and testing
// that through Venus took the render server down.
@@ -70,7 +70,7 @@ class BottomDesktopCompositorService : Service() {
FileUtils.copyAsset(this, "wayland/keymap.xkb", File(runtimeDir, "keymap.xkb"))
data.getString(KEY_LOG)?.let { path ->
WaylandCompositor.setSessionLogFile(File(path))
runCatching { android.system.Os.setenv("BL_WAYLAND_LOG", path, true) }
runCatching { android.system.Os.setenv("DD_WAYLAND_LOG", path, true) }
.onFailure { Log.w(TAG, "could not point the compositor's log at $path", it) }
}
WaylandCompositor.setFirstFrameListener { reply(MSG_FIRST_FRAME) }
@@ -50,7 +50,7 @@ object CompositorHost {
refreshHz: Float,
fpsLimit: Int,
): Boolean {
WaylandCompositor.nativeSetClockControl(java.io.File(context.filesDir, "${com.droiddeck.launcher.runtime.LinuxRuntime.DIR}/tmp/.bl-clock").path)
WaylandCompositor.nativeSetClockControl(java.io.File(context.filesDir, "${com.droiddeck.launcher.runtime.LinuxRuntime.DIR}/tmp/.dd-clock").path)
ownVsyncThread = SessionPrefs.vsyncThread(context)
WaylandCompositor.nativeSetRenderOnCommit(SessionPrefs.renderOnCommit(context))
blackFrameInsertion = SessionPrefs.blackFrameInsertion(context)
@@ -84,7 +84,7 @@ public class DroidDeckLowLatencyDecoderFactory implements VideoDecoderFactory {
private Surface standInSurface() {
if (standIn == null) {
standInThread = new HandlerThread("bl-decoder-standin");
standInThread = new HandlerThread("dd-decoder-standin");
standInThread.start();
standIn = ImageReader.newInstance(Math.max(width, 16), Math.max(height, 16), ImageFormat.PRIVATE, 3);
standIn.setOnImageAvailableListener(reader -> {
@@ -209,7 +209,7 @@ class AgentSecurityTest {
@Test fun fastPathLibraryIsValidatedAndSelectedForOneSession() {
AgentAccess.setCommandsEnabled(context, true)
val source = File(AgentEnv.inbox(context).apply { mkdirs() }, "libblfastpath.so")
val source = File(AgentEnv.inbox(context).apply { mkdirs() }, "libddfastpath.so")
source.writeText("wrong architecture")
refused("INVALID_LIBRARY") { AgentEnv.override(context, source.name) }
val header = ByteArray(64)
@@ -227,11 +227,43 @@ class AgentSecurityTest {
assertEquals(64, response.getString("sha256").length)
assertEquals(ProotFastPath.LIBRARY, AgentEnv.fastPathLibrary(context))
AgentEnv.beginSession(context)
assertEquals("/opt/droiddeck-agent/bin/libblfastpath.so", AgentEnv.fastPathLibrary(context))
assertEquals("/opt/droiddeck-agent/bin/libddfastpath.so", AgentEnv.fastPathLibrary(context))
AgentEnv.endSession(context)
assertEquals(ProotFastPath.LIBRARY, AgentEnv.fastPathLibrary(context))
}
@Test fun aFastPathOverrideQueuedUnderTheOldNameStillApplies() {
AgentAccess.setCommandsEnabled(context, true)
File(AgentEnv.inbox(context).apply { mkdirs() }, "libblfastpath.so").writeText("old")
refused("INVALID_NAME") { AgentEnv.override(context, "libblfastpath.so") }
val bin = File(LinuxRuntime.rootDir(context), "opt/droiddeck-agent/bin").apply { mkdirs() }
File(bin, "libblfastpath.so").writeText("queued")
File(context.filesDir, "agent-env.json").writeText("""{"pendingOverrides":["libblfastpath.so"]}""")
AgentEnv.beginSession(context)
assertEquals("/opt/droiddeck-agent/bin/libddfastpath.so", AgentEnv.fastPathLibrary(context))
assertEquals("queued", File(bin, "libddfastpath.so").readText())
assertFalse(File(bin, "libblfastpath.so").exists())
AgentEnv.endSession(context)
}
@Test fun aQueuedOldNameOverrideThatCannotBeRenamedWaits() {
AgentAccess.setCommandsEnabled(context, true)
val bin = File(LinuxRuntime.rootDir(context), "opt/droiddeck-agent/bin").apply { mkdirs() }
File(bin, "libblfastpath.so").writeText("queued")
File(context.filesDir, "agent-env.json").writeText("""{"pendingOverrides":["libblfastpath.so"]}""")
bin.setWritable(false)
try {
org.junit.Assume.assumeFalse(bin.canWrite())
AgentEnv.beginSession(context)
assertEquals(ProotFastPath.LIBRARY, AgentEnv.fastPathLibrary(context))
assertTrue(File(bin, "libblfastpath.so").isFile)
val state = JSONObject(File(context.filesDir, "agent-env.json").readText())
assertEquals("libddfastpath.so", state.getJSONArray("pendingOverrides").getString(0))
} finally {
bin.setWritable(true)
}
}
@Test fun environmentValuesAreNotLogged() {
AgentAccess.setCommandsEnabled(context, true)
AgentEnv.set(context, listOf("CUSTOM=synthetic-private-value"), false)
@@ -134,12 +134,12 @@ class GameEnvironmentTest {
assertEquals("1", chosen.games["42"]!!["FEX_TSOENABLED"])
}
val ntsync = GameEnvironment.withGameSync(base, "42", "ntsync").games["42"]!!
assertEquals(listOf("1", "0", "1"), listOf(ntsync["BL_SYNC"], ntsync["BL_FSYNC_FIRST"], ntsync["BL_SYNC_FALLBACK"]))
assertEquals(listOf("1", "0", "1"), listOf(ntsync["DD_SYNC"], ntsync["DD_FSYNC_FIRST"], ntsync["DD_SYNC_FALLBACK"]))
assertFalse(ntsync.containsKey("PROTON_NO_ESYNC"))
val fsync = GameEnvironment.withGameSync(base, "42", "fsync").games["42"]!!
assertEquals(listOf("0", "1", "1", "1"), listOf(fsync["BL_SYNC"], fsync["BL_FSYNC_FIRST"], fsync["BL_SYNC_FALLBACK"], fsync["PROTON_NO_ESYNC"]))
assertEquals(listOf("0", "1", "1", "1"), listOf(fsync["DD_SYNC"], fsync["DD_FSYNC_FIRST"], fsync["DD_SYNC_FALLBACK"], fsync["PROTON_NO_ESYNC"]))
val wineserver = GameEnvironment.withGameSync(base, "42", "wineserver").games["42"]!!
assertEquals(listOf("0", "0", "0"), listOf(wineserver["BL_SYNC"], wineserver["BL_FSYNC_FIRST"], wineserver["BL_SYNC_FALLBACK"]))
assertEquals(listOf("0", "0", "0"), listOf(wineserver["DD_SYNC"], wineserver["DD_FSYNC_FIRST"], wineserver["DD_SYNC_FALLBACK"]))
val inherited = GameEnvironment.withGameSync(base, "42", null)
assertNull(GameEnvironment.gameSync(inherited, "42"))
assertEquals(mapOf("FEX_TSOENABLED" to "1"), inherited.games["42"])
@@ -35,7 +35,7 @@ class ModeSettingsLoadingTest {
@Test fun desktopDoesNotConsumeSteamsAppliedShaderChoice() {
val activity = Robolectric.buildActivity(FrontEndActivity::class.java).get()
SessionPrefs.setShaderPrecache(activity, false)
val applied = File(LinuxRuntime.rootDir(activity), "root/.bl-shader-precache-applied")
val applied = File(LinuxRuntime.rootDir(activity), "root/.dd-shader-precache-applied")
applied.parentFile!!.mkdirs()
applied.writeText("0")
load(activity, SessionService.MODE_DESKTOP)
@@ -82,7 +82,7 @@ class FrameStatsTest {
}
@Test fun guestFrameTimesMoveByThePausedSessionsClockShift() {
val control = java.io.File.createTempFile("bl-clock", null)
val control = java.io.File.createTempFile("dd-clock", null)
try {
control.writeBytes(java.nio.ByteBuffer.allocate(8).order(java.nio.ByteOrder.LITTLE_ENDIAN).putLong(62_283_930_706L).array())
val feed = GameFrameFeed(java.io.File("/nonexistent/droiddeck-hud/frames"), clockControl = control)
@@ -60,10 +60,10 @@ class BwrapSpawnerTest {
val env = mutableMapOf(
"DDNATV_ROOT" to rootfs, "DDNATV_BINDS" to "/dev:/dev", "HOME" to "/root",
"SPA_PLUGIN_DIR" to "/usr/local/lib/droiddeck-pipewire/lib/spa-0.2",
"LD_PRELOAD" to "/run/droiddeck-preload/libblsession.so:$rootfs/usr/local/lib/libblsession.so:$rootfs/usr/lib/libddnatv-hook.so",
"LD_PRELOAD" to "/run/droiddeck-preload/libddsession.so:$rootfs/usr/local/lib/libddsession.so:$rootfs/usr/lib/libddnatv-hook.so",
)
BwrapSpawner.withoutRootfsSettings(env, rootfs)
assertEquals(mapOf("HOME" to "/root", "LD_PRELOAD" to "/run/droiddeck-preload/libblsession.so"), env)
assertEquals(mapOf("HOME" to "/root", "LD_PRELOAD" to "/run/droiddeck-preload/libddsession.so"), env)
val onlySession = mutableMapOf("LD_PRELOAD" to "$rootfs/usr/lib/libddnatv-hook.so")
BwrapSpawner.withoutRootfsSettings(onlySession, rootfs)
assertTrue(onlySession.isEmpty())
@@ -117,33 +117,33 @@ class BwrapSpawnerPlanTest {
lib.parentFile!!.mkdirs()
lib.writeText("")
val root = File(dir, "root").apply { mkdirs() }
for (session in listOf(emptyMap(), mapOf("BL_DESKTOP" to "1"),
mapOf("BL_DESKTOP" to "1", "GALLIUM_DRIVER" to "zink", "MESA_LOADER_DRIVER_OVERRIDE" to "zink"))) {
for (session in listOf(emptyMap(), mapOf("DD_DESKTOP" to "1"),
mapOf("DD_DESKTOP" to "1", "GALLIUM_DRIVER" to "zink", "MESA_LOADER_DRIVER_OVERRIDE" to "zink"))) {
val env = session.toMutableMap()
val binds = BwrapSpawner.gpu(runtime.path, root, env, true)!!
assertTrue(binds.any { it.host == lib.canonicalPath && it.guest == "/run/droiddeck-gpu/libvulkan_freedreno.so" })
assertEquals("/run/droiddeck-gpu/freedreno_icd.json", env["VK_DRIVER_FILES"])
assertEquals("zink", env["GALLIUM_DRIVER"])
assertEquals(session["BL_DESKTOP"], env["BL_DESKTOP"])
assertEquals(session["DD_DESKTOP"], env["DD_DESKTOP"])
}
for (choice in listOf(mapOf("VK_DRIVER_FILES" to "/custom/icd.json"),
mapOf("VK_ICD_FILENAMES" to ""), mapOf("LIBGL_ALWAYS_SOFTWARE" to "1"))) {
val env = (choice + ("BL_DESKTOP" to "1")).toMutableMap()
val env = (choice + ("DD_DESKTOP" to "1")).toMutableMap()
val original = env.toMap()
assertEquals(null, BwrapSpawner.gpu(runtime.path, root, env, true))
assertEquals(original, env)
}
val env = mutableMapOf("BL_DESKTOP" to "1", "GALLIUM_DRIVER" to "llvmpipe")
val env = mutableMapOf("DD_DESKTOP" to "1", "GALLIUM_DRIVER" to "llvmpipe")
assertTrue(BwrapSpawner.gpu(runtime.path, root, env, true)!!.isNotEmpty())
assertEquals("llvmpipe", env["GALLIUM_DRIVER"])
val gamescope = mutableMapOf("BL_DESKTOP" to "1", "LIBGL_ALWAYS_SOFTWARE" to "1", "GAMESCOPE_WAYLAND_DISPLAY" to "gamescope-0")
val gamescope = mutableMapOf("DD_DESKTOP" to "1", "LIBGL_ALWAYS_SOFTWARE" to "1", "GAMESCOPE_WAYLAND_DISPLAY" to "gamescope-0")
assertTrue(BwrapSpawner.gpu(runtime.path, root, gamescope, true)!!.isNotEmpty())
val unavailable = mutableMapOf("BL_DESKTOP" to "1")
val unavailable = mutableMapOf("DD_DESKTOP" to "1")
assertEquals(null, BwrapSpawner.gpu(runtime.path, root, unavailable, false))
assertEquals(mapOf("BL_DESKTOP" to "1"), unavailable)
assertEquals(mapOf("DD_DESKTOP" to "1"), unavailable)
assertTrue(lib.delete())
assertEquals(null, BwrapSpawner.gpu(runtime.path, root, unavailable, true))
assertEquals(mapOf("BL_DESKTOP" to "1"), unavailable)
assertEquals(mapOf("DD_DESKTOP" to "1"), unavailable)
}
@Test fun buildsTheTreeFlatpakAsksFor() {
@@ -181,8 +181,8 @@ class BwrapSpawnerPlanTest {
@Test fun fexSandboxesStartThroughTheEnvTheyBringAndSkipArmPreloads() {
val context = RuntimeEnvironment.getApplication()
val rootfs = LinuxRuntime.rootDir(context)
val lib = File(rootfs, "usr/local/lib/libblsession.so").apply { parentFile?.mkdirs(); writeText("") }
val preload = File(rootfs, "etc/ld.so.preload").apply { parentFile?.mkdirs(); writeText("/usr/local/lib/libblsession.so\n") }
val lib = File(rootfs, "usr/local/lib/libddsession.so").apply { parentFile?.mkdirs(); writeText("") }
val preload = File(rootfs, "etc/ld.so.preload").apply { parentFile?.mkdirs(); writeText("/usr/local/lib/libddsession.so\n") }
try {
val plan = BwrapSpawner.plan(context, request(op("t" to "dir", "dest" to "/tmp"))
.put("envTool", "/run/droiddeck-fex/bin/env"), dir)
@@ -197,12 +197,12 @@ class BwrapSpawnerPlanTest {
@Test fun sandboxedAppsSeeTheSessionsNetworkLink() {
val context = RuntimeEnvironment.getApplication()
val rootfs = LinuxRuntime.rootDir(context)
val lib = File(rootfs, "usr/local/lib/libblsession.so").apply { parentFile?.mkdirs(); writeText("") }
val preload = File(rootfs, "etc/ld.so.preload").apply { parentFile?.mkdirs(); writeText("/usr/local/lib/libblsession.so\n") }
val lib = File(rootfs, "usr/local/lib/libddsession.so").apply { parentFile?.mkdirs(); writeText("") }
val preload = File(rootfs, "etc/ld.so.preload").apply { parentFile?.mkdirs(); writeText("/usr/local/lib/libddsession.so\n") }
val link = File(rootfs, "etc/droiddeck-net").apply { writeText("if wlan0 2 1500\n") }
try {
val plan = BwrapSpawner.plan(context, request(op("t" to "dir", "dest" to "/tmp")), dir)
assertEquals("/run/droiddeck-preload/libblsession.so", plan.env["LD_PRELOAD"])
assertEquals("/run/droiddeck-preload/libddsession.so", plan.env["LD_PRELOAD"])
assertEquals(link.path, plan.binds.single { it.guest == "/etc/droiddeck-net" }.host)
} finally {
listOf(lib, preload, link).forEach { it.delete() }
@@ -93,4 +93,41 @@ class LegacyNamesTest {
assertEquals("Exec=env APPIMAGE_EXTRACT_AND_RUN=1 /opt/appimages/other.AppImage\n",
File(root, "usr/share/applications/other.desktop").readText())
}
@Test fun homeMarkersKeepTheirStateAndRetiredLibrariesGo() {
write("root/.bl-lossless-asked", "1")
write("root/.bl-compat-pending", "550\n")
write("root/.dd-seed-beat", "new")
write("root/.bl-seed-beat", "old")
write("usr/local/lib/libblsession.so", "old")
write("usr/local/lib/droiddeck-fex/x86_64/libblsession.so", "old")
write("usr/local/lib/libddsession.so", "new")
LegacyNames.migrateRootfs(root)
assertEquals("1", File(root, "root/.dd-lossless-asked").readText())
assertEquals("550\n", File(root, "root/.dd-compat-pending").readText())
assertEquals("new", File(root, "root/.dd-seed-beat").readText())
assertFalse(File(root, "root/.bl-lossless-asked").exists())
assertFalse(File(root, "root/.bl-seed-beat").exists())
assertFalse(File(root, "usr/local/lib/libblsession.so").exists())
assertFalse(File(root, "usr/local/lib/droiddeck-fex/x86_64/libblsession.so").exists())
assertEquals("new", File(root, "usr/local/lib/libddsession.so").readText())
}
@Test fun queuedRequestsUnderBothNamesAreAllKept() {
write("root/.bl-proton-extra", "ge")
write("root/.dd-proton-extra", "em\n")
LegacyNames.migrateRootfs(root)
assertEquals("em\nge\n", File(root, "root/.dd-proton-extra").readText())
assertFalse(File(root, "root/.bl-proton-extra").exists())
}
@Test fun queuedRequestsStaySeparateWhenTheNewQueueIsUnterminated() {
write("root/.bl-proton-extra", "ge\n")
write("root/.dd-proton-extra", "cachyos")
write("root/.bl-steam-urls", "steam://run/440")
write("root/.dd-steam-urls", "steam://run/570")
LegacyNames.migrateRootfs(root)
assertEquals("cachyos\nge\n", File(root, "root/.dd-proton-extra").readText())
assertEquals("steam://run/570\nsteam://run/440\n", File(root, "root/.dd-steam-urls").readText())
}
}
@@ -679,11 +679,11 @@ class EsyncPacksTest {
val root = temp.newFolder("rootfs")
EsyncPacks.store(root).mkdirs()
assertEquals(0, EsyncPacks.fetchWanted(context, root))
GameEnvironmentStore.save(context, GameEnvironment.Config(games = mapOf("42" to mapOf("BL_SYNC_FALLBACK" to "1"))))
GameEnvironmentStore.save(context, GameEnvironment.Config(games = mapOf("42" to mapOf("DD_SYNC_FALLBACK" to "1"))))
assertTrue(EsyncPacks.enabled(context))
GameEnvironmentStore.save(context, GameEnvironment.Config(shared = mapOf("BL_SYNC_FALLBACK" to "1")))
GameEnvironmentStore.save(context, GameEnvironment.Config(shared = mapOf("DD_SYNC_FALLBACK" to "1")))
assertTrue(EsyncPacks.enabled(context))
GameEnvironmentStore.save(context, GameEnvironment.Config(games = mapOf("42" to mapOf("BL_SYNC_FALLBACK" to "0"))))
GameEnvironmentStore.save(context, GameEnvironment.Config(games = mapOf("42" to mapOf("DD_SYNC_FALLBACK" to "0"))))
assertFalse(EsyncPacks.enabled(context))
SessionPrefs.setSyncFallback(context, true)
assertTrue(EsyncPacks.enabled(context))
@@ -41,6 +41,6 @@ class FexCatalogTest {
@Test fun theSessionGetsTheBuildAndEverySource() {
val env = FexCatalog.environment(FexCatalog.Build("fex-2610-r5", url, sha), listOf(url, "https://ghfast.top/$url"))
assertEquals(listOf("BL_FEX_TAG=fex-2610-r5", "BL_FEX_SHA256=$sha", "BL_FEX_URLS=$url https://ghfast.top/$url"), env)
assertEquals(listOf("DD_FEX_TAG=fex-2610-r5", "DD_FEX_SHA256=$sha", "DD_FEX_URLS=$url https://ghfast.top/$url"), env)
}
}
@@ -315,4 +315,12 @@ class GameEnvironmentStoreTest {
GameEnvironmentStore.save(context, config)
assertEquals(config, GameEnvironmentStore.read(context))
}
@Test fun savedSettingsFromBeforeTheRenameKeepTheirValues() {
val json = JSONObject("""{"version":1,"shared":{"BL_SYNC":"1","DXVK_HUD":"fps"},
"games":{"440":{"BL_FSYNC_FIRST":"1","BL_SYNC_FALLBACK":"0","DD_SYNC_FALLBACK":"1"}}}""")
val config = GameEnvironmentStore.decode(json)
assertEquals(mapOf("DD_SYNC" to "1", "DXVK_HUD" to "fps"), config.shared)
assertEquals(mapOf("DD_FSYNC_FIRST" to "1", "DD_SYNC_FALLBACK" to "1"), config.games["440"])
}
}
@@ -39,7 +39,7 @@ class SessionSuspendControllerTest {
assertEquals(listOf(Triple(1, 1_000_000L, 3_000_000L)), fixture.pagedOut)
assertEquals(0, fixture.unacknowledged)
assertTrue(fixture.game.threads.all { it.state == 't' })
assertFalse(File(fixture.control.parentFile, ".bl-zram.ack.$GAME").exists())
assertFalse(File(fixture.control.parentFile, ".dd-zram.ack.$GAME").exists())
}
@Test fun unchangedSwapIsNotTakenForAFinishedPageOut() {
@@ -478,8 +478,8 @@ class SessionSuspendControllerTest {
var emptyGameTasks = false
var rootGone = false
var afterSleep: (() -> Unit)? = null
val control = File(tmp, ".bl-zram")
val clock = File(tmp, ".bl-clock")
val control = File(tmp, ".dd-zram")
val clock = File(tmp, ".dd-clock")
var clockAtContinue: Long? = null
var clockAtMapping: Long? = null
val pagedOut = mutableListOf<Triple<Int, Long, Long>>()
@@ -582,7 +582,7 @@ class SessionSuspendControllerTest {
"TracerPid: ${group.tracer}\n" +
if (group == game) "VmRSS:\t$gameResidentKb kB\nVmSwap:\t$gameSwapKb kB\n" else "",
)
if (group == game) File(dir, "maps").writeText("7f00000000-7f00001000 r-xp 00000000 fe:05 42 /usr/local/lib/libblsession.so\n")
if (group == game) File(dir, "maps").writeText("7f00000000-7f00001000 r-xp 00000000 fe:05 42 /usr/local/lib/libddsession.so\n")
val taskDir = File(dir, "task")
if (group == game && missingGameTasks) { taskDir.deleteRecursively(); continue }
taskDir.mkdirs()
@@ -250,7 +250,7 @@ class SteamDownloadMonitorTest {
File(steam, "package").mkdirs()
File(steam, "package/bannerlator-installed").writeText("1\n")
assertFalse(SteamDownloadMonitor.clientInstallPending(root))
File(root, "root/.bl-steam-repair").writeText("1\n")
File(root, "root/.dd-steam-repair").writeText("1\n")
assertTrue(SteamDownloadMonitor.clientInstallPending(root))
} finally {
root.deleteRecursively()
+2 -2
View File
@@ -151,7 +151,7 @@ tools/droiddeckctl env set DXVK_HUD=fps
tools/droiddeckctl env list
tools/droiddeckctl env clear [next|persistent|all]
tools/droiddeckctl override gamescope ./gamescope
tools/droiddeckctl override libblfastpath.so ./libblfastpath.so
tools/droiddeckctl override libddfastpath.so ./libddfastpath.so
tools/droiddeckctl proot-profile enable --slow-us 1000
tools/droiddeckctl proot-profile disable
tools/droiddeckctl proot-profile report ./session.log --sort wall
@@ -436,7 +436,7 @@ through first, since the launcher window carries the game's app id too:
`proot-profile enable` queues handler profiling for the next session using the existing debugging
consent gate. Counters and bounded slow samples appear in `session.log`; `proot-profile report`
ranks a saved local log without ADB. This measures PRoot handler work, not full syscall latency.
`override libblfastpath.so FILE` selects a glibc ARM64 shared library in the next session's preload
`override libddfastpath.so FILE` selects a glibc ARM64 shared library in the next session's preload
list, reports its SHA-256, and refuses installation until the current session stops. It lasts for
one session; the next session stages the bundled library again. See
[the profiling workflow](development/proot-performance.md#finding-the-next-fast-path) for timing
+1 -1
View File
@@ -10,7 +10,7 @@ publishes it on the Steam Deck client channels. `droiddeck-steam-install` instal
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.
- Setting: `BL_STEAM_CHANNEL`, otherwise `~/.config/droiddeck/steam-channel`, set to `beta` or
- 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
(`package/droiddeck-channel`) until a setting says otherwise. The fallback happens:
+3 -3
View File
@@ -1,6 +1,6 @@
# Low-memory reclaim and userspace compression
The Steam session monitor uses the existing `libblsession.so` page-out request to reclaim
The Steam session monitor uses the existing `libddsession.so` page-out request to reclaim
private anonymous launcher memory. The default remains a request 20 seconds after game focus,
with five minutes between requests. With client compression enabled, low system headroom can
also trigger a request while a game is loading, before its first focused window.
@@ -58,7 +58,7 @@ percentage: Android's `lmkd` killed a session on a 7.5 GiB device with
kill. A world load added 1 GiB of GPU memory in about ten seconds, and compressing 1.4 GiB took
2.6 seconds, so the request has to leave room for both.
Performance > Compress idle game memory turns this off (`BL_ZRAM_IDLE=0`); launcher compression
Performance > Compress idle game memory turns this off (`DD_ZRAM_IDLE=0`); launcher compression
and the RAM cap are unaffected.
The session request runs when real headroom falls below a quarter of RAM (bounded to
@@ -71,7 +71,7 @@ for either to complete, so a slow launcher acknowledgement does not delay the ga
request finishes, its anonymous RSS remains reserved from the session's swap budget. Completion
and backoff are measured against the processes that received each request, even if a later scan
finds different processes. The session request targets processes that loaded
`libblsession.so`: the game, Wine and its services, and excludes Steam and hidden launchers.
`libddsession.so`: the game, Wine and its services, and excludes Steam and hidden launchers.
Requests are at least 30 seconds apart and need the same
swap reserve as launcher requests. When the session has read back more than half of what the
previous request compressed, that memory is in use: the request is skipped and the wait doubles,
+1 -1
View File
@@ -164,7 +164,7 @@ App (Kotlin/C):
- Gives a zero row pitch a packed 64-byte row (gamescope's 1x1 root buffer).
- `gpu/GpuInfo.kt`, `FrontEndActivity.kt`, `core/DeviceReport.kt`: wording, plus a "Venus" line in `device.txt`.
- `session/SessionFiles.kt`: stages the Mali compatibility layer when the APK carries it.
- `tools/linuxfs/preload/venus.c` (new, part of `libblsession`): unsets `LIBGL_KOPPER_DISABLE` when `VN_DEBUG` has `vtest`.
- `tools/linuxfs/preload/venus.c` (new, part of `libddsession`): unsets `LIBGL_KOPPER_DISABLE` when `VN_DEBUG` has `vtest`.
- Steam's `steamwebhelper.sh` sets it unconditionally.
- Without kopper and without DRI3, Zink gets no GL context, and the Steam UI crash-loops.
- Steam restores that script when it verifies its install, so it cannot be edited.
+9 -9
View File
@@ -47,7 +47,7 @@ waits; it does not establish a full-install PRoot overhead percentage.
```
SessionService ─HostProcess─▶ libproot.so (ONE tracer process, nice -6 after 2 s)
└─ /usr/bin/env -i … droiddeck-session steam
└─ gamescope ─▶ droiddeck-session (BL_INSIDE) ─▶ steamrtarm64/steam (+ steamwebhelper/CEF tree)
└─ gamescope ─▶ droiddeck-session (DD_INSIDE) ─▶ steamrtarm64/steam (+ steamwebhelper/CEF tree)
└─ reaper ─▶ droiddeck-game-env ─▶ droiddeck-proton ─▶ Valve ARM64 Proton (python)
└─ wine (arm64ec, FEX loaded in-process as a DLL) ─▶ wineserver, game.exe, …
```
@@ -56,7 +56,7 @@ SessionService ─HostProcess─▶ libproot.so (ONE tracer process, nice -6 aft
- The options are `--kill-on-exit`, `--kernel-release=…` (kompat, for the hostname), `-i uid:uid`
(fake_id0, for Xwayland's `setgid`/`setuid`), and about 25 binds: `/dev`, `/proc`, `/sys`, fake
`/proc` and `/sys` files, the GPU node, `/dev/shm`, storage and the game libraries.
- `/etc/ld.so.preload` loads `libblsession.so` (the `tools/linuxfs/preload/*.c` shims) into every
- `/etc/ld.so.preload` loads `libddsession.so` (the `tools/linuxfs/preload/*.c` shims) into every
guest process.
- The Flatpak sandboxes (`BwrapSpawner`) already run in **separate** proot instances, started from
the Android side.
@@ -187,9 +187,9 @@ Checked against bionic `android16-release`:
|---|---|---|
| `rseq`, `set_robust_list` | **blocked** | glibc, at the start of every thread, while all signals are blocked |
| `faccessat2` | **blocked** | glibc's `faccessat()`, which tries it on **every** call before falling back, so 2 round trips (`access()` calls the plain `faccessat` syscall directly) |
| `fchmodat2`, `openat2` | **blocked** | newer glibc, Flatpak/libglnx, FEX's rootfs lookups (`libblsession.so` turns `openat2` into `openat`, resolving `RESOLVE_IN_ROOT` paths component by component inside the root) |
| `fchmodat2`, `openat2` | **blocked** | newer glibc, Flatpak/libglnx, FEX's rootfs lookups (`libddsession.so` turns `openat2` into `openat`, resolving `RESOLVE_IN_ROOT` paths component by component inside the root) |
| `setuid`, `setgid` and the rest of the family | **blocked** | Xwayland (hence `-i`) |
| `futex_waitv`, `io_uring_*`, `landlock_*` | **blocked** | Proton's fsync (droiddeck-fsync answers `futex_waitv` in `libblsession.so`), some engines |
| `futex_waitv`, `io_uring_*`, `landlock_*` | **blocked** | Proton's fsync (droiddeck-fsync answers `futex_waitv` in `libddsession.so`), some engines |
| `clone3` | blocked before Android 15 | glibc `pthread_create` |
| `close_range` | blocked on Android 12 | |
| `statx`, `process_vm_readv`/`writev`, `memfd_create`, `pidfd_*`, `seccomp` | allowed | |
@@ -300,7 +300,7 @@ it needs `patches/0014`, enabled with `PROOT_FASTPATH=1`.
library file itself at the fixed address instead, as proot's loader does for every program.
- Nothing claims `0xffff00000` first.
- The stub's syscalls pass Android's filter. They should: all are allowed.
- **Integrate into `libblsession.so`** rather than a second preload. `opens.c` and `pathcache.c`
- **Integrate into `libddsession.so`** rather than a second preload. `opens.c` and `pathcache.c`
already define `open` and `access`, so their "real" call should become the fast path. That also
removes the second library's load cost, about 0.2–0.4 ms per exec that is still unexplained (see
the exec row above).
@@ -375,19 +375,19 @@ Build a **glibc ARM64** library using the same toolchain as the shipped fast pat
docker run --rm --platform linux/amd64 --user "$(id -u):$(id -g)" \
-v "$PWD:/src" -w /src droiddeck-local-cross:24.04-v3 \
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \
-o /src/libblfastpath.so tools/proot/fastpath/fastpath.c -ldl
-o /src/libddfastpath.so tools/proot/fastpath/fastpath.c -ldl
tools/droiddeckctl stop
tools/droiddeckctl override libblfastpath.so ./libblfastpath.so
tools/droiddeckctl override libddfastpath.so ./libddfastpath.so
tools/droiddeckctl proot-profile enable
tools/droiddeckctl start steam --wait
```
The existing override bridge now recognizes `libblfastpath.so`: it checks ELF class, endianness,
The existing override bridge now recognizes `libddfastpath.so`: it checks ELF class, endianness,
type, and machine, reports SHA-256, and selects that file in `/etc/ld.so.preload` for one session.
It rejects installation while a session is active. This is an architecture check, not validation
of libc compatibility or the library's behavior. The fast path still requires its normal enabled
setting and the patched PRoot pack. Its basename stays `libblfastpath.so`, so `libblsession`'s FEX
setting and the patched PRoot pack. Its basename stays `libddfastpath.so`, so `libddsession`'s FEX
routing finds it. Guest-command restaging retains the active selection. After stopping, the next
session stages the bundled preload again; `env clear all` cancels queued overrides.
+3 -3
View File
@@ -63,7 +63,7 @@ handles the same constraint with `libproot-loader.so`.
## Compared with DroidDeck
| | DroidDeck (proot + 0001–0018 + `libblfastpath.so`) | proroot |
| | DroidDeck (proot + 0001–0018 + `libddfastpath.so`) | proroot |
|---|---|---|
| exec, `PT_INTERP`, `/proc/self/exe` | proot's loader under ptrace, 0.4–0.8 ms per exec | Its own loaders, with no tracer; also needs its own ld.so with a glibc offset table |
| path calls through libc wrappers | fast path, about 0.6–1.9 µs | runtime hooks |
@@ -82,7 +82,7 @@ DroidDeck is as a fast path *in front of* proot.
## What is worth taking
1. **Patch glibc's svc sites from `libblfastpath.so`'s constructor.** This is the largest gain
1. **Patch glibc's svc sites from `libddfastpath.so`'s constructor.** This is the largest gain
and the cheapest way to do option 6 in [proot-performance](proot-performance.md) ("a proot-aware
glibc") without rebuilding glibc.
- For `libc.so.6` (and `ld-linux-aarch64.so.1` for runtime `dlopen`), rewrite each `svc #0`
@@ -136,7 +136,7 @@ netlink and SysV shm (`netif.c` and `sysv.c` already cover these); and the long-
`tools/proot/fastpath/svc-patch.h`, included by `fastpath.c`, implements the first
slice of item 1. It runs automatically in fresh processes using the replacement
`libblfastpath.so` when the ordinary fast-path configuration and tracer-key check
`libddfastpath.so` when the ordinary fast-path configuration and tracer-key check
succeed. Set `PROOT_FP_PATCH_SVC=0` to disable it for troubleshooting or comparisons;
`PROOT_FP_PATCH_SVC=1` also explicitly enables it. It skips processes that already have multiple threads,
and declines SVE/SME hardware because the relay preserves the base ARM64 register state.
+7 -7
View File
@@ -13,7 +13,7 @@ very high-resolution panels and on foldables?
## How the session is sized today (main @ c636eea3)
- `droiddeck-session` starts gamescope with `-W/-H` (output) = `-w/-h` (nested, what games and the
client see) = `BL_WIDTH x BL_HEIGHT`, the per-mode "Resolution" setting. The default is
client see) = `DD_WIDTH x DD_HEIGHT`, the per-mode "Resolution" setting. The default is
`1280x720` (`SessionDisplay.DEFAULT_RESOLUTION`). One Xwayland server holds both the Steam
client and the games.
- The Android compositor (`waylandcomp`) draws gamescope's output into a panel-sized swapchain
@@ -68,7 +68,7 @@ fullscreen off, with a spike build of `feat/steam-native-output`. Each run sets
Steam UI idle: GPU 0%, gamescope 27 dma-bufs, Xwayland 39. Everything renders at 1920x1080.
### Run 2: client height cap (`BL_STEAM_MAX_HEIGHT=720`)
### Run 2: client height cap (`DD_STEAM_MAX_HEIGHT=720`)
- Log: `== steam: the client's height capped at 720 (was unset)`. The client never wrote its own
value during the run, so a one-time set would hold.
@@ -173,15 +173,15 @@ restored): the session starts at `size=1280x720` and the device report shows `72
### How runs 2 to 6 were driven
Two temporary session-script hooks, not kept on this branch: `BL_STEAM_MAX_HEIGHT=N` wrote
`GAMESCOPE_STEAM_MAX_HEIGHT` on the root window, and `BL_GAME_XWAYLAND_MODE=WxH` wrote
Two temporary session-script hooks, not kept on this branch: `DD_STEAM_MAX_HEIGHT=N` wrote
`GAMESCOPE_STEAM_MAX_HEIGHT` on the root window, and `DD_GAME_XWAYLAND_MODE=WxH` wrote
`GAMESCOPE_XWAYLAND_MODE_CONTROL = 1,W,H,0` five seconds after `GAMESCOPE_FOCUSED_APP` showed a
game. `--xwayland-count 2` and `STEAM_MULTIPLE_XWAYLANDS=1` went through `Download/droiddeck-env`.
## Two Xwayland servers by default (`feat/steam-dual-xwayland`)
Steam sessions now start gamescope with `--xwayland-count 2` and `STEAM_MULTIPLE_XWAYLANDS=1`.
`BL_XWAYLAND_COUNT=1` in `Android/data/com.droiddeck.launcher/files/droiddeck-env` goes back to one. The session script's
`DD_XWAYLAND_COUNT=1` in `Android/data/com.droiddeck.launcher/files/droiddeck-env` goes back to one. The session script's
root-window requests that are meant for the game (the drawer's live Force fullscreen,
`GAMESCOPE_FORCE_WINDOWS_FULLSCREEN`, and the resume watcher's `GAMESCOPE_RESTORE_FOCUS_WINDOW`)
go to both displays, `$DISPLAY` and `STEAM_GAME_DISPLAY_0`. gamescope reads both per server, so
@@ -221,8 +221,8 @@ With games on their own Xwayland server, FlatOut 2 no longer shrinks under the Q
reason "Force game windows fullscreen" existed. What it still did was make any game whose Game
Resolution differs from what it draws fight it (runs 4 and 5). The switch is gone from Steam
settings (Games) and the session drawer (Display), along with its preference, the
`BL_GAMESCOPE_FORCE_FULLSCREEN` flag, the `~/.droiddeck-fill` live watcher and the device report
line. `BL_GAMESCOPE_ARGS=--force-windows-fullscreen` in `Android/data/com.droiddeck.launcher/files/droiddeck-env` still passes the
`DD_GAMESCOPE_FORCE_FULLSCREEN` flag, the `~/.droiddeck-fill` live watcher and the device report
line. `DD_GAMESCOPE_ARGS=--force-windows-fullscreen` in `Android/data/com.droiddeck.launcher/files/droiddeck-env` still passes the
flag for an experiment.
Device check (Thor): Alan Wake's American Nightmare with its 1280x720 Game Resolution runs on `:1`
+1 -1
View File
@@ -38,7 +38,7 @@ SteamTouchConfig (Steam's configs) ←─── output reports ←── Ste
- **Plugging.** The device is plugged in only while Steam's controls are shown: always in a Steam
session with that choice, since a handheld's built-in pad would keep Auto off for good. Unplugging
ends the device's report stream (the client lets the controller go); either way libfakeinput
sends a udev event through `udevmon.c`'s stand-in monitor (`bl_udevmon_inject`), since the
sends a udev event through `udevmon.c`'s stand-in monitor (`dd_udevmon_inject`), since the
sandbox gives the client no kernel uevents and its HID discovery would never look again.
## Layouts
+1 -1
View File
@@ -270,7 +270,7 @@ A game's web links reach Android: `droiddeck-store-launch` sets the prefix's
`HKCU\Software\Wine\WineBrowser` `Browsers` to `/usr/local/bin/droiddeck-open-url`, which is also
`xdg-open` first on the game's PATH, and hands http(s) addresses to the app, which opens them in
Android's browser. EOS uses this when a sign-in needs a one-time step ("corrective action"): it
falls back to a browser, the user approves on the phone, and the game signs in. `BL_DEBUG_BROWSER=1`
falls back to a browser, the user approves on the phone, and the game signs in. `DD_DEBUG_BROWSER=1`
in droiddeck-env adds `WINEDEBUG=+shell,+winebrowser`. Epic's EOS overlay is not provisioned (with
it games exited while loading); an `OverlayPath` an earlier build wrote is removed at launch. The
parked overlay work is on the branch `park/epic-eos-overlay`.
@@ -426,7 +426,7 @@ path.
still fall back.
Same workloads on the Thor, stock library against the new one (session started with
`droiddeckctl override libblfastpath.so`, PRoot profiler on):
`droiddeckctl override libddfastpath.so`, PRoot profiler on):
| Workload | Stock | New |
|---|---|---|
+23 -23
View File
@@ -2,7 +2,7 @@
Valve's x86-64 Linux Steam client, run unchanged under FEX beside the default arm64 client. It is
opt-in: Steam settings, **Steam client: x86-64** (`steamClientArch`, passed to the
session as `BL_STEAM_CLIENT_ARCH=x86_64`, applies from the next session), or the desktop menu entry
session as `DD_STEAM_CLIENT_ARCH=x86_64`, applies from the next session), or the desktop menu entry
**Steam x86-64 (FEX, experimental)**. The Library lists the active client's games and tags its
header "x86-64" while that client's list is shown. This page records why each workaround exists and what was seen
on devices. The timeline is in `docs/progress-log.md`.
@@ -11,7 +11,7 @@ on devices. The timeline is in `docs/progress-log.md`.
VAC-secured servers ("Connection Blocked ... VAC secured server") and no client log mentions VAC. VAC
modules are x86 code. Under FEX the x86-64 client has a module it can run, as SteamLite does in Wine.
**Layout.** Everything lives in its own home, `$X64_HOME` (`BL_X64_HOME`, default `~/.droiddeck-x64`):
**Layout.** Everything lives in its own home, `$X64_HOME` (`DD_X64_HOME`, default `~/.droiddeck-x64`):
its own `~/.steam` links, config, libraries, x86 rootfs and log (`steam-x64.log`). Shared with the arm64
client: the sign-in, and its `config/uioverrides` (Steam's startup movie overrides), which the x86 client
links. One client runs at a time, since both use the same account; the standalone launcher shuts the
@@ -76,7 +76,7 @@ arm64 client down first.
- **Tracer.** proot is a tracer, so tier0 believes a debugger is attached and breaks into it with int3
on the first failed assertion: the web helper died of SIGTRAP a second after every start.
`preload/tracer.c` exempts web helpers on purpose (Chromium traps on a status fd that is not
procfs); with `BL_WEBHELPER_HIDE_TRACER=1` only opens called from `libtier0_s.so` get the copy
procfs); with `DD_WEBHELPER_HIDE_TRACER=1` only opens called from `libtier0_s.so` get the copy
without the tracer.
- **FEXServer owns the rootfs.** A FEX process takes its rootfs from FEXServer, and a server started
earlier without `FEX_ROOTFS` (any FEX run in the guest) serves none: every x86 library lookup fell
@@ -86,7 +86,7 @@ arm64 client down first.
never got a browser up. FEX looks in the rootfs first, so an empty `rootfs/dev/dri` hides the node.
- **Scout runtime.** Valve ships it as `ubuntu12_32/steam-runtime.tar.xz` and `steam.sh` unpacks it.
Since `steam.sh` is not used, `--prepare` unpacks it when its checksum changes.
- **Repair.** Repair Steam (`BL_X64_REPAIR=1`), or two starts in a row that never showed the client
- **Repair.** Repair Steam (`DD_X64_REPAIR=1`), or two starts in a row that never showed the client
(`package/droiddeck-unconfirmed`; the app clears the count once the client is on screen), removes
the install stamp so the client is reinstalled. Counts from before this was tracked are dropped
rather than taken as failed starts. `droiddeck-steam-install` removes the repair request when it is
@@ -100,10 +100,10 @@ arm64 client down first.
- **FEX settings.** The app's PERFORMANCE_TSO preset (`core/FexPreset.kt`, WinNative's default). FEX's
own defaults keep half-barrier TSO and full-precision x87, which cost every x86 program time. Values
already in the environment win.
- **Fast path.** libblfastpath, preloaded into every guest process and so into FEX, broke FEX's 32-bit
- **Fast path.** libddfastpath, preloaded into every guest process and so into FEX, broke FEX's 32-bit
mode (SIGILL at start). It stands down when FEX is about to run a 32-bit program; 64-bit programs
keep it. `BL_X64_FP_OFF=1` turns it off for everything.
- **Diagnostics.** `BL_FEX` runs another FEX build (a `DEBUG_STRACE` one, say). `BL_FEXSERVER_LOG`
keep it. `DD_X64_FP_OFF=1` turns it off for everything.
- **Diagnostics.** `DD_FEX` runs another FEX build (a `DEBUG_STRACE` one, say). `DD_FEXSERVER_LOG`
starts a FEXServer in the foreground logging there; every FEX process that logs to "server"
(`FEX_OUTPUTLOG` or an AppConfig) then has its lines tagged with its pid (file logs overwrite each
other).
@@ -113,18 +113,18 @@ arm64 client down first.
The client's web helper draws its whole UI. There are two:
- **The arm64 client's helper** (`droiddeck-x64-arm-webhelper`), used when both clients are the same
Steam build (unless `BL_X64_X86_WEBHELPER=1`). FEX hands the arm64 program to the CPU, so it runs
Steam build (unless `DD_X64_X86_WEBHELPER=1`). FEX hands the arm64 program to the CPU, so it runs
natively with the session's preloads (KGSL poll fix, fast path) and the arm64 session's GPU
settings. It talks to the client over IPC, and a helper of another build never comes up: the client
restarted it every 10 s (device: 1790721607 against 1790904859). The session therefore updates the
arm64 client's parts on the same channel first (`droiddeck-steam-install --sync
steamdeck_publicbeta`). With this helper the client itself gets the GPU: it shows every Big Picture
frame the helper draws, and in software (llvmpipe under FEX) that held the UI at about 20 fps
(`BL_X64_CLIENT_SOFTWARE=1` keeps it in software). Device: 144 fps menus.
(`DD_X64_CLIENT_SOFTWARE=1` keeps it in software). Device: 144 fps menus.
- **The client's own x86 helper on the GPU** (`droiddeck-x64-webhelper`), otherwise: ANGLE's GL
backend through FEX's GL thunk to zink and Turnip. On ANGLE's Vulkan backend the x86 compositor
thread was the bottleneck (16 fps against 60). Never `--in-process-gpu`, the preload's default: a
GPU crash there took the whole helper down (102 restarts). `BL_X64_CEF_GPU=0` keeps it in software.
GPU crash there took the whole helper down (102 restarts). `DD_X64_CEF_GPU=0` keeps it in software.
Its GPU process loads libpci, which exits when `/sys/bus/pci/devices` lists a device whose files
the app may not read (a RedMagic's PCIe root ports): every GPU process exited with status 1 in about
50 ms, software ones too, until Chromium gave up ("GPU process isn't usable") and the menus stayed
@@ -132,7 +132,7 @@ The client's web helper draws its whole UI. There are two:
0 GPU process exits, ANGLE on zink and Turnip.
The session shim (`preload/net.c`) turns `steamrt64/steamwebhelper.sh`'s exec of `./steamwebhelper`
into `BL_X64_ARM_WEBHELPER`. Nothing in the client's folder is edited: the client checksums its files
into `DD_X64_ARM_WEBHELPER`. Nothing in the client's folder is edited: the client checksums its files
as it starts and reinstalled itself over an edited launcher (2-3 minutes) on every start.
Quick Access Menu and flicker, x86 helper:
@@ -149,7 +149,7 @@ Quick Access Menu and flicker, x86 helper:
`LIBGL_KOPPER_DISABLE=true` none did in 60 opens, at 60 fps instead of about 140 (Xwayland's
per-window timing for child windows). No flashes was chosen over frame rate.
Software path (no host thunks, or `BL_X64_SOFTWARE=1`): x86 Mesa has no driver for this GPU, so
Software path (no host thunks, or `DD_X64_SOFTWARE=1`): x86 Mesa has no driver for this GPU, so
llvmpipe for GL (the client's own window needs GLX) and the rootfs's own Vulkan ICDs (lavapipe). GLX
first failed because the desktop exports zink over the arm64 Turnip ICD; those variables are cleared.
`LIBGL_DRI3_DISABLE=1`: over DRI3 the X server hands out the GPU node and Mesa's software path then
@@ -187,7 +187,7 @@ alone would then read as an installed client.
0008). FEX opened every rootfs path with `openat2(RESOLVE_IN_ROOT)` and fell through to the arm64
guest on anything but EXDEV; x86 bash could not find libtinfo. Since r4 the fallback resolves the
path inside the rootfs itself (absolute symlinks restart at the rootfs, as `RESOLVE_IN_ROOT` does);
before, they resolved against the arm64 guest. `libblsession.so` (`preload/robust.c`) answers
before, they resolved against the arm64 guest. `libddsession.so` (`preload/robust.c`) answers
`openat2` first in practice and does the same walk for `RESOLVE_IN_ROOT` callers, so Valve's FEX-Emu
on the arm64 client gets it too. Each path component is then its own system call.
- `0002-thunkgen-newer-clang`: the container's newer clang has no `FileManager::clearStatCache()`,
@@ -214,7 +214,7 @@ alone would then read as an installed client.
- **Where the app gets it.** The app downloads FEX from Droid-Deck/DroidDeck-Components, where nothing is
uploaded by hand. The app follows its `fex.json`: it reads it from
Components' `main` (directly, at most every ten minutes) and keeps the last copy, and every session passes
that build to `droiddeck-fex-update` (`BL_FEX_TAG`, `BL_FEX_SHA256`, `BL_FEX_URLS` with the download
that build to `droiddeck-fex-update` (`DD_FEX_TAG`, `DD_FEX_SHA256`, `DD_FEX_URLS` with the download
source's mirrors). The script installs a build only after its archive matches the sha256 and every
program in it loads (`ld-linux --list`); the files it replaces are kept aside until the installed copy
loads too and put back otherwise, and the tag is written last. Otherwise it keeps the installed one while that still loads,
@@ -246,7 +246,7 @@ alone would then read as an installed client.
- **Mapping** (`x64_map_direct`): every game the client's appinfo cache shows with a Linux build (type
game, oslist with linux; runtime from `config/app_mappings`: SteamLinuxRuntime_sniper or _soldier,
none means scout), installed or not, so Steam downloads the Linux depots. A title on a tool chosen in
Properties keeps it, except `BL_X64_DIRECT_APPS` (Left 4 Dead 2, 550, by default), which is always
Properties keeps it, except `DD_X64_DIRECT_APPS` (Left 4 Dead 2, 550, by default), which is always
taken back. `direct-auto.json` lists what was mapped. One pass over the mapping: a 2000-title fixture
went from 16.5 s to 0.2 s with the same output.
- A game whose Windows build is installed (it ran on a Proton before) stays a Windows game on the
@@ -270,7 +270,7 @@ alone would then read as an installed client.
in its container.
- **GPU.** Games get FEX's host thunks and the session's GPU settings (Turnip, Zink), saved by the
launcher as `game-gpu.env` and rewritten whenever it runs; `game-gpu.local` is the user's, never
rewritten, and is read after it. `BL_X64_GAME_SOFTWARE=1` keeps a game in software, with
rewritten, and is read after it. `DD_X64_GAME_SOFTWARE=1` keeps a game in software, with
`mesa_glthread=false` (GL threading is no help with software GL under FEX).
- Source games (`hl2.sh`, `hl2_linux`, `srcds`) get `-condebug` for the VAC diagnostics.
- **Controllers.** `libfakeinput` is built for x86-64 and preloaded in the rootfs; Big Picture works
@@ -316,7 +316,7 @@ alone would then read as an installed client.
written only while no client runs. Shader pre-caching stays each client's own: the x86 client may
fetch a shared game's shader cache into its own folder (Valheim, 1.8 GB).
- **SD card.** The x86 client's card library is a folder inside the arm64 one (`/mnt/droiddeck-sd/x86-64`,
`GameStorage.X64_CARD_DIR`, passed as `BL_X64_STEAM_LIBRARIES`), so the install dialog offers Internal
`GameStorage.X64_CARD_DIR`, passed as `DD_X64_STEAM_LIBRARIES`), so the install dialog offers Internal
Storage and SD card. compatdata, shadercache and runtime tools stay private, as in the arm64 card
library. FEX runs x86 programs from the noexec exFAT card. The folder appears with the client's first
session on the card and its `steamapps` with the first library write. Desktop sessions prepare it as
@@ -378,7 +378,7 @@ alone would then read as an installed client.
it. It keeps the game display Steam chose: the saved `DISPLAY=:0` hid the game window and made
DiRT Showdown exit after about 7 s. Proton takes its Steam client parts from the client's install
folder, and the x86 client's are x86, so `STEAM_COMPAT_CLIENT_INSTALL_PATH` points at the arm64 root
and `BL_X64_STEAM_ROOT` keeps the x86 one for install-script lookups.
and `DD_X64_STEAM_ROOT` keeps the x86 one for install-script lookups.
- **Game overlay.** The x86 client preloads its own x86 overlay; the arm64 one takes its place. The
overlay marks the game's windows with the Steam app ID, and without it gamescope never shows them
(FlatOut ran and played sound behind Steam's launch screen, "steam app id: 0"). The agent also tags
@@ -425,7 +425,7 @@ alone would then read as an installed client.
to secure servers."). That console reaches a file only with `-condebug`: `<game>/<mod>/console.log`,
or `<game>/game/<mod>/console.log` for Source 2. At session start the app writes
`~/.droiddeck-vac-diagnostics` (start time, client, each console.log's length, since `-condebug`
appends). The launch wrapper (`bl_vacdiag`) then adds `-condebug` to Source titles (found by
appends). The launch wrapper (`dd_vacdiag`) then adds `-condebug` to Source titles (found by
`gameinfo.txt` or `gameinfo.gi`), flags `-insecure` in launch options and notes each launch. At the
end the session copies what each console.log gained into `vac/`, scrubbed, and writes `vac.txt`: the
game's secure/insecure lines, VAC lines in the client's logs, and which client files are present. A
@@ -440,7 +440,7 @@ alone would then read as an installed client.
## Session integration, restarts and mapping
- With `BL_STEAM_CLIENT_ARCH=x86_64`, `droiddeck-session` updates the arm64 client's parts
- With `DD_STEAM_CLIENT_ARCH=x86_64`, `droiddeck-session` updates the arm64 client's parts
(`droiddeck-steam-install`, then `--sync steamdeck_publicbeta`), runs `droiddeck-steam-x64 --prepare`
and starts the client with `droiddeck-steam-x64 --exec`. Steps only for the arm64 client (library
registration, the ARM64 Proton fetch, the live compat helper) are skipped; added games,
@@ -450,7 +450,7 @@ alone would then read as an installed client.
failed at ../src/pulse/operation.c:136 pa_operation_get_state()", the runtime's PulseAudio 13).
`preload/pulseguard.c` (x86 builds only; the arm64 client does not hit it) answers a missing operation
as cancelled and ignores its unref and cancel. The session passes `-steamdeck -steamos3` unless
`BL_X64_DECK=0`. Switch to Desktop is expected to need no change (an x86 shell under FEX runs
`DD_X64_DECK=0`. Switch to Desktop is expected to need no change (an x86 shell under FEX runs
`steamos-session-select`); the full switch has not been tested on a device.
- **Process names.** Under FEX a process's argv[0] is FEX and the program is its first argument. The
session's game detection, CPU pinning and the zRAM watcher read that argument. Steam pins itself and
@@ -459,13 +459,13 @@ alone would then read as an installed client.
`steam-compatibility --x64 --live` and `droiddeck-steam-x64 --map-direct --live`, every 15 s and
only in the session's first hour (720 beats of 5 s). A title installed after that is mapped when the
client exits and takes effect from the next session. Steam reads a
mapping changed while it runs only at its next start, so changed titles go to `.bl-compat-pending`.
mapping changed while it runs only at its next start, so changed titles go to `.dd-compat-pending`.
Once they have installed (`StateFlags` 4 in the client's root or its card folder) and no game runs,
the client is restarted once per title, at most 3 times a session.
- **After exit.** Added games, `steam-compatibility --x64` and `--map-direct` run again: the client
wrote its mapping from memory as it exited, over what the live passes set.
- The Lossless Scaling ownership probe and the Steam import watcher reach the x86 client through the
arm64 client's `steamclient.so` (`BL_STEAMCLIENT`); the watcher restarts the client with
arm64 client's `steamclient.so` (`DD_STEAMCLIENT`); the watcher restarts the client with
`droiddeck-steam-x64 --exec -shutdown`.
- Steam logs and the Steam language come from the x86 client's home. On the desktop, `steam` and
`steamdeck-steam` start the selected client, and the desktop game entries list its libraries.
+11 -11
View File
@@ -58,7 +58,7 @@ the timeline, then lessons and backlog. Companion to the README (what the app *d
`mirror-release.yml`, checked against a new `fex.json` catalog there (Components PR #2), and
`droiddeck-steam-x64` downloads it from there instead of The412Banner/DroidDeck.
- **FEX fex-2610-r4** (PR #71 review): without openat2 (proot) FEX opened rootfs paths with absolute
symlinks resolved against the arm64 guest, and `libblsession.so` converted every openat2 the same way
symlinks resolved against the arm64 guest, and `libddsession.so` converted every openat2 the same way
before FEX saw ENOSYS. `preload/robust.c` now resolves `RESOLVE_IN_ROOT` paths component by component
inside the root (59 cases; 100,000-path differential fuzz; new `test_openat2_preload.py`), and patch
0001 does the same in FEX. Patch 0003 marks only the host mappings that overlap a failed MAP_32BIT
@@ -313,7 +313,7 @@ stay as they were (`afa479ee`).
- **Merged main (94 commits).** Main dropped the Steam channel and Deck-mode settings (#546): only the
client choice (`steamClientArch`), `activeSteamRoot` and VAC diagnostics remain. Main's web-helper
arguments (#566, `bl_webhelper_argv`) are composed with the x86 client's arm64 web-helper redirect in
arguments (#566, `dd_webhelper_argv`) are composed with the x86 client's arm64 web-helper redirect in
`preload/net.c`. Main's single background loop (#575) now carries the x86 hooks: the client's own
compat pass (`--x64 --live`), `steamrt64` in the pinning and stale-tmp patterns, Lossless probe off for
x86, and the once-per-title restart after a new mapping. The text-strings merge had dropped three of
@@ -483,7 +483,7 @@ cache is saved as the round goes, so a sync the user closes the app on still lea
paths (`SessionPrefs.gameFolderBinds`), so the listing and every Steam shortcut are unchanged;
`addedGamesDirs` is cleared. Log: `games: migrated <root> → N games`.
- **Libraries:** `GameStorage.gamesFolderLibraries` returns only a Games folder Steam installed
into (an appmanifest in its `steamapps/`); the others drop out of `BL_STEAM_LIBRARIES` and the
into (an appmanifest in its `steamapps/`); the others drop out of `DD_STEAM_LIBRARIES` and the
runtime's `droiddeck-steam-library` forgets the `/root/Games/...` entries it had registered.
The user's two folders have `steamapps/` without manifests (checked on the device), so both go.
- **Tests:** `GamesFolderMigrationTest` (exe / appid / name / removal kept, guest paths unchanged,
@@ -510,7 +510,7 @@ What it took, in order (each step was the next failure on device):
could not find libtinfo. `tools/fex/patches/0001-openat2-enosys-fallback.patch`.
- **FEXServer owns the rootfs** - a server started before `FEX_ROOTFS` (any earlier FEX run) answers
every client with no rootfs. The launcher stops it first.
- **32-bit x86 died with SIGILL** - libblfastpath (the proot fast path, preloaded into every guest
- **32-bit x86 died with SIGILL** - libddfastpath (the proot fast path, preloaded into every guest
process, FEX itself included) breaks FEX's 32-bit mode. `PROOT_FP_OFF=1` for FEX.
- **"Steam now requires user namespaces"** - steam-runtime-check-requirements' bwrap probe; the
arm64 client has no such probe. The SteamRT3 client (`steamrt64/steam`) is started directly, the
@@ -518,7 +518,7 @@ What it took, in order (each step was the next failure on device):
runtime linked file by file and only the probe replaced.
- **tier0 assertion "Function not implemented"** - semget: Android has no System V IPC. Traced with
a `-DDEBUG_STRACE` FEX (build-fex.yml `cxxflags` input, artifact only). The session shim
(`preload/*.c`) is now also built natively as `libblsession-x86_64.so`, staged, and preloaded
(`preload/*.c`) is now also built natively as `libddsession-x86_64.so`, staged, and preloaded
through the rootfs's own `/etc/ld.so.preload`.
- **re-exec into pressure-vessel after self-update** - `STEAM_STEAMRT_RECURSION_GUARD=1`.
- **libgtk-x11-2.0 missing / soname links / old glibc shadowing** - Valve's steamrt3c platform
@@ -526,10 +526,10 @@ What it took, in order (each step was the next failure on device):
and only libraries the rootfs lacks (LD_LIBRARY_PATH beats system folders whatever its order).
- **GLX failed** - the desktop exports zink over the arm64 Turnip ICD; cleared, llvmpipe used.
- **web helper died of SIGTRAP a second after start** - found with pid-tagged traces (FEX AppConfig
`OutputLog=server` + a foreground FEXServer, `BL_FEXSERVER_LOG`; file logs overwrite each other):
`OutputLog=server` + a foreground FEXServer, `DD_FEXSERVER_LOG`; file logs overwrite each other):
every web helper read `/proc/self/status` from libtier0_s.so, saw proot as a tracer, and tier0 broke
into the "debugger" with int3. `preload/tracer.c` exempts the web helper on purpose (Chromium traps
on a status fd that is not procfs); with `BL_WEBHELPER_HIDE_TRACER=1` only opens called from
on a status fd that is not procfs); with `DD_WEBHELPER_HIDE_TRACER=1` only opens called from
libtier0_s.so get the copy.
- `SessionFiles` stages `bannerlator-steam-x64` and the x86-64 shim (they were missing from the list).
@@ -545,7 +545,7 @@ Later the same day (device-proven unless noted):
- From an audit of `bannerlator-session`: stale lock cleanup, branch sync before every start, core
re-pinning, path cache and `perms.c` for `steamrt64`, the app's FEX preset (PERFORMANCE_TSO).
- **Play button (built, not yet device-tested)**: Steam settings > Client > "Steam client: ARM64 /
x86-64 (FEX, experimental)" (`BL_STEAM_CLIENT_ARCH`). The session then starts the x86 client via
x86-64 (FEX, experimental)" (`DD_STEAM_CLIENT_ARCH`). The session then starts the x86 client via
`bannerlator-steam-x64 --prepare/--exec` and gives it everything it gives the arm64 one; steps
only for the arm64 client (ARM64 Proton, mapping, seeding, Decky, steamclient.so probes) are
skipped.
@@ -908,7 +908,7 @@ without it and Setup says "Stores engine not built").
launch, so it is removed (user decision): no overlay switch, no download, no `OverlayPath`; a
launch removes a pointer an earlier build wrote, and the app deletes an earlier 656 MB download
once. The work is parked on `park/epic-eos-overlay` (at `bf81104`). Kept: the browser hand-off,
the Epic card (sign-in, offline, Resolve Epic sign-in) and `BL_DEBUG_BROWSER`.
the Epic card (sign-in, offline, Resolve Epic sign-in) and `DD_DEBUG_BROWSER`.
- **A game launched from the Games tab with no session running sat at "Launching"** (device,
2026-10-09-04-steam, and 2026-10-08-05 before it). The session put `steam://rungameid/<id>` on
the client's command line; the client took it seconds before its interface was up (focus went to
@@ -931,9 +931,9 @@ without it and Setup says "Stores engine not built").
browser in the prefix (`"Browsers"="/usr/local/bin/droiddeck-open-url,xdg-open"`, an absolute path
that does not depend on Wine's PATH), linked as `xdg-open` first on the game's PATH, and reading
the session channel from `/tmp/droiddeck-browser/launch-dir` when Wine does not pass
`BL_LAUNCH_DIR` on. Whether EOS calls ShellExecute at all in its browser flow (rather than handing
`DD_LAUNCH_DIR` on. Whether EOS calls ShellExecute at all in its browser flow (rather than handing
a verification URI and code to the game to show) is what the next run's `droiddeck xdg-open:` line,
or `BL_DEBUG_BROWSER=1` in droiddeck-env (`WINEDEBUG=+shell,+winebrowser`), will show.
or `DD_DEBUG_BROWSER=1` in droiddeck-env (`WINEDEBUG=+shell,+winebrowser`), will show.
- **Resolve Epic sign-in** (the Epic card): opens Epic's account page behind its sign-in in Android's
browser, where a pending corrective action (privacy policy, EULA) is presented.
- **Epic overlay off by default** (device A/B, Metalstorm: overlay pointer set → exits while
+1 -1
View File
@@ -2,7 +2,7 @@
The [Discord report](https://discord.com/channels/1552707793247539220/1552707794430459916/1558974992753098874) describes Steam replacing KDE with a gamescope session. The launcher unconditionally wrote `steam-launch`, which tells the Android app to end KDE and start Steam under gamescope. Other desktop applications have a separate GPU wrapper; this change addresses Steam's desktop client.
Desktop Steam now runs the existing session supervisor with `BL_INSIDE=1` on KDE's inherited Xwayland display and authentication. CEF uses software rendering because KDE's QPainter compositor accepts shared-memory buffers. Big Picture continues to request the explicit gaming session. A lock keeps repeated menu clicks from starting another supervisor while Steam is starting or updating; subsequent clicks wait for Steam's live IPC pipe and then forward the Steam URL to the existing client. This also prevents a second click during cold startup from launching a client without software CEF. KDE retains its own agent and clipboard helpers when Steam starts and exits.
Desktop Steam now runs the existing session supervisor with `DD_INSIDE=1` on KDE's inherited Xwayland display and authentication. CEF uses software rendering because KDE's QPainter compositor accepts shared-memory buffers. Big Picture continues to request the explicit gaming session. A lock keeps repeated menu clicks from starting another supervisor while Steam is starting or updating; subsequent clicks wait for Steam's live IPC pipe and then forward the Steam URL to the existing client. This also prevents a second click during cold startup from launching a client without software CEF. KDE retains its own agent and clipboard helpers when Steam starts and exits.
Validation on AYN Thor uses the full wireless ADB serial `adb-d234a848-fv2FDl (2)._adb-tls-connect._tcp`. Live script testing displayed the authenticated library, restored the main window from maximized to windowed, opened Settings as a separate window, and forwarded a second launch to Downloads. KDE's panel remained visible, no gamescope process started, and no session handoff file was written. Quitting Steam returned to the running Plasma desktop with its agent still available. An explicit Big Picture launch then switched to a Steam session and reached READY with Steam focused.
+6 -6
View File
@@ -128,15 +128,15 @@ docker run --rm --platform "${docker_platform}" \
-o "$d/libfakeinput.so" app/src/main/cpp/fakeinput_steam.cpp -ldl
aarch64-linux-gnu-strip --strip-unneeded "$d/libfakeinput.so"
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \
-o "$d/libblsession.so" tools/linuxfs/preload/*.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$d/libblsession.so"
-o "$d/libddsession.so" tools/linuxfs/preload/*.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$d/libddsession.so"
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \
-o "$d/libblfastpath.so" tools/proot/fastpath/fastpath.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$d/libblfastpath.so"
-o "$d/libddfastpath.so" tools/proot/fastpath/fastpath.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$d/libddfastpath.so"
bash tools/nativeguest/build.sh "$d/libddnatv-hook.so"
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -nostdlib -ffreestanding -fno-stack-protector \
-fno-tree-loop-distribute-patterns -Wl,-z,defs -o "$d/libblaudit.so" tools/proot/fastpath/audit.c
aarch64-linux-gnu-strip --strip-unneeded "$d/libblaudit.so"
-fno-tree-loop-distribute-patterns -Wl,-z,defs -o "$d/libddaudit.so" tools/proot/fastpath/audit.c
aarch64-linux-gnu-strip --strip-unneeded "$d/libddaudit.so"
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \
-o "$d/libssbs.so" tools/linuxfs/ssbs/ssbs_adapter.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$d/libssbs.so"
+6 -6
View File
@@ -7,15 +7,15 @@ aarch64-linux-gnu-g++ -shared -fPIC -O2 -Wall -Wno-attributes -Wno-nonnull-compa
-o "$D/libfakeinput.so" app/src/main/cpp/fakeinput_steam.cpp -ldl
aarch64-linux-gnu-strip --strip-unneeded "$D/libfakeinput.so"
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \
-o "$D/libblsession.so" tools/linuxfs/preload/*.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$D/libblsession.so"
-o "$D/libddsession.so" tools/linuxfs/preload/*.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$D/libddsession.so"
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \
-o "$D/libblfastpath.so" tools/proot/fastpath/fastpath.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$D/libblfastpath.so"
-o "$D/libddfastpath.so" tools/proot/fastpath/fastpath.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$D/libddfastpath.so"
bash tools/nativeguest/build.sh "$D/libddnatv-hook.so"
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -nostdlib -ffreestanding -fno-stack-protector \
-fno-tree-loop-distribute-patterns -Wl,-z,defs -o "$D/libblaudit.so" tools/proot/fastpath/audit.c
aarch64-linux-gnu-strip --strip-unneeded "$D/libblaudit.so"
-fno-tree-loop-distribute-patterns -Wl,-z,defs -o "$D/libddaudit.so" tools/proot/fastpath/audit.c
aarch64-linux-gnu-strip --strip-unneeded "$D/libddaudit.so"
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \
-o "$D/libssbs.so" tools/linuxfs/ssbs/ssbs_adapter.c -ldl
aarch64-linux-gnu-strip --strip-unneeded "$D/libssbs.so"
+5 -5
View File
@@ -102,16 +102,16 @@
"url": "https://github.com/Droid-Deck/DroidDeck/actions/runs/39992155294"
},
"outputs": {
"i386/libblsession.so": "5343cdb704217ddc81ee593e67d5987363dc7b5ac78bd4bd36000219e5063268",
"i386/libddsession.so": "5343cdb704217ddc81ee593e67d5987363dc7b5ac78bd4bd36000219e5063268",
"i386/libfakeinput.so": "188d88dfb13b6e2f2df948e7b8b4d9ec604770f55d1ea5b6b9e21ad56a74ce5e",
"i386/libfaultreport.so": "95f9ef60f04a13ee60cfbd4d2d2efb60a7063b722e646c78c9dc27162292877b",
"libblaudit.so": "6c6abe89baf5d7309babee0c3372a4b00c2b689e2a63de38c5e9a660626509b5",
"libblfastpath.so": "0e1f151b5c1c5ea9dd380ad58d09f8fe7ba3ae037d0991cb3eef6899e9d5ec83",
"libblsession.so": "29d4b5ea46dba941107e02c0ee544244b137a339cada43bff65c350f2ef2755a",
"libddaudit.so": "6c6abe89baf5d7309babee0c3372a4b00c2b689e2a63de38c5e9a660626509b5",
"libddfastpath.so": "0e1f151b5c1c5ea9dd380ad58d09f8fe7ba3ae037d0991cb3eef6899e9d5ec83",
"libddsession.so": "29d4b5ea46dba941107e02c0ee544244b137a339cada43bff65c350f2ef2755a",
"libfakeinput.so": "5f6dc3aea05de2dc1fbe0bbfac2ce4d11e3d47f761c6b06c8badb15fe1904392",
"libssbs.so": "c288ed0da26c2481aff270d1cdafe1205061c4a300c2c46ae1b53c6e0c94f44b",
"usr/local/bin/droiddeck-clipboard": "ec50e8f67fdf76372927189b0fdb670f9b70fd3484f2fe3e833bc8f9fdc44205",
"x86_64/libblsession.so": "61d19f06aebab6a789f8c99f687af9903376bfc853e46b70c48a2ce5e497accc",
"x86_64/libddsession.so": "61d19f06aebab6a789f8c99f687af9903376bfc853e46b70c48a2ce5e497accc",
"x86_64/libfakeinput.so": "8663dd2086bf8ae53069a480dd9ae4619109d32f0947a29e2ce38f07a21ae2e6",
"x86_64/libfaultreport.so": "bb0dc9165d0d764473e552508650edd586df16d620fc5b16b8b1c5740a28ce22",
"x86_64/libvulkan-thunk.so": "74f01b652d7e8179561a096a552328b68da640cc4bad3981edd38e6afbf90243",
+10 -10
View File
@@ -62,10 +62,10 @@
],
"outputs": [
"app/src/main/assets/linuxfs/x86_64/libfakeinput.so",
"app/src/main/assets/linuxfs/x86_64/libblsession.so",
"app/src/main/assets/linuxfs/x86_64/libddsession.so",
"app/src/main/assets/linuxfs/x86_64/libfaultreport.so",
"app/src/main/assets/linuxfs/i386/libfakeinput.so",
"app/src/main/assets/linuxfs/i386/libblsession.so",
"app/src/main/assets/linuxfs/i386/libddsession.so",
"app/src/main/assets/linuxfs/i386/libfaultreport.so",
"app/src/main/assets/linuxfs/x86_64/libwebkitinput.so",
"app/src/main/assets/linuxfs/x86_64/libvulkan-thunk.so"
@@ -83,10 +83,10 @@
],
"snapshot_outputs": [
"x86_64/libfakeinput.so",
"x86_64/libblsession.so",
"x86_64/libddsession.so",
"x86_64/libfaultreport.so",
"i386/libfakeinput.so",
"i386/libblsession.so",
"i386/libddsession.so",
"i386/libfaultreport.so",
"x86_64/libwebkitinput.so",
"x86_64/libvulkan-thunk.so"
@@ -169,9 +169,9 @@
],
"outputs": [
"app/src/main/assets/linuxfs/libfakeinput.so",
"app/src/main/assets/linuxfs/libblsession.so",
"app/src/main/assets/linuxfs/libblfastpath.so",
"app/src/main/assets/linuxfs/libblaudit.so",
"app/src/main/assets/linuxfs/libddsession.so",
"app/src/main/assets/linuxfs/libddfastpath.so",
"app/src/main/assets/linuxfs/libddaudit.so",
"app/src/main/assets/linuxfs/libssbs.so",
"app/src/main/assets/linuxfs/usr/local/bin/droiddeck-clipboard",
"app/src/main/assets/linuxfs/libddnatv-hook.so"
@@ -194,9 +194,9 @@
],
"snapshot_outputs": [
"libfakeinput.so",
"libblsession.so",
"libblfastpath.so",
"libblaudit.so",
"libddsession.so",
"libddfastpath.so",
"libddaudit.so",
"libssbs.so",
"usr/local/bin/droiddeck-clipboard",
"libddnatv-hook.so"
+1 -1
View File
@@ -1355,7 +1355,7 @@ def build_parser() -> argparse.ArgumentParser:
env_clear = env_ops.add_parser("clear")
env_clear.add_argument("scope", nargs="?", choices=["next", "persistent", "all"], default="next")
override = commands.add_parser("override", help="override a program or libblfastpath.so for the next session (debugging tools)")
override = commands.add_parser("override", help="override a program or libddfastpath.so for the next session (debugging tools)")
override.add_argument("name", help="the program name, e.g. gamescope")
override.add_argument("path", help="the local file to push")
+3 -3
View File
@@ -8,12 +8,12 @@ for arch in x86_64 i386; do
esac
mkdir -p "$out/$arch"
gcc $bits -shared -fPIC -O2 -Wall -pthread \
-o "$out/$arch/libblsession.so" tools/linuxfs/preload/*.c -ldl
-o "$out/$arch/libddsession.so" tools/linuxfs/preload/*.c -ldl
g++ $bits -shared -fPIC -O2 -Wall -Wno-attributes -Wno-nonnull-compare \
-pthread -std=c++17 -static-libstdc++ -static-libgcc -Wl,--exclude-libs,ALL \
-o "$out/$arch/libfakeinput.so" app/src/main/cpp/fakeinput_steam.cpp -ldl
strip --strip-unneeded "$out/$arch/libblsession.so" "$out/$arch/libfakeinput.so"
for lib in "$out/$arch/libblsession.so" "$out/$arch/libfakeinput.so"; do
strip --strip-unneeded "$out/$arch/libddsession.so" "$out/$arch/libfakeinput.so"
for lib in "$out/$arch/libddsession.so" "$out/$arch/libfakeinput.so"; do
newest=$(objdump -T "$lib" | grep -o 'GLIBC_2\.[0-9]*' | sort -u -t. -k2,2n | tail -1)
minor=${newest#GLIBC_2.}
if [ "$minor" -gt 31 ]; then
+3 -3
View File
@@ -15,12 +15,12 @@ done
if grep -qxE '__gxx_personality_v0|__cxa_throw|_Unwind_Resume' <<<"$FAKE"; then
echo "::error::libfakeinput.so exports the C++ runtime"; exit 1
fi
SESSION=$(syms "$D/libblsession.so")
SESSION=$(syms "$D/libddsession.so")
for sym in socket bind getsockname setsockopt statfs statvfs syscall shm_open shm_unlink mmap mmap64 munmap mprotect drmPrimeFDToHandle drmCloseBufferHandle; do
grep -qx "$sym" <<<"$SESSION" || { echo "::error::libblsession.so does not export $sym"; exit 1; }
grep -qx "$sym" <<<"$SESSION" || { echo "::error::libddsession.so does not export $sym"; exit 1; }
done
if grep -qx drmIoctl <<<"$SESSION"; then
echo "::error::libblsession.so exports drmIoctl"; exit 1
echo "::error::libddsession.so exports drmIoctl"; exit 1
fi
SSBS=$(syms "$D/libssbs.so")
for sym in sigaction signal bsd_signal sysv_signal; do
+6 -6
View File
@@ -19,15 +19,15 @@ done 2>/dev/null
export DROIDDECK_NESTED_SCALE=1
export DROIDDECK_GLTHREAD=${mesa_glthread:-}
unset MESA_LOADER_DRIVER_OVERRIDE LIBGL_KOPPER_DRI2 mesa_glthread
if [ -n "${BL_DEBUG_DIR:-}" ]; then
mkdir -p "$BL_DEBUG_DIR" 2>/dev/null || true
exec >>"$BL_DEBUG_DIR/desktop.log" 2>&1
echo "== droiddeck-desktop $(date -u '+%Y-%m-%d %H:%M:%S UTC') ${BL_WIDTH:-1280}x${BL_HEIGHT:-720}"
if [ -n "${DD_DEBUG_DIR:-}" ]; then
mkdir -p "$DD_DEBUG_DIR" 2>/dev/null || true
exec >>"$DD_DEBUG_DIR/desktop.log" 2>&1
echo "== droiddeck-desktop $(date -u '+%Y-%m-%d %H:%M:%S UTC') ${DD_WIDTH:-1280}x${DD_HEIGHT:-720}"
fi
find "$XDG_RUNTIME_DIR" -mindepth 1 -maxdepth 1 ! -name 'wayland-0*' ! -name 'keymap.xkb' -exec rm -rf {} + 2>/dev/null
chmod 700 "$XDG_RUNTIME_DIR" 2>/dev/null
mkdir -p /tmp/.X11-unix /tmp/.ICE-unix && chmod 1777 /tmp/.X11-unix /tmp/.ICE-unix 2>/dev/null
export BL_DESKTOP=1
export DD_DESKTOP=1
ln -sf /usr/local/bin/droiddeck-steam-launch /usr/local/bin/steamdeck-steam 2>/dev/null
ln -sf /usr/local/bin/droiddeck-steam-shim /usr/local/bin/steam 2>/dev/null
python3 /usr/local/bin/droiddeck-desktop-games 2>&1 | sed 's/^/[games] /'
@@ -134,7 +134,7 @@ dbus-run-session -- startplasma-wayland
rc=$?
/usr/local/bin/droiddeck-pipewire stop
echo "== droiddeck-desktop: Plasma ended ($rc)"
if [ "$rc" -eq 0 ] && [ -z "${BL_BOTTOM_DESKTOP:-}" ]; then
if [ "$rc" -eq 0 ] && [ -z "${DD_BOTTOM_DESKTOP:-}" ]; then
/usr/local/bin/droiddeck-steam-launch bigpicture
sleep 30
fi
+1 -1
View File
@@ -15,7 +15,7 @@ CHROMIUM_FLAGS = " --no-sandbox --ozone-platform=x11"
def enabled():
return os.environ.get("BL_DESKTOP_GPU", "on").strip().lower() not in ("off", "0", "no", "false")
return os.environ.get("DD_DESKTOP_GPU", "on").strip().lower() not in ("off", "0", "no", "false")
def main_group(text):
+13 -13
View File
@@ -1,30 +1,30 @@
#!/bin/bash
set -u
[ $# -gt 0 ] || { echo "usage: droiddeck-gpu <program> [args...]" >&2; exit 64; }
if [ -n "${BL_DEBUG_DIR:-}" ]; then
exec >>"$BL_DEBUG_DIR/desktop.log" 2>&1
if [ -n "${DD_DEBUG_DIR:-}" ]; then
exec >>"$DD_DEBUG_DIR/desktop.log" 2>&1
fi
width=${BL_WIDTH:-1280}
height=${BL_HEIGHT:-720}
backend=${BL_GAMESCOPE_BACKEND:-wayland}
width=${DD_WIDTH:-1280}
height=${DD_HEIGHT:-720}
backend=${DD_GAMESCOPE_BACKEND:-wayland}
case "$backend" in
wayland|sdl) ;;
*) echo "== unsupported gamescope backend: $backend" >&2; exit 64 ;;
esac
window=0
if [ "$backend" = wayland ] && [ "${BL_DESKTOP_GPU_WINDOW:-1}" != 0 ] && [ -n "${WAYLAND_DISPLAY:-}" ] && [ "$WAYLAND_DISPLAY" != wayland-0 ]; then
if [ "$backend" = wayland ] && [ "${DD_DESKTOP_GPU_WINDOW:-1}" != 0 ] && [ -n "${WAYLAND_DISPLAY:-}" ] && [ "$WAYLAND_DISPLAY" != wayland-0 ]; then
window=1
parent=$WAYLAND_DISPLAY
args=(--backend sdl --expose-wayland --follow-game-window-mode -W "$width" -H "$height" -w "$width" -h "$height")
else
args=(--backend "$backend" --expose-wayland -f -W "$width" -H "$height" -w "$width" -h "$height")
fi
if [ "${BL_FPS:-0}" -gt 0 ]; then
args+=(-r "$BL_FPS")
elif [ "${BL_REFRESH:-0}" -gt 0 ]; then
args+=(-r "$BL_REFRESH")
if [ "${DD_FPS:-0}" -gt 0 ]; then
args+=(-r "$DD_FPS")
elif [ "${DD_REFRESH:-0}" -gt 0 ]; then
args+=(-r "$DD_REFRESH")
fi
[ "${BL_HDR:-0}" = 1 ] && args+=(--hdr-enabled)
[ "${DD_HDR:-0}" = 1 ] && args+=(--hdr-enabled)
if [ "$window" = 1 ]; then
echo "== droiddeck-gpu $(date -u +%H:%M:%S): $* (gamescope ${width}x${height} in a window on $parent)"
else
@@ -38,7 +38,7 @@ wsi=",${MESA_VK_WSI_DEBUG:-},"
while [[ $wsi == *,sw,* ]]; do wsi=${wsi//,sw,/,}; done
wsi=${wsi#,}; wsi=${wsi%,}
if [ -n "$wsi" ]; then export MESA_VK_WSI_DEBUG=$wsi; else unset MESA_VK_WSI_DEBUG; fi
export BL_DESKTOP_GPU_CHILD=1
export DD_DESKTOP_GPU_CHILD=1
export MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink LIBGL_KOPPER_DRI2=true
[ -n "${DROIDDECK_GLTHREAD:-}" ] && export mesa_glthread=$DROIDDECK_GLTHREAD
export APPIMAGE_EXTRACT_AND_RUN=1
@@ -51,7 +51,7 @@ if ! command -v gamescopereaper >/dev/null 2>&1; then
done
fi
if [ "$window" = 1 ]; then
export BL_GPU_CHILD_WSI=${MESA_VK_WSI_DEBUG:-}
export DD_GPU_CHILD_WSI=${MESA_VK_WSI_DEBUG:-}
SDL_VIDEODRIVER=wayland MESA_VK_WSI_DEBUG=sw gamescope "${args[@]}" -- /usr/local/bin/droiddeck-gpu-window "$@"
else
gamescope "${args[@]}" -- env SDL_VIDEODRIVER=x11 /usr/local/bin/droiddeck-gpu-window "$@"
+2 -2
View File
@@ -1,5 +1,5 @@
#!/bin/bash
if [ "${BL_DESKTOP:-}" = 1 ]; then
set -- --wayland-display wayland-0 --socket wayland-1 --width "${BL_WIDTH:-1280}" --height "${BL_HEIGHT:-720}" --no-lockscreen "$@"
if [ "${DD_DESKTOP:-}" = 1 ]; then
set -- --wayland-display wayland-0 --socket wayland-1 --width "${DD_WIDTH:-1280}" --height "${DD_HEIGHT:-720}" --no-lockscreen "$@"
fi
exec /usr/bin/kwin_wayland_wrapper "$@"
@@ -3,9 +3,9 @@ echo "steamos-session-select: $*" >&2
case "${1:-}" in
""|gamescope) exit 0 ;;
esac
dir=${BL_LAUNCH_DIR:-}
dir=${DD_LAUNCH_DIR:-}
if [ -z "$dir" ] || [ ! -d "$dir" ]; then
echo "steamos-session-select: not inside a DroidDeck session (BL_LAUNCH_DIR unset)" >&2
echo "steamos-session-select: not inside a DroidDeck session (DD_LAUNCH_DIR unset)" >&2
exit 1
fi
printf 'session=desktop\nui=desktop\nurl=\n' > "$dir/steam-launch.tmp" && mv -f "$dir/steam-launch.tmp" "$dir/steam-launch"
@@ -283,7 +283,7 @@ def sandboxed_apps(proc=Path("/proc")):
def window_steam_app(win, flatpaks, proc=Path("/proc")):
match = STEAM_APP_CLASS.match(win.get("class") or "")
if match:
return match.group(1) if os.environ.get("BL_STEAM_CLIENT_ARCH") == "x86_64" else None
return match.group(1) if os.environ.get("DD_STEAM_CLIENT_ARCH") == "x86_64" else None
pid = win.get("pid")
if pid:
if under_reaper(pid, proc):
@@ -529,7 +529,7 @@ def cdp_port(agent_dir):
try:
port = (agent_dir / "cdp-port").read_text().strip()
except OSError:
port = os.environ.get("BL_CDP_PORT", "")
port = os.environ.get("DD_CDP_PORT", "")
if not port.isdigit():
raise AgentError("NO_DEVTOOLS", "The Steam client's DevTools port is not known (no Steam client in this session yet)")
return int(port)
@@ -1218,9 +1218,9 @@ def serve(agent_dir, focus=True, poll=0.1):
def main(argv):
base = os.environ.get("BL_LAUNCH_DIR")
base = os.environ.get("DD_LAUNCH_DIR")
if not base:
print("BL_LAUNCH_DIR is not set", file=sys.stderr)
print("DD_LAUNCH_DIR is not set", file=sys.stderr)
return 2
if argv and argv[0] == "--wait-steam-shortcut-overview":
if len(argv) not in (2, 3):
@@ -467,7 +467,7 @@ def still_pages(root):
def desktop_size():
width, height = os.environ.get("BL_WIDTH", ""), os.environ.get("BL_HEIGHT", "")
width, height = os.environ.get("DD_WIDTH", ""), os.environ.get("DD_HEIGHT", "")
if width.isdigit() and height.isdigit() and 0 < int(width) <= 7680 and 0 < int(height) <= 4320:
return int(width), int(height)
return 1280, 720
@@ -900,18 +900,18 @@ class Tidy:
def desktop_gpu():
if os.environ.get("BL_DESKTOP") != "1" or os.environ.get("BL_DESKTOP_GPU_CHILD"):
if os.environ.get("DD_DESKTOP") != "1" or os.environ.get("DD_DESKTOP_GPU_CHILD"):
return None
if os.environ.get("BL_DESKTOP_GPU", "on").strip().lower() in ("off", "0", "no", "false"):
if os.environ.get("DD_DESKTOP_GPU", "on").strip().lower() in ("off", "0", "no", "false"):
return None
gpu = os.path.join(BIN, "droiddeck-gpu")
return gpu if os.access(gpu, os.X_OK) else None
def proton_options():
if os.environ.get("BL_DESKTOP") == "1" and not os.environ.get("BL_DESKTOP_GPU_CHILD"):
if os.environ.get("DD_DESKTOP") == "1" and not os.environ.get("DD_DESKTOP_GPU_CHILD"):
return ["--window"]
width, height = os.environ.get("BL_WIDTH", ""), os.environ.get("BL_HEIGHT", "")
width, height = os.environ.get("DD_WIDTH", ""), os.environ.get("DD_HEIGHT", "")
options = ["--desktop", "%sx%s" % (width, height)] if width.isdigit() and height.isdigit() else []
game = os.environ.get("SteamGameId", "")
return options + (["--game-id", game] if game.isdigit() and game != "0" else [])
@@ -942,7 +942,7 @@ def queued_requests(launch_dir):
def serve_requests(pfx, processes=None, launch_dir=None):
launch_dir = launch_dir or os.environ.get("BL_LAUNCH_DIR")
launch_dir = launch_dir or os.environ.get("DD_LAUNCH_DIR")
names = queued_requests(launch_dir) if launch_dir else []
if not names or not agent_up(wine_processes(pfx) if processes is None else processes):
return False
@@ -1136,7 +1136,7 @@ def stop_leftovers(pfx):
def open_client(root, reinstall=False):
pfx = os.path.join(prefix(root), "pfx")
write_menu()
answer = ask_fex(os.environ.get("BL_LAUNCH_DIR"))
answer = ask_fex(os.environ.get("DD_LAUNCH_DIR"))
say("FEX: %s" % (answer or "no answer from the app; Components' choice stays"))
if running(pfx):
say("Battle.net is already running in its prefix; waiting for it to close")
@@ -1226,7 +1226,7 @@ def launch(root, code):
try:
own = None
if lock is not None and not running(pfx):
answer = ask_fex(os.environ.get("BL_LAUNCH_DIR"))
answer = ask_fex(os.environ.get("DD_LAUNCH_DIR"))
say("FEX: %s" % (answer or "no answer from the app; Components' choice stays"))
verb = None if stop_leftovers(pfx) else "run"
configure(root, LIBRARY)
@@ -1560,7 +1560,7 @@ def main(argv):
if gpu:
say("the desktop starts Battle.net on the GPU")
os.execv(gpu, [gpu, os.path.abspath(sys.argv[0])] + list(sys.argv[1:]))
os.environ["BL_BATTLENET"] = "1"
os.environ["DD_BATTLENET"] = "1"
if launching:
say("launch %s" % argv[1])
return launch(root, argv[1])
@@ -2,16 +2,16 @@
# KDE Plasma on a dual-screen handheld's bottom screen, next to the session on the top one.
set -u
export HOME=${HOME:-/root}
if [ -n "${BL_DEBUG_DIR:-}" ]; then
mkdir -p "$BL_DEBUG_DIR" 2>/dev/null || true
exec >>"$BL_DEBUG_DIR/bottom-desktop.log" 2>&1
if [ -n "${DD_DEBUG_DIR:-}" ]; then
mkdir -p "$DD_DEBUG_DIR" 2>/dev/null || true
exec >>"$DD_DEBUG_DIR/bottom-desktop.log" 2>&1
fi
echo "== droiddeck-bottom-desktop $(date -u '+%Y-%m-%d %H:%M:%S UTC') ${BL_WIDTH:-?}x${BL_HEIGHT:-?} beside a ${BL_TOP_SESSION:-?} session"
echo "== droiddeck-bottom-desktop $(date -u '+%Y-%m-%d %H:%M:%S UTC') ${DD_WIDTH:-?}x${DD_HEIGHT:-?} beside a ${DD_TOP_SESSION:-?} session"
[ -x /usr/local/bin/droiddeck-desktop ] || { echo "== the desktop package is not installed"; exit 66; }
# Launch requests would reach the top session's watcher and could replace it.
unset BL_LAUNCH_DIR BL_LOG
export BL_BOTTOM_DESKTOP=1
unset DD_LAUNCH_DIR BL_LAUNCH_DIR DD_LOG
export DD_BOTTOM_DESKTOP=1
for _ in $(seq 1 100); do
wayland-info >/dev/null 2>&1 && break
@@ -23,7 +23,7 @@ ET.register_namespace("bookmark", ICON_NS)
def steam_libraries(home, data):
steam = data / "Steam"
libraries = {steam: "Internal Storage"}
listing = os.environ.get("BL_STEAM_LIBRARIES")
listing = os.environ.get("DD_STEAM_LIBRARIES")
selected = None
if listing:
try:
@@ -46,15 +46,15 @@ def steam_libraries(home, data):
managed = path == LIBRARY or path.is_relative_to(home / "Games") or path.is_relative_to(ADDED)
if selected is not None and managed and path not in selected:
continue
if path == LIBRARY and selected is None and not os.environ.get("BL_LIBRARY_LABEL"):
if path == LIBRARY and selected is None and not os.environ.get("DD_LIBRARY_LABEL"):
continue
label = entry.get("label")
label = re.sub(r'\\(["\\])', r'\1', label) if isinstance(label, str) else ""
libraries[path] = label or path.name
if selected is not None:
libraries.update(selected)
elif os.environ.get("BL_LIBRARY_LABEL"):
libraries[LIBRARY] = os.environ["BL_LIBRARY_LABEL"]
elif os.environ.get("DD_LIBRARY_LABEL"):
libraries[LIBRARY] = os.environ["DD_LIBRARY_LABEL"]
libraries[steam] = "Internal Storage"
return {path.as_uri(): "Steam (" + (" ".join(label.split()) or path.name) + ")"
for path, label in libraries.items() if path.is_absolute() and (path / "steamapps").is_dir()}
@@ -68,7 +68,7 @@ def place_uri(uri):
def removable_volumes():
listing = os.environ.get("BL_DESKTOP_VOLUMES")
listing = os.environ.get("DD_DESKTOP_VOLUMES")
if not listing:
return {}
volumes = {}
@@ -168,7 +168,7 @@ def atomic_write(path, content):
def main():
home = Path.home()
config = Path(os.environ.get("XDG_CONFIG_HOME") or home / ".config")
label = os.environ.get("BL_LIBRARY_LABEL")
label = os.environ.get("DD_LIBRARY_LABEL")
available = bool(label) and (LIBRARY / "steamapps").is_dir()
update_bookmark(bookmarks_file(home, config), label if available else None)
data = Path(os.environ.get("XDG_DATA_HOME") or home / ".local/share")
@@ -1,6 +1,6 @@
#!/bin/bash
[ -n "${BL_ANDROID_CLIPBOARD:-}" ] && [ -n "${DISPLAY:-}" ] || exit 0
/usr/local/bin/droiddeck-clipboard "$BL_ANDROID_CLIPBOARD" &
[ -n "${DD_ANDROID_CLIPBOARD:-}" ] && [ -n "${DISPLAY:-}" ] || exit 0
/usr/local/bin/droiddeck-clipboard "$DD_ANDROID_CLIPBOARD" &
child=$!
trap 'kill "$child" 2>/dev/null' EXIT
trap 'exit 0' TERM INT
@@ -4,8 +4,8 @@ import re
import sys
HOME = os.environ.get("HOME", "/root")
X64 = os.environ.get("BL_STEAM_CLIENT_ARCH") == "x86_64"
CLIENT_HOME = (os.environ.get("BL_X64_HOME") or os.path.join(HOME, ".droiddeck-x64")) if X64 else HOME
X64 = os.environ.get("DD_STEAM_CLIENT_ARCH") == "x86_64"
CLIENT_HOME = (os.environ.get("DD_X64_HOME") or os.path.join(HOME, ".droiddeck-x64")) if X64 else HOME
STEAM_ROOT = sys.argv[1] if len(sys.argv) > 1 else os.path.join(CLIENT_HOME, ".local/share/Steam")
LIBRARIES = ((STEAM_ROOT, "Steam Games"), ("/mnt/droiddeck-sd/x86-64" if X64 else "/mnt/droiddeck-sd", "SD Games"))
NOT_GAMES = {228980, 1070560, 1161040, 1391110, 1493710, 1628350, 1826330, 3127680, 4183110, 4185400, 4427310, 4628740}
@@ -112,7 +112,7 @@ HIDDEN_ENV = {
"DROIDDECK_EPIC_HIDDEN": "1",
"EGL_DISABLE_STORE_PREWARM": "1",
}
KEPT_ENV = ("HOME", "USER", "LOGNAME", "LANG", "LANGUAGE", "LC_ALL", "LC_MESSAGES", "TZ", "XDG_RUNTIME_DIR", "BL_LAUNCH_DIR")
KEPT_ENV = ("HOME", "USER", "LOGNAME", "LANG", "LANGUAGE", "LC_ALL", "LC_MESSAGES", "TZ", "XDG_RUNTIME_DIR", "DD_LAUNCH_DIR", "BL_LAUNCH_DIR")
LAUNCH_VERBS = ("waitforexitandrun", "run", "runinprefix")
EPIC_ARGS = ("-auth_", "-epic")
CMD_SPECIAL = "&|<>^"
@@ -720,7 +720,7 @@ def clear_playing():
def launch_dir():
found = os.environ.get("BL_LAUNCH_DIR", "")
found = os.environ.get("DD_LAUNCH_DIR", "")
if not found:
try:
with open(LAUNCH_DIR_FILE, encoding="utf-8") as f:
@@ -39,7 +39,7 @@ MIN_NOFILE = 8192
LOG_LINES = 200
LIVE_FILE = "prefixes.json"
LIVE_ROWS = 200
LIVE_KEYS = ("WINESERVER", "BL_SYNC_PACK", "WINEESYNC", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC", "BL_SYNC", "BL_FSYNC", "WINEFSYNC")
LIVE_KEYS = ("WINESERVER", "DD_SYNC_PACK", "WINEESYNC", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC", "DD_SYNC", "DD_FSYNC", "WINEFSYNC")
CACHE_ROWS = 512
TEMP_AGE = 3600
GC_GRACE = 600
@@ -637,7 +637,7 @@ def app_id(env):
def minimum_nofile(env):
try:
return int(env.get("BL_SYNC_MIN_NOFILE") or MIN_NOFILE)
return int(env.get("DD_SYNC_MIN_NOFILE") or MIN_NOFILE)
except ValueError:
return MIN_NOFILE
@@ -650,8 +650,8 @@ def log_launch(root, command, env, tool, pack_id):
try:
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
line = tsv([[int(time.time()), app_id(env) or "-", command[1] if len(command) > 1 else "-", tool, pack_id or "-",
env.get("WINEESYNC") or "-", env.get("BL_SYNC") or "-", "%s/%s" % (limit(soft), limit(hard)),
env.get("BL_FSYNC") or "-"]])
env.get("WINEESYNC") or "-", env.get("DD_SYNC") or "-", "%s/%s" % (limit(soft), limit(hard)),
env.get("DD_FSYNC") or "-"]])
def append(text):
lines = [entry for entry in text.split("\n") if entry]
@@ -704,7 +704,7 @@ def select(command, env):
if not prefix or last == "0" or last.startswith("0-"):
return result
if truthy(env.get("PROTON_NO_NTSYNC")):
env["BL_SYNC"] = "0"
env["DD_SYNC"] = "0"
result = (list(command), dict(env))
root = store_root(env)
if root is None:
@@ -796,7 +796,7 @@ def keep_live(root, command, env, tool):
return None
if not os.path.isfile(kept_command) or not server_running(prefix):
return None
kept_pack = row["env"].get("BL_SYNC_PACK")
kept_pack = row["env"].get("DD_SYNC_PACK", row["env"].get("BL_SYNC_PACK"))
if isinstance(kept_pack, str) and kept_pack and command[1:2] == ["waitforexitandrun"]:
try:
cache = HashCache(root)
@@ -808,25 +808,28 @@ def keep_live(root, command, env, tool):
pack = {"id": kept_pack}
if pack is None or pack["id"] != kept_pack:
return None
kept = {("DD_" + name[3:] if name.startswith("BL_") else name): value
for name, value in row["env"].items() if name.startswith("BL_")}
kept.update((name, value) for name, value in row["env"].items() if not name.startswith("BL_"))
command, env = list(command), dict(env)
command[0] = kept_command
for name in LIVE_KEYS:
value = row["env"].get(name)
value = kept.get(name)
if isinstance(value, str):
env[name] = value
else:
env.pop(name, None)
say("droiddeck-esync: Wine is still running in this prefix; keeping its sync choice (%s)" % describe(env))
log_launch(root, command, env, tool, env.get("BL_SYNC_PACK"))
log_launch(root, command, env, tool, env.get("DD_SYNC_PACK"))
return command, env
def describe(env):
if env.get("BL_SYNC") == "1":
if env.get("DD_SYNC") == "1":
return "droiddeck-ntsync"
if env.get("BL_FSYNC") == "1":
if env.get("DD_FSYNC") == "1":
return "droiddeck-fsync"
if env.get("BL_SYNC_PACK") and truthy(env.get("WINEESYNC")):
if env.get("DD_SYNC_PACK") and truthy(env.get("WINEESYNC")):
return "droiddeck-esync"
if all(truthy(env.get(name)) for name in WINESERVER_ONLY):
return "wineserver"
@@ -835,13 +838,13 @@ def describe(env):
def fsync_ready(env, measured):
listed = "PROTON_NO_FSYNC" not in env and app_id(env) in NOSYNC_APPS
return measured["fsync"] and env.get("BL_SYNC") != "1" and not truthy(env.get("PROTON_NO_FSYNC")) and not listed
return measured["fsync"] and env.get("DD_SYNC") != "1" and not truthy(env.get("PROTON_NO_FSYNC")) and not listed
def with_fsync(root, command, env, tool, reason):
command, env = list(command), dict(env)
env["BL_FSYNC"] = "1"
env["BL_SYNC"] = "0"
env["DD_FSYNC"] = "1"
env["DD_SYNC"] = "0"
env["WINEFSYNC"] = "1"
say("droiddeck-fsync: %s; stock binaries with Proton's fsync" % reason)
log_launch(root, command, env, tool, None)
@@ -855,10 +858,10 @@ def stand_in(root, command, env, tool, reason, measured=None):
if truthy(env.get("PROTON_NO_NTSYNC")):
say("droiddeck-esync: %s; stock binaries" % reason)
elif measured is not None and not measured["ntsync"]:
env["BL_SYNC"] = "0"
env["DD_SYNC"] = "0"
say("droiddeck-esync: %s; stock binaries (this Wine has no ntsync)" % reason)
else:
env["BL_SYNC"] = "1"
env["DD_SYNC"] = "1"
say("droiddeck-esync: %s; stock binaries with droiddeck-ntsync" % reason)
log_launch(root, command, env, tool, None)
return command, env
@@ -880,17 +883,17 @@ def wineserver_only(env):
if truthy(env["PROTON_NO_FSYNC"]):
env["WINEFSYNC"] = "0"
if truthy(env["PROTON_NO_NTSYNC"]):
env["BL_SYNC"] = "0"
env["DD_SYNC"] = "0"
return env
def choose(root, command, env, tool, stock):
name = os.path.basename(tool.rstrip("/")) or tool
wants_fsync = env.get("BL_FSYNC_FIRST") == "1"
if "BL_FSYNC" in env:
env["BL_FSYNC"] = "0"
stock = (stock[0], dict(stock[1], BL_FSYNC="0"))
if env.get("BL_SYNC_FALLBACK") != "1" and not wants_fsync and env.get("BL_SYNC") != "1":
wants_fsync = env.get("DD_FSYNC_FIRST") == "1"
if "DD_FSYNC" in env:
env["DD_FSYNC"] = "0"
stock = (stock[0], dict(stock[1], DD_FSYNC="0"))
if env.get("DD_SYNC_FALLBACK") != "1" and not wants_fsync and env.get("DD_SYNC") != "1":
stock = (stock[0], wineserver_only(stock[1]))
say("droiddeck-esync: off; wineserver sync only")
log_launch(root, stock[0], stock[1], tool, None)
@@ -898,14 +901,14 @@ def choose(root, command, env, tool, stock):
cache = HashCache(root)
try:
measured = measure(tool, cache)
if env.get("BL_SYNC") == "1" and not measured["ntsync"]:
env["BL_SYNC"] = "0"
stock = (stock[0], dict(stock[1], BL_SYNC="0"))
if env.get("DD_SYNC") == "1" and not measured["ntsync"]:
env["DD_SYNC"] = "0"
stock = (stock[0], dict(stock[1], DD_SYNC="0"))
wants_fsync = True
say("droiddeck-ntsync: %s has no ntsync; trying droiddeck-fsync" % name)
if wants_fsync and fsync_ready(env, measured):
return with_fsync(root, command, env, tool, "chosen for %s" % name)
if env.get("BL_SYNC_FALLBACK") != "1":
if env.get("DD_SYNC_FALLBACK") != "1":
say("droiddeck-esync: off")
log_launch(root, command, env, tool, None)
return stock
@@ -936,16 +939,16 @@ def choose(root, command, env, tool, stock):
env["WINEESYNC"] = "0"
env["PROTON_NO_ESYNC"] = "1"
if not truthy(env.get("PROTON_NO_NTSYNC")) and measured["ntsync"]:
env["BL_SYNC"] = "1"
env["DD_SYNC"] = "1"
elif not env.get("WINEESYNC"):
env["WINEESYNC"] = "1"
if truthy(env["WINEESYNC"]) and "PROTON_NO_FSYNC" not in env:
env["PROTON_NO_FSYNC"] = "1"
env["WINESERVER"] = os.path.join(dist, WINESERVER)
env["BL_SYNC_PACK"] = pack["id"]
env["DD_SYNC_PACK"] = pack["id"]
command[0] = os.path.join(dist, os.path.basename(command[0]))
say("droiddeck-esync: pack %s for %s (%s, %s match); droiddeck-ntsync %s, droiddeck-esync %s, fds %s/%s"
% (pack["id"], name, measured["version_line"], match_kind(pack, measured), "on" if env.get("BL_SYNC") == "1" else "off",
% (pack["id"], name, measured["version_line"], match_kind(pack, measured), "on" if env.get("DD_SYNC") == "1" else "off",
"on" if truthy(env["WINEESYNC"]) else "off", limit(soft), limit(hard)))
log_launch(root, command, env, tool, pack["id"])
return command, env
@@ -1005,7 +1008,7 @@ def update_wanted(root, fresh, scanned, packs, cache):
def reconcile_store(root, steam_root, env):
cache = HashCache(root)
packs = load_packs(root)
enabled = env.get("BL_SYNC_FALLBACK") == "1"
enabled = env.get("DD_SYNC_FALLBACK") == "1"
rows = []
fresh = {}
scanned = set()
@@ -60,7 +60,7 @@ PROVIDED_NEEDS = {
}
GLIBC_BUILD = re.compile(r"^(?:ld|lib[A-Za-z_]+)-2\.[0-9]+\.so$|^libSegFault\.so$")
GUEST_LIBDIRS = (("x86_64", "lib/x86_64-linux-gnu"), ("i386", "lib/i386-linux-gnu"))
PRELOAD_NAMES = ("libblsession.so", "libfakeinput.so")
PRELOAD_NAMES = ("libddsession.so", "libfakeinput.so")
FAULT_REPORT = "libfaultreport.so"
VULKAN_PIN = "libvulkan-thunk.so"
VULKAN_PIN_DIR = "lib/x86_64-linux-gnu/droiddeck/vulkan"
@@ -182,7 +182,7 @@ def own_fex_loads():
def update_own_fex():
wanted = os.environ.get("BL_FEX_TAG")
wanted = os.environ.get("DD_FEX_TAG")
if not wanted:
return
if (read_text(OWN_FEX_TAG) or "").strip() == wanted and own_fex_loads():
@@ -55,11 +55,11 @@ fex_ready() {
local have ok=
have=$(cat /usr/local/share/fex-emu/.droiddeck-tag 2>/dev/null || true)
[ -x /usr/local/bin/FEX ] && fex_loads / && ok=1
if [ -n "${BL_FEX_TAG:-}" ]; then
if [ -n "$ok" ] && [ "$have" = "$BL_FEX_TAG" ]; then FEX_NOW=$have FEX_FROM=catalog; return 0; fi
step "downloading FEX ($BL_FEX_TAG)"
if fex_install "$BL_FEX_TAG" "${BL_FEX_SHA256:-}" "${BL_FEX_URLS:-}"; then FEX_NOW=$BL_FEX_TAG FEX_FROM=catalog; return 0; fi
if [ -n "$ok" ]; then FEX_NOW=$have FEX_FROM="kept; $BL_FEX_TAG did not install"; return 0; fi
if [ -n "${DD_FEX_TAG:-}" ]; then
if [ -n "$ok" ] && [ "$have" = "$DD_FEX_TAG" ]; then FEX_NOW=$have FEX_FROM=catalog; return 0; fi
step "downloading FEX ($DD_FEX_TAG)"
if fex_install "$DD_FEX_TAG" "${DD_FEX_SHA256:-}" "${DD_FEX_URLS:-}"; then FEX_NOW=$DD_FEX_TAG FEX_FROM=catalog; return 0; fi
if [ -n "$ok" ]; then FEX_NOW=$have FEX_FROM="kept; $DD_FEX_TAG did not install"; return 0; fi
fi
if [ -n "$ok" ] && [ "$have" = "$FEX_TAG" ]; then FEX_NOW=$have FEX_FROM=built-in; return 0; fi
step "downloading FEX ($FEX_TAG)"
@@ -7,7 +7,7 @@ case ":${XDG_DATA_DIRS:-}:" in
*) export XDG_DATA_DIRS=$HOME/.local/share/flatpak/exports/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share} ;;
esac
socket=()
if [ -n "${BL_INSIDE:-}" ] || [ -n "${GAMESCOPE_WAYLAND_DISPLAY:-}" ]; then
if [ -n "${DD_INSIDE:-}" ] || [ -n "${GAMESCOPE_WAYLAND_DISPLAY:-}" ]; then
unset WAYLAND_DISPLAY
export XDG_SESSION_TYPE=x11
socket=(--nosocket=wayland --socket=x11)
@@ -47,7 +47,7 @@ def load_config():
def session_debug_dir(env):
return env.get("BL_DEBUG_DIR", "")
return env.get("DD_DEBUG_DIR", "")
def apply_game_debug_logs(env, config=None, debug_dir=None):
@@ -15,9 +15,9 @@ GAME_PREFIX = "DROIDDECK_GAME_"
GAME_SPLIT_KEYS = ("TU_DEBUG", "MESA_NO_ERROR")
CHROMIUM_FILES = {"chrome-sandbox", "chrome_100_percent.pak", "v8_context_snapshot.bin"}
D3D9_DEFAULT_MEMORY_MB = 4096
SYNC_KEYS = ("BL_SYNC", "BL_SYNC_FALLBACK", "BL_FSYNC_FIRST", "BL_SYNC_MIN_NOFILE", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC", "PROTON_NO_NTSYNC", "WINEESYNC")
SYNC_KEYS = ("DD_SYNC", "DD_SYNC_FALLBACK", "DD_FSYNC_FIRST", "DD_SYNC_MIN_NOFILE", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC", "PROTON_NO_NTSYNC", "WINEESYNC")
SEED_REDISTS = "/usr/local/bin/droiddeck-seed-redists"
PACK_KEYS = ("WINESERVER", "BL_SYNC_PACK", "WINEESYNC", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC")
PACK_KEYS = ("WINESERVER", "DD_SYNC_PACK", "WINEESYNC", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC")
GAME_DEBUG = runpy.run_path(str(Path(__file__).with_name("droiddeck-game-debug")))
game_debug_channels = GAME_DEBUG["game_debug_channels"]
apply_game_debug_logs = GAME_DEBUG["apply_game_debug_logs"]
@@ -454,7 +454,7 @@ def game_gpu(env, keep=False):
def vram_cap(env):
value = env.get("BL_VRAM_MB", "")
value = env.get("DD_VRAM_MB", "")
if not re.fullmatch(r"[1-9][0-9]{0,6}", value):
return env
result = env.copy()
@@ -552,7 +552,7 @@ def cpu_topology(env, command=()):
if env["WINE_CPU_TOPOLOGY"]:
env["PROTON_CPU_TOPOLOGY"] = env["WINE_CPU_TOPOLOGY"]
return
picked = bool(env.get("DROIDDECK_GAME_CORES", "").strip() or env.get("BL_GAME_CPUS", "").strip())
picked = bool(env.get("DROIDDECK_GAME_CORES", "").strip() or env.get("DD_GAME_CPUS", "").strip())
fastest = env.get("DROIDDECK_FASTEST_CORES", "").strip() != "0" and game_id(env) is not None
if not (picked or fastest):
return
@@ -633,7 +633,7 @@ def apply_config(env, config, app_id, fixes=None):
# An open driver pair (PanVK, RADV) on a GPU that is not an Adreno: vkd3d-proton reports the
# driver's own feature level and shader model. The app-wide 12_2 / 6_9 over-promised what PanVK
# has, and an Unreal DX12 game took paths that crashed. A game's own setting still wins.
if env.get("BL_OPEN_DRIVER") == "1":
if env.get("DD_OPEN_DRIVER") == "1":
game = config.get("games", {}).get(app_id, {}) or {}
for name in ("VKD3D_FEATURE_LEVEL", "VKD3D_SHADER_MODEL"):
if name not in game and name in result:
@@ -668,7 +668,7 @@ def render_path_defaults(command, env):
def bridge_feature_level(env):
if env.get("BL_VKBRIDGE") != "1" or env.get("VKD3D_FEATURE_LEVEL") not in ("12_1", "12_2"):
if env.get("DD_VKBRIDGE") != "1" or env.get("VKD3D_FEATURE_LEVEL") not in ("12_1", "12_2"):
return None
was = env["VKD3D_FEATURE_LEVEL"]
env["VKD3D_FEATURE_LEVEL"] = "12_0"
@@ -749,7 +749,7 @@ EVALUATOR_SCRIPT = re.compile(r"(?:^|[\\/])evaluatorscript_[0-9]+\.vdf$", re.IGN
def mark_install_scripts(command, env):
if not any(arg.lower().replace("\\", "/").endswith("iscriptevaluator.exe") for arg in command):
return []
root = env.get("BL_X64_STEAM_ROOT") or env.get("STEAM_COMPAT_CLIENT_INSTALL_PATH") or str(Path.home() / ".local/share/Steam")
root = env.get("DD_X64_STEAM_ROOT") or env.get("STEAM_COMPAT_CLIENT_INSTALL_PATH") or str(Path.home() / ".local/share/Steam")
scripts = [str(Path(root) / arg.replace("\\", "/")) for arg in command if EVALUATOR_SCRIPT.search(arg)]
scripts = [path for path in scripts if os.path.isfile(path)]
if not scripts:
@@ -1001,7 +1001,7 @@ def repair_foreign_system_dlls(prefix, proton, env=None):
machine = pe_machine(path)
if machine is None or PE["machine_compatible"](path, machines, machine, builtins):
continue
link = path.parent / (name + ".bl-new")
link = path.parent / (name + ".dd-new")
backup = path.parent / (name + FOREIGN_SUFFIX)
if backups:
backup = path.parent / (name + FOREIGN_SUFFIX + ".%d" % (backups[-1][0] + 1))
@@ -1270,14 +1270,14 @@ def system_graphics_launch(command, env):
def game_logs(command, env, app_id, now=None):
"""Detailed graphics logs for one game launch, in the session's log folder: Proton's own log,
DXVK's and vkd3d-proton's, and the Vulkan driver's startup messages. The app turns this on
(BL_GAME_LOGS=1) on a GPU that is not an Adreno, or with Setup's "Detailed graphics logs"."""
if env.get("BL_GAME_LOGS") != "1" or not env.get("BL_DEBUG_DIR") or len(command) < 3 \
(DD_GAME_LOGS=1) on a GPU that is not an Adreno, or with Setup's "Detailed graphics logs"."""
if env.get("DD_GAME_LOGS") != "1" or not env.get("DD_DEBUG_DIR") or len(command) < 3 \
or command[1] != "waitforexitandrun":
return env
import time
stamp = time.strftime("%Y%m%d-%H%M%S", time.localtime(now))
name = app_id or re.sub(r"[^A-Za-z0-9._-]+", "_", Path(command[2]).stem)[:40] or "game"
parent = Path(env["BL_DEBUG_DIR"]) / "games"
parent = Path(env["DD_DEBUG_DIR"]) / "games"
try:
parent.mkdir(parents=True, exist_ok=True)
folder = Path(tempfile.mkdtemp(prefix=stamp + "-", suffix="-" + name, dir=parent))
@@ -1303,7 +1303,7 @@ def game_logs(command, env, app_id, now=None):
"proton: %s" % command[0],
"started: %s" % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(now)),
] + ["%s=%s" % (key, env[key]) for key in sorted(env)
if key.startswith(("VK_", "BL_VK", "BL_DRM", "BL_OPEN", "MESA_", "PANVK", "DXVK_", "VKD3D", "ZINK", "TU_", "DROIDDECK_VKD3D"))]) + "\n")
if key.startswith(("VK_", "DD_VK", "DD_DRM", "DD_OPEN", "MESA_", "PANVK", "DXVK_", "VKD3D", "ZINK", "TU_", "DROIDDECK_VKD3D"))]) + "\n")
except OSError:
pass
# Whether the game's sound reaches PulseAudio: the streams 20 s and 60 s in, without waiting.
@@ -1328,7 +1328,7 @@ def main():
if not command:
return 2
env = game_gpu(os.environ.copy())
mic_enabled = env.get("BL_MIC_ENABLED")
mic_enabled = env.get("DD_MIC_ENABLED")
debug_dir = session_debug_dir(env)
prefix_path = env.get("STEAM_COMPAT_DATA_PATH", "").rstrip("/")
app_id = game_id(env)
@@ -99,11 +99,11 @@ def desktop_environment(base, proc=Path("/proc")):
if command != b"/usr/bin/plasmashell":
continue
values = dict(os.fsdecode(item).split("=", 1) for item in (entry / "environ").read_bytes().split(b"\0") if b"=" in item)
if values.get("BL_DESKTOP") != "1" or values.get("XDG_RUNTIME_DIR") != env.get("XDG_RUNTIME_DIR"):
if values.get("DD_DESKTOP") != "1" or values.get("XDG_RUNTIME_DIR") != env.get("XDG_RUNTIME_DIR"):
continue
if not values.get("DISPLAY") or values.get("WAYLAND_DISPLAY") == env.get("WAYLAND_DISPLAY"):
continue
for key in ("DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS", "BL_DESKTOP"):
for key in ("DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS", "DD_DESKTOP"):
if key in values:
env[key] = values[key]
return env
@@ -130,10 +130,10 @@ def runner(folder, appid, game, graphical=False):
raise ValueError("No Proton tool is installed for this game")
tool, command = available[name]
base = desktop_environment(os.environ) if graphical else dict(os.environ)
env = run["environment"](base, target, tool, root, window=base.get("BL_DESKTOP") == "1")
env = run["environment"](base, target, tool, root, window=base.get("DD_DESKTOP") == "1")
env["DROIDDECK_GOG_MAINTENANCE"] = "1"
env["FEX_X87REDUCEDPRECISION"] = "0"
env.pop("BL_STORE_EXIT", None)
env.pop("DD_STORE_EXIT", None)
return str(Path(tool) / command), env, target.compatdata
@@ -44,8 +44,8 @@ def advertise_compositing():
if __name__ == '__main__':
if len(sys.argv) < 2:
raise SystemExit('usage: droiddeck-gpu-window <program> [args...]')
if 'BL_GPU_CHILD_WSI' in os.environ:
wsi = os.environ.pop('BL_GPU_CHILD_WSI')
if 'DD_GPU_CHILD_WSI' in os.environ:
wsi = os.environ.pop('DD_GPU_CHILD_WSI')
if wsi:
os.environ['MESA_VK_WSI_DEBUG'] = wsi
else:
@@ -84,8 +84,8 @@ def connect():
def main():
launch = os.environ.get("BL_LAUNCH_DIR", "")
report = Report(os.environ.get("BL_IME_DIR") or (os.path.join(launch, "agent") if launch else ""))
launch = os.environ.get("DD_LAUNCH_DIR", "")
report = Report(os.environ.get("DD_IME_DIR") or (os.path.join(launch, "agent") if launch else ""))
conn = Connection(connect())
conn.send(DISPLAY_ID, 1, struct.pack("<I", REGISTRY_ID))
contexts = {}
@@ -323,7 +323,7 @@ def load_netmanager():
def main():
directory = os.environ.get("BL_LAUNCH_DIR")
directory = os.environ.get("DD_LAUNCH_DIR")
if not directory or not Path(directory).is_dir():
sys.exit("droiddeck-login1: no DroidDeck session directory")
ready = Path(directory) / "steam-sleep-ready"
@@ -187,7 +187,7 @@ def import_of(key, what):
def imported(what, real, key, name):
launch = os.environ.get("BL_LAUNCH_DIR")
launch = os.environ.get("DD_LAUNCH_DIR")
if not launch or not os.path.isdir(launch):
raise RuntimeError("%s cannot run from here; add it in DroidDeck with Add an app." % name)
result = os.path.join(launch, "desktop-import-%s.result" % key)
@@ -311,7 +311,7 @@ def command(path, args, what, window=False, appid=None):
def on_desktop(env):
return env.get("BL_DESKTOP") == "1" and not env.get("GAMESCOPE_WAYLAND_DISPLAY") and os.access(GPU, os.X_OK)
return env.get("DD_DESKTOP") == "1" and not env.get("GAMESCOPE_WAYLAND_DISPLAY") and os.access(GPU, os.X_OK)
def unattended(env):
@@ -321,7 +321,7 @@ def unattended(env):
return True
if stat.S_ISCHR(out.st_mode):
return not os.isatty(1)
folder = env.get("BL_DEBUG_DIR")
folder = env.get("DD_DEBUG_DIR")
try:
log = os.stat(os.path.join(folder, "desktop.log")) if folder else None
except OSError:
@@ -30,7 +30,7 @@ def main(argv):
url = argv[0] if argv else ""
if url.startswith("steam://openurl/"):
url = url[len("steam://openurl/"):]
launch_dir = os.environ.get("BL_LAUNCH_DIR", "")
launch_dir = os.environ.get("DD_LAUNCH_DIR", "")
if not launch_dir:
try:
launch_dir = open(LAUNCH_DIR_FILE).read().strip()
@@ -693,7 +693,7 @@ def melonds_geometry():
import base64, struct
w, h = 512, 288
try:
screen_w = int(os.environ.get("BL_WIDTH", "1920"))
screen_w = int(os.environ.get("DD_WIDTH", "1920"))
except ValueError:
screen_w = 1920
rect = (0, 0, w - 1, h - 1)
@@ -227,7 +227,7 @@ def shortcut_entries(root):
except (OSError, ValueError, IndexError, KeyError, struct.error):
pass
try:
with open(os.environ.get("BL_ADDED_GAMES", ""), encoding="utf-8") as f:
with open(os.environ.get("DD_ADDED_GAMES", ""), encoding="utf-8") as f:
for game in json.load(f):
if isinstance(game, dict) and game.get("exe") and str(game.get("appid", "")).isdigit():
entries.append((int(game["appid"]) & 0xFFFFFFFF, game["exe"], game.get("dir") or ""))
@@ -16,7 +16,7 @@ run=("${interp[@]}" "./$entry")
if [ -x /usr/local/bin/droiddeck-fex ]; then
run=(/usr/local/bin/droiddeck-fex run --mode "$fex" --for "$folder" -- "${interp[@]}" "./$entry")
fi
if [ "$fex" = off ]; then unset BL_BINFMT; else export BL_BINFMT=1; fi
if [ "$fex" = off ]; then unset DD_BINFMT; else export DD_BINFMT=1; fi
echo "== script $entry in $folder (${interp[*]:-a program}, FEX $fex)"
case ${DBUS_SESSION_BUS_ADDRESS:-} in
unix:*) "${run[@]}" "$@" ;;
File diff suppressed because it is too large. Load diff
@@ -1315,7 +1315,7 @@ def main():
files_only = sys.argv[1:2] == ["--files-only"]
steam_root = sys.argv[2 if files_only else 1]
try:
port = int(os.environ.get("BL_CDP_PORT", ""))
port = int(os.environ.get("DD_CDP_PORT", ""))
except ValueError:
say("no devtools port for this session; the client's mapping is kept through config.vdf")
return 0
@@ -1339,7 +1339,7 @@ def main():
watcher = Watcher([COMPAT["state_path"]("request.json"), COMPAT["state_path"]("games.json"),
os.path.join(steam_root, "appcache", "appinfo.vdf")] +
[os.path.join(lib, "steamapps", "libraryfolders.vdf") for lib in (steam_root, COMPAT["LIBRARY"] + "-sd")])
steamos = os.environ.get("BL_STEAMDECK") == "1" and os.environ.get("BL_STEAM_UI") != "desktop"
steamos = os.environ.get("DD_STEAMDECK") == "1" and os.environ.get("DD_STEAM_UI") != "desktop"
helper = Helper(steam_root, port, steamos)
failures = 0
last = None
@@ -21,9 +21,9 @@ def select_desktop(evaluate, timeout=90):
if __name__ == '__main__':
base = os.environ.get('BL_LAUNCH_DIR')
base = os.environ.get('DD_LAUNCH_DIR')
if not base:
raise SystemExit('BL_LAUNCH_DIR is not set')
raise SystemExit('DD_LAUNCH_DIR is not set')
agent = runpy.run_path('/usr/local/bin/droiddeck-agent')
selected = select_desktop(lambda expression: agent['cdp_eval'](
Path(base) / 'agent', expression, timeout=2))
@@ -134,7 +134,7 @@ def method(obj, slot, result, *args):
def probe(steam_root, ids):
library = C.CDLL(os.environ.get("BL_STEAMCLIENT") or str(Path(steam_root) / "steamrtarm64/steamclient.so"))
library = C.CDLL(os.environ.get("DD_STEAMCLIENT") or str(Path(steam_root) / "steamrtarm64/steamclient.so"))
library.CreateInterface.argtypes = [C.c_char_p, C.c_void_p]
library.CreateInterface.restype = C.c_void_p
client = library.CreateInterface(b"SteamClient020", None)
@@ -184,8 +184,8 @@ def downloads_idle(steam_root):
def request_restart(steam_root):
Path(os.environ.get("HOME", "/root"), ".bl-restart-once").touch()
command = shlex.split(os.environ.get("BL_STEAM_SHUTDOWN", "")) or [str(Path(steam_root) / "steamrtarm64/steam"), "-shutdown"]
Path(os.environ.get("HOME", "/root"), ".dd-restart-once").touch()
command = shlex.split(os.environ.get("DD_STEAM_SHUTDOWN", "")) or [str(Path(steam_root) / "steamrtarm64/steam"), "-shutdown"]
subprocess.run(command,
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=30)
@@ -231,7 +231,7 @@ def remember_tried(steam_root, account, appids):
def watch(steam_root, listing):
games = [game for game in read_json(listing, []) if not store_game(game) and not game.get("native")]
if os.environ.get("BL_STEAM_OFFLINE") == "1" or not games:
if os.environ.get("DD_STEAM_OFFLINE") == "1" or not games:
return
candidates, sources = {}, {}
next_lookup = 0
@@ -259,7 +259,7 @@ def watch(steam_root, listing):
elif candidates and (key != probed or now >= next_probe):
probed, next_probe = key, now + 300
try:
probe_env = dict(os.environ, HOME=os.environ["BL_STEAM_IPC_HOME"]) if os.environ.get("BL_STEAM_IPC_HOME") else None
probe_env = dict(os.environ, HOME=os.environ["DD_STEAM_IPC_HOME"]) if os.environ.get("DD_STEAM_IPC_HOME") else None
result = subprocess.run([sys.executable, __file__, "probe", steam_root,
*map(str, sorted(set(candidates.values())))],
capture_output=True, text=True, timeout=15, env=probe_env)
@@ -6,7 +6,7 @@ stable_channel=steamdeck_stable
steam_root=${XDG_DATA_HOME:-$HOME/.local/share}/Steam
channel_state=$steam_root/package/droiddeck-channel
pinned=1
wanted=${BL_STEAM_CHANNEL:-$(cat "$HOME/.config/droiddeck/steam-channel" 2>/dev/null || true)}
wanted=${DD_STEAM_CHANNEL:-$(cat "$HOME/.config/droiddeck/steam-channel" 2>/dev/null || true)}
case $wanted in
stable|"$stable_channel") steam_channel=$stable_channel ;;
beta|"$beta_channel") steam_channel=$beta_channel ;;
@@ -24,7 +24,7 @@ manifest=steam_client_${steam_channel}_linuxarm64
stamp=$steam_root/package/droiddeck-installed
legacy_stamp=$steam_root/package/bannerlator-installed
unconfirmed=$steam_root/package/droiddeck-unconfirmed
repair_request=$HOME/.bl-steam-repair
repair_request=$HOME/.dd-steam-repair
parts=$steam_root/package/droiddeck-download
if [ -f "$legacy_stamp" ] && [ ! -f "$stamp" ]; then
mv -f "$legacy_stamp" "$stamp" || true
@@ -85,7 +85,7 @@ size_of() {
echo $((n))
}
limits=(--connect-timeout 30 --speed-limit 4096 --speed-time 60)
read -r -a delays <<< "${BL_STEAM_RETRY_DELAYS:-5 10 20 30 30}"
read -r -a delays <<< "${DD_STEAM_RETRY_DELAYS:-5 10 20 30 30}"
step() { echo "== STEP $(date -u +%H:%M:%S) $*"; }
progress() {
@@ -11,13 +11,13 @@ case $target in
*) url=steam://rungameid/$target ;;
esac
if [ "$ui" = desktop ] && [ "${BL_DESKTOP:-}" = 1 ]; then
if [ "$ui" = desktop ] && [ "${DD_DESKTOP:-}" = 1 ]; then
case ",${MESA_VK_WSI_DEBUG:-}," in
*,sw,*) ;;
*) export MESA_VK_WSI_DEBUG=${MESA_VK_WSI_DEBUG:+$MESA_VK_WSI_DEBUG,}sw ;;
esac
if [ "${BL_STEAM_CLIENT_ARCH:-}" = x86_64 ]; then
client_home=${BL_X64_HOME:-${HOME:-/root}/.droiddeck-x64}
if [ "${DD_STEAM_CLIENT_ARCH:-}" = x86_64 ]; then
client_home=${DD_X64_HOME:-${HOME:-/root}/.droiddeck-x64}
client=(/usr/local/bin/droiddeck-steam-x64 --exec)
else
steam_root=${XDG_DATA_HOME:-${HOME:-/root}/.local/share}/Steam
@@ -25,7 +25,7 @@ if [ "$ui" = desktop ] && [ "${BL_DESKTOP:-}" = 1 ]; then
client_home=$HOME
client=("$steam_root/steamrtarm64/steam")
fi
if [ "${BL_BOTTOM_DESKTOP:-}" = 1 ]; then
if [ "${DD_BOTTOM_DESKTOP:-}" = 1 ]; then
pid=$(cat "$client_home/.steam/steam.pid" 2>/dev/null || true)
if [ -p "$client_home/.steam/steam.pipe" ] && [[ "$pid" =~ ^[0-9]+$ ]] && kill -0 "$pid" 2>/dev/null; then
# The top screen's client takes the request, so games open there.
@@ -48,13 +48,13 @@ if [ "$ui" = desktop ] && [ "${BL_DESKTOP:-}" = 1 ]; then
exit 69
fi
[ "$url" = steam://exit ] && exit 0
export BL_INSIDE=1 BL_STEAM_UI=desktop
export DD_INSIDE=1 DD_STEAM_UI=desktop
exec /usr/local/bin/droiddeck-session steam "${url:-steam://open/library}"
fi
dir=${BL_LAUNCH_DIR:-}
dir=${DD_LAUNCH_DIR:-}
if [ -z "$dir" ] || [ ! -d "$dir" ]; then
echo "droiddeck-steam-launch: not inside a DroidDeck session (BL_LAUNCH_DIR unset)" >&2
echo "droiddeck-steam-launch: not inside a DroidDeck session (DD_LAUNCH_DIR unset)" >&2
exit 69
fi
printf 'ui=%s\nurl=%s\n' "$ui" "$url" > "$dir/steam-launch.tmp" && mv -f "$dir/steam-launch.tmp" "$dir/steam-launch"
@@ -6,7 +6,7 @@ import runpy
import sys
BIN_DIR = os.path.dirname(os.path.abspath(__file__))
LIBRARIES = (("/mnt/droiddeck-sd", os.environ.get("BL_LIBRARY_LABEL", "SD Card")),)
LIBRARIES = (("/mnt/droiddeck-sd", os.environ.get("DD_LIBRARY_LABEL", "SD Card")),)
MAIN_LABEL = "Internal Storage"
@@ -219,7 +219,7 @@ ADDED_DIR = "/mnt/droiddeck-lib/"
def wanted():
listing = os.environ.get("BL_STEAM_LIBRARIES")
listing = os.environ.get("DD_STEAM_LIBRARIES")
if not listing:
return None
try:
@@ -1,6 +1,6 @@
#!/bin/bash
set -u
if [ "${BL_DESKTOP:-}" = 1 ]; then
if [ "${DD_DESKTOP:-}" = 1 ]; then
url=
ui=desktop
for arg in "$@"; do
@@ -12,5 +12,5 @@ if [ "${BL_DESKTOP:-}" = 1 ]; then
done
exec /usr/local/bin/droiddeck-steam-launch "$ui" ${url:+"$url"}
fi
[ "${BL_STEAM_CLIENT_ARCH:-}" = x86_64 ] && exec /usr/local/bin/droiddeck-steam-x64 --exec "$@"
[ "${DD_STEAM_CLIENT_ARCH:-}" = x86_64 ] && exec /usr/local/bin/droiddeck-steam-x64 --exec "$@"
exec "${HOME:-/root}/.local/share/Steam/steamrtarm64/steam" "$@"
Loaded 100 of 229 files, more files were not shown because too many files have changed in this diff. Show more