MaxsTechReview 4349563fd1 feat(display): zero-copy presentation toggle and compositor display buffers (#2905)
* 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.
2026-11-21 00:26:50 -05:00
2026-10-13 21:27:42 -04:00
2026-10-13 21:27:42 -04:00
2026-10-13 21:27:42 -04:00
2026-10-13 21:27:42 -04:00

DroidDeck

DroidDeck brings the SteamOS experience to Android: Steam Gaming Mode, full Linux desktop, integration with GOG, Epic Games, Xbox, and other storefronts, Steam VR, and more!

100% open source. No ads. No telemetry. No proprietary components. No source withheld.

Download DroidDeck 0.7.1 Join the DroidDeck Discord

Star History Rank

Droid-Deck%2FDroidDeck | Trendshift Droid-Deck%2FDroidDeck | Trendshift

On a Retroid Pocket Duo: Play Steam from the DroidDeck launcher, open Pac-Man in Steam Big Picture and play it, exit the game, then Switch to Desktop from the Power menu

The official website is droid-deck.dev. Only download DroidDeck from this repository's Releases.

The Library switching source chips, changing the card size and opening the Filter menu A Windows game running through Proton with the on-screen controls Two controllers playing split screen on one handheld The Kubuntu desktop with Discover open

Install

  1. Android 9 or newer on Adreno 730 or newer, or any 8xx. Adreno 6xx, Mali, Xclipse and PowerVR are experimental. Adreno 710 is currently unsupported. No root needed.
  2. About 3 GB free for the runtime, plus 1.1 GB for the desktop and emulators.
  3. Install the APK, install the Linux runtime, press Play and sign in to Steam.
  4. On Android 14 and newer, turn on Disable child process restrictions in Developer options. On Android 12 and 13, Steam's first launch shows a Fix it for me button that walks you through it.

Smart glasses setup is in the support matrix. Release notes are in docs/releases.

Help, Preview builds and device reports are on Discord. For bugs, post in #bug-reports with the zip from Share logs.

Build

Needs Docker, Java 17, the Android SDK and NDK, Rust via rustup, Go, a host C compiler, the x86_64 and i686 MinGW-w64 compilers (i686 with DWARF-2 exceptions, as Debian and Ubuntu ship it; SJLJ builds such as Homebrew's cannot link Rust's i686-pc-windows-gnu), GitHub CLI, Python 3 and zstd. On x86_64 Linux, Docker also needs an arm64 binfmt handler (docker run --privileged --rm tonistiigi/binfmt --install arm64).

tools/build_local.sh

The APK lands in app/build/outputs/apk/release/. Install it with tools/deploy_local.sh. After the first run, ./gradlew :app:assembleRelease reuses the prepared inputs. Unit tests run with ./gradlew -PskipRust=true :app:testDebugUnitTest, and the helper and preload suite with bash tools/test_local.sh.

On Windows, see tools/run_windows.ps1 and tools/prepare_windows_runtime.py.

Limits

Compatibility and performance vary by device. Desktop compositing is software rendered, and Firefox sandboxing is reduced under proot.

Credits and licence

DroidDeck is GPL-3.0. Steam and Proton belong to Valve Corporation. VITURE, RayNeo, XREAL, Rokid, REDMAGIC, Nintendo Switch and Joy-Con are trademarks of their owners. This project is not affiliated with any of them.

Runtime, Wine and Proton
  • Runtime, shim, input and controller work build on WinNative and Bannerlator by maxjivi05.
  • mmap ring buffer controller input by ribbit384 (WinNative #345).
  • FEX (MIT) runs x86 code. DroidDeck's build puts the platform name under AT_PLATFORM so sharun AppImages by VHSgunzo (MIT) start through its userland-execve loader (MIT), and its GL thunk hands X errors to the program's own error handler. FEX's code disk cache was checked in its source.
  • x86 AppImages, and arm64 ones whose runtime can't unpack on Android, are unpacked with uruntime by VHSgunzo (MIT), shipped unmodified with its licence.
  • x86 programs linking OpenSSL 3 use the copy in the Steam Linux Runtime 4.0. x86 Linux games get the /etc/asound.conf that pressure-vessel writes.
  • WriteProcessMemory hooks fall back to /proc/<pid>/mem the way Wine's server/ptrace.c did before Wine 11.
  • Windows programs on noexec storage get executable copies of their image pages, following @yujikaido's finding in droiddeck-rp4pro that Wine's own processes need the noexec shim.
  • Wine write watches use userfaultfd support in Proton'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'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 ntsync semantics in Documentation/userspace-api/ntsync.rst (GPL-2.0).
  • The proot fast path orders bindings like 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.
  • Zink on PowerVR keeps colour textures in colour with Icenowy Zheng's upstream Mesa fix d55418dae7 (MIT), carried as a runtime patch.
  • Games and AppImage, Flatpak and Snap programs such as emulators use TU_DEBUG=sysmem by default, as does the Steam client. Turnip sysmem rendering can be turned off in Performance settings, except with the Adreno 710/720 driver, which always uses it.
  • Black Ops III and Dark Souls Remastered start without umu-protonfixes (BSD-2-Clause), whose 311210.py and 570940.py fail under ARM64 Proton.
  • ReSkate (GPL-3.0) by Dingo Shenanigans uses the launch option from its README and D3D12 feature level 12_1.
  • The arm64 client's sign in was checked by reading Steam's saved token with the ConnectCache format from deadlock-api-ingest.
Stores
  • Epic Games and GOG build on Phobos's adaptation of Legendary and gogdl. GOG install script registry entries are read the way Heroic Games Launcher (GPL-3.0) reads them. GOG cloud storage requests send the Galaxy communication-service User-Agent that gogdl and Lutris (GPL-3.0) send.
  • Epic's official Linux launcher preview runs through FEX. That setup is outside Epic's listed Linux support.
  • The launcher's .deb gets the WebKitGTK and GTK 3 libraries it needs from unmodified Debian 13 packages, following @zooluis's research in #2268.
  • Battle.net is by @kayakyakr. It runs Blizzard's own client in Proton (downloaded from Blizzard, not included) and shows key art from the Battle.net Shop. Without Steam, its games see the pad as an Xbox 360 controller via PROTON_SPOOF_STEAMINPUT_VIDPID in Proton's dlls/winebus.sys.
  • The EA store follows the EA app's protocols as documented by ArmchairDevelopers' Maxima (GPL-3.0): sign-in, the GraphQL queries (included verbatim, since EA matches them by hash), build archives, online activation licences and the LSX game endpoint. The code is DroidDeck's own.
  • Battle.net installs drive Blizzard's Agent the way @barncastle's Battle.Net-Installer does, with requests from wowdev.wiki. Read without taking code: @mubaraknumann's unifideck, @djmittens's neo-mittens bnetswitch, @BCD1210's soju and Lutris's product.db reader.
  • The Rockstar launcher service looks for launcher pipe names in the executables beside the game, since CitizenFX's ros-patches-five shows GTA V opening GTAVLauncher_Pipe and @pingod's rdr2-linux-launcher notes that Rockstar's protected executables resolve such strings only at run time. Read without taking code.
  • World of Warcraft addon imports replace an addon's folder from a temporary copy, as WowUp does, and read flavour folders the way WoWDeck does. No code from either is used.
  • The World of Warcraft addon Download window searches WoWInterface through its MMOUI API. CurseForge opens in the user's browser, with no API and no key.
  • The Xbox store runs @domsvoboda's nexus-backend 0.2.15 (GPL-3.0, a fork of Xodus), and Xbox games load the Windows modules of his nexus-runtime (LGPL-2.1-or-later), including the C++ nexus-xgameruntime and wintypes.dll. Content licensing sends delegation-compact device tickets in the licensing wire form, as nexus-backend's Store license path (commit 27c335e) does. Minecraft's GameInput setup was checked against @Wyze3306's BedrockOnLinux (MIT).
  • The Xbox Cloud Gaming player uses the WebRTC client of @unknownskl's Greenlight (MIT), and its offer tweaks and sharpening follow @redphx's Better xCloud (MIT). See tools/xcloud-player/NOTICE.md.
  • The itch.io butler pack ships butler's 7z.so, itch.io's build of 7-Zip by Igor Pavlov (LGPL-2.1, unRAR restriction on RAR code), unmodified. Other archives use Apache Commons Compress and the runtime's bsdtar (libarchive).
  • The Store uses Flatpak (LGPL-2.1) through DroidDeck's own bubblewrap shim. Chromium and Electron apps start directly, since zypak by @refi64 (BSD-3-Clause) always uses Flatpak's spawn portal.
  • Folder sync runs Syncthing (MPL-2.0), built from @researchxxl's syncthing-android fork (MPL-2.0).
Audio, video and HUD
  • Steam audio goes through @The412Banner's DirectAudio PulseAudio sink (LGPL-2.1-or-later), built from tools/directaudio/sink.
  • The DroidDeck HUD is @The412Banner's FusionHUD (GPL-3.0 with an attribution term). Its readings match Valve's MangoHud build (MIT), with frame times from gamescope patch 0125.
  • The HUD's CPU, GPU load, thermal and battery readers come from @xXJSONDeruloXx's work.
  • LSFG frame generation comes from Camille LaVey and the Eden project, following lsfg-vk, ported by @maxjivi05. It needs your own copy of Lossless Scaling and ships none of its shaders.
  • Black frame insertion follows the design of @artzox's BFI Presenter (GPL-3.0): the strobe runs on the display's refresh clock and the game is paced to the lit refresh. Both build on Blur Busters' research on MPRT and motion blur. No BFI Presenter code is used.
  • Remote Play decodes through Android's MediaCodec or the FFmpeg (LGPL-2.1-or-later) in Steam's runtime. Qualcomm low latency settings follow Moonlight (GPL-3.0).
  • PipeWire (MIT) sockets use the settings in its module-access.c, and WirePlumber (MIT) keeps those clients at full permissions.
Desktop
  • The KDE pacman repository snapshots Arch Linux ARM and installs with pacman (GPL-2.0-or-later).
  • KWin (GPL-2.0-or-later) is patched to pass on the scroll data its wayland_backend.cpp leaves as a TODO.
  • Read without taking code: Qt's qwaylandinputdevice.cpp and qguiapplication.cpp, Konsole's TerminalDisplay.cpp, and Mesa's u_threaded_context.c and zink_resource.c.
  • The Steam Keyboard window rule follows Valve's steamdeck-kde-presets with Bazzite's 0001-steam-virtual-keyboard.patch.
  • Steam's Browse buttons open a GTK 3 file chooser via PyGObject (LGPL-2.1-or-later), shown over Steam by gamescope (BSD-2-Clause) through GetAppIdFromReaper.
  • The AYN Odin 2 phantom second display was confirmed by @SapphireRhodonite's WatermelonDS 0.0.5 notes and iiSU #363, without taking their code.
Smart glasses
VR, Joy-Con and hand tracking
  • Joy-Con VR ports the arm model from Google's GVR SDK for Unity (Apache-2.0) and adapts the hand skeleton from Valve's OpenVR handskeletonsimulation sample (BSD-3-Clause), which follows Moshi Turner's work in Monado. Index offsets come from Monado's vive_poses.c (BSL-1.0).
  • Joy-Con research: Linux's hid-nintendo by Daniel J. Ogorchock, @dekuNukem's Nintendo_Switch_Reverse_Engineering, SDL and AOSP. Checked against ALVR, OpenComposite, PSMoveSteamVRBridge, @F8LEFT's JoyConVr, @krnelpan1c's Daydream-Controller-SteamVR, @yoyobuae's joyconvr, Moonlight and Dolphin. See docs/third-party/joycon.
  • Camera hand tracking runs Google's MediaPipe Pose Landmarker (Lite), BlazePose GHUM 3D and Hand Landmarker (Apache-2.0) on CameraX frames (Apache-2.0), with usage reports off. Checked against JoyConVr's camera app (MIT).
  • Tracking math: the GVR arm model's accelerometer mode, Eric Foxlin's zero velocity updates, Frosio, Pedersini and Borghese's accelerometer autocalibration, a Kalman filter (Kalman, 1960), Horn's quaternion method (1987) and the 1€ filter (Casiez, Roussel and Vogel, 2012).
  • Gestures follow ALVR's hand_gestures.rs (MIT) and Meta Quest's menu pinch, tuned on HaGRID photos (CC BY-SA 4.0, not included).
  • The glove model follows OpenVR's render model reference, is meshed with surface nets (Gibson, 1998; Mikola Lysenko), and uses Inigo Quilez's smooth minimum, distance field ambient occlusion and polygon distance (MIT). See docs/third-party/handtracking.

Star history

Star history chart
S
Description
No description provided
Readme GPL-3.0
561 MiB
0 Stars 1 Watchers 0 Forks
Languages
Kotlin 51.5%
Python 16.8%
C 15.2%
C++ 7.1%
Rust 3.5%
Other 5.7%