mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 11:01:07 +00:00
* fix: Red Dead Redemption 2 launches again, its Vulkan runtime installer is left to run droiddeck-seed-redists marked every process in every game's install script as already run, Red Dead Redemption 2's VulkanRT-1.1.108.0 installer included. Steam's compat config for the game says nativevulkanloader, so Proton loads vulkan-1.dll native only, and Khronos' loader is in the prefix only once that installer has run. Without it the Rockstar launcher starts RDR2.exe and it exits with STATUS_DLL_NOT_FOUND (0xc0000135) before it opens a window. A Vulkan runtime installer is now left out of the seeding, and a marker an earlier seeding wrote for one comes out of each prefix and Proton template once (dates kept), so the client runs the installer on the next launch. The installer finishes in a few seconds under FEX. * fix: Steam's screensaver no longer covers a running game The client's defaults show screensavers while a game runs, after 300 s on AC power without a button press - and a held stick or trigger is no press. Red Dead Redemption 2's intro runs longer than that: the slideshow covered the game, and the button that woke it reached the game too (B asked to quit to the desktop). Customization/Screensaver/WhileInGame is seeded "0" in config.vdf once, like the UI scale and native resolution, so turning it back on in Settings stays the user's choice. On the RedMagic: 18 minutes from the last button press through the intro and riding, focus never left the game and no screensaver was created. * fix: Rockstar's hidden launcher no longer takes cores from its game The Rockstar Games Launcher keeps drawing its Chromium interface (SocialClubHelper.exe: renderers, and a GPU process compositing through DXVK) for as long as the game runs, hidden behind it - and Wine passes Chromium's priorities on, so those threads ran above the game's (the GPU process at nice -10), across every core. With Red Dead Redemption 2 in front that was 1.3 to 2.5 cores under FEX for a page nobody sees. droiddeck-launcher-cores follows gamescope's focus from the agent's focus.json: while a game window has it, every SocialClubHelper thread runs on the last core of the slowest cluster at nice 19; when the launcher's own window has focus again each thread gets its own mask and priority back (also on exit). Stopping the helpers would not hold - proot resumes a stopped tracee. Started for Steam sessions; BL_LAUNCHER_CORES=0 turns it off. RedMagic, RDR2 all Low, riding at the thermal limit, same spot and session: released 46.5 fps, 1% low 27.5, p99 31.8 ms, CPU 89%, 2200 MHz; held 48.7 fps, 1% low 32.6, p99 27.6 ms, CPU 79%, 2638 MHz. * fix: sessions clean up what earlier ones left in /tmp The guest's /tmp is a directory in the rootfs that no boot ever empties, and Android ends sessions by killing them. Every session left a /tmp/mangohud.XXXXXXXX (mktemp, never removed), and the Steam client, its web helper, Chromium apps, dbus-run-session, AppImage runs and KDE their own temporary files and sockets: 1,422 entries on the RedMagic. mangoapp's config is now one fixed file rewritten each session, and the session's first pass sweeps each kind of leftover while nothing that could own one is running, with a single find. On the device that cleared 1,391 entries over two sessions, leaving 38.
96 lines
3.8 KiB
Python
96 lines
3.8 KiB
Python
import os
|
|
import re
|
|
import shutil
|
|
import socket
|
|
import subprocess
|
|
import tempfile
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
SESSION = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin/droiddeck-session"
|
|
|
|
STEAM = ["mangohud.Ab3dE6gH", ".com.valvesoftware.Steam.x1Y2z3/", "steam_chrome_shmem_uid10480_0", "steamADfAnd/"]
|
|
CHROMIUM = ["scoped_dir3yu9Xt/SingletonSocket"]
|
|
APPIMAGE = ["droiddeck-appimage.19PoOD"]
|
|
BUS = ["dbus-1zWfOP1IaR="] # = a socket
|
|
KDE = ["plasma-csd-generator.BVWIWA/"]
|
|
STALE = STEAM + CHROMIUM + APPIMAGE + BUS + KDE
|
|
KEPT = ["droiddeck-mangohud.conf", ".X11-unix/", "steamworks", "steamABCDEF/inside", "notes.txt",
|
|
"mangohud.conf", ".wine-10480/", "dbus-1zWfOP1IaR.log", "dbus-notasocket",
|
|
"plasma-csd-generator.CQGZSw/kept"]
|
|
|
|
|
|
def sweep_function(tmp):
|
|
match = re.search(r"^clear_stale_tmp\(\) \{\n.*?^\}\n", SESSION.read_text(), re.M | re.S)
|
|
return match.group(0).replace("find /tmp ", "find %s " % tmp)
|
|
|
|
|
|
class SessionTmpTest(unittest.TestCase):
|
|
def setUp(self):
|
|
self.root = Path(tempfile.mkdtemp())
|
|
self.addCleanup(shutil.rmtree, self.root, True)
|
|
self.tmp = self.root / "tmp"
|
|
self.tmp.mkdir()
|
|
for name in STALE + KEPT:
|
|
path = self.tmp / name
|
|
if name.endswith("/"):
|
|
path.mkdir(parents=True)
|
|
elif name.endswith("="):
|
|
listener = socket.socket(socket.AF_UNIX)
|
|
listener.bind(str(self.tmp / name[:-1]))
|
|
listener.close()
|
|
else:
|
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
path.write_text("x")
|
|
self.bin = self.root / "bin"
|
|
self.bin.mkdir()
|
|
|
|
def sweep(self, running=""):
|
|
pgrep = self.bin / "pgrep"
|
|
pgrep.write_text("#!/bin/sh\nprintf '%s' '" + running + "'\n")
|
|
pgrep.chmod(0o755)
|
|
env = dict(os.environ, PATH="%s:%s" % (self.bin, os.environ["PATH"]))
|
|
return subprocess.run(["bash", "-c", sweep_function(self.tmp) + "clear_stale_tmp"], env=env,
|
|
capture_output=True, text=True, timeout=30, check=True).stdout
|
|
|
|
def exists(self, name):
|
|
return os.path.lexists(self.tmp / name.rstrip("=").split("/")[0])
|
|
|
|
def test_what_killed_sessions_left_goes_and_nothing_else(self):
|
|
self.assertEqual("== /tmp: cleared 8 entries earlier sessions left\n", self.sweep())
|
|
for name in STALE:
|
|
self.assertFalse(self.exists(name), name)
|
|
for name in KEPT:
|
|
self.assertTrue((self.tmp / name).exists(), name)
|
|
|
|
def kept_while(self, running, owned):
|
|
self.sweep(running)
|
|
for name in STALE:
|
|
self.assertEqual(name in owned, self.exists(name), name)
|
|
|
|
def test_a_running_client_keeps_its_own(self):
|
|
self.kept_while("1234 /root/.local/share/Steam/steamrtarm64/steam -gamepadui\n", STEAM)
|
|
|
|
def test_a_running_chromium_keeps_its_singleton(self):
|
|
self.kept_while("88 /opt/Heroic/heroic --type=renderer --enable-features=x\n", CHROMIUM)
|
|
|
|
def test_a_running_appimage_keeps_its_stamp(self):
|
|
self.kept_while("77 /bin/bash /usr/local/bin/droiddeck-appimage-run /root/Apps/X.AppImage\n", APPIMAGE)
|
|
|
|
def test_a_running_session_bus_keeps_its_socket(self):
|
|
self.kept_while("66 dbus-daemon --config-file=/usr/share/dbus-1/session.conf --nofork --session\n", BUS)
|
|
|
|
def test_the_system_bus_is_not_a_session_bus(self):
|
|
self.kept_while("55 dbus-daemon --config-file=/usr/local/share/droiddeck/system-bus.conf --nofork\n", [])
|
|
|
|
def test_a_running_desktop_keeps_its_decorations(self):
|
|
self.kept_while("44 kwin_wayland --xwayland\n", KDE)
|
|
|
|
def test_a_clean_tmp_says_nothing(self):
|
|
self.sweep()
|
|
self.assertEqual("", self.sweep())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|