* FEX: emulate x86-64 ptrace, seccomp and /proc for anti-cheat launchers
* Guest hook: route raw execve/execveat through the exec wrapper and pass self-sent SIGSYS to the program
A program that execs with syscall(SYS_execveat, ...) bypassed the environment the
guest needs, so re-executing /proc/self/exe died in the loader. /proc/self/exe now
maps to the real program on exec as it already does on open.
A SIGSYS the program queues itself, or one from a filter for another architecture,
went to the Android-filter emulation instead of the program's handler.
* FEX: list only guest mappings in /proc/<pid>/maps on hosts below 47 address bits
Credit the anti-cheat emulation source in the patch header.
* Preloads: leave poll, ppoll and select buffers untouched when no emulated device is open
A bad user pointer now reaches the kernel and returns EFAULT instead of crashing the caller inside the wrapper.
* Emulate only host-architecture seccomp traps in the guest hook; report the calling thread's seccomp mode in FEX's /proc/self/status
A SIGSYS carrying another architecture's seccomp siginfo now takes its default action when the program has no handler, so a process whose emulated filter traps a syscall while SIGSYS is blocked or ignored dies as on Linux.
* FEX: read the host status file through the raw openat syscall
* README: credit StonkGuy's FEX anti-cheat emulation
* FEX: open the host status file with a direct system call so preloads cannot rewrite it
* FEX: hand a traced program's ptrace state across exec
* Credit StonkGuy in the FEX anti-cheat patches and README
Co-authored-by: StonkGuy <68372320+StonkGuy@users.noreply.github.com>
* FEX: open guest paths with the raw openat system call so host preloads cannot replace the file
* FEX: serve emulated proc files by the requested path when the host returns a memfd
* FEX: map fixed guest memory above a small host address space
Co-authored-by: StonkGuy <StonkGuy@users.noreply.github.com>
* FEX: serve decoder reads from fixed guest memory above the host limit
* Run games with anti-cheat files on an x86-64 DroidDeck-Proton under FEX
The Proton launchers look for Easy Anti-Cheat or BattlEye bridge files in
the game folder and, when an x86-64 DroidDeck-Proton and the matching Proton
runtime are installed, hand the launch to that Proton under FEX with the
game's own prefix. Picking the x86-64 tool directly also runs it under FEX.
DROIDDECK_ANTICHEAT=off keeps a game on ARM64.
* Keep x86-64 DroidDeck-Proton builds out of the ARM64 tool list
* droiddeck-fex: take the runtime from an adopted tool's original manifest
* FEX: show the guest command line when the argument area cannot be remapped
* FEX: describe the container's procfs in emulated mount tables
* FEX: order the anti-cheat series after the guest stack patch from main
* Test the container procfs view of FEX's emulated mount tables
* Docs: describe the anti-cheat signal mask fix and the container procfs view
* README: match the StonkGuy credit to the renumbered FEX patches
* Keep anti-cheat games on a tool the user chose instead of moving them to x86-64
* test(game-env): build the adopted-tool wrapper through extra_wrapper_sh
* Check anti-cheat runtime bridges, apply component choices under FEX and honour MAP_FIXED_NOREPLACE above the host limit
* Check the driver query is answered before each wrapper's call sites
* Keep x86-64 Proton builds out of the automatic default tool
* Keep high guest mappings intact when a fixed map or unmap fails
Check room in the region table, splits included, before a fixed map or
unmap removes anything, return the host munmap error without touching
the table entry, and keep write-protecting low shared aliases of
executable ranges that sit above the host address limit.
* Keep a requested x86-64 default and accept linked anti-cheat runtimes
A request for the current automatic x86-64 default now marks it as the
app's choice, so the next settle no longer moves it back to ARM64.
Anti-cheat runtime discovery follows a symlinked runtime directory.
* Route anti-cheat games to x86-64 Proton only on a capable FEX
The FEX build now lists its patches in share/fex-emu/.droiddeck-patches.
Anti-cheat routing needs the fixed guest memory patch in that list and
otherwise keeps the launch on ARM64, as an older FEX cannot map the
anti-cheat helper buffer above the host address limit. Installing a FEX
build without the list removes a list left by an earlier build.
* Update FEX before deciding anti-cheat routing
A device on an older FEX build never went through droiddeck-fex on the
ARM64 path, so the catalog FEX was never installed and the gate kept
anti-cheat games on ARM64 forever. dd_anticheat now runs the new
droiddeck-fex update action first, which installs the catalog build
under the same lock and retry window as other FEX launches.
* Leave MAP_FIXED_NOREPLACE above the host limit to the host
Wine finds the top of the address space with MAP_FIXED_NOREPLACE probes.
Claiming those probes above a 39-bit host limit made Wine place its stacks
in relocated memory, and every wineserver request then failed with EFAULT
because the iovec buffers it passes to writev are nested pointers that are
not translated. Only MAP_FIXED requests are relocated again, so the probes
see the real host limit while fixed mappings above it keep working.
* Translate only pointer syscall arguments into high guest memory
Pointer arguments are now picked from a per-syscall layout table, so
scalar values such as a truncate length are never rewritten. Sized
buffers must map to one contiguous host range or the call fails with
EFAULT, and new host backings are placed next to their guest
neighbours so adjacent mappings stay contiguous. readv, writev and the
preadv/pwritev family, sendmsg and recvmsg get a host-side copy of
their iovec and msghdr with translated bases, leaving the guest copies
untouched. Code invalidation for kernel writes maps the host buffer
back to its guest address, and an unmap checks the table before it
changes any host mapping.
* Claim high guest memory only with LSE atomics and invalidate every code alias
High guest mappings are claimed only when the JIT emits LSE atomics, and
exclusive load/store instructions are never single-stepped, so an atomic
on high memory cannot spin. A store into high code invalidates every
mirror of the written page through the tracked mapping. madvise and
mprotect on high memory apply to each region at its own host address.
* Reject wrapping lengths and drop stale code on discarded high memory
A nonzero length that wraps when page-aligned now fails madvise with
EINVAL and mprotect with ENOMEM, as on Linux. Discarding advice on
high memory invalidates translated code for the range whenever advice
reached any region.
* Add an end-to-end probe for guest memory above the host address limit
* Emulate exclusive pairs on high guest memory and release failed host unmaps later
* Size counted guest buffers by element and keep exclusive access within guest protection
poll, ppoll, epoll waits, mmsg calls and select bitmaps now translate the whole array their count describes, so a buffer that crosses into an unrelated host range fails with EFAULT and oversized counts cannot wrap. High regions remember their protection through mprotect, splitting at the range edges, and exclusive stores to read-only pages or loads from inaccessible pages reach the guest as a fault instead of being emulated.
* Refuse a high unmap when failed host unmaps could not all be retained
UnmapLocked counts the overlapping regions before it changes anything and returns ENOMEM when the retired list could not hold all of them, so a host range is never dropped from tracking while still mapped.
* Serve memory trim requests while syscall user dispatch blocks
A thread that runs with syscall user dispatch on and its selector set to
block (as x86-64 Wine does while in Windows code) took the trim signal
with the selector still blocking. Every raw syscall the handler made was
then dispatched to the program's SIGSYS handler, which either deadlocked
the thread or killed the process when SIGSYS was blocked, so the session
saw it as a deaf process and the game stalled during loading.
Track the selector each thread registers through prctl, allow syscalls
for the length of the handler and restore the selector before returning.
* Allow syscalls for a forwarded prctl while dispatch blocks
The prctl wrapper issues its syscall from the preload's own text, so a
thread whose selector blocks got SIGSYS where the plain libc call would
have been dispatched the same way by the caller's own rules. Allow
syscalls for the forwarded call and restore the selector afterwards.
The dispatch test now waits until the selector blocks before it sends
the trim request, and checks a prctl call made while it blocks.
* Merge high regions after protection changes and translate message batches
Protect now merges neighbouring high regions whose guest and host
ranges touch and whose protection and code state match, so toggling
page protections no longer fills the region table.
Exclusive loads on high memory accept write-only pages and exclusive
stores need only PROT_WRITE, matching x86-64 where writable pages are
readable.
sendmmsg and recvmmsg translate the name, control and io vectors of
every message in the batch, return msg_len for each processed message
and the received header fields for recvmmsg.
Counted arrays passed to getgroups, setgroups, semop, semtimedop,
io_submit, io_getevents, io_pgetevents, move_pages, futex_waitv and
listmount are now checked to stay within one host range. The unused
ToHost helper is removed.
* Translate fixed-size, string and in-array guest pointers in high memory
Give every syscall pointer without a length a fixed x86-64 size, a
length read through another argument, or a terminator scan for strings,
so spans crossing separately backed regions are refused before the
kernel sees them. Size message queue buffers as the type word plus
msgsz. Translate io_submit control blocks and their buffers, including
vectored reads and writes, through bounded host copies, restore the
guest words afterwards, and report guest iocb addresses back from
io_getevents. Translate move_pages page lists for the calling process
and futex_waitv addresses. Merge new mappings with matching neighbours.
* Size high-memory syscall spans by kernel widths and embedded sizes
Read counts with the width the kernel uses for each argument, so int
and unsigned int counts ignore the upper register bits and negative
counts reach the handler. Size capability data by its header version,
perf and scheduler attributes, file handles and mount requests by their
own size fields, and landlock rules by rule type. Keep the translated
prefix of a message batch, read headers that span separate backings one
by one, write results back through the current guest mapping, and stop
counting messages whose length cannot be stored. Revisit an entry moved
into an earlier slot while merging regions. Give newer syscalls
fallback numbers in the test harness.
* Send translated message batches one message at a time
Submit sendmmsg batches that need scratch headers one message per call,
storing each length before the next message goes out, so a length that
cannot be stored stops the batch where Linux would. Skip the name length
when no name was given and store flags before the control length. Check
the whole fixed file-handle header even when its size is invalid. Hand
capget and capset a private header so the checked data size matches the
version the kernel reads, and return a rewritten version to the guest.
Patch and restore AIO control blocks under the mapping lock and restore
only the block that was patched.
* Harden high-memory aio, capability and message batch write-backs
Restore patched aio buffers through /proc/self/mem when the control block
became read-only and keep the scratch vectors alive if that fails too,
fault capability calls whose header write-back fails, stop send batches
after a short message, and pin the batch socket with a private dup.
* Pin batch sockets, fall back to whole batches and reconcile pending aio restores
Follow-up message sends and the first dispatch share one duplicated
socket. When it cannot be duplicated, the whole translated batch goes
to the kernel in one call and lengths are written back up to the first
one that cannot be stored. Short sends compare against the iovec
lengths given to the kernel. Unrestorable aio_buf edits, including
unreadable control blocks, keep their storage in a bounded list that
later submissions reconcile.
* Stop message batches at unreadable vectors, send singly without a spare descriptor and reserve aio restore slots
A message whose iovec snapshot cannot be taken ends the prepared batch
instead of being sent with an unknown length; when it is the first
message the kernel handles the original array natively. When the
batch socket cannot be duplicated, messages still go one at a time on
the original descriptor with each length written before the next send.
Pending aio restore slots are reserved under the pending mutex before
the first guest edit and released or handed to the pending record, so
concurrent submissions cannot exceed the bound. Tests use a real
socket pair, injected descriptor exhaustion and concurrent
reservations.
* Send only the first message of a batch when the socket cannot be pinned
* Replay high-memory faults over the whole access and reconcile aio restores on unmap
* Keep high-memory traps ordered, fault-exact and locked against unmap
Protect, Map and low mmap/munmap/mremap/mprotect reconcile pending aio
restores at once, and io_submit reconciles them even when no high region
is mapped. Ordered loads and stores split across backings are emulated
between full fences instead of being byte-copied through the trampoline;
atomics and exclusives are still refused. Gather and scatter use
fault-safe copies, and a failing piece is re-faulted at the guest
instruction through a probe load, with SIGBUS redelivered the same way.
The VMA lock is held from planning until the scatter finishes, so unmap
and protect cannot race a resumed access. Sign-extending loads are no
longer classified as writes.
* Defer user signals while guest high memory mappings are held
Only the trampoline breakpoint completes a replay, user-sent SIGSEGV,
SIGBUS and SIGTRAP raised while the mapping lock is held are requeued
after it is released, and stranded control block words are restored
when their page turns readable again. The harness now runs under a
timeout.
* Rebase the FEX patch series onto FEX-2612
* FEX: restore stranded aio words before readable protection, report failures
Restore every pending aio word in the range before a readable guest
protection is applied, on both the high and low paths, and fail the guest
mprotect with the old protection kept when a word cannot be restored or its
window cannot be closed. Ignore user-sent SIGSEGV/SIGBUS after deferral,
read the cleared syscall info when resuming with guest GPRs and on restore,
and check exclusive acquisition from a separate thread in the harness.
* FEX: submit aio control blocks through private host copies
Stop editing guest IOCBs in place when aio_buf needs translation. io_submit
now hands the kernel a host copy of each such control block, maps
io_event.obj back to the guest pointer when the completion is reaped,
redirects io_cancel by guest pointer and context to the copy, and frees
copies on reap, on io_destroy, or when the kernel did not accept them.
The guest control block is never patched and its protection is never
touched, so the pending restore records, the protection windows and the
restore hooks in mmap, munmap, mremap and mprotect are removed with their
tests.
* fex: keep aio keys, cancels and reaped events native for copied control blocks
Guest aio_key is no longer cleared before dispatch: the slot is probed with a
same-value write and only the first n accepted copies get key 0 after the host
io_submit returns n. io_cancel redirects to a copy only when the guest block is
readable and its key is 0, so unreadable blocks fault in the kernel as before.
io_getevents and io_pgetevents reap into emulator storage, translate and
release copies there, then copy the events out, returning -EFAULT if that
fails. A successful io_setup clears the ring header magic so userspace ring
reapers fall back to io_getevents, where copies are translated and released.
* fex: leave aio rejections, keys and unwritable event buffers to the kernel
A copied control block whose key slot is read-only is now passed to the
kernel as the guest's own block at the end of the list, so the kernel reports
its native fd, eventfd or key error. After io_submit, guest keys follow the
private copies through the first rejected position, and they are stored
through a fresh translation of the guest address, skipped when it no longer
maps. io_getevents and io_pgetevents probe the guest event buffer and reap at
most its writable prefix, handing an unwritable buffer to the kernel so
completions are not consumed.
* Kept AIO completions and key stores stable against sibling remaps
Wrapped event buffers go to the kernel unchanged. Direct reaps report guest
control blocks and release copies only after the store lands. Guest stores and
reads hold the mapping lock across translation and copy. Completions whose
copy-out fails are stashed per context and delivered first on the next reap,
and dropped on io_destroy.
* fex: stage every AIO reap and keep stashed completions recoverable
Hold the guest mapping for every high address, restore the caller's
signal mask after thread-context holds, replace the fixed event stash
with a per-context table that reserves space before dispatch, stage
all reaps so control block identities are translated before copy-out,
keep collecting ready completions once the stash meets min_nr, and
restash events on every error except an interrupted delivery or a
destroyed context.
* fex: own AIO recovery storage before dispatch and bind it to the context lifetime
Allocate the recovery node with the event buffer before the kernel
consumes completions and hand the buffer itself to the stash when
copy-out fails, so settling never allocates. Track each context by a
generation that io_setup advances, so a destroy that finishes after a
replacement context reuses the ring address only releases the old
context's copies and stash. Drop the reservation cap so blocking reaps
keep their min_nr.
* fex: publish AIO contexts from private storage, keep their generation, wake blocked reapers for stashed completions
* fex: wait for AIO events in bounded slices instead of wake markers, roll back setup by its own generation, fault unreadable io_setup output
Blocked reapers wait in the kernel for at most 20 ms at a time and take stashed completions between waits until the guest minimum or timeout is met, so no eventfd or io_submit notification is needed. Deferred signals end the wait like EINTR. io_setup rollback uses the generation BeginContext installed, and an unreadable context output returns -EFAULT before dispatch.
---------
Co-authored-by: StonkGuy <68372320+StonkGuy@users.noreply.github.com>
Co-authored-by: StonkGuy <StonkGuy@users.noreply.github.com>
Commit Android IME text through the focused renderer and submit only after delivery is confirmed. Restore Steam pinyin on Ubuntu rc7 and allow older runtimes to start normally without IBus.
Add opt-in frosted wallpaper and cards with separate transparency settings. Keep dialogs solid and fall back to the standard palette when blur or readable contrast is unavailable.
* docs: research Android's child-process limit without developer options
* docs: confirm the child-process gaps on the Thor
* feat(session): start long-lived daemons in uncounted worker processes
* feat(nativeguest): hand long-lived programs to uncounted worker processes
* test(session): run the session bus block with dd_spawn
* test(nativeguest): cover the exec handoff's wait and kill
* feat(session): run the session root, its jobs and the gamescope chain outside the child-process count
* feat(setup): the child-process limit no longer blocks Steam while the session runs in workers
* feat(audio): run PulseAudio outside the child-process count
* feat(nativeguest): hand off posix_spawn children and keep handed-off daemons alive
* fix(nativeguest): let Steam end a handed-off game and keep process-group signals
* perf(session): exec a worker as soon as its reply is in and keep two bound ahead; fix review findings
* fix(nativeguest): address review findings in handoff waits, signals and spawn errors
* fix(session): commit each worker launch explicitly and keep workers with the session that asked
* fix(session): let a worker wait for its launch commit on the main thread
* fix(session): confirm handoffs, honour wait selectors and stop spawns at teardown
* fix(session): one owner per handoff exit, worker launch answers and spawn edge cases
* fix(session): send a working directory outside the program's root by its real path
* fix(session): recheck a taken exit's child and commit a launch only on a whole go line
* fix(session): three-step launch, tagged exit reports and lock-free popen and system children
* test(native): popen test shell is static, as the other hook fixtures
* test(native): run the popen test program with a clean environment
* test(native): skip the popen test where a spawn child cannot exec aarch64
* fix(session): confirm the hook before the worker runs, prefer a late report and free a reused pid
* fix(session): tell a reused pid's old entry by start time, not the reaped flag
* fix(session): silent failed launches, bounded spawn requests and held check-gone writes
* test(native): check the unlisted child's status only where a child can exec aarch64
* fix(session): every exit-only waitid goes through the handoff wait
* fix(handoff): exact waitid events, safe exit timer, bounded request receipt
* feat(handoff): hand off shell children near Android's process limit
* fix(agent): tag handed-off game windows outside the reaper
* fix(handoff): a handed-off program's getppid() is its forking process
* fix(handoff): exact waitid selection, kept Steam and pipe readers, held reports
* fix(handoff): getppid() gives init for an exited or replaced parent
* fix(handoff): keep __WALL waitid calls on the handoff path
* test(handoff): require a zombie parent in the unreaped-parent case
* fix(handoff): honor __WNOTHREAD and check every argument for Steam
* fix(handoff): stop waiting on a held entry once its parent has exited
* fix(handoff): __WNOTHREAD on waits for a pid, flags on every shim reap
* fix(handoff): keep the forking thread of each child in the parent
* fix(handoff): a wait that finds no child rechecks live handoffs
* fix(handoff): keep a child's forking thread until its end is taken
* fix(handoff): the thread selector applies to claims in progress too
* fix(handoff): controlling-terminal check via /dev/tty, owned records only
* fix(handoff): a child whose forking thread ended is any thread's
* fix(handoff): a parent /proc cannot read is checked with kill(), then given up
* fix(handoff): one-word fork records, changed only by compare-and-swap
* fix(handoff): watch the forking parent through a pidfd opened at start
* fix(handoff): fork records by pid, a gone thread's children go to the main one
* fix(handoff): keep the parent pidfd through dup2 and check it before use
* fix(handoff): no handoff without fork records, unknown thread state keeps the owner
* fix(handoff): undo a pidfd move when dup fails, recheck it after the poll
* fix(handoff): fresh fork records in a forked child, heir is the first live thread
* fix(handoff): one lock over a pidfd move, its dup and the undo
* fix(handoff): liveness check under the pidfd lock, forget only a reaped pid's record
* fix(handoff): lock only dups onto the pidfd, with signals blocked
* fix(handoff): fork record generations, no pidfd restore after a failed move
* fix(handoff): every dup in a pidfd process locks, fork prep blocks signals
* test(semaphores): tell a child hung in qemu-user from a guest deadlock
* fix(handoff): fork records matched by the child's start time, never removed
* test(semaphores): count only reaped children, only futex waits as emulator stalls
* fix(handoff): a known-start bit in fork records
* fix(handoff): dup bookkeeping before the pidfd lock, newer fork records kept
* fix(handoff): a fork record stays only for the pid's current process
* fix(handoff): keep a pending child's fork record when an older fork records late
* fix(handoff): an unknown-start fork record never replaces a pending one
* fix(handoff): self-recorded forks, ELF and wait option checks, both nofile limits
* test(handoff): find the module in the namespace run under discover too
* fix(handoff): a spare parent pidfd made at start, so a dup2 onto it makes no fd
* test(handoff): require ENOEXEC for an ELF stub; skip the namespace run without binfmt
* fix(hook): change the kept fd list under a sequence lock; readers take a copy
* fix(handoff): one report per handed-off child; stops keep a claim; nested waits keep their selector
* fix(hook): a table made at runtime outlives closes begun before it; unknown-start fork records kept
* fix(handoff): waits look before they reap, so a handed-off fork's child is never reported
* fix(hook): settle waits out earlier epochs; unknown-start fork records kept for any handoff under way
* fix(handoff): generation-checked reap marks, stops taken as stops, close counts reset in a fork
* fix(handoff): one given-up table at most, whole stop codes and rusage, WNOWAIT exits rechecked
* fix(handoff): requests name their session; stops of handed-off programs reported; cancellable look
* fix(handoff): table setup not cancellable; test spawner never runs what it cannot end
* fix(handoff): job-control jobs stay counted; unnamed requests refused; cancel-safe setup
* docs(phantom): job-control jobs stay counted; listed programs report no stops
* fix(handoff): a listed program a shell runs as a job-control job stays counted
* refactor(hook): kept descriptors in their own part, a handoff matched by another program
The descriptors close(), close_range() and closefrom() leave open move from
privileged.c to hook/kept.c (unchanged), so the bionic runtime's exec shim can
build the handoff with them. ddh_try_as() matches DD_HANDOFF against one
program and sends another: the bionic shim sends "/system/bin/linker64 PROGRAM
ARGS" and lists it by PROGRAM. ddh_try() is ddh_try_as() with both the same.
* feat(bionic): hand the bionic runtime's Wine programs to the app's workers
The glibc session's hook never sees DroidDeck-Bionic's processes (Wine on
Android's libc), so a bionic game's Wine programs all stayed counted under the
worker running the tool's launch.sh. The handoff is now built into the
runtime's exec shim (tools/bionic-runtime/handoff.c, part of libexecshim.so):
- hook/handoff.c and hook/kept.c with what the native hook's other parts do
around them: fork(), close(), close_range(), dup2(), dup3(), and exit() for
the on_exit() bionic lacks
- bionic's execv(), execvp(), execl*() reach the execve system call inside
libc, past execshim's execve(); Wine starts its preloader with execv(), so
the shim defines them on top of its execve()
- a linker64 start is listed by its program
- the app starts a handed-off program from the glibc root's bash, which cannot
load the runtime's LD_PRELOAD/LD_LIBRARY_PATH: they go as arguments of
/system/bin/env, which puts them back for the program
- launch.sh keeps DD_SPAWN, DD_SPAWN_SESSION, DD_HANDOFF*, DDH_* and
DDNATV_ROOT, and its /proc/N/environ reads no longer print "Permission
denied" for idle workers (2>/dev/null before the redirect)
Pocket FIT, DroidDeck-Bionic 14.1-r67 with this shim and launcher, handoff on:
counted during Brawlhalla 25 -> 17, DiRT Showdown 24-27 -> 16, whole run
28 -> 19-20; with Android's limit on no DroidDeck process and no other app's
process was killed (before: Discord, BatteryLog helpers); DiRT 75 fps either
way. docs/phantom-processes.md: "The bionic runtime".
* fix(bionic): hand off only starts that would succeed here; bionic's execvp fallbacks
Review follow-ups on the bionic runtime's handoff (tools/bionic-runtime/handoff.c):
- A start is handed to a worker only when it would get past execve() in this process: the file is a
regular executable outside the app's data (Android refuses execve() there), and for a linker64 start
the program it loads is a readable regular file. A start that failed in the worker failed where the
caller could not see it, so Wine never tried its next candidate. The hook's own check looked at
/system/bin/env, not the program.
- A start whose argv[0] is not its file stays here: env starts FILE with FILE as argv[0]. linker64 and
interpreter starts are unaffected (their argv[0] is the file). An empty argv stays here too.
- Nothing is built for the handoff without DD_SPAWN and DD_HANDOFF.
- execvp()/execvpe()/execlp() follow bionic's: an unset PATH is libc's default, an empty PATH or entry
is the current directory, and a file the kernel cannot start (ENOEXEC) runs under /system/bin/sh.
- close_range() refuses first > last and unknown flags before it splits the range or unshares the table.
- The debug line reads the table's owner only once the table is seen published.
* fix(bionic): hand off app-data starts only where SELinux lets them run; bare names stay here
Follow-up to 7d95564f7 (review, and a Pocket FIT test of its pack):
- 7d95564f7 kept every start of a file in the app's data here. Wine's preloader is one (a static ELF,
so execshim.c cannot make it a linker64 start), and where SELinux is permissive, as on AYANEO's
firmware, it runs: Wine then never reached its loader, and its programs ran here, counted again
(Pocket FIT: Brawlhalla 26-28 counted vs 16-17 before). Where SELinux enforces, Android refuses the
exec, here and in a worker alike, and Wine falls back to its loader, which goes as a linker64 start.
Such a start is now handed off when /sys/fs/selinux/enforce reads 0, and stays here otherwise
(also when the setting cannot be read).
- The program a start would run is checked with the hook's own ddh_startable() (an ELF the kernel
loads with its interpreter there, or a script with its interpreter): for a linker64 start, the
program it loads.
- A file name without '/' stays here: env would look it up in PATH, the exec here in the caller's
working directory.
- execvpe() skips a PATH entry whose candidate exceeds PATH_MAX (ENAMETOOLONG) instead of copying
it onto the stack.
* fix(handoff): spawn blocks signals and cancellation across the fork; root flag stored under the stop lock
* fix(handoff): a thread that unshares its fd table keeps its own copy of the kept fds
* fix(handoff): register the kept list's fork handlers before a split takes its lock
* test(handoff): cover WNOHANG with a held forked child, early reaps, blocked waitid and pidfd parents; keep the counted-process exception in translations
* test(handoff): exited-entry precondition, atomic checkpoints, a pidfd-only zombie check; validate the shim hold fd
* test(handoff): WNOHANG with two handed-off children and for a group; a program's exit while its entry is held
* test(handoff): a held exit with no free fd, with and without the parent's pidfd
* test(handoff): held-exit tests require the program's own exit status
* test(handoff): time held exits from the run, and only once the program is at its exit
* perf(handoff): keep the asker's priority, quick tools local, workers bound ahead of a game (#3582)
Three fixes that bring handoff-on speed to within 1-2 % of handoff off
(AIO D3D11 same session: 3196 -> 3520 fps, 1 % low 444 -> 637) with the
same counted processes (benchmark mean 18.5, peak 23):
- A handed-off program keeps its asker's priority. Workers are bound
from the top app with BIND_IMPORTANT, so Android boosts their main
thread to THREAD_PRIORITY_TOP_APP_BOOST (-10); the program the worker
execs inherited it. The asker's nice value is sent with the request and
set before execve, and a watcher resets it if Android boosts it again.
- Quick script tools (awk, sed, grep, cat, ...) stay where they are when
the count is near the limit. Sent to a worker, the forked child waits
(counted) while a worker starts; run locally it is counted for a few ms.
- Workers are bound ahead when a Steam game is queued (16 for 20 s), so
Wine's services do not wait on zygote forks at game start.
---------
Co-authored-by: The412Banner <the412banner@users.noreply.github.com>
Co-authored-by: The412Banner <205237651+The412Banner@users.noreply.github.com>
* feat(native): run the desktop, its apps and shells as an ordinary user instead of fake root
* fix(native): a script's interpreter takes DDNATV_BECOME, so sudo runs scripts as root
* fix(desktop): keep the Plasma start line the pipewire tests slice the script at
* fix(droiddeckctl): gamepad and pen input on Android 13 and 14 QPR1
* fix(droiddeckctl): read the pen's codes before its bus so Android 14 QPR1 retries numerically
* Prepare FrameGen for instance-owned scratch lifecycle
* Make DD-FG rebuild and teardown completion-aware
* Restore DD-FG namespace boundary
* Isolate DD-FG scratch state and reclaim resources on rebuild
* Declare per-instance scratch builder before recording code
* Make DD-FG ring teardown report unsafe GPU completion
* Retain DD-FG input ring until GPU completion is confirmed
* Add DD-FG lifecycle and resource-isolation tests
* Cover DD-FG teardown and rebuild failure cases
* Document DD-FG scratch ownership and teardown semantics
* Guard DD-FG teardown when GPU completion cannot be queried
* docs: clarify DD-FG device-loss teardown
* fix: define DD-FG scratch state before resize
* fix: define DD-FG scratch state before resize
* fix(ddfg): wait for the GPU before replacing the input ring on resize
* Fix DD-FG ring cleanup after device loss
* Propagate DD-FG device-loss status
* Retain DD-FG resources when GPU completion is unknown
* Retain DD-FG resources when GPU completion is unknown
* Retain DD-FG resources when GPU completion is unknown
* Retain DD-FG resources when GPU completion is unknown
* Retain DD-FG resources when GPU completion is unknown
* Retry DD-FG cleanup after an idle-wait failure
* Test DD-FG cleanup retry after GPU wait failure
---------
Co-authored-by: maxjivi05 <maxjividen@gmail.com>
* fix(game-env): run Inno Setup installers with the FEX Stability settings
An Inno Setup installer added as a game stops with Wine's "Path not
fpund." dialog under the default FEX preset. The 32-bit setup stub
corrupts its own paths before it opens its archive (#1277, #3067). #1174
avoids the stub only for GOG installs, by extracting them natively.
droiddeck-game-env now finds the stub by the setup loader's offset-table
ID in its resources, or the "Inno" marker older loaders keep at 0x30, and
launches it with the Stability preset's FEX settings. A FEX preset chosen
for the game itself still wins.
Fixes#3067
* fix(game-env): name only the preset seen to corrupt Inno Setup paths
The launch note and the docs said the faster presets corrupt the setup
stub. Only the default Performance + TSO preset was seen doing it.
* fix(game-env): give Inno Setup installers started with run the Stability settings
The run verb skips engine_fixes and gets only the sync settings, so an installer started that way kept the inherited Performance + TSO preset. Apply the Stability values on that path too; explicit game settings still win in apply_config.
* fix(game-env): keep the game's own FEX settings for installers started with run
The run path filtered the game entry down to sync keys, so a FEX preset
chosen for the game was replaced by the installer's Stability settings,
and a null could not unset a preset key. Copy the game's Stability FEX
keys into the synced config before applying it, so the game's own
settings still win on every launch path.
---------
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
* fix(venus): OpenGL quads no longer crash Mali's shader compiler through Zink
The Mali-G610's driver crashes compiling Zink's geometry shaders
(SIGSEGV at 0x40 in cmpbe_v2_compile_multiple_shaders), and the render
server and the application die with it. A plain geometry shader that
only passes triangles on does not crash it, but draws nothing. Zink
draws GL_QUADS through a geometry shader when the device has the
feature, so OpenGL programs died on their first quad.
The Mali layer now reports no geometryShader to Zink on ARM GPUs.
Mesa then splits quads into triangles itself. DXVK keeps the feature,
which it needs for D3D10 and 11. DROIDDECK_MALI_COMPAT_NO_GS=0 keeps
it for Zink, =1 hides it from every application.
* test(venus): clear DROIDDECK_MALI_COMPAT_NO_GS before the layer tests
The geometry shader test checks the default first. With the variable
exported in the shell, it failed before it reached its own settings.
* test(venus): check that other ARM applications keep the geometry shader
* docs: bottom screen research and proposals
* docs: expand bottom screen region mirror, guides and companion API
* feat(bottom): idle home card, per-game panel memory, Steam achievements tab and screen off
* feat(bottom): quick tiles page on the dashboard
* feat(bottom): Steam guides tab with per-game reading position
* feat(bottom): companion page with Stardew, Skyrim and Fallout 4 adapters
* docs: bottom screen implementation status
* feat(bottom): mirror a region of the game picture on the bottom screen
* fix(bottom): follow Steam's selection for any game, composite while mirroring
* docs: bottom screen hardware results and screenshots
* feat(bottom): guides wiki, fixes, maps and saved pages; hide mirrored region on top
* feat(bottom): guides, mirror and companion as their own panels in the app's settings style
* feat(bottom): Steam's Quick Access menu as a bottom screen panel
* fix(bottom): park Steam's Quick Access through its own bounds and keep it open on a lease
* feat(bottom): align Quick Access left, centre or right; keep its tab and Decky working
* fix(bottom): quieter Quick Access move handles, instant reopen, Decky tab after a cold start
* fix(bottom): lay Quick Access out at the panel's shape so every tab keeps one size
* feat(bottom): Quick Access tabs fill the bottom screen
* fix(bottom): the Quick Access button still opens the menu on the top screen
* feat(bottom): choose Quick Access layout from the bar: full width, left, center or right
* feat(bottom): brightness slider for the bottom screen with screen off at its end
* feat(bottom): game art panel, hideable bar with a pull tab, direct guide links, centred guide tabs
* fix(bottom): mirror fills the panel, options open from the bar
* docs: drop the removed dashboard row screenshot
* refactor(bottom): split the companion panel into its own change
* fix(bottom): Steam dialogs take input over the parked Quick Access menu; review fixes
* fix(bottom): extract the Quick Access relay at session start; second review round
* fix(bottom): game art refreshes details for the same game
* fix(bottom): Quick Access retries back off; art never shows another game for the running one
* fix(bottom): Quick Access keeps its lease through retry backoff
* fix(bottom): renew the Quick Access lease apart from discovery
* fix(bottom): a Quick Access panel releases only its own lease
* fix(bottom): an older Quick Access panel cannot take back a newer panel's lease
* test(bottom): an expired Quick Access lease can be taken by any panel
* fix(bottom): only the Quick Access lease owner sets the menu's shape
* docs: DroidDeck 0.7.11 release notes
* docs: text-only highlights under a heading, images beside their entries
* docs: measured memory card start times for 0.7.11
* docs(release): 0.7.11 notes cover zero-copy, the Library rebuild and the latest fixes
* docs(release): 0.7.11 notes list the DroidDeck-Proton and DD-Turnip fixes
* docs(release): 0.7.11 notes cover run without proot by default, DroidDeck-Bionic, CurseForge, in-game menu pages and the latest fixes
* docs(release): screenshots for the 0.7.11 menu, first run, Decky, CurseForge, resolutions and on-screen controls
* docs(release): 0.7.11 community share excludes both maintainers, screenshots recaptured on current main
* docs(readme): headliner links to CD's Retro Corner's Odin 3 DroidDeck video instead of the GIF
* docs(readme): headliner is a short showcase GIF of quick wake, the Thor touchpad and the store tabs
* docs: README and 0.7.11 notes say no subscriptions, and the README drops its Limits section
* docs(readme): showcase GIF drops the store tabs and ends on scrolling Steam then the home screen
* docs(readme): showcase GIF opens on the table of devices
* docs(readme): showcase GIF keeps two sleep and wake cycles instead of three
* docs(release): 0.7.11 shows each new store's chip row and games from the Pocket FIT
* docs(release): 0.7.11 store screenshots show the cards without titles or sizes
* docs(release): 0.7.11 combines the three new stores into one bullet with a chip GIF
* docs(release): 0.7.11 new stores GIF is the full-screen Pocket FIT recording
* docs(release): 0.7.11 notes fold the three new stores into one bullet
* docs(release): 0.7.11 combines tab, Library and in-game menu customization into one bullet with screenshots
* docs(release): 0.7.11 headlines put no proot with DroidDeck-Bionic and zero-copy right after the stores
* docs(release): 0.7.11 explains no proot and DroidDeck-Bionic in plainer words
* docs(release): 0.7.11 says what no proot and DroidDeck-Bionic gain: CPU overhead, 1% lows, memory
* docs(release): 0.7.11 puts no proot and Bionic first and trims the headline, Features and Improvements wording
* docs(release): 0.7.11 folds small fixes and minor features into grouped lines and shortens the contributor table
* docs(release): 0.7.11 controller kits image is the cropped portrait set with the bottom button row
* docs(release): 0.7.11 moves the Xbox save and install work from Features to Fixed
* docs(release): 0.7.11 groups no proot, zero-copy and DroidDeck-Bionic as one new foundation at the top of Features
* docs(release): 0.7.11 summary leads with native execution and DroidDeck-Bionic
* docs(release): 0.7.11 summary names no proot again
* docs(release): 0.7.11 gets a Design and organization section, with the Features re-order
* docs(release): 0.7.11 moves frame generation, integer scaling, pens, XREAL and virtual pads lower in Features
* docs(release): 0.7.11 controller kits image shows four kits
* docs(release): 0.7.11 intro, store line and Lab builds wording
* docs: remove the unused steam-to-desktop headliner GIF
* docs(release): 0.7.11 summary wording, HDR and memory card lines, on-screen controls
* docs(release): 0.7.11 moves landscape and portrait resolutions to Improvements
* docs(release): 0.7.11 adds the latest main fixes and recounts the totals and leaderboard
* docs(release): 0.7.11 counts outside contributors as everyone but the three maintainers
* docs(release): 0.7.11 intro counts the 39 outside contributors
* docs(release): 0.7.11 intro counts 111 pull requests from outside contributors
* docs(release): 0.7.11 zero-copy and DroidDeck-Bionic charts
* docs(release): 0.7.11 no-proot speed chart
* docs(release): 0.7.11 shows one combined new-foundation chart
* docs(release): 0.7.11 new-foundation chart adds the SD card start times
* docs(release): 0.7.11 new-foundation chart drops its title and shrinks the headlines
* docs(release): 0.7.11 chart calls no proot native execution
* docs(release): 0.7.11 chart axes say whether higher or lower is better
* docs(release): 0.7.11 drops the HUD settings screenshots
* docs(release): 0.7.11 drops the first run screenshot
---------
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
* fix(library): keep another program of a Steam install out of the Steam app's route
* fix(library): cover a Steam-edited target in the unrouted-program test and docs
* fix(library): keep Steam-edited targets routed and release stale Spacewar imports for other programs
* fix(library): keep Steam-edited targets adopted before the marker existed routed
A saved executable and seen revision without the adoption marker are recognised
from the Steam shortcut record (its target is the current executable and differs
from the one the app asked for), and the marker is stored.
At the game's default monster mesh detail, slimes show only their tips.
Set the two skeletal mesh detail values in Engine.ini before each launch,
in the prefix the game profile selects, and keep the file's permissions.
The game ignores -ini: overrides and deletes a writable Engine.ini after
reading it, so a launch argument or a one-time write does not work.
* fix: a Steam target whose file is gone goes back to the app's exe
A shortcut Target edited in Steam is kept across the client's restart on
purpose, but it was kept even after the file it names disappeared. When the
app's own exe already equalled the recorded proposal, nothing replaced the dead
target: Steam started `System/launcher.exe`, Wine answered
`err:steam:run_process Failed to create process ...: 2`, and the game never ran
(#694, after #1644 and #2022 removed the two real causes).
The merge now treats a target that is not a file as no edit at all and writes
the listing's exe and StartIn. The check runs in the guest, where the shortcut's
paths live.
Fixes#694
* fix: keep a Steam target whose card is not mounted
- The app recreates /mnt/droiddeck-sd and /mnt/bannerlator-sd before binding the card, so the
mountpoint outlives a removed card. A target directly under one had an existing parent, so
the missing-file repair overwrote the edited Exe and Start In and kept them overwritten.
- The repair now needs the target's storage to be there: a card mountpoint that lists nothing
is a card that is not in the device, and the edit is kept for when it returns. Extra Steam
libraries under /mnt/droiddeck-lib/<id> get the same check.
- test_a_steam_target_under_a_bare_card_mountpoint_is_kept fails without the check and asserts
both fields; test_a_steam_target_under_a_mounted_card_goes_back_to_the_apps keeps the repair.
* fix: repair a Steam target removed with its folder
- A missing target is gone when its storage is mounted and either its folder is still
there or it lives in a tree the app always has (internal store installs, the internal
Steam library). An update that removes the whole game folder now repairs the shortcut.
- Store volumes and added game folders are removable mounts too: /mnt/droiddeck-stores/<id>
and /root/Games/<name> are checked for content before a target under them is treated as
gone, so an unplugged volume keeps the edited Exe and Start In.
- Tests: internal folder removed repairs both fields; a bare store mountpoint and a card
mountpoint keep both; a mounted card still repairs. 84 tests pass.
* fix: classify a Steam target by its resolved path
- A target such as /root/Games/Stores/../../../mnt/droiddeck-sd/Other.exe matched the
internal prefix and was repaired while the card was out. internal_target and
removable_mount now normalize the path before choosing the storage class, so the
decision follows the file the target resolves to; the kept text is unchanged.
- test_a_steam_target_is_classified_by_its_resolved_path fails before the normalization
(the edit is replaced) and keeps both fields after it. 85 tests pass.
* fix(nativeguest): x86-64 path system calls and SIGSYS handlers stay inside the rootfs hook
FEX passed most guest path system calls to the kernel with an inline svc, so the
native path hook never mapped them, and it mirrored guest SIGSYS handlers with a
raw rt_sigaction that replaced the hook's own handler, after which the next
blocked system call killed the program. Path calls now go through libc's
syscall(), which the hook maps (guarded until the hook is initialised so an early
allocator cannot deadlock), and a SIGSYS handler set through syscall() is
recorded and chained like one set through sigaction().
* fix(ddexec): a program that re-execs itself keeps the rootfs hook
A re-exec through /proc/self/exe starts the program through the guest
ld.so again but left out the hook, so the child saw host paths. Steam's
reaper then recorded host install folders, and Battle.net games moved to
a mapped drive the Library could not resolve. The re-exec now preloads
the hook of the root the same way the first start does.
* fix(fex): free host signal state when a guest leaves its handler
FEX keeps each signal's host context on the host stack and frees it only
on rt_sigreturn. A guest that leaves its handler another way (siglongjmp,
or CoreCLR resuming a catch after a NullReferenceException) left about
2 KB of host stack and one SignalHandlerRefCounter count behind. Some
3500 such exceptions on one thread overran the guard-less 8 MB host
stack, and the CurseForge agent died with "Internal CLR error.
(0x80131506)" and "Stack overflow occurred on the same thread again!"
at the start of its second addon scan.
0009 chains each thread's signal frames with the guest frame range and
alternate stack they used. A signal that arrives in JIT code at the host
level of the newest frame, after the guest stack pointer has left that
frame, drops the left frames and stores its context where the newest
live frame (or the dispatcher entry) left the host stack. rt_sigreturn
pops its frame and any newer ones it skips; thread stop clears the
chain. Signals inside system calls or thunk callbacks are left alone.
This follows the approach suggested in FEX-Emu/FEX#2487.
0008 now restores InSyscallInfo only for signals that interrupted JIT
code, the only case that saves it. Restoring 0 for a signal that
interrupted a system call cleared the mark while the call was still
running; an itimer loop around time() crashed in 15 of 15 runs.
Pocket FIT Elite: siglongjmp out of a SIGSEGV handler died after about
3500 iterations under FEX-2611.1 with and without 0008 and finishes
200000 with 0009; the new probe (350000 escapes on and off the alternate
stack, mixed with returning handlers and nested handlers) finishes under
0009 and crashes before 2000 iterations without it. The 0008 probe
still reports no stale registers.
* test(fex): check every delivery hunk of the 0009 patch
* fix(fex): reset the host stack when a system call ends a block
* fix(fex): thunk calls mark the guest state as spilled
* fix(fex): signal returns apply the handler's register changes
* docs(fex): describe patches 0010 to 0012 and credit the upstream fix
* test(fex): require AVX2 for the ymm probe and keep vdso canaries live
* fix(fex): signal return restores the interrupted syscall state
A guest rt_sigreturn goes through FEX's syscall stub, which marks every
static register as spilled. Returning to unchanged JIT code skipped the
stub's reset, so later asynchronous signals skipped the register spill
and guest handlers read stale registers. CoreCLR's GC suspension reads
and redirects that context, which made x86-64 .NET programs fail with
random access violations. Restore the value saved at signal entry.
* fix(addons): run CurseForge headless from the addon browser, without a session
- The CurseForge source starts the app in its own headless gamescope
(droiddeck-headless, shared with the Battle.net Agent) instead of a hidden
session: no SessionService, compositor output or ImageReader.
- The helper's start keeps running until the app exits, so the app lives
for as long as the addon browser holds that guest command; closing the
dialog asks the app to quit, stops its process group and cancels the
command, which ends the app, its gamescope and the guest.
- An app the user already has open is reported busy and left alone.
- Removes BackgroundSession and the CompositorHost start path it shared with
SessionActivity, with their tests.
* fix(addons): bind each CurseForge stop to its launch and keep the inspector URL out of logs
A stop now only acts on the launch that registered it, so a late stop
from a closed browser cannot end a newer launch, and the browser stops
once. Command logs redact the inspector URL. The signal probe reports a
sender thread that cannot start, sets ECX before the measured region and
its test accepts a valid overshoot of the target count.
* fix(fex): unblock the probe signal before sampling
* fix(steam-x64): keep the session's GL thunk for the x86 web helper
FEX's global AppConfig for steamwebhelper turns the GL thunk off and is
read after FEX_THUNKCONFIG, so the x86 helper used the rootfs's x86 Mesa.
Steam's browser compositor creates its window through SDL3 and GLX in
the helper's browser process, x86 Mesa faulted in driCreateNewScreen3
(SIGSEGV) about 11 s after each start, and the client restarted the
helper every 12 s.
For every global FEX AppConfig that turns off a thunk the session uses,
the launcher writes a local AppConfig with the session's thunk set. It
leaves local files with other content alone and removes its own files
when the client runs in software.
* fix(steam-x64): write FEX AppConfig overrides atomically
* fix(steam-x64): stage AppConfig overrides in a unique temporary file
* fix(steam-x64): publish AppConfig overrides without replacing a newer file
The FEX build pinned FEX-2610 and its tag checks only accepted four
digits, so FEX-2611.1 was never picked up. The build now takes the
latest release tag, and Fixed-upstream compares the four-digit release.
CMake 4.5 rejects DEPENDS in install(CODE), which stopped host thunk
builds; patch 0007 drops it.
* fix(fex): invalidate translated code written through a later writable alias
x86-64 CoreCLR maps its W^X memfd writable after the executable view was
translated. Under SMCChecks=mtrack the new alias was never write-protected,
so writes through it did not invalidate stale translations. Protect the
overlapping part of an executable alias on mmap and mprotect.
* fix(fex): protect every writable alias in one mprotect range and build fmt without modules
* fix(fex): build without C++ module scanning or import std
Dragon's Dogma 2 checks for Wine and takes a path that does not start.
Launches of Steam app 2054970 now append the game's own
/WineDetectionEnabled:False switch at launch time. Steam's stored Launch
Options are untouched, and a /WineDetectionEnabled: value the user already
passes keeps priority and is not repeated.
* fix(venus): lower the guest's SPIR-V to 1.3 for the phone's shader compiler
* fix(venus): lower SPIR-V to 1.3 for Mali drivers
* fix(venus): keep the SPIR-V cap valid and scoped to active layers
Cap inline compute pipeline code too, leave the shader hooks off when
the layer is turned off, strip clip and cull distances only where they
are emulated, and leave modules alone whose capabilities, decorations or
OpSelect results need a newer version or an undeclared extension.
* fix(venus): keep application pipeline chains read-only and check non-semantic imports
Inline stage code is handed to the driver through a copy of the stage's
pNext chain instead of being written into the application's create info,
pipeline hooks return VK_ERROR_OUT_OF_HOST_MEMORY when their allocations
fail, and a NonSemantic import is only lowered to SPIR-V 1.3 when the
module declares SPV_KHR_non_semantic_info.
* fix(venus): preserve valid pipeline and shader behavior
* fix(venus): lower compatible read-only shader parameters
* fix(venus): install SPIR-V 1.3 lowering hooks on Vulkan 1.2+ devices or emulated gaps
* fix(preload): look up the native glibc symbol version first so wrapped calls never allocate
On x86 the first dlvsym lookup asked for GLIBC_2.17, which only exists on arm64. The failed lookup makes glibc allocate, which deadlocks when the first wrapped call happens inside a program's own allocator setup. Each architecture now asks for its base version first.
* fix(zram): start the page-out worker per request instead of keeping a thread in every process
Every process that loaded the session preload carried a resident zr-worker thread from its constructor on. Programs that check they are single-threaded before forking or before unshare(CLONE_NEWUSER) failed, for example Chromium's zygote, which could not start its GPU process.
The signal handler now starts the worker with a raw clone on a stack the preload maps itself. The worker makes only raw system calls and exits when no request is left, so starting it from the handler is safe and idle processes stay single-threaded. When the worker cannot be started, the process trims inline in small steps as before.
* fix(preload): start the page-out worker with the same clone flags as a thread
Programs that filter clone to the flag set threads use, as browser
sandboxes do, now accept the worker. The kernel clears the stack-busy
word and wakes waiters when the worker exits.
* fix(preload): page out inline in single-threaded and self-sandboxed processes
A process with one thread may be about to check that it is single-threaded
before fork or unshare, and a process that added a seccomp filter after it
started may trap system calls into its own handler. Neither gets a worker
thread now; both trim inline in small steps as before.
* fix(preload): check the signalled thread's own seccomp filters before starting the worker
Read Seccomp_filters from /proc/thread-self/status so a thread that installed its own filter
without TSYNC trims inline instead of calling clone under that filter, and fall back to the
inline path when the signal mask cannot be changed.
* test(preload): start parked threads with SIGURG already blocked
* test(preload): count only page-out workers when checking for leftover threads
* feat(launcher): tick haptics for controller navigation, off for touch
* docs: regenerate settings map for controller haptics
* fix(launcher): tick for hat and stick navigation, which arrive as joystick-source keys
* fix(launcher): tick before the Components tab consumes L1/R1
* feat(display): zero-copy presentation toggle and compositor display buffers
Adds a Zero-copy presentation switch under Steam Settings, Display,
Session Display (on by default), and a display-buffer allocator in the
compositor: a Vulkan driver that states displayBuffers asks it for the
memory of the images it exports, so frames presented through the nested
compositor are gralloc buffers that go on the display layer without a
copy. Compressed buffers are offered only where the device's allocator
matches the layout the drivers render to; everything else stays on the
copy path.
The private buffer protocol is renamed to droiddeck-ahb-v1.
* fix(display): zero-copy frames keep the full refresh rate
Two buffers set on the game layer inside one refresh replaced each other, and a frame that slipped into the next refresh made the compositor hold and drop the on-time frame behind it. The layer now queues buffers, and a refresh takes a second frame when the one before it took none. The pacing tool no longer counts its dump time in the frame rate.
* Keep cropped scenes on the display layer and pace layer frames evenly
Accept any in-bounds source crop for the display layer and map the draw
geometry the same way the copy path does. Time layer frames against the
display's frame timeline, and when the game's rate is a steady whole
fraction of the refresh rate show each frame a fixed number of refreshes
after the last so uneven arrivals no longer reach the screen.
* List zero-copy in the settings map
* Hold display buffers until the display releases them
A buffer the game or gamescope rendered straight into went back to its
client as soon as the next one was latched, with the display's release
fence attached to the dma-buf. The KGSL driver does not wait on that
fence, so the client could draw into a buffer the panel was still
reading. Display buffers now wait for the release fence before the
release event, and gamescope composites only into output images the
host has released.
* Keep the game picture copy-free when an overlay has no display layer
When the display cannot give a second layer of its own to an overlay,
the compositor tells gamescope how many planes it can show directly.
gamescope then composes its overlays into the game picture, which still
reaches the display without a copy.
* feat(session): the panel refresh rate follows the session's frame rate
The session learns the panel's refresh rates and reports the refresh rate and
frame rate it wants. The panel moves to the highest rate the frame rate divides
evenly, frame generation counts at its output rate, and a panel whose rate the
system holds offers only that rate.
* feat(session): the panel follows a frame rate the game holds on its own
The compositor reports the game's frame rate once a second. A rate that
holds for three seconds and divides a panel rate becomes the content
rate when neither the app's limit nor the session's limiter is setting
the pace, so a game capped in its own settings gets a panel rate its
frames divide into. A rate that was dropped has to hold twice as long
before it is used again.
* Show generated frames on the game's display layer
With frame generation on, the game's own frames stay on their display
layer untouched and each generated frame is placed on the same layer
between them, timed across the game's frame interval. The compositor
pass is kept when effects, HDR routing or a cursor need it, or when the
panel cannot show the multiplied rate.
* Keep scaling, generated frames and HDR on the display layer
A scaler or frame generation with zero-copy on now draws once into the
display layer instead of falling back to the copied surface. HDR output
goes to the layer when the panel supports it; on a panel without HDR the
picture is tone-mapped on the same path, and the toggle is labelled to
match what the panel can do.
* Spread a frame limit the refresh rate does not divide evenly across refreshes
* Cover the spare-tick and panel-rate paths in the compositor source tests
* Pin the gamescope build with the display-plane, release, refresh and limiter patches
* Give the layer and terminal-caller harnesses the black fill state they compile against
* feat(display): switch HDR during a session without restarting the app
The compositor now offers HDR whenever the device can present it, and the
HDR setting only decides whether the session uses it. Both HDR switches set
gamescope's hdr_enabled, the compositor's HDR output and zero-copy for the
running session. gamescope patch 0139 lets hdr_enabled change after start.
The 'Restart the app to apply.' hint is removed from every locale.
* Remake the output images in the new format when HDR is switched during a session
* Pin the gamescope build that switches HDR during a session
* Apply a saved HDR opt-out at session start and keep HDR retries with their session
* Serialise the HDR output switch with the gate opening
* feat(display): keep the client's HDR setting and the session's in step
The session publishes its HDR state with the other device controls and the
client helper applies it to the client's own display setting. A change made in
the client is reported back and goes through the same switch the drawer and
Session Display use, so all three always show one value.
* fix(desktop): keep the display-buffer socket when the runtime directory is cleared
The desktop launcher removed everything in the runtime directory except the
compositor's Wayland socket, which took the display-buffer socket with it, so
no desktop program could ask for display buffers and every frame was copied.
* fix(display): the client's HDR setting follows the session in every client mode
The bridge only ran when a variable nothing sets was present, so the client's
HDR setting and the session's never met. It now runs whenever the session
publishes an HDR state, and a client that has no such setting is asked again
only every ten seconds.
* fix(display): harden display-buffer hand-off, layer fallbacks and HDR sync
- Stop closing a buffer handle's descriptor the allocator still owns, and free an allocation whose reply could not be sent.
- Rebuild the advertised buffer formats when zero-copy is switched during a session.
- Fall back to the copy path when a layer buffer cannot be allocated, and hide the game layer when it is skipped for a frame.
- Keep a release fence that has not signalled instead of rendering into a buffer the display still reads.
- Ignore a refresh-target reset from a client that does not own the target.
- Restart the content-rate measurement after a pause, clear it when the game stops, and lengthen engagement only for a rate that was released before.
- Compare colour conversions by their values, and read padded cursor buffers at their row width.
- Use the running session's mode for the HDR and zero-copy settings, probe the display before screen effects are pushed, retry a held panel mode, and ignore callbacks after the activity is destroyed.
- Write a newer HDR value while an earlier write is settling, and reapply the value after the bridge is reinstalled.
* fix(session): remove the keep-top guard from other displays
#2763 put a transparent KeepTopActivity on every other display while a
session was on top, so lmkd killing that display's home could not move focus
off the session. A/B on a 12 GB AYN Thor (Android 13) and a Retroid Pocket
Duo (Android 16) found no case where it kept a session alive: with steady
pressure the bottom home (stock launcher or Cocoon) was killed up to 400
times per run without taking focus, and a burst big enough to matter makes
lmkd kill the session at adj 0 with or without the guard.
Its side effects were real:
- Android's ActivityRecordInputSink made the bottom screen ignore touch
(worked around in #2910 by stepping aside on touch).
- Cocoon tracks each display's top activity, so it could not suspend or
resume DroidDeck cleanly.
- The Thor's Game Assistant gives every app with an activity on top of the
bottom display that display's volume, so DroidDeck's audio followed the
bottom screen's volume slider.
Removes KeepTopActivity, the focus bounce and light pause, the memory
pressure trigger and their tests. onPause runs its departure cleanup every
time again.
tools/memory_guard_ab.py gains a burst mode, reads oom_score_adj without
su (lmkd kills the root manager app and su can then open its request screen
over the game), handles Android 13 dumps, a hung stop and a session that
does not start. docs/development/memory-guard-ab.md has the Thor results.
* test(session): the guard A/B fill mode starts its counter again, and a pressure run with no completed run fails
* test(session): the burst seed is rebuilt unless it is exactly 256 MiB
* test(session): the guard A/B burst takes its last partial chunk, and only a hog run that finished counts
* fix(session): the bottom screen takes touch again while a game runs
Since #2763, a transparent KeepTopActivity covers every other display while a
session is on top. Its window is NOT_TOUCHABLE, but Android gives a
translucent activity alone in its task an ActivityRecordInputSink that eats
every touch on that display (ENABLE_TOUCH_OPAQUE_ACTIVITIES, on for this
target SDK). With the dual-screen panel closed, the bottom screen's launcher,
Cocoon or any other app could not be touched until the session ended, and
the guard stayed over it after Home/PiP as well.
- The guard now takes touches itself: a touch removes it from that display.
- It comes back when the session is top-resumed again, or after 5 s if the
session kept the top spot (the user touched the bottom screen once and
stayed in the game).
- Stopping or entering PiP removes the guards; PiP keeps the session at adj
50 with or without them, so they protected nothing there.
A/B on a Retroid Pocket Duo (Android 16, Cocoon as bottom home): the guard
is on top in every state it was on top on main, except the 5 s after a
bottom touch and PiP. Under lmkd pressure (kills down to adj 50, bottom
home killed 14-31 times per run) neither build lost the top spot.
* test(session): A/B tool for the keep-top guard on rooted dual screens, with Duo findings
* test(session): the guard A/B tool stops on a failed session start and cleans up an interrupted pressure run