Compare commits

..
Author SHA1 Message Date
Kurt Himebauch 4264c44b73 Merge remote-tracking branch 'origin/main' into hdr-content-driven 2026-12-02 13:50:23 -05:00
Kurt Himebauch 186bae8f3e feat(native): run the desktop, its apps and shells as an ordinary user instead of fake root (#3587)
* 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
2026-12-02 13:50:06 -05:00
Kurt Himebauch 3bb22dc92b fix(native): terminals use the ioctls Android allows on an app's pseudo-terminal (#3585)
* fix(native): terminals use the ioctls Android allows on an app's pseudo-terminal

* fix(native): leave a terminal request alone when its register is read before the high half
2026-12-02 13:47:59 -05:00
Kurt Himebauch 27e2067b2d fix(gamescope): SDR games keep their brightness while Steam's overlays are composited over them 2026-12-02 13:20:02 -05:00
LunaDL f3f410059d Feat:Add separate orientation settings for Steam and desktop sessions (#3567)
* Add per-session orientation preferences

* Apply orientation preference for active session

* Use session-specific orientation for output following

* Test independent session orientation preferences

* Map run sessions to Steam orientation preference

* Add separate Steam and desktop orientation controls

* Cover session mode orientation mapping

* Persist in-session orientation by session mode

* Refresh inherited orientation settings after global change

* Resolve window and portrait orientation by session mode

* Use session orientation for output sizing and window behavior

* Test mode-specific window and portrait orientation

* Refresh session orientation choices on resume

* Refresh session orientation choices on resume

* Use Compose lifecycle owner import

* Trigger CI
2026-12-02 12:29:52 -05:00
MaxsTechReview 6e7908ed81 fix(display): copy the game and the window above it in one GPU submit (#3583)
* fix(display): copy the game and the window above it in one GPU submit

When a game's frames go on the layer-copy path and a window sits above
the game, each scene copied the game frame and then the window above it
with two separate submits and two CPU waits. Each wait queued behind
the game's own GPU work, so a GPU-bound game lost on-screen frames to
the second wait.

Record both copies in one command buffer, merge their release fences,
and wait once per scene. The zero-copy path and the single-layer copy
path are unchanged.

* Check overlay eligibility against the frame's own game geometry and keep both release waits when a fence merge fails
2026-12-02 12:12:08 -05:00
LunaDL 9ca6fa064e fix(bionic): the WSI layer uses its normal bypass check, and zero-copy fallbacks log their reason (#3487)
The Bionic launcher no longer forces the WSI layer's XWayland bypass; the layer runs its normal eligibility check, cached for 100 ms. The compositor logs, rate-limited, why a frame or layer candidate leaves the zero-copy path: no registered gralloc buffer, a failed direct present, or a rejected candidate draw.

Tested on a 60 Hz Adreno handheld with the forced bypass on and off and with two driver versions: every run stayed on the zero-copy path at about 60 fps.
2026-12-02 04:04:53 -05:00
MaxsTechReview aab15f3146 fix(display): copy zero-copy frames that carry no acquire fence (#3427)
When a frame's acquire fence cannot be exported from its dma-buf, the frame takes the layer-copy path instead of reaching the display unfenced. Fixes #3410.
2026-12-02 03:29:48 -05:00
Kurt Himebauch 11af78340a fix(gamescope): keep forwarded buffers alive while waiting for scanout, and composite at full rate (#3560)
* fix(gamescope): a pending scanout wait keeps its forwarded buffer alive

Patch 0147 waits for scanout on a forwarded client buffer with a raw
pointer to its CWaylandFb. If the buffer was shown again and the next host
release found scanout already over, that release dropped the last
reference while the earlier wait was still queued, and the wait then
called OnScanoutDone on a freed buffer. The wait now holds a reference
until it finishes.

* fix(gamescope): composite every frame when the host releases buffers before scanout

Holding a forwarded client buffer until scanout ends (0147) costs a three-buffer
client a third of the refresh rate: Steam's UI ran at 80 fps on a 120 Hz screen.
Once the backend sees a forwarded buffer released while it is still being
scanned out, it composites every frame into its own output images, which 0146
reuses at latch. The Steam UI runs at 120 fps again on the Pocket FIT.

* Pin the gamescope build with the scanout wait reference and full-rate compositing
2026-12-02 00:54:29 -05:00
MaxsTechReview 2c95ebd22d fix(input): the middle of a crossed on-screen D-pad presses the nearest arm (#3558)
* fix(input): the middle of a crossed on-screen D-pad presses the nearest arm

Four direction buttons laid out as a cross left an empty square in the
middle, so a touch there fell through to the mouse. A touch inside the
cross now picks the arm on that side, for the stock pad and any custom
layout with the same shape.

* fix(input): take the D-pad middle for hand-placed arms that are not exactly centred

* fix(input): limit the D-pad fallback to its middle and find the cross among duplicate arms

* fix(input): D-pad middle picks the nearest arm and needs overlapping opposite arms

* fix(input): D-pad middle measures the distance to each arm itself

* fix(input): D-pad middle weighs every matching arm set
2026-12-01 22:15:02 -05:00
MaxsTechReview 7ce53ccbed fix(tabs): keep More on the bar so tabs can always be edited (#3556)
Edit tabs only opens from the More page, and More left the bar once no
tab was shelved in it. Hiding or moving every shelved tab therefore
removed the only way back into the tab editor. More now always stays on
the bar; with nothing shelved it opens to the Edit tabs button.
2026-12-01 20:33:08 -05:00
Kurt Himebauch 1b4aaf8a3b feat(drawer): fold session menu groups into summarized sections and regroup pages (#3550)
* feat(drawer): fold session menu groups into summarized sections and regroup pages

* chore(drawer): drop unused strings

* fix(drawer): observe controller state, drop stale achievements, stable section keys
2026-12-01 20:26:14 -05:00
Kurt Himebauch 4793d1df62 fix(display): the Game Mode FPS override caps the frames the guest draws (#3388)
fix(display): the Game Mode FPS override caps the frames the guest draws, not only the ones shown
2026-12-01 20:10:34 -05:00
Kurt Himebauch 9dfbc05933 fix(droiddeckctl): gamepad and pen input on Android 13 and 14 QPR1 (#3530)
* 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
2026-12-01 10:32:06 -05:00
MaxsTechReview 8ec6e646d9 fix(effects): CAS addresses the scene with its pushed input size (#3519)
CAS derives texel centres from the input size in its push constants instead of textureSize on the imported scene image, as the previous CAS shader did. Fixes the grid of black marks with CAS on 10-bit game images on Adreno 8xx.
2026-12-01 10:11:30 -05:00
Kurt Himebauch 41412450fd feat(bottom): Steam menu and Quick Access side by side on the bottom screen (#3501) 2026-12-01 09:52:13 -05:00
MaxsTechReview bf772b7c55 ci(desktop): build KWin 6.8.3 to match the Arch Linux ARM package (#3526) 2026-12-01 09:09:51 -05:00
MaxsTechReview 29b04b66eb fix(gamescope): hold forwarded client buffers until the display finished scanning them out (#3516)
* Return a forwarded client buffer to its client only after the display finished scanning it out

* Test that a forwarded client buffer waits for scanout and composite images do not

* Pin the gamescope build that holds forwarded client buffers until scanout ends
2026-12-01 06:02:16 -05:00
MaxsTechReview 044c8ee475 fix(gamescope): a composited cursor no longer forwards the default arrow to the host (#3510) 2026-12-01 03:55:33 -05:00
MaxsTechReview ca499115ac fix(zero-copy): merge a second release fence into the pending fence wait (#3509)
When the kernel cannot attach a display release fence to the buffer, the
compositor waits on the fence itself. A second release of the same buffer
before that fence signalled overwrote the pending wait, so the first wait
removed the second one and then fired again with no source to remove,
crashing the compositor and losing the session.

A second unsignalled fence is now merged into the pending wait, and a
signalled or attached one leaves the pending wait in charge of the
deferred release.
2026-12-01 02:55:37 -05:00
157 changed files with 4066 additions and 9051 deletions

No files matched your search

-64
View File
@@ -417,69 +417,5 @@
android:name="backend:com.google.android.datatransport.cct.CctBackendFactory"
tools:node="remove" />
</service>
<service android:name=".runtime.GuestWorker0" android:exported="false" android:process=":g0" />
<service android:name=".runtime.GuestWorker1" android:exported="false" android:process=":g1" />
<service android:name=".runtime.GuestWorker2" android:exported="false" android:process=":g2" />
<service android:name=".runtime.GuestWorker3" android:exported="false" android:process=":g3" />
<service android:name=".runtime.GuestWorker4" android:exported="false" android:process=":g4" />
<service android:name=".runtime.GuestWorker5" android:exported="false" android:process=":g5" />
<service android:name=".runtime.GuestWorker6" android:exported="false" android:process=":g6" />
<service android:name=".runtime.GuestWorker7" android:exported="false" android:process=":g7" />
<service android:name=".runtime.GuestWorker8" android:exported="false" android:process=":g8" />
<service android:name=".runtime.GuestWorker9" android:exported="false" android:process=":g9" />
<service android:name=".runtime.GuestWorker10" android:exported="false" android:process=":g10" />
<service android:name=".runtime.GuestWorker11" android:exported="false" android:process=":g11" />
<service android:name=".runtime.GuestWorker12" android:exported="false" android:process=":g12" />
<service android:name=".runtime.GuestWorker13" android:exported="false" android:process=":g13" />
<service android:name=".runtime.GuestWorker14" android:exported="false" android:process=":g14" />
<service android:name=".runtime.GuestWorker15" android:exported="false" android:process=":g15" />
<service android:name=".runtime.GuestWorker16" android:exported="false" android:process=":g16" />
<service android:name=".runtime.GuestWorker17" android:exported="false" android:process=":g17" />
<service android:name=".runtime.GuestWorker18" android:exported="false" android:process=":g18" />
<service android:name=".runtime.GuestWorker19" android:exported="false" android:process=":g19" />
<service android:name=".runtime.GuestWorker20" android:exported="false" android:process=":g20" />
<service android:name=".runtime.GuestWorker21" android:exported="false" android:process=":g21" />
<service android:name=".runtime.GuestWorker22" android:exported="false" android:process=":g22" />
<service android:name=".runtime.GuestWorker23" android:exported="false" android:process=":g23" />
<service android:name=".runtime.GuestWorker24" android:exported="false" android:process=":g24" />
<service android:name=".runtime.GuestWorker25" android:exported="false" android:process=":g25" />
<service android:name=".runtime.GuestWorker26" android:exported="false" android:process=":g26" />
<service android:name=".runtime.GuestWorker27" android:exported="false" android:process=":g27" />
<service android:name=".runtime.GuestWorker28" android:exported="false" android:process=":g28" />
<service android:name=".runtime.GuestWorker29" android:exported="false" android:process=":g29" />
<service android:name=".runtime.GuestWorker30" android:exported="false" android:process=":g30" />
<service android:name=".runtime.GuestWorker31" android:exported="false" android:process=":g31" />
<service android:name=".runtime.GuestWorker32" android:exported="false" android:process=":g32" />
<service android:name=".runtime.GuestWorker33" android:exported="false" android:process=":g33" />
<service android:name=".runtime.GuestWorker34" android:exported="false" android:process=":g34" />
<service android:name=".runtime.GuestWorker35" android:exported="false" android:process=":g35" />
<service android:name=".runtime.GuestWorker36" android:exported="false" android:process=":g36" />
<service android:name=".runtime.GuestWorker37" android:exported="false" android:process=":g37" />
<service android:name=".runtime.GuestWorker38" android:exported="false" android:process=":g38" />
<service android:name=".runtime.GuestWorker39" android:exported="false" android:process=":g39" />
<service android:name=".runtime.GuestWorker40" android:exported="false" android:process=":g40" />
<service android:name=".runtime.GuestWorker41" android:exported="false" android:process=":g41" />
<service android:name=".runtime.GuestWorker42" android:exported="false" android:process=":g42" />
<service android:name=".runtime.GuestWorker43" android:exported="false" android:process=":g43" />
<service android:name=".runtime.GuestWorker44" android:exported="false" android:process=":g44" />
<service android:name=".runtime.GuestWorker45" android:exported="false" android:process=":g45" />
<service android:name=".runtime.GuestWorker46" android:exported="false" android:process=":g46" />
<service android:name=".runtime.GuestWorker47" android:exported="false" android:process=":g47" />
<service android:name=".runtime.GuestWorker48" android:exported="false" android:process=":g48" />
<service android:name=".runtime.GuestWorker49" android:exported="false" android:process=":g49" />
<service android:name=".runtime.GuestWorker50" android:exported="false" android:process=":g50" />
<service android:name=".runtime.GuestWorker51" android:exported="false" android:process=":g51" />
<service android:name=".runtime.GuestWorker52" android:exported="false" android:process=":g52" />
<service android:name=".runtime.GuestWorker53" android:exported="false" android:process=":g53" />
<service android:name=".runtime.GuestWorker54" android:exported="false" android:process=":g54" />
<service android:name=".runtime.GuestWorker55" android:exported="false" android:process=":g55" />
<service android:name=".runtime.GuestWorker56" android:exported="false" android:process=":g56" />
<service android:name=".runtime.GuestWorker57" android:exported="false" android:process=":g57" />
<service android:name=".runtime.GuestWorker58" android:exported="false" android:process=":g58" />
<service android:name=".runtime.GuestWorker59" android:exported="false" android:process=":g59" />
<service android:name=".runtime.GuestWorker60" android:exported="false" android:process=":g60" />
<service android:name=".runtime.GuestWorker61" android:exported="false" android:process=":g61" />
<service android:name=".runtime.GuestWorker62" android:exported="false" android:process=":g62" />
<service android:name=".runtime.GuestWorker63" android:exported="false" android:process=":g63" />
</application>
</manifest>
+3 -3
View File
@@ -39,7 +39,7 @@
// - Same push constants as cas.frag: ndc, input size, sharpness [0..1].
// CasSetup's const1.x = -1 / lerp(8, 5, sharpness) is computed here.
// - The input is the effect chain's previous target at the same size, so the
// output pixel reads the input pixel 1:1 (texelFetch, edges clamped).
// output pixel reads the input pixel 1:1 (texel centres, edges clamped).
// =============================================================================
// DD_HALF is set for the *_half_frag.h build (gen_shaders.sh): colour and
@@ -64,8 +64,8 @@ layout(location = 0) in highp vec2 fragTexCoord;
layout(location = 0) out vec4 outColor;
vec3 CasLoad(ivec2 p) {
ivec2 sz = textureSize(InputTexture, 0);
return texelFetch(InputTexture, clamp(p, ivec2(0), sz - ivec2(1)), 0).rgb;
highp vec2 uv = (vec2(p) + 0.5) / pc.resolution;
return textureLod(InputTexture, uv, 0.0).rgb;
}
float AMin3F1(float x, float y, float z) { return min(x, min(y, z)); }
+210 -211
View File
@@ -1,214 +1,213 @@
// 1116.2.0
// 1115.1.0
#pragma once
const uint32_t cas_ffx_half_code[] = {
0x07230203,0x00010000,0x0008000b,0x000000d7,0x00000000,0x00020011,0x00000001,0x00020011,
0x00000032,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,
0x00000000,0x00000001,0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000043,
0x000000d1,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,
0x00000004,0x6e69616d,0x00000000,0x00060005,0x0000000d,0x4c736143,0x2864616f,0x3b326976,
0x00000000,0x00030005,0x0000000c,0x00000070,0x00070005,0x00000014,0x6e694d41,0x28314633,
0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000011,0x00000078,0x00030005,0x00000012,
0x00000079,0x00030005,0x00000013,0x0000007a,0x00070005,0x00000019,0x78614d41,0x28314633,
0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000016,0x00000078,0x00030005,0x00000017,
0x00000079,0x00030005,0x00000018,0x0000007a,0x00030005,0x0000001b,0x00007a73,0x00060005,
0x0000001f,0x75706e49,0x78655474,0x65727574,0x00000000,0x00030005,0x00000040,0x00007073,
0x00060005,0x00000043,0x67617266,0x43786554,0x64726f6f,0x00000000,0x00030005,0x00000045,
0x00004350,0x00040006,0x00000045,0x00000000,0x0063646e,0x00060006,0x00000045,0x00000001,
0x6f736572,0x6974756c,0x00006e6f,0x00060006,0x00000045,0x00000002,0x72616873,0x73656e70,
0x00000073,0x00030005,0x00000047,0x00006370,0x00040005,0x0000004d,0x6b616570,0x00000000,
0x00030005,0x0000005b,0x00000062,0x00040005,0x00000060,0x61726170,0x0000006d,0x00030005,
0x00000062,0x00000064,0x00040005,0x00000066,0x61726170,0x0000006d,0x00030005,0x00000068,
0x00000065,0x00040005,0x00000069,0x61726170,0x0000006d,0x00030005,0x0000006c,0x00000066,
0x00040005,0x00000070,0x61726170,0x0000006d,0x00030005,0x00000072,0x00000068,0x00040005,
0x00000076,0x61726170,0x0000006d,0x00030005,0x00000078,0x00476e6d,0x00040005,0x00000079,
0x61726170,0x0000006d,0x00040005,0x0000007e,0x61726170,0x0000006d,0x00040005,0x00000081,
0x61726170,0x0000006d,0x00040005,0x00000085,0x61726170,0x0000006d,0x00040005,0x00000086,
0x61726170,0x0000006d,0x00040005,0x00000089,0x61726170,0x0000006d,0x00030005,0x0000008d,
0x0047786d,0x00040005,0x0000008e,0x61726170,0x0000006d,0x00040005,0x00000091,0x61726170,
0x0000006d,0x00040005,0x00000094,0x61726170,0x0000006d,0x00040005,0x00000098,0x61726170,
0x0000006d,0x00040005,0x00000099,0x61726170,0x0000006d,0x00040005,0x0000009c,0x61726170,
0x0000006d,0x00040005,0x000000a0,0x4d706372,0x00000047,0x00040005,0x000000a5,0x47706d61,
0x00000000,0x00030005,0x000000af,0x00004777,0x00050005,0x000000b3,0x57706372,0x68676965,
0x00000074,0x00030005,0x000000b9,0x00786970,0x00050005,0x000000d1,0x4374756f,0x726f6c6f,
0x00000000,0x00030047,0x0000000d,0x00000000,0x00030047,0x00000011,0x00000000,0x00030047,
0x00000012,0x00000000,0x00030047,0x00000013,0x00000000,0x00030047,0x00000014,0x00000000,
0x00030047,0x00000016,0x00000000,0x00030047,0x00000017,0x00000000,0x00030047,0x00000018,
0x00000000,0x00030047,0x00000019,0x00000000,0x00030047,0x0000001f,0x00000000,0x00040047,
0x0000001f,0x00000021,0x00000000,0x00040047,0x0000001f,0x00000022,0x00000000,0x00030047,
0x00000020,0x00000000,0x00030047,0x00000024,0x00000000,0x00030047,0x0000002e,0x00000000,
0x00030047,0x0000002f,0x00000000,0x00030047,0x00000032,0x00000000,0x00030047,0x00000033,
0x00000000,0x00030047,0x00000034,0x00000000,0x00030047,0x00000035,0x00000000,0x00030047,
0x00000036,0x00000000,0x00030047,0x00000039,0x00000000,0x00030047,0x0000003a,0x00000000,
0x00030047,0x0000003b,0x00000000,0x00030047,0x0000003c,0x00000000,0x00030047,0x0000003d,
0x00000000,0x00040047,0x00000043,0x0000001e,0x00000000,0x00030047,0x00000045,0x00000002,
0x00050048,0x00000045,0x00000000,0x00000023,0x00000000,0x00050048,0x00000045,0x00000001,
0x00000023,0x00000010,0x00040048,0x00000045,0x00000002,0x00000000,0x00050048,0x00000045,
0x00000002,0x00000023,0x00000018,0x00030047,0x0000004d,0x00000000,0x00030047,0x00000054,
0x00000000,0x00030047,0x00000057,0x00000000,0x00030047,0x00000058,0x00000000,0x00030047,
0x00000059,0x00000000,0x00030047,0x0000005b,0x00000000,0x00030047,0x00000061,0x00000000,
0x00030047,0x00000062,0x00000000,0x00030047,0x00000067,0x00000000,0x00030047,0x00000068,
0x00000000,0x00030047,0x0000006b,0x00000000,0x00030047,0x0000006c,0x00000000,0x00030047,
0x00000071,0x00000000,0x00030047,0x00000072,0x00000000,0x00030047,0x00000077,0x00000000,
0x00030047,0x00000078,0x00000000,0x00030047,0x00000079,0x00000000,0x00030047,0x0000007d,
0x00000000,0x00030047,0x0000007e,0x00000000,0x00030047,0x00000080,0x00000000,0x00030047,
0x00000081,0x00000000,0x00030047,0x00000083,0x00000000,0x00030047,0x00000084,0x00000000,
0x00030047,0x00000085,0x00000000,0x00030047,0x00000086,0x00000000,0x00030047,0x00000088,
0x00000000,0x00030047,0x00000089,0x00000000,0x00030047,0x0000008b,0x00000000,0x00030047,
0x0000008c,0x00000000,0x00030047,0x0000008d,0x00000000,0x00030047,0x0000008e,0x00000000,
0x00030047,0x00000090,0x00000000,0x00030047,0x00000091,0x00000000,0x00030047,0x00000093,
0x00000000,0x00030047,0x00000094,0x00000000,0x00030047,0x00000096,0x00000000,0x00030047,
0x00000097,0x00000000,0x00030047,0x00000098,0x00000000,0x00030047,0x00000099,0x00000000,
0x00030047,0x0000009b,0x00000000,0x00030047,0x0000009c,0x00000000,0x00030047,0x0000009e,
0x00000000,0x00030047,0x0000009f,0x00000000,0x00030047,0x000000a0,0x00000000,0x00030047,
0x000000a1,0x00000000,0x00030047,0x000000a3,0x00000000,0x00030047,0x000000a4,0x00000000,
0x00030047,0x000000a5,0x00000000,0x00030047,0x000000a6,0x00000000,0x00030047,0x000000a7,
0x00000000,0x00030047,0x000000a8,0x00000000,0x00030047,0x000000a9,0x00000000,0x00030047,
0x000000aa,0x00000000,0x00030047,0x000000ab,0x00000000,0x00030047,0x000000ac,0x00000000,
0x00030047,0x000000ad,0x00000000,0x00030047,0x000000ae,0x00000000,0x00030047,0x000000af,
0x00000000,0x00030047,0x000000b0,0x00000000,0x00030047,0x000000b1,0x00000000,0x00030047,
0x000000b2,0x00000000,0x00030047,0x000000b3,0x00000000,0x00030047,0x000000b5,0x00000000,
0x00030047,0x000000b6,0x00000000,0x00030047,0x000000b7,0x00000000,0x00030047,0x000000b8,
0x00000000,0x00030047,0x000000b9,0x00000000,0x00030047,0x000000ba,0x00000000,0x00030047,
0x000000bb,0x00000000,0x00030047,0x000000bc,0x00000000,0x00030047,0x000000bd,0x00000000,
0x00030047,0x000000be,0x00000000,0x00030047,0x000000bf,0x00000000,0x00030047,0x000000c0,
0x00000000,0x00030047,0x000000c1,0x00000000,0x00030047,0x000000c2,0x00000000,0x00030047,
0x000000c3,0x00000000,0x00030047,0x000000c4,0x00000000,0x00030047,0x000000c5,0x00000000,
0x00030047,0x000000c6,0x00000000,0x00030047,0x000000c7,0x00000000,0x00030047,0x000000c8,
0x00000000,0x00030047,0x000000c9,0x00000000,0x00030047,0x000000ca,0x00000000,0x00030047,
0x000000cb,0x00000000,0x00030047,0x000000cc,0x00000000,0x00030047,0x000000cd,0x00000000,
0x00030047,0x000000ce,0x00000000,0x00030047,0x000000cf,0x00000000,0x00030047,0x000000d1,
0x00000000,0x00040047,0x000000d1,0x0000001e,0x00000000,0x00030047,0x000000d2,0x00000000,
0x00030047,0x000000d3,0x00000000,0x00030047,0x000000d4,0x00000000,0x00030047,0x000000d5,
0x00000000,0x00030047,0x000000d6,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,
0x00000002,0x00040015,0x00000006,0x00000020,0x00000001,0x00040017,0x00000007,0x00000006,
0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x00030016,0x00000009,0x00000020,
0x00040017,0x0000000a,0x00000009,0x00000003,0x00040021,0x0000000b,0x0000000a,0x00000008,
0x00040020,0x0000000f,0x00000007,0x00000009,0x00060021,0x00000010,0x00000009,0x0000000f,
0x0000000f,0x0000000f,0x00090019,0x0000001c,0x00000009,0x00000001,0x00000000,0x00000000,
0x00000000,0x00000001,0x00000000,0x0003001b,0x0000001d,0x0000001c,0x00040020,0x0000001e,
0x00000000,0x0000001d,0x0004003b,0x0000001e,0x0000001f,0x00000000,0x0004002b,0x00000006,
0x00000021,0x00000000,0x0005002c,0x00000007,0x00000026,0x00000021,0x00000021,0x0004002b,
0x00000006,0x00000028,0x00000001,0x0005002c,0x00000007,0x00000029,0x00000028,0x00000028,
0x00040017,0x0000002d,0x00000009,0x00000004,0x00040017,0x00000041,0x00000009,0x00000002,
0x00040020,0x00000042,0x00000001,0x00000041,0x0004003b,0x00000042,0x00000043,0x00000001,
0x0005001e,0x00000045,0x0000002d,0x00000041,0x00000009,0x00040020,0x00000046,0x00000009,
0x00000045,0x0004003b,0x00000046,0x00000047,0x00000009,0x00040020,0x00000048,0x00000009,
0x00000041,0x0004002b,0x00000009,0x0000004e,0xbf800000,0x0004002b,0x00000009,0x0000004f,
0x41000000,0x0004002b,0x00000009,0x00000050,0x40a00000,0x0004002b,0x00000006,0x00000051,
0x00000002,0x00040020,0x00000052,0x00000009,0x00000009,0x0004002b,0x00000009,0x00000055,
0x00000000,0x0004002b,0x00000009,0x00000056,0x3f800000,0x00040020,0x0000005a,0x00000007,
0x0000000a,0x0004002b,0x00000006,0x0000005d,0xffffffff,0x0005002c,0x00000007,0x0000005e,
0x00000021,0x0000005d,0x0005002c,0x00000007,0x00000064,0x0000005d,0x00000021,0x0005002c,
0x00000007,0x0000006e,0x00000028,0x00000021,0x0005002c,0x00000007,0x00000074,0x00000021,
0x00000028,0x00040015,0x0000007a,0x00000020,0x00000000,0x0004002b,0x0000007a,0x0000007b,
0x00000001,0x0004002b,0x00000009,0x000000a2,0x3a800000,0x0004002b,0x00000009,0x000000b4,
0x40800000,0x00040020,0x000000d0,0x00000003,0x0000002d,0x0004003b,0x000000d0,0x000000d1,
0x00000003,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,
0x0004003b,0x00000008,0x00000040,0x00000007,0x0004003b,0x0000000f,0x0000004d,0x00000007,
0x0004003b,0x0000005a,0x0000005b,0x00000007,0x0004003b,0x00000008,0x00000060,0x00000007,
0x0004003b,0x0000005a,0x00000062,0x00000007,0x0004003b,0x00000008,0x00000066,0x00000007,
0x0004003b,0x0000005a,0x00000068,0x00000007,0x0004003b,0x00000008,0x00000069,0x00000007,
0x0004003b,0x0000005a,0x0000006c,0x00000007,0x0004003b,0x00000008,0x00000070,0x00000007,
0x0004003b,0x0000005a,0x00000072,0x00000007,0x0004003b,0x00000008,0x00000076,0x00000007,
0x0004003b,0x0000000f,0x00000078,0x00000007,0x0004003b,0x0000000f,0x00000079,0x00000007,
0x0004003b,0x0000000f,0x0000007e,0x00000007,0x0004003b,0x0000000f,0x00000081,0x00000007,
0x0004003b,0x0000000f,0x00000085,0x00000007,0x0004003b,0x0000000f,0x00000086,0x00000007,
0x0004003b,0x0000000f,0x00000089,0x00000007,0x0004003b,0x0000000f,0x0000008d,0x00000007,
0x0004003b,0x0000000f,0x0000008e,0x00000007,0x0004003b,0x0000000f,0x00000091,0x00000007,
0x0004003b,0x0000000f,0x00000094,0x00000007,0x0004003b,0x0000000f,0x00000098,0x00000007,
0x0004003b,0x0000000f,0x00000099,0x00000007,0x0004003b,0x0000000f,0x0000009c,0x00000007,
0x0004003b,0x0000000f,0x000000a0,0x00000007,0x0004003b,0x0000000f,0x000000a5,0x00000007,
0x0004003b,0x0000000f,0x000000af,0x00000007,0x0004003b,0x0000000f,0x000000b3,0x00000007,
0x0004003b,0x0000005a,0x000000b9,0x00000007,0x0004003d,0x00000041,0x00000044,0x00000043,
0x00050041,0x00000048,0x00000049,0x00000047,0x00000028,0x0004003d,0x00000041,0x0000004a,
0x00000049,0x00050085,0x00000041,0x0000004b,0x00000044,0x0000004a,0x0004006e,0x00000007,
0x0000004c,0x0000004b,0x0003003e,0x00000040,0x0000004c,0x00050041,0x00000052,0x00000053,
0x00000047,0x00000051,0x0004003d,0x00000009,0x00000054,0x00000053,0x0008000c,0x00000009,
0x00000057,0x00000001,0x0000002b,0x00000054,0x00000055,0x00000056,0x0008000c,0x00000009,
0x00000058,0x00000001,0x0000002e,0x0000004f,0x00000050,0x00000057,0x00050088,0x00000009,
0x00000059,0x0000004e,0x00000058,0x0003003e,0x0000004d,0x00000059,0x0004003d,0x00000007,
0x0000005c,0x00000040,0x00050080,0x00000007,0x0000005f,0x0000005c,0x0000005e,0x0003003e,
0x00000060,0x0000005f,0x00050039,0x0000000a,0x00000061,0x0000000d,0x00000060,0x0003003e,
0x0000005b,0x00000061,0x0004003d,0x00000007,0x00000063,0x00000040,0x00050080,0x00000007,
0x00000065,0x00000063,0x00000064,0x0003003e,0x00000066,0x00000065,0x00050039,0x0000000a,
0x00000067,0x0000000d,0x00000066,0x0003003e,0x00000062,0x00000067,0x0004003d,0x00000007,
0x0000006a,0x00000040,0x0003003e,0x00000069,0x0000006a,0x00050039,0x0000000a,0x0000006b,
0x0000000d,0x00000069,0x0003003e,0x00000068,0x0000006b,0x0004003d,0x00000007,0x0000006d,
0x00000040,0x00050080,0x00000007,0x0000006f,0x0000006d,0x0000006e,0x0003003e,0x00000070,
0x0000006f,0x00050039,0x0000000a,0x00000071,0x0000000d,0x00000070,0x0003003e,0x0000006c,
0x00000071,0x0004003d,0x00000007,0x00000073,0x00000040,0x00050080,0x00000007,0x00000075,
0x00000073,0x00000074,0x0003003e,0x00000076,0x00000075,0x00050039,0x0000000a,0x00000077,
0x0000000d,0x00000076,0x0003003e,0x00000072,0x00000077,0x00050041,0x0000000f,0x0000007c,
0x00000062,0x0000007b,0x0004003d,0x00000009,0x0000007d,0x0000007c,0x0003003e,0x00000079,
0x0000007d,0x00050041,0x0000000f,0x0000007f,0x00000068,0x0000007b,0x0004003d,0x00000009,
0x00000080,0x0000007f,0x0003003e,0x0000007e,0x00000080,0x00050041,0x0000000f,0x00000082,
0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000083,0x00000082,0x0003003e,0x00000081,
0x00000083,0x00070039,0x00000009,0x00000084,0x00000014,0x00000079,0x0000007e,0x00000081,
0x0003003e,0x00000085,0x00000084,0x00050041,0x0000000f,0x00000087,0x0000005b,0x0000007b,
0x0004003d,0x00000009,0x00000088,0x00000087,0x0003003e,0x00000086,0x00000088,0x00050041,
0x0000000f,0x0000008a,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000008b,0x0000008a,
0x0003003e,0x00000089,0x0000008b,0x00070039,0x00000009,0x0000008c,0x00000014,0x00000085,
0x00000086,0x00000089,0x0003003e,0x00000078,0x0000008c,0x00050041,0x0000000f,0x0000008f,
0x00000062,0x0000007b,0x0004003d,0x00000009,0x00000090,0x0000008f,0x0003003e,0x0000008e,
0x00000090,0x00050041,0x0000000f,0x00000092,0x00000068,0x0000007b,0x0004003d,0x00000009,
0x00000093,0x00000092,0x0003003e,0x00000091,0x00000093,0x00050041,0x0000000f,0x00000095,
0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000096,0x00000095,0x0003003e,0x00000094,
0x00000096,0x00070039,0x00000009,0x00000097,0x00000019,0x0000008e,0x00000091,0x00000094,
0x0003003e,0x00000098,0x00000097,0x00050041,0x0000000f,0x0000009a,0x0000005b,0x0000007b,
0x0004003d,0x00000009,0x0000009b,0x0000009a,0x0003003e,0x00000099,0x0000009b,0x00050041,
0x0000000f,0x0000009d,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000009e,0x0000009d,
0x0003003e,0x0000009c,0x0000009e,0x00070039,0x00000009,0x0000009f,0x00000019,0x00000098,
0x00000099,0x0000009c,0x0003003e,0x0000008d,0x0000009f,0x0004003d,0x00000009,0x000000a1,
0x0000008d,0x0007000c,0x00000009,0x000000a3,0x00000001,0x00000028,0x000000a1,0x000000a2,
0x00050088,0x00000009,0x000000a4,0x00000056,0x000000a3,0x0003003e,0x000000a0,0x000000a4,
0x0004003d,0x00000009,0x000000a6,0x00000078,0x0004003d,0x00000009,0x000000a7,0x0000008d,
0x00050083,0x00000009,0x000000a8,0x00000056,0x000000a7,0x0007000c,0x00000009,0x000000a9,
0x00000001,0x00000025,0x000000a6,0x000000a8,0x0004003d,0x00000009,0x000000aa,0x000000a0,
0x00050085,0x00000009,0x000000ab,0x000000a9,0x000000aa,0x0008000c,0x00000009,0x000000ac,
0x00000001,0x0000002b,0x000000ab,0x00000055,0x00000056,0x0003003e,0x000000a5,0x000000ac,
0x0004003d,0x00000009,0x000000ad,0x000000a5,0x0006000c,0x00000009,0x000000ae,0x00000001,
0x0000001f,0x000000ad,0x0003003e,0x000000a5,0x000000ae,0x0004003d,0x00000009,0x000000b0,
0x000000a5,0x0004003d,0x00000009,0x000000b1,0x0000004d,0x00050085,0x00000009,0x000000b2,
0x000000b0,0x000000b1,0x0003003e,0x000000af,0x000000b2,0x0004003d,0x00000009,0x000000b5,
0x000000af,0x00050085,0x00000009,0x000000b6,0x000000b4,0x000000b5,0x00050081,0x00000009,
0x000000b7,0x00000056,0x000000b6,0x00050088,0x00000009,0x000000b8,0x00000056,0x000000b7,
0x0003003e,0x000000b3,0x000000b8,0x0004003d,0x0000000a,0x000000ba,0x0000005b,0x0004003d,
0x00000009,0x000000bb,0x000000af,0x0005008e,0x0000000a,0x000000bc,0x000000ba,0x000000bb,
0x0004003d,0x0000000a,0x000000bd,0x00000062,0x0004003d,0x00000009,0x000000be,0x000000af,
0x0005008e,0x0000000a,0x000000bf,0x000000bd,0x000000be,0x00050081,0x0000000a,0x000000c0,
0x000000bc,0x000000bf,0x0004003d,0x0000000a,0x000000c1,0x0000006c,0x0004003d,0x00000009,
0x000000c2,0x000000af,0x0005008e,0x0000000a,0x000000c3,0x000000c1,0x000000c2,0x00050081,
0x0000000a,0x000000c4,0x000000c0,0x000000c3,0x0004003d,0x0000000a,0x000000c5,0x00000072,
0x0004003d,0x00000009,0x000000c6,0x000000af,0x0005008e,0x0000000a,0x000000c7,0x000000c5,
0x000000c6,0x00050081,0x0000000a,0x000000c8,0x000000c4,0x000000c7,0x0004003d,0x0000000a,
0x000000c9,0x00000068,0x00050081,0x0000000a,0x000000ca,0x000000c8,0x000000c9,0x0004003d,
0x00000009,0x000000cb,0x000000b3,0x0005008e,0x0000000a,0x000000cc,0x000000ca,0x000000cb,
0x00060050,0x0000000a,0x000000cd,0x00000055,0x00000055,0x00000055,0x00060050,0x0000000a,
0x000000ce,0x00000056,0x00000056,0x00000056,0x0008000c,0x0000000a,0x000000cf,0x00000001,
0x0000002b,0x000000cc,0x000000cd,0x000000ce,0x0003003e,0x000000b9,0x000000cf,0x0004003d,
0x0000000a,0x000000d2,0x000000b9,0x00050051,0x00000009,0x000000d3,0x000000d2,0x00000000,
0x00050051,0x00000009,0x000000d4,0x000000d2,0x00000001,0x00050051,0x00000009,0x000000d5,
0x000000d2,0x00000002,0x00070050,0x0000002d,0x000000d6,0x000000d3,0x000000d4,0x000000d5,
0x00000056,0x0003003e,0x000000d1,0x000000d6,0x000100fd,0x00010038,0x00050036,0x0000000a,
0x0000000d,0x00000000,0x0000000b,0x00030037,0x00000008,0x0000000c,0x000200f8,0x0000000e,
0x0004003b,0x00000008,0x0000001b,0x00000007,0x0004003d,0x0000001d,0x00000020,0x0000001f,
0x00040064,0x0000001c,0x00000022,0x00000020,0x00050067,0x00000007,0x00000023,0x00000022,
0x00000021,0x0003003e,0x0000001b,0x00000023,0x0004003d,0x0000001d,0x00000024,0x0000001f,
0x0004003d,0x00000007,0x00000025,0x0000000c,0x0004003d,0x00000007,0x00000027,0x0000001b,
0x00050082,0x00000007,0x0000002a,0x00000027,0x00000029,0x0008000c,0x00000007,0x0000002b,
0x00000001,0x0000002d,0x00000025,0x00000026,0x0000002a,0x00040064,0x0000001c,0x0000002c,
0x00000024,0x0007005f,0x0000002d,0x0000002e,0x0000002c,0x0000002b,0x00000002,0x00000021,
0x0008004f,0x0000000a,0x0000002f,0x0000002e,0x0000002e,0x00000000,0x00000001,0x00000002,
0x000200fe,0x0000002f,0x00010038,0x00050036,0x00000009,0x00000014,0x00000000,0x00000010,
0x00030037,0x0000000f,0x00000011,0x00030037,0x0000000f,0x00000012,0x00030037,0x0000000f,
0x00000013,0x000200f8,0x00000015,0x0004003d,0x00000009,0x00000032,0x00000011,0x0004003d,
0x00000009,0x00000033,0x00000012,0x0004003d,0x00000009,0x00000034,0x00000013,0x0007000c,
0x00000009,0x00000035,0x00000001,0x00000025,0x00000033,0x00000034,0x0007000c,0x00000009,
0x00000036,0x00000001,0x00000025,0x00000032,0x00000035,0x000200fe,0x00000036,0x00010038,
0x00050036,0x00000009,0x00000019,0x00000000,0x00000010,0x00030037,0x0000000f,0x00000016,
0x00030037,0x0000000f,0x00000017,0x00030037,0x0000000f,0x00000018,0x000200f8,0x0000001a,
0x0004003d,0x00000009,0x00000039,0x00000016,0x0004003d,0x00000009,0x0000003a,0x00000017,
0x0004003d,0x00000009,0x0000003b,0x00000018,0x0007000c,0x00000009,0x0000003c,0x00000001,
0x00000028,0x0000003a,0x0000003b,0x0007000c,0x00000009,0x0000003d,0x00000001,0x00000028,
0x00000039,0x0000003c,0x000200fe,0x0000003d,0x00010038
0x07230203,0x00010000,0x0008000b,0x000000d7,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000047,0x000000d1,0x00030010,
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
0x00000000,0x00060005,0x0000000d,0x4c736143,0x2864616f,0x3b326976,0x00000000,0x00030005,
0x0000000c,0x00000070,0x00070005,0x00000014,0x6e694d41,0x28314633,0x663b3166,0x31663b31,
0x0000003b,0x00030005,0x00000011,0x00000078,0x00030005,0x00000012,0x00000079,0x00030005,
0x00000013,0x0000007a,0x00070005,0x00000019,0x78614d41,0x28314633,0x663b3166,0x31663b31,
0x0000003b,0x00030005,0x00000016,0x00000078,0x00030005,0x00000017,0x00000079,0x00030005,
0x00000018,0x0000007a,0x00030005,0x0000001d,0x00007675,0x00030005,0x00000024,0x00004350,
0x00040006,0x00000024,0x00000000,0x0063646e,0x00060006,0x00000024,0x00000001,0x6f736572,
0x6974756c,0x00006e6f,0x00060006,0x00000024,0x00000002,0x72616873,0x73656e70,0x00000073,
0x00030005,0x00000026,0x00006370,0x00060005,0x0000002f,0x75706e49,0x78655474,0x65727574,
0x00000000,0x00030005,0x00000045,0x00007073,0x00060005,0x00000047,0x67617266,0x43786554,
0x64726f6f,0x00000000,0x00040005,0x0000004d,0x6b616570,0x00000000,0x00030005,0x0000005a,
0x00000062,0x00040005,0x00000060,0x61726170,0x0000006d,0x00030005,0x00000062,0x00000064,
0x00040005,0x00000066,0x61726170,0x0000006d,0x00030005,0x00000068,0x00000065,0x00040005,
0x00000069,0x61726170,0x0000006d,0x00030005,0x0000006c,0x00000066,0x00040005,0x00000070,
0x61726170,0x0000006d,0x00030005,0x00000072,0x00000068,0x00040005,0x00000076,0x61726170,
0x0000006d,0x00030005,0x00000078,0x00476e6d,0x00040005,0x00000079,0x61726170,0x0000006d,
0x00040005,0x0000007e,0x61726170,0x0000006d,0x00040005,0x00000081,0x61726170,0x0000006d,
0x00040005,0x00000085,0x61726170,0x0000006d,0x00040005,0x00000086,0x61726170,0x0000006d,
0x00040005,0x00000089,0x61726170,0x0000006d,0x00030005,0x0000008d,0x0047786d,0x00040005,
0x0000008e,0x61726170,0x0000006d,0x00040005,0x00000091,0x61726170,0x0000006d,0x00040005,
0x00000094,0x61726170,0x0000006d,0x00040005,0x00000098,0x61726170,0x0000006d,0x00040005,
0x00000099,0x61726170,0x0000006d,0x00040005,0x0000009c,0x61726170,0x0000006d,0x00040005,
0x000000a0,0x4d706372,0x00000047,0x00040005,0x000000a5,0x47706d61,0x00000000,0x00030005,
0x000000af,0x00004777,0x00050005,0x000000b3,0x57706372,0x68676965,0x00000074,0x00030005,
0x000000b9,0x00786970,0x00050005,0x000000d1,0x4374756f,0x726f6c6f,0x00000000,0x00030047,
0x0000000d,0x00000000,0x00030047,0x00000011,0x00000000,0x00030047,0x00000012,0x00000000,
0x00030047,0x00000013,0x00000000,0x00030047,0x00000014,0x00000000,0x00030047,0x00000016,
0x00000000,0x00030047,0x00000017,0x00000000,0x00030047,0x00000018,0x00000000,0x00030047,
0x00000019,0x00000000,0x00030047,0x00000024,0x00000002,0x00050048,0x00000024,0x00000000,
0x00000023,0x00000000,0x00050048,0x00000024,0x00000001,0x00000023,0x00000010,0x00040048,
0x00000024,0x00000002,0x00000000,0x00050048,0x00000024,0x00000002,0x00000023,0x00000018,
0x00030047,0x0000002f,0x00000000,0x00040047,0x0000002f,0x00000021,0x00000000,0x00040047,
0x0000002f,0x00000022,0x00000000,0x00030047,0x00000030,0x00000000,0x00030047,0x00000033,
0x00000000,0x00030047,0x00000034,0x00000000,0x00030047,0x00000037,0x00000000,0x00030047,
0x00000038,0x00000000,0x00030047,0x00000039,0x00000000,0x00030047,0x0000003a,0x00000000,
0x00030047,0x0000003b,0x00000000,0x00030047,0x0000003e,0x00000000,0x00030047,0x0000003f,
0x00000000,0x00030047,0x00000040,0x00000000,0x00030047,0x00000041,0x00000000,0x00030047,
0x00000042,0x00000000,0x00040047,0x00000047,0x0000001e,0x00000000,0x00030047,0x0000004d,
0x00000000,0x00030047,0x00000054,0x00000000,0x00030047,0x00000056,0x00000000,0x00030047,
0x00000057,0x00000000,0x00030047,0x00000058,0x00000000,0x00030047,0x0000005a,0x00000000,
0x00030047,0x00000061,0x00000000,0x00030047,0x00000062,0x00000000,0x00030047,0x00000067,
0x00000000,0x00030047,0x00000068,0x00000000,0x00030047,0x0000006b,0x00000000,0x00030047,
0x0000006c,0x00000000,0x00030047,0x00000071,0x00000000,0x00030047,0x00000072,0x00000000,
0x00030047,0x00000077,0x00000000,0x00030047,0x00000078,0x00000000,0x00030047,0x00000079,
0x00000000,0x00030047,0x0000007d,0x00000000,0x00030047,0x0000007e,0x00000000,0x00030047,
0x00000080,0x00000000,0x00030047,0x00000081,0x00000000,0x00030047,0x00000083,0x00000000,
0x00030047,0x00000084,0x00000000,0x00030047,0x00000085,0x00000000,0x00030047,0x00000086,
0x00000000,0x00030047,0x00000088,0x00000000,0x00030047,0x00000089,0x00000000,0x00030047,
0x0000008b,0x00000000,0x00030047,0x0000008c,0x00000000,0x00030047,0x0000008d,0x00000000,
0x00030047,0x0000008e,0x00000000,0x00030047,0x00000090,0x00000000,0x00030047,0x00000091,
0x00000000,0x00030047,0x00000093,0x00000000,0x00030047,0x00000094,0x00000000,0x00030047,
0x00000096,0x00000000,0x00030047,0x00000097,0x00000000,0x00030047,0x00000098,0x00000000,
0x00030047,0x00000099,0x00000000,0x00030047,0x0000009b,0x00000000,0x00030047,0x0000009c,
0x00000000,0x00030047,0x0000009e,0x00000000,0x00030047,0x0000009f,0x00000000,0x00030047,
0x000000a0,0x00000000,0x00030047,0x000000a1,0x00000000,0x00030047,0x000000a3,0x00000000,
0x00030047,0x000000a4,0x00000000,0x00030047,0x000000a5,0x00000000,0x00030047,0x000000a6,
0x00000000,0x00030047,0x000000a7,0x00000000,0x00030047,0x000000a8,0x00000000,0x00030047,
0x000000a9,0x00000000,0x00030047,0x000000aa,0x00000000,0x00030047,0x000000ab,0x00000000,
0x00030047,0x000000ac,0x00000000,0x00030047,0x000000ad,0x00000000,0x00030047,0x000000ae,
0x00000000,0x00030047,0x000000af,0x00000000,0x00030047,0x000000b0,0x00000000,0x00030047,
0x000000b1,0x00000000,0x00030047,0x000000b2,0x00000000,0x00030047,0x000000b3,0x00000000,
0x00030047,0x000000b5,0x00000000,0x00030047,0x000000b6,0x00000000,0x00030047,0x000000b7,
0x00000000,0x00030047,0x000000b8,0x00000000,0x00030047,0x000000b9,0x00000000,0x00030047,
0x000000ba,0x00000000,0x00030047,0x000000bb,0x00000000,0x00030047,0x000000bc,0x00000000,
0x00030047,0x000000bd,0x00000000,0x00030047,0x000000be,0x00000000,0x00030047,0x000000bf,
0x00000000,0x00030047,0x000000c0,0x00000000,0x00030047,0x000000c1,0x00000000,0x00030047,
0x000000c2,0x00000000,0x00030047,0x000000c3,0x00000000,0x00030047,0x000000c4,0x00000000,
0x00030047,0x000000c5,0x00000000,0x00030047,0x000000c6,0x00000000,0x00030047,0x000000c7,
0x00000000,0x00030047,0x000000c8,0x00000000,0x00030047,0x000000c9,0x00000000,0x00030047,
0x000000ca,0x00000000,0x00030047,0x000000cb,0x00000000,0x00030047,0x000000cc,0x00000000,
0x00030047,0x000000cd,0x00000000,0x00030047,0x000000ce,0x00000000,0x00030047,0x000000cf,
0x00000000,0x00030047,0x000000d1,0x00000000,0x00040047,0x000000d1,0x0000001e,0x00000000,
0x00030047,0x000000d2,0x00000000,0x00030047,0x000000d3,0x00000000,0x00030047,0x000000d4,
0x00000000,0x00030047,0x000000d5,0x00000000,0x00030047,0x000000d6,0x00000000,0x00020013,
0x00000002,0x00030021,0x00000003,0x00000002,0x00040015,0x00000006,0x00000020,0x00000001,
0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,
0x00030016,0x00000009,0x00000020,0x00040017,0x0000000a,0x00000009,0x00000003,0x00040021,
0x0000000b,0x0000000a,0x00000008,0x00040020,0x0000000f,0x00000007,0x00000009,0x00060021,
0x00000010,0x00000009,0x0000000f,0x0000000f,0x0000000f,0x00040017,0x0000001b,0x00000009,
0x00000002,0x00040020,0x0000001c,0x00000007,0x0000001b,0x0004002b,0x00000009,0x00000020,
0x3f000000,0x00040017,0x00000023,0x00000009,0x00000004,0x0005001e,0x00000024,0x00000023,
0x0000001b,0x00000009,0x00040020,0x00000025,0x00000009,0x00000024,0x0004003b,0x00000025,
0x00000026,0x00000009,0x0004002b,0x00000006,0x00000027,0x00000001,0x00040020,0x00000028,
0x00000009,0x0000001b,0x00090019,0x0000002c,0x00000009,0x00000001,0x00000000,0x00000000,
0x00000000,0x00000001,0x00000000,0x0003001b,0x0000002d,0x0000002c,0x00040020,0x0000002e,
0x00000000,0x0000002d,0x0004003b,0x0000002e,0x0000002f,0x00000000,0x0004002b,0x00000009,
0x00000032,0x00000000,0x00040020,0x00000046,0x00000001,0x0000001b,0x0004003b,0x00000046,
0x00000047,0x00000001,0x0004002b,0x00000009,0x0000004e,0xbf800000,0x0004002b,0x00000009,
0x0000004f,0x41000000,0x0004002b,0x00000009,0x00000050,0x40a00000,0x0004002b,0x00000006,
0x00000051,0x00000002,0x00040020,0x00000052,0x00000009,0x00000009,0x0004002b,0x00000009,
0x00000055,0x3f800000,0x00040020,0x00000059,0x00000007,0x0000000a,0x0004002b,0x00000006,
0x0000005c,0x00000000,0x0004002b,0x00000006,0x0000005d,0xffffffff,0x0005002c,0x00000007,
0x0000005e,0x0000005c,0x0000005d,0x0005002c,0x00000007,0x00000064,0x0000005d,0x0000005c,
0x0005002c,0x00000007,0x0000006e,0x00000027,0x0000005c,0x0005002c,0x00000007,0x00000074,
0x0000005c,0x00000027,0x00040015,0x0000007a,0x00000020,0x00000000,0x0004002b,0x0000007a,
0x0000007b,0x00000001,0x0004002b,0x00000009,0x000000a2,0x3a800000,0x0004002b,0x00000009,
0x000000b4,0x40800000,0x00040020,0x000000d0,0x00000003,0x00000023,0x0004003b,0x000000d0,
0x000000d1,0x00000003,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,
0x00000005,0x0004003b,0x00000008,0x00000045,0x00000007,0x0004003b,0x0000000f,0x0000004d,
0x00000007,0x0004003b,0x00000059,0x0000005a,0x00000007,0x0004003b,0x00000008,0x00000060,
0x00000007,0x0004003b,0x00000059,0x00000062,0x00000007,0x0004003b,0x00000008,0x00000066,
0x00000007,0x0004003b,0x00000059,0x00000068,0x00000007,0x0004003b,0x00000008,0x00000069,
0x00000007,0x0004003b,0x00000059,0x0000006c,0x00000007,0x0004003b,0x00000008,0x00000070,
0x00000007,0x0004003b,0x00000059,0x00000072,0x00000007,0x0004003b,0x00000008,0x00000076,
0x00000007,0x0004003b,0x0000000f,0x00000078,0x00000007,0x0004003b,0x0000000f,0x00000079,
0x00000007,0x0004003b,0x0000000f,0x0000007e,0x00000007,0x0004003b,0x0000000f,0x00000081,
0x00000007,0x0004003b,0x0000000f,0x00000085,0x00000007,0x0004003b,0x0000000f,0x00000086,
0x00000007,0x0004003b,0x0000000f,0x00000089,0x00000007,0x0004003b,0x0000000f,0x0000008d,
0x00000007,0x0004003b,0x0000000f,0x0000008e,0x00000007,0x0004003b,0x0000000f,0x00000091,
0x00000007,0x0004003b,0x0000000f,0x00000094,0x00000007,0x0004003b,0x0000000f,0x00000098,
0x00000007,0x0004003b,0x0000000f,0x00000099,0x00000007,0x0004003b,0x0000000f,0x0000009c,
0x00000007,0x0004003b,0x0000000f,0x000000a0,0x00000007,0x0004003b,0x0000000f,0x000000a5,
0x00000007,0x0004003b,0x0000000f,0x000000af,0x00000007,0x0004003b,0x0000000f,0x000000b3,
0x00000007,0x0004003b,0x00000059,0x000000b9,0x00000007,0x0004003d,0x0000001b,0x00000048,
0x00000047,0x00050041,0x00000028,0x00000049,0x00000026,0x00000027,0x0004003d,0x0000001b,
0x0000004a,0x00000049,0x00050085,0x0000001b,0x0000004b,0x00000048,0x0000004a,0x0004006e,
0x00000007,0x0000004c,0x0000004b,0x0003003e,0x00000045,0x0000004c,0x00050041,0x00000052,
0x00000053,0x00000026,0x00000051,0x0004003d,0x00000009,0x00000054,0x00000053,0x0008000c,
0x00000009,0x00000056,0x00000001,0x0000002b,0x00000054,0x00000032,0x00000055,0x0008000c,
0x00000009,0x00000057,0x00000001,0x0000002e,0x0000004f,0x00000050,0x00000056,0x00050088,
0x00000009,0x00000058,0x0000004e,0x00000057,0x0003003e,0x0000004d,0x00000058,0x0004003d,
0x00000007,0x0000005b,0x00000045,0x00050080,0x00000007,0x0000005f,0x0000005b,0x0000005e,
0x0003003e,0x00000060,0x0000005f,0x00050039,0x0000000a,0x00000061,0x0000000d,0x00000060,
0x0003003e,0x0000005a,0x00000061,0x0004003d,0x00000007,0x00000063,0x00000045,0x00050080,
0x00000007,0x00000065,0x00000063,0x00000064,0x0003003e,0x00000066,0x00000065,0x00050039,
0x0000000a,0x00000067,0x0000000d,0x00000066,0x0003003e,0x00000062,0x00000067,0x0004003d,
0x00000007,0x0000006a,0x00000045,0x0003003e,0x00000069,0x0000006a,0x00050039,0x0000000a,
0x0000006b,0x0000000d,0x00000069,0x0003003e,0x00000068,0x0000006b,0x0004003d,0x00000007,
0x0000006d,0x00000045,0x00050080,0x00000007,0x0000006f,0x0000006d,0x0000006e,0x0003003e,
0x00000070,0x0000006f,0x00050039,0x0000000a,0x00000071,0x0000000d,0x00000070,0x0003003e,
0x0000006c,0x00000071,0x0004003d,0x00000007,0x00000073,0x00000045,0x00050080,0x00000007,
0x00000075,0x00000073,0x00000074,0x0003003e,0x00000076,0x00000075,0x00050039,0x0000000a,
0x00000077,0x0000000d,0x00000076,0x0003003e,0x00000072,0x00000077,0x00050041,0x0000000f,
0x0000007c,0x00000062,0x0000007b,0x0004003d,0x00000009,0x0000007d,0x0000007c,0x0003003e,
0x00000079,0x0000007d,0x00050041,0x0000000f,0x0000007f,0x00000068,0x0000007b,0x0004003d,
0x00000009,0x00000080,0x0000007f,0x0003003e,0x0000007e,0x00000080,0x00050041,0x0000000f,
0x00000082,0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000083,0x00000082,0x0003003e,
0x00000081,0x00000083,0x00070039,0x00000009,0x00000084,0x00000014,0x00000079,0x0000007e,
0x00000081,0x0003003e,0x00000085,0x00000084,0x00050041,0x0000000f,0x00000087,0x0000005a,
0x0000007b,0x0004003d,0x00000009,0x00000088,0x00000087,0x0003003e,0x00000086,0x00000088,
0x00050041,0x0000000f,0x0000008a,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000008b,
0x0000008a,0x0003003e,0x00000089,0x0000008b,0x00070039,0x00000009,0x0000008c,0x00000014,
0x00000085,0x00000086,0x00000089,0x0003003e,0x00000078,0x0000008c,0x00050041,0x0000000f,
0x0000008f,0x00000062,0x0000007b,0x0004003d,0x00000009,0x00000090,0x0000008f,0x0003003e,
0x0000008e,0x00000090,0x00050041,0x0000000f,0x00000092,0x00000068,0x0000007b,0x0004003d,
0x00000009,0x00000093,0x00000092,0x0003003e,0x00000091,0x00000093,0x00050041,0x0000000f,
0x00000095,0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000096,0x00000095,0x0003003e,
0x00000094,0x00000096,0x00070039,0x00000009,0x00000097,0x00000019,0x0000008e,0x00000091,
0x00000094,0x0003003e,0x00000098,0x00000097,0x00050041,0x0000000f,0x0000009a,0x0000005a,
0x0000007b,0x0004003d,0x00000009,0x0000009b,0x0000009a,0x0003003e,0x00000099,0x0000009b,
0x00050041,0x0000000f,0x0000009d,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000009e,
0x0000009d,0x0003003e,0x0000009c,0x0000009e,0x00070039,0x00000009,0x0000009f,0x00000019,
0x00000098,0x00000099,0x0000009c,0x0003003e,0x0000008d,0x0000009f,0x0004003d,0x00000009,
0x000000a1,0x0000008d,0x0007000c,0x00000009,0x000000a3,0x00000001,0x00000028,0x000000a1,
0x000000a2,0x00050088,0x00000009,0x000000a4,0x00000055,0x000000a3,0x0003003e,0x000000a0,
0x000000a4,0x0004003d,0x00000009,0x000000a6,0x00000078,0x0004003d,0x00000009,0x000000a7,
0x0000008d,0x00050083,0x00000009,0x000000a8,0x00000055,0x000000a7,0x0007000c,0x00000009,
0x000000a9,0x00000001,0x00000025,0x000000a6,0x000000a8,0x0004003d,0x00000009,0x000000aa,
0x000000a0,0x00050085,0x00000009,0x000000ab,0x000000a9,0x000000aa,0x0008000c,0x00000009,
0x000000ac,0x00000001,0x0000002b,0x000000ab,0x00000032,0x00000055,0x0003003e,0x000000a5,
0x000000ac,0x0004003d,0x00000009,0x000000ad,0x000000a5,0x0006000c,0x00000009,0x000000ae,
0x00000001,0x0000001f,0x000000ad,0x0003003e,0x000000a5,0x000000ae,0x0004003d,0x00000009,
0x000000b0,0x000000a5,0x0004003d,0x00000009,0x000000b1,0x0000004d,0x00050085,0x00000009,
0x000000b2,0x000000b0,0x000000b1,0x0003003e,0x000000af,0x000000b2,0x0004003d,0x00000009,
0x000000b5,0x000000af,0x00050085,0x00000009,0x000000b6,0x000000b4,0x000000b5,0x00050081,
0x00000009,0x000000b7,0x00000055,0x000000b6,0x00050088,0x00000009,0x000000b8,0x00000055,
0x000000b7,0x0003003e,0x000000b3,0x000000b8,0x0004003d,0x0000000a,0x000000ba,0x0000005a,
0x0004003d,0x00000009,0x000000bb,0x000000af,0x0005008e,0x0000000a,0x000000bc,0x000000ba,
0x000000bb,0x0004003d,0x0000000a,0x000000bd,0x00000062,0x0004003d,0x00000009,0x000000be,
0x000000af,0x0005008e,0x0000000a,0x000000bf,0x000000bd,0x000000be,0x00050081,0x0000000a,
0x000000c0,0x000000bc,0x000000bf,0x0004003d,0x0000000a,0x000000c1,0x0000006c,0x0004003d,
0x00000009,0x000000c2,0x000000af,0x0005008e,0x0000000a,0x000000c3,0x000000c1,0x000000c2,
0x00050081,0x0000000a,0x000000c4,0x000000c0,0x000000c3,0x0004003d,0x0000000a,0x000000c5,
0x00000072,0x0004003d,0x00000009,0x000000c6,0x000000af,0x0005008e,0x0000000a,0x000000c7,
0x000000c5,0x000000c6,0x00050081,0x0000000a,0x000000c8,0x000000c4,0x000000c7,0x0004003d,
0x0000000a,0x000000c9,0x00000068,0x00050081,0x0000000a,0x000000ca,0x000000c8,0x000000c9,
0x0004003d,0x00000009,0x000000cb,0x000000b3,0x0005008e,0x0000000a,0x000000cc,0x000000ca,
0x000000cb,0x00060050,0x0000000a,0x000000cd,0x00000032,0x00000032,0x00000032,0x00060050,
0x0000000a,0x000000ce,0x00000055,0x00000055,0x00000055,0x0008000c,0x0000000a,0x000000cf,
0x00000001,0x0000002b,0x000000cc,0x000000cd,0x000000ce,0x0003003e,0x000000b9,0x000000cf,
0x0004003d,0x0000000a,0x000000d2,0x000000b9,0x00050051,0x00000009,0x000000d3,0x000000d2,
0x00000000,0x00050051,0x00000009,0x000000d4,0x000000d2,0x00000001,0x00050051,0x00000009,
0x000000d5,0x000000d2,0x00000002,0x00070050,0x00000023,0x000000d6,0x000000d3,0x000000d4,
0x000000d5,0x00000055,0x0003003e,0x000000d1,0x000000d6,0x000100fd,0x00010038,0x00050036,
0x0000000a,0x0000000d,0x00000000,0x0000000b,0x00030037,0x00000008,0x0000000c,0x000200f8,
0x0000000e,0x0004003b,0x0000001c,0x0000001d,0x00000007,0x0004003d,0x00000007,0x0000001e,
0x0000000c,0x0004006f,0x0000001b,0x0000001f,0x0000001e,0x00050050,0x0000001b,0x00000021,
0x00000020,0x00000020,0x00050081,0x0000001b,0x00000022,0x0000001f,0x00000021,0x00050041,
0x00000028,0x00000029,0x00000026,0x00000027,0x0004003d,0x0000001b,0x0000002a,0x00000029,
0x00050088,0x0000001b,0x0000002b,0x00000022,0x0000002a,0x0003003e,0x0000001d,0x0000002b,
0x0004003d,0x0000002d,0x00000030,0x0000002f,0x0004003d,0x0000001b,0x00000031,0x0000001d,
0x00070058,0x00000023,0x00000033,0x00000030,0x00000031,0x00000002,0x00000032,0x0008004f,
0x0000000a,0x00000034,0x00000033,0x00000033,0x00000000,0x00000001,0x00000002,0x000200fe,
0x00000034,0x00010038,0x00050036,0x00000009,0x00000014,0x00000000,0x00000010,0x00030037,
0x0000000f,0x00000011,0x00030037,0x0000000f,0x00000012,0x00030037,0x0000000f,0x00000013,
0x000200f8,0x00000015,0x0004003d,0x00000009,0x00000037,0x00000011,0x0004003d,0x00000009,
0x00000038,0x00000012,0x0004003d,0x00000009,0x00000039,0x00000013,0x0007000c,0x00000009,
0x0000003a,0x00000001,0x00000025,0x00000038,0x00000039,0x0007000c,0x00000009,0x0000003b,
0x00000001,0x00000025,0x00000037,0x0000003a,0x000200fe,0x0000003b,0x00010038,0x00050036,
0x00000009,0x00000019,0x00000000,0x00000010,0x00030037,0x0000000f,0x00000016,0x00030037,
0x0000000f,0x00000017,0x00030037,0x0000000f,0x00000018,0x000200f8,0x0000001a,0x0004003d,
0x00000009,0x0000003e,0x00000016,0x0004003d,0x00000009,0x0000003f,0x00000017,0x0004003d,
0x00000009,0x00000040,0x00000018,0x0007000c,0x00000009,0x00000041,0x00000001,0x00000028,
0x0000003f,0x00000040,0x0007000c,0x00000009,0x00000042,0x00000001,0x00000028,0x0000003e,
0x00000041,0x000200fe,0x00000042,0x00010038
};
@@ -7,6 +7,7 @@
#include "droiddeck-ahb-v1-server-protocol.h"
#include <android/hardware_buffer.h>
#include <errno.h>
#include <linux/sync_file.h>
#include <fcntl.h>
#include <poll.h>
#include <pthread.h>
@@ -145,6 +146,12 @@ static void handle_released(uint64_t id, int fd) {
if (poll(&p, 1, 0) > 0) {
close(fd);
} else {
if (ab->fence_src) {
struct sync_merge_data m = {.name = "droiddeck-release", .fd2 = fd};
if (ioctl(ab->fence_fd, SYNC_IOC_MERGE, &m) == 0) { close(fd); fd = m.fence; }
wl_event_source_remove(ab->fence_src);
close(ab->fence_fd);
}
ab->fence_fd = fd;
ab->fence_src = wl_event_loop_add_fd(g_loop, fd, WL_EVENT_READABLE, on_fence_readable, ab);
if (!ab->fence_src) { close(fd); ab->fence_fd = -1; }
@@ -152,6 +159,7 @@ static void handle_released(uint64_t id, int fd) {
}
}
}
if (ab->fence_src) return;
send_deferred_release(ab);
maybe_free(ab);
}
@@ -197,15 +205,19 @@ int ahb_swapchain_present(struct dmabuf_buffer *b, struct surface *s, int scene_
struct droiddeck_dma_buf_sync_file exp = {.flags = DROIDDECK_DMA_BUF_SYNC_READ, .fd = -1};
if (dmabuf_fd >= 0 && ioctl(dmabuf_fd, DROIDDECK_DMA_BUF_IOCTL_EXPORT_SYNC_FILE, &exp) == 0 && exp.fd >= 0) {
acquire = exp.fd;
} else if (dmabuf_fd >= 0) {
} else {
if (!g_export_failed_logged) {
g_export_failed_logged = 1;
droiddeck_log("layer", "zero-copy: DMA_BUF_IOCTL_EXPORT_SYNC_FILE failed (%s): waiting for each frame on the CPU instead",
strerror(errno));
droiddeck_log("layer", "zero-copy: no acquire fence from the game's dma-buf (%s): %s",
dmabuf_fd >= 0 ? strerror(errno) : "no dma-buf fd",
draw ? "its frames are copied instead" : "it cannot be copied, so each frame is waited for on the CPU");
}
struct pollfd p = {.fd = dmabuf_fd, .events = POLLIN};
int r;
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
if (dmabuf_fd >= 0) {
struct pollfd p = {.fd = dmabuf_fd, .events = POLLIN};
int r;
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
}
if (draw) return -1;
}
int r = sc_layer_present_ahb(ab->ahb, ab->w, ab->h, acquire, (void *)(uintptr_t)ab->id, scene_w, scene_h, draw,
s ? droiddeck_surface_color(s) : NULL, ab->format);
+223 -16
View File
@@ -2272,6 +2272,69 @@ static void bind_output(struct wl_client *c, void *data, uint32_t ver, uint32_t
struct draw_list { struct vkp_draw *d; int n, cap; };
#define ZERO_COPY_FALLBACK_SIGNATURES 32u
enum zero_copy_fallback_reason {
ZERO_COPY_NO_SURFACE_BUFFER = 1,
ZERO_COPY_NO_GRALLOC_AHB = 2,
ZERO_COPY_AHB_PRESENT_FAILED = 3
};
struct zero_copy_fallback_signature {
uint32_t reason, format, stride, offset;
int width, height;
uint64_t modifier;
};
static struct zero_copy_fallback_signature g_zero_copy_fallbacks[ZERO_COPY_FALLBACK_SIGNATURES];
static uint32_t g_zero_copy_fallback_count;
static int g_zero_copy_fallback_limit_logged;
static int zero_copy_fallback_should_log(const struct dmabuf_buffer *b, uint32_t reason) {
const struct zero_copy_fallback_signature key = {
.reason = reason, .format = b ? b->format : 0,
.stride = b && b->n_planes ? b->stride[0] : 0,
.offset = b && b->n_planes ? b->offset[0] : 0,
.width = b ? b->width : 0, .height = b ? b->height : 0,
.modifier = b ? b->modifier : 0};
for (uint32_t i = 0; i < g_zero_copy_fallback_count; i++) {
const struct zero_copy_fallback_signature *seen = &g_zero_copy_fallbacks[i];
if (seen->reason == key.reason && seen->format == key.format && seen->stride == key.stride &&
seen->offset == key.offset && seen->width == key.width && seen->height == key.height &&
seen->modifier == key.modifier)
return 0;
}
if (g_zero_copy_fallback_count >= ZERO_COPY_FALLBACK_SIGNATURES) {
if (!g_zero_copy_fallback_limit_logged) {
g_zero_copy_fallback_limit_logged = 1;
droiddeck_log("layer", "zero-copy: further fallback diagnostics suppressed after %u distinct buffer signatures",
ZERO_COPY_FALLBACK_SIGNATURES);
}
return 0;
}
g_zero_copy_fallbacks[g_zero_copy_fallback_count++] = key;
return 1;
}
static void note_zero_copy_fallback(struct surface *s, const struct dmabuf_buffer *b, uint32_t reason,
int scene_w, int scene_h, int present_result) {
if (!zero_copy_fallback_should_log(b, reason)) return;
char name[160] = "unknown surface";
if (s) describe(s, name, sizeof(name));
if (reason == ZERO_COPY_NO_SURFACE_BUFFER) {
droiddeck_log("layer", "zero-copy: layer candidate %s has no associated Wayland surface buffer; using the layer-copy path",
name);
} else {
droiddeck_log("layer", "zero-copy: %s buffer %c%c%c%c %dx%d stride %u offset %u modifier 0x%llx %s; "
"scene %dx%d will use the layer-copy path (direct-present result %d)",
name, b->format & 0xff, (b->format >> 8) & 0xff, (b->format >> 16) & 0xff,
(b->format >> 24) & 0xff, b->width, b->height,
b->n_planes ? b->stride[0] : 0, b->n_planes ? b->offset[0] : 0,
(unsigned long long)b->modifier,
reason == ZERO_COPY_NO_GRALLOC_AHB
? "has no registered gralloc AHardwareBuffer"
: "has a registered gralloc AHardwareBuffer but direct presentation failed",
scene_w, scene_h, present_result);
}
}
static int add_cursor(struct draw_list *dl, int scene_w);
static struct vkp_image *surface_image(struct surface *s) {
@@ -2391,17 +2454,53 @@ static int black_fill_below(const struct draw_list *dl, int n) {
return 1;
}
#define LAYER_CANDIDATE_DIAGNOSTICS 32u
static unsigned g_layer_candidate_diag_count;
static int g_layer_candidate_diag_limit;
static void note_layer_candidate_skip(const struct vkp_draw *d, int index, int reason,
int scene_w, int scene_h) {
static int seen[LAYER_CANDIDATE_DIAGNOSTICS][8];
const int key[8] = {index, reason, scene_w, scene_h, d->dx, d->dy, d->dw, d->dh};
for (unsigned i = 0; i < g_layer_candidate_diag_count; i++)
if (!memcmp(seen[i], key, sizeof(key))) return;
if (g_layer_candidate_diag_count >= LAYER_CANDIDATE_DIAGNOSTICS) {
if (!g_layer_candidate_diag_limit++) droiddeck_log("layer", "zero-copy: further candidate-rejection details suppressed after %u signatures",
LAYER_CANDIDATE_DIAGNOSTICS);
return;
}
memcpy(seen[g_layer_candidate_diag_count++], key, sizeof(key));
const char *why = reason == 1 ? "translucent draw" :
reason == 2 ? "image is not DMA-BUF" :
reason == 3 ? "source rectangle is outside/invalid" :
reason == 4 ? "draw rectangle is outside scene or invalid" :
"not fullscreen and no black backing below";
droiddeck_log("layer", "zero-copy: candidate draw %d rejected: %s; scene %dx%d, dst %dx%d at %d,%d, src %.2f,%.2f %.2fx%.2f, image %dx%d",
index, why, scene_w, scene_h, d->dw, d->dh, d->dx, d->dy,
d->sx, d->sy, d->sw, d->sh, vkp_image_width(d->img), vkp_image_height(d->img));
}
static int layer_candidate(const struct draw_list *dl, int scene_w, int scene_h) {
for (int i = dl->n - 1; i >= 0 && i >= dl->n - 2; i--) {
const struct vkp_draw *d = &dl->d[i];
if (d->blend) continue;
if (!vkp_image_is_dmabuf(d->img)) continue;
if (d->blend) { note_layer_candidate_skip(d, i, 1, scene_w, scene_h); continue; }
if (!vkp_image_is_dmabuf(d->img)) { note_layer_candidate_skip(d, i, 2, scene_w, scene_h); continue; }
if (d->sx < 0 || d->sy < 0 || d->sw < 1.0f || d->sh < 1.0f ||
d->sx + d->sw >= vkp_image_width(d->img) + 1.0f ||
d->sy + d->sh >= vkp_image_height(d->img) + 1.0f) continue;
d->sy + d->sh >= vkp_image_height(d->img) + 1.0f) {
note_layer_candidate_skip(d, i, 3, scene_w, scene_h);
continue;
}
if (d->dx == 0 && d->dy == 0 && d->dw == scene_w && d->dh == scene_h) return i;
if (d->dx < 0 || d->dy < 0 || d->dw <= 0 || d->dh <= 0 || d->dx + d->dw > scene_w ||
d->dy + d->dh > scene_h || !black_fill_below(dl, i)) continue;
d->dy + d->dh > scene_h) {
note_layer_candidate_skip(d, i, 4, scene_w, scene_h);
continue;
}
if (!black_fill_below(dl, i)) {
note_layer_candidate_skip(d, i, 5, scene_w, scene_h);
continue;
}
return i;
}
return -1;
@@ -2422,6 +2521,56 @@ static void note_copy_scene(const struct draw_list *dl, int scene_w, int scene_h
vkp_image_is_dmabuf(t->img) ? "GPU" : "memory", t->blend ? ", translucent" : "");
}
static struct surface *surface_for_image(const struct vkp_image *img);
static void note_layer_candidate_rejected(const struct draw_list *dl, int scene_w, int scene_h) {
static int seen[32][14];
static unsigned seen_count;
static int limit_logged;
static time_t window_start;
struct timespec now_ts;
const struct vkp_draw *a = dl->n > 0 ? &dl->d[dl->n - 1] : NULL;
const struct vkp_draw *b = dl->n > 1 ? &dl->d[dl->n - 2] : NULL;
struct surface *sa = a ? surface_for_image(a->img) : NULL;
struct surface *sb = b ? surface_for_image(b->img) : NULL;
const int signature[14] = {
dl->n, scene_w, scene_h,
a ? a->dw : 0, a ? a->dh : 0,
a ? vkp_image_width(a->img) : 0, a ? vkp_image_height(a->img) : 0,
a ? vkp_image_is_dmabuf(a->img) : 0, a ? a->blend : 0, sa && sa->dmabuf_buf ? 1 : 0,
b ? b->dw : 0, b ? b->dh : 0, b ? vkp_image_is_dmabuf(b->img) : 0, sb && sb->dmabuf_buf ? 1 : 0
};
clock_gettime(CLOCK_MONOTONIC, &now_ts);
if (!window_start || now_ts.tv_sec - window_start >= 30) {
seen_count = 0;
limit_logged = 0;
window_start = now_ts.tv_sec;
}
for (unsigned i = 0; i < seen_count; i++)
if (!memcmp(signature, seen[i], sizeof(signature))) return;
if (seen_count >= 32) {
if (!limit_logged++) droiddeck_log("layer", "zero-copy: further fullscreen-candidate rejection details suppressed after 32 signatures in 30 seconds");
return;
}
memcpy(seen[seen_count++], signature, sizeof(signature));
char below[48];
if (b)
snprintf(below, sizeof(below), "%s %dx%d",
vkp_image_is_dmabuf(b->img) ? "DMA-BUF" : "non-DMA-BUF", b->dw, b->dh);
else
snprintf(below, sizeof(below), "none");
droiddeck_log("layer", "zero-copy: no eligible fullscreen DMA-BUF layer candidate: scene %dx%d, %d draws; "
"top draw %dx%d at %d,%d image %dx%d %s%s surface=%s dmabuf=%s; "
"draw below %s",
scene_w, scene_h, dl->n, a ? a->dw : 0, a ? a->dh : 0, a ? a->dx : 0, a ? a->dy : 0,
a ? vkp_image_width(a->img) : 0, a ? vkp_image_height(a->img) : 0,
a && vkp_image_is_dmabuf(a->img) ? "DMA-BUF" : "non-DMA-BUF",
a && a->blend ? " blended" : "",
sa ? "associated" : "unassociated",
sa && sa->dmabuf_buf ? "yes" : "no",
below);
}
static struct surface *surface_for_image(const struct vkp_image *img) {
struct surface *s;
wl_list_for_each(s, &g_surfaces, link)
@@ -2430,16 +2579,56 @@ static struct surface *surface_for_image(const struct vkp_image *img) {
}
static struct surface *ahb_layer_only_candidate(int scene_w, int scene_h) {
static struct {
const struct surface *surface;
int reason, scene_w, scene_h, w, h, buf_w, buf_h, x, y, src_set, dst_set, children;
} seen[32];
static unsigned seen_count;
static int limit_logged;
struct surface *s;
int w, h;
int w = 0, h = 0, reason = 0;
if (wl_list_empty(&g_toplevels)) return NULL;
s = wl_container_of(g_toplevels.prev, s, toplevel_link);
if (!s->dmabuf_buf || s->dmabuf_buf->img || !ahb_swapchain_has_ahb(s->dmabuf_buf)) return NULL;
if ((g_desktop && !s->placed) || s->x != 0 || s->y != 0 || s->src_set || s->dst_set) return NULL;
if (!wl_list_empty(&s->children)) return NULL;
if (g_hide_shell && !strcmp(client_name(wl_resource_get_client(s->resource)), "explorer.exe")) return NULL;
if (!s->dmabuf_buf) reason = 1;
else if (s->dmabuf_buf->img) reason = 2;
else if (!ahb_swapchain_has_ahb(s->dmabuf_buf)) reason = 3;
else if ((g_desktop && !s->placed) || s->x != 0 || s->y != 0 || s->src_set || s->dst_set) reason = 4;
else if (!wl_list_empty(&s->children)) reason = 5;
else if (g_hide_shell && !strcmp(client_name(wl_resource_get_client(s->resource)), "explorer.exe")) reason = 6;
surface_size(s, &w, &h);
if (w != scene_w || h != scene_h || s->buf_w != scene_w || s->buf_h != scene_h) return NULL;
if (!reason && (w != scene_w || h != scene_h || s->buf_w != scene_w || s->buf_h != scene_h)) reason = 7;
if (reason) {
int found = 0;
for (unsigned i = 0; i < seen_count; i++) {
if (seen[i].surface == s && seen[i].reason == reason && seen[i].scene_w == scene_w &&
seen[i].scene_h == scene_h && seen[i].w == w && seen[i].h == h &&
seen[i].buf_w == s->buf_w && seen[i].buf_h == s->buf_h && seen[i].x == s->x &&
seen[i].y == s->y && seen[i].src_set == s->src_set && seen[i].dst_set == s->dst_set &&
seen[i].children == !wl_list_empty(&s->children)) { found = 1; break; }
}
if (!found && seen_count < 32) {
seen[seen_count].surface = s; seen[seen_count].reason = reason;
seen[seen_count].scene_w = scene_w; seen[seen_count].scene_h = scene_h;
seen[seen_count].w = w; seen[seen_count].h = h; seen[seen_count].buf_w = s->buf_w; seen[seen_count].buf_h = s->buf_h;
seen[seen_count].x = s->x; seen[seen_count].y = s->y; seen[seen_count].src_set = s->src_set;
seen[seen_count].dst_set = s->dst_set; seen[seen_count].children = !wl_list_empty(&s->children);
seen_count++;
const char *why = reason == 1 ? "no DMA-BUF buffer" :
reason == 2 ? "buffer is already importable by Vulkan" :
reason == 3 ? "no registered gralloc AHardwareBuffer" :
reason == 4 ? "surface is positioned/cropped/scaled" :
reason == 5 ? "surface has child surfaces" :
reason == 6 ? "hidden shell surface" : "surface or buffer dimensions differ from scene";
char name[160]; describe(s, name, sizeof(name));
droiddeck_log("layer", "zero-copy: AHardwareBuffer-only candidate rejected: %s; %s, scene %dx%d, surface %dx%d at %d,%d, buffer %dx%d, crop=%d destination=%d children=%d",
why, name, scene_w, scene_h, w, h, s->x, s->y, s->buf_w, s->buf_h,
s->src_set, s->dst_set, !wl_list_empty(&s->children));
} else if (!found && !limit_logged) {
limit_logged = 1;
droiddeck_log("layer", "zero-copy: further AHardwareBuffer-only candidate diagnostics suppressed after 32 signatures");
}
return NULL;
}
return s;
}
@@ -2882,7 +3071,10 @@ static void render_scene(void) {
struct surface *ls = li >= 0 ? surface_for_image(dl.d[li].img) : NULL;
const struct vkp_draw *ld = li >= 0 ? &dl.d[li] : NULL;
if (li < 0) ls = layer_only;
if (g_zero_copy && li < 0 && !ls && !blocked && !cardboard) note_copy_scene(&dl, w, h, cursor_on);
if (g_zero_copy && li < 0 && !ls && !blocked && !cardboard) {
if (!cursor_on && !bfi) note_layer_candidate_rejected(&dl, w, h);
note_copy_scene(&dl, w, h, cursor_on);
}
if (cardboard) ls = NULL;
if (cursor_on) ls = NULL;
if (bfi) ls = NULL;
@@ -2910,15 +3102,30 @@ static void render_scene(void) {
r = generated >= 0 ? 0 : -1;
else if (generated >= 0 && !(fx_on && li >= 0) && ls && ls->dmabuf_buf && ahb_swapchain_has_ahb(ls->dmabuf_buf))
r = ahb_swapchain_present(ls->dmabuf_buf, ls, w, h, ld);
if (!fg_pass && generated >= 0 && !fx_on && !framegen && r != 0) {
if (!ls || !ls->dmabuf_buf)
note_zero_copy_fallback(ls, NULL, ZERO_COPY_NO_SURFACE_BUFFER, w, h, r);
else if (!ahb_swapchain_has_ahb(ls->dmabuf_buf))
note_zero_copy_fallback(ls, ls->dmabuf_buf, ZERO_COPY_NO_GRALLOC_AHB, w, h, r);
else
note_zero_copy_fallback(ls, ls->dmabuf_buf, ZERO_COPY_AHB_PRESENT_FAILED, w, h, r);
}
if (r == 0 && !fg_pass) g_zero_copy_shown = ls;
else settle_unwaited();
if (!fg_pass && generated >= 0 && r != 0 && li >= 0)
r = fx_on ? sc_layer_present_pass(&dl.d[li], 1, w, h)
: sc_layer_present(dl.d[li].img, w, h, ld, ls ? droiddeck_surface_color(ls) : NULL);
int ov = 0, ov_done = 0;
if (!fg_pass && generated >= 0 && r != 0 && li >= 0) {
if (fx_on) {
r = sc_layer_present_pass(&dl.d[li], 1, w, h);
} else {
r = sc_layer_present(dl.d[li].img, w, h, ld, ls ? droiddeck_surface_color(ls) : NULL,
over == 1 ? &dl.d[li + 1] : NULL, &ov);
ov_done = 1;
}
}
if (r == 0) {
if (ls) ls->drawn = 1;
int go[8], ov = 0;
if (over == 1 && li >= 0 && vkp_map_draw(&dl.d[li + 1], go))
int go[8];
if (!ov_done && over == 1 && li >= 0 && vkp_map_draw(&dl.d[li + 1], go))
ov = sc_layer_present_overlay(dl.d[li + 1].img, go, dl.d[li + 1].blend) == 0 ? 1 : -1;
if (ov <= 0) sc_layer_hide_overlay();
if (ov < 0) {
@@ -62,8 +62,40 @@ struct entry {
static struct wl_list g_entries;
static struct wl_event_loop *g_loop;
static uint64_t g_next_id = 1;
static int g_refused_logged;
static int g_ubwc_promised;
#define DISPLAY_BUFFER_MISMATCH_SIGNATURES 64u
struct display_buffer_mismatch_signature {
uint32_t kind, format, stride, offset;
int width, height;
uint64_t modifier;
};
static struct display_buffer_mismatch_signature g_mismatch_signatures[DISPLAY_BUFFER_MISMATCH_SIGNATURES];
static uint32_t g_mismatch_signature_count;
static int g_mismatch_limit_logged;
static int mismatch_should_log(const struct dmabuf_buffer *b, uint32_t kind) {
const struct display_buffer_mismatch_signature key = {
.kind = kind, .format = b->format, .stride = b->stride[0], .offset = b->offset[0],
.width = b->width, .height = b->height, .modifier = b->modifier};
for (uint32_t i = 0; i < g_mismatch_signature_count; i++) {
const struct display_buffer_mismatch_signature *seen = &g_mismatch_signatures[i];
if (seen->kind == key.kind && seen->format == key.format && seen->stride == key.stride &&
seen->offset == key.offset && seen->width == key.width && seen->height == key.height &&
seen->modifier == key.modifier)
return 0;
}
if (g_mismatch_signature_count >= DISPLAY_BUFFER_MISMATCH_SIGNATURES) {
if (!g_mismatch_limit_logged) {
g_mismatch_limit_logged = 1;
droiddeck_log("layer", "display buffers: further mismatch diagnostics suppressed after %u distinct buffer signatures",
DISPLAY_BUFFER_MISMATCH_SIGNATURES);
}
return 0;
}
g_mismatch_signatures[g_mismatch_signature_count++] = key;
return 1;
}
static int g_ubwc_probed[2];
static uint32_t ahb_format_of(uint32_t drm, uint64_t modifier) {
@@ -238,16 +270,51 @@ static void handle_alloc(struct peer *p, const struct display_buffers_request *q
} else {
if (ahb) AHardwareBuffer_release(ahb);
fd = -1;
if (sized && wanted && (compressed || !g_refused_logged)) {
g_refused_logged = 1;
droiddeck_log(compressed ? "error" : "layer", "display buffers: no gralloc buffer matches pid %d's %ux%u "
"%c%c%c%c %s layout (stride %u bytes, pixels at %u, %llu bytes; gralloc's layout has pixels at "
"%llu, %llu bytes): %s", (int)p->pid, q->width, q->height,
q->format & 0xff, (q->format >> 8) & 0xff, (q->format >> 16) & 0xff, (q->format >> 24) & 0xff,
compressed ? "UBWC" : "linear", q->stride, q->offset, (unsigned long long)q->size,
(unsigned long long)(compressed ? ubwc_meta_size(q->width, q->height) : 0),
(unsigned long long)(compressed ? ubwc_size(q->width, q->height, q->stride) : q->size),
compressed ? "its compressed frames cannot be shown" : "its frames keep the copy path");
static struct {
pid_t pid;
uint32_t width, height, format, stride, offset, reason;
uint64_t size, modifier;
} refused[32];
static unsigned refused_count;
static int refused_limit_logged;
uint32_t reason = !sized ? 1u : !sane ? 2u : !wanted ? 3u :
!ahb_swapchain_advertised() ? 4u :
p->count >= DISPLAY_BUFFERS_MAX_PER_CLIENT ? 5u : 6u;
int seen = 0;
for (unsigned i = 0; i < refused_count; i++) {
if (refused[i].pid == p->pid && refused[i].width == q->width && refused[i].height == q->height &&
refused[i].format == q->format && refused[i].stride == q->stride && refused[i].offset == q->offset &&
refused[i].size == q->size && refused[i].modifier == q->modifier && refused[i].reason == reason) {
seen = 1;
break;
}
}
if (!seen && refused_count < 32) {
refused[refused_count].pid = p->pid;
refused[refused_count].width = q->width;
refused[refused_count].height = q->height;
refused[refused_count].format = q->format;
refused[refused_count].stride = q->stride;
refused[refused_count].offset = q->offset;
refused[refused_count].size = q->size;
refused[refused_count].modifier = q->modifier;
refused[refused_count].reason = reason;
refused_count++;
const char *why = reason == 1 ? "invalid dimensions, format, or stride" :
reason == 2 ? "size/offset/layout sanity check failed" :
reason == 3 ? "zero-copy or UBWC offering is disabled" :
reason == 4 ? "AHardwareBuffer swapchain is not advertised" :
reason == 5 ? "per-client allocation limit reached" :
"gralloc allocation/fd/size validation failed";
droiddeck_log(compressed ? "error" : "layer",
"display buffers: allocation refused for pid %d: %s; request %ux%u %c%c%c%c %s stride=%u offset=%u size=%llu modifier=0x%llx (client has %d allocations)",
(int)p->pid, why, q->width, q->height,
q->format & 0xff, (q->format >> 8) & 0xff, (q->format >> 16) & 0xff, (q->format >> 24) & 0xff,
compressed ? "UBWC" : "linear", q->stride, q->offset,
(unsigned long long)q->size, (unsigned long long)q->modifier, p->count);
} else if (!seen && !refused_limit_logged) {
refused_limit_logged = 1;
droiddeck_log("layer", "display buffers: further allocation-refusal diagnostics suppressed after 32 signatures");
}
}
if (reply(p, &r, fd) != 0 && e) entry_free(e);
@@ -299,9 +366,18 @@ static int on_listen(int fd, uint32_t mask, void *data) {
}
void display_buffers_match(struct wl_client *c, struct wl_resource *buffer, struct dmabuf_buffer *b) {
static int invalid_logged;
struct stat st;
struct entry *e;
if (!g_loop || wl_list_empty(&g_entries) || b->n_planes != 1 || b->offset[0] != 0 || fstat(b->fd[0], &st) != 0) return;
if (!g_loop || wl_list_empty(&g_entries)) return;
if (b->n_planes != 1 || b->offset[0] != 0 || fstat(b->fd[0], &st) != 0) {
if (!invalid_logged) {
invalid_logged = 1;
droiddeck_log("layer", "display buffers: cannot associate %s's DMA-BUF with gralloc (plane count %u; expected one plane at offset 0, or fstat failed)",
droiddeck_client_name(c), b->n_planes);
}
return;
}
wl_list_for_each(e, &g_entries, link) {
if (e->dev != st.st_dev || e->ino != st.st_ino) continue;
AHardwareBuffer_Desc d;
@@ -311,11 +387,27 @@ void display_buffers_match(struct wl_client *c, struct wl_resource *buffer, stru
(uint32_t)b->height == e->height
: (b->modifier == MOD_LINEAR || b->modifier == MOD_INVALID) &&
e->stride == b->stride[0];
if (laid_out && e->format == ahb_format_of(b->format, e->modifier) && b->width > 0 && b->height > 0 &&
(uint32_t)b->width <= d.width && (uint32_t)b->height <= d.height)
const uint32_t expected_format = ahb_format_of(b->format, e->modifier);
const int dimensions = b->width > 0 && b->height > 0 &&
(uint32_t)b->width <= d.width && (uint32_t)b->height <= d.height;
if (laid_out && e->format == expected_format && dimensions) {
ahb_swapchain_adopt(c, buffer, b, e->ahb, e->modifier);
} else if (mismatch_should_log(b, 2)) {
droiddeck_log("layer", "display buffers: gralloc DMA-BUF identity matched but layout was rejected for %s: %c%c%c%c %dx%d stride %u offset %u modifier 0x%llx; gralloc %ux%u stride %u format 0x%x, expected format 0x%x (layout %s, dimensions %s)",
droiddeck_client_name(c), b->format & 0xff, (b->format >> 8) & 0xff,
(b->format >> 16) & 0xff, (b->format >> 24) & 0xff, b->width, b->height,
b->stride[0], b->offset[0], (unsigned long long)b->modifier,
e->width, e->height, e->stride, e->format, expected_format,
laid_out ? "ok" : "mismatch", dimensions ? "ok" : "mismatch");
}
return;
}
if (mismatch_should_log(b, 1)) {
droiddeck_log("layer", "display buffers: no registered gralloc allocation matches %s's DMA-BUF identity: %c%c%c%c %dx%d stride %u offset %u modifier 0x%llx; imported normally, copy path only",
droiddeck_client_name(c), b->format & 0xff, (b->format >> 8) & 0xff,
(b->format >> 16) & 0xff, (b->format >> 24) & 0xff, b->width, b->height,
b->stride[0], b->offset[0], (unsigned long long)b->modifier);
}
}
void display_buffers_init(struct wl_display *display) {
+58 -14
View File
@@ -187,6 +187,8 @@ struct layer {
static struct layer g_layers[SC_LAYER_COUNT];
static void apply_frame_rate(ASurfaceTransaction *tx, struct layer *l);
static void coverage_text(const struct layer *l, char *out, size_t n);
static int overlay_slot(struct layer *l, struct vkp_image *src, int *idx, int *wait_fd);
static int overlay_shown(struct layer *l, int idx, const int geo[8], int translucent);
static int g_layers_ready;
static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
static int g_pending_cb;
@@ -721,9 +723,15 @@ static int layer_geometry(int w, int h, int scene_w, int scene_h, const struct v
static ARect g_game_src, g_game_dst;
static int g_game_geo_known;
static void note_game_geometry(const int r[8]) {
g_game_src = (ARect){r[0], r[1], r[2], r[3]};
g_game_dst = (ARect){r[4], r[5], r[6], r[7]};
g_game_geo_known = 1;
}
static void apply_geometry(ASurfaceTransaction *tx, struct layer *l, const int r[8]) {
ARect srcR = {r[0], r[1], r[2], r[3]}, dstR = {r[4], r[5], r[6], r[7]};
if (l == &g_layers[SC_LAYER_GAME]) { g_game_src = srcR; g_game_dst = dstR; g_game_geo_known = 1; }
if (l == &g_layers[SC_LAYER_GAME]) note_game_geometry(r);
if (!l->geo_valid || memcmp(&srcR, &l->geo_src, sizeof(srcR)) || memcmp(&dstR, &l->geo_dst, sizeof(dstR))) {
api.setGeometry(tx, l->sc, &srcR, &dstR, 0 );
l->geo_src = srcR; l->geo_dst = dstR; l->geo_valid = 1;
@@ -998,19 +1006,40 @@ unavailable:
}
int sc_layer_present(struct vkp_image *src, int scene_w, int scene_h, const struct vkp_draw *draw,
const struct droiddeck_color *color) {
const struct droiddeck_color *color, const struct vkp_draw *over, int *over_shown) {
struct layer *l = layer_of(SC_LAYER_GAME);
*over_shown = 0;
if (!src || ensure_sc(l) != 0) return -1;
int sw = vkp_image_width(src), sh = vkp_image_height(src);
int r[8];
int g = layer_geometry(sw, sh, scene_w, scene_h, draw, r);
if (g < 0) return -1;
if (g == 0) { sc_layer_hide(); return 0; }
int og[8];
if (over && !vkp_map_draw(over, og)) over = NULL;
if (g == 0) {
sc_layer_hide();
if (over) *over_shown = sc_layer_present_overlay(over->img, og, over->blend) == 0 ? 1 : -1;
return 0;
}
int wait_fd;
int idx = take_free_slot(l, sw, sh, AHB_RGBA8, &wait_fd);
if (idx < 0) { log_drop(l); return g_alloc_failed ? -1 : 0; }
if (vkp_blit_image(src, l->slots[idx].img, wait_fd) != 0) return -1;
struct vkp_blit blits[2] = {{.src = src, .wait_fd = -1}, {.src = over ? over->img : NULL, .wait_fd = -1}};
int idx = take_free_slot(l, sw, sh, AHB_RGBA8, &blits[0].wait_fd);
if (idx < 0) {
log_drop(l);
if (g_alloc_failed) return -1;
if (over) *over_shown = sc_layer_present_overlay(over->img, og, over->blend) == 0 ? 1 : -1;
return 0;
}
blits[0].dst = l->slots[idx].img;
struct layer *ol = layer_of(SC_LAYER_OVERLAY);
int over_idx = -1;
if (over) {
note_game_geometry(r);
const int taken = overlay_slot(ol, over->img, &over_idx, &blits[1].wait_fd);
*over_shown = taken < 0 ? -1 : 1;
if (taken > 0) blits[1].dst = ol->slots[over_idx].img;
}
if (vkp_blit_images(blits, over_idx >= 0 ? 2 : 1) != 0) return -1;
if (present_slot(l, idx, r, color, 0) != 0) return -1;
if (color && color->dataspace) droiddeck_color_frame_shown(color, DROIDDECK_HDR_LAYER_COPY, AHB_RGBA8);
if (!l->first_logged) {
@@ -1020,6 +1049,7 @@ int sc_layer_present(struct vkp_image *src, int scene_w, int scene_h, const stru
pool_kind(l->pool_modifier), l->pool_n);
}
vkp_signal_first_frame();
if (over_idx >= 0 && overlay_shown(ol, over_idx, og, over->blend) != 0) *over_shown = -1;
return 0;
}
@@ -1209,17 +1239,19 @@ int sc_layer_overlay_affordable(void) {
return ok;
}
int sc_layer_present_overlay(struct vkp_image *src, const int geo[8], int translucent) {
struct layer *l = layer_of(SC_LAYER_OVERLAY);
if (!src || !geo) return -1;
static int overlay_slot(struct layer *l, struct vkp_image *src, int *idx, int *wait_fd) {
*wait_fd = -1;
if (!src) return -1;
if (!sc_layer_overlay_affordable()) return -1;
if (ensure_sc(l) != 0) return -1;
int sw = vkp_image_width(src), sh = vkp_image_height(src);
if (sw <= 0 || sh <= 0) return -1;
int wait_fd;
int idx = take_free_slot(l, sw, sh, AHB_RGBA8, &wait_fd);
if (idx < 0) { log_drop(l); return g_alloc_failed ? -1 : 0; }
if (vkp_blit_image(src, l->slots[idx].img, wait_fd) != 0) return -1;
*idx = take_free_slot(l, sw, sh, AHB_RGBA8, wait_fd);
if (*idx < 0) { log_drop(l); return g_alloc_failed ? -1 : 0; }
return 1;
}
static int overlay_shown(struct layer *l, int idx, const int geo[8], int translucent) {
if (present_slot(l, idx, geo, NULL, translucent) != 0) return -1;
if (!l->first_logged) {
l->first_logged = 1;
@@ -1228,6 +1260,18 @@ int sc_layer_present_overlay(struct vkp_image *src, const int geo[8], int transl
return 0;
}
int sc_layer_present_overlay(struct vkp_image *src, const int geo[8], int translucent) {
struct layer *l = layer_of(SC_LAYER_OVERLAY);
if (!geo) return -1;
int idx;
struct vkp_blit blit = {.src = src, .wait_fd = -1};
const int taken = overlay_slot(l, src, &idx, &blit.wait_fd);
if (taken <= 0) return taken;
blit.dst = l->slots[idx].img;
if (vkp_blit_images(&blit, 1) != 0) return -1;
return overlay_shown(l, idx, geo, translucent);
}
static int hide_layer(struct layer *l) {
if (!l->sc || !l->shown || api.state != 1) return 0;
ASurfaceTransaction *tx = api.txCreate();
+1 -1
View File
@@ -22,7 +22,7 @@ void sc_layer_hdr_symbols(char *out, size_t size);
int sc_layer_present(struct vkp_image *src, int scene_w, int scene_h, const struct vkp_draw *draw,
const struct droiddeck_color *color);
const struct droiddeck_color *color, const struct vkp_draw *over, int *over_shown);
int sc_layer_present_pass(const struct vkp_draw *draws, int n, int scene_w, int scene_h);
int sc_layer_present_generated(const struct vkp_draw *draws, int n_draws, const struct vkp_hdr_frame *hf,
+62 -27
View File
@@ -20,6 +20,8 @@
#include <unistd.h>
#include <errno.h>
#include <poll.h>
#include <linux/sync_file.h>
#include <sys/ioctl.h>
#include <time.h>
#include <pthread.h>
#include <stdarg.h>
@@ -3162,8 +3164,38 @@ static void blit_to_layer(VkCommandBuffer cmd, VkImage src, VkImageLayout src_la
0, 0, NULL, 0, NULL, 1, &release);
}
int vkp_blit_image(struct vkp_image *src, struct vkp_image *dst, int wait_fd) {
if (!src || src->blit_dst || !dst || !dst->blit_dst || dev_init() != 0) {
static int merge_wait_fds(int a, int b) {
if (a < 0) return b;
if (b < 0) return a;
struct sync_merge_data m = {.name = "droiddeck-layer-copy", .fd2 = b};
if (ioctl(a, SYNC_IOC_MERGE, &m) == 0) {
close(a);
close(b);
return m.fence;
}
struct pollfd p = {.fd = b, .events = POLLIN};
int r;
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
close(b);
if (r != 0) return a;
p.fd = a;
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
close(a);
return -2;
}
int vkp_blit_images(const struct vkp_blit *blits, int n) {
int wait_fd = -1;
for (int i = 0; i < n; i++) {
if (wait_fd == -2) { if (blits[i].wait_fd >= 0) close(blits[i].wait_fd); continue; }
wait_fd = merge_wait_fds(wait_fd, blits[i].wait_fd);
}
int valid = n > 0 && wait_fd != -2;
for (int i = 0; valid && i < n; i++) {
const struct vkp_image *src = blits[i].src, *dst = blits[i].dst;
if (!src || src->blit_dst || !dst || !dst->blit_dst) valid = 0;
}
if (!valid || dev_init() != 0) {
if (wait_fd >= 0) close(wait_fd);
return -1;
}
@@ -3176,32 +3208,35 @@ int vkp_blit_image(struct vkp_image *src, struct vkp_image *dst, int wait_fd) {
VkCommandBufferBeginInfo bi = {.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT};
g_vk.BeginCommandBuffer(g_cmd, &bi);
stage_linear_dmabuf(g_cmd, src);
struct vkp_external_client_barrier_pair src_pair;
const int src_external = vkp_external_client_barrier_pair(
src->image, g_qfam, foreign_image(src), src->blit_dst, &src_pair);
VkImageMemoryBarrier acq = src_external ? src_pair.acquire : (VkImageMemoryBarrier){
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = src->image, .subresourceRange = range, .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT};
if (!src_external) {
acq.oldLayout = src->in_general ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_PREINITIALIZED;
acq.newLayout = VK_IMAGE_LAYOUT_GENERAL;
acq.srcAccessMask = VK_ACCESS_HOST_WRITE_BIT;
src->in_general = 1;
for (int i = 0; i < n; i++) {
struct vkp_image *src = blits[i].src, *dst = blits[i].dst;
stage_linear_dmabuf(g_cmd, src);
struct vkp_external_client_barrier_pair src_pair;
const int src_external = vkp_external_client_barrier_pair(
src->image, g_qfam, foreign_image(src), src->blit_dst, &src_pair);
VkImageMemoryBarrier acq = src_external ? src_pair.acquire : (VkImageMemoryBarrier){
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = src->image, .subresourceRange = range, .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT};
if (!src_external) {
acq.oldLayout = src->in_general ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_PREINITIALIZED;
acq.newLayout = VK_IMAGE_LAYOUT_GENERAL;
acq.srcAccessMask = VK_ACCESS_HOST_WRITE_BIT;
src->in_general = 1;
}
g_vk.CmdPipelineBarrier(g_cmd, VK_PIPELINE_STAGE_HOST_BIT | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, NULL, 0, NULL, 1, &acq);
int bw = src->w < dst->w ? src->w : dst->w, bh = src->h < dst->h ? src->h : dst->h;
VkImageBlit blit = {.srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},
.srcOffsets = {{0, 0, 0}, {bw, bh, 1}},
.dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},
.dstOffsets = {{0, 0, 0}, {bw, bh, 1}}};
blit_to_layer(g_cmd, src->image, src_external ? VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL : VK_IMAGE_LAYOUT_GENERAL,
dst, &blit, VK_FILTER_NEAREST);
release_external_client_image(g_cmd, src);
}
g_vk.CmdPipelineBarrier(g_cmd, VK_PIPELINE_STAGE_HOST_BIT | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, NULL, 0, NULL, 1, &acq);
int bw = src->w < dst->w ? src->w : dst->w, bh = src->h < dst->h ? src->h : dst->h;
VkImageBlit blit = {.srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},
.srcOffsets = {{0, 0, 0}, {bw, bh, 1}},
.dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},
.dstOffsets = {{0, 0, 0}, {bw, bh, 1}}};
blit_to_layer(g_cmd, src->image, src_external ? VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL : VK_IMAGE_LAYOUT_GENERAL,
dst, &blit, VK_FILTER_NEAREST);
release_external_client_image(g_cmd, src);
g_vk.EndCommandBuffer(g_cmd);
VkPipelineStageFlags wait_stage = VK_PIPELINE_STAGE_TRANSFER_BIT;
@@ -105,7 +105,11 @@ int vkp_render_hdr(int scene_w, int scene_h, const struct vkp_draw *draws, int n
int vkp_pass_begin_hdr(int scene_w, int scene_h, const struct vkp_draw *draws, int n,
const struct vkp_hdr_frame *hf, int *rw, int *rh);
int vkp_blit_image(struct vkp_image *src, struct vkp_image *dst, int wait_fd);
struct vkp_blit {
struct vkp_image *src, *dst;
int wait_fd;
};
int vkp_blit_images(const struct vkp_blit *blits, int n);
int vkp_image_readback(struct vkp_image *src, uint32_t *out, int max_px);
int vkp_update_map(int scene_w, int scene_h);
int vkp_map_draw(const struct vkp_draw *d, int out[8]);
@@ -20,10 +20,6 @@ class App : Application() {
override fun onCreate() {
super.onCreate()
if (android.os.Build.VERSION.SDK_INT >= 28 &&
com.droiddeck.launcher.runtime.GuestWorker.isWorkerProcess(this, Application.getProcessName())) return
if (android.os.Build.VERSION.SDK_INT >= 28 && Application.getProcessName() == packageName)
com.droiddeck.launcher.runtime.GuestWorkers.attach(this)
com.droiddeck.launcher.runtime.NativeGuest.init(this)
com.droiddeck.launcher.session.Onboarding.attach(this)
Thread({ runCatching { EnhancedSessionLogShare.cleanupAbandonedStages(this) } }, "diagnostic-stage-cleanup").start()
@@ -192,6 +192,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
private var prootNoSeccomp by mutableStateOf(false)
private var prootFastPath by mutableStateOf(true)
private var nativeUserland by mutableStateOf(true)
private var desktopAsUser by mutableStateOf(false)
private var cursorComposite by mutableStateOf(true)
private var guestHostname by mutableStateOf(SessionPrefs.DEFAULT_GUEST_HOSTNAME)
private var phantomWarning by mutableStateOf<String?>(null)
@@ -3049,7 +3050,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
fsyncFirst = fsyncFirst,
gamescopeRealtime = gamescopeRealtime,
gpuClockPin = gpuClockPin,
prootNoSeccomp = prootNoSeccomp, prootFastPath = prootFastPath, nativeUserland = nativeUserland, cursorComposite = cursorComposite,
prootNoSeccomp = prootNoSeccomp, prootFastPath = prootFastPath, nativeUserland = nativeUserland, desktopAsUser = desktopAsUser, cursorComposite = cursorComposite,
guestHostname = guestHostname, phantomWarning = phantomWarning,
onClientOverride = { on -> SessionPrefs.setClientCpusOverride(this, on); clientOverride = on },
onPaceCores = { on -> SessionPrefs.setPaceCores(this, on); paceCores = on },
@@ -3066,6 +3067,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
onProotNoSeccomp = { on -> SessionPrefs.setProotNoSeccomp(this, on); prootNoSeccomp = on },
onProotFastPath = { on -> SessionPrefs.setProotFastPath(this, on); prootFastPath = on },
onNativeUserland = { on -> SessionPrefs.setNativeUserland(this, on); nativeUserland = on },
onDesktopAsUser = { on -> SessionPrefs.setDesktopAsUser(this, on); desktopAsUser = on },
onCursorComposite = { on -> SessionPrefs.setCursorComposite(this, on); cursorComposite = on },
onGuestHostname = { name -> SessionPrefs.setGuestHostname(this, name) },
onClientCore = { core, on ->
@@ -3384,6 +3386,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
prootNoSeccomp = SessionPrefs.prootNoSeccomp(this)
prootFastPath = SessionPrefs.prootFastPath(this)
nativeUserland = SessionPrefs.nativeUserland(this)
desktopAsUser = SessionPrefs.desktopAsUser(this)
cursorComposite = SessionPrefs.cursorComposite(this)
guestHostname = SessionPrefs.guestHostname(this)
refreshPhantomStatus()
@@ -807,6 +807,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
}
private var isHomeApp by mutableStateOf(false)
private var androidApps by mutableStateOf<List<HomeApp.LaunchableApp>>(emptyList())
private var padConnected by mutableStateOf(false)
private val deviceListener = object : InputManager.InputDeviceListener {
override fun onInputDeviceAdded(deviceId: Int) {
@@ -1264,7 +1265,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
) { headTracker?.recenter() }
if (!phonePanel && glasses.present && !drawerOpen && !pcKeyboardOpen && !loading.visible) com.droiddeck.launcher.ui.GlassesCornerButton(glassesSlot,
controllerSettings?.tint ?: android.graphics.Color.rgb(90, 160, 255), controllerSettings?.opacity ?: 100) {
drawerPage = com.droiddeck.launcher.ui.SessionDrawerPage.GLASSES
drawerPage = com.droiddeck.launcher.ui.SessionDrawerPage.VR
drawerOpen = true
}
if (!drawerOpen && !pcKeyboardOpen && !loading.visible) {
@@ -1451,7 +1452,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
}
}
LaunchedEffect(drawerOpen, achievementsOpen, AgentGuest.focusRevision, StoreAchievements.revision) {
if (!drawerOpen && !achievementsOpen) return@LaunchedEffect
if (!drawerOpen && !achievementsOpen) {
achievementsInFront = null
return@LaunchedEffect
}
val found = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) {
runCatching { resolveAchievementsInFront() }
.onFailure { Log.w(TAG, "achievements in front: ${it.javaClass.simpleName}") }.getOrNull()
@@ -1787,7 +1791,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
onBlackFrameInsertion = { on ->
SessionPrefs.setBlackFrameInsertion(this@SessionActivity, on)
blackFrameInsertion = on
CompositorHost.setBlackFrameInsertion(on, refreshHz(), outputFpsLimit())
CompositorHost.setBlackFrameInsertion(on, refreshHz(), compositorFpsLimit())
},
hdr = hdrWanted,
hdrAvailable = hdrAvailable,
@@ -1824,7 +1828,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
onRumble = { on -> updateControllerPrefs { ControllerPrefs.setRumble(this@SessionActivity, on) } },
onSteamMenu = if (SessionState.mode == SessionService.MODE_STEAM) ({ sendSteamGuide() }) else null,
onQam = if (SessionState.mode == SessionService.MODE_STEAM) ({ triggerSteamQam() }) else null,
onAchievements = achievementsInFront?.let { { drawerOpen = false; achievementsOpen = true } },
controllerConnected = padConnected,
achievementsGame = achievementsInFront?.game,
achievementsTitle = achievementsInFront?.title,
achievementsProgress = achievementsInFront?.progress,
padType = if (SessionState.mode == SessionService.MODE_STEAM && SessionState.deckPad) padType else null,
onPadType = { id ->
@@ -1945,7 +1951,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
onResume = { SessionService.resume(this@SessionActivity) },
orientation = sessionOrientation,
onOrientation = { value ->
SessionPrefs.setOrientation(this@SessionActivity, value)
when (SessionState.mode) {
SessionService.MODE_STEAM, SessionService.MODE_RUN ->
SessionPrefs.setOrientation(this@SessionActivity, "steam", value)
SessionService.MODE_DESKTOP ->
SessionPrefs.setOrientation(this@SessionActivity, "desktop", value)
else -> SessionPrefs.setOrientation(this@SessionActivity, value)
}
sessionOrientation = value
applyFollowOrientation(resources.configuration)
},
@@ -2724,7 +2736,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
oscTrackpads = SessionPrefs.oscTrackpads(this)
backHold = SessionPrefs.backHold(this)
dockedMenuController = SessionPrefs.dockedMenuController(this)
sessionOrientation = SessionPrefs.orientation(this)
sessionOrientation = SessionPrefs.orientation(this, SessionState.mode)
dualScreenSessionMode = SessionPrefs.dualScreenSessionMode(this)
backActionsInverted = SessionPrefs.backActionsInverted(this)
physicalShortcuts.bindings = PhysicalShortcuts.read(this)
@@ -2990,7 +3002,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
CompositorHost.startOrAttach(
this, holder.surface, runtimeDir.path,
driverId?.let { turnip.driverPath(it) }, driverId?.let { turnip.libraryName(it) },
applicationInfo.nativeLibraryDir, size.first, size.second, refreshHz(holder), outputFpsLimit(),
applicationInfo.nativeLibraryDir, size.first, size.second, refreshHz(holder), compositorFpsLimit(),
)
onOutputAttached(holder)
if (SessionState.running && size != previous) {
@@ -3056,7 +3068,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
WaylandCompositor.nativeResizeOutput(size.first, size.second)
}
private fun followPortrait(): Boolean = glassesScreen == null && SessionPrefs.portrait(this)
private fun followPortrait(): Boolean = glassesScreen == null && SessionPrefs.portrait(this, SessionState.mode)
private fun applyFollowChoice() {
val scale = SessionState.followScales.let { if (followPortrait()) it.second else it.first }
@@ -3065,7 +3077,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
}
private fun applyFollowOrientation(config: android.content.res.Configuration) {
val wanted = SessionPrefs.windowOrientation(this, SessionState.followScreen, config.smallestScreenWidthDp)
val wanted = SessionPrefs.windowOrientation(this, SessionState.followScreen, config.smallestScreenWidthDp, SessionState.mode)
if (requestedOrientation != wanted) requestedOrientation = wanted
}
@@ -3128,13 +3140,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
private fun displayMode(): String = SessionPrefs.displayMode(this,
intent.getStringExtra(SessionService.EXTRA_MODE) ?: SessionService.MODE_STEAM, intent.getStringExtra(SessionService.EXTRA_PROGRAM))
private fun portraitOutput(): Boolean = SessionPrefs.portrait(this) && !controlsBelowWanted()
private fun portraitOutput(): Boolean = SessionPrefs.portrait(this, SessionState.mode) && !controlsBelowWanted()
private fun outputSize(): Pair<Int, Int> =
com.droiddeck.launcher.session.SessionDisplay.resolveChoice(com.droiddeck.launcher.session.SessionDisplay.panelSize(this),
resolutionChoice(), portraitOutput())
private fun resolutionChoice(portrait: Boolean = SessionPrefs.portrait(this)): String {
private fun resolutionChoice(portrait: Boolean = SessionPrefs.portrait(this, SessionState.mode)): String {
val mode = displayMode()
val program = intent.getStringExtra(SessionService.EXTRA_PROGRAM)
return if (intent.getStringExtra(SessionService.EXTRA_MODE) == SessionService.MODE_RUN &&
@@ -3181,6 +3193,18 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
private fun outputFpsLimit(): Int = outputFpsLimit(pipUi)
// Android holds the window to the Game Mode override while the panel runs faster; the guest paces to the panel,
// so without this cap every frame past the override is drawn and dropped.
private fun hostFrameCap(): Int {
if (glassesScreen != null || bottomOutputActive) return 0
val display = (if (Build.VERSION.SDK_INT >= 30) display else @Suppress("DEPRECATION") windowManager.defaultDisplay) ?: return 0
return SessionPrefs.hostFrameCap(display.refreshRate, display.mode.refreshRate)
}
private fun compositorFpsLimit(): Int = SessionPrefs.compositorFpsLimit(
mirrorRefreshLimit(), if (noSteamSession()) SessionState.fpsLimit else 0, pipUi, hostFrameCap(),
)
private fun outputFpsLimit(pip: Boolean): Int =
SessionPrefs.compositorFpsLimit(mirrorRefreshLimit(), if (noSteamSession()) SessionState.fpsLimit else 0, pip)
@@ -3218,7 +3242,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
)
val hz = refreshHz()
val changed = kotlin.math.abs(SessionState.refreshHz - hz) > 0.1f
CompositorHost.updatePacing(hz, outputFpsLimit())
CompositorHost.updatePacing(hz, compositorFpsLimit())
pushCardboard(activeCardboard)
if (changed && ::surfaceView.isInitialized) applyFrameGen()
}
@@ -3789,7 +3813,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
if (fromController && (event.keyCode == KeyEvent.KEYCODE_BUTTON_L1 || event.keyCode == KeyEvent.KEYCODE_BUTTON_R1)) {
if (event.action == KeyEvent.ACTION_DOWN && event.repeatCount == 0) {
// The bumpers walk the tabs on the strip; a page kept inside More counts as the More tab.
val pages = sessionDrawerPages(glasses.present)
val pages = sessionDrawerPages(achievementsInFront != null)
drawerPage = pages.strip().step(pages.tabFor(drawerPage), if (event.keyCode == KeyEvent.KEYCODE_BUTTON_R1) 1 else -1)
releaseDrawerDirection()
}
@@ -4945,6 +4969,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
}
private fun refreshControls() {
padConnected = controllerConnected()
applyUnfoldedControls()
updateOnScreenControls()
}
@@ -6385,6 +6410,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
}
(getSystemService(INPUT_SERVICE) as? InputManager)
?.registerInputDeviceListener(deviceListener, Handler(Looper.getMainLooper()))
padConnected = controllerConnected()
padBridge?.setStickDeadZone(ControllerPrefs.deadZone(this))
refreshSecondScreenDisplays()
if (SessionState.guestPid > 1) padBridge?.syncConnectedControllers()
@@ -89,7 +89,7 @@ public class DirectAudioRelayComponent extends SessionPart {
}
}
final java.io.PrintWriter log = out;
pid = HostProcess.startUncounted(command.toString(), env.toArray(new String[0]),
pid = HostProcess.start(command.toString(), env.toArray(new String[0]),
app().getFilesDir(), null,
line -> {
Log.i(TAG, line);
@@ -186,16 +186,13 @@ public class PulseAudioComponent extends SessionPart {
env.add("LD_LIBRARY_PATH=/system/lib64:" + modules + ":" + workingDir.getAbsolutePath());
env.add("HOME=" + workingDir);
env.add("TMPDIR=" + workingDir);
// The daemon closes every fd at start but this one; in a worker process it is the binder
// fd whose closing Android takes for the process's death.
env.add("PULSE_PASSED_FD=" + com.droiddeck.launcher.runtime.GuestWorker.BINDER_FD_TOKEN);
String command = String.join(" ", HostProcess.dataExecutable(workingDir.getAbsolutePath() + "/libpulseaudio.so"))
+ " --system=false --disable-shm=true --fail=false"
+ " -n --file=default.pa --daemonize=false --use-pid-file=false --exit-idle-time=-1"
+ " --log-level=info";
final java.io.PrintWriter out = openLog();
if (!host.launch(generation, () -> HostProcess.startUncounted(command, env.toArray(new String[0]), workingDir, status -> {
if (!host.launch(generation, () -> HostProcess.start(command, env.toArray(new String[0]), workingDir, status -> {
if (host.exited(generation)) {
Log.w(TAG, "audio host exited with status " + status + "; restarting");
start(generation);
@@ -1,6 +1,5 @@
package com.droiddeck.launcher.core
import android.os.ParcelFileDescriptor
import android.util.Log
import java.io.File
import java.util.function.Consumer
@@ -8,9 +7,6 @@ import java.util.function.Consumer
object HostProcess {
private const val TAG = "HostProcess"
private const val LINKER = "/system/bin/linker64"
// sh -c WORKER_CD sh DIR NAME=VALUE... -- PROGRAM ARGS...
private const val WORKER_CD = "cd \"\$1\" || exit 126; shift; " +
"while [ \$# -gt 0 ] && [ \"\$1\" != -- ]; do export \"\$1\"; shift; done; shift; exec \"\$@\""
/** Android 10+ refuses to execute app data files for targetSdk 29+; its linker still loads them. */
@JvmStatic
@@ -69,77 +65,6 @@ object HostProcess {
}
}
/**
* As [start], but the program runs as the main process of one of the app's worker processes,
* which Android does not count against the app's child processes (docs/phantom-processes.md).
* Falls back to [start] when no worker is available. The exit status is the program's exit
* code, or 128 plus the signal that ended it, as Process.waitFor() reports it.
*/
@JvmStatic
@JvmOverloads
fun startUncounted(command: String, env: Array<String>?, dir: File?, onExit: Consumer<Int>?, onLine: Consumer<String>?,
outputFile: File? = null, onOutputComplete: Runnable? = null): Int {
val context = com.droiddeck.launcher.runtime.GuestWorkers.context
val argv = split(command)
// A missing working directory fails the launch (start() returns -1 for it), not the program
if (context == null || argv.isEmpty() || !com.droiddeck.launcher.runtime.GuestWorkers.enabled(context) ||
(dir != null && !dir.isDirectory)) {
return start(command, env, dir, onExit, onLine, outputFile, onOutputComplete)
}
val environment = LinkedHashMap(System.getenv())
env?.forEach { line ->
val eq = line.indexOf('=')
if (eq > 0) environment[line.substring(0, eq)] = line.substring(eq + 1)
}
val assignments = environment.map { (k, v) -> "$k=$v" }
// A worker cannot chdir before its exec, so Android's shell does it. The shell starts with an
// environment of its own (the program's LD_PRELOAD of glibc libraries would stop it loading)
// and exports the program's before the exec.
val launch = if (dir != null) {
listOf("/system/bin/sh", "-c", WORKER_CD, "sh", dir.path) + assignments + listOf("--") + argv
} else argv
val workerEnv = if (dir != null) listOf("PATH=/system/bin") else assignments
var input: ParcelFileDescriptor? = null
var reader: ParcelFileDescriptor? = null
var output: ParcelFileDescriptor? = null
val pid = try {
input = ParcelFileDescriptor.open(File("/dev/null"), ParcelFileDescriptor.MODE_READ_ONLY)
output = when {
onLine != null -> ParcelFileDescriptor.createPipe().let { reader = it[0]; it[1] }
outputFile != null -> ParcelFileDescriptor.open(outputFile,
ParcelFileDescriptor.MODE_WRITE_ONLY or ParcelFileDescriptor.MODE_CREATE or ParcelFileDescriptor.MODE_APPEND)
else -> ParcelFileDescriptor.open(File("/dev/null"), ParcelFileDescriptor.MODE_WRITE_ONLY)
}
com.droiddeck.launcher.runtime.GuestWorkers.start(context, launch, workerEnv, listOf(input, output, output)) { status ->
onExit?.accept(if (status < 0) -1 else if (status and 0x7f == 0) (status shr 8) and 0xff else 128 + (status and 0x7f))
}
} catch (e: Exception) {
Log.w(TAG, "no worker for ${argv.first()}", e)
-1
} finally {
runCatching { input?.close() }
runCatching { output?.close() }
}
if (pid <= 0) {
reader?.close()
return start(command, env, dir, onExit, onLine, outputFile, onOutputComplete)
}
Log.i(TAG, "started pid $pid outside the child-process count: ${argv.first()} (${argv.size - 1} arguments)")
reader?.let { pipe ->
Thread({
try {
ParcelFileDescriptor.AutoCloseInputStream(pipe).bufferedReader().useLines { lines ->
lines.forEach { onLine?.accept(it) }
}
} catch (e: Exception) {
} finally {
onOutputComplete?.run()
}
}, "proc-out-$pid").apply { priority = Thread.NORM_PRIORITY - 1; isDaemon = true; start() }
}
return pid
}
@JvmStatic
fun pidOf(process: Process): Int = try {
val field = process.javaClass.getDeclaredField("pid")
@@ -7,8 +7,6 @@ import com.droiddeck.launcher.R
enum class PhantomProcessStatus {
NOT_APPLICABLE,
/** The limit is on, but the session keeps its programs out of Android's count (GuestWorkers). */
UNCOUNTED,
DISABLED,
ENABLED,
UNSET,
@@ -59,12 +57,6 @@ object PhantomProcessLimit {
fun read(context: Context, sdk: Int = Build.VERSION.SDK_INT): PhantomProcessStatus {
if (sdk < Build.VERSION_CODES.S) return PhantomProcessStatus.NOT_APPLICABLE
val status = readSetting(context, sdk)
return if (status != PhantomProcessStatus.DISABLED && com.droiddeck.launcher.runtime.GuestWorkers.limitHandled(context))
PhantomProcessStatus.UNCOUNTED else status
}
private fun readSetting(context: Context, sdk: Int): PhantomProcessStatus {
if (usesDeviceConfig(sdk)) {
val off = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getBoolean(PREF_ANDROID_12_OFF, false)
val global = try {
@@ -109,8 +101,7 @@ object PhantomProcessLimit {
fun hasDeveloperToggle(sdk: Int = Build.VERSION.SDK_INT): Boolean = sdk >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE
fun blocksSteam(status: PhantomProcessStatus): Boolean =
status != PhantomProcessStatus.NOT_APPLICABLE && status != PhantomProcessStatus.DISABLED &&
status != PhantomProcessStatus.UNCOUNTED
status != PhantomProcessStatus.NOT_APPLICABLE && status != PhantomProcessStatus.DISABLED
fun title(context: Context, status: PhantomProcessStatus): String = context.getString(when (status) {
PhantomProcessStatus.ENABLED -> R.string.phantom_title_on
@@ -118,7 +109,6 @@ object PhantomProcessLimit {
PhantomProcessStatus.UNREADABLE -> R.string.phantom_title_unreadable
PhantomProcessStatus.DISABLED -> R.string.phantom_title_off
PhantomProcessStatus.NOT_APPLICABLE -> R.string.phantom_title_not_required
PhantomProcessStatus.UNCOUNTED -> R.string.phantom_title_uncounted
})
fun instructions(context: Context, status: PhantomProcessStatus): String = when (status) {
@@ -126,7 +116,6 @@ object PhantomProcessLimit {
context.getString(R.string.phantom_instructions_fix, fixSentence(context))
PhantomProcessStatus.DISABLED -> context.getString(R.string.phantom_instructions_off)
PhantomProcessStatus.NOT_APPLICABLE -> context.getString(R.string.phantom_instructions_not_applicable)
PhantomProcessStatus.UNCOUNTED -> context.getString(R.string.phantom_instructions_uncounted)
}
fun gateInstructions(context: Context, status: PhantomProcessStatus): String = when (status) {
@@ -143,6 +132,5 @@ object PhantomProcessLimit {
PhantomProcessStatus.UNSET -> "not set (ROM default applies; DroidDeck requires an explicit disabled value)"
PhantomProcessStatus.UNREADABLE -> "unreadable (DroidDeck could not verify the setting)"
PhantomProcessStatus.NOT_APPLICABLE -> "not applicable before Android 12"
PhantomProcessStatus.UNCOUNTED -> "on, not needed (most of the session's programs run in uncounted worker processes)"
}
}
@@ -28,18 +28,17 @@ object SessionLogCapture {
out.flush()
writer = out
this.target = target
pid = HostProcess.startUncounted(
pid = HostProcess.start(
command(Process.myPid(), sinceMillis),
null, target.parentFile, null,
onLine = { line ->
synchronized(this) {
try {
writer?.apply { write(line); newLine(); flush() }
} catch (e: Exception) {
}
) { line ->
synchronized(this) {
try {
writer?.apply { write(line); newLine(); flush() }
} catch (e: Exception) {
}
},
)
}
}
if (pid == -1) {
out.write("logcat could not be started; this ROM may not hand an app its own entries.\n")
out.flush()
@@ -38,6 +38,11 @@ object ElfSeccompPatch {
val end = minOf(data.size, buffer.getLong(at + 8).toInt() + buffer.getLong(at + 32).toInt()) and 3.inv()
var pos = start
while (pos + 4 <= end) {
if (patchTermiosRequest(buffer, pos, end)) {
patched++
pos += 4
continue
}
val replacement = when (buffer.getInt(pos)) {
MOV_X8_SET_ROBUST_LIST -> NOP
MOV_X8_CLONE3, MOV_X8_RSEQ -> MOV_X0_ENOSYS
@@ -65,6 +70,40 @@ object ElfSeccompPatch {
return patched
}
/**
* glibc 2.42 and later read and set a terminal with TCGETS2 and TCSETS2/W2/F2, which Android's
* SELinux policy refuses on an app's pseudo-terminal slaves (EACCES): isatty() was false in every
* Konsole, ssh and tmux session, so bash had no prompt or job control and stdout was not line
* buffered. TCGETS and TCSETS* carry the same struct without its two speed fields, which glibc
* then takes from c_cflag. A site is `movz xN, #lo` then `movk xN, #hi, lsl #16`; the movz gets
* the old request and the movk becomes a no-op.
*/
private fun patchTermiosRequest(buffer: ByteBuffer, pos: Int, end: Int): Boolean {
val movz = buffer.getInt(pos)
if ((movz and 0x7fe00000) != 0x52800000) return false
val low = (movz ushr 5) and 0xffff
if (low !in 0x542a..0x542d) return false
val register = movz and 0x1f
var next = pos + 4
while (next < minOf(end, pos + 4 + 4 * 4)) {
val movk = buffer.getInt(next)
if ((movk and 0x7fe00000) == 0x72a00000 && (movk and 0x1f) == register) {
val request = when ((movk ushr 5) and 0xffff) {
0x802c -> if (low == 0x542a) 0x5401 else return false
0x402c -> if (low != 0x542a) 0x5402 + (low - 0x542b) else return false
else -> return false
}
buffer.putInt(pos, (movz and 0x1f.inv() and (0xffff shl 5).inv()) or (request shl 5) or register)
buffer.putInt(next, NOP)
return true
}
// Anything between that might read or write the register would see the old low half
if (intArrayOf(0, 5, 10, 16).any { (movk ushr it) and 0x1f == register }) return false
next += 4
}
return false
}
/** Patches the file behind [path] (symlinks followed) if it still has unpatched call sites. */
fun patchFile(path: File): Int {
val target = path.canonicalFile
@@ -1,820 +0,0 @@
package com.droiddeck.launcher.runtime
import android.app.ActivityManager
import android.app.Service
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.net.LocalServerSocket
import android.net.LocalSocket
import android.os.Binder
import android.os.Handler
import android.os.IBinder
import android.os.Looper
import android.os.Parcel
import android.os.ParcelFileDescriptor
import android.os.Process
import android.system.ErrnoException
import android.system.Os
import android.system.OsConstants
import android.system.StructPollfd
import android.util.Log
import org.json.JSONObject
import java.io.DataInputStream
import java.io.File
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
/**
* A guest program run as the main process of its own Android process.
*
* Android counts the processes in an app process's cgroup against its child-process limit, but not
* the app processes themselves. The worker execs the program in place; its binder fd stays open
* across the exec, so the system keeps the process as a live service process. The program's own
* children are still counted. See docs/phantom-processes.md.
*/
open class GuestWorker : Service() {
private val binder = object : Binder() {
override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean {
if (code != RUN) return super.onTransact(code, data, reply, flags)
val argv = data.createStringArray() ?: return false
val env = data.createStringArray() ?: return false
val fds = List(data.readInt()) { data.readFileDescriptor() }
val targets = data.createIntArray() ?: IntArray(fds.size) { it }
val fillBinderFd = data.readInt() != 0
val go = data.readFileDescriptor()
reply?.writeInt(Process.myPid())
Handler(Looper.getMainLooper()).post {
// The app writes a byte once it has the reply and has taken the launch on: an exec
// before then would end this process with the reply undelivered, and with none (the
// app gave up and starts the program another way) the program must not run here.
var why = ""
// poll() with a timeout counts as network I/O to StrictMode on the main thread
android.os.StrictMode.setThreadPolicy(android.os.StrictMode.ThreadPolicy.LAX)
val committed = runCatching {
fun byte(timeout: Int): Int {
val poll = StructPollfd().apply { fd = go.fileDescriptor; events = OsConstants.POLLIN.toShort() }
val ready = Os.poll(arrayOf(poll), timeout)
return (if (ready > 0) Os.read(go.fileDescriptor, ByteArray(1), 0, 1) else -1)
.also { why = "poll $ready revents ${poll.revents} read $it" }
}
// The commit, an answer, and the app's word that it has the answer: the app may
// have stopped waiting for it (and started the program another way) meanwhile.
// That last word comes, or the app closes its end (a byte or EOF): no timeout,
// which could drop a launch the app has already reported as started.
byte(GO_TIMEOUT_MS) == 1 && Os.write(go.fileDescriptor, byteArrayOf(1), 0, 1) == 1 && byte(-1) == 1
}.getOrElse { why = it.toString(); false }
go.close()
if (committed) exec(argv, env, fds, targets, fillBinderFd)
else {
Log.w(TAG, "launch not committed ($why): not running ${argv.firstOrNull()}")
Process.killProcess(Process.myPid())
}
}
return true
}
}
override fun onBind(intent: Intent): IBinder = binder
private fun exec(argv: Array<String>, env: Array<String>, fds: List<ParcelFileDescriptor?>, targets: IntArray, fillBinderFd: Boolean) {
try {
val top = targets.maxOrNull() ?: 2
val (binderTop, binderFd) = keepBinderOpen(maxOf(BINDER_FDS, top + 1))
// Out of the way first, so that placing one fd cannot overwrite another not yet placed.
val above = maxOf(MOVED_FDS, top + 1, binderTop + 1)
val moved = fds.map { pfd -> pfd?.let { Os.fcntlInt(it.fileDescriptor, OsConstants.F_DUPFD, above) } }
moved.forEachIndexed { i, fd ->
if (fd == null || i >= targets.size) return@forEachIndexed
val source = ParcelFileDescriptor.adoptFd(fd).also { kept.add(it) }.fileDescriptor
Os.dup2(source, targets[i])
Os.fcntlInt(source, OsConstants.F_SETFD, OsConstants.FD_CLOEXEC)
}
// A session of its own: in zygote's process group, a program signalling its group
// (kill(0, sig)) would reach every process of the app.
runCatching { Os.setsid() }
// The native hook closes the binder fds in every other process (hook/handoff.c). Only an
// app launch asks for the number (a whole argument or variable value), never a guest's.
val fill = { arg: String ->
if (!fillBinderFd) arg
else if (arg == BINDER_FD_TOKEN) binderFd.toString()
else if (arg.endsWith("=$BINDER_FD_TOKEN")) arg.removeSuffix(BINDER_FD_TOKEN) + binderFd
else arg
}
// This thread blocks SIGQUIT, SIGUSR1 and SIGPIPE (Android's runtime), and an exec keeps
// that: the program's hook sets DDH_SIGMASK instead (none blocked, unless the request says).
val mask = if (env.any { it.startsWith("DDH_SIGMASK=") }) emptyList() else listOf("DDH_SIGMASK=0")
Os.execve(argv[0], argv.map(fill).toTypedArray(),
env.filterNot { it.startsWith("DDH_WORKER_PID=") }.map(fill).toTypedArray() + mask +
"DDH_WORKER_PID=${Process.myPid()}")
} catch (e: ErrnoException) {
Log.e(TAG, "could not exec ${argv.firstOrNull()}", e)
}
Process.killProcess(Process.myPid())
}
/**
* Binder fds stay open across the exec, at [from] or above, where no fd of the program goes.
* Returns the highest fd used and the one on /dev/binder, whose closing Android takes for
* the death of this process.
*/
private fun keepBinderOpen(from: Int): Pair<Int, Int> {
var highest = from - 1
var binder = -1
File("/proc/self/fd").listFiles()?.forEach { link ->
val target = runCatching { Os.readlink(link.path) }.getOrNull() ?: return@forEach
if (target !in BINDER_DEVICES && !target.startsWith("/dev/binderfs/")) return@forEach
// A copy, not adoptFd(): some of these fds are owned (fdsan) by a ParcelFileDescriptor.
val copy = runCatching { ParcelFileDescriptor.fromFd(link.name.toIntOrNull() ?: return@forEach) }.getOrNull()
?: return@forEach
val kept = Os.fcntlInt(copy.fileDescriptor, OsConstants.F_DUPFD, from)
highest = maxOf(highest, kept)
if (target.substringAfterLast('/') == "binder") binder = kept
copy.close()
}
return highest to binder
}
companion object {
const val RUN = IBinder.FIRST_CALL_TRANSACTION
/** An argument, or a variable's whole value, in an app launch: replaced by the number of its kept binder fd. */
const val BINDER_FD_TOKEN = "@DDH_WORKER_BINDER_FD@"
// Longer than the app may wait for the hook's "go" (GuestWorkers.ACK_TIMEOUT_MS) before it commits
private const val GO_TIMEOUT_MS = 15000
private val BINDER_DEVICES = setOf("/dev/binder", "/dev/hwbinder", "/dev/vndbinder")
private const val BINDER_FDS = 900
private const val MOVED_FDS = 1200
private const val TAG = "GuestWorker"
private val kept = ArrayList<ParcelFileDescriptor>()
fun isWorkerProcess(context: Context, process: String?): Boolean =
process != null && process.startsWith(context.packageName + ":g") &&
process.substring(context.packageName.length + 2).all { it.isDigit() }
}
}
class GuestWorker0 : GuestWorker()
class GuestWorker1 : GuestWorker()
class GuestWorker2 : GuestWorker()
class GuestWorker3 : GuestWorker()
class GuestWorker4 : GuestWorker()
class GuestWorker5 : GuestWorker()
class GuestWorker6 : GuestWorker()
class GuestWorker7 : GuestWorker()
class GuestWorker8 : GuestWorker()
class GuestWorker9 : GuestWorker()
class GuestWorker10 : GuestWorker()
class GuestWorker11 : GuestWorker()
class GuestWorker12 : GuestWorker()
class GuestWorker13 : GuestWorker()
class GuestWorker14 : GuestWorker()
class GuestWorker15 : GuestWorker()
class GuestWorker16 : GuestWorker()
class GuestWorker17 : GuestWorker()
class GuestWorker18 : GuestWorker()
class GuestWorker19 : GuestWorker()
class GuestWorker20 : GuestWorker()
class GuestWorker21 : GuestWorker()
class GuestWorker22 : GuestWorker()
class GuestWorker23 : GuestWorker()
class GuestWorker24 : GuestWorker()
class GuestWorker25 : GuestWorker()
class GuestWorker26 : GuestWorker()
class GuestWorker27 : GuestWorker()
class GuestWorker28 : GuestWorker()
class GuestWorker29 : GuestWorker()
class GuestWorker30 : GuestWorker()
class GuestWorker31 : GuestWorker()
class GuestWorker32 : GuestWorker()
class GuestWorker33 : GuestWorker()
class GuestWorker34 : GuestWorker()
class GuestWorker35 : GuestWorker()
class GuestWorker36 : GuestWorker()
class GuestWorker37 : GuestWorker()
class GuestWorker38 : GuestWorker()
class GuestWorker39 : GuestWorker()
class GuestWorker40 : GuestWorker()
class GuestWorker41 : GuestWorker()
class GuestWorker42 : GuestWorker()
class GuestWorker43 : GuestWorker()
class GuestWorker44 : GuestWorker()
class GuestWorker45 : GuestWorker()
class GuestWorker46 : GuestWorker()
class GuestWorker47 : GuestWorker()
class GuestWorker48 : GuestWorker()
class GuestWorker49 : GuestWorker()
class GuestWorker50 : GuestWorker()
class GuestWorker51 : GuestWorker()
class GuestWorker52 : GuestWorker()
class GuestWorker53 : GuestWorker()
class GuestWorker54 : GuestWorker()
class GuestWorker55 : GuestWorker()
class GuestWorker56 : GuestWorker()
class GuestWorker57 : GuestWorker()
class GuestWorker58 : GuestWorker()
class GuestWorker59 : GuestWorker()
class GuestWorker60 : GuestWorker()
class GuestWorker61 : GuestWorker()
class GuestWorker62 : GuestWorker()
class GuestWorker63 : GuestWorker()
/** The pool of [GuestWorker] processes, and the socket guests ask it through (`droiddeck-spawn`). */
object GuestWorkers {
private const val TAG = "GuestWorkers"
private val classes: List<Class<out GuestWorker>> = listOf(
GuestWorker0::class.java, GuestWorker1::class.java, GuestWorker2::class.java,
GuestWorker3::class.java, GuestWorker4::class.java, GuestWorker5::class.java,
GuestWorker6::class.java, GuestWorker7::class.java, GuestWorker8::class.java,
GuestWorker9::class.java, GuestWorker10::class.java, GuestWorker11::class.java,
GuestWorker12::class.java, GuestWorker13::class.java, GuestWorker14::class.java,
GuestWorker15::class.java, GuestWorker16::class.java, GuestWorker17::class.java,
GuestWorker18::class.java, GuestWorker19::class.java, GuestWorker20::class.java,
GuestWorker21::class.java, GuestWorker22::class.java, GuestWorker23::class.java,
GuestWorker24::class.java, GuestWorker25::class.java, GuestWorker26::class.java,
GuestWorker27::class.java, GuestWorker28::class.java, GuestWorker29::class.java,
GuestWorker30::class.java, GuestWorker31::class.java, GuestWorker32::class.java,
GuestWorker33::class.java, GuestWorker34::class.java, GuestWorker35::class.java,
GuestWorker36::class.java, GuestWorker37::class.java, GuestWorker38::class.java,
GuestWorker39::class.java, GuestWorker40::class.java, GuestWorker41::class.java,
GuestWorker42::class.java, GuestWorker43::class.java, GuestWorker44::class.java,
GuestWorker45::class.java, GuestWorker46::class.java, GuestWorker47::class.java,
GuestWorker48::class.java, GuestWorker49::class.java, GuestWorker50::class.java,
GuestWorker51::class.java, GuestWorker52::class.java, GuestWorker53::class.java,
GuestWorker54::class.java, GuestWorker55::class.java, GuestWorker56::class.java,
GuestWorker57::class.java, GuestWorker58::class.java, GuestWorker59::class.java,
GuestWorker60::class.java, GuestWorker61::class.java, GuestWorker62::class.java,
GuestWorker63::class.java,
)
private class Slot(val index: Int) {
lateinit var connection: ServiceConnection
val connected = CountDownLatch(1)
@Volatile var service: IBinder? = null
@Volatile var pid = -1
@Volatile var guest = false
/** The session it runs a program for ([serve]'s number). */
@Volatile var session = 0
@Volatile var onExit: ((Int) -> Unit)? = null
/** Set once its program was handed over: only then does its end count as the program's. */
@Volatile var started = false
/** Between the pid and the last word of a launch (under the slots lock): its end is held back. */
var launching = false
/** It ended while launching: reported once the launch turns out to have run, never otherwise. */
var endedLaunching = false
}
private val slots = arrayOfNulls<Slot>(classes.size)
// Workers bound ahead of need while a session runs: a zygote fork and the bind take about
// 60-100 ms, which every program the session starts would otherwise wait for.
private val warm = ArrayDeque<Slot>()
@Volatile private var warmTarget = 0
// Numbers the sessions: an old session's teardown can still be running when the next one starts.
@Volatile private var session = 0
// The latest session whose teardown has begun
@Volatile private var stopped = 0
// Held for a launch's last word and for marking a session stopped
private val authorizing = Any()
private val warming = java.util.concurrent.atomic.AtomicBoolean(false)
private const val WARM_WORKERS = 2
private const val ACK_TIMEOUT_MS = 5000
private const val ANSWER_TIMEOUT_MS = 5000
private const val RECEIVE_TIMEOUT_MS = 10000
// argv and the environment of one exec, with room: Linux caps them at a quarter of the stack
private const val MAX_REQUEST_BYTES = 8 shl 20
private const val MAX_RECEIVING = 32
private val receiving = java.util.concurrent.atomic.AtomicInteger()
private val connections = java.util.concurrent.Executors.newSingleThreadExecutor { Thread(it, "guest-worker-binder").apply { isDaemon = true } }
@Volatile private var server: Thread? = null
/** The app, once [attach] or [serve] ran in its main process; null before. */
@Volatile var context: Context? = null
private set
/** Whether the session runs its programs in workers: the native userland, and not turned off. */
fun enabled(context: Context): Boolean =
android.os.Build.VERSION.SDK_INT >= 30 && com.droiddeck.launcher.session.SessionPrefs.childProcessHandoff(context) &&
NativeGuest.enabled(context)
/** How the running session's root was started: in a worker (true) or counted (false); null with none running. */
@Volatile var sessionRootUncounted: Boolean? = null
/**
* Whether Android's child-process limit is out of the session's way: as the running session
* started (a proot session, or one whose root fell back to a counted start, is not), else as
* the next one would start.
*/
fun limitHandled(context: Context): Boolean =
sessionRootUncounted ?: (NativeGuest.sessionMode != false && enabled(context))
/** Whether pid is a program running in one of the workers. */
fun runsInWorker(pid: Int): Boolean = pid > 0 && synchronized(slots) { slots.any { it != null && it.started && it.pid == pid } }
fun socketName(context: Context): String = "droiddeck-spawn." + context.packageName + "." + Process.myUid()
/**
* Runs [argv] (a host command line) as the main process of a free worker with [env] and the
* fds in [stdio] as its 0, 1 and 2. Returns its pid, or -1. Blocks: not for the main thread.
* [onExit] runs once the process is gone.
*/
fun start(context: Context, argv: List<String>, env: List<String>, stdio: List<ParcelFileDescriptor>, onExit: (Int) -> Unit): Int =
start(context, argv, env, stdio, IntArray(stdio.size) { it }, onExit)
/** As [start], with the fds in [fds] placed at the numbers in [targets]. */
fun start(context: Context, argv: List<String>, env: List<String>, fds: List<ParcelFileDescriptor>, targets: IntArray,
onExit: (Int) -> Unit): Int = start(context, argv, env, fds, targets, false, onExit)
/**
* [guest]: one of the session's guest programs, which [guestPids] lists and [stopGuests] ends.
* [commit] runs with the pid before the worker may run the program; false, and it does not.
* [confirmed] runs once the worker has taken it on, just before it is told to run it; false, and it does not.
* [owner]: the session asking (the one a guest's request names), else the latest.
*/
private fun start(context: Context, argv: List<String>, env: List<String>, fds: List<ParcelFileDescriptor>, targets: IntArray,
guest: Boolean, onExit: (Int) -> Unit, commit: (Int) -> Boolean = { true },
confirmed: () -> Boolean = { true }, owner: Int = session): Int {
val app = context.applicationContext
if (guest && owner <= stopped) {
Log.w(TAG, (if (owner == 0) "a request naming no session" else "session $owner is stopping") +
": not starting ${argv.firstOrNull()}")
return -1
}
val slot = takeWarm() ?: bind(app)?.takeIf { fresh ->
fresh.connected.await(10, TimeUnit.SECONDS).also { if (!it) release(app, fresh) }
} ?: run {
Log.w(TAG, "no worker started for ${argv.firstOrNull()}")
return -1
}
slot.guest = guest
slot.session = owner
slot.onExit = onExit
refill(app)
// The worker execs once a byte comes through this socket: after the reply has reached us, so
// that its exec does not cut the reply off, and after the slot is marked started. Closed
// without one, the worker ends without running the program (the caller starts it another way).
// It answers with a byte of its own: without that it gave up waiting, and nothing runs.
var go: Array<ParcelFileDescriptor>? = null
var data: Parcel? = Parcel.obtain()
val reply = Parcel.obtain()
try {
go = ParcelFileDescriptor.createSocketPair()
data!!.writeStringArray(argv.toTypedArray())
data.writeStringArray(env.toTypedArray())
data.writeInt(fds.size)
fds.forEach { data.writeFileDescriptor(it.fileDescriptor) }
data.writeIntArray(targets)
data.writeInt(if (guest) 0 else 1)
data.writeFileDescriptor(go[0].fileDescriptor)
slot.service!!.transact(GuestWorker.RUN, data, reply, 0)
// The worker has its own copy: with ours closed (and the request's, which holds one too),
// a worker that gave up leaves no reader
data.recycle()
data = null
go[0].close()
val pid = reply.readInt()
// Once a session's teardown has begun (stopGuests), none of its programs may start: it
// would not find them.
val stopping = { guest && owner <= stopped }
if (stopping() || !commit(pid)) {
Log.w(TAG, "worker ${slot.index}: ${argv.firstOrNull()} was not taken on")
release(app, slot)
return -1
}
// launching, not started yet: an end before the last word is reported only if the launch ran
val live = synchronized(slots) {
(slots[slot.index] === slot && !stopping()).also { if (it) { slot.pid = pid; slot.launching = true } }
}
if (!live) {
Log.w(TAG, "worker ${slot.index} ended, or its session is stopping, before running ${argv.firstOrNull()}")
release(app, slot)
return -1
}
Os.write(go[1].fileDescriptor, byteArrayOf(1), 0, 1)
val answer = StructPollfd().apply { fd = go[1].fileDescriptor; events = OsConstants.POLLIN.toShort() }
// then the word to run it: given only here, once its answer is in, so that a worker whose
// answer came too late never runs a program this call reports as not started. [confirmed]
// goes first: a caller that hears nothing runs the program itself, so it must have heard
// before the worker may run it (an app dying in between loses the program, not doubles it).
// The word and a teardown's start exclude each other: a launch is authorized before stopGuests()
// marks the session stopped, and is then stopped with the pids it takes (guestPids lists a
// launching slot), or never.
val answered = Os.poll(arrayOf(answer), ANSWER_TIMEOUT_MS) > 0 && Os.read(go[1].fileDescriptor, ByteArray(1), 0, 1) == 1
val accepted = answered && synchronized(authorizing) {
!stopping() && confirmed() && Os.write(go[1].fileDescriptor, byteArrayOf(1), 0, 1) == 1
}
val endedRunning = synchronized(slots) {
slot.launching = false
if (accepted && !slot.endedLaunching) slot.started = true
accepted && slot.endedLaunching
}
if (!accepted) {
Log.w(TAG, "worker ${slot.index} did not take ${argv.firstOrNull()} on")
release(app, slot)
return -1
}
// it ran and was already gone by now: its end, once
if (endedRunning) reportEnd(app, slot)
} catch (e: Exception) {
Log.w(TAG, "worker ${slot.index} refused ${argv.firstOrNull()}", e)
synchronized(slots) { slot.launching = false }
release(app, slot)
return -1
} finally {
data?.recycle()
reply.recycle()
go?.forEach { runCatching { it.close() } }
}
Log.i(TAG, "worker ${slot.index} (pid ${slot.pid}) runs ${argv.lastOrNull { !it.startsWith("-") }}")
return slot.pid
}
/** Binds a free worker; its [Slot.connected] opens once it is up. Null when all are in use. */
private fun bind(app: Context): Slot? {
val slot = synchronized(slots) {
val index = slots.indexOfFirst { it == null }
if (index < 0) {
Log.w(TAG, "all ${slots.size} workers are busy")
return null
}
Slot(index).also { slots[index] = it }
}
slot.connection = object : ServiceConnection {
override fun onServiceConnected(name: ComponentName, binder: IBinder) {
slot.service = binder
slot.connected.countDown()
}
override fun onServiceDisconnected(name: ComponentName) = release(app, slot)
override fun onBindingDied(name: ComponentName) = release(app, slot)
}
// Callbacks off the main thread: start() waits for onServiceConnected, and a caller holding a
// lock the main thread is waiting for (PulseAudio's launch) would otherwise wait out the timeout.
val bound = runCatching {
app.bindService(Intent(app, classes[slot.index]), Context.BIND_AUTO_CREATE or Context.BIND_IMPORTANT,
connections, slot.connection)
}.onFailure { Log.w(TAG, "worker ${slot.index} could not be bound", it) }.getOrDefault(false)
if (!bound) {
release(app, slot)
return null
}
return slot
}
private fun takeWarm(): Slot? = synchronized(slots) {
while (warm.isNotEmpty()) {
val slot = warm.removeFirst()
if (slots[slot.index] === slot && slot.service?.isBinderAlive == true) return slot
}
null
}
/** Brings the warm workers back up to [warmTarget], one at a time, off the caller's thread. */
private fun refill(app: Context) {
if (warmTarget == 0 || !warming.compareAndSet(false, true)) return
Thread({
try {
while (true) {
val missing = warmTarget - synchronized(slots) { warm.size }
if (missing <= 0) break
// all at once: the zygote forks them in parallel
val fresh = (1..missing).mapNotNull { bind(app) }
if (fresh.isEmpty()) break
for (slot in fresh) {
if (!slot.connected.await(10, TimeUnit.SECONDS)) {
release(app, slot)
continue
}
// decided once, under the lock: kept warm, or released
val kept = synchronized(slots) {
(slots[slot.index] === slot && warmTarget > 0).also { if (it) warm.addLast(slot) }
}
if (!kept) release(app, slot)
}
}
} finally {
warming.set(false)
}
}, "guest-worker-warm").apply { isDaemon = true; start() }
}
private fun release(app: Context, slot: Slot) {
var report = false
val removed = synchronized(slots) {
warm.remove(slot)
if (slot.launching) slot.endedLaunching = true else report = slot.started
(slots[slot.index] === slot).also { if (it) slots[slot.index] = null }
}
if (!removed) return
runCatching { app.unbindService(slot.connection) }
if (report) reportEnd(app, slot)
}
private fun reportEnd(app: Context, slot: Slot) {
val onExit = slot.onExit ?: return
Thread({ onExit(exitStatus(app, slot.pid)) }, "guest-worker-exit").start()
}
/** The worker's exit as a wait status (exit code << 8, or the signal), -1 when unknown. */
private fun exitStatus(app: Context, pid: Int): Int {
if (pid <= 0 || android.os.Build.VERSION.SDK_INT < 30) return -1
val am = app.getSystemService(ActivityManager::class.java)
var recorded = false
repeat(20) {
am.getHistoricalProcessExitReasons(app.packageName, pid, 1).firstOrNull()?.let {
recorded = true
// an exit code only when the process exited itself; a signal number otherwise (a native crash)
if (it.reason == android.app.ApplicationExitInfo.REASON_EXIT_SELF) return (it.status and 0xff) shl 8
if (it.status in 1..64) return it.status and 0x7f
// Android records the death first and the zygote's status later (as UNKNOWN, 0, then
// EXIT_SELF): a reason without a status may still be completed
if (it.reason != android.app.ApplicationExitInfo.REASON_UNKNOWN) return OsConstants.SIGKILL
}
Thread.sleep(50)
}
// killed by Android with no signal recorded, not a clean exit
return if (recorded) OsConstants.SIGKILL else -1
}
/** The pids of session [of]'s guest programs running in workers. */
fun guestPids(of: Int = session): List<Int> =
synchronized(slots) { slots.mapNotNull { s -> s?.takeIf { it.guest && it.session == of }?.pid?.takeIf { it > 0 } } }
/** Ends session [of]'s guest programs that are still running, and, for the latest session, the warm workers. */
fun stopGuests(of: Int = session) {
// the check and the reset together: a new session's serve() may be under way
val drained = synchronized(authorizing) {
synchronized(slots) {
stopped = maxOf(stopped, of)
if (of != session) emptyList() else { warmTarget = 0; warm.toList().also { warm.clear() } }
}
}
context?.let { app -> drained.forEach { release(app, it) } }
val pids = guestPids(of)
if (pids.isEmpty()) return
pids.forEach { Process.sendSignal(it, OsConstants.SIGTERM) }
Thread.sleep(500)
pids.forEach { Process.killProcess(it) }
}
/** Listens for `droiddeck-spawn` requests from the session's guests. */
fun attach(context: Context) {
this.context = context.applicationContext
}
/** Starts a session's use of the workers (and the spawn socket, once); returns its number. */
fun serve(context: Context): Int {
val app = context.applicationContext
this.context = app
val number = synchronized(slots) { warmTarget = WARM_WORKERS; ++session }
refill(app)
synchronized(this) {
if (server != null) return number
server = Thread({
val socket = try {
LocalServerSocket(socketName(app))
} catch (e: Exception) {
Log.e(TAG, "no spawn socket", e)
synchronized(this) { server = null }
return@Thread
}
while (true) {
val client = runCatching { socket.accept() }.getOrNull()
if (client == null) {
Thread.sleep(100) // out of fds, for one: do not spin
continue
}
// A bounded number of requests still coming in: a stalled sender holds a thread
if (receiving.incrementAndGet() > MAX_RECEIVING) {
receiving.decrementAndGet()
Log.w(TAG, "$MAX_RECEIVING spawn requests are still coming in: refusing another")
runCatching { client.close() }
continue
}
Thread({
try {
handle(app, client) { receiving.decrementAndGet() }
} catch (e: Throwable) {
Log.w(TAG, "spawn request failed", e)
}
}, "guest-spawn").start()
}
}, "guest-spawn-server").apply { isDaemon = true; start() }
}
return number
}
private fun handle(app: Context, client: LocalSocket, received: () -> Unit) {
var receiving = true
val done = { if (receiving) { receiving = false; received() } }
try {
handleRequest(app, client, done)
} finally {
done()
}
}
private fun handleRequest(app: Context, client: LocalSocket, received: () -> Unit) {
client.use {
if (client.peerCredentials.uid != Process.myUid()) return
// The whole request and its fds within this, however slowly they come (the wait for a
// program's exit is not): each read gets what is left of it
val deadline = android.os.SystemClock.elapsedRealtime() + RECEIVE_TIMEOUT_MS
fun left() {
val ms = deadline - android.os.SystemClock.elapsedRealtime()
if (ms <= 0) throw java.net.SocketTimeoutException("spawn request not received in time")
client.soTimeout = ms.toInt()
}
val input = DataInputStream(client.inputStream)
val fds = ArrayList<ParcelFileDescriptor>()
fun take() {
val received = client.ancillaryFileDescriptors.orEmpty()
try {
received.forEach { fds.add(ParcelFileDescriptor.dup(it)) }
} finally {
received.forEach { runCatching { Os.close(it) } }
}
}
// fds can come with any read, the request's own bytes too: each read's are taken at once
fun fill(bytes: ByteArray) {
var got = 0
while (got < bytes.size) {
left()
val n = input.read(bytes, got, bytes.size - got)
take()
if (n < 0) throw java.io.EOFException("spawn request ended at $got of ${bytes.size} bytes")
got += n
}
}
// Until start() has them: closed on every way out before that, from the first byte on
var handedOver = false
try {
val length = ByteArray(4).also { fill(it) }.let { java.nio.ByteBuffer.wrap(it).int }
if (length !in 1..MAX_REQUEST_BYTES) {
Log.w(TAG, "spawn request of $length bytes refused")
return
}
val payload = ByteArray(length).also { fill(it) }
val request = JSONObject(String(payload))
if (request.has("fdchunks")) {
// The hook sends its fds after the request, a chunk with each byte (hook/handoff.c)
val total = (request.optJSONArray("fds")?.length() ?: 0) + (if (request.has("table")) 1 else 0)
while (fds.size < total) {
left()
if (input.read() < 0) throw java.io.EOFException("fds ended at ${fds.size} of $total")
take()
}
} else {
take()
}
received()
val argv = request.getJSONArray("argv").let { a -> List(a.length()) { a.getString(it) } }
val env = LinkedHashMap<String, String>()
request.optJSONObject("env")?.let { o -> o.keys().forEach { env[it] = o.getString(it) } }
request.optJSONArray("envlist")?.let { a ->
for (i in 0 until a.length()) a.getString(i).split('=', limit = 2).let { if (it.size == 2) env[it[0]] = it[1] }
}
// What the hook told the program that asked (it may run in a worker itself) is not this one's
env.keys.removeAll { it.startsWith("DDH_") }
val cwd = request.optString("cwd", "/")
val wait = request.optBoolean("wait", false)
// A path without a slash names a file in the cwd, as execve() takes it, not one on PATH
val file = request.optString("file", "").let { if (it.isNotEmpty() && '/' !in it) "./$it" else it }
// The handoff table (the hook's) comes last among the fds; the rest go to these numbers.
val tableIndex = request.optInt("table", -1)
val numbers = request.optJSONArray("fds")?.let { a -> IntArray(a.length()) { a.getInt(it) } } ?: IntArray(3) { it }
val table = fds.getOrNull(tableIndex)?.takeIf { pfd ->
runCatching { Os.readlink("/proc/self/fd/${pfd.fd}") }.getOrNull()?.contains("ddnatv-handoff") == true
}
val slot = request.optInt("slot", -1)
val parent = request.optInt("parent", -1)
var programFds = fds.filterIndexed { i, _ -> i != tableIndex }
var targets = numbers
if (table != null && slot >= 0) {
// The program reports its own exit status into the table (hook/handoff.c)
val tableFd = (numbers.maxOrNull() ?: 2) + 1
programFds = programFds + table
targets = numbers + tableFd
env["DDH_TABLE"] = "$tableFd:$slot:$parent:${request.optInt("child", -1)}"
}
val root = env["DDNATV_ROOT"]?.let(::File)
val out = client.outputStream
if (root == null || argv.isEmpty()) {
out.write("error no guest root or program\n".toByteArray())
return
}
val shell = listOf("/usr/bin/bash", "/bin/bash").first { File(root, it.removePrefix("/")).isFile }
val args = if (file.isNotEmpty()) {
listOf("-c", "unset DDH_WRAPPER; cd -- \"\$1\" 2>/dev/null; a=\$2; f=\$3; shift 3; exec -a \"\$a\" \"\$f\" \"\$@\"",
"droiddeck-spawn", cwd, argv[0], file) + argv.drop(1)
} else {
listOf("-c", "unset DDH_WRAPPER; cd -- \"\$1\" 2>/dev/null; shift; exec \"\$@\"", "droiddeck-spawn", cwd) + argv
}
val command = NativeGuest.command(root, shell, args)
env["DDNATV_REAL_EXE"] = File(root, shell.removePrefix("/")).path
// The hook restores these in the program (tools/nativeguest/hook/handoff.c).
if (request.has("sigign")) env["DDH_SIGIGN"] = request.getLong("sigign").toString()
if (request.has("nofile")) {
env["DDH_NOFILE"] = request.getLong("nofile").toString() +
(if (request.has("nofilemax")) ":" + request.getLong("nofilemax") else "")
}
if (request.has("umask")) env["DDH_UMASK"] = request.getLong("umask").toString()
if (request.has("pgid")) env["DDH_PGID"] = request.getLong("pgid").toString()
if (request.has("anchor")) env["DDH_ANCHOR"] = request.getLong("anchor").toString()
if (request.has("pstart")) env["DDH_PSTART"] = request.getLong("pstart").toString()
if (request.has("astart")) env["DDH_ASTART"] = request.getLong("astart").toString()
env["DDH_SIGMASK"] = request.optLong("sigmask", 0L).toString()
// The shell above: the hook restores nothing there (bash changes its own signal mask),
// only in the program it execs, which no longer has this.
env["DDH_WRAPPER"] = "1"
val child = request.optInt("child", -1)
val exited = CountDownLatch(1)
var status = -1
var worker = -1
// The hook answers the pid with "go" (ack): without it (it died, or gave up and runs the
// program itself) the worker must not run it too.
val ack = request.optBoolean("ack", false)
var answered = false
// the hook's last word, sent once the worker has taken the program on and before it runs it
var confirmedToHook = false
// The session whose guest asks, not the latest: a new session can start (serve()) while an
// older one's guests are still sending, and that older one's teardown must find its programs.
// A request that names none is refused (start() runs nothing for session 0): the hook and
// droiddeck-spawn always name it, and which session's it is cannot be told otherwise.
val owner = request.optInt("session", 0).coerceAtLeast(0)
val pid = start(app, command, env.map { (k, v) -> "$k=$v" }, programFds, targets, true, owner = owner, onExit = { code ->
status = code
if (table != null && slot >= 0) reportExit(table, slot, code, parent, child, worker)
exited.countDown()
}, confirmed = {
!ack || runCatching {
out.write("ok\n".toByteArray())
out.flush()
confirmedToHook = true
}.isSuccess
}, commit = { started ->
worker = started
if (!ack) return@start true
runCatching {
out.write("pid $started\n".toByteArray())
out.flush()
answered = true
client.soTimeout = ACK_TIMEOUT_MS
// the whole line: a hook whose write stopped short treats it as failed and runs the program itself
val line = StringBuilder()
var ended = false
while (!ended) {
val c = input.read()
if (c < 0) break
if (c == '\n'.code) ended = true else line.append(c.toChar())
}
ended && line.toString() == "go"
}.getOrDefault(false)
})
handedOver = true
programFds.filter { it !== table }.forEach { runCatching { it.close() } }
if (pid <= 0) table?.let { runCatching { it.close() } }
if (!answered) {
out.write(if (pid > 0) "pid $pid\n".toByteArray() else "error no worker\n".toByteArray())
out.flush()
} else if (!confirmedToHook) {
// nothing runs it in a worker: the hook runs it itself
runCatching { out.write("error not started\n".toByteArray()); out.flush() }
}
if (pid > 0 && wait) {
exited.await()
// droiddeck-spawn exits with this: an exit code, or 128 plus the signal
val code = if (status < 0) 1 else if (status and 0x7f == 0) (status shr 8) and 0xff else 128 + (status and 0x7f)
out.write("exit $code\n".toByteArray())
out.flush()
}
} finally {
if (!handedOver) fds.forEach { runCatching { it.close() } }
}
}
}
// Layout of the hook's table (tools/nativeguest/hook/handoff.c): a 64-byte header, then 64-byte
// entries of int32 child, real, parent, state, ..., and at 32 the app's report: int32 status, child.
// The report is one 8-byte write tagged with the child it is for; only the hook changes an
// entry's state, so a report that lands after the entry went to another child is ignored there.
private fun reportExit(table: ParcelFileDescriptor, slot: Int, status: Int, parent: Int, child: Int, worker: Int) {
runCatching {
val entry = 64L + slot * 64L
val head = java.nio.ByteBuffer.allocate(16).order(java.nio.ByteOrder.nativeOrder())
Os.pread(table.fileDescriptor, head, entry)
val real = head.getInt(4)
val state = head.getInt(12)
// Also while the hook holds the entry (TAKEN) or has already guessed its end (EXITED):
// the report is for this child only, and wins over the timeout's guess (ddh_status)
if (head.getInt(0) != child || head.getInt(8) != parent || (real != 0 && real != worker) || state !in 1..4)
return@runCatching
// An exit Android has no record of is reported as a failure, not as a signal.
val report = java.nio.ByteBuffer.allocate(8).order(java.nio.ByteOrder.nativeOrder())
.putInt(0, if (status < 0) 1 shl 8 else status).putInt(4, child)
Os.pwrite(table.fileDescriptor, report, entry + 32)
if (parent > 0) Process.sendSignal(parent, OsConstants.SIGCHLD)
}.onFailure { Log.w(TAG, "could not report an exit to the guest's parent", it) }
runCatching { table.close() }
}
}
@@ -130,8 +130,6 @@ object SessionFiles {
"usr/local/bin/droiddeck-agent" to "usr/local/bin/droiddeck-agent",
"usr/local/bin/steam-compatibility" to "usr/local/bin/steam-compatibility",
"usr/local/bin/droiddeck-clipboard" to "usr/local/bin/droiddeck-clipboard",
"usr/local/bin/droiddeck-spawn" to "usr/local/bin/droiddeck-spawn",
"usr/local/bin/droiddeck-log-writer" to "usr/local/bin/droiddeck-log-writer",
"usr/local/bin/droiddeck-desktop-clipboard" to "usr/local/bin/droiddeck-desktop-clipboard",
"usr/local/bin/droiddeck-gpu-window" to "usr/local/bin/droiddeck-gpu-window",
"usr/local/bin/droiddeck-steam-install" to "usr/local/bin/droiddeck-steam-install",
@@ -156,6 +154,7 @@ object SessionFiles {
"usr/local/bin/droiddeck-desktop-bookmarks" to "usr/local/bin/droiddeck-desktop-bookmarks",
"usr/local/bin/droiddeck-downloads" to "usr/local/bin/droiddeck-downloads",
"usr/local/bin/droiddeck-root" to "usr/local/bin/droiddeck-root",
"usr/local/bin/droiddeck-user" to "usr/local/bin/droiddeck-user",
"usr/local/bin/droiddeck-text" to "usr/local/bin/droiddeck-text",
"usr/local/bin/droiddeck-snapd" to "usr/local/bin/droiddeck-snapd",
"usr/local/bin/droiddeck-emulators" to "usr/local/bin/droiddeck-emulators",
@@ -360,6 +359,7 @@ object SessionFiles {
Log.e(TAG, "could not write steam-compatibility-label")
}
writeCjkFontConfig(root, etc)
writeSessionBusPolicy(etc)
writeDesktopStrings(context, File(etc, "droiddeck").apply { mkdirs() })
val droiddeckEtc = File(etc, "droiddeck").apply { mkdirs() }
val stagedSocket = File(droiddeckEtc, "bwrap-socket.staged")
@@ -882,6 +882,24 @@ object SessionFiles {
}
}
/**
* A session bus admits only its owner, and with droiddeck-user (the native hook's ordinary
* user) a root process and a user's share the bus while the kernel sees one Android uid.
*/
private fun writeSessionBusPolicy(etc: File) {
val xml = """<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy context="default">
<allow user="*"/>
</policy>
</busconfig>
"""
val conf = File(etc, "dbus-1/session.d/droiddeck-users.conf")
conf.parentFile?.mkdirs()
if (!FileUtils.writeString(conf, xml)) Log.e(TAG, "could not write the session bus policy")
}
private fun writeCjkFontConfig(root: File, etc: File) {
try {
val confDir = File(etc, "fonts/conf.d").apply { mkdirs() }
@@ -63,6 +63,24 @@ object SessionPrefs {
.takeIf { value -> orientationOptions.any { it.first == value } }
?: ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
fun orientation(context: Context, mode: String?): Int {
val key = when (mode) {
"steam", SessionService.MODE_STEAM, SessionService.MODE_RUN -> "orientation.steam"
"desktop", SessionService.MODE_DESKTOP -> "orientation.desktop"
else -> null
} ?: return orientation(context)
val stored = prefs(context).getInt(key, Int.MIN_VALUE)
return if (stored == Int.MIN_VALUE) orientation(context)
else stored.takeIf { value -> orientationOptions.any { it.first == value } } ?: orientation(context)
}
fun setOrientation(context: Context, mode: String, orientation: Int) {
require(mode == "steam" || mode == "desktop")
require(orientationOptions.any { it.first == orientation })
val key = if (mode == "steam") "orientation.steam" else "orientation.desktop"
prefs(context).edit().putInt(key, orientation).apply()
}
/** The session menu's width in dp the user dragged it to; null keeps the default. */
fun drawerWidthDp(context: Context): Int? = prefs(context).getInt("drawerWidthDp", 0).takeIf { it > 0 }
@@ -75,11 +93,19 @@ object SessionPrefs {
prefs(context).edit().putInt("orientation", orientation).apply()
}
fun windowOrientation(context: Context, followScreen: Boolean, smallestWidthDp: Int): Int =
if (followScreen && smallestWidthDp >= SessionDisplay.UNFOLDED_MIN_DP && !prefs(context).contains("orientation"))
fun windowOrientation(context: Context, followScreen: Boolean, smallestWidthDp: Int, mode: String? = null): Int {
val modeKey = when (mode) {
"steam", SessionService.MODE_STEAM, SessionService.MODE_RUN -> "orientation.steam"
"desktop", SessionService.MODE_DESKTOP -> "orientation.desktop"
else -> null
}
val preferences = prefs(context)
if (modeKey != null && preferences.contains(modeKey)) return orientation(context, mode)
return if (followScreen && smallestWidthDp >= SessionDisplay.UNFOLDED_MIN_DP && !preferences.contains("orientation"))
ActivityInfo.SCREEN_ORIENTATION_USER else orientation(context)
}
fun portrait(context: Context): Boolean = when (orientation(context)) {
fun portrait(context: Context, mode: String? = null): Boolean = when (orientation(context, mode)) {
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT -> true
ActivityInfo.SCREEN_ORIENTATION_USER ->
context.resources.configuration.orientation == android.content.res.Configuration.ORIENTATION_PORTRAIT
@@ -493,6 +519,17 @@ object SessionPrefs {
prefs(context).edit().putString("drawerPageHidden", keys.joinToString(",")).apply()
}
fun drawerSections(context: Context): Map<String, Boolean> =
idList(prefs(context).getString("drawerSections", null)).mapNotNull { entry ->
val at = entry.lastIndexOf('=').takeIf { it > 0 } ?: return@mapNotNull null
entry.substring(0, at) to (entry.substring(at + 1) == "1")
}.toMap()
fun setDrawerSections(context: Context, sections: Map<String, Boolean>) {
prefs(context).edit().putString("drawerSections", sections.entries.filter { ',' !in it.key }
.joinToString(",") { "${it.key}=${if (it.value) 1 else 0}" }).apply()
}
fun setNavTabHidden(context: Context, keys: Set<String>) {
prefs(context).edit().putString("navTabHidden", keys.joinToString(",")).apply()
}
@@ -1100,13 +1137,17 @@ object SessionPrefs {
fun nativeUserland(context: Context): Boolean = prefs(context).getBoolean("nativeUserland", true)
/** The session's long-lived programs run in worker processes Android does not count (GuestWorkers). */
fun childProcessHandoff(context: Context): Boolean = prefs(context).getBoolean("childProcessHandoff", true)
fun setNativeUserland(context: Context, on: Boolean) {
prefs(context).edit().putBoolean("nativeUserland", on).apply()
}
/** Whether the Plasma desktop, and so its apps and shells, runs as an ordinary user instead of root (native userland only). */
fun desktopAsUser(context: Context): Boolean = prefs(context).getBoolean("desktopAsUser", false)
fun setDesktopAsUser(context: Context, on: Boolean) {
prefs(context).edit().putBoolean("desktopAsUser", on).apply()
}
fun prootFastPath(context: Context): Boolean = prefs(context).getBoolean("prootFastPath", true)
fun setProotFastPath(context: Context, on: Boolean) {
@@ -1810,16 +1851,15 @@ object SessionPrefs {
const val PIP_FPS = 30
fun compositorFpsLimit(mirrorRefreshLimit: Int, sessionLimit: Int = 0, pip: Boolean = false): Int {
val limit = when {
mirrorRefreshLimit <= 0 && sessionLimit <= 0 -> FPS_UNPACED
mirrorRefreshLimit <= 0 -> sessionLimit
sessionLimit <= 0 -> mirrorRefreshLimit
else -> minOf(mirrorRefreshLimit, sessionLimit)
}
fun compositorFpsLimit(mirrorRefreshLimit: Int, sessionLimit: Int = 0, pip: Boolean = false, hostCap: Int = 0): Int {
val limit = listOf(mirrorRefreshLimit, sessionLimit, hostCap).filter { it > 0 }.minOrNull() ?: FPS_UNPACED
return if (pip && mirrorRefreshLimit <= 0 && (limit <= 0 || limit > PIP_FPS)) PIP_FPS else limit
}
/** The per-app rate Android holds this window to (Game Mode's FPS override), or 0 when the panel's rate applies. */
fun hostFrameCap(overrideHz: Float, panelHz: Float): Int =
if (overrideHz > 1f && panelHz - overrideHz > 1f) Math.round(overrideHz) else 0
val upscalerChoices = listOf(
2 to "Nearest", 0 to "Linear", 4 to "AMD FSR 1", 3 to "Snapdragon GSR",
8 to "Snapdragon GSR (quality)", 7 to "NVIDIA NIS", 6 to "Sharpen only",
@@ -661,7 +661,7 @@ class SessionService : Service() {
Log.i(TAG, "game resolution: ${w}x$h on a ${size.first}x${size.second} output")
}
if (SessionState.followScreen || size.first < size.second ||
SessionPrefs.orientation(this) == android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER)
SessionPrefs.orientation(this, SessionState.mode) == android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER)
guest.add("DD_FOLLOW_OUTPUT=1")
if (SessionState.hdr) {
guest.add("DD_HDR=1")
@@ -705,24 +705,11 @@ class SessionService : Service() {
if (com.droiddeck.launcher.gpu.Lossless.owned(this)) guest.add("DD_LOSSLESS_OWNED=1")
}
guest.add("DD_LAUNCH_DIR=" + sessionRoot.path)
// this session's worker number: the shared field may be a newer session's by the time it is used
var ownWorkers = 0
if (com.droiddeck.launcher.runtime.GuestWorkers.enabled(this)) {
// Under the lock a stop takes its number with: a stop either comes first (and this session
// starts no workers) or owns them
ownWorkers = synchronized(stopLock) {
if (gen != sessionGen || !SessionState.running) 0
else com.droiddeck.launcher.runtime.GuestWorkers.serve(this).also { guestWorkerSession = it }
}
if (ownWorkers > 0) {
guest.add("DD_SPAWN=" + com.droiddeck.launcher.runtime.GuestWorkers.socketName(this))
guest.add("DD_SPAWN_SESSION=$ownWorkers")
}
}
// Proton builds up to 11.12 report X11 text fields under this name.
guest.add("BL_LAUNCH_DIR=" + sessionRoot.path)
GameStorage.effective(this)?.let { guest.add("DD_LIBRARY_LABEL=" + it.label.replace('"', ' ')) }
if (SessionState.mode == MODE_STEAM && SessionState.steamUi == "desktop") guest.add("DD_STEAM_UI=desktop")
if (SessionPrefs.desktopAsUser(this)) guest.add("DD_DESKTOP_USER=1")
// Detailed graphics logs: per-game logs and the guest's Vulkan summary (a GPU that is not
// an Adreno, or Setup's switch), and graphics-report.txt for every session.
if (GraphicsReport.detailed(this)) guest.add("DD_GAME_LOGS=1")
@@ -877,10 +864,10 @@ class SessionService : Service() {
watchLaunchRequests(sessionRoot)
watchSyncWanted(root)
EsyncPacks.fetchInBackground(this, root)
val pid = SessionEvents.step("guest-launch") { HostProcess.startUncounted(line, hostEnv.asArray(), root, { status ->
val pid = SessionEvents.step("guest-launch") { HostProcess.start(line, hostEnv.asArray(), root, { status ->
if (gen != sessionGen) {
Log.i(TAG, "an earlier session's process ended ($status); the current one carries on")
return@startUncounted
return@start
}
val program = programStatus(sessionRoot)
Log.i(TAG, "session ended: $status" + if (program != null) " (program $program)" else "")
@@ -896,13 +883,10 @@ class SessionService : Service() {
syncWatcher = null
}
abandonStart(gen, sessionDir, started)
val workers = ownWorkers
if (pid > 1) Thread({ teardown(pid, workerSession = workers) }, "session-teardown").start()
else com.droiddeck.launcher.runtime.GuestWorkers.stopGuests(workers)
if (pid > 1) Thread({ teardown(pid) }, "session-teardown").start()
return
}
sessionPid = pid
com.droiddeck.launcher.runtime.GuestWorkers.sessionRootUncounted = com.droiddeck.launcher.runtime.GuestWorkers.runsInWorker(pid)
if (pid > 1) {
raiseTracer(pid, gen)
SessionEvents.guestStarted(pid)
@@ -1552,15 +1536,10 @@ class SessionService : Service() {
return binds
}
// The workers' session number of the session running now (GuestWorkers.serve)
@Volatile private var guestWorkerSession = 0
private fun teardown(prootPid: Int, expectedStartTime: Long? = null, workerSession: Int = guestWorkerSession) {
private fun teardown(prootPid: Int, expectedStartTime: Long? = null) {
fun stillSameProcess(): Boolean = expectedStartTime == null || readStat(prootPid)?.second == expectedStartTime
if (!stillSameProcess()) return
// The session's programs that run in worker processes are not descendants of its root.
val workers = if (expectedStartTime == null) com.droiddeck.launcher.runtime.GuestWorkers.guestPids(workerSession) else emptyList()
val tree = descendants(prootPid) + workers.flatMap { pid -> listOfNotNull(readStat(pid)?.let { Pair(pid, it.second) }) + descendants(pid) }
val tree = descendants(prootPid)
if (!stillSameProcess()) return
saveWineRegistries(tree)
android.os.Process.sendSignal(prootPid, 15)
@@ -1577,7 +1556,6 @@ class SessionService : Service() {
killed++
}
if (killed > 0) Log.i(TAG, "swept $killed process(es) proot left behind")
if (expectedStartTime == null) com.droiddeck.launcher.runtime.GuestWorkers.stopGuests(workerSession)
}
private fun clearCachedApps() {
@@ -2348,16 +2326,12 @@ class SessionService : Service() {
return
}
completeNativeSleep()
var workers = 0
val (ended, endedArch) = synchronized(stopLock) {
if (gen != null && gen != sessionGen) return
// as it is when running is cleared: startup registers its workers under this lock too
workers = guestWorkerSession
cancelQueuedSteamGame()
gameExitWatchToken++
// also when startup stopped before the guest ran
com.droiddeck.launcher.runtime.NativeGuest.sessionMode = null
com.droiddeck.launcher.runtime.GuestWorkers.sessionRootUncounted = null
if (!SessionState.running) return
if (relaunch) SessionState.confirmRelaunchStop()
SessionEvents.record("guest.exited", mapOf("status" to status))
@@ -2418,8 +2392,7 @@ class SessionService : Service() {
if (prootPid > 1 && steamClientMayRun) askSteamToExit(prootPid)
com.droiddeck.launcher.stores.gog.GogComet.end(stoppedSession)
auxiliary.forEach { (pid, started) -> teardown(pid, started) }
if (prootPid > 1) teardown(prootPid, workerSession = workers)
else com.droiddeck.launcher.runtime.GuestWorkers.stopGuests(workers)
if (prootPid > 1) teardown(prootPid)
killGuestLeftovers(ended)
pruneSystemVulkanRuntime()
finishSessionStop(status, stoppedGen, collectEnded)
@@ -2428,7 +2401,6 @@ class SessionService : Service() {
} else {
Thread({ pruneSystemVulkanRuntime() }, "system-vulkan-prune").start()
Thread({
com.droiddeck.launcher.runtime.GuestWorkers.stopGuests(workers)
com.droiddeck.launcher.stores.gog.GogComet.end(stoppedSession)
finishSessionStop(status, stoppedGen, collectEnded)
if (launcherEnded) importLauncherGames()
@@ -18,7 +18,7 @@ object SettingsReset {
"storesInstallLanguage",
"hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "__KEEP_droidDeckHud__", "__KEEP_droidDeckHudPos__", "backHold", "dockedMenuController", "backActionsInverted", "backDoubleTapMs", "touch", "pen", "penButton", "osc", "shape", "steamController",
"gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "unfoldedControlsWithController",
"stretch16x9", "avoidNotch", "picturePosition", "integerScaling", "railLabels", "developerTools", "navTabOrder", "navTabShelved", "navTabHidden", "drawerPageOrder", "drawerPageHidden", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys",
"stretch16x9", "avoidNotch", "picturePosition", "integerScaling", "railLabels", "developerTools", "navTabOrder", "navTabShelved", "navTabHidden", "drawerPageOrder", "drawerPageHidden", "drawerSections", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys",
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "paceCores",
"directAudio", "mic", "wifiDiscovery", "clientCpusOverride", "clientCpus", "gameCpus",
@@ -10,9 +10,23 @@ import java.io.File
// browser view placed outside the Big Picture window, composition capped at "notification" so gamescope keeps the game
// focused, and gamepad focus on the main UI. The hold is a lease the app renews, so Steam recovers if the app goes away.
object SteamQam {
data class Target(val port: Int, val path: String)
/** [mainPath] is Steam's main menu page, shown beside the quick access menu in the split layout. */
data class Target(val port: Int, val path: String, val mainPath: String? = null)
const val MAIN_MENU = 1
const val QUICK_ACCESS = 2
/** Height in CSS pixels both menus are laid out at in the split layout, so they show at one scale. */
const val SPLIT_CSS_HEIGHT = 480
/** Steam's own width for the main menu; quick access takes the rest of the panel. */
const val MAIN_CSS_WIDTH = 240
/** Holds the parked main menu in place and spreads its item rows (not dividers) over the full height, at most 80 px each. */
private const val MAIN_PARKED_CSS =
".BasicUI > .Panel { transform: none !important; width: 100% !important; height: 100% !important; margin: 0 !important; } " +
".BasicUI > .Panel > :has(> .Focusable) { flex: 1 1 0 !important; height: auto !important; max-height: 80px; } " +
".BasicUI > .Panel > :has(> .Focusable) > .Panel { height: 100% !important; }"
const val LEASE_MS = 5_000
private const val TAG = "SteamQam"
private const val EVAL_MS = 6_000L
@@ -26,21 +40,54 @@ object SteamQam {
* Takes or renews the lease for [owner], or releases it. A live lease held by a newer panel is never taken back by an
* older one, so a late request from a panel being torn down cannot end its replacement's lease or change its layout.
*/
internal fun leaseScript(on: Boolean, owner: Long, aspect: Float = 0f): String =
internal fun leaseScript(on: Boolean, owner: Long, aspect: Float = 0f, split: Boolean = false): String =
if (on) "if (!(g.__ddQamUntil > Date.now()) || !(g.__ddQamOwner > $owner)) { g.__ddQamOwner = $owner; g.__ddQamUntil = Date.now() + $LEASE_MS;" +
(if (aspect > 0f) " g.__ddQamAspect = $aspect;" else "") + " }"
(if (aspect > 0f) " g.__ddQamAspect = $aspect;" else "") + " g.__ddQamSplit = $split; }"
else "if (g.__ddQamOwner === $owner) g.__ddQamUntil = 0;"
/** [aspect] is the panel's width over height: the menu is laid out at that shape so every tab shows at one scale. */
internal fun script(on: Boolean, aspect: Float = 0f, owner: Long = 0): String = """(() => {
const g = globalThis, QAM = 2;
/**
* [aspect] is the panel's width over height: the menu is laid out at that shape so every tab shows at one scale. With
* [split], Steam's main menu is kept rendered at its own width beside the quick access menu, which gets the rest.
*/
internal fun script(on: Boolean, aspect: Float = 0f, owner: Long = 0, split: Boolean = false): String = """(() => {
const g = globalThis, QAM = 2, MAIN = 1;
const W = SteamUIStore.WindowStore.SteamUIWindows[0];
const m = W.MenuStore, c = W.m_CompositionStateStore;
const nav = W.m_FocusNavContext;
const popup = g_PopupManager.GetExistingPopup("SP BPM_uid0");
const held = () => g.__ddQamUntil > Date.now();
const ours = () => held() && m.m_eOpenSideMenu === QAM && !g.__ddQamTop;
const split = () => held() && g.__ddQamSplit === true;
// Steam's views carry no names: the main menu's is the one Steam focuses while the main menu is open. Until Steam
// has shown it, the main menu is opened once with its view parked like the quick access menu's.
const probing = () => g.__ddMainProbe > Date.now();
const ours = () => held() && !g.__ddQamTop && (m.m_eOpenSideMenu === QAM || (probing() && m.m_eOpenSideMenu === MAIN));
const width = (h) => g.__ddQamAspect > 0 ? Math.round(h * g.__ddQamAspect) : 0;
const parkX = () => popup.m_popup.innerWidth + 64;
const mainSize = () => [$MAIN_CSS_WIDTH, $SPLIT_CSS_HEIGHT];
const qamSplitSize = () => [Math.max(Math.round($SPLIT_CSS_HEIGHT * (g.__ddQamAspect > 0 ? g.__ddQamAspect : 1)) - $MAIN_CSS_WIDTH, 320), $SPLIT_CSS_HEIGHT];
const size = (w, h) => split() ? qamSplitSize() : [width(h) || w, h];
const mainView = () => views().find(v => v.__ddMain);
// Only the quick access view is parked: the one Steam focuses while quick access is open. Before Steam has
// focused it, any view but the main menu's and the header's web page (Store and other pages) may be it.
const headerView = () => W.m_HeaderStore?.m_currentBrowserAndBackstack?.m_browserView;
const isQam = (v) => !v.__ddMain && v !== headerView() &&
(!!v.__ddQamView || !views().some(o => o.__ddQamView) || (probing() && m.m_eOpenSideMenu === MAIN));
const mainParked = () => split() && (m.m_eOpenSideMenu !== MAIN || probing());
const mainDoc = () => {
for (const s of SteamUIStore.m_GamepadNavigationManager?.m_rgGamepadInputSources || []) {
try { const d = s.m_targetWindow?.document; if (d?.title?.startsWith("MainMenu")) return d; } catch (e) {}
}
return null;
};
// Steam slides the main menu out whenever it is not the open side menu; parked, it stays in place and fills its view.
const mainStyle = (on) => {
const d = mainDoc();
let s = d?.getElementById("dd-main-split");
if (!on) { s?.remove(); return; }
if (!d?.head) return;
if (!s) { s = d.createElement("style"); s.id = "dd-main-split"; d.head.appendChild(s); }
if (s.textContent !== "$MAIN_PARKED_CSS") s.textContent = "$MAIN_PARKED_CSS";
};
if (!c.__ddQam) {
c.__ddQam = c.ComputeOverallMinimumRequestedComposition;
m.__ddQam = m.OnMenuDeactivated;
@@ -59,6 +106,18 @@ object SteamQam {
return without >= 2 ? v : 1;
};
}
// Steam frosts its Store page while a side menu is open; a parked menu is not over it.
const inst = m.m_Instance;
if (inst?.SetStoreBrowserGlass && !inst.__ddQamGlass) {
inst.__ddQamGlass = inst.SetStoreBrowserGlass;
inst.SetStoreBrowserGlass = function (e) { return inst.__ddQamGlass.call(this, ours() ? 0 : e); };
}
const glass = () => {
const on = !ours() && m.m_eOpenSideMenu !== 0;
if (g.__ddQamGlassOn === on) return;
g.__ddQamGlassOn = on;
inst?.SetStoreBrowserGlass?.(m.m_eOpenSideMenu);
};
const views = () => popup?.m_rgChildBrowserViews || [];
const backdrop = (hide) => {
const doc = popup?.m_popup?.document;
@@ -75,16 +134,61 @@ object SteamQam {
};
const keep = () => {
for (const v of views()) {
if (v.__ddQam) continue;
v.__ddQam = v.SetBounds;
if (!v.__ddQam) v.__ddQam = v.SetBounds;
if (v.__ddQamW === 4) continue;
v.__ddQamW = 4;
v.__ddQamVis = v.__ddQamVis || v.SetVisible;
v.__ddQamFocus = v.__ddQamFocus || v.SetFocus;
v.SetBounds = function (x, y, w, h, ...r) {
if (v.__ddMain && mainParked()) {
if (w > 0) v.__ddMainAsked = [x, y, w, h];
[w, h] = mainSize();
v.__ddMainOn = true; v.__ddMainW = w; v.__ddMainH = h;
return v.__ddQam.call(this, parkX(), 0, w, h, ...r);
}
if (v.__ddMain && w > 0) mainStyle(false);
v.__ddAsked = [x, y, w, h];
if (w > 0 && ours()) { x = popup.m_popup.innerWidth + 64; w = width(h) || w; }
if (w > 0 && ours() && isQam(v)) { x = parkX(); [w, h] = size(w, h); }
v.__ddAt = x;
v.__ddW = w;
v.__ddH = h;
return v.__ddQam.call(this, x, y, w, h, ...r);
};
v.SetVisible = function (on, ...r) {
return v.__ddQamVis.call(this, on || (!!v.__ddMain && mainParked()), ...r);
};
v.SetFocus = function (on, ...r) {
if (on && m.m_eOpenSideMenu === MAIN && v !== headerView()) {
for (const o of views()) if (o !== v) delete o.__ddMain;
v.__ddMain = true;
delete v.__ddQamView;
}
if (on && m.m_eOpenSideMenu === QAM && !v.__ddMain && v !== headerView()) {
for (const o of views()) if (o !== v) delete o.__ddQamView;
v.__ddQamView = true;
}
return v.__ddQamFocus.call(this, on, ...r);
};
}
if (g.__ddMainProbe && !probing()) { g.__ddMainProbe = 0; g.__ddMainProbed = true; }
if (probing() && mainView()) { g.__ddMainProbe = 0; g.__ddMainProbed = true; }
const mv = mainView();
if (mv && !probing()) {
if (mainParked()) {
const [w, h] = mainSize();
if (!mv.__ddMainOn || mv.__ddMainW !== w || mv.__ddMainH !== h) {
mv.__ddQam.call(mv, parkX(), 0, w, h);
mv.__ddQamVis.call(mv, true);
mv.__ddMainOn = true; mv.__ddMainW = w; mv.__ddMainH = h;
}
} else if (mv.__ddMainOn) {
mv.__ddMainOn = false;
if (m.m_eOpenSideMenu !== MAIN) { mv.__ddQamVis.call(mv, false); mv.__ddQam.call(mv, 0, 0, 0, 0); }
else if (mv.__ddMainAsked) mv.__ddQam.call(mv, ...mv.__ddMainAsked);
}
}
mainStyle(!!mv && mainParked() && !probing());
glass();
if (!held()) {
const parked = !g.__ddQamTop;
g.__ddQamTop = false;
@@ -124,6 +228,25 @@ object SteamQam {
}
g.__ddQamTop = false;
}
// Each Split activation gets a fresh probe budget, and a spent one refills after a backoff, so a Steam that was
// still loading does not leave the main menu undiscovered for good.
if (split() !== !!g.__ddQamSplitOn) { g.__ddQamSplitOn = split(); if (split()) g.__ddMainProbes = 0; }
if (split() && !mv) {
if (probing()) return;
if ((g.__ddMainProbes || 0) >= 3 && Date.now() - (g.__ddMainProbeLast || 0) > 30000) g.__ddMainProbes = 0;
if ((g.__ddMainProbes || 0) < 3 && m.m_eOpenSideMenu !== MAIN) {
g.__ddMainProbes = (g.__ddMainProbes || 0) + 1;
g.__ddMainProbeLast = Date.now();
g.__ddMainProbe = Date.now() + 1500;
m.OpenMainMenu();
c.EnsureCorrectComposition?.();
return;
}
}
if (g.__ddMainProbed) {
g.__ddMainProbed = false;
if (m.m_eOpenSideMenu === MAIN) m.OpenQuickAccessMenu(g.__ddQamTab ?? undefined);
}
const decky = !!g.DeckyPluginLoader?.tabsHook?.qamBrowserViewPatch;
// Decky hooks the menu after Steam starts; the menu has to unmount for its tab to appear, so reopen on the next tick.
if (m.m_eOpenSideMenu === QAM && decky && !g.__ddQamDecky) { g.__ddQamDecky = true; m.CloseSideMenus(); return; }
@@ -136,18 +259,26 @@ object SteamQam {
if (m.m_eQuickAccessTab != null) g.__ddQamTab = m.m_eQuickAccessTab;
if (!g.__ddQamOn) { g.__ddQamOn = true; c.EnsureCorrectComposition?.(); }
for (const v of views()) {
if (v.__ddMain) continue;
if (!isQam(v)) {
// A view parked before the quick access view was known goes back where Steam asked for it.
const a = v.__ddAsked;
if (a?.[2] > 0 && v.__ddAt >= popup.m_popup.innerWidth) { v.__ddQam.call(v, ...a); v.__ddAt = a[0]; v.__ddW = a[2]; v.__ddH = a[3]; }
continue;
}
if (!v.__ddAsked) {
const b = v.GetBounds?.();
if (b && b.width > 0) { v.__ddAsked = [b.x, b.y, b.width, b.height]; v.__ddAt = b.x; v.__ddW = b.width; }
if (b && b.width > 0) { v.__ddAsked = [b.x, b.y, b.width, b.height]; v.__ddAt = b.x; v.__ddW = b.width; v.__ddH = b.height; }
}
const a = v.__ddAsked;
if (a?.[2] > 0 && (v.__ddAt < popup.m_popup.innerWidth || (width(a[3]) && v.__ddW !== width(a[3])))) v.SetBounds(...a);
const [w, h] = a?.[2] > 0 ? size(a[2], a[3]) : [0, 0];
if (a?.[2] > 0 && (v.__ddAt < popup.m_popup.innerWidth || v.__ddW !== w || v.__ddH !== h)) v.SetBounds(...a);
}
const main = nav?.m_rgGamepadNavigationTrees?.find(t => t.m_ID === "GamepadUI_Full_Root");
if (main && nav.m_LastActiveNavTree?.m_ID?.startsWith("QuickAccess")) nav.SetActiveNavTree(main);
if (main && /^(QuickAccess|MainMenu)/.test(nav.m_LastActiveNavTree?.m_ID ?? "")) nav.SetActiveNavTree(main);
backdrop(true);
};
${leaseScript(on, owner, aspect)}
${leaseScript(on, owner, aspect, split)}
keep();
if (held() && !g.__ddQamTimer) {
g.__ddQamTimer = setInterval(() => {
@@ -161,7 +292,8 @@ object SteamQam {
/** [open] is Steam's open side menu; [top] is true while the menu is shown on the top screen. */
data class Hold(val open: Int, val top: Boolean)
fun hold(context: Context, aspect: Float, owner: Long): Hold? = eval(context, script(true, aspect, owner))?.let(::parseHold)
fun hold(context: Context, aspect: Float, owner: Long, split: Boolean = false): Hold? =
eval(context, script(true, aspect, owner, split))?.let(::parseHold)
internal fun parseHold(text: String): Hold? = runCatching {
val a = JSONArray(text)
@@ -181,7 +313,9 @@ object SteamQam {
fun target(context: Context): Target? = runCatching {
val devtools = File(AgentGuest.dir(context), "cdp-port").readText().trim().toInt()
val (relay, secret) = parseRelay(helper(context, "start", devtools.toString())) ?: return null
val found = runCatching { parseTarget(relay, get(relay, "/$secret/json"))?.let { it.copy(path = "/$secret${it.path}") } }
val found = runCatching {
parseTarget(relay, get(relay, "/$secret/json"))?.let { t -> t.copy(path = "/$secret${t.path}", mainPath = t.mainPath?.let { "/$secret$it" }) }
}
if (found.getOrNull() == null) helper(context, "stop", relay.toString())
found.getOrThrow()
}.onFailure { android.util.Log.e(TAG, "no quick access target: $it") }.getOrNull()
@@ -232,14 +366,16 @@ object SteamQam {
internal fun parseTarget(port: Int, json: String): Target? {
val list = JSONArray(json)
for (i in 0 until list.length()) {
val t = list.optJSONObject(i) ?: continue
if (!t.optString("title").startsWith("QuickAccess")) continue
val ws = t.optString("webSocketDebuggerUrl")
val path = Regex("^ws://[^/]+(/devtools/page/[A-Za-z0-9-]+)$").find(ws)?.groupValues?.get(1) ?: continue
return Target(port, path)
fun page(prefix: String): String? {
for (i in 0 until list.length()) {
val t = list.optJSONObject(i) ?: continue
if (!t.optString("title").startsWith(prefix)) continue
val ws = t.optString("webSocketDebuggerUrl")
Regex("^ws://[^/]+(/devtools/page/[A-Za-z0-9-]+)$").find(ws)?.groupValues?.get(1)?.let { return it }
}
return null
}
return null
return page("QuickAccess")?.let { Target(port, it, page("MainMenu")) }
}
private fun eval(context: Context, expression: String): String? = runCatching {
@@ -8,11 +8,14 @@ import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.AlignHorizontalCenter
import androidx.compose.material.icons.outlined.AlignHorizontalLeft
import androidx.compose.material.icons.outlined.AlignHorizontalRight
import androidx.compose.material.icons.outlined.VerticalSplit
import androidx.compose.material.icons.outlined.WidthFull
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@@ -72,7 +75,8 @@ internal enum class QamFit(val id: String, @StringRes val label: Int, val icon:
FULL("full", R.string.bottom_qam_layout_full, Icons.Outlined.WidthFull, 0),
LEFT("left", R.string.bottom_qam_layout_left, Icons.Outlined.AlignHorizontalLeft, -1),
CENTER("center", R.string.bottom_qam_layout_center, Icons.Outlined.AlignHorizontalCenter, 0),
RIGHT("right", R.string.bottom_qam_layout_right, Icons.Outlined.AlignHorizontalRight, 1);
RIGHT("right", R.string.bottom_qam_layout_right, Icons.Outlined.AlignHorizontalRight, 1),
SPLIT("split", R.string.bottom_qam_layout_split, Icons.Outlined.VerticalSplit, 0);
val next: QamFit get() = entries[(ordinal + 1) % entries.size]
@@ -92,6 +96,7 @@ internal enum class QamFit(val id: String, @StringRes val label: Int, val icon:
internal object QamLayout {
private const val WIDE_CSS = "div.BasicUI { width: 100% !important; } div[class*=\\\"tab_\\\"] { max-width: none !important; }"
private const val PARKED_CSS = " #Footer { display: none !important; }"
/** Scale and left edge of the menu in a box; [align] -1, 0 or 1 places a narrower menu left, centred or right. */
fun fit(boxWidth: Float, boxHeight: Float, contentRight: Float, cssHeight: Float, align: Int = 0): Pair<Float, Float> {
@@ -102,10 +107,13 @@ internal object QamLayout {
fun toCss(x: Float, y: Float, scale: Float, left: Float): Pair<Float, Float> = (x - left) / scale to y / scale
/** Makes the menu follow the panel-shaped view (Steam sizes it once, on open) and lifts each tab's 300 px cap, then measures where the content ends. */
/** [wide] is false while the menu is shown on the top screen, where it keeps Steam's own layout. */
fun contentScript(wide: Boolean): String = "(() => { let s = document.getElementById('dd-qam-wide'); " +
/**
* [wide] is false while the menu is shown on the top screen, where it keeps Steam's own layout. [parked] hides the
* button-hint footer Steam draws in a game, which stays an empty black strip while the controller is not on the menu.
*/
fun contentScript(wide: Boolean, parked: Boolean = wide): String = "(() => { let s = document.getElementById('dd-qam-wide'); " +
"if (!s) { s = document.createElement('style'); s.id = 'dd-qam-wide'; document.head.appendChild(s); } " +
"const css = '${if (wide) WIDE_CSS else ""}'; " +
"const css = '${(if (wide) WIDE_CSS else "") + (if (parked) PARKED_CSS else "")}'; " +
"if (s.textContent !== css) s.textContent = css; if (document.scrollingElement.scrollLeft) document.scrollingElement.scrollLeft = 0; " +
"const w = innerWidth; let right = 0; for (const e of document.body.querySelectorAll('*')) { " +
"const r = e.getBoundingClientRect(); const tab = /(^| )tab_/.test(String(e.className)); " +
@@ -117,17 +125,90 @@ private const val TICK_MS = 1_000L
private const val FAST_TICK_MS = 150L
private const val MAX_RETRY_MS = 4_000L
/** The last frame shown, so returning to the panel shows the menu at once while the live stream reconnects. */
/** One of Steam's menu pages streamed to the panel; the last frame is kept so returning to the panel shows it at once. */
internal class MenuStream {
@Volatile var page: CdpPage? = null
val live = java.util.concurrent.atomic.AtomicBoolean(false)
val image = mutableStateOf<ImageBitmap?>(null)
val shape = mutableStateOf<FloatArray?>(null)
fun show(frame: ImageBitmap) {
image.value = frame
live.set(true)
}
/** Connects to [path] and starts its screencast; false when the page cannot be reached. */
fun connect(port: Int, path: String): Boolean {
page?.close()
page = null
live.set(false)
val p = runCatching {
CdpPage(port, path) { method, params ->
if (method == "Page.screencastFrame") {
page?.send("Page.screencastFrameAck", JSONObject().put("sessionId", params.optInt("sessionId")))
decodeFrame(params.optString("data"))?.let(::show)
}
}
}.onFailure { android.util.Log.w("SteamQam", "devtools connect: $it") }.getOrNull() ?: return false
page = p
p.send("Page.enable")
val started = p.call("Page.startScreencast", JSONObject().put("format", "jpeg").put("quality", 85)
.put("maxWidth", 1920).put("maxHeight", 1440))
if (started == null || started.has("error") || !started.has("result")) {
p.close()
page = null
return false
}
return true
}
/** Runs [script], which returns the page's [width, height, pixel ratio, content right], and refreshes a still page. */
fun refresh(script: String) {
val p = page ?: return
// The screencast sends frames only when the menu repaints, so a still menu needs one screenshot.
if (!live.get()) {
p.call("Page.captureScreenshot", JSONObject().put("format", "jpeg").put("quality", 85))
?.optJSONObject("result")?.optString("data")?.let(::decodeFrame)?.let(::show)
}
(p.evaluate(script) as? String)?.let { text ->
runCatching {
val a = JSONArray(text)
val layout = FloatArray(4) { a.getDouble(it).toFloat() }
if (!layout.contentEquals(shape.value)) shape.value = layout
}
}
}
/** Stops the stream and runs [restore] on the page, which outlives this connection. */
fun stop(restore: String) {
val p = page ?: return
page = null
runCatching { p.send("Page.stopScreencast") }
runCatching { p.evaluate(restore) }
p.close()
}
fun frame(): QamFrame? {
val img = image.value
val l = shape.value
return if (img != null && l != null && l[0] > 0f) QamFrame(img, l[0], l[1], l[3].coerceIn(l[0] * 0.25f, l[0])) else null
}
}
/** Steam's main menu beside the quick access menu; Steam's side of the hold keeps it in place and filling its view. */
internal object MainMenuLayout {
const val CONTENT_SCRIPT = "JSON.stringify([innerWidth, innerHeight, devicePixelRatio, innerWidth])"
}
/** Panel streams kept across visits to the panel. */
private object QamCache {
@Volatile var image: ImageBitmap? = null
@Volatile var shape: FloatArray? = null
val qam = MenuStream()
val main = MenuStream()
}
@Composable
internal fun SteamQamPanel() {
val context = LocalContext.current.applicationContext
var image by remember { mutableStateOf(QamCache.image) }
var shape by remember { mutableStateOf(QamCache.shape) }
var failed by remember { mutableStateOf(false) }
var slow by remember { mutableStateOf(false) }
LaunchedEffect(Unit) {
@@ -135,78 +216,67 @@ internal fun SteamQamPanel() {
slow = true
}
val fit = QamFit.current(context)
val holder = remember { arrayOfNulls<CdpPage>(1) }
val qam = QamCache.qam
val mainMenu = QamCache.main
val owner = remember { SteamQam.newOwner() }
val relay = remember { intArrayOf(0) }
val live = remember { java.util.concurrent.atomic.AtomicBoolean(false) }
val mainPath = remember { arrayOfNulls<String>(1) }
val aspect = remember { floatArrayOf(0f) }
val measure = Modifier.fillMaxSize().onSizeChanged { if (it.height > 0) aspect[0] = it.width.toFloat() / it.height }
val show = { frame: ImageBitmap -> image = frame; QamCache.image = frame; live.set(true) }
LaunchedEffect(Unit) {
withContext(Dispatchers.IO) {
var misses = 0
// The main menu page backs off on its own, so Quick Access stays available while its neighbour cannot connect.
var mainMisses = 0
var mainRetryAt = 0L
fun split() = QamFit.current(context) == QamFit.SPLIT
// The lease is renewed on its own, so slow discovery or a retry backoff never lets the held menu lapse.
val renew = launch {
while (isActive) {
if (SessionState.phase == SessionPhase.READY && aspect[0] > 0f) SteamQam.hold(context, aspect[0], owner)
if (SessionState.phase == SessionPhase.READY && aspect[0] > 0f) SteamQam.hold(context, aspect[0], owner, split())
delay(TICK_MS)
}
}
try {
while (isActive) {
// Holding the menu before Steam's first frame keeps gamescope from presenting it.
if (SessionState.phase != SessionPhase.READY) {
if (SessionState.phase != SessionPhase.READY || aspect[0] == 0f) {
delay(FAST_TICK_MS)
continue
}
if (aspect[0] == 0f) {
delay(FAST_TICK_MS)
continue
}
val held = SteamQam.hold(context, aspect[0], owner)
val split = split()
val held = SteamQam.hold(context, aspect[0], owner, split)
ensureActive()
var reached = held != null
if (held?.open == SteamQam.QUICK_ACCESS) {
var page = holder[0]
if (page == null || page.closed) {
page?.close()
live.set(false)
page = SteamQam.target(context)?.let { t ->
if (qam.page?.closed != false) {
val t = SteamQam.target(context)
if (t != null) {
if (relay[0] != 0 && relay[0] != t.port) SteamQam.stopRelay(context, relay[0])
relay[0] = t.port
runCatching {
CdpPage(t.port, t.path) { method, params ->
if (method == "Page.screencastFrame") {
holder[0]?.send("Page.screencastFrameAck", JSONObject().put("sessionId", params.optInt("sessionId")))
decodeFrame(params.optString("data"))?.let(show)
}
}
}.onFailure { android.util.Log.w("SteamQam", "devtools connect: $it") }.getOrNull()
mainPath[0] = t.mainPath
qam.connect(t.port, t.path)
mainMenu.stop(MainMenuLayout.CONTENT_SCRIPT)
}
holder[0] = page
ensureActive()
page?.send("Page.enable")
val started = page?.call("Page.startScreencast", JSONObject().put("format", "jpeg").put("quality", 85)
.put("maxWidth", 1920).put("maxHeight", 1440))
if (page != null && (started == null || started.has("error") || !started.has("result"))) {
page.close()
page = null
holder[0] = null
}
}
// The screencast sends frames only when the menu repaints, so a still menu needs one screenshot.
if (!live.get()) {
page?.call("Page.captureScreenshot", JSONObject().put("format", "jpeg").put("quality", 85))
?.optJSONObject("result")?.optString("data")?.let(::decodeFrame)?.let(show)
}
reached = page != null
val wide = !held.top && QamFit.current(context) == QamFit.FULL
(page?.evaluate(QamLayout.contentScript(wide)) as? String)?.let { text ->
runCatching {
val a = JSONArray(text)
val layout = floatArrayOf(a.getDouble(0).toFloat(), a.getDouble(1).toFloat(), a.getDouble(2).toFloat(), a.getDouble(3).toFloat())
if (!layout.contentEquals(shape)) { shape = layout; QamCache.shape = layout }
reached = qam.page?.closed == false
val wide = !held.top && (QamFit.current(context) == QamFit.FULL || split)
qam.refresh(QamLayout.contentScript(wide, parked = !held.top))
val path = mainPath[0]
if (split && path != null) {
val now = android.os.SystemClock.elapsedRealtime()
if (mainMenu.page?.closed != false && now >= mainRetryAt) {
if (mainMenu.connect(relay[0], path)) {
mainMisses = 0
} else {
mainMisses++
mainRetryAt = now + minOf(TICK_MS shl minOf(mainMisses - 1, 2), MAX_RETRY_MS)
}
}
mainMenu.refresh(MainMenuLayout.CONTENT_SCRIPT)
} else if (!split) {
mainMenu.stop(MainMenuLayout.CONTENT_SCRIPT)
}
}
failed = !reached
@@ -214,7 +284,7 @@ internal fun SteamQamPanel() {
misses = if (reached) 0 else misses + 1
val wait = when {
!reached -> minOf(TICK_MS shl minOf(misses - 1, 2), MAX_RETRY_MS)
live.get() -> TICK_MS
qam.live.get() && (!split || mainMenu.live.get() || mainMenu.page?.closed != false) -> TICK_MS
else -> FAST_TICK_MS
}
val used = QamFit.current(context)
@@ -225,35 +295,46 @@ internal fun SteamQamPanel() {
} finally {
withContext(NonCancellable) {
renew.cancelAndJoin()
val page = holder[0]
holder[0] = null
runCatching { page?.send("Page.stopScreencast") }
// The page outlives this connection, so the widened layout would otherwise stay on the top screen.
runCatching { page?.evaluate(QamLayout.contentScript(wide = false)) }
page?.close()
// The pages outlive these connections, so the widened layouts would otherwise stay on the top screen.
qam.stop(QamLayout.contentScript(wide = false))
mainMenu.stop(MainMenuLayout.CONTENT_SCRIPT)
SteamQam.release(context, relay[0], owner)
}
}
}
}
val img = image
val l = shape
val f = remember(img, l) {
if (img != null && l != null && l[0] > 0f) QamFrame(img, l[0], l[1], l[3].coerceIn(l[0] * 0.25f, l[0])) else null
}
if (f == null) {
val qamFrame = qam.frame()
if (qamFrame == null) {
Box(measure) {
if (slow) PanelNote(stringResource(if (failed) R.string.bottom_qam_unavailable else R.string.achievements_reading))
}
return
}
BoxWithConstraints(measure.background(f.fill)) {
if (fit != QamFit.SPLIT) {
MenuCanvas(qamFrame, fit.align, measure) { qam.page }
return
}
// Each side is as wide as its menu at the shared scale, so neither is shrunk nor padded with empty space.
val mainFrame = mainMenu.frame()
val mainWidth = mainFrame?.cssWidth ?: SteamQam.MAIN_CSS_WIDTH.toFloat()
Row(measure) {
val left = Modifier.weight(mainWidth).fillMaxHeight()
if (mainFrame != null) MenuCanvas(mainFrame, -1, left) { mainMenu.page }
else Box(left.background(qamFrame.fill))
MenuCanvas(qamFrame, -1, Modifier.weight(qamFrame.cssWidth).fillMaxHeight()) { qam.page }
}
}
/** Draws [f] scaled into the box, placed by [align], and forwards touches on it to [page]. */
@Composable
private fun MenuCanvas(f: QamFrame, align: Int, modifier: Modifier, page: () -> CdpPage?) {
BoxWithConstraints(modifier.background(f.fill)) {
val density = LocalDensity.current
val boxW = with(density) { maxWidth.toPx() }
val boxH = with(density) { maxHeight.toPx() }
val (scale, left) = QamLayout.fit(boxW, boxH, f.contentRight, f.cssHeight, fit.align)
val (scale, left) = QamLayout.fit(boxW, boxH, f.contentRight, f.cssHeight, align)
Canvas(
Modifier.fillMaxSize().pointerInput(f.cssWidth, f.contentRight, boxW, boxH, fit) {
Modifier.fillMaxSize().pointerInput(f.cssWidth, f.contentRight, boxW, boxH, align) {
var touching = false
var target: CdpPage? = null
try {
@@ -268,7 +349,7 @@ internal fun SteamQamPanel() {
PointerEventType.Release -> "touchEnd"
else -> null
}?.takeIf { it == "touchStart" || touching } ?: continue
if (type == "touchStart") target = holder[0]
if (type == "touchStart") target = page()
touching = type != "touchEnd"
val points = if (type == "touchEnd") JSONArray()
else JSONArray().put(JSONObject().put("x", x.toDouble()).put("y", y.toDouble()))
@@ -0,0 +1,142 @@
package com.droiddeck.launcher.ui
import android.content.Context
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.expandVertically
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.shrinkVertically
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.hoverable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsFocusedAsState
import androidx.compose.foundation.interaction.collectIsHoveredAsState
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ExpandMore
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateMapOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.stateDescription
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.droiddeck.launcher.R
import com.droiddeck.launcher.session.SessionPrefs
/**
* Inside the session menu every top-level settings group folds to its header and a summary of its values.
* Groups start folded; a group the player opens or folds stays that way across sessions.
*/
internal object DrawerSectionState {
private val chosen = mutableStateMapOf<String, Boolean>()
fun load(context: Context) {
if (DevPreview.drawer != null) return
chosen.clear()
chosen.putAll(SessionPrefs.drawerSections(context))
}
fun isOpen(key: String) = chosen[key] ?: false
fun toggle(context: Context, key: String) {
chosen[key] = !isOpen(key)
if (DevPreview.drawer == null) SessionPrefs.setDrawerSections(context, chosen.toMap())
}
}
internal class DrawerSections(val context: Context, val track: (String) -> Modifier)
internal val LocalDrawerSections = compositionLocalOf<DrawerSections?> { null }
@Composable
internal fun DrawerSection(
sections: DrawerSections, key: String, title: String, summary: String?, tag: String?,
content: @Composable ColumnScope.() -> Unit,
) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val open = DrawerSectionState.isOpen(key)
val source = remember { MutableInteractionSource() }
val hot = source.collectIsFocusedAsState().value || source.collectIsHoveredAsState().value
val rotation by animateFloatAsState(if (open) 180f else 0f, Motion.tw(180), label = "sectionArrow")
val state = stringResource(if (open) R.string.widgets_expanded else R.string.widgets_collapsed)
val toggle = { DrawerSectionState.toggle(sections.context, key) }
val shape = RoundedCornerShape(14.dp)
Column(
Modifier.fillMaxWidth().padding(top = 6.dp).clip(shape)
.background(colors.surface).border(1.dp, if (open) pal.line2 else pal.line, shape),
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier.fillMaxWidth().heightIn(min = 48.dp)
.then(sections.track("section-$key"))
.testTag("drawer-section-$key")
.background(if (hot) pal.signal.copy(alpha = 0.12f) else androidx.compose.ui.graphics.Color.Transparent)
.glideBorder(hot, shape, pal.signal)
.hoverable(source)
.clickable(interactionSource = source, indication = LocalIndication.current, role = Role.Button, onClick = toggle)
.controllerConfirm(onClick = toggle)
.semantics { contentDescription = title; stateDescription = state }
.padding(start = 12.dp, end = 8.dp, top = 6.dp, bottom = 6.dp),
) {
Column(Modifier.weight(1f)) {
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
Text(title.uppercase(), fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.2.sp,
color = if (open) colors.onBackground else colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f, fill = false))
if (tag != null) Text(
tag, fontSize = 10.sp, fontWeight = FontWeight.SemiBold, color = pal.signal, maxLines = 1,
modifier = Modifier.clip(RoundedCornerShape(6.dp)).background(pal.signal.copy(alpha = 0.14f))
.padding(horizontal = 6.dp, vertical = 2.dp),
)
}
if (!open && !summary.isNullOrEmpty()) Text(
summary, fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis,
modifier = Modifier.padding(top = 2.dp),
)
}
Icon(Icons.Outlined.ExpandMore, contentDescription = null, tint = colors.onSurfaceVariant,
modifier = Modifier.size(22.dp).rotate(rotation))
}
AnimatedVisibility(open, enter = expandVertically(Motion.tw(200)) + fadeIn(Motion.tw(160)),
exit = shrinkVertically(Motion.tw(160)) + fadeOut(Motion.tw(120))) {
Column(Modifier.fillMaxWidth()) {
Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
// Only top-level groups fold; groups and dialogs opened from inside one draw normally.
CompositionLocalProvider(LocalDrawerSections provides null) { content() }
}
}
}
}
@@ -26,7 +26,8 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
fun on(key: String) = cfg[key] == "1"
fun int(key: String, fallback: Int) = cfg[key]?.toIntOrNull() ?: fallback
SettingsGroup(stringResource(R.string.drawer_hud)) {
SettingsGroup(stringResource(R.string.drawer_hud), key = "performance-hud",
detail = stringResource(if (a.hudOn) R.string.widgets_on else R.string.widgets_off)) {
ToggleRow(host, "hud", stringResource(R.string.drawer_hud), null, a.hudOn, chipModifier = track("hud"), onChange = a.onHud)
if (a.hudOn) ToggleRow(
host, "hud-only-during-game", stringResource(R.string.hud_only_during_game),
@@ -62,7 +63,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
if (a.dashboardAvailable && a.secondScreenDisplays.isNotEmpty()) BottomStripSettings(host, track)
if (!a.hudOn) return
SettingsGroup(stringResource(R.string.hud_group_look)) {
SettingsGroup(stringResource(R.string.hud_group_look), key = "performance-hud-look") {
SliderRow(stringResource(R.string.hud_scale), null, int("hudScale", 100), 50..150, step = 5, format = { "$it%" },
modifier = track("hud-scale")) { a.onHudSetting("hudScale", it.toString()) }
SliderRow(stringResource(R.string.drawer_hud_opacity), null, int("hudOpacity", 80), 0..100, step = 5, format = { "$it%" },
@@ -85,7 +86,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
}
var editing by remember { mutableStateOf(false) }
SettingsGroup(stringResource(R.string.hud_group_metrics)) {
SettingsGroup(stringResource(R.string.hud_group_metrics), key = "performance-hud-metrics") {
ActionRow(stringResource(R.string.hud_group_metrics), null, stringResource(R.string.common_edit),
onClick = { editing = true }, modifier = track("hud-readings"))
val rows = DroidDeckHudSize.rowsFor(DroidDeckHudSize.from(cfg["hudSize"]), cfg)
@@ -103,7 +104,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
)
}
if (on("showTemp") || on("showGpuTemp") || on("showBatteryTemp")) SettingsGroup(stringResource(R.string.hud_group_temps)) {
if (on("showTemp") || on("showGpuTemp") || on("showBatteryTemp")) SettingsGroup(stringResource(R.string.hud_group_temps), key = "performance-hud-temps") {
ChoiceRow(host, "hud-temp-unit", stringResource(R.string.hud_temp_unit), null,
listOf("c" to "°C", "f" to "°F"), if (cfg["tempUnit"].equals("f", true)) "f" else "c",
chipModifier = track("hud-temp-unit")) { a.onHudSetting("tempUnit", it) }
@@ -129,7 +130,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
}
}
SettingsGroup(stringResource(R.string.hud_group_more)) {
SettingsGroup(stringResource(R.string.hud_group_more), key = "performance-hud-more") {
ActionRow(stringResource(R.string.hud_export), stringResource(R.string.hud_export_hint),
stringResource(R.string.hud_export_button), onClick = a.onHudExport, modifier = track("hud-export"))
ActionRow(stringResource(R.string.hud_reset), null, stringResource(R.string.hud_reset_button),
@@ -145,7 +146,7 @@ private fun BottomStripSettings(host: MenuHost, track: (String) -> Modifier) {
var hudOn by remember { mutableStateOf(SessionPrefs.bottomHud(context)) }
var onTabs by remember { mutableStateOf(SessionPrefs.bottomStripOnTabs(context)) }
var shown by remember { mutableStateOf(SessionPrefs.bottomStripMetrics(context)) }
SettingsGroup(stringResource(R.string.bottom_hud_group)) {
SettingsGroup(stringResource(R.string.bottom_hud_group), key = "performance-bottom-hud") {
ToggleRow(host, "bottom-hud", stringResource(R.string.bottom_hud_group), null, hudOn,
chipModifier = track("bottom-hud")) { on ->
hudOn = on
@@ -1,6 +1,9 @@
package com.droiddeck.launcher.ui
import androidx.compose.ui.platform.LocalContext
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.FocusRequester
import android.os.Build
@@ -50,6 +53,7 @@ import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
@@ -152,6 +156,19 @@ internal fun SetupPanel(
) {
val host = rememberMenuHost()
val ctx = LocalContext.current
var steamOrientation by remember { mutableStateOf(SessionPrefs.orientation(ctx, "steam")) }
var desktopOrientation by remember { mutableStateOf(SessionPrefs.orientation(ctx, "desktop")) }
val lifecycleOwner = LocalLifecycleOwner.current
DisposableEffect(lifecycleOwner, ctx) {
val observer = LifecycleEventObserver { _, event ->
if (event == Lifecycle.Event.ON_RESUME) {
steamOrientation = SessionPrefs.orientation(ctx, "steam")
desktopOrientation = SessionPrefs.orientation(ctx, "desktop")
}
}
lifecycleOwner.lifecycle.addObserver(observer)
onDispose { lifecycleOwner.lifecycle.removeObserver(observer) }
}
var hideHomeFromRecents by remember { mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.hideHomeFromRecents(ctx)) }
var processLimitBusy by remember { mutableStateOf(false) }
var processLimitMessage by remember { mutableStateOf<String?>(null) }
@@ -398,8 +415,7 @@ internal fun SetupPanel(
listOfNotNull(
gpu.displayName(ctx),
s.installed?.let { stringResource(R.string.setup_ready_runtime, it) },
stringResource(R.string.setup_ready_limit_off)
.takeIf { !limitBlocks && s.phantomProcessStatus != PhantomProcessStatus.UNCOUNTED },
stringResource(R.string.setup_ready_limit_off).takeIf { !limitBlocks },
s.offlineAccount?.takeIf { it.isNotEmpty() }?.let { stringResource(R.string.setup_ready_signed_in, it) },
).joinToString(" · "),
open = showChecks, onDetails = { showChecks = !showChecks },
@@ -517,7 +533,27 @@ internal fun SetupPanel(
ChoiceRow(
host, "orientation", stringResource(R.string.setup_session_orientation), stringResource(R.string.setup_session_orientation_hint),
SessionPrefs.orientationOptions.map { (value, label) -> value to stringResource(label) },
s.orientation, onPick = a.onOrientation,
s.orientation, onPick = { value ->
a.onOrientation(value)
steamOrientation = SessionPrefs.orientation(ctx, "steam")
desktopOrientation = SessionPrefs.orientation(ctx, "desktop")
},
)
ChoiceRow(
host, "orientation-steam", stringResource(R.string.setup_session_orientation) + " (Steam)", stringResource(R.string.setup_session_orientation_hint),
SessionPrefs.orientationOptions.map { (value, label) -> value to stringResource(label) },
steamOrientation, onPick = { value ->
steamOrientation = value
SessionPrefs.setOrientation(ctx, "steam", value)
},
)
ChoiceRow(
host, "orientation-desktop", stringResource(R.string.setup_session_orientation) + " (Desktop)", stringResource(R.string.setup_session_orientation_hint),
SessionPrefs.orientationOptions.map { (value, label) -> value to stringResource(label) },
desktopOrientation, onPick = { value ->
desktopOrientation = value
SessionPrefs.setOrientation(ctx, "desktop", value)
},
)
ToggleRow(
host, "launcher-fullscreen", stringResource(R.string.setup_fullscreen),
@@ -88,7 +88,7 @@ internal fun VrControllerGroups(host: MenuHost, track: (String) -> Modifier = {
androidx.compose.runtime.LaunchedEffect(Unit) { com.droiddeck.launcher.input.VrControllers.load(context) }
val c by com.droiddeck.launcher.input.VrControllers.settings.collectAsState()
val emulate = com.droiddeck.launcher.input.VrControllers.Emulate.entries
SettingsGroup(stringResource(R.string.vr_controllers_group)) {
SettingsGroup(stringResource(R.string.vr_controllers_group), key = "vr-controllers") {
ChoiceRow(host, "vr-emulate", stringResource(R.string.vr_controllers_emulate), stringResource(R.string.vr_controllers_emulate_hint),
emulate.map { it to stringResource(when (it) {
com.droiddeck.launcher.input.VrControllers.Emulate.OFF -> R.string.vr_controllers_off
@@ -142,13 +142,13 @@ internal fun GlassesGroups(
val directView = usesGlasses && picture == GlassesRendering.Picture.STEREO
val menuScreen = !inSession && g.usable && s.gameOnGlasses && s.screen3dof
if (g.canControl && onRecenter != null && s.headTracking && (virtualScreen || menuScreen || (directView && steamVrRunning))) {
SettingsGroup(stringResource(R.string.glasses_quick_actions), compact = true) {
SettingsGroup(stringResource(R.string.glasses_quick_actions), compact = true, key = "vr-glasses-quick") {
ActionRow(stringResource(R.string.glasses_recenter),
if (virtualScreen || menuScreen) stringResource(R.string.glasses_recenter_screen_hint) else null,
stringResource(R.string.cardboard_recenter_button), onRecenter)
}
}
if (display) SettingsGroup(g.model) {
if (display) SettingsGroup(g.model, key = "vr-glasses") {
if (g.experimental) SettingsRow(stringResource(R.string.glasses_control), stringResource(
if (g.supportsDisplayModeControl) R.string.glasses_xreal_experimental else R.string.glasses_pro2_experimental)) {}
val status = if (g.hasDisplay) stringResource(R.string.glasses_status, g.width, g.height, kotlin.math.round(g.hz).toInt(),
@@ -170,7 +170,7 @@ internal fun GlassesGroups(
s.gameOnGlasses, chipModifier = track("glasses-game")) { Glasses.setGameOnGlasses(it) }
}
if (display && g.canControl && g.supportsDisplayModeControl && (inSession || g.sbs || g.sbsSupport == GlassesState.SBS_FAILS)) {
SettingsGroup(stringResource(R.string.glasses_display_mode)) {
SettingsGroup(stringResource(R.string.glasses_display_mode), key = "vr-glasses-mode") {
if (g.sbsSupport == GlassesState.SBS_FAILS && !g.sbs) {
ActionRow(stringResource(R.string.glasses_3d), stringResource(R.string.glasses_3d_failed),
stringResource(R.string.stores_dl_retry), { Glasses.set3d(true) })
@@ -182,12 +182,12 @@ internal fun GlassesGroups(
val profiles = if (inSession) listOf(GlassesDisplayModes.profile(g.sbs, false))
else listOf(GlassesDisplayProfile.TWO_D, GlassesDisplayProfile.THREE_D)
for (profile in profiles) SettingsGroup(stringResource(if (profile == GlassesDisplayProfile.TWO_D)
R.string.glasses_output_2d else R.string.glasses_output_3d)) {
R.string.glasses_output_2d else R.string.glasses_output_3d), key = "vr-glasses-output-${profile.name.lowercase()}") {
GlassesResolutionRow(host, g, s, profile, track)
if ((profile == GlassesDisplayProfile.THREE_D) == g.sbs) GlassesRefreshRow(host, g, s, track)
}
}
if (display && (g.canControl || g.hasDisplay)) SettingsGroup(stringResource(R.string.glasses_picture_group)) {
if (display && (g.canControl || g.hasDisplay)) SettingsGroup(stringResource(R.string.glasses_picture_group), key = "vr-glasses-picture") {
ChoiceRow(host, "glasses-picture", stringResource(R.string.glasses_picture), stringResource(R.string.glasses_picture_hint),
listOf(
GlassesSettings.PICTURE_AUTO to stringResource(R.string.glasses_picture_auto),
@@ -213,7 +213,7 @@ internal fun GlassesGroups(
format = { SpatialMeasurements.distance(it / 10f) }, modifier = track("glasses-distance")) { Glasses.setScreenDistanceDm(it) }
}
}
if (vr && (g.canControl || g.hasDisplay)) SettingsGroup(stringResource(R.string.cardboard_steamvr)) {
if (vr && (g.canControl || g.hasDisplay)) SettingsGroup(stringResource(R.string.cardboard_steamvr), key = "vr-glasses-steamvr") {
steamVr()
if (g.supportsDisplayModeControl) ToggleRow(host, "glasses-auto3d", stringResource(R.string.glasses_auto3d),
stringResource(R.string.glasses_auto3d_hint), s.auto3d, chipModifier = track("glasses-auto3d")) { Glasses.setAuto3d(it) }
@@ -226,7 +226,7 @@ internal fun GlassesGroups(
format = { "$it°" }, modifier = track("glasses-vr-fov")) { Glasses.setVrFovDeg(it) }
}
if ((tab == null || tab == GlassesTab.TRACKING) && g.canControl) {
SettingsGroup(stringResource(R.string.glasses_head_tracking)) {
SettingsGroup(stringResource(R.string.glasses_head_tracking), key = "vr-glasses-tracking") {
val trackingHint = when {
inSession && !usesGlasses -> R.string.glasses_screen_no_output
spatialVr -> R.string.glasses_head_tracking_spatial_vr_hint
@@ -240,13 +240,13 @@ internal fun GlassesGroups(
chipModifier = track("glasses-tracking")) { Glasses.setHeadTracking(it) }
}
val calibration by Glasses.calibration.collectAsState()
if (calibration.supported) SettingsGroup(stringResource(R.string.glasses_calibration)) {
if (calibration.supported) SettingsGroup(stringResource(R.string.glasses_calibration), key = "vr-glasses-calibration") {
GlassesCalibrationControls(calibration,
onStart = Glasses::startCalibration, onCancel = Glasses::cancelCalibration,
onReset = Glasses::resetCalibration, onDone = { onRecenter?.invoke() })
}
}
if ((tab == null || tab == GlassesTab.HARDWARE) && g.canControl && g.hardwareControls) SettingsGroup(stringResource(R.string.glasses_hardware)) {
if ((tab == null || tab == GlassesTab.HARDWARE) && g.canControl && g.hardwareControls) SettingsGroup(stringResource(R.string.glasses_hardware), key = "vr-glasses-hardware") {
if (g.brightnessMax > 0) SliderRow(stringResource(R.string.glasses_brightness), null, g.brightness.coerceAtLeast(0), 0..g.brightnessMax, step = 1,
modifier = track("glasses-brightness")) { Glasses.setBrightness(it) }
if (g.volumeMax > 0) SliderRow(stringResource(R.string.glasses_volume), null, g.volume.coerceAtLeast(0), 0..g.volumeMax, step = 1,
@@ -259,7 +259,7 @@ internal fun GlassesGroups(
androidx.compose.runtime.LaunchedEffect(Unit) { HandTracking.load(context) }
if ((tab == null || tab == GlassesTab.TRACKING) && g.canControl) {
if (g.spatialConnected) {
SettingsGroup(stringResource(R.string.glasses_experimental)) {
SettingsGroup(stringResource(R.string.glasses_experimental), key = "vr-glasses-experimental") {
val spatial by SpatialTracking.status.collectAsState()
ToggleRow(host, "glasses-position", stringResource(R.string.glasses_position), stringResource(R.string.glasses_position_hint),
s.positionalTracking, chipModifier = track("glasses-position")) { Glasses.setPositionalTracking(it) }
@@ -282,7 +282,7 @@ internal fun GlassesGroups(
s.joyConTracking, enabled = s.positionalTracking, chipModifier = track("glasses-joycons")) { Glasses.setJoyConTracking(it) }
}
}
if (hands.usable) SettingsGroup(stringResource(R.string.phone_camera_tracking_group)) {
if (hands.usable) SettingsGroup(stringResource(R.string.phone_camera_tracking_group), key = "vr-hand-camera") {
HandCameraRows(host, track, inSession)
}
}
@@ -44,6 +44,7 @@ import com.droiddeck.launcher.session.SessionPrefs
import kotlin.math.abs
import kotlin.math.atan2
import kotlin.math.hypot
import kotlin.math.max
import kotlin.math.min
@SuppressLint("ViewConstructor")
@@ -63,6 +64,7 @@ class InputSurfaceView(
private val art by lazy(LazyThreadSafetyMode.NONE) { PadArt(context) }
private var artworkDpad = emptyList<HoldButton>()
private val artworkDpadBounds = RectF()
private var crossDpads = emptyList<Pair<List<HoldButton>, RectF>>()
private var requestedLayout = customLayout
init { customLayout = surfaceStyle.shown(customLayout); addView(content, LayoutParams(-1, -1)); renderCustom(pad) }
@@ -185,6 +187,7 @@ class InputSurfaceView(
private fun renderCustom(pad: PadBridge?) {
artworkDpad = emptyList()
crossDpads = emptyList()
val canvas = object : ViewGroup(context) {
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
val layout = customLayout
@@ -203,6 +206,7 @@ class InputSurfaceView(
child.layout(x, y, x + child.measuredWidth, y + child.measuredHeight)
}
updateArtworkDpad(this)
updateCrossDpad(this)
}
override fun dispatchDraw(canvas: Canvas) {
@@ -244,11 +248,39 @@ class InputSurfaceView(
canvas.getChildAt(index) as? HoldButton
}
val previous = artworkDpad
artworkDpad = if (crossed(buttons)) buttons else emptyList()
artworkDpad = if (crossed(buttons, artworkDpadBounds)) buttons else emptyList()
if (artworkDpad != previous) (previous + artworkDpad).forEach { it.invalidate() }
}
private fun crossed(buttons: List<HoldButton>): Boolean {
private fun updateCrossDpad(canvas: ViewGroup) {
val buttons = (0 until canvas.childCount).map(canvas::getChildAt).filterIsInstance<HoldButton>()
val (ups, rights, downs, lefts) = DIRECTIONS.map { direction -> buttons.filter { (it.tag as? InputSurfaceElement)?.control == direction } }
crossDpads = ups.flatMap { up -> rights.flatMap { right -> downs.flatMap { down ->
lefts.mapNotNull { left -> listOf(up, right, down, left).let { arms -> hole(arms)?.let { arms to it } } } } } }
}
private fun hole(buttons: List<HoldButton>): RectF? {
val (up, right, down, left) = buttons
val hole = RectF(left.right.toFloat(), up.bottom.toFloat(), right.left.toFloat(), down.top.toFloat())
val across = max(up.left, down.left) to min(up.right, down.right)
val along = max(left.top, right.top) to min(left.bottom, right.bottom)
return hole.takeIf {
!it.isEmpty && across.first < across.second && along.first < along.second &&
across.first < it.right && across.second > it.left && along.first < it.bottom && along.second > it.top
}
}
private fun crossTarget(x: Float, y: Float): HoldButton? {
val first = crossDpads.firstOrNull()?.first?.first() ?: return null
val hx = x - (originX(first) - first.left)
val hy = y - (originY(first) - first.top)
return crossDpads.filter { (arms, hole) -> arms.all { it.visibility == VISIBLE } && hole.contains(hx, hy) }
.flatMap { it.first }.distinct().minByOrNull { arm ->
hypot(max(max(arm.left - hx, hx - arm.right), 0f), max(max(arm.top - hy, hy - arm.bottom), 0f))
}
}
private fun crossed(buttons: List<HoldButton>, bounds: RectF): Boolean {
if (buttons.size != DIRECTIONS.size) return false
val (up, right, down, left) = buttons
val centerX = (left.left + right.right) / 2f
@@ -258,7 +290,7 @@ class InputSurfaceView(
kotlin.math.abs((left.top + left.bottom) / 2f - centerY) > 2f ||
kotlin.math.abs((right.top + right.bottom) / 2f - centerY) > 2f ||
up.bottom >= down.top || left.right >= right.left) return false
artworkDpadBounds.set(left.left.toFloat(), up.top.toFloat(), right.right.toFloat(), down.bottom.toFloat())
bounds.set(left.left.toFloat(), up.top.toFloat(), right.right.toFloat(), down.bottom.toFloat())
return true
}
@@ -284,6 +316,7 @@ class InputSurfaceView(
val views = (canvas.childCount - 1 downTo 0).map(canvas::getChildAt).filter { it.visibility == VISIBLE }
views.firstOrNull { !(it is StickView && it.adaptive) && hits(it, x, y, 0f) }?.let { return it }
views.filter { it is HoldButton && hits(it, x, y, slack(it)) }.minByOrNull { distance(it, x, y) }?.let { return it }
crossTarget(x, y)?.let { return it }
if (views.any { it is HoldButton && hits(it, x, y, slack(it) + ADAPTIVE_CLEARANCE_PX) }) return null
return views.filter { it is StickView && it.adaptive && it !in owners.values && (hits(it, x, y, 0f) || it.captures(x - originX(it), y - originY(it))) }
.minByOrNull { distance(it, x, y) }
@@ -116,10 +116,7 @@ internal object NavTabs {
fun more(s: FrontEndState) = listed(s).filter { place(s, it) == TabPlace.MORE }
fun bar(s: FrontEndState): List<String> {
val shown = listed(s).filter { place(s, it) == TabPlace.BAR }
return if (more(s).isEmpty()) shown else shown + MORE
}
fun bar(s: FrontEndState): List<String> = listed(s).filter { place(s, it) == TabPlace.BAR } + MORE
fun setHidden(context: Context, key: String, hide: Boolean) {
hidden = if (hide && hideable(key)) hidden + key else hidden - key
@@ -11,7 +11,7 @@ internal fun PenSettingsGroup(
host: MenuHost, pen: SessionPrefs.Pen, track: (String) -> Modifier = { Modifier },
onPick: (key: String, value: String) -> Unit,
) {
SettingsGroup(stringResource(R.string.mode_pen)) {
SettingsGroup(stringResource(R.string.mode_pen), key = "controller-pen") {
ChoiceRow(host, "pen", stringResource(R.string.mode_pen), null,
listOf(SessionPrefs.PEN_MOUSE to stringResource(R.string.mode_pen_mouse),
SessionPrefs.PEN_TOUCH to stringResource(R.string.mode_pen_touch)),
@@ -49,6 +49,7 @@ fun PerformancePage(
prootNoSeccomp: Boolean,
prootFastPath: Boolean,
nativeUserland: Boolean,
desktopAsUser: Boolean,
cursorComposite: Boolean,
guestHostname: String,
phantomWarning: String?,
@@ -67,6 +68,7 @@ fun PerformancePage(
onProotNoSeccomp: (Boolean) -> Unit,
onProotFastPath: (Boolean) -> Unit,
onNativeUserland: (Boolean) -> Unit,
onDesktopAsUser: (Boolean) -> Unit,
onCursorComposite: (Boolean) -> Unit,
onGuestHostname: (String) -> Unit,
onClientCore: (Int, Boolean) -> Unit,
@@ -194,6 +196,12 @@ fun PerformancePage(
modifier = Modifier.width(220.dp).focusGlide(),
)
}
ToggleRow(
host, "desktopasuser", stringResource(R.string.perf_desktop_as_user),
stringResource(if (nativeUserland) R.string.perf_desktop_as_user_hint else R.string.perf_desktop_as_user_needs_native),
desktopAsUser && nativeUserland, enabled = nativeUserland,
onChange = onDesktopAsUser,
)
}
if (phantomWarning != null) {
Spacer(Modifier.height(16.dp))
@@ -218,7 +226,7 @@ fun PerformancePage(
@Composable
internal fun GpuClockGroup(host: MenuHost, on: Boolean, chipModifier: Modifier = Modifier, onChange: (Boolean) -> Unit) {
SettingsGroup(stringResource(R.string.perf_gpu)) {
SettingsGroup(stringResource(R.string.perf_gpu), key = "performance-gpu") {
ToggleRow(
host, "gpuclock", stringResource(R.string.perf_gpuclock),
null,
@@ -6,17 +6,18 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.droiddeck.launcher.session.SessionPrefs
/** HUD holds the Performance page and GAMES the Game page; the names stay because saved page orders use them. */
internal enum class SessionDrawerPage(val firstControl: String) {
CONTROLLER("input-profile"),
GLASSES("glasses-game"),
DISPLAY("fg"),
HUD("hud"),
EFFECTS("look"),
GAMES("anisotropy"),
AGENT("agent-input"),
SESSION("suspend"),
CONTROLLER("section-controller-input"),
HUD("section-performance-pacing"),
DISPLAY("section-display"),
EFFECTS("section-effects-look"),
GAMES("section-game-profile"),
VR("section-vr-steamvr"),
SESSION("pause"),
MORE("more-edit"),
VR("steamvr"),
ACHIEVEMENTS("achievements"),
AGENT("agent-input"),
}
internal object DrawerPages {
@@ -71,16 +72,16 @@ internal object DrawerPages {
}
internal fun offeredDrawerPages(
hasGlasses: Boolean = false, hasAgent: Boolean = com.droiddeck.launcher.agent.AgentTab.shown,
hasAchievements: Boolean = false, hasAgent: Boolean = com.droiddeck.launcher.agent.AgentTab.shown,
): List<SessionDrawerPage> =
DrawerPages.order.filter {
(hasGlasses || it != SessionDrawerPage.GLASSES) &&
(hasAchievements || it != SessionDrawerPage.ACHIEVEMENTS) &&
(hasAgent || it != SessionDrawerPage.AGENT)
}
internal fun sessionDrawerPages(
hasGlasses: Boolean = false, hasAgent: Boolean = com.droiddeck.launcher.agent.AgentTab.shown,
): List<SessionDrawerPage> = offeredDrawerPages(hasGlasses, hasAgent).filter { it !in DrawerPages.hidden }
hasAchievements: Boolean = false, hasAgent: Boolean = com.droiddeck.launcher.agent.AgentTab.shown,
): List<SessionDrawerPage> = offeredDrawerPages(hasAchievements, hasAgent).filter { it !in DrawerPages.hidden }
/** The pages shown as tabs: everything up to and including the More tab. */
internal fun List<SessionDrawerPage>.strip(): List<SessionDrawerPage> {
File diff suppressed because it is too large. Load diff
@@ -89,6 +89,7 @@ internal object SettingsIndex {
s(SettingsSection.PERFORMANCE, R.string.perf_native_userland, "proot"),
s(SettingsSection.PERFORMANCE, R.string.perf_cursor_composite, "mouse", "cursor"),
s(SettingsSection.PERFORMANCE, R.string.perf_hostname, "name"),
s(SettingsSection.PERFORMANCE, R.string.perf_desktop_as_user, "root", "user", "sudo", "fakeroot"),
s(SettingsSection.CONTROLLER, R.string.setup_tab_controller, "gamepad", "buttons", "mapping", "profile", "remap"),
SettingsEntry(SettingsPlace.TAB, R.string.rail_storage, tab = "storage", words = listOf("sd card", "space", "uninstall", "disk")),
@@ -443,7 +443,11 @@ fun ValueChip(text: String, open: Boolean, enabled: Boolean = true, modifier: Mo
}
@Composable
fun SettingsGroup(title: String, compact: Boolean = false, detail: String? = null, content: @Composable ColumnScope.() -> Unit) {
fun SettingsGroup(title: String, compact: Boolean = false, detail: String? = null, key: String? = null, tag: String? = null, content: @Composable ColumnScope.() -> Unit) {
LocalDrawerSections.current?.let { sections ->
DrawerSection(sections, key ?: title, title, detail, tag, content)
return
}
val tight = compact || LocalCompactSettings.current
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
@@ -56,6 +56,7 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
@@ -358,6 +359,67 @@ internal fun SessionAchievementsPanel(label: String, state: AchievementsState, t
}
}
/** The Achievements page of the session menu: the same list as the full panel, inside the menu's own scroll. */
@Composable
internal fun DrawerAchievementsPage(game: StoreAchievements.Game, title: String?, track: (String) -> Modifier) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val label = StoreAchievements.forSource(game.source)?.label.orEmpty()
val state = rememberAchievements(game) ?: AchievementsState.READING
val kinds = remember(state.list) {
val list = state.list.orEmpty()
val split = groups(list)
if (split.size < 2) emptyList() else listOf(R.string.stores_tab_all to list) + split
}
var pick by remember { mutableIntStateOf(0) }
if (pick >= kinds.size) pick = 0
var noteHadFocus by remember { mutableStateOf(false) }
val firstRow = remember { FocusRequester() }
val loaded = !state.list.isNullOrEmpty()
LaunchedEffect(loaded) {
if (loaded && noteHadFocus) {
noteHadFocus = false
withFrameNanos { }
runCatching { firstRow.requestFocus() }
}
}
Column(Modifier.fillMaxWidth().padding(top = 8.dp, start = 4.dp, end = 4.dp)) {
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
Text(title.orEmpty(), fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f))
state.list?.takeIf { it.isNotEmpty() }?.let { list ->
if (state.all) Trophy(18.dp, Modifier.padding(end = 6.dp))
Text(stringResource(R.string.achievements_count_short, state.done, list.size), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = pal.signal)
}
}
val list = state.list
if (list.isNullOrEmpty()) {
Text(achievementsNote(state, label).orEmpty(), fontSize = 13.sp, color = colors.onSurfaceVariant,
modifier = Modifier.padding(top = 12.dp).then(track("achievements"))
.onFocusChanged { if (it.isFocused) noteHadFocus = true }.focusable())
return@Column
}
LinearProgressIndicator(
progress = { state.done / list.size.toFloat() }, color = pal.signal, trackColor = pal.line,
modifier = Modifier.padding(top = 8.dp).fillMaxWidth().height(4.dp).clip(RoundedCornerShape(2.dp)),
)
if (kinds.isNotEmpty()) TabStrip(
kinds.map { (name, group) -> if (name == R.string.stores_tab_all) stringResource(name) + " · " + group.size else stringResource(name, group.size) },
pick, { pick = it }, Modifier.padding(top = 10.dp), bumpers = false, compact = true,
)
val shown = kinds.getOrNull(pick)?.second ?: list
val sections = if (pick == 0) groups(shown).filter { it.second.isNotEmpty() } else listOf(null to shown)
val first = sections.firstOrNull()?.second?.firstOrNull()?.id
Column(Modifier.padding(top = 6.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) {
for ((group, items) in sections) {
if (group != null) AchievementGroupLabel(stringResource(group, items.size))
for (a in items) androidx.compose.runtime.key(a.id) {
AchievementRow(a, compact = true, if (a.id == first) track("achievements").focusRequester(firstRow) else Modifier)
}
}
}
}
}
@Composable
internal fun DrawerAchievementsRow(progress: Pair<Int, Int>?, modifier: Modifier = Modifier, onClick: () -> Unit) {
val colors = MaterialTheme.colorScheme
+4 -2
View File
@@ -654,6 +654,9 @@
<string name="perf_hostname">اسم المضيف</string>
<string name="perf_hostname_hint">الاسم الذي يراه Steam لهذا الجهاز. اتركه خاليًا للاستعادة إلى %1$s.</string>
<string name="perf_hostname_invalid">أحرف وأرقام وشرطات داخلية فقط، حتى 63 حرفًا.</string>
<string name="perf_desktop_as_user">تشغيل سطح المكتب كمستخدم</string>
<string name="perf_desktop_as_user_hint">يعمل سطح المكتب وتطبيقاته وطرفياته كمستخدم عادي باسم deck بدلًا من root، للتطبيقات التي ترفض root. يظل sudo يعمل. يسري على سطح المكتب التالي.</string>
<string name="perf_desktop_as_user_needs_native">يتطلب التشغيل دون proot.</string>
<string name="perf_phantom_warning">Android مهيَّأ لإنهاء هذه الجلسة</string>
<string name="driver_installed">مثبّت</string>
<string name="driver_available">متاح للتنزيل</string>
@@ -2236,6 +2239,7 @@
<string name="bottom_qam_layout_left">يسار</string>
<string name="bottom_qam_layout_center">وسط</string>
<string name="bottom_qam_layout_right">يمين</string>
<string name="bottom_qam_layout_split">مقسّم</string>
<string name="bottom_qam_unavailable">قائمة الوصول السريع في Steam غير متاحة بعد.</string>
<string name="bottom_page_telemetry">إحصاءات داخل اللعبة</string>
<string name="bottom_hud_group">مؤشرات الشاشة السفلية</string>
@@ -2550,8 +2554,6 @@
<string name="phantom_instructions_fix">%1$s إذا لم يكن ذلك ممكنًا، وصِّل هذا الجهاز بكمبيوتر يستخدم ADB ونفِّذ الأمر أدناه. عُد إلى هنا وتحقَّق مرة أخرى.</string>
<string name="phantom_instructions_off">يمكن بدء جلسات Steam.</string>
<string name="phantom_instructions_not_applicable">لا يستخدم إصدار Android هذا هذا الحدّ.</string>
<string name="phantom_title_uncounted">يتولى DroidDeck حد العمليات الفرعية</string>
<string name="phantom_instructions_uncounted">يشغّل DroidDeck برامج الجلسة في عمليات لا يحتسبها Android، لذا يمكن إبقاء خيارات المطوّرين متوقفة.</string>
<string name="phantom_fix_toggle">فعِّل «إيقاف القيود المفروضة على العمليات الثانوية» في خيارات المطوّرين، واترك خيارات المطوّرين مفعَّلة بعد ذلك.</string>
<string name="phantom_fix_no_toggle">لا يحتوي إصدار Android هذا على مفتاح لذلك. استخدِم تصحيح الأخطاء اللاسلكي لتغييره من هذا الجهاز.</string>
<string name="upd_block_no_apk">لا يتوفّر تنزيل لهذا الإصدار الخاص بهذه النسخة من DroidDeck.</string>
+4 -2
View File
@@ -648,6 +648,9 @@
<string name="perf_hostname">Nombre del host</string>
<string name="perf_hostname_hint">El nombre que Steam ve para este dispositivo. En blanco restaura %1$s.</string>
<string name="perf_hostname_invalid">Solo letras, dígitos y guiones internos, hasta 63 caracteres.</string>
<string name="perf_desktop_as_user">El escritorio se ejecuta como usuario</string>
<string name="perf_desktop_as_user_hint">El escritorio, sus apps y sus terminales se ejecutan como el usuario común deck en lugar de root, para las apps que rechazan root. sudo sigue funcionando. Se aplica al próximo escritorio.</string>
<string name="perf_desktop_as_user_needs_native">Requiere Ejecutar sin proot.</string>
<string name="perf_phantom_warning">Android está configurado para cerrar esta sesión</string>
<string name="driver_installed">Instalado</string>
<string name="driver_available">Disponible para descargar</string>
@@ -2231,6 +2234,7 @@
<string name="bottom_qam_layout_left">Izquierda</string>
<string name="bottom_qam_layout_center">Centro</string>
<string name="bottom_qam_layout_right">Derecha</string>
<string name="bottom_qam_layout_split">Dividido</string>
<string name="bottom_qam_unavailable">El menú de acceso rápido de Steam aún no está disponible.</string>
<string name="bottom_page_telemetry">Estadísticas del juego</string>
<string name="bottom_hud_group">HUD de la pantalla inferior</string>
@@ -2542,8 +2546,6 @@
<string name="phantom_instructions_fix">%1$s Si no es posible, conecta este dispositivo a una computadora con ADB y ejecuta el comando de abajo. Después vuelve aquí y comprueba de nuevo.</string>
<string name="phantom_instructions_off">Ya se pueden iniciar sesiones de Steam.</string>
<string name="phantom_instructions_not_applicable">Esta versión de Android no usa este límite.</string>
<string name="phantom_title_uncounted">DroidDeck gestiona el límite de procesos secundarios</string>
<string name="phantom_instructions_uncounted">DroidDeck ejecuta los programas de la sesión en procesos que Android no cuenta, así que las Opciones de desarrollador pueden quedar desactivadas.</string>
<string name="phantom_fix_toggle">Activa “Inhabilitar restricciones de procesos secundarios” en Opciones de desarrollador y deja activadas las Opciones de desarrollador después.</string>
<string name="phantom_fix_no_toggle">Esta versión de Android no tiene un interruptor para ello. Usa la Depuración inalámbrica para cambiarlo desde este dispositivo.</string>
<string name="upd_block_no_apk">Esta versión no tiene descarga para esta copia de DroidDeck.</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Име на хоста</string>
<string name="perf_hostname_hint">Името, което Steam вижда за това устройство. Оставено празно възстановява %1$s.</string>
<string name="perf_hostname_invalid">Само букви, цифри и тирета по средата, до 63 знака.</string>
<string name="perf_desktop_as_user">Работният плот работи като потребител</string>
<string name="perf_desktop_as_user_hint">Работният плот, приложенията и терминалите му работят като обикновения потребител deck вместо root, за приложения, които отказват root. sudo продължава да работи. Важи за следващия работен плот.</string>
<string name="perf_desktop_as_user_needs_native">Изисква Работа без proot.</string>
<string name="perf_phantom_warning">Android е настроен да прекратява тази сесия</string>
<string name="driver_installed">Инсталиран</string>
<string name="driver_available">Налично за изтегляне</string>
@@ -2136,6 +2139,7 @@
<string name="bottom_qam_layout_left">Вляво</string>
<string name="bottom_qam_layout_center">В центъра</string>
<string name="bottom_qam_layout_right">Вдясно</string>
<string name="bottom_qam_layout_split">Разделено</string>
<string name="bottom_qam_unavailable">Менюто за бърз достъп на Steam още не е налично.</string>
<string name="bottom_page_telemetry">Статистика в играта</string>
<string name="bottom_hud_group">HUD на долния екран</string>
@@ -2446,8 +2450,6 @@
<string name="phantom_instructions_fix">%1$s Ако това не е възможно, свържи устройството с компютър с ADB и изпълни командата отдолу. Върни се тук и провери отново.</string>
<string name="phantom_instructions_off">Сесиите на Steam могат да стартират.</string>
<string name="phantom_instructions_not_applicable">Тази версия на Android не използва това ограничение.</string>
<string name="phantom_title_uncounted">DroidDeck се справя с ограничението за дъщерни процеси</string>
<string name="phantom_instructions_uncounted">DroidDeck изпълнява програмите на сесията в процеси, които Android не отчита, така че опциите за програмисти могат да останат изключени.</string>
<string name="phantom_fix_toggle">Включи „Деактивиране на ограниченията за дъщерните процеси“ в Опции за програмисти и остави Опции за програмисти включени след това.</string>
<string name="phantom_fix_no_toggle">Тази версия на Android няма превключвател за това. Използвай безжично отстраняване на грешки, за да го промениш от това устройство.</string>
<string name="upd_block_no_apk">Тази версия няма изтегляне за това копие на DroidDeck.</string>
+4 -2
View File
@@ -650,6 +650,9 @@
<string name="perf_hostname">Název hostitele</string>
<string name="perf_hostname_hint">Název, který Steam vidí pro toto zařízení. Prázdné obnoví %1$s.</string>
<string name="perf_hostname_invalid">Pouze písmena, číslice a vnitřní pomlčky, až 63 znaků.</string>
<string name="perf_desktop_as_user">Plocha běží jako uživatel</string>
<string name="perf_desktop_as_user_hint">Plocha, její aplikace a terminály běží jako běžný uživatel deck místo root, kvůli aplikacím, které root odmítají. sudo dál funguje. Projeví se u příští plochy.</string>
<string name="perf_desktop_as_user_needs_native">Vyžaduje Spouštět bez proot.</string>
<string name="perf_phantom_warning">Android je nastaven tak, aby tuto relaci ukončil</string>
<string name="driver_installed">Nainstalováno</string>
<string name="driver_available">K dispozici ke stažení</string>
@@ -2186,6 +2189,7 @@
<string name="bottom_qam_layout_left">Vlevo</string>
<string name="bottom_qam_layout_center">Na střed</string>
<string name="bottom_qam_layout_right">Vpravo</string>
<string name="bottom_qam_layout_split">Rozděleno</string>
<string name="bottom_qam_unavailable">Nabídka rychlého přístupu Steamu zatím není k dispozici.</string>
<string name="bottom_page_telemetry">Statistiky ve hře</string>
<string name="bottom_hud_group">HUD na spodní obrazovce</string>
@@ -2498,8 +2502,6 @@
<string name="phantom_instructions_fix">%1$s Pokud to není možné, připojte toto zařízení k počítači s ADB a spusťte příkaz níže. Vraťte se sem a zkontrolujte to znovu.</string>
<string name="phantom_instructions_off">Relace Steamu se mohou spouštět.</string>
<string name="phantom_instructions_not_applicable">Tato verze Androidu tento limit nepoužívá.</string>
<string name="phantom_title_uncounted">Limit podřízených procesů řeší DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck spouští programy relace v procesech, které Android nezapočítává, takže možnosti pro vývojáře mohou zůstat vypnuté.</string>
<string name="phantom_fix_toggle">Zapněte „Deaktivace omezení podřízených procesů“ v Možnostech pro vývojáře a pak je nechte zapnuté.</string>
<string name="phantom_fix_no_toggle">Tato verze Androidu pro to nemá přepínač. Použijte bezdrátové ladění a změňte to z tohoto zařízení.</string>
<string name="upd_block_no_apk">Toto sestavení nemá stažení pro tuto kopii DroidDecku.</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Værtsnavn</string>
<string name="perf_hostname_hint">Navnet Steam ser for denne enhed. Tomt gendanner %1$s.</string>
<string name="perf_hostname_invalid">Kun bogstaver, tal og bindestreger i midten, op til 63 tegn.</string>
<string name="perf_desktop_as_user">Skrivebordet kører som bruger</string>
<string name="perf_desktop_as_user_hint">Skrivebordet, dets apps og terminaler kører som den almindelige bruger deck i stedet for root, til apps der afviser root. sudo virker stadig. Gælder fra næste skrivebord.</string>
<string name="perf_desktop_as_user_needs_native">Kræver Kør uden proot.</string>
<string name="perf_phantom_warning">Android er sat til at lukke denne session</string>
<string name="driver_installed">Installeret</string>
<string name="driver_available">Tilgængelig til download</string>
@@ -2136,6 +2139,7 @@
<string name="bottom_qam_layout_left">Venstre</string>
<string name="bottom_qam_layout_center">Midte</string>
<string name="bottom_qam_layout_right">Højre</string>
<string name="bottom_qam_layout_split">Delt</string>
<string name="bottom_qam_unavailable">Steams menu til hurtig adgang er ikke tilgængelig endnu.</string>
<string name="bottom_page_telemetry">Statistik i spillet</string>
<string name="bottom_hud_group">HUD på nederste skærm</string>
@@ -2446,8 +2450,6 @@
<string name="phantom_instructions_fix">%1$s Hvis det ikke er muligt, så forbind enheden til en computer med ADB, og køre kommandoen nedenfor. Kom tilbage hertil, og tjek igen.</string>
<string name="phantom_instructions_off">Steam-sessioner kan starte.</string>
<string name="phantom_instructions_not_applicable">Denne Android-version bruger ikke denne grænse.</string>
<string name="phantom_title_uncounted">DroidDeck håndterer grænsen for underprocesser</string>
<string name="phantom_instructions_uncounted">DroidDeck kører sessionens programmer i processer, som Android ikke tæller med, så Indstillinger for udviklere kan forblive slået fra.</string>
<string name="phantom_fix_toggle">Tænd „Deaktiver begrænsningerne for underprocesser“ i Udvikleremuligheder, og lad Udvikleremuligheder være tændt bagefter.</string>
<string name="phantom_fix_no_toggle">Denne Android-version har ingen kontakt til det. Brug Trådløs fejlretning til at ændre det fra denne enhed.</string>
<string name="upd_block_no_apk">Denne version har ingen download til denne kopi af DroidDeck.</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Hostname</string>
<string name="perf_hostname_hint">Der Name, den Steam für dieses Gerät sieht. Leer lassen stellt %1$s wieder her.</string>
<string name="perf_hostname_invalid">Nur Buchstaben, Ziffern und innere Bindestriche, bis zu 63 Zeichen.</string>
<string name="perf_desktop_as_user">Desktop läuft als Benutzer</string>
<string name="perf_desktop_as_user_hint">Der Desktop, seine Apps und Terminals laufen als normaler Benutzer deck statt als root, für Apps, die root ablehnen. sudo funktioniert weiterhin. Gilt ab dem nächsten Desktop.</string>
<string name="perf_desktop_as_user_needs_native">Erfordert Ohne proot ausführen.</string>
<string name="perf_phantom_warning">Android ist so eingestellt, dass es diese Sitzung beendet</string>
<string name="driver_installed">Installiert</string>
<string name="driver_available">Zum Download verfügbar</string>
@@ -2128,6 +2131,7 @@
<string name="bottom_qam_layout_left">Links</string>
<string name="bottom_qam_layout_center">Mitte</string>
<string name="bottom_qam_layout_right">Rechts</string>
<string name="bottom_qam_layout_split">Geteilt</string>
<string name="bottom_qam_unavailable">Das Schnellzugriffsmenü von Steam ist noch nicht verfügbar.</string>
<string name="bottom_page_telemetry">Spielstatistiken</string>
<string name="bottom_hud_group">HUD für den unteren Bildschirm</string>
@@ -2438,8 +2442,6 @@
<string name="phantom_instructions_fix">%1$s Falls das nicht möglich ist, verbinde dieses Gerät per ADB mit einem Computer und führe den Befehl unten aus. Kehre dann hierher zurück und prüfe erneut.</string>
<string name="phantom_instructions_off">Steam-Sitzungen können starten.</string>
<string name="phantom_instructions_not_applicable">Diese Android-Version nutzt dieses Limit nicht.</string>
<string name="phantom_title_uncounted">Limit für untergeordnete Prozesse übernimmt DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck führt die Programme der Sitzung in Prozessen aus, die Android nicht mitzählt, daher können die Entwickleroptionen ausgeschaltet bleiben.</string>
<string name="phantom_fix_toggle">Aktiviere „Beschränkungen für Unterprozesse deaktivieren“ in den Entwickleroptionen und lass die Entwickleroptionen danach aktiviert.</string>
<string name="phantom_fix_no_toggle">Diese Android-Version hat dafür keinen Schalter. Nutze Debugging über WLAN, um es auf diesem Gerät zu ändern.</string>
<string name="upd_block_no_apk">Dieser Build hat keinen Download für diese DroidDeck-Installation.</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Όνομα κεντρικού υπολογιστή</string>
<string name="perf_hostname_hint">Το όνομα που βλέπει το Steam για αυτή τη συσκευή. Αν το αφήσετε κενό, επανέρχεται σε %1$s.</string>
<string name="perf_hostname_invalid">Μόνο γράμματα, ψηφία και εσωτερικές παύλες, έως 63 χαρακτήρες.</string>
<string name="perf_desktop_as_user">Η επιφάνεια εργασίας εκτελείται ως χρήστης</string>
<string name="perf_desktop_as_user_hint">Η επιφάνεια εργασίας, οι εφαρμογές και τα τερματικά της εκτελούνται ως ο απλός χρήστης deck αντί για root, για εφαρμογές που αρνούνται το root. Το sudo εξακολουθεί να λειτουργεί. Ισχύει από την επόμενη επιφάνεια εργασίας.</string>
<string name="perf_desktop_as_user_needs_native">Απαιτεί Εκτέλεση χωρίς proot.</string>
<string name="perf_phantom_warning">Το Android είναι ρυθμισμένο να διακόπτει αυτή τη συνεδρία</string>
<string name="driver_installed">Εγκατεστημένο</string>
<string name="driver_available">Διαθέσιμο για λήψη</string>
@@ -2136,6 +2139,7 @@
<string name="bottom_qam_layout_left">Αριστερά</string>
<string name="bottom_qam_layout_center">Κέντρο</string>
<string name="bottom_qam_layout_right">Δεξιά</string>
<string name="bottom_qam_layout_split">Διαιρεμένο</string>
<string name="bottom_qam_unavailable">Το μενού γρήγορης πρόσβασης του Steam δεν είναι ακόμη διαθέσιμο.</string>
<string name="bottom_page_telemetry">Στατιστικά παιχνιδιού</string>
<string name="bottom_hud_group">HUD κάτω οθόνης</string>
@@ -2446,8 +2450,6 @@
<string name="phantom_instructions_fix">%1$s Αν αυτό δεν είναι δυνατό, συνδέστε αυτή τη συσκευή σε έναν υπολογιστή με ADB και εκτελέστε την παρακάτω εντολή. Επιστρέψτε εδώ και ελέγξτε ξανά.</string>
<string name="phantom_instructions_off">Οι συνεδρίες Steam μπορούν να ξεκινήσουν.</string>
<string name="phantom_instructions_not_applicable">Αυτή η έκδοση Android δεν χρησιμοποιεί αυτό το όριο.</string>
<string name="phantom_title_uncounted">Το DroidDeck χειρίζεται το όριο θυγατρικών διεργασιών</string>
<string name="phantom_instructions_uncounted">Το DroidDeck εκτελεί τα προγράμματα της συνεδρίας σε διεργασίες που το Android δεν μετράει, οπότε οι Επιλογές για προγραμματιστές μπορούν να μείνουν απενεργοποιημένες.</string>
<string name="phantom_fix_toggle">Ενεργοποιήστε την «Απενεργοπ. περιορισμών σε θυγατρικές διεργασίες» στις Επιλογές προγραμματιστή και αφήστε τις Επιλογές προγραμματιστή ενεργές μετά.</string>
<string name="phantom_fix_no_toggle">Αυτή η έκδοση Android δεν έχει διακόπτη για αυτό. Χρησιμοποιήστε τον ασύρματο εντοπισμό σφαλμάτων για να το αλλάξετε από αυτή τη συσκευή.</string>
<string name="upd_block_no_apk">Αυτή η έκδοση δεν έχει λήψη για αυτό το αντίγραφο του DroidDeck.</string>
+4 -2
View File
@@ -648,6 +648,9 @@
<string name="perf_hostname">Nombre del host</string>
<string name="perf_hostname_hint">El nombre que Steam ve para este dispositivo. En blanco restaura %1$s.</string>
<string name="perf_hostname_invalid">Solo letras, dígitos y guiones internos, hasta 63 caracteres.</string>
<string name="perf_desktop_as_user">El escritorio se ejecuta como usuario</string>
<string name="perf_desktop_as_user_hint">El escritorio, sus apps y sus terminales se ejecutan como el usuario normal deck en lugar de root, para las apps que rechazan root. sudo sigue funcionando. Se aplica al próximo escritorio.</string>
<string name="perf_desktop_as_user_needs_native">Requiere Ejecutar sin proot.</string>
<string name="perf_phantom_warning">Android está configurado para cerrar esta sesión</string>
<string name="driver_installed">Instalado</string>
<string name="driver_available">Disponible para descargar</string>
@@ -2161,6 +2164,7 @@
<string name="bottom_qam_layout_left">Izquierda</string>
<string name="bottom_qam_layout_center">Centro</string>
<string name="bottom_qam_layout_right">Derecha</string>
<string name="bottom_qam_layout_split">Dividido</string>
<string name="bottom_qam_unavailable">El menú de acceso rápido de Steam aún no está disponible.</string>
<string name="bottom_page_telemetry">Estadísticas del juego</string>
<string name="bottom_hud_group">HUD de la pantalla inferior</string>
@@ -2472,8 +2476,6 @@
<string name="phantom_instructions_fix">%1$s Si no es posible, conecta este dispositivo a un ordenador con ADB y ejecuta el comando de abajo. Después vuelve aquí y comprueba de nuevo.</string>
<string name="phantom_instructions_off">Ya se pueden iniciar sesiones de Steam.</string>
<string name="phantom_instructions_not_applicable">Esta versión de Android no usa este límite.</string>
<string name="phantom_title_uncounted">DroidDeck gestiona el límite de procesos secundarios</string>
<string name="phantom_instructions_uncounted">DroidDeck ejecuta los programas de la sesión en procesos que Android no cuenta, así que las Opciones para desarrolladores pueden seguir desactivadas.</string>
<string name="phantom_fix_toggle">Activa “Inhabilitar restricciones de procesos secundarios” en Opciones de desarrollador y deja activadas las Opciones de desarrollador después.</string>
<string name="phantom_fix_no_toggle">Esta versión de Android no tiene un interruptor para ello. Usa la Depuración inalámbrica para cambiarlo desde este dispositivo.</string>
<string name="upd_block_no_apk">Esta versión no tiene descarga para esta copia de DroidDeck.</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Isäntänimi</string>
<string name="perf_hostname_hint">Nimi, jonka Steam näkee tälle laitteelle. Tyhjä palauttaa arvon %1$s.</string>
<string name="perf_hostname_invalid">Vain kirjaimia, numeroita ja sisäisiä yhdysmerkkejä, enintään 63 merkkiä.</string>
<string name="perf_desktop_as_user">Työpöytä toimii käyttäjänä</string>
<string name="perf_desktop_as_user_hint">Työpöytä, sen sovellukset ja päätteet toimivat tavallisena käyttäjänä deck rootin sijaan, rootin torjuvia sovelluksia varten. sudo toimii edelleen. Koskee seuraavaa työpöytää.</string>
<string name="perf_desktop_as_user_needs_native">Vaatii Suorita ilman prootia.</string>
<string name="perf_phantom_warning">Android on asetettu lopettamaan tämä istunto</string>
<string name="driver_installed">Asennettu</string>
<string name="driver_available">Ladattavissa</string>
@@ -2136,6 +2139,7 @@
<string name="bottom_qam_layout_left">Vasen</string>
<string name="bottom_qam_layout_center">Keskellä</string>
<string name="bottom_qam_layout_right">Oikea</string>
<string name="bottom_qam_layout_split">Jaettu</string>
<string name="bottom_qam_unavailable">Steamin pikavalikko ei ole vielä käytettävissä.</string>
<string name="bottom_page_telemetry">Pelinsisäiset tilastot</string>
<string name="bottom_hud_group">Alanäytön HUD</string>
@@ -2446,8 +2450,6 @@
<string name="phantom_instructions_fix">%1$s Jos se ei ole mahdollista, yhdistä tämä laite tietokoneeseen ADB:llä ja suorita alla oleva komento. Palaa tähän ja tarkista uudelleen.</string>
<string name="phantom_instructions_off">Steam-istunnot voivat käynnistyä.</string>
<string name="phantom_instructions_not_applicable">Tämä Android-versio ei käytä tätä rajaa.</string>
<string name="phantom_title_uncounted">DroidDeck hoitaa aliprosessirajoituksen</string>
<string name="phantom_instructions_uncounted">DroidDeck ajaa istunnon ohjelmat prosesseissa, joita Android ei laske, joten kehittäjäasetukset voivat pysyä pois päältä.</string>
<string name="phantom_fix_toggle">Ota käyttöön ”Poista käytöstä alatason prosessirajoitukset” Kehittäjäasetuksissa, ja pidä Kehittäjäasetukset päällä sen jälkeen.</string>
<string name="phantom_fix_no_toggle">Tässä Android-versiossa ei ole kytkintä sille. Käytä langatonta virheenkorjausta muuttaaksesi sitä tältä laitteelta.</string>
<string name="upd_block_no_apk">Tälle versiolle ei ole latausta tähän DroidDeck-kopioon.</string>
+4 -2
View File
@@ -648,6 +648,9 @@
<string name="perf_hostname">Nom d\'hôte</string>
<string name="perf_hostname_hint">Le nom sous lequel Steam voit cet appareil. Laisser vide pour restaurer %1$s.</string>
<string name="perf_hostname_invalid">Ne peut contenir que des lettres, des chiffres et des tirets au milieu, jusqu\'à 63 caractères.</string>
<string name="perf_desktop_as_user">Le bureau s’exécute en tant qu’utilisateur</string>
<string name="perf_desktop_as_user_hint">Le bureau, ses applications et ses terminaux s’exécutent en tant qu’utilisateur ordinaire deck au lieu de root, pour les applications qui refusent root. sudo fonctionne toujours. S’applique au prochain bureau.</string>
<string name="perf_desktop_as_user_needs_native">Nécessite Exécuter sans proot.</string>
<string name="perf_phantom_warning">Android est configuré pour terminer cette session</string>
<string name="driver_installed">Installé</string>
<string name="driver_available">Téléchargeable</string>
@@ -2160,6 +2163,7 @@
<string name="bottom_qam_layout_left">Gauche</string>
<string name="bottom_qam_layout_center">Centre</string>
<string name="bottom_qam_layout_right">Droite</string>
<string name="bottom_qam_layout_split">Partagé</string>
<string name="bottom_qam_unavailable">Le menu d’accès rapide de Steam n’est pas encore disponible.</string>
<string name="bottom_page_telemetry">Statistiques en jeu</string>
<string name="bottom_hud_group">HUD de l\'écran du bas</string>
@@ -2471,8 +2475,6 @@
<string name="phantom_instructions_fix">%1$s Si ce n\'est pas possible, connectez cet appareil à un ordinateur avec ADB et exécutez la commande ci-dessous. Revenez ensuite ici et vérifiez à nouveau.</string>
<string name="phantom_instructions_off">Les sessions Steam peuvent démarrer.</string>
<string name="phantom_instructions_not_applicable">Cette version d\'Android n\'utilise pas cette limite.</string>
<string name="phantom_title_uncounted">Limite de processus enfants gérée par DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck exécute les programmes de la session dans des processus qu’Android ne compte pas : les options pour les développeurs peuvent rester désactivées.</string>
<string name="phantom_fix_toggle">Activez « Désactiver les limites pour les processus enfant » dans les options pour les développeurs, puis laissez les options pour les développeurs activées.</string>
<string name="phantom_fix_no_toggle">Cette version d\'Android ne dispose pas de cet interrupteur. Utilisez le débogage sans fil pour le modifier depuis cet appareil.</string>
<string name="upd_block_no_apk">Cette version ne propose aucun téléchargement pour cette copie de DroidDeck.</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">होस्ट नाम</string>
<string name="perf_hostname_hint">वह नाम जो Steam इस डिवाइस के लिए देखता है। खाली छोड़ने पर %1$s वापस आ जाता है।</string>
<string name="perf_hostname_invalid">सिर्फ़ अक्षर, अंक और बीच के हाइफ़न, 63 वर्णों तक।</string>
<string name="perf_desktop_as_user">डेस्कटॉप उपयोगकर्ता के रूप में चलता है</string>
<string name="perf_desktop_as_user_hint">डेस्कटॉप, उसके ऐप और टर्मिनल root के बजाय सामान्य उपयोगकर्ता deck के रूप में चलते हैं, उन ऐप के लिए जो root को अस्वीकार करते हैं। sudo फिर भी काम करता है। अगले डेस्कटॉप पर लागू होता है।</string>
<string name="perf_desktop_as_user_needs_native">proot के बिना चलाएँ आवश्यक है।</string>
<string name="perf_phantom_warning">Android इस सेशन को बंद करने के लिए सेट है</string>
<string name="driver_installed">इंस्टॉल है</string>
<string name="driver_available">डाउनलोड के लिए उपलब्ध</string>
@@ -2136,6 +2139,7 @@
<string name="bottom_qam_layout_left">बाएँ</string>
<string name="bottom_qam_layout_center">बीच में</string>
<string name="bottom_qam_layout_right">दाएँ</string>
<string name="bottom_qam_layout_split">विभाजित</string>
<string name="bottom_qam_unavailable">Steam का क्विक एक्सेस मेनू अभी उपलब्ध नहीं है।</string>
<string name="bottom_page_telemetry">इन-गेम आंकड़े</string>
<string name="bottom_hud_group">निचली स्क्रीन HUD</string>
@@ -2446,8 +2450,6 @@
<string name="phantom_instructions_fix">%1$s अगर यह संभव नहीं है, तो इस डिवाइस को ADB वाले कंप्यूटर से कनेक्ट करें और नीचे दिया कमांड चलाएं। यहां वापस आएं और फिर से जांचें।</string>
<string name="phantom_instructions_off">Steam सेशन शुरू हो सकते हैं।</string>
<string name="phantom_instructions_not_applicable">यह Android वर्शन इस सीमा का उपयोग नहीं करता।</string>
<string name="phantom_title_uncounted">चाइल्ड-प्रोसेस सीमा DroidDeck संभालता है</string>
<string name="phantom_instructions_uncounted">DroidDeck सत्र के प्रोग्राम उन प्रोसेस में चलाता है जिन्हें Android नहीं गिनता, इसलिए डेवलपर विकल्प बंद रह सकते हैं।</string>
<string name="phantom_fix_toggle">डेवलपर विकल्प में “चाइल्ड प्रोसेस से जुड़ी पाबंदियां हटाएं” चालू करें, और बाद में डेवलपर विकल्प चालू रहने दें।</string>
<string name="phantom_fix_no_toggle">इस Android वर्शन में इसके लिए कोई स्विच नहीं है। इसे इस डिवाइस से बदलने के लिए वायरलेस डीबगिंग इस्तेमाल करें।</string>
<string name="upd_block_no_apk">इस बिल्ड में DroidDeck की इस कॉपी के लिए कोई डाउनलोड नहीं है।</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Hosztnév</string>
<string name="perf_hostname_hint">A név, amelyet a Steam ehhez az eszközhöz lát. Üresen hagyva visszaállítja: %1$s.</string>
<string name="perf_hostname_invalid">Csak betűk, számok és belső kötőjelek, legfeljebb 63 karakter.</string>
<string name="perf_desktop_as_user">Az asztal felhasználóként fut</string>
<string name="perf_desktop_as_user_hint">Az asztal, az alkalmazásai és a termináljai root helyett a deck nevű átlagos felhasználóként futnak, a root-ot elutasító alkalmazások miatt. A sudo továbbra is működik. A következő asztaltól érvényes.</string>
<string name="perf_desktop_as_user_needs_native">A Futtatás proot nélkül szükséges hozzá.</string>
<string name="perf_phantom_warning">Az Android be van állítva, hogy kilője ezt a munkamenetet</string>
<string name="driver_installed">Telepítve</string>
<string name="driver_available">Letölthető</string>
@@ -2136,6 +2139,7 @@
<string name="bottom_qam_layout_left">Balra</string>
<string name="bottom_qam_layout_center">Középen</string>
<string name="bottom_qam_layout_right">Jobbra</string>
<string name="bottom_qam_layout_split">Osztott</string>
<string name="bottom_qam_unavailable">A Steam gyorselérési menüje még nem érhető el.</string>
<string name="bottom_page_telemetry">Játékon belüli statisztikák</string>
<string name="bottom_hud_group">HUD az alsó képernyőn</string>
@@ -2446,8 +2450,6 @@
<string name="phantom_instructions_fix">%1$s Ha ez nem lehetséges, csatlakoztassa ezt az eszközt egy ADB-vel rendelkező számítógéphez, és futtassa az alábbi parancsot. Térjen vissza ide, és ellenőrizze újra.</string>
<string name="phantom_instructions_off">A Steam-munkamenetek elindulhatnak.</string>
<string name="phantom_instructions_not_applicable">Ez az Android-verzió nem használja ezt a korlátot.</string>
<string name="phantom_title_uncounted">A gyermekfolyamat-korlátot a DroidDeck kezeli</string>
<string name="phantom_instructions_uncounted">A DroidDeck a munkamenet programjait olyan folyamatokban futtatja, amelyeket az Android nem számol bele, így a fejlesztői beállítások kikapcsolva maradhatnak.</string>
<string name="phantom_fix_toggle">Kapcsolja be az „Alárendelt folyamatok korlátozásának kikapcsolása” lehetőséget a Fejlesztői beállításokban, és utána hagyja bekapcsolva a Fejlesztői beállításokat.</string>
<string name="phantom_fix_no_toggle">Ehhez az Android-verzióhoz nincs kapcsoló. Használja a vezeték nélküli hibakeresést a módosításához erről az eszközről.</string>
<string name="upd_block_no_apk">Ehhez a buildhez nincs letöltés a DroidDeck ezen másolatához.</string>
+4 -2
View File
@@ -644,6 +644,9 @@
<string name="perf_hostname">Nama host</string>
<string name="perf_hostname_hint">Nama yang dilihat Steam untuk perangkat ini. Kosongkan untuk memulihkan %1$s.</string>
<string name="perf_hostname_invalid">Hanya huruf, angka, dan tanda hubung di tengah, hingga 63 karakter.</string>
<string name="perf_desktop_as_user">Desktop berjalan sebagai pengguna</string>
<string name="perf_desktop_as_user_hint">Desktop, aplikasi, dan terminalnya berjalan sebagai pengguna biasa deck, bukan root, untuk aplikasi yang menolak root. sudo tetap berfungsi. Berlaku untuk desktop berikutnya.</string>
<string name="perf_desktop_as_user_needs_native">Memerlukan Jalankan tanpa proot.</string>
<string name="perf_phantom_warning">Android diatur untuk menghentikan sesi ini</string>
<string name="driver_installed">Terinstal</string>
<string name="driver_available">Tersedia untuk diunduh</string>
@@ -2112,6 +2115,7 @@
<string name="bottom_qam_layout_left">Kiri</string>
<string name="bottom_qam_layout_center">Tengah</string>
<string name="bottom_qam_layout_right">Kanan</string>
<string name="bottom_qam_layout_split">Terbagi</string>
<string name="bottom_qam_unavailable">Menu Akses Cepat Steam belum tersedia.</string>
<string name="bottom_page_telemetry">Statistik dalam gim</string>
<string name="bottom_hud_group">HUD layar bawah</string>
@@ -2421,8 +2425,6 @@
<string name="phantom_instructions_fix">%1$s Jika itu tidak memungkinkan, sambungkan perangkat ini ke komputer dengan ADB dan jalankan perintah di bawah. Kembali ke sini dan periksa lagi.</string>
<string name="phantom_instructions_off">Sesi Steam dapat dimulai.</string>
<string name="phantom_instructions_not_applicable">Versi Android ini tidak menggunakan batas ini.</string>
<string name="phantom_title_uncounted">Batas proses anak ditangani DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck menjalankan program sesi dalam proses yang tidak dihitung Android, jadi Opsi developer bisa tetap nonaktif.</string>
<string name="phantom_fix_toggle">Aktifkan “Nonaktifkan batasan proses turunan” di Opsi developer, dan biarkan Opsi developer tetap aktif setelahnya.</string>
<string name="phantom_fix_no_toggle">Versi Android ini tidak memiliki sakelar untuk itu. Gunakan Debugging nirkabel untuk mengubahnya dari perangkat ini.</string>
<string name="upd_block_no_apk">Build ini tidak memiliki unduhan untuk salinan DroidDeck ini.</string>
+4 -2
View File
@@ -648,6 +648,9 @@
<string name="perf_hostname">Nome host</string>
<string name="perf_hostname_hint">Il nome con cui Steam vede questo dispositivo. Se vuoto, torna a %1$s.</string>
<string name="perf_hostname_invalid">Solo lettere, cifre e trattini interni, fino a 63 caratteri.</string>
<string name="perf_desktop_as_user">Il desktop viene eseguito come utente</string>
<string name="perf_desktop_as_user_hint">Il desktop, le sue app e i suoi terminali vengono eseguiti come utente normale deck invece che come root, per le app che rifiutano root. sudo funziona comunque. Si applica al prossimo desktop.</string>
<string name="perf_desktop_as_user_needs_native">Richiede Esegui senza proot.</string>
<string name="perf_phantom_warning">Android è impostato per terminare questa sessione</string>
<string name="driver_installed">Installati</string>
<string name="driver_available">Disponibili per il download</string>
@@ -2152,6 +2155,7 @@
<string name="bottom_qam_layout_left">Sinistra</string>
<string name="bottom_qam_layout_center">Centro</string>
<string name="bottom_qam_layout_right">Destra</string>
<string name="bottom_qam_layout_split">Diviso</string>
<string name="bottom_qam_unavailable">Il menu di accesso rapido di Steam non è ancora disponibile.</string>
<string name="bottom_page_telemetry">Statistiche di gioco</string>
<string name="bottom_hud_group">HUD dello schermo inferiore</string>
@@ -2463,8 +2467,6 @@
<string name="phantom_instructions_fix">%1$s Se non è possibile, collega questo dispositivo a un computer con ADB ed esegui il comando qui sotto. Poi torna qui e ricontrolla.</string>
<string name="phantom_instructions_off">Le sessioni Steam possono avviarsi.</string>
<string name="phantom_instructions_not_applicable">Questa versione di Android non usa questo limite.</string>
<string name="phantom_title_uncounted">Limite dei processi figli gestito da DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck esegue i programmi della sessione in processi che Android non conteggia, quindi le Opzioni sviluppatore possono restare disattivate.</string>
<string name="phantom_fix_toggle">Attiva “Disattiva limitazioni per i processi secondari” in Opzioni sviluppatore e poi lascia attive le Opzioni sviluppatore.</string>
<string name="phantom_fix_no_toggle">Questa versione di Android non ha un interruttore per farlo. Usa il debug wireless per cambiarlo da questo dispositivo.</string>
<string name="upd_block_no_apk">Questa build non ha un download per questa copia di DroidDeck.</string>
+4 -2
View File
@@ -644,6 +644,9 @@
<string name="perf_hostname">ホスト名</string>
<string name="perf_hostname_hint">Steamがこのデバイスを認識する名前。空にすると%1$sに戻ります。</string>
<string name="perf_hostname_invalid">英数字と中間のハイフンのみ使用でき、最大63文字です。</string>
<string name="perf_desktop_as_user">デスクトップをユーザーとして実行</string>
<string name="perf_desktop_as_user_hint">デスクトップとそのアプリやターミナルを root ではなく一般ユーザー deck として実行します。root を拒否するアプリ向けです。sudo は引き続き使えます。次回のデスクトップから適用されます。</string>
<string name="perf_desktop_as_user_needs_native">proot なしで実行が必要です。</string>
<string name="perf_phantom_warning">Androidがこのセッションを終了するように設定されています</string>
<string name="driver_installed">インストール済み</string>
<string name="driver_available">ダウンロード可能</string>
@@ -2112,6 +2115,7 @@
<string name="bottom_qam_layout_left">左</string>
<string name="bottom_qam_layout_center">中央</string>
<string name="bottom_qam_layout_right">右</string>
<string name="bottom_qam_layout_split">分割</string>
<string name="bottom_qam_unavailable">Steam のクイックアクセスメニューはまだ使えません。</string>
<string name="bottom_page_telemetry">ゲーム内統計</string>
<string name="bottom_hud_group">下部画面の HUD</string>
@@ -2421,8 +2425,6 @@
<string name="phantom_instructions_fix">%1$s それができない場合は、このデバイスをADBが使えるPCに接続し、以下のコマンドを実行してください。その後ここに戻って再確認してください。</string>
<string name="phantom_instructions_off">Steamセッションを開始できます。</string>
<string name="phantom_instructions_not_applicable">このAndroidバージョンではこの制限は使用されません。</string>
<string name="phantom_title_uncounted">子プロセスの制限は DroidDeck が対処します</string>
<string name="phantom_instructions_uncounted">DroidDeck はセッションのプログラムを Android が数えないプロセスで実行するため、開発者向けオプションはオフのままでかまいません。</string>
<string name="phantom_fix_toggle">開発者向けオプションで「子プロセスの制限を無効化」をオンにし、その後も開発者向けオプションをオンのままにしてください。</string>
<string name="phantom_fix_no_toggle">このAndroidバージョンにはこのスイッチがありません。ワイヤレスデバッグを使って、このデバイスから変更してください。</string>
<string name="upd_block_no_apk">このビルドには、このDroidDeckコピー用のダウンロードがありません。</string>
+4 -2
View File
@@ -644,6 +644,9 @@
<string name="perf_hostname">호스트 이름</string>
<string name="perf_hostname_hint">Steam이 이 기기를 인식하는 이름입니다. 비워 두면 %1$s(으)로 복원됩니다.</string>
<string name="perf_hostname_invalid">영문, 숫자 및 중간 하이픈만 사용할 수 있으며 최대 63자입니다.</string>
<string name="perf_desktop_as_user">데스크톱을 사용자로 실행</string>
<string name="perf_desktop_as_user_hint">데스크톱과 앱, 터미널이 root 대신 일반 사용자 deck으로 실행됩니다. root를 거부하는 앱을 위한 설정입니다. sudo는 계속 사용할 수 있습니다. 다음 데스크톱부터 적용됩니다.</string>
<string name="perf_desktop_as_user_needs_native">proot 없이 실행이 필요합니다.</string>
<string name="perf_phantom_warning">Android가 이 세션을 종료하도록 설정했습니다</string>
<string name="driver_installed">설치됨</string>
<string name="driver_available">다운로드 가능</string>
@@ -2112,6 +2115,7 @@
<string name="bottom_qam_layout_left">왼쪽</string>
<string name="bottom_qam_layout_center">가운데</string>
<string name="bottom_qam_layout_right">오른쪽</string>
<string name="bottom_qam_layout_split">분할</string>
<string name="bottom_qam_unavailable">Steam 빠른 메뉴를 아직 사용할 수 없습니다.</string>
<string name="bottom_page_telemetry">게임 내 통계</string>
<string name="bottom_hud_group">하단 화면 HUD</string>
@@ -2421,8 +2425,6 @@
<string name="phantom_instructions_fix">%1$s 이 방법을 사용할 수 없으면 이 기기를 ADB가 설치된 PC에 연결하고 아래 명령을 실행하세요. 그런 다음 여기로 돌아와 다시 확인하세요.</string>
<string name="phantom_instructions_off">Steam 세션을 시작할 수 있습니다.</string>
<string name="phantom_instructions_not_applicable">이 Android 버전에서는 이 제한을 사용하지 않습니다.</string>
<string name="phantom_title_uncounted">하위 프로세스 제한은 DroidDeck이 처리합니다</string>
<string name="phantom_instructions_uncounted">DroidDeck은 세션의 프로그램을 Android가 세지 않는 프로세스에서 실행하므로 개발자 옵션을 꺼 둔 채로 두어도 됩니다.</string>
<string name="phantom_fix_toggle">개발자 옵션에서 “하위 프로세스 제한 사용 중지”를 켜고, 이후에도 개발자 옵션을 켜 둔 상태로 유지하세요.</string>
<string name="phantom_fix_no_toggle">이 Android 버전에는 해당 스위치가 없습니다. 무선 디버깅을 사용하여 이 기기에서 변경하세요.</string>
<string name="upd_block_no_apk">이 빌드에는 이 DroidDeck 복사본용 다운로드가 없습니다.</string>
+4 -2
View File
@@ -644,6 +644,9 @@
<string name="perf_hostname">Nama hos</string>
<string name="perf_hostname_hint">Nama yang dilihat Steam untuk peranti ini. Kosongkan untuk memulihkan %1$s.</string>
<string name="perf_hostname_invalid">Huruf, digit dan tanda sempang dalaman sahaja, sehingga 63 aksara.</string>
<string name="perf_desktop_as_user">Desktop berjalan sebagai pengguna</string>
<string name="perf_desktop_as_user_hint">Desktop, aplnya dan terminalnya berjalan sebagai pengguna biasa deck dan bukan root, untuk apl yang menolak root. sudo masih berfungsi. Berkuat kuasa pada desktop seterusnya.</string>
<string name="perf_desktop_as_user_needs_native">Memerlukan Jalankan tanpa proot.</string>
<string name="perf_phantom_warning">Android ditetapkan untuk menamatkan sesi ini</string>
<string name="driver_installed">Dipasang</string>
<string name="driver_available">Tersedia untuk dimuat turun</string>
@@ -2112,6 +2115,7 @@
<string name="bottom_qam_layout_left">Kiri</string>
<string name="bottom_qam_layout_center">Tengah</string>
<string name="bottom_qam_layout_right">Kanan</string>
<string name="bottom_qam_layout_split">Terbahagi</string>
<string name="bottom_qam_unavailable">Menu Akses Pantas Steam belum tersedia.</string>
<string name="bottom_page_telemetry">Statistik dalam permainan</string>
<string name="bottom_hud_group">HUD skrin bawah</string>
@@ -2421,8 +2425,6 @@
<string name="phantom_instructions_fix">%1$s Jika itu tidak boleh, sambungkan peranti ini ke komputer dengan ADB dan jalankan arahan di bawah. Kembali ke sini dan semak semula.</string>
<string name="phantom_instructions_off">Sesi Steam boleh dimulakan.</string>
<string name="phantom_instructions_not_applicable">Versi Android ini tidak menggunakan had ini.</string>
<string name="phantom_title_uncounted">Had proses anak dikendalikan oleh DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck menjalankan program sesi dalam proses yang tidak dikira oleh Android, jadi Pilihan pembangun boleh kekal dimatikan.</string>
<string name="phantom_fix_toggle">Hidupkan “Lumpuhkan sekatan proses anak” dalam Pilihan pembangun, dan biarkan Pilihan pembangun hidup selepas itu.</string>
<string name="phantom_fix_no_toggle">Versi Android ini tidak mempunyai suis untuknya. Gunakan Debugging Wayarles untuk menukarnya daripada peranti ini.</string>
<string name="upd_block_no_apk">Binaan ini tidak mempunyai muat turun untuk salinan DroidDeck ini.</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Vertsnavn</string>
<string name="perf_hostname_hint">Navnet Steam ser for denne enheten. Tomt gjenoppretter %1$s.</string>
<string name="perf_hostname_invalid">Bare bokstaver, tall og bindestreker inni navnet, opptil 63 tegn.</string>
<string name="perf_desktop_as_user">Skrivebordet kjører som bruker</string>
<string name="perf_desktop_as_user_hint">Skrivebordet, appene og terminalene kjører som den vanlige brukeren deck i stedet for root, for apper som avviser root. sudo virker fortsatt. Gjelder fra neste skrivebord.</string>
<string name="perf_desktop_as_user_needs_native">Krever Kjør uten proot.</string>
<string name="perf_phantom_warning">Android er satt til å avslutte denne sesjonen</string>
<string name="driver_installed">Installert</string>
<string name="driver_available">Tilgjengelig for nedlasting</string>
@@ -2136,6 +2139,7 @@
<string name="bottom_qam_layout_left">Venstre</string>
<string name="bottom_qam_layout_center">Midten</string>
<string name="bottom_qam_layout_right">Høyre</string>
<string name="bottom_qam_layout_split">Delt</string>
<string name="bottom_qam_unavailable">Steams hurtigtilgangsmeny er ikke tilgjengelig ennå.</string>
<string name="bottom_page_telemetry">Statistikk i spillet</string>
<string name="bottom_hud_group">HUD på bunnskjermen</string>
@@ -2446,8 +2450,6 @@
<string name="phantom_instructions_fix">%1$s Hvis det ikke er mulig, koble denne enheten til en datamaskin med ADB og kjør kommandoen under. Kom tilbake hit og kontroller igjen.</string>
<string name="phantom_instructions_off">Steam-sesjoner kan starte.</string>
<string name="phantom_instructions_not_applicable">Denne Android-versjonen bruker ikke denne grensen.</string>
<string name="phantom_title_uncounted">DroidDeck håndterer grensen for underprosesser</string>
<string name="phantom_instructions_uncounted">DroidDeck kjører programmene i økten i prosesser som Android ikke teller med, så utvikleralternativer kan forbli av.</string>
<string name="phantom_fix_toggle">Slå på «Slå av begrensninger for underordnede prosesser» i Utvikleralternativer, og la Utvikleralternativer stå på etterpå.</string>
<string name="phantom_fix_no_toggle">Denne Android-versjonen har ingen bryter for det. Bruk trådløs feilsøking for å endre det fra denne enheten.</string>
<string name="upd_block_no_apk">Denne builden har ingen nedlasting for denne kopien av DroidDeck.</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Hostnaam</string>
<string name="perf_hostname_hint">De naam die Steam voor dit apparaat ziet. Leeg herstelt %1$s.</string>
<string name="perf_hostname_invalid">Alleen letters, cijfers en koppeltekens binnen de naam, tot 63 tekens.</string>
<string name="perf_desktop_as_user">Bureaublad draait als gebruiker</string>
<string name="perf_desktop_as_user_hint">Het bureaublad, de apps en terminals draaien als de gewone gebruiker deck in plaats van root, voor apps die root weigeren. sudo werkt nog steeds. Geldt vanaf het volgende bureaublad.</string>
<string name="perf_desktop_as_user_needs_native">Vereist Uitvoeren zonder proot.</string>
<string name="perf_phantom_warning">Android is ingesteld om deze sessie te sluiten</string>
<string name="driver_installed">Geïnstalleerd</string>
<string name="driver_available">Beschikbaar om te downloaden</string>
@@ -2136,6 +2139,7 @@
<string name="bottom_qam_layout_left">Links</string>
<string name="bottom_qam_layout_center">Midden</string>
<string name="bottom_qam_layout_right">Rechts</string>
<string name="bottom_qam_layout_split">Gesplitst</string>
<string name="bottom_qam_unavailable">Het menu Snelle toegang van Steam is nog niet beschikbaar.</string>
<string name="bottom_page_telemetry">In-game statistieken</string>
<string name="bottom_hud_group">HUD op het onderste scherm</string>
@@ -2446,8 +2450,6 @@
<string name="phantom_instructions_fix">%1$s Als dat niet mogelijk is, sluit dit apparaat aan op een computer met ADB en voer de onderstaande opdracht uit. Kom hierna terug en controleer opnieuw.</string>
<string name="phantom_instructions_off">Steam-sessies kunnen starten.</string>
<string name="phantom_instructions_not_applicable">Deze Android-versie gebruikt deze limiet niet.</string>
<string name="phantom_title_uncounted">Limiet voor onderliggende processen geregeld door DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck voert de programma\'s van de sessie uit in processen die Android niet meetelt, dus Ontwikkelaarsopties kunnen uit blijven.</string>
<string name="phantom_fix_toggle">Schakel “Beperkingen voor onderliggende processen uitzetten” in bij Ontwikkelaarsopties en laat Ontwikkelaarsopties daarna aan staan.</string>
<string name="phantom_fix_no_toggle">Deze Android-versie heeft hier geen schakelaar voor. Gebruik draadloze foutopsporing om dit vanaf dit apparaat te wijzigen.</string>
<string name="upd_block_no_apk">Deze build heeft geen download voor dit exemplaar van DroidDeck.</string>
+4 -2
View File
@@ -650,6 +650,9 @@
<string name="perf_hostname">Nazwa hosta</string>
<string name="perf_hostname_hint">Nazwa tego urządzenia widoczna dla Steam. Puste pole przywraca %1$s.</string>
<string name="perf_hostname_invalid">Tylko litery, cyfry i łączniki w środku, do 63 znaków.</string>
<string name="perf_desktop_as_user">Pulpit działa jako użytkownik</string>
<string name="perf_desktop_as_user_hint">Pulpit, jego aplikacje i terminale działają jako zwykły użytkownik deck zamiast root, dla aplikacji, które odrzucają root. sudo nadal działa. Obowiązuje od następnego pulpitu.</string>
<string name="perf_desktop_as_user_needs_native">Wymaga Uruchamiaj bez proot.</string>
<string name="perf_phantom_warning">Android jest ustawiony tak, że zamknie tę sesję</string>
<string name="driver_installed">Zainstalowane</string>
<string name="driver_available">Do pobrania</string>
@@ -2186,6 +2189,7 @@
<string name="bottom_qam_layout_left">Do lewej</string>
<string name="bottom_qam_layout_center">Na środku</string>
<string name="bottom_qam_layout_right">Do prawej</string>
<string name="bottom_qam_layout_split">Podzielony</string>
<string name="bottom_qam_unavailable">Menu szybkiego dostępu Steam nie jest jeszcze dostępne.</string>
<string name="bottom_page_telemetry">Statystyki w grze</string>
<string name="bottom_hud_group">HUD dolnego ekranu</string>
@@ -2498,8 +2502,6 @@
<string name="phantom_instructions_fix">%1$s Jeśli to niemożliwe, podłącz to urządzenie do komputera z ADB i uruchom poniższe polecenie. Wróć tutaj i sprawdź ponownie.</string>
<string name="phantom_instructions_off">Sesje Steam mogą się uruchamiać.</string>
<string name="phantom_instructions_not_applicable">Ta wersja systemu Android nie używa tego limitu.</string>
<string name="phantom_title_uncounted">Limitem procesów podrzędnych zajmuje się DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck uruchamia programy sesji w procesach, których Android nie liczy, więc Opcje programisty mogą pozostać wyłączone.</string>
<string name="phantom_fix_toggle">Włącz „Wyłącz ograniczenia procesów podrzędnych aplikacji” w Opcjach programisty i nie wyłączaj potem Opcji programisty.</string>
<string name="phantom_fix_no_toggle">Ta wersja systemu Android nie ma dla niego przełącznika. Użyj debugowania bezprzewodowego, aby zmienić go z tego urządzenia.</string>
<string name="upd_block_no_apk">Ta wersja nie ma pliku do pobrania dla tej kopii DroidDeck.</string>
+4 -2
View File
@@ -648,6 +648,9 @@
<string name="perf_hostname">Nome do anfitrião</string>
<string name="perf_hostname_hint">O nome com que o Steam vê este dispositivo. Em branco, repõe %1$s.</string>
<string name="perf_hostname_invalid">Apenas letras, algarismos e hífenes interiores, até 63 carateres.</string>
<string name="perf_desktop_as_user">O ambiente de trabalho corre como utilizador</string>
<string name="perf_desktop_as_user_hint">O ambiente de trabalho, as suas apps e terminais correm como o utilizador comum deck em vez de root, para apps que recusam root. O sudo continua a funcionar. Aplica-se ao próximo ambiente de trabalho.</string>
<string name="perf_desktop_as_user_needs_native">Requer Executar sem proot.</string>
<string name="perf_phantom_warning">O Android está configurado para terminar esta sessão</string>
<string name="driver_installed">Instalado</string>
<string name="driver_available">Disponível para transferir</string>
@@ -2167,6 +2170,7 @@
<string name="bottom_qam_layout_left">Esquerda</string>
<string name="bottom_qam_layout_center">Centro</string>
<string name="bottom_qam_layout_right">Direita</string>
<string name="bottom_qam_layout_split">Dividido</string>
<string name="bottom_qam_unavailable">O menu de acesso rápido do Steam ainda não está disponível.</string>
<string name="bottom_page_telemetry">Estatísticas no jogo</string>
<string name="bottom_hud_group">HUD do ecrã inferior</string>
@@ -2478,8 +2482,6 @@
<string name="phantom_instructions_fix">%1$s Se não for possível, ligue este dispositivo a um computador com ADB e execute o comando abaixo. Volte aqui e verifique novamente.</string>
<string name="phantom_instructions_off">As sessões Steam podem ser iniciadas.</string>
<string name="phantom_instructions_not_applicable">Esta versão do Android não usa este limite.</string>
<string name="phantom_title_uncounted">Limite de processos filhos gerido pelo DroidDeck</string>
<string name="phantom_instructions_uncounted">O DroidDeck executa os programas da sessão em processos que o Android não conta, por isso as Opções de programador podem continuar desativadas.</string>
<string name="phantom_fix_toggle">Ative «Desativar restrições de processos secundários» nas Opções de programador e mantenha as Opções de programador ativadas depois.</string>
<string name="phantom_fix_no_toggle">Esta versão do Android não tem um interruptor para isto. Use a depuração sem fios para o alterar a partir deste dispositivo.</string>
<string name="upd_block_no_apk">Esta versão não tem transferência para esta cópia do DroidDeck.</string>
+4 -2
View File
@@ -648,6 +648,9 @@
<string name="perf_hostname">Nome do host</string>
<string name="perf_hostname_hint">O nome que a Steam vê para este dispositivo. Em branco, volta a ser %1$s.</string>
<string name="perf_hostname_invalid">Só letras, dígitos e hifens internos, até 63 caracteres.</string>
<string name="perf_desktop_as_user">A área de trabalho roda como usuário</string>
<string name="perf_desktop_as_user_hint">A área de trabalho, seus apps e terminais rodam como o usuário comum deck em vez de root, para apps que recusam root. O sudo continua funcionando. Vale a partir da próxima área de trabalho.</string>
<string name="perf_desktop_as_user_needs_native">Requer Executar sem proot.</string>
<string name="perf_phantom_warning">O Android está configurado para encerrar esta sessão</string>
<string name="driver_installed">Instalados</string>
<string name="driver_available">Disponíveis para download</string>
@@ -2175,6 +2178,7 @@
<string name="bottom_qam_layout_left">Esquerda</string>
<string name="bottom_qam_layout_center">Centro</string>
<string name="bottom_qam_layout_right">Direita</string>
<string name="bottom_qam_layout_split">Dividido</string>
<string name="bottom_qam_unavailable">O menu de acesso rápido do Steam ainda não está disponível.</string>
<string name="bottom_page_telemetry">Estatísticas no jogo</string>
<string name="bottom_hud_group">HUD da tela inferior</string>
@@ -2486,8 +2490,6 @@
<string name="phantom_instructions_fix">%1$s Se não for possível, conecte este dispositivo a um computador com ADB e execute o comando abaixo. Depois volte aqui e verifique de novo.</string>
<string name="phantom_instructions_off">As sessões do Steam podem ser iniciadas.</string>
<string name="phantom_instructions_not_applicable">Esta versão do Android não usa esse limite.</string>
<string name="phantom_title_uncounted">Limite de processos filhos gerenciado pelo DroidDeck</string>
<string name="phantom_instructions_uncounted">O DroidDeck executa os programas da sessão em processos que o Android não conta, então as Opções do desenvolvedor podem continuar desativadas.</string>
<string name="phantom_fix_toggle">Ative “Desativar restrições de processos filhos” nas Opções do desenvolvedor e mantenha as Opções do desenvolvedor ativadas depois.</string>
<string name="phantom_fix_no_toggle">Esta versão do Android não tem uma chave para isso. Use a depuração por Wi-Fi para alterar pelo próprio dispositivo.</string>
<string name="upd_block_no_apk">Esta versão não tem download para esta cópia do DroidDeck.</string>
+4 -2
View File
@@ -648,6 +648,9 @@
<string name="perf_hostname">Nume de host</string>
<string name="perf_hostname_hint">Numele pe care Steam îl vede pentru acest dispozitiv. Gol restaurează %1$s.</string>
<string name="perf_hostname_invalid">Doar litere, cifre și liniuțe interioare, până la 63 de caractere.</string>
<string name="perf_desktop_as_user">Desktopul rulează ca utilizator</string>
<string name="perf_desktop_as_user_hint">Desktopul, aplicațiile și terminalele sale rulează ca utilizatorul obișnuit deck în loc de root, pentru aplicațiile care refuză root. sudo funcționează în continuare. Se aplică la următorul desktop.</string>
<string name="perf_desktop_as_user_needs_native">Necesită Rulează fără proot.</string>
<string name="perf_phantom_warning">Android este setat să închidă această sesiune</string>
<string name="driver_installed">Instalat</string>
<string name="driver_available">Disponibil pentru descărcare</string>
@@ -2161,6 +2164,7 @@
<string name="bottom_qam_layout_left">Stânga</string>
<string name="bottom_qam_layout_center">Centru</string>
<string name="bottom_qam_layout_right">Dreapta</string>
<string name="bottom_qam_layout_split">Împărțit</string>
<string name="bottom_qam_unavailable">Meniul de acces rapid Steam nu este încă disponibil.</string>
<string name="bottom_page_telemetry">Statistici în joc</string>
<string name="bottom_hud_group">HUD pe ecranul de jos</string>
@@ -2472,8 +2476,6 @@
<string name="phantom_instructions_fix">%1$s Dacă nu este posibil, conectează acest dispozitiv la un computer cu ADB și rulează comanda de mai jos. Revino aici și verifică din nou.</string>
<string name="phantom_instructions_off">Sesiunile Steam pot porni.</string>
<string name="phantom_instructions_not_applicable">Această versiune de Android nu folosește această limită.</string>
<string name="phantom_title_uncounted">Limita proceselor copil este gestionată de DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck rulează programele sesiunii în procese pe care Android nu le numără, așa că Opțiunile pentru dezvoltatori pot rămâne dezactivate.</string>
<string name="phantom_fix_toggle">Activează „Dezactivează restricțiile pentru procese secundare” în Opțiunile pentru dezvoltatori, și lasă Opțiunile pentru dezvoltatori activate după aceea.</string>
<string name="phantom_fix_no_toggle">Această versiune de Android nu are un comutator pentru asta. Folosește Depanarea wireless pentru a o schimba de pe acest dispozitiv.</string>
<string name="upd_block_no_apk">Această versiune nu are o descărcare pentru această copie de DroidDeck.</string>
+4 -2
View File
@@ -650,6 +650,9 @@
<string name="perf_hostname">Имя хоста</string>
<string name="perf_hostname_hint">Имя, под которым Steam видит это устройство. Оставьте пустым, чтобы вернуть %1$s.</string>
<string name="perf_hostname_invalid">Только буквы, цифры и дефисы посередине, до 63 символов.</string>
<string name="perf_desktop_as_user">Рабочий стол от имени пользователя</string>
<string name="perf_desktop_as_user_hint">Рабочий стол, его приложения и терминалы работают от имени обычного пользователя deck вместо root — для приложений, которые отказываются работать от root. sudo по-прежнему работает. Применяется к следующему запуску рабочего стола.</string>
<string name="perf_desktop_as_user_needs_native">Требуется «Запуск без proot».</string>
<string name="perf_phantom_warning">Android настроен на завершение этой сессии</string>
<string name="driver_installed">Установлен</string>
<string name="driver_available">Доступен для скачивания</string>
@@ -2187,6 +2190,7 @@
<string name="bottom_qam_layout_left">Слева</string>
<string name="bottom_qam_layout_center">По центру</string>
<string name="bottom_qam_layout_right">Справа</string>
<string name="bottom_qam_layout_split">Разделённый</string>
<string name="bottom_qam_unavailable">Меню быстрого доступа Steam пока недоступно.</string>
<string name="bottom_page_telemetry">Игровая статистика</string>
<string name="bottom_hud_group">HUD нижнего экрана</string>
@@ -2499,8 +2503,6 @@
<string name="phantom_instructions_fix">%1$s Если это невозможно, подключите устройство к компьютеру с ADB и выполните команду ниже. Затем вернитесь сюда и проверьте снова.</string>
<string name="phantom_instructions_off">Сессии Steam могут запускаться.</string>
<string name="phantom_instructions_not_applicable">Эта версия Android не использует это ограничение.</string>
<string name="phantom_title_uncounted">Ограничение дочерних процессов обходит DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck запускает программы сеанса в процессах, которые Android не учитывает, поэтому параметры разработчика можно не включать.</string>
<string name="phantom_fix_toggle">Включите «Отключить ограничения для дочерних процессов» в разделе «Для разработчиков» и оставьте этот раздел включенным.</string>
<string name="phantom_fix_no_toggle">В этой версии Android нет такого переключателя. Измените настройку с этого устройства через отладку по Wi-Fi.</string>
<string name="upd_block_no_apk">В этой сборке нет загрузки для этой копии DroidDeck.</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Värdnamn</string>
<string name="perf_hostname_hint">Namnet Steam ser för den här enheten. Lämna tomt för att återställa till %1$s.</string>
<string name="perf_hostname_invalid">Endast bokstäver, siffror och bindestreck inuti, upp till 63 tecken.</string>
<string name="perf_desktop_as_user">Skrivbordet körs som användare</string>
<string name="perf_desktop_as_user_hint">Skrivbordet, dess appar och terminaler körs som den vanliga användaren deck i stället för root, för appar som vägrar root. sudo fungerar fortfarande. Gäller från nästa skrivbord.</string>
<string name="perf_desktop_as_user_needs_native">Kräver Kör utan proot.</string>
<string name="perf_phantom_warning">Android är inställt på att avsluta den här sessionen</string>
<string name="driver_installed">Installerad</string>
<string name="driver_available">Tillgänglig att ladda ned</string>
@@ -2136,6 +2139,7 @@
<string name="bottom_qam_layout_left">Vänster</string>
<string name="bottom_qam_layout_center">Mitten</string>
<string name="bottom_qam_layout_right">Höger</string>
<string name="bottom_qam_layout_split">Delad</string>
<string name="bottom_qam_unavailable">Steams snabbåtkomstmeny är inte tillgänglig än.</string>
<string name="bottom_page_telemetry">Statistik i spelet</string>
<string name="bottom_hud_group">HUD på nedre skärmen</string>
@@ -2446,8 +2450,6 @@
<string name="phantom_instructions_fix">%1$s Om det inte är möjligt ansluter du den här enheten till en dator med ADB och kör kommandot nedan. Kom tillbaka hit och kontrollera igen.</string>
<string name="phantom_instructions_off">Steam-sessioner kan starta.</string>
<string name="phantom_instructions_not_applicable">Den här Android-versionen använder inte den här gränsen.</string>
<string name="phantom_title_uncounted">DroidDeck hanterar gränsen för underprocesser</string>
<string name="phantom_instructions_uncounted">DroidDeck kör sessionens program i processer som Android inte räknar, så Utvecklaralternativ kan vara avstängda.</string>
<string name="phantom_fix_toggle">Slå på ”Inaktivera begränsningar på underordnade processer” i Utvecklaralternativ, och låt Utvecklaralternativ vara kvar på efteråt.</string>
<string name="phantom_fix_no_toggle">Den här Android-versionen har ingen växel för det. Använd trådlös felsökning för att ändra det från den här enheten.</string>
<string name="upd_block_no_apk">Den här versionen har ingen nedladdning för den här kopian av DroidDeck.</string>
+4 -2
View File
@@ -644,6 +644,9 @@
<string name="perf_hostname">ชื่อโฮสต์</string>
<string name="perf_hostname_hint">ชื่อที่ Steam มองเห็นสำหรับอุปกรณ์นี้ เว้นว่างไว้เพื่อคืนค่าเป็น %1$s</string>
<string name="perf_hostname_invalid">ใช้ได้เฉพาะตัวอักษร ตัวเลข และยัติภังค์ตรงกลาง ไม่เกิน 63 ตัวอักษร</string>
<string name="perf_desktop_as_user">เดสก์ท็อปทำงานในฐานะผู้ใช้</string>
<string name="perf_desktop_as_user_hint">เดสก์ท็อป แอป และเทอร์มินัลจะทำงานในฐานะผู้ใช้ทั่วไป deck แทน root สำหรับแอปที่ไม่ยอมทำงานด้วย root sudo ยังใช้งานได้ มีผลกับเดสก์ท็อปครั้งถัดไป</string>
<string name="perf_desktop_as_user_needs_native">ต้องเปิด เรียกใช้โดยไม่มี proot</string>
<string name="perf_phantom_warning">Android ถูกตั้งให้ปิดเซสชันนี้</string>
<string name="driver_installed">ติดตั้งแล้ว</string>
<string name="driver_available">พร้อมดาวน์โหลด</string>
@@ -2112,6 +2115,7 @@
<string name="bottom_qam_layout_left">ซ้าย</string>
<string name="bottom_qam_layout_center">กึ่งกลาง</string>
<string name="bottom_qam_layout_right">ขวา</string>
<string name="bottom_qam_layout_split">แบ่งหน้าจอ</string>
<string name="bottom_qam_unavailable">เมนูเข้าถึงด่วนของ Steam ยังไม่พร้อมใช้งาน</string>
<string name="bottom_page_telemetry">สถิติในเกม</string>
<string name="bottom_hud_group">HUD หน้าจอล่าง</string>
@@ -2421,8 +2425,6 @@
<string name="phantom_instructions_fix">%1$s หากทำไม่ได้ ให้เชื่อมต่ออุปกรณ์นี้กับคอมพิวเตอร์ที่มี ADB แล้วรันคำสั่งด้านล่าง กลับมาที่นี่แล้วตรวจสอบอีกครั้ง</string>
<string name="phantom_instructions_off">เซสชัน Steam สามารถเริ่มได้</string>
<string name="phantom_instructions_not_applicable">Android รุ่นนี้ไม่ใช้ขีดจำกัดนี้</string>
<string name="phantom_title_uncounted">DroidDeck จัดการขีดจำกัดโปรเซสลูกให้</string>
<string name="phantom_instructions_uncounted">DroidDeck เรียกใช้โปรแกรมของเซสชันในโปรเซสที่ Android ไม่นับ จึงปิดตัวเลือกสำหรับนักพัฒนาซอฟต์แวร์ไว้ได้</string>
<string name="phantom_fix_toggle">เปิด “ปิดการจำกัดการประมวลผลข้อมูลย่อย” ในตัวเลือกสำหรับนักพัฒนา และเปิดตัวเลือกสำหรับนักพัฒนาไว้ต่อไปหลังจากนั้น</string>
<string name="phantom_fix_no_toggle">Android รุ่นนี้ไม่มีสวิตช์สำหรับสิ่งนี้ ใช้ Wireless debugging เพื่อเปลี่ยนค่าจากอุปกรณ์นี้</string>
<string name="upd_block_no_apk">บิลด์นี้ไม่มีให้ดาวน์โหลดสำหรับสำเนานี้ของ DroidDeck</string>
+4 -2
View File
@@ -646,6 +646,9 @@
<string name="perf_hostname">Ana bilgisayar adı</string>
<string name="perf_hostname_hint">Steam\'in bu cihaz için gördüğü ad. Boş bırakılırsa %1$s geri yüklenir.</string>
<string name="perf_hostname_invalid">Yalnızca harf, rakam ve arada kısa çizgi; en fazla 63 karakter.</string>
<string name="perf_desktop_as_user">Masaüstü kullanıcı olarak çalışır</string>
<string name="perf_desktop_as_user_hint">Masaüstü, uygulamaları ve terminalleri root yerine sıradan kullanıcı deck olarak çalışır; root’u reddeden uygulamalar içindir. sudo çalışmaya devam eder. Bir sonraki masaüstünde geçerli olur.</string>
<string name="perf_desktop_as_user_needs_native">proot olmadan çalıştır gerekir.</string>
<string name="perf_phantom_warning">Android bu oturumu sonlandıracak şekilde ayarlı</string>
<string name="driver_installed">Yüklü</string>
<string name="driver_available">İndirilebilir</string>
@@ -2128,6 +2131,7 @@
<string name="bottom_qam_layout_left">Sol</string>
<string name="bottom_qam_layout_center">Orta</string>
<string name="bottom_qam_layout_right">Sağ</string>
<string name="bottom_qam_layout_split">Bölünmüş</string>
<string name="bottom_qam_unavailable">Steam Hızlı Erişim menüsü henüz kullanılamıyor.</string>
<string name="bottom_page_telemetry">Oyun içi istatistikler</string>
<string name="bottom_hud_group">Alt ekrandaki HUD</string>
@@ -2438,8 +2442,6 @@
<string name="phantom_instructions_fix">%1$s Bu mümkün değilse bu cihazı ADB\'li bir bilgisayara bağlayıp aşağıdaki komutu çalıştırın. Buraya dönüp yeniden kontrol edin.</string>
<string name="phantom_instructions_off">Steam oturumları başlayabilir.</string>
<string name="phantom_instructions_not_applicable">Bu Android sürümü bu sınırı kullanmaz.</string>
<string name="phantom_title_uncounted">Alt işlem sınırını DroidDeck yönetiyor</string>
<string name="phantom_instructions_uncounted">DroidDeck oturumun programlarını Android\'in saymadığı işlemlerde çalıştırır; bu yüzden Geliştirici seçenekleri kapalı kalabilir.</string>
<string name="phantom_fix_toggle">Geliştirici seçenekleri\'nde “Alt işlem kısıtlamalarını devre dışı bırak” seçeneğini açın ve sonrasında Geliştirici seçeneklerini açık tutun.</string>
<string name="phantom_fix_no_toggle">Bu Android sürümünde bunun için bir anahtar yok. Bu cihazdan değiştirmek için Kablosuz hata ayıklamayı kullanın.</string>
<string name="upd_block_no_apk">Bu derlemede bu DroidDeck kopyası için bir indirme yok.</string>
+4 -2
View File
@@ -650,6 +650,9 @@
<string name="perf_hostname">Ім’я хоста</string>
<string name="perf_hostname_hint">Ім’я, яке Steam бачить для цього пристрою. Порожнє значення відновлює %1$s.</string>
<string name="perf_hostname_invalid">Лише літери, цифри та дефіси всередині, до 63 символів.</string>
<string name="perf_desktop_as_user">Робочий стіл від імені користувача</string>
<string name="perf_desktop_as_user_hint">Робочий стіл, його застосунки й термінали працюють від імені звичайного користувача deck замість root — для застосунків, які відмовляються працювати від root. sudo і далі працює. Застосовується до наступного запуску робочого столу.</string>
<string name="perf_desktop_as_user_needs_native">Потрібен «Запуск без proot».</string>
<string name="perf_phantom_warning">Android налаштовано завершувати цей сеанс</string>
<string name="driver_installed">Встановлено</string>
<string name="driver_available">Доступно для завантаження</string>
@@ -2186,6 +2189,7 @@
<string name="bottom_qam_layout_left">Ліворуч</string>
<string name="bottom_qam_layout_center">По центру</string>
<string name="bottom_qam_layout_right">Праворуч</string>
<string name="bottom_qam_layout_split">Розділений</string>
<string name="bottom_qam_unavailable">Меню швидкого доступу Steam ще недоступне.</string>
<string name="bottom_page_telemetry">Ігрова статистика</string>
<string name="bottom_hud_group">HUD на нижньому екрані</string>
@@ -2498,8 +2502,6 @@
<string name="phantom_instructions_fix">%1$s Якщо це неможливо, підключіть цей пристрій до комп’ютера з ADB і виконайте команду нижче. Потім поверніться сюди і перевірте ще раз.</string>
<string name="phantom_instructions_off">Сеанси Steam можуть запускатися.</string>
<string name="phantom_instructions_not_applicable">Ця версія Android не використовує це обмеження.</string>
<string name="phantom_title_uncounted">Обмеження дочірніх процесів обходить DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck запускає програми сеансу в процесах, які Android не враховує, тож параметри розробника можна не вмикати.</string>
<string name="phantom_fix_toggle">Увімкніть «Вимкнути обмеження для дочірніх процесів» у розділі «Параметри розробника» і залишіть «Параметри розробника» увімкненими після цього.</string>
<string name="phantom_fix_no_toggle">У цій версії Android немає перемикача для цього. Змініть це з цього пристрою за допомогою бездротового налагодження.</string>
<string name="upd_block_no_apk">У цій збірці немає завантаження для цієї копії DroidDeck.</string>
+4 -2
View File
@@ -644,6 +644,9 @@
<string name="perf_hostname">Tên máy chủ</string>
<string name="perf_hostname_hint">Tên mà Steam thấy cho thiết bị này. Để trống để khôi phục %1$s.</string>
<string name="perf_hostname_invalid">Chỉ chữ, số và gạch ngang ở giữa, tối đa 63 ký tự.</string>
<string name="perf_desktop_as_user">Màn hình nền chạy dưới dạng người dùng</string>
<string name="perf_desktop_as_user_hint">Màn hình nền, các ứng dụng và terminal của nó chạy dưới người dùng thường deck thay vì root, cho các ứng dụng từ chối root. sudo vẫn hoạt động. Áp dụng cho lần mở màn hình nền tiếp theo.</string>
<string name="perf_desktop_as_user_needs_native">Cần bật Chạy không cần proot.</string>
<string name="perf_phantom_warning">Android được đặt để tắt phiên này</string>
<string name="driver_installed">Đã cài</string>
<string name="driver_available">Có thể tải</string>
@@ -2112,6 +2115,7 @@
<string name="bottom_qam_layout_left">Trái</string>
<string name="bottom_qam_layout_center">Giữa</string>
<string name="bottom_qam_layout_right">Phải</string>
<string name="bottom_qam_layout_split">Chia màn hình</string>
<string name="bottom_qam_unavailable">Menu Truy cập nhanh của Steam chưa sẵn sàng.</string>
<string name="bottom_page_telemetry">Thông số trong game</string>
<string name="bottom_hud_group">HUD màn hình dưới</string>
@@ -2421,8 +2425,6 @@
<string name="phantom_instructions_fix">%1$s Nếu không thể, hãy kết nối thiết bị này với một máy tính có ADB và chạy lệnh dưới đây. Quay lại đây và kiểm tra lại.</string>
<string name="phantom_instructions_off">Phiên Steam có thể khởi động.</string>
<string name="phantom_instructions_not_applicable">Phiên bản Android này không dùng giới hạn này.</string>
<string name="phantom_title_uncounted">DroidDeck xử lý giới hạn tiến trình con</string>
<string name="phantom_instructions_uncounted">DroidDeck chạy các chương trình của phiên trong những tiến trình mà Android không tính, nên có thể để tắt Tùy chọn cho nhà phát triển.</string>
<string name="phantom_fix_toggle">Bật “Tắt các mục hạn chế đối với tiến trình con” trong Developer options, và giữ Developer options luôn mở sau đó.</string>
<string name="phantom_fix_no_toggle">Phiên bản Android này không có công tắc cho việc đó. Dùng Gỡ lỗi qua mạng không dây để đổi nó từ thiết bị này.</string>
<string name="upd_block_no_apk">Bản build này không có tệp tải cho bản DroidDeck này.</string>
+4 -2
View File
@@ -644,6 +644,9 @@
<string name="perf_hostname">主机名</string>
<string name="perf_hostname_hint">Steam 看到的本设备名称。留空恢复为 %1$s。</string>
<string name="perf_hostname_invalid">仅限字母、数字,连字符只能位于中间,最多 63 个字符。</string>
<string name="perf_desktop_as_user">桌面以普通用户运行</string>
<string name="perf_desktop_as_user_hint">桌面及其应用和终端以普通用户 deck 而非 root 运行,适用于拒绝以 root 运行的应用。sudo 仍可使用。下次启动桌面时生效。</string>
<string name="perf_desktop_as_user_needs_native">需要开启“不使用 proot 运行”。</string>
<string name="perf_phantom_warning">Android 将会终止此会话</string>
<string name="driver_installed">已安装</string>
<string name="driver_available">可下载</string>
@@ -2189,6 +2192,7 @@
<string name="bottom_qam_layout_left">左侧</string>
<string name="bottom_qam_layout_center">居中</string>
<string name="bottom_qam_layout_right">右侧</string>
<string name="bottom_qam_layout_split">分屏</string>
<string name="bottom_qam_unavailable">Steam 快速访问菜单暂不可用。</string>
<string name="bottom_page_telemetry">游戏内数据</string>
<string name="bottom_hud_group">下屏 HUD</string>
@@ -2498,8 +2502,6 @@
<string name="phantom_instructions_fix">%1$s 如果无法做到,请将此设备连接到装有 ADB 的电脑并运行下方命令,然后返回此处重新检查。</string>
<string name="phantom_instructions_off">可以启动 Steam 会话了。</string>
<string name="phantom_instructions_not_applicable">此 Android 版本不使用该限制。</string>
<string name="phantom_title_uncounted">子进程限制由 DroidDeck 处理</string>
<string name="phantom_instructions_uncounted">DroidDeck 在 Android 不计数的进程中运行会话程序,因此开发者选项可以保持关闭。</string>
<string name="phantom_fix_toggle">在开发者选项中打开“停止限制子进程”,之后请保持开发者选项开启。</string>
<string name="phantom_fix_no_toggle">此 Android 版本没有该开关。请使用无线调试在此设备上更改。</string>
<string name="upd_block_no_apk">此构建没有适用于此 DroidDeck 副本的下载。</string>
+4 -2
View File
@@ -644,6 +644,9 @@
<string name="perf_hostname">主機名稱</string>
<string name="perf_hostname_hint">Steam 看到的此裝置名稱。留空則還原為 %1$s。</string>
<string name="perf_hostname_invalid">只可使用字母、數字和中間的連字號,最多 63 個字元。</string>
<string name="perf_desktop_as_user">桌面以普通用戶執行</string>
<string name="perf_desktop_as_user_hint">桌面及其應用程式和終端機會以普通用戶 deck 而非 root 執行,適用於拒絕以 root 執行的應用程式。sudo 仍可使用。下次開啟桌面時生效。</string>
<string name="perf_desktop_as_user_needs_native">需要開啟「不使用 proot 執行」。</string>
<string name="perf_phantom_warning">Android 已設定為終止此會話</string>
<string name="driver_installed">已安裝</string>
<string name="driver_available">可供下載</string>
@@ -2111,6 +2114,7 @@
<string name="bottom_qam_layout_left">左側</string>
<string name="bottom_qam_layout_center">置中</string>
<string name="bottom_qam_layout_right">右側</string>
<string name="bottom_qam_layout_split">分割</string>
<string name="bottom_qam_unavailable">Steam 快速存取選單暫時無法使用。</string>
<string name="bottom_page_telemetry">遊戲內數據</string>
<string name="bottom_hud_group">下方螢幕 HUD</string>
@@ -2418,8 +2422,6 @@
<string name="phantom_instructions_fix">%1$s 如無法這樣做,請將此裝置連接到已安裝 ADB 的電腦,並執行以下指令,然後返回這裡再檢查一次。</string>
<string name="phantom_instructions_off">可以啟動 Steam 會話。</string>
<string name="phantom_instructions_not_applicable">此 Android 版本不使用此限制。</string>
<string name="phantom_title_uncounted">子程序限制由 DroidDeck 處理</string>
<string name="phantom_instructions_uncounted">DroidDeck 在 Android 不計算的程序中執行工作階段的程式,因此開發人員選項可以保持關閉。</string>
<string name="phantom_fix_toggle">在開發人員選項中開啟「停用對子處理過程的限制」,之後請保持開發人員選項開啟。</string>
<string name="phantom_fix_no_toggle">此 Android 版本沒有此開關。請使用無線偵錯,直接在此裝置上更改。</string>
<string name="upd_block_no_apk">此版本沒有適用於此 DroidDeck 版本的下載。</string>
+4 -2
View File
@@ -644,6 +644,9 @@
<string name="perf_hostname">主機名稱</string>
<string name="perf_hostname_hint">Steam 看到的此裝置名稱。留空可還原為 %1$s。</string>
<string name="perf_hostname_invalid">只能包含字母、數字和中間的連字號,最多 63 個字元。</string>
<string name="perf_desktop_as_user">桌面以一般使用者執行</string>
<string name="perf_desktop_as_user_hint">桌面及其應用程式和終端機會以一般使用者 deck 而非 root 執行,適用於拒絕以 root 執行的應用程式。sudo 仍可使用。下次開啟桌面時生效。</string>
<string name="perf_desktop_as_user_needs_native">需要開啟「不使用 proot 執行」。</string>
<string name="perf_phantom_warning">Android 已設定為結束此工作階段</string>
<string name="driver_installed">已安裝</string>
<string name="driver_available">可下載</string>
@@ -2111,6 +2114,7 @@
<string name="bottom_qam_layout_left">左側</string>
<string name="bottom_qam_layout_center">置中</string>
<string name="bottom_qam_layout_right">右側</string>
<string name="bottom_qam_layout_split">分割</string>
<string name="bottom_qam_unavailable">Steam 快速存取選單暫時無法使用。</string>
<string name="bottom_page_telemetry">遊戲內數據</string>
<string name="bottom_hud_group">下螢幕 HUD</string>
@@ -2418,8 +2422,6 @@
<string name="phantom_instructions_fix">%1$s 如果無法這麼做,請將此裝置連接到裝有 ADB 的電腦並執行下方指令,然後返回這裡重新檢查。</string>
<string name="phantom_instructions_off">可以啟動 Steam 工作階段。</string>
<string name="phantom_instructions_not_applicable">此 Android 版本不使用這項限制。</string>
<string name="phantom_title_uncounted">子程序限制由 DroidDeck 處理</string>
<string name="phantom_instructions_uncounted">DroidDeck 在 Android 不計算的程序中執行工作階段的程式,因此開發人員選項可以保持關閉。</string>
<string name="phantom_fix_toggle">在開發人員選項中開啟「停止限制子程序」,之後請保持開發人員選項開啟。</string>
<string name="phantom_fix_no_toggle">此 Android 版本沒有這個開關。請使用無線偵錯,直接在此裝置上變更。</string>
<string name="upd_block_no_apk">此組建版本沒有適用於此 DroidDeck 複本的下載檔案。</string>
+20 -3
View File
@@ -678,6 +678,9 @@
<string name="perf_hostname">Host name</string>
<string name="perf_hostname_hint">The name Steam sees for this device. Blank restores %1$s.</string>
<string name="perf_hostname_invalid">Letters, digits and inner hyphens only, up to 63 characters.</string>
<string name="perf_desktop_as_user">Desktop runs as a user</string>
<string name="perf_desktop_as_user_hint">The desktop, its apps and its terminals run as the ordinary user deck instead of root, for apps that refuse root. sudo still works. Applies to the next desktop.</string>
<string name="perf_desktop_as_user_needs_native">Needs Run without proot.</string>
<string name="perf_phantom_warning">Android is set to kill this session</string>
<string name="driver_installed">Installed</string>
<string name="driver_available">Available to download</string>
@@ -707,7 +710,22 @@
<string name="drawer_next_page">Next page</string>
<string name="drawer_manage_pages">Arrange pages</string>
<string name="drawer_page_more">More</string>
<string name="drawer_more_back">Back to %1$s</string>
<string name="drawer_page_performance">Performance</string>
<string name="drawer_page_game">Game</string>
<string name="drawer_page_vr">VR &amp; glasses</string>
<string name="drawer_section_pacing">Frame pacing</string>
<string name="drawer_section_mouse">Mouse</string>
<string name="drawer_section_keyboard_layout">Keyboard layout</string>
<string name="drawer_section_input">Input profile</string>
<string name="drawer_section_compat">Compatibility</string>
<string name="drawer_section_tuning">Fine tuning</string>
<string name="drawer_tag_controller">controller connected</string>
<string name="drawer_tag_no_controller">no controller</string>
<string name="drawer_tag_running">running</string>
<string name="drawer_tag_custom">custom look</string>
<string name="drawer_tag_attached">attached</string>
<string name="drawer_tag_downloading">downloading</string>
<string name="drawer_pause_game">Pause game</string> <string name="drawer_more_back">Back to %1$s</string>
<string name="drawer_more_empty">Nothing is kept here. Arrange pages and move one below the More row.</string>
<string name="drawer_pages_reset">Reset</string>
<string name="drawer_pages_done">Done</string>
@@ -2419,6 +2437,7 @@
<string name="bottom_qam_layout_left">Left</string>
<string name="bottom_qam_layout_center">Center</string>
<string name="bottom_qam_layout_right">Right</string>
<string name="bottom_qam_layout_split">Split</string>
<string name="bottom_qam_unavailable">Steam\'s Quick Access menu is not available yet.</string>
<string name="bottom_page_telemetry">In-game stats</string>
<string name="bottom_hud_group">Bottom screen HUD</string>
@@ -2749,8 +2768,6 @@
<string name="phantom_instructions_fix">%1$s If that is not possible, connect this device to a computer with ADB and run the command below. Return here and check again.</string>
<string name="phantom_instructions_off">Steam sessions can start.</string>
<string name="phantom_instructions_not_applicable">This Android version does not use this limit.</string>
<string name="phantom_title_uncounted">Child-process limit handled by DroidDeck</string>
<string name="phantom_instructions_uncounted">DroidDeck runs most of the session\'s programs in processes Android does not count, which keeps the session well under the limit, so Developer options can stay off. Steam and some of its helpers still count.</string>
<string name="phantom_fix_toggle">Turn on “Disable child process restrictions” in Developer options, and keep Developer options on afterwards.</string>
<string name="phantom_fix_no_toggle">This Android version has no switch for it. Use Wireless debugging to change it from this device.</string>
<string name="upd_block_no_apk">This build has no download for this copy of DroidDeck.</string>
@@ -81,10 +81,4 @@ class PhantomProcessLimitTest {
assertFalse(PhantomProcessLimit.hasDeveloperToggle(33))
assertTrue(PhantomProcessLimit.hasDeveloperToggle(34))
}
@Test
fun theLimitOnDoesNotBlockSteamWhenTheSessionStaysOutOfItsCount() {
assertFalse(PhantomProcessLimit.blocksSteam(PhantomProcessStatus.UNCOUNTED))
assertTrue(PhantomProcessLimit.blocksSteam(PhantomProcessStatus.ENABLED))
}
}
@@ -44,6 +44,40 @@ class ElfSeccompPatchTest {
}
}
@Test
fun terminalRequestsUseTheOnesAndroidAllowsOnAPseudoTerminal() {
// glibc 2.43's tcsetattr: TCSETS2 into x0, TCGETS2 into x1, with an unrelated instruction between
val data = elfWith(
0xd28a8560.toInt(), 0x910123e2.toInt(), 0xf2a80580.toInt(),
0xd28a8541.toInt(), 0x93407ea0.toInt(), 0xf2b00581.toInt(),
0x528a85a3.toInt(), 0x72a80583.toInt(),
)
assertEquals(3, ElfSeccompPatch.patch(data))
val b = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN)
val nop = 0xd503201f.toInt()
assertEquals(0xd28a8040.toInt(), b.getInt(0x100)) // mov x0, #0x5402 (TCSETS)
assertEquals(nop, b.getInt(0x108))
assertEquals(0xd28a8021.toInt(), b.getInt(0x10c)) // mov x1, #0x5401 (TCGETS)
assertEquals(nop, b.getInt(0x114))
assertEquals(0x528a8083.toInt(), b.getInt(0x118)) // mov w3, #0x5404 (TCSETSF)
assertEquals(nop, b.getInt(0x11c))
assertEquals(0, ElfSeccompPatch.patch(data))
}
@Test
fun aLookalikeConstantIsLeftAlone() {
// 0x542a with another high half, and one whose high half goes to another register
val data = elfWith(0xd28a8541.toInt(), 0xf2a00021.toInt(), 0xd28a8541.toInt(), 0xf2b00582.toInt())
assertEquals(0, ElfSeccompPatch.patch(data))
}
@Test
fun aSiteWhoseRegisterIsReadBeforeTheHighHalfIsLeftAlone() {
// movz x1, #0x542a; add x2, x1, #1; movk x1, #0x802c, lsl #16; movk x2, #0x402c, lsl #16
val data = elfWith(0xd28a8541.toInt(), 0x91000422.toInt(), 0xf2b00581.toInt(), 0xf2a80582.toInt())
assertEquals(0, ElfSeccompPatch.patch(data))
}
@Test
fun otherSystemCallsAreLeftAlone() {
val svc = 0xd4000001.toInt()
@@ -80,6 +80,24 @@ class OrientationTest {
assertFalse(SessionPrefs.portrait(landscape))
}
@Test fun modeOrientationControlsWindowFollowAndPortraitResolution() {
SessionPrefs.setOrientation(context, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
assertEquals(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, SessionPrefs.windowOrientation(context, true, 700, SessionService.MODE_STEAM))
SessionPrefs.setOrientation(context, "steam", ActivityInfo.SCREEN_ORIENTATION_USER)
assertEquals(ActivityInfo.SCREEN_ORIENTATION_USER, SessionPrefs.windowOrientation(context, true, 700, SessionService.MODE_STEAM))
assertEquals(ActivityInfo.SCREEN_ORIENTATION_USER, SessionPrefs.windowOrientation(context, false, 400, SessionService.MODE_RUN))
val config = android.content.res.Configuration(context.resources.configuration)
config.orientation = android.content.res.Configuration.ORIENTATION_PORTRAIT
val portrait = context.createConfigurationContext(config)
config.orientation = android.content.res.Configuration.ORIENTATION_LANDSCAPE
val landscape = context.createConfigurationContext(config)
assertTrue(SessionPrefs.portrait(portrait, SessionService.MODE_STEAM))
assertFalse(SessionPrefs.portrait(landscape, SessionService.MODE_STEAM))
assertTrue(SessionPrefs.portrait(landscape, SessionService.MODE_DESKTOP))
}
@Test fun invalidLauncherOrientationFallsBackAndInvalidChoicePreservesPreference() {
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putInt("orientation", 999).commit()
assertEquals(ActivityInfo.SCREEN_ORIENTATION_USER, AppUiPrefs.orientation(context))
@@ -88,4 +106,20 @@ class OrientationTest {
assertEquals(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, AppUiPrefs.orientation(context))
}
@Test fun steamAndDesktopOrientationsAreIndependentAndFallBackToLegacyChoice() {
assertEquals(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, SessionPrefs.orientation(context, "steam"))
assertEquals(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, SessionPrefs.orientation(context, "desktop"))
SessionPrefs.setOrientation(context, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
SessionPrefs.setOrientation(context, "steam", ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
SessionPrefs.setOrientation(context, "desktop", ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE)
assertEquals(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, SessionPrefs.orientation(context, "steam"))
assertEquals(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, SessionPrefs.orientation(context, SessionService.MODE_STEAM))
assertEquals(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, SessionPrefs.orientation(context, SessionService.MODE_RUN))
assertEquals(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE, SessionPrefs.orientation(context, "desktop"))
assertEquals(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE, SessionPrefs.orientation(context, SessionService.MODE_DESKTOP))
assertEquals(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, SessionPrefs.orientation(context))
}
}
@@ -30,4 +30,16 @@ class OutputPacingTest {
@Test fun mirroringKeepsTheGlassesRate() {
assertEquals(60, SessionPrefs.compositorFpsLimit(60))
}
@Test fun gameModeOverrideCapsAPanelThatRunsFaster() {
assertEquals(60, SessionPrefs.hostFrameCap(60.000004f, 120.00001f))
assertEquals(0, SessionPrefs.hostFrameCap(120.00001f, 120.00001f))
assertEquals(0, SessionPrefs.hostFrameCap(0f, 120f))
}
@Test fun hostCapPacesSteamSessionsAndYieldsToLowerLimits() {
assertEquals(60, SessionPrefs.compositorFpsLimit(0, 0, hostCap = 60))
assertEquals(45, SessionPrefs.compositorFpsLimit(0, 45, hostCap = 60))
assertEquals(SessionPrefs.PIP_FPS, SessionPrefs.compositorFpsLimit(0, 0, pip = true, hostCap = 60))
}
}
@@ -1,5 +1,6 @@
package com.droiddeck.launcher.session
import com.droiddeck.launcher.ui.MainMenuLayout
import com.droiddeck.launcher.ui.QamFit
import com.droiddeck.launcher.ui.QamLayout
import org.junit.Assert.assertEquals
@@ -51,6 +52,7 @@ class SteamQamTest {
val program = "const g = {};\n" + steps.joinToString("\n") { step ->
when (step) {
is Triple<*, *, *> -> SteamQam.leaseScript(step.first as Boolean, step.second as Long, step.third as Float)
is SplitStep -> SteamQam.leaseScript(true, step.owner, 0.5f, step.split)
is Pair<*, *> -> if (step.second == EXPIRE) "g.__ddQamUntil = Date.now() - 1;" else SteamQam.leaseScript(step.first as Boolean, step.second as Long)
else -> error("unknown step $step")
}
@@ -85,14 +87,17 @@ class SteamQamTest {
@Test fun theQuickAccessButtonTogglesTheTopScreenAndTheWideLayoutFollows() {
val script = SteamQam.script(true)
assertTrue(script.contains("const ours = () => held() && m.m_eOpenSideMenu === QAM && !g.__ddQamTop;"))
assertTrue(script.contains("const ours = () => held() && !g.__ddQamTop && (m.m_eOpenSideMenu === QAM || (probing() && m.m_eOpenSideMenu === MAIN));"))
assertTrue(script.contains("if (press !== g.__ddQamPress) {"))
assertTrue(QamLayout.contentScript(true).contains("max-width: none !important"))
assertFalse(QamLayout.contentScript(false).contains("max-width: none"))
// The empty in-game button-hint footer is hidden only while the menu is parked, in every layout.
assertTrue(QamLayout.contentScript(false, parked = true).contains("#Footer { display: none !important; }"))
assertFalse(QamLayout.contentScript(false).contains("#Footer"))
}
@Test fun theMenuIsLaidOutAtThePanelsShapeOnlyWhileHeld() {
assertTrue(SteamQam.script(true, 1.5f, owner = 3).contains("g.__ddQamOwner = 3; g.__ddQamUntil = Date.now() + ${SteamQam.LEASE_MS}; g.__ddQamAspect = 1.5; }"))
assertTrue(SteamQam.script(true, 1.5f, owner = 3).contains("g.__ddQamOwner = 3; g.__ddQamUntil = Date.now() + ${SteamQam.LEASE_MS}; g.__ddQamAspect = 1.5; g.__ddQamSplit = false; }"))
assertFalse(SteamQam.script(true).contains("g.__ddQamAspect ="))
assertFalse(SteamQam.script(false, 1.5f).contains("g.__ddQamAspect ="))
}
@@ -114,8 +119,8 @@ class SteamQamTest {
@Test fun whileHeldTheMenuStaysOffTheTopScreenAndOutOfTheGamesWay() {
val script = SteamQam.script(true)
assertTrue(script.contains("return without >= 2 ? v : 1;"))
assertTrue(script.contains("if (w > 0 && ours()) { x = popup.m_popup.innerWidth + 64; w = width(h) || w; }"))
assertTrue(script.contains("nav.m_LastActiveNavTree?.m_ID?.startsWith(\"QuickAccess\")"))
assertTrue(script.contains("if (w > 0 && ours() && isQam(v)) { x = parkX(); [w, h] = size(w, h); }"))
assertTrue(script.contains("/^(QuickAccess|MainMenu)/.test(nav.m_LastActiveNavTree?.m_ID ?? \"\")"))
assertTrue(script.contains("if (m.m_eOpenSideMenu === QAM) m.CloseSideMenus();"))
}
@@ -134,8 +139,9 @@ class SteamQamTest {
assertEquals(0f, QamLayout.fit(1280f, 832f, 1280f, 640f, 1).second, 0.001f)
}
@Test fun theLayoutButtonCyclesFullLeftCenterRight() {
assertEquals(listOf(QamFit.LEFT, QamFit.CENTER, QamFit.RIGHT, QamFit.FULL), QamFit.entries.map { it.next })
@Test fun theLayoutButtonCyclesFullLeftCenterRightSplit() {
assertEquals(listOf(QamFit.LEFT, QamFit.CENTER, QamFit.RIGHT, QamFit.SPLIT, QamFit.FULL), QamFit.entries.map { it.next })
assertEquals(QamFit.SPLIT, QamFit.from("split"))
assertEquals(QamFit.FULL, QamFit.from(null))
assertEquals(QamFit.RIGHT, QamFit.from("right"))
assertEquals(QamFit.FULL, QamFit.from("sideways"))
@@ -147,6 +153,61 @@ class SteamQamTest {
assertEquals(0f, left, 0.001f)
}
@Test fun findsTheMainMenuPageBesideQuickAccess() {
val json = """[
{"title":"MainMenu_uid2","webSocketDebuggerUrl":"ws://127.0.0.1:8080/devtools/page/M41N"},
{"title":"QuickAccess_uid2","webSocketDebuggerUrl":"ws://127.0.0.1:8080/devtools/page/0F3A-b9"}
]"""
assertEquals(SteamQam.Target(4321, "/devtools/page/0F3A-b9", "/devtools/page/M41N"), SteamQam.parseTarget(4321, json))
assertNull(SteamQam.parseTarget(1, """[{"title":"MainMenu_uid2","webSocketDebuggerUrl":"ws://127.0.0.1:1/devtools/page/A"}]"""))
}
@Test fun theSplitLayoutIsPartOfTheLease() {
assertEquals("true", runLease(listOf(SplitStep(1L, true)), "g.__ddQamSplit"))
// A rejected hold from an older panel leaves the newer panel's split choice alone.
assertEquals("true", runLease(listOf(SplitStep(2L, true), SplitStep(1L, false)), "g.__ddQamSplit"))
assertTrue(SteamQam.script(true, 0.5f, owner = 3, split = true).contains("g.__ddQamSplit = true; }"))
}
@Test fun onlyTheQuickAccessViewIsParked() {
val script = SteamQam.script(true, 1.3f, owner = 3)
// Store and other web pages live in the header's view, which keeps the bounds Steam gives it.
assertTrue(script.contains("const isQam = (v) => !v.__ddMain && v !== headerView() &&"))
assertTrue(script.contains("if (on && m.m_eOpenSideMenu === QAM && !v.__ddMain && v !== headerView()) {"))
assertTrue(script.contains("if (!isQam(v)) {"))
// A parked menu leaves the Store page unfrosted.
assertTrue(script.contains("inst.__ddQamGlass.call(this, ours() ? 0 : e)"))
}
@Test fun mainMenuDiscoveryRecoversAfterFailedProbes() {
val script = SteamQam.script(true, 1.3f, owner = 3, split = true)
assertTrue(script.contains("if (split() !== !!g.__ddQamSplitOn) { g.__ddQamSplitOn = split(); if (split()) g.__ddMainProbes = 0; }"))
assertTrue(script.contains("if ((g.__ddMainProbes || 0) >= 3 && Date.now() - (g.__ddMainProbeLast || 0) > 30000) g.__ddMainProbes = 0;"))
}
@Test fun theMainMenuStaysInPlaceOnlyWhileParked() {
val script = SteamQam.script(true, 0.5f, owner = 3, split = true)
assertTrue(script.contains("transform: none !important"))
assertTrue(script.contains("mainStyle(!!mv && mainParked() && !probing());"))
// Steam sizing the main menu for the top screen drops the parked style at once.
assertTrue(script.contains("if (v.__ddMain && w > 0) mainStyle(false);"))
}
@Test fun theScriptsParse() {
val node = runCatching { ProcessBuilder("node", "--version").start().waitFor() == 0 }.getOrDefault(false)
org.junit.Assume.assumeTrue("node is not installed", node)
val scripts = listOf(SteamQam.script(true, 0.5f, 3, split = true), SteamQam.script(false, owner = 3),
QamLayout.contentScript(true), MainMenuLayout.CONTENT_SCRIPT)
val program = scripts.joinToString(";") { "new Function(" + org.json.JSONObject.quote(it) + ")" }
// Passed on stdin: Windows argument quoting would mangle the quotes in the scripts.
val p = ProcessBuilder("node").redirectErrorStream(true).start()
p.outputStream.use { it.write(program.toByteArray()) }
val out = p.inputStream.bufferedReader().readText()
assertEquals(out, 0, p.waitFor())
}
private data class SplitStep(val owner: Long, val split: Boolean)
private companion object {
/** A lease step that lets the current lease run out. */
const val EXPIRE = -1L
@@ -0,0 +1,12 @@
package com.droiddeck.launcher.ui
import androidx.compose.ui.test.SemanticsNodeInteractionsProvider
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performScrollTo
/** Session menu groups start folded; a test opens the one whose rows it checks. */
internal fun SemanticsNodeInteractionsProvider.openSection(key: String) {
if (DrawerSectionState.isOpen(key)) return
onNodeWithTag("drawer-section-$key").performScrollTo().performClick()
}
@@ -227,6 +227,81 @@ class InputSurfaceTouchTest {
touch(MotionEvent.ACTION_UP, 1 to (750f to 285f))
}
@Test fun theMiddleOfACrossedDpadPressesTheNearestArmInsteadOfFallingThrough() {
val up = InputSurfaceElement(InputControl.UP, .45f, .1f, .1f, .15f)
val down = InputSurfaceElement(InputControl.DOWN, .45f, .45f, .1f, .15f)
show(up, down, InputSurfaceElement(InputControl.LEFT, .3f, .25f, .15f, .2f),
InputSurfaceElement(InputControl.RIGHT, .55f, .25f, .15f, .2f), a)
val missed = mutableListOf<Int>()
view.onTouchMiss = { missed += it.actionMasked }
touch(MotionEvent.ACTION_DOWN, 1 to (500f to 170f))
assertEquals(-1, state().hatY())
touch(MotionEvent.ACTION_MOVE, 1 to (540f to 215f))
assertEquals(1, state().hatX())
assertEquals(0, state().hatY())
touch(MotionEvent.ACTION_UP, 1 to (540f to 215f))
assertEquals(0, state().hatX())
assertTrue(missed.isEmpty())
assertFalse(view.takesTouchAt(250f, 210f))
assertFalse(view.takesTouchAt(800f, 500f))
assertFalse(view.takesTouchAt(350f, 100f))
show(up, down)
assertFalse(view.takesTouchAt(500f, 210f))
view.onTouchMiss = null
}
@Test fun aHandPlacedDpadWithOffArmsStillTakesItsMiddle() {
show(InputSurfaceElement(InputControl.UP, .42f, .1f, .1f, .15f),
InputSurfaceElement(InputControl.DOWN, .42f, .45f, .1f, .15f),
InputSurfaceElement(InputControl.LEFT, .3f, .27f, .15f, .15f),
InputSurfaceElement(InputControl.RIGHT, .5f, .25f, .15f, .2f))
touch(MotionEvent.ACTION_DOWN, 1 to (475f to 225f))
assertTrue(state().hatX() != 0 || state().hatY() != 0)
touch(MotionEvent.ACTION_UP, 1 to (475f to 225f))
assertFalse(view.takesTouchAt(750f, 225f))
}
@Test fun aTallGapPicksTheNearestArmAndSplitArmsAreNoCross() {
show(InputSurfaceElement(InputControl.UP, .45f, .1f, .1f, .15f),
InputSurfaceElement(InputControl.DOWN, .45f, .65f, .1f, .15f),
InputSurfaceElement(InputControl.LEFT, .3f, .35f, .15f, .2f),
InputSurfaceElement(InputControl.RIGHT, .55f, .35f, .15f, .2f))
touch(MotionEvent.ACTION_DOWN, 1 to (530f to 290f))
assertEquals(1, state().hatX())
assertEquals(0, state().hatY())
touch(MotionEvent.ACTION_UP, 1 to (530f to 290f))
touch(MotionEvent.ACTION_DOWN, 1 to (530f to 180f))
assertEquals(-1, state().hatY())
assertEquals(0, state().hatX())
touch(MotionEvent.ACTION_UP, 1 to (530f to 180f))
show(InputSurfaceElement(InputControl.UP, .2f, .1f, .1f, .15f),
InputSurfaceElement(InputControl.DOWN, .7f, .6f, .1f, .15f),
InputSurfaceElement(InputControl.LEFT, .1f, .35f, .15f, .2f),
InputSurfaceElement(InputControl.RIGHT, .8f, .35f, .15f, .2f))
assertFalse(view.takesTouchAt(500f, 300f))
}
@Test fun aSecondUpButtonDoesNotHideTheCross() {
show(InputSurfaceElement(InputControl.UP, .1f, .7f, .1f, .15f, "extra-up"),
InputSurfaceElement(InputControl.UP, .45f, .1f, .1f, .15f),
InputSurfaceElement(InputControl.DOWN, .45f, .45f, .1f, .15f),
InputSurfaceElement(InputControl.LEFT, .3f, .25f, .15f, .2f),
InputSurfaceElement(InputControl.RIGHT, .55f, .25f, .15f, .2f))
touch(MotionEvent.ACTION_DOWN, 1 to (500f to 170f))
assertEquals(-1, state().hatY())
touch(MotionEvent.ACTION_UP, 1 to (500f to 170f))
assertEquals(0, state().hatY())
show(InputSurfaceElement(InputControl.UP, .45f, 0f, .1f, .05f, "extra-up"),
InputSurfaceElement(InputControl.UP, .45f, .1f, .1f, .15f),
InputSurfaceElement(InputControl.DOWN, .45f, .45f, .1f, .15f),
InputSurfaceElement(InputControl.LEFT, .3f, .25f, .15f, .2f),
InputSurfaceElement(InputControl.RIGHT, .55f, .25f, .15f, .2f))
touch(MotionEvent.ACTION_DOWN, 1 to (490f to 170f))
assertEquals(-1, state().hatY())
assertEquals(0, state().hatX())
touch(MotionEvent.ACTION_UP, 1 to (490f to 170f))
}
@Test fun adaptiveSticksCaptureAroundThemAndTheLeftOneToTheEdge() {
val left = InputSurfaceElement(InputControl.LS, .3f, .3f, .2f, .4f, hideWhenIdle = true)
val right = InputSurfaceElement(InputControl.RS, .6f, .3f, .2f, .4f, hideWhenIdle = true)
@@ -77,6 +77,17 @@ class NavTabsTest {
assertFalse("desktop" in navigationKeys(s))
}
@Test fun moreStaysOnTheBarWhenNoTabIsShelvedSoTabsCanStillBeEdited() {
NavTabs.more(state()).forEach { place(it, TabPlace.HIDDEN) }
assertTrue(NavTabs.more(state()).isEmpty())
assertEquals(NavTabs.MORE, navigationKeys(state()).last())
NavTabs.reset(ctx)
NavTabs.more(state()).forEach { place(it, TabPlace.BAR) }
assertTrue(NavTabs.more(state()).isEmpty())
assertEquals(NavTabs.MORE, navigationKeys(state()).last())
assertEquals(1, navigationKeys(state()).count { it == NavTabs.MORE })
}
@Test fun appsAndTheDevHarnessCanBeShownWithoutHomeScreenOrDeveloperTools() {
place("android-apps", TabPlace.MORE)
assertTrue("android-apps" in NavTabs.more(state()))
@@ -31,7 +31,9 @@ class PenSettingsGroupTest {
@Test fun theDrawerHasNoPenGroupUntilAPenIsKnown() {
compose.setContent { DroidDeckTheme { SessionDrawer(true, SessionDrawerPage.CONTROLLER, false, {}, actions(pen = null)) } }
compose.openSection("controller-touch")
compose.onNodeWithTag("setting-touch").assertExists()
compose.onNodeWithTag("drawer-section-controller-pen").assertDoesNotExist()
compose.onNodeWithTag("setting-pen").assertDoesNotExist()
compose.onNodeWithTag("setting-pen-button").assertDoesNotExist()
}
@@ -43,6 +45,7 @@ class PenSettingsGroupTest {
SessionDrawer(true, SessionDrawerPage.CONTROLLER, false, {}, actions(SessionPrefs.Pen()) { k, v -> picks += k to v })
}
}
compose.openSection("controller-pen")
compose.onNodeWithTag("setting-pen-button").performScrollTo().performClick()
compose.onNodeWithText(context.getString(R.string.gesture_middle_click)).performScrollTo().performClick()
compose.onNodeWithTag("setting-pen").performScrollTo().performClick()
@@ -4,60 +4,51 @@ import org.junit.Assert.*
import org.junit.Test
class SessionDrawerPageTest {
@Test fun navigationStartsWithControllerAndGoesStraightToDisplay() {
@Test fun navigationRunsControllerPerformanceDisplayEffectsGameVrSession() {
val pages = sessionDrawerPages(hasAgent = false)
assertEquals(SessionDrawerPage.CONTROLLER, pages.first())
assertEquals(SessionDrawerPage.DISPLAY, pages.step(SessionDrawerPage.CONTROLLER, 1))
assertEquals(SessionDrawerPage.VR, pages.step(SessionDrawerPage.CONTROLLER, -1))
assertEquals(SessionDrawerPage.HUD, pages.step(SessionDrawerPage.DISPLAY, 1))
assertEquals(SessionDrawerPage.EFFECTS, pages.step(SessionDrawerPage.HUD, 1))
assertEquals(SessionDrawerPage.GAMES, pages.step(SessionDrawerPage.EFFECTS, 1))
assertEquals(SessionDrawerPage.SESSION, pages.step(SessionDrawerPage.GAMES, 1))
assertEquals(
listOf(SessionDrawerPage.CONTROLLER, SessionDrawerPage.HUD, SessionDrawerPage.DISPLAY, SessionDrawerPage.EFFECTS,
SessionDrawerPage.GAMES, SessionDrawerPage.VR, SessionDrawerPage.SESSION, SessionDrawerPage.MORE),
pages.strip(),
)
assertEquals(SessionDrawerPage.MORE, pages.step(SessionDrawerPage.CONTROLLER, -1))
}
@Test fun moreKeepsSteamVrByDefaultAndStandsInForThePagesInsideIt() {
val pages = sessionDrawerPages(hasAgent = false)
assertEquals(listOf(SessionDrawerPage.VR), pages.inMore())
assertEquals(SessionDrawerPage.MORE, pages.strip().last())
assertFalse(SessionDrawerPage.VR in pages.strip())
assertEquals(SessionDrawerPage.MORE, pages.tabFor(SessionDrawerPage.VR))
@Test fun achievementsAndTheAgentStartInsideMore() {
val pages = sessionDrawerPages(hasAchievements = true, hasAgent = true)
assertEquals(listOf(SessionDrawerPage.ACHIEVEMENTS, SessionDrawerPage.AGENT), pages.inMore())
assertEquals(SessionDrawerPage.MORE, pages.tabFor(SessionDrawerPage.ACHIEVEMENTS))
assertEquals(SessionDrawerPage.GAMES, pages.tabFor(SessionDrawerPage.GAMES))
val strip = pages.strip()
assertEquals(SessionDrawerPage.MORE, strip.step(SessionDrawerPage.SESSION, 1))
assertEquals(SessionDrawerPage.CONTROLLER, strip.step(SessionDrawerPage.MORE, 1))
assertEquals(SessionDrawerPage.SESSION, strip.step(pages.tabFor(SessionDrawerPage.VR), -1))
assertEquals(SessionDrawerPage.CONTROLLER, strip.step(pages.tabFor(SessionDrawerPage.AGENT), 1))
}
@Test fun achievementsAreOfferedOnlyForAGameThatHasThem() {
assertFalse(SessionDrawerPage.ACHIEVEMENTS in sessionDrawerPages(hasAchievements = false, hasAgent = false))
assertFalse(SessionDrawerPage.AGENT in sessionDrawerPages(hasAgent = false))
assertTrue(sessionDrawerPages(hasAgent = false).inMore().isEmpty())
}
@Test fun anOlderSavedOrderKeepsItsPagesAndGetsAMoreTabAfterSession() {
val saved = listOf("CONTROLLER", "DISPLAY", "HUD", "EFFECTS", "VR", "GAMES", "AGENT", "SESSION")
val saved = listOf("CONTROLLER", "GLASSES", "DISPLAY", "HUD", "EFFECTS", "VR", "GAMES", "AGENT", "SESSION")
val out = DrawerPages.arrange(saved)
assertEquals(SessionDrawerPage.entries.toSet(), out.toSet())
assertEquals(SessionDrawerPage.MORE, out[out.indexOf(SessionDrawerPage.SESSION) + 1])
assertTrue(out.indexOf(SessionDrawerPage.VR) < out.indexOf(SessionDrawerPage.EFFECTS) + 2)
assertTrue(out.inMore().isEmpty())
assertEquals(listOf(SessionDrawerPage.ACHIEVEMENTS), out.inMore())
assertTrue(SessionDrawerPage.AGENT in out.strip())
}
@Test fun sessionCanBeKeptInsideMore() {
val saved = listOf("CONTROLLER", "DISPLAY", "HUD", "EFFECTS", "GAMES", "AGENT", "MORE", "SESSION", "VR")
val out = DrawerPages.arrange(saved)
assertEquals(listOf(SessionDrawerPage.SESSION, SessionDrawerPage.VR), out.inMore())
assertEquals(listOf(SessionDrawerPage.ACHIEVEMENTS, SessionDrawerPage.SESSION, SessionDrawerPage.VR), out.inMore())
assertFalse(SessionDrawerPage.SESSION in out.strip())
}
@Test fun moreAndSessionCannotBeHidden() {
assertFalse(DrawerPages.hideable(SessionDrawerPage.MORE))
}
@Test fun glassesAddTheirPageAfterController() {
val pages = sessionDrawerPages(hasGlasses = true, hasAgent = false)
assertEquals(SessionDrawerPage.GLASSES, pages.step(SessionDrawerPage.CONTROLLER, 1))
assertEquals(sessionDrawerPages(hasAgent = false), pages.filter { it != SessionDrawerPage.GLASSES })
}
@Test fun theAgentPageComesBeforeSessionOnlyWhenTheTabIsShown() {
val with = sessionDrawerPages(hasAgent = true)
assertEquals(SessionDrawerPage.AGENT, with.step(SessionDrawerPage.GAMES, 1))
assertEquals(SessionDrawerPage.SESSION, with.step(SessionDrawerPage.AGENT, 1))
assertFalse(SessionDrawerPage.AGENT in sessionDrawerPages(hasAgent = false))
assertFalse(DrawerPages.hideable(SessionDrawerPage.SESSION))
assertTrue(DrawerPages.hideable(SessionDrawerPage.HUD))
}
@Test fun arrangeKeepsSavedOrderAndSlotsNewPagesAfterTheirNeighbour() {
@@ -67,9 +58,4 @@ class SessionDrawerPageTest {
assertEquals(listOf(SessionDrawerPage.SESSION, SessionDrawerPage.HUD), out.filter { it in setOf(SessionDrawerPage.SESSION, SessionDrawerPage.HUD) })
assertTrue(out.indexOf(SessionDrawerPage.HUD) < out.indexOf(SessionDrawerPage.CONTROLLER))
}
@Test fun sessionPageCannotBeHidden() {
assertFalse(DrawerPages.hideable(SessionDrawerPage.SESSION))
assertTrue(DrawerPages.hideable(SessionDrawerPage.HUD))
}
}
@@ -130,6 +130,8 @@ class SessionSecondScreenTest {
actions(true, listOf(SecondScreenDisplay(1, "Bottom screen"), SecondScreenDisplay(2, "Monitor")), gameSwap = true))
}
}
compose.onNodeWithText(context.getString(R.string.swap_game_screen)).assertDoesNotExist()
compose.openSection("display-second")
compose.onNodeWithText(context.getString(R.string.swap_game_screen)).performScrollTo().assertIsDisplayed()
compose.onNodeWithText("Bottom screen").performScrollTo().assertIsDisplayed()
}
@@ -265,7 +267,7 @@ class SessionSecondScreenTest {
state<Boolean>("drawerOpenState").value = true
state<Boolean>("drawerControllerActive").value = true
state<List<SecondScreenDisplay>>("secondScreenDisplays").value = listOf(SecondScreenDisplay(1, "Bottom screen"))
for ((button, page) in listOf(KeyEvent.KEYCODE_BUTTON_R1 to SessionDrawerPage.DISPLAY,
for ((button, page) in listOf(KeyEvent.KEYCODE_BUTTON_R1 to SessionDrawerPage.HUD,
KeyEvent.KEYCODE_BUTTON_L1 to SessionDrawerPage.CONTROLLER)) {
assertTrue(activity.dispatchKeyEvent(KeyEvent(0L, 0L, KeyEvent.ACTION_DOWN, button, 0, 0,
device.id, 0, 0, InputDevice.SOURCE_GAMEPAD)))
@@ -309,6 +311,7 @@ class SessionSecondScreenTest {
actions(true, emptyList(), micAvailable = true, micEnabled = true, onMic = changes::add))
}
}
compose.openSection("session-behavior")
compose.onNodeWithTag("setting-microphone").assertIsEnabled()
.assert(SemanticsMatcher.expectValue(StateDescription, context.getString(R.string.widgets_on))).performClick()
assertEquals(listOf(false), changes)
@@ -322,6 +325,7 @@ class SessionSecondScreenTest {
actions(true, emptyList(), micAvailable = true, onMic = changes::add))
}
}
compose.openSection("session-behavior")
compose.onNodeWithTag("setting-microphone").assertIsEnabled()
.assert(SemanticsMatcher.expectValue(StateDescription, context.getString(R.string.widgets_off))).performClick()
assertEquals(listOf(true), changes)
@@ -333,6 +337,7 @@ class SessionSecondScreenTest {
SessionDrawer(true, SessionDrawerPage.SESSION, false, {}, actions(false, emptyList()))
}
}
compose.openSection("session-behavior")
compose.onNodeWithTag("setting-microphone").assertDoesNotExist()
compose.onNodeWithText(context.getString(R.string.mode_mic)).assertDoesNotExist()
}
@@ -354,6 +359,7 @@ class SessionSecondScreenTest {
onInputSelection = { panel.refreshControls() }, onClose = { open.value = false }))
}
}
compose.openSection("controller-input")
compose.onNodeWithTag("setting-input-profile").performScrollTo().performClick()
compose.onNodeWithText("Desktop").performScrollTo().performClick()
compose.onNodeWithTag("input-profile-expand").performScrollTo().performClick()
+4 -2
View File
@@ -258,8 +258,10 @@ and `--rate` (120 samples a second); `--pressure` and tilt take `FROM:TO` ranges
`--tilt-x=-30:30` when they start negative. A gesture lasts at most 30 s. `UINPUT_UNAVAILABLE`
means the shell has no `uinput` or cannot write `/dev/uinput`, `NO_VIEWPORT` that there is no
internal display or it is off, and `UINPUT_FAILED` that `uinput` stopped early; all three exit 3.
It needs Android 14 QPR2 or later: the `uinput` of Android 12 to 14 QPR1 takes only numeric codes
and the USB or Bluetooth bus, so there the pen ends with `UINPUT_FAILED`.
The `uinput` of Android 12 to 14 QPR1 takes only numeric codes, the USB or Bluetooth bus and no
`sync` command. Below SDK 34 the pen and the gamepad send that form, with the pen on the USB bus,
and success is a clean exit. On SDK 34, which spans both sides of QPR2, the named form goes first
and is resent in that form when `uinput` rejects it before registering the device.
## State (schema 2)
+7 -1
View File
@@ -181,8 +181,10 @@ Plugin loaders expose Steam's CEF DevTools so the menu can be viewed in a deskto
- The menu's browser view is placed just outside the Big Picture window through its own `SetBounds`, so it keeps rendering but never shows on top, including while Steam slides it wider for Friends and chat. The view is also given the panel's shape (about 712 × 463 instead of Steam's 856 × 463), so every tab shows at one scale. In Full width, a style on the menu page also lifts Steam's 300 px cap on each tab, so every tab fills the panel and Friends shows its list and chat side by side.
- A timer inside Steam keeps this state every 250 ms, so the menu comes back, on the tab it was showing, as soon as Steam's main menu or a full-screen page such as Decky's store closes. It runs on a 5 s lease that the panel renews each second: if the app stops, Steam returns to normal by itself.
- The hold starts only once the session is ready: holding the menu before Steam's first frame kept gamescope from presenting anything.
- `droiddeck-qam-relay` relays the app to the DevTools port, which only answers clients inside the guest. The panel streams the menu with `Page.startScreencast`, scales its content to the panel and fills the rest with the menu's own background, and forwards touches on the menu with `Input.dispatchTouchEvent`. A layout button in the panel's bar cycles Full width (every tab stretched to the panel), Left, Center and Right (Steam's own narrow tabs, placed on that side); the choice is kept. Returning to the panel shows the last frame at once while the stream reconnects, and the first frame after a cold start takes about 1.4 s.
- `droiddeck-qam-relay` relays the app to the DevTools port, which only answers clients inside the guest. The panel streams the menu with `Page.startScreencast`, scales its content to the panel and fills the rest with the menu's own background, and forwards touches on the menu with `Input.dispatchTouchEvent`. A layout button in the panel's bar cycles Full width (every tab stretched to the panel), Left, Center and Right (Steam's own narrow tabs, placed on that side) and Split (below); the choice is kept. Returning to the panel shows the last frame at once while the stream reconnects, and the first frame after a cold start takes about 1.4 s.
- The Quick Access button still shows the menu on the top screen, in Steam's own layout and with the controller; closing it there (B or the button again) returns it to the bottom screen on the same tab.
- The Split layout puts Steam's main menu (the Steam button's menu) on the left and Quick Access on the right. Both are laid out 480 CSS pixels tall so they show at one scale: the main menu at Steam's own 240 px width with its rows spread over the full height, Quick Access across the rest. Steam keeps one side menu open at a time and slides the other out, so the main menu's view is kept visible, parked beside Quick Access's, and a style on its page holds it in place. Steam's views carry no names: the main menu's is the one Steam focuses while the main menu is open, so after Steam starts the panel opens it once, parked before it is drawn. Taps on either half go to that menu; in a game, the running game's card at the top of the main menu returns to it. The Steam button still shows the main menu on the top screen in Steam's own layout, and closing it returns both menus to the bottom. Checked on the AYN Thor in Big Picture and in Bomb Rush Cyberfunk, with the game keeping focus.
- Only Quick Access's own view is parked: the one Steam focuses while Quick Access is open. Store and other web pages live in another view, which keeps the bounds Steam gives it, and Steam's frosted glass over the Store page is left off while the menu is parked rather than over it.
- Leaving the panel closes the menu and turns the patches off; the Steam button and the normal Quick Access button then work as before. Opening Steam's main menu replaces the Quick Access menu for as long as it is open, as on a Deck.
Checked with Decky Loader 3.3.1 enabled: its tab renders and takes touch, and its store opens full screen on top with the controller, then returns to the Decky tab below. Decky hooks the menu after Steam starts, so the panel reopens it once when that happens.
@@ -201,6 +203,10 @@ Limits: it relies on Steam's minified UI stores and method names, so a client up
| --- | --- |
| ![Quick Access in the centred layout](evidence/bottom-screen-qam-center-2026-11-27.png) | ![Quick Access in the right-aligned layout](evidence/bottom-screen-qam-right-2026-11-27.png) |
| Layout: Split | Split, in a game |
| --- | --- |
| ![Steam's main menu and Quick Access side by side on the bottom screen](evidence/bottom-screen-qam-split-2026-11-30.png) | ![The split layout during a game, with the game's card at the top of the main menu](evidence/bottom-screen-qam-split-ingame-2026-11-30.png) |
The top screen during that game, with the menu open on the bottom: ![Top screen during the game, with nothing drawn over it](evidence/bottom-screen-qam-top-ingame-2026-11-27.png)
## Related fixes
Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 KiB

-569
View File
@@ -1,569 +0,0 @@
# Android's child-process limit without developer options
Research log for removing DroidDeck's requirement to turn off "Restrict child processes" (or run
`settings put global settings_enable_monitor_phantom_procs false` over wireless ADB). The goal:
Android must not kill a Steam session for having too many Linux processes, and the user must not
need developer options.
Status: **working on the AYN Thor (Android 13).** With Android's limit on and no developer option,
a Steam session with a game running keeps 12 processes in the app's counted cgroups (63 without
this work), and Android killed nothing in minutes of forced scans. DroidDeck's Setup reports the
limit as handled and no longer blocks Steam. Both counting gaps below are in identical code on
Android 12 through 16; a stock Android 14+ phone is still to be tested. The experiments are in
`tools/phantomlab` (see the end).
## How Android counts and kills
Source: `frameworks/base/services/core/java/com/android/server/am/PhantomProcessList.java`
(android12-release to android16-release and main; the parts below are unchanged across them).
1. **What is counted.** For every app process AMS knows (`mPidsSelfLocked`),
`lookForPhantomProcessesLocked(app)` reads
`/sys/fs/cgroup/uid_<app.info.uid>/pid_<pid>/cgroup.procs` (`/acct/...` on cgroup v1). Every
pid listed there other than the app process itself is a "phantom process". `cgroup.procs`
lists thread-group ids, so threads never count.
2. **What is skipped.**
- `if (app.appZygote || app.isKilled() || app.isKilledByAm()) return;`. `appZygote` is true
for uids in `FIRST_APP_ZYGOTE_ISOLATED_UID..LAST_APP_ZYGOTE_ISOLATED_UID` (90000–98999),
i.e. every process forked from an app zygote (`ProcessRecord` constructor).
- A pid that is itself an app process (`mPidsSelfLocked.get(pid) != null`).
- A pid whose `/proc/<pid>/cmdline` cannot be opened, whose uid cannot be read, or for which
`pidfd_open` fails. These only happen once the process is gone (an empty cmdline reads as
`""`, not `null`, so it is still counted).
3. **When.** Only after AMS refreshes CPU stats (`AppProfiler.updateCpuStatsNow` →
`updateProcessCpuStatesLocked`), at most every 5 s (`MONITOR_CPU_MIN_TIME`), and only when
something asks for it: activity and process lifecycle events, mostly. Also from
`setProcessGroupForPhantomProcessOfApp` when an app changes scheduling group. A new phantom
schedules `trimPhantomProcessesIfNecessary`.
4. **The kill.** When the device-wide total exceeds `max_phantom_processes` (32), phantoms are
sorted by their app's oom adj (most important first), then youngest first, and the surplus is
killed from the end of that list (`SIGKILL` and `killProcessGroup`): the least important app's
oldest processes go first. As the foreground app, other apps' phantoms go first, so the
practical budget is our own 32, and of ours the **oldest** die first: the session's PipeWire,
D-Bus and Steam itself, not the game that pushed the count over.
5. **The second killer.** `ActivityManagerService.updatePhantomProcessCpuTimeLPr`: when the app is
at `PROCESS_STATE_HOME` or below (backgrounded, no foreground service) and a phantom used
"excessive" CPU, `killPhantomProcessGroupLocked` kills every phantom of that app **and the app**.
`settings_enable_monitor_phantom_procs=false` (the developer option) switches off both on Android
12L and later; Android 12 does not have the setting, and there only the `device_config` limit below
applies. Raising
`max_phantom_processes` through `device_config` (shell only) avoids only the first: the
excessive-CPU check still runs while monitoring is on.
Today an idle Steam session is about 30 processes and a session with a game about 45 (#566, #575).
## Gap 1: an isolated process's children are never counted
Two independent reasons, either of which is enough:
- **Wrong cgroup path.** The path is built from `app.info.uid`, the *package's* uid (10148 here),
but an isolated process runs as its own uid (99000+ for `android:isolatedProcess`, 90000+ from an
app zygote) and its cgroup is `uid_<isolated uid>/pid_<pid>`. The lookup finds nothing
(`FileNotFoundException`, logged only with `DEBUG_PROCESSES`) and the process is skipped.
- **App zygote skip.** Processes forked from an app zygote (`android:useAppZygote="true"`) are
skipped outright by the `app.appZygote` check, by design ("doesn't have its own acct entry").
This one survives even if Google fixes the path.
Measured with `max_phantom_processes=4` and monitoring on, children killed by Android:
| Where the children were forked | Children | Thor (Android 13) | Emulator (Android 15) |
|---|---|---|---|
| Main app process (control) | 10 | 6 ("Trimming phantom processes") | 6 |
| plain `isolatedProcess` service (uid 99000+) | 10 | 0 | 0 |
| `isolatedProcess` + `useAppZygote` service (uid 90000) | 40 | 0 | 0 |
`cgroup.procs` of `/sys/fs/cgroup/uid_90000/pid_<service>` held all 41 pids the whole time; the
phantom list (`dumpsys activity processes`, "All Active App Child Processes") only ever showed the
main process's children. With the limit at 4, the Thor also trimmed another app's `logcat` child,
as expected for the device-wide count.
## Gap 2: a process that execs in place is an app process, not a phantom
An `android:process` service process can `execve()` a Linux program in place. If it first clears
`FD_CLOEXEC` on its binder fd, the binder node stays alive, so AMS never sees the process die. The
pid stays in `mPidsSelfLocked` and is never counted. Its own children are counted as usual.
Same results on the Thor and the emulator:
| Worker `:wN` | Result |
|---|---|
| exec `/system/bin/sleep`, binder fd closed by exec (control) | "has died" at once; AMS restarts the service |
| exec `/system/bin/sleep`, binder fd kept | stays `fg`/`(service)` while bound; survives a density change, `am send-trim-memory`, Home/back cycles |
| exec `sh` forking 6 `sleep`s, binder fd kept | `sh` not counted; its 6 children counted (2 trimmed at limit 4) |
| guest exits (killed) | AMS logs "has died" and removes the cgroup, as for any app process |
Calls AMS makes into the process after the exec fail cleanly: the kernel logs
`binder_alloc_buf, no vma` and AMS gets `DeadObjectException` ("Failed for dead process.
ClientTransactionItem=ConfigurationChangeItem", "Remote exception" for trim). Nothing kills the
process for it. It is frozen like any cached process when the app goes to the background without a
foreground service.
## What else was tried
| Idea | Result |
|---|---|
| Move a process to another cgroup (`cgroup.procs` of root, of `uid_N`) | `EACCES`: dirs are `system:system 0775` and SELinux denies `cgroup_v2` writes to apps |
| Make a sub-cgroup under our `pid_N` (children of a sub-cgroup are not in its `cgroup.procs`) | `EACCES` |
| `clone3(CLONE_INTO_CGROUP)` | apps cannot open `/sys/fs/cgroup` (SELinux `read` denied) |
| `unshare(CLONE_NEWUSER)` / `CLONE_NEWCGROUP` | `EINVAL` (no user namespaces in GKI) / `EPERM` |
| Empty `/proc/<pid>/cmdline` | read as `""`, still counted; changing it needs `PR_SET_MM` (`CAP_SYS_RESOURCE`) |
| Run "processes" as threads (`CLONE_THREAD`) | only with a shared address space; Steam, Chromium and Wine rely on real processes |
| More `android:process` services hosting the tree | each process's children are still phantoms; only the process itself is free (Gap 2) |
| Rely on kill order | we are the foreground app, so our own newest processes die first |
## What an isolated process can do
Measured from both isolated variants (domain `isolated_app`) against the normal app
(`untrusted_app`), with fds created by the app and passed over binder:
| | app | isolated |
|---|---|---|
| `fork` | ✅ | ✅ (children uncounted) |
| `execve` of an executable in the APK's lib dir (as `libddexec.so`) | ✅ | ✅ |
| `execve` of `/system/bin/*` | ✅ | ✅ |
| create `AF_INET` socket | ✅ | ❌ `EACCES` |
| `connect`/`send`/`recv` on a TCP or UDP socket the app created | ✅ | ✅ (policy: "network sockets received over IPC") |
| read/write a passed unix stream socket / pipe | ✅ | ✅ |
| `open()` an app data file by path | ✅ | ❌ `ENOENT` (not mounted) |
| read/write/`mmap` a passed app data file | ✅ | ✅ |
| `mmap(PROT_EXEC)` of a passed app data file | ✅ | ❌ `EACCES` |
| receive a passed directory fd | ✅ | ❌ (binder refuses the transaction) |
| `mmap(PROT_EXEC)` of a memfd, anonymous RWX (JIT) | ✅ | ✅ |
| GPU device (`/dev/kgsl-3d0`, `/dev/mali0`) | ✅ | ❌ (`neverallow`, also for passed fds) |
| signal or read `/proc` of the app's processes | ✅ | ❌ (`EPERM`, `EACCES`) |
This table is the emulator (stock, enforcing policy). **The Thor's ROM runs `isolated_app`
permissive** (every isolated denial logs `permissive=1`; `untrusted_app` is enforcing): there an
isolated process could also create inet sockets and open `/dev/kgsl-3d0`. That is an AYN quirk and
must not be relied on; design for the enforcing column.
Isolated processes can talk to each other through abstract unix sockets. Everything else in the
app's world (files, sockets to the app's servers, the GPU) has to be brokered through fds.
## Routes
### A. An isolated tier for everything that does not touch the GPU
Run a session's GPU-free processes inside one app-zygote isolated service; their whole fork tree is
invisible. Needed:
- **Loader:** `libddexec.so` already starts programs without the kernel loading them; it would take
its ELF from an inherited fd and copy segments into anonymous or memfd memory, since isolated
processes cannot map app files executable. A broker can hand out one sealed memfd per library so
pages stay shared.
- **File broker:** the native hook already funnels path calls through `rewrite_path`; in the
isolated tier those calls become requests to a broker in the app, which opens the file and returns
the fd. Directories cannot be passed, so `opendir`/`getdents` are served from listings.
Raw syscalls (Wine's preloader, FEX internals) need a seccomp `SIGSYS` trap, which the hook
already uses for Android's own filter.
- **Sockets:** `socket(AF_INET*)` → broker-created socket; then the process connects itself.
Unix sockets between isolated processes become abstract sockets; connections to servers in the
app (compositor, PipeWire, VkBridge) are connected by the broker.
- **No signals across the boundary:** a process and everything it signals or ptraces must be on the
same side. Wine's processes all depend on `wineserver` signalling them, so Wine stays with the game.
- **GPU:** only through a remoting layer such as VkBridge (already used on Mali), never directly.
Candidates for the tier: the Steam client and its web helper's renderer/utility processes (with
the web helper's GPU work remoted or in software), the session scripts, D-Bus services, PipeWire
helpers, Python daemons. A cross-tier launch (Steam starting the game's `reaper`) runs through the
broker, with a small stand-in process left in the tier for Steam to wait on. Stand-ins are free
there.
### B. Exec-in-place workers for long-lived processes
Declare a pool of `android:process` services (`:g0`…`:g95`). Each long-lived program runs as the
main process of one worker (Gap 2): full app privileges, direct GPU, normal signals and `/proc`
(same uid and SELinux domain), and the app hears its exit through binder death. Costs and limits:
- A worker is a zygote fork (~100 ms); a pre-started pool removes the wait.
- Only the worker's main process is free; its children count. So each long-lived program must be
started in its own worker, not forked by its parent.
- Programs the app or the session script start and do not wait on (Xwayland, D-Bus, PipeWire,
helpers, `wineserver -p`) can move with a `droiddeck-spawn` client and no other change.
- A program another guest forks and waits on (Wine's processes, Steam's children) needs the hook to
hand the exec to a worker and translate the pid for the parent: `wait4`, `kill`, `/proc/<pid>`,
`SIGCHLD`. All app processes share zygote's session (sid 0, pgid of zygote), so `setpgid` and
process-group signals across workers are possible.
- Relies on AMS never pinging a process; today it only sends oneway calls that fail harmlessly.
### Measured on the Thor: a real session
An idle Steam session (Big Picture at the library, Decky on, 0.7.11 / main `b08d8e8e1`) holds
**48 counted processes** in the app's cgroup, well past 32 before any game starts:
9 bash, 6 python3, 5 dbus-daemon (with the portals and at-spi under the session bus), 4 Decky
PluginLoader, 4 steamwebhelper, 2 Xwayland, gamescope and its reaper, PipeWire and WirePlumber,
Steam, the clipboard bridge, and the app's own logcat, PulseAudio and audio relay.
Prototype of B on this branch (`runtime/GuestWorkers.kt`, `droiddeck-spawn`, `dd_spawn` in the
session script; `DD_SPAWN_DAEMONS=0` turns it off): 24 `:gN` worker services, a spawn socket in the
app, and the session script starting the clipboard bridge, the system bus, login1 and the session
bus through it. Result:
- Each of the four runs as its own app process (`/sys/fs/cgroup/uid_<app>/pid_<worker>` with one
process). login1's sleep handshake, NetworkManager (state 70, full connectivity) and the Steam
library all work.
- Counted processes: **45** instead of 48. The session bus took its 9 activated children with it, so
they are still counted, under its worker.
So starting top-level daemons in workers is not enough. What is left is the processes other
programs start. Of the 47 counted processes in that session, **40 are exec'd programs** and only 7
are forks without an exec (the session script's `( … ) &` subshells). A handoff inside the native
hook, at `execve()` in a forked child, could move all 40, leaving about 7 counted at idle. That needs
the pid translation described in B (the parent keeps the forked pid; `wait4`, `kill`, `SIGCHLD` and
`/proc/<pid>` go to the worker's process).
### Handoff in the native hook (prototype, on this branch)
`tools/nativeguest/hook/handoff.c`. At `execve()` in a forked child, a program named in
`DD_HANDOFF` is sent to the app's spawn socket instead of exec'd: the request carries argv, the
environment, the working directory and every inheritable fd with its number, and a worker execs
the program with those fds in place. The child records "my pid is now worker pid P" in a memfd
table its parent created, and exits. In the parent, `wait4`/`waitpid`/`wait`/`wait3`/`waitid` and
`kill` treat the forked pid as P until P exits. P's hook writes its exit status into the table; for
a program that ends without `exit()` (a signal) the app writes a report tagged with the child it is
for (from `ApplicationExitInfo`), which the parent's hook takes once P is gone, and sends the parent
`SIGCHLD`. Only the hook moves an entry to "exited", by compare-and-swap. A launch takes three
answers: the hook's "go" once it has P's pid, the worker's answer to the app's commit, and the
app's "ok" once the worker runs the program; without any of them the program runs locally instead,
never twice. The child's side is
vfork-safe (Python's subprocess execs under `vfork`). Details that mattered:
- **Scripts:** the list also matches the `#!` interpreter (`python3` for `droiddeck-agent`).
- **Exec chains:** a forked child that first execs a wrapper (`env`, `taskset`, a shell script,
Wine re-executing itself through `wine-preloader`) keeps its parent's table fd across the exec,
so the wrapper's own exec can still be handed off.
- **Not handed off:** Steam and the web helper's browser process (gamescope finds a window's app by
walking its process's parents) and its utility processes (the client refuses its transport —
"no transport is available" — from processes that are not its children). The web helper's
renderers hand off fine.
- **Game windows outside the reaper:** gamescope finds a window's app by walking its process up to
Steam's `reaper`, which a handed-off Wine process is not under. Proton sets `STEAM_GAME` itself
from `SteamGameId`, but a store game's is a 64-bit id and is not set: Splinter Cell (Ubisoft)
ran without ever taking focus. The agent now tags such a window from its process's `SteamAppId`
also on the arm64 client.
- One-shot programs cost a worker start (~100 ms) each, so the list names long-lived programs only
(`xprop+-spy`: `name+prefix` matches only when an argument starts with prefix).
- **Near the limit, a shell's children too.** Once 20 of the app's processes are counted (the hook
counts them in `/proc`: this uid's processes in an app process's cgroup other than that process),
a child of `bash`, `sh`, `dash`, `zsh`, `ksh`, `fish`, `make` or `xargs` is handed off even when
it is not listed. Those parents wait with `wait()`, which the hook answers; Qt's `QProcess` and
other parents that watch a child by pidfd or `/proc` would see the forked child end at once, so
their children stay. A job in the foreground of its controlling terminal (`TIOCGPGRP` on
`/dev/tty`, whatever its standard fds are: `cmd | less`, `less < file`) stays too: a handed-off
program has no controlling terminal, so `/dev/tty`, ^C and job control would miss it. A job a
shell with job control runs (any process group other than the shell's, `cmd &` in an interactive
terminal, each member of its pipeline) stays as well: the shell waits for its stops and continues,
which happen to a handed-off program's worker and never reach that wait. A job started with `&`
from a shell without job control (a script, `bash -c`) runs in the shell's group reading
`/dev/null`, and goes. Steam's client and launch chain (`steam`, its
web helper, `droiddeck-steam-x64`, `reaper`, `steam-launch-wrapper`, `pw-audio-namespace`,
gamescope, anything under `Steam/`) never go this way. In the desktop
session (KDE Plasma, 17–19 counted at rest), a Konsole running 40 `sleep 600 &` jobs peaked at
61 counted and lost 27 processes to Android's limit (Konsole, D-Bus, the portal) before this, and
at 20 with no kills after. Still counted, and not handed off: a terminal's foreground jobs (a
`make -j` and its compilers), the D-Bus daemon's activation helpers (forks that never exec) and
the desktop's own programs started by KDE's launchers.
Default list: the portals, at-spi, `python3`, PipeWire, WirePlumber, Decky's PluginLoader, the log's
`gnudd`, `xprop -spy`, the web helper's renderers, `wine`, `wine-preloader`, `wineserver`.
Measured on the Thor, same session and game as above:
| | counted children, idle | counted, Bully (Proton) running |
|---|---|---|
| main, no handoff | 48 | 63 |
| handoff | **26** | **29** |
With the handoff on, Bully reached its menu at 30 fps, kept focus, and Steam's library, Decky, the
portals, NetworkManager/login1 and the agent all worked.
Then Android's own limit was switched back on (`settings_enable_monitor_phantom_procs=true`,
default limit 32) with the game running, and a scan was forced every 20 s for 3 minutes
(`dumpsys meminfo` refreshes the CPU stats the scan runs on; process starts and activity changes do
too, irregularly):
| | Android listed | killed | session |
|---|---|---|---|
| no handoff (`DD_SPAWN_DAEMONS=0`, same build) | 63 | **33**, oldest first: the session's bash, Python daemons, D-Bus, Xwayland, Steam, PipeWire, gamescope's reaper | FAILED |
| handoff | 27–29 (device-wide) | **0** in 9 scans | game running throughout |
### Taken further: the session itself in workers
A second round moved most of what was still counted:
- **The app's own processes:** `HostProcess.startUncounted` runs a host command in a worker with the
same contract as `HostProcess.start` (output lines, exit code, working directory). The session
root, the app log's logcat, PulseAudio and the DirectAudio relay use it. A worker cannot `chdir`
before its exec, so Android's `sh` does it from an environment of its own and exports the
program's (`env -i` cannot be used: the APK's library path contains `==`).
- **PulseAudio** closes every inherited fd at start, the worker's binder fd included, and Android
then killed the worker as dead (the SIGKILL came from system_server's `ActivityManager` thread,
seen with the `signal_generate` ftrace event, which shell can enable on the Thor). The daemon
spares the fd named in `PULSE_PASSED_FD`; the worker replaces `@DDH_WORKER_BINDER_FD@` in a
program's arguments and environment with its `/dev/binder` fd number, so PulseAudio is given it.
Started as a normal child the token reads as fd 0, which the daemon ignores.
- **The script's long-lived subshells:** `dd_job FUNCTION` runs a function in a new `bash` that first
loads the shell's variables, functions and options from a state file, so it is an exec'd program
the hook can hand off (`bash+dd-job`). `$!`, `kill` and `wait` keep working. The zRAM scanner,
the property watcher, Decky's supervisor and the request/timer loop use it.
- **The log pipeline** is `droiddeck-log-writer`, a script of its own instead of a `{ gnudd; cat; }`
subshell.
- **gamescope, its reaper and the inner `droiddeck-session steam`** are handed off. Steam, its web
helper's browser process and its utility processes still are not (see above).
Things this needed, found the hard way:
- **The binder fd is the worker's life.** It sits above every fd number the program gets; programs
that close all inherited fds (gamescope) are kept from closing it (the hook's kept fds, also
against `CLOSE_RANGE_CLOEXEC`); children never send it along with a handoff; and the hook closes
copies in every other process (`DDH_WORKER_PID`), so a worker's exit is seen when its program
exits. A worker that lost its binder fd was killed by Android within milliseconds.
- **A session of its own (`setsid`) for every worker.** All app processes are in zygote's process
group, so a program signalling its group reached the app itself (the hook also refuses
`kill(0)`/`kill(-pgid)` into zygote's group, and `kill(-1)`). `reap_orphans` in the session
script stands down when its parent is zygote.
- **Nested handoffs** (a program in a worker handing off its own child): inherited `DDH_*`
variables are dropped from each request.
- **Requests carry up to 240 fds,** in chunks of 60 (`LocalSocket` reads at most 64 per read), after
the request itself; the spawn server catches everything per connection (an uncaught exception there
took the whole app down once).
- **The table is made at a process's first fork,** not only when `DD_SPAWN` is in its environment at
start: a shell that exports it has no sign of it in its own environment.
- **Exit status:** the program's hook records it with `on_exit` or in `_exit()` into the parent's
table; the app's `ApplicationExitInfo` is only the fallback (signals). A program inherits its
forked parent's ignored signals, open-files limit and umask (`DDH_SIGIGN`, `DDH_NOFILE`,
`DDH_UMASK`).
Measured on the Thor, Bully under Proton, Android's limit on (default 32), a scan forced every 20 s:
| | counted, idle | counted, in game | killed in 3 min |
|---|---|---|---|
| main (no handoff) | 48 | 63 | 33, session failed |
| first round | 26 | 29 | 0 |
| second round | 9 | 14 | 0 |
| **third round** | **7–9** | **12** | **0** in 2 min, game kept focus |
Still counted at idle: `run_gamescope`'s subshell, Steam, its web helper's browser and
two or three utility processes, the session bus's activation babysitter and Decky's
multiprocessing child (forks without an exec). In game, also Steam's launch chain (`sh`,
`pw-audio-namespace`, `reaper`) and the `wineserver` daemon (a fork of its first process, which
lingers in its worker; see below).
### Third round
- **PulseAudio in a worker** (above).
- **`posix_spawn()`:** Python 3.13+ (`subprocess`, even with `close_fds`) and GLib's `g_spawn` start
programs with `posix_spawn()`, whose child makes the exec system call itself, past the hook. A
listed program is now spawned with `fork()` and the hook's `execve()`; the hook replays glibc's
file actions and attributes in the child, and a close-on-exec pipe returns an exec error as
`posix_spawn()`'s result. Proton's Wine and at-spi's bus came out of the count this way.
- **The table fd survives a child that closes every inherited fd** (Python's `subprocess` before
exec): it sits at fd 800 or above and is one of the hook's kept fds. Reopening it from
`/proc/<owner>/fd` does not work on Android (EACCES). A nonce in the table's header tells it from
a file a program put at that number (inode numbers are rewritten by the hardlink emulation).
- **The exit status comes from the program itself.** The worker first runs a `bash` that `cd`s and
execs the program; that `bash` closed the `DDH_TABLE` fd as someone else's table, so the
program after it could never report, and statuses came from `ApplicationExitInfo`, late or
unknown. The `DDH_TABLE` fd is now kept through that exec, and `_exit()` reports as `exit()` does.
- **Daemons:** Android kills every process in a worker's cgroup when the worker's own process ends
(`libprocessgroup: Successfully killed process cgroup`). `wineserver` forks the server and leaves
with `_exit(0)`, so the server died with it and Wine stopped with "the wine server failed to run".
A handed-off program's process now reports its status and then stays, with no fds but the
binder's and all signals blocked, until no other process is left in its cgroup (found through
`/proc/<pid>/cgroup`, as `cgroup.procs` is not readable). It does so only when it is
single-threaded at exit, and never for the processes the app starts itself (the session root),
whose exit the app waits for.
- **`reap_orphans`** in the session script killed every process whose parent was zygote (all the
app's workers, the session root among them) when the inner `droiddeck-session` ended in a
worker: the guest cannot see zygote in `/proc`. It now stands down when `DDH_WORKER_PID` is
its own pid.
- **`DD_HANDOFF_DEBUG=/path`** appends the hook's trace to a file. On stderr it broke Steam's
login, and the trace from a game's processes went to a pipe nobody read.
- **Finding the sender of a SIGKILL:** shell can enable the `signal/signal_generate` ftrace event
on the Thor (`/sys/kernel/tracing`), which names the sending thread; Perfetto recorded nothing
there.
- **Ending a game from Steam** (`SteamClient.Apps.TerminateApp`, the overlay's Exit game) left Wine
running since the first round: Steam sends SIGINT to the launch's `reaper` and its parent, and the
reaper ends what is under it, which handed-off programs are not. Each handed-off program now
lists itself as `P<pid>` with the process that forked its child and, for when that process is
gone (Wine starts a process through a fork that exits at once), the worker's program it descended
from. A signal to `reaper SteamLaunch` from a hooked process also goes, as SIGTERM for SIGINT
(Wine takes SIGINT for a console's Ctrl+C), to the groups of every listed program under that
reaper, all found before any is signalled.
- **Process groups:** a handed-off program runs in a session of its own, outside the group its
forked parent's child was in. It lists itself as `GROUP.PID.START` for that group (`DDH_PGID`,
also for the processes it forks), and the hook's `kill(-GROUP)`, `kill(0)` and `killpg()` also
signal the groups those programs lead.
- **Tried and dropped:** handing off Steam's launch chain (`sh`, `steam-launch-wrapper`, `reaper`):
the client tracks the process it forked, which then exits at once, and called the game closed.
Showing a handed-off program's forking process as its parent in `/proc/<pid>/stat` and `status`
left Steam's UI at "Loading library data": the client checks the parents of the processes on its
IPC connections with `lsof -F R`. Only the program's own `getppid()` answers with that process
(while it lives, then 1): the GOG launch leases the game folder for as long as the launcher, its
parent, runs, and took zygote, which the guest cannot see, for a launcher already gone. And
`posix_spawn()` emulation must make only
system calls in its child (no hook wrapper takes a lock there): one Steam fork hung on a lock
another thread held.
Quitting the game (also from Steam), stopping the session (no worker is left) and starting
again all work. Started from the front end with the limit on, Setup shows "Child-process limit
handled by DroidDeck" and Steam starts.
### The bionic runtime
DroidDeck-Bionic runs Wine on Android's libc, outside the glibc root, so the native hook never sees
its processes: with the handoff on, a bionic game's Wine programs (the game, `services.exe`,
`winedevice.exe`, `plugplay.exe`, `svchost.exe`, `lsass.exe`, `explorer.exe`, `rpcss.exe`) all stayed
under the worker that runs the tool's `launch.sh` and were counted. The same handoff is built into
the runtime's exec shim (`tools/bionic-runtime/handoff.c`, part of `libexecshim.so`, which every Wine
process preloads): it includes `hook/handoff.c` and `hook/kept.c` (the descriptors `close()` and
`close_range()` leave open, moved out of `privileged.c` for this) and adds what the native hook's
other parts do around them (`fork()`, `close()`, `close_range()`, `dup2()`, `dup3()`, and `exit()` for
the `on_exit()` bionic lacks). What differs on bionic:
- **bionic's `execv()`, `execvp()` and `execl*()`** make the execve system call inside libc, past an
interposed `execve()`. Wine starts its preloader with `execv()`, so the shim defines them on top
of its `execve()`.
- **A start through the system linker** (`/system/bin/linker64 PROGRAM ARGS`, which the shim makes
of a dynamic program in app data, and which Wine sometimes makes itself) is listed by PROGRAM
(`ddh_try_as()` matches one program and sends another).
- **The app starts a handed-off program from the glibc root's `bash`** (GuestWorkers), which cannot
load the runtime's `LD_PRELOAD` and `LD_LIBRARY_PATH` (bionic libraries: "libdl.so: cannot open
shared object file"). The request carries those two as arguments of `/system/bin/env` instead,
which `bash` execs and which puts them back for the program; the worker's main process is the
program all the same.
- `launch.sh` keeps `DD_SPAWN`, `DD_SPAWN_SESSION`, `DD_HANDOFF*`, `DDH_*` and `DDNATV_ROOT` (it drops
the glibc guest's environment otherwise). The "can't open /proc/N/environ: Permission denied"
lines its prefix checks printed came from idle workers (zygote forks, not dumpable), not from
handed-off programs, which are readable; the redirect is now quiet.
Measured on an AYANEO Pocket FIT (Snapdragon G3 Gen 3, Adreno 750, Android 14), DroidDeck-Bionic 14.1-r67 with this shim and
launcher, handoff on, max counted in the app's cgroups:
| | Brawlhalla | DiRT Showdown | whole run | other apps' processes trimmed (limit on) |
|---|---|---|---|---|
| bionic, before | 25 | 24–27 | 28 | yes (Discord, a logcat, BatteryLog's `su`) |
| bionic, with the shim | 17 | 16 | 19–20 | none |
| DroidDeck-Proton 11-14.2 | 12–13 | 12–15 | 15–17 | none |
DiRT's benchmark held 75 fps average either way; quit through Steam, stop and restart worked with
Android's limit on, with no DroidDeck process killed. Still counted on bionic: what `launch.sh`
itself starts (the game's first Wine process, `gstag`, the wait loop's `sleep`), since Android's
`sh` has no hook, and `wineserver`'s daemon fork.
### Cost
Measured on the Thor, Bully under Proton, the handoff on (`childProcessHandoff`) against off, two
sessions each:
| | off | on, first | on, now |
|---|---|---|---|
| one program started, `fork`+`exec` of `/usr/bin/true` | 37–39 ms | 197 ms | 80 ms |
| `start steam` to READY | 14.0–14.2 s | 20.0–20.2 s | 18.2–18.5 s |
| `launch` to the game's focus | 10.1 s | 14.7–14.8 s | 11.6–11.7 s |
| in game: frames, CPU of the app's uid, `system_server` | 29.9 fps, 1.02–1.05 s/s, 21 ms/s | 29.8 fps, 1.11 s/s, 21–27 ms/s | 29.8–29.9 fps, 1.10–1.11 s/s, 22 ms/s |
| memory of the app's processes (RSS) | 3.57–3.62 GB | 3.42–3.50 GB | 3.49–3.66 GB |
Running costs nothing measurable; starting things does. A handed-off program costs a worker: a
zygote fork, its runtime (40–50 ms of CPU) and the bind, and the worker waited 100 ms before its
exec so as not to cut off its reply. Now the app closes a pipe once it has the reply and the worker
execs then, and two workers are kept bound ahead of need while a session runs (12 MB of PSS each);
four did no better. Starting a session takes about 10 more CPU-seconds (51 s against 41 s for the
app's uid), and the last 4 s come from the session script's own steps running beside the
handed-off daemons. With only the hook's handoffs off (`DD_SPAWN_DAEMONS=0`), READY came at
14.1 s: the app's own workers (the session root, PulseAudio, logcat) cost nothing there.
**In the app:** `PhantomProcessStatus.UNCOUNTED` is reported when the limit is on but the session
runs in workers (`GuestWorkers.enabled`: the native userland, Android 11+, and the
`childProcessHandoff` session preference, on by default). It does not block Steam. Turning the
preference off (`droiddeckctl prefs set session childProcessHandoff false --type bool`, with
Setup > Developer > Debugging tools on; see `docs/agent-control.md`) brings back
the old behavior and the old requirement.
### C. Plan
1. ~~Verify both gaps on the Thor~~ done; still to do on a stock Android 14+ phone (enforcing
SELinux, unlike the Thor) and on a Mali device.
2. ~~B for the processes DroidDeck and the session script start themselves~~ done.
3. ~~B inside the hook, with pid translation~~ done.
4. ~~The session root, its jobs, the log pipeline, the gamescope chain~~ done: 9 idle, 14 in game.
Third round (PulseAudio, `posix_spawn`, daemons): 7–9 idle, 12 in game.
5. ~~Setup no longer requires the developer option while the session runs in workers~~ done.
6. Open:
- ~~PulseAudio in a worker~~ done;
- ~~`posix_spawn()` and daemons in workers~~ done;
- `/proc/<pid>/stat` showing the virtual parent, so that Steam and its web helper can be handed
off too;
- ~~pre-started workers, so that a handoff costs no zygote fork~~ done: two are kept bound;
- ~~more games and configurations~~ done on the Thor with the stock limit on, no kills in any:
Bully on GE-Proton, Proton Experimental ARM64 and DroidDeck-Proton 11 (11–14 counted), Bomb
Rush Cyberfunk (14), MGSV Ground Zeroes (13), Sekiro (13), zero-copy off (11), the x86-64
Steam client under FEX (14, against 55 without the handoff), Splinter Cell through Ubisoft
Connect (14, against 65), Star Wars: Galaxy of Heroes (EA, 14), 9 Years of Shadows (GOG, 14),
run mode with 40 background jobs (1), the desktop at rest (17–20) and
with a terminal's 40 background jobs (20). PRoot sessions keep the old behavior and still need
the developer option: with the limit on, Android killed 30 of their processes and the session
failed;
- Wine-heavy launchers and anti-cheat;
- a settings switch for `childProcessHandoff`.
7. A (the isolated tier) only if B stops working on a future Android; it needs a file and socket
broker and keeps the GPU outside.
## Robustness
- Gap 1's path mismatch is a bug that could be fixed; the app-zygote skip is deliberate. Use app
zygote isolated services so either one is enough.
- Gap 2 depends on AMS not probing liveness. A future check (a ping, or watching a pidfd for the
binder) would end it; the session would then fall back to counted processes, which is today's
behavior.
- OEM ROMs with their own process managers (MIUI/HyperOS, ColorOS) are outside this.
- A listed program's stops and continues (`kill -STOP`, `SIGCONT`) reach its worker, not a wait in
its parent: `waitpid(…, WUNTRACED)` and `WCONTINUED` report none for it. Listed programs are the
session's own (Steam, Wine, game helpers), whose parents start them without job control; one a
shell runs as a job-control job (`wine game.exe &` in an interactive terminal) stays counted, as
any such job does, so its shell gets its stops. Reading
the worker's state from `/proc` instead was tried and dropped: a stop and a continue can both
fall between two reads.
## phantomlab
`tools/phantomlab` is a standalone test app (package `com.droiddeck.phantomlab`, no Gradle). It
forks sleepers from the main process, a plain isolated service, an app-zygote isolated service and
eight `:wN` workers, execs in place, and probes what a process may do.
The limit of 4 below is device-wide: a trim while it is set can kill other apps' child processes,
which restoring the setting does not bring back. Use a test device or an emulator with nothing else
running, and note the current values first, to put them back afterwards:
```
adb shell settings get global settings_enable_monitor_phantom_procs
adb shell device_config get activity_manager max_phantom_processes
adb shell device_config get_sync_disabled_for_tests
```
Android 12 and some Android 13 builds have no `get_sync_disabled_for_tests`; there `adb shell
device_config is_sync_disabled_for_tests` answers only true or false, so it cannot tell `persistent`
from `until_reboot`. Note `none` when it says false. When it says true, sync is already off: skip
the `set_sync_disabled_for_tests persistent` step below, which keeps whichever mode it was, and
leave the mode alone when you restore the rest.
```
tools/phantomlab/build.sh # build/phantomlab.apk, debug-signed
adb install -r tools/phantomlab/build/phantomlab.apk
adb shell device_config set_sync_disabled_for_tests persistent
adb shell device_config put activity_manager max_phantom_processes 4
adb shell settings put global settings_enable_monitor_phantom_procs true
adb shell am start -n com.droiddeck.phantomlab/.Main --es cmd spawn --es target iso:a --ei n 40
adb shell "am start -n com.droiddeck.phantomlab/.Main --es cmd exec --es target w0 --ei keep 1 --es argv '/system/bin/sleep|100000'"
adb shell am start -n com.droiddeck.phantomlab/.Main --es cmd probe --es target iso:a --es what self,memfd_exec,exec,fds,escape,libexec --es fds tcp,udp,unix,file:probe.txt
adb logcat -s PLAB ActivityManager | grep -i 'PLAB\|Trimming'
```
Targets: `main`, `proc` (`:proc`), `isoplain`, `iso:<name>` (one app-zygote instance per name),
`w0`…`w7`. Android scans only on CPU-stat refreshes, so switch apps a few times (5 s apart) before
reading the phantom list. Restore the noted values afterwards: `adb shell device_config put
activity_manager max_phantom_processes <value>` (or `adb shell device_config delete activity_manager
max_phantom_processes` if it was null), `adb shell device_config set_sync_disabled_for_tests <mode>`
and `adb shell settings put global settings_enable_monitor_phantom_procs <value>`, and end the lab's
sleepers with `adb shell am force-stop com.droiddeck.phantomlab`.
+1
View File
@@ -32,6 +32,7 @@ Links of the form `droiddeck://settings/<section>` open a Settings section direc
| Run without proot (experimental) | Settings › Performance (`droiddeck://settings/performance`) | proot |
| Draw the cursor inside gamescope | Settings › Performance (`droiddeck://settings/performance`) | mouse, cursor |
| Host name | Settings › Performance (`droiddeck://settings/performance`) | name |
| Desktop runs as a user | Settings › Performance (`droiddeck://settings/performance`) | root, user, sudo, fakeroot |
| Controller | Settings › Controller (`droiddeck://settings/controller`) | gamepad, buttons, mapping, profile, remap |
| Smart glasses | Settings › Smart glasses (`droiddeck://settings/glasses`) | xreal, viture, vr, ar |
| Theme | Settings › Launcher (`droiddeck://settings/launcher`) | color, dark |
+1 -1
View File
@@ -184,7 +184,7 @@ echo "== DroidDeck fake input (app/src/main/cpp/fakeinput_steam.cpp), heap-taggi
"$CXX" -shared -fPIC -O2 -Wall -Wno-attributes -pthread -std=c++17 "$ROOT/app/src/main/cpp/fakeinput_steam.cpp" \
-ldl -static-libstdc++ -o "$PACK/preload/libfakeinput.so"
"$CC" -shared -fPIC -O2 -Wall "$HERE/notag.c" -ldl -o "$PACK/preload/libnotag.so"
"$CC" -shared -fPIC -O2 -Wall "$HERE/execshim.c" "$HERE/handoff.c" -ldl -o "$PACK/preload/libexecshim.so"
"$CC" -shared -fPIC -O2 -Wall "$HERE/execshim.c" -ldl -o "$PACK/preload/libexecshim.so"
"$CC" -shared -fPIC -O2 -Wall -Wextra -fvisibility=hidden "$HERE/steamshm.c" -ldl -o "$PACK/preload/libsteamshm.so"
"$CC" -O2 -Wall "$HERE/gstag.c" -o "$PACK/bin/gstag"
"$STRIP" --strip-unneeded "$PACK/layer/"*.so "$PACK/preload/"*.so "$PACK/bin/gstag"
-5
View File
@@ -25,9 +25,6 @@ typedef struct __posix_spawn_file_actions *posix_spawn_file_actions_t;
#define LINKER "/system/bin/linker64"
// handoff.c: returns unless the exec was handed to one of the app's worker processes
void ddh_bionic_exec(const char *file, char *const args[], char *const envp[], const char *path, char *const argv[]);
enum kind { PASS, VIA_LINKER, VIA_INTERP };
// What starting `path` needs; for scripts, the interpreter and its optional argument.
@@ -208,8 +205,6 @@ int execve(const char *path, char *const argv[], char *const envp[]) {
char storage[6 * PATH_MAX]; // stack only: this may run in posix_spawn's vfork-like child (where it passes)
const char *file = path;
char **args = rewrite(path, argv, &file, storage);
// the app may run it in a worker instead (handoff.c): matched by the program, sent as the start below
ddh_bionic_exec(file, args ? args : argv, envp, path, argv);
int ret = real(file, args ? args : argv, envp);
int saved = errno;
free(args);
-410
View File
@@ -1,410 +0,0 @@
// handoff: part of libexecshim.so, preloaded into the bionic Wine processes. The native hook's exec
// handoff (tools/nativeguest/hook/handoff.c, docs/phantom-processes.md) built for bionic: a program a
// Wine process forks and execs runs as the main process of one of the app's worker processes instead of
// as a child Android counts against its limit. The glibc session's hook cannot reach these processes
// (they run on Android's libc), so without this every Wine process of a bionic game was counted.
//
// What the native hook does around the handoff and this file does too: fork() records the child for
// its parent's table, close(), close_range(), dup2() and dup3() leave the table and the worker's binder
// fds alone (hook/kept.c), and execve() offers the exec to the app before it runs (execshim.c calls
// ddh_bionic_exec() with the start it is about to make: "/system/bin/linker64 PROGRAM ARGS" for a
// program in the app's data, matched against DD_HANDOFF by PROGRAM). wait*(), kill() and _exit() are
// the handoff's own (hook/handoff.c). Nothing here acts without DD_SPAWN and DD_HANDOFF in the
// environment (tools/bionic-runtime/tool/launch.sh keeps them).
#define _GNU_SOURCE
#include <dlfcn.h>
#include <elf.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <pthread.h>
#include <sched.h>
#include <signal.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <sys/wait.h>
// bionic has no thread cancellation: nothing can cancel the table's setup
#ifndef PTHREAD_CANCEL_ENABLE
#define PTHREAD_CANCEL_ENABLE 0
#define PTHREAD_CANCEL_DISABLE 1
static int pthread_setcancelstate(int state, int *old) {
(void)state;
if (old) *old = PTHREAD_CANCEL_ENABLE;
return 0;
}
#endif
#ifndef CLOSE_RANGE_UNSHARE
#define CLOSE_RANGE_UNSHARE (1U << 1)
#endif
#ifndef CLOSE_RANGE_CLOEXEC
#define CLOSE_RANGE_CLOEXEC (1U << 2)
#endif
#ifndef __NR_close_range
#define __NR_close_range 436
#endif
#include <sys/sysmacros.h>
static void pthread_testcancel(void) {}
int close_range(unsigned int first, unsigned int last, int flags);
// bionic has no on_exit(): the handoff reports a program's exit status from it (exit() runs it).
// atexit() handlers get no status, so exit() below notes it first; a return from main() reaches
// exit() inside libc and reports 0.
static void (*g_on_exit_fn)(int, void *);
static void *g_on_exit_arg;
static int g_exit_status;
static void run_on_exit(void) {
if (g_on_exit_fn) g_on_exit_fn(g_exit_status, g_on_exit_arg);
}
static int on_exit(void (*fn)(int, void *), void *arg) {
g_on_exit_fn = fn;
g_on_exit_arg = arg;
return atexit(run_on_exit);
}
// The native hook's names for the plain system call and for a guest path: here there is no guest root.
static long call_orig_syscall(long nr, unsigned long a, unsigned long b, unsigned long c, unsigned long d,
unsigned long e, unsigned long f) {
return syscall(nr, a, b, c, d, e, f);
}
static const char *rewrite_path(const char *path, char *out, size_t size) {
(void)out;
(void)size;
return path;
}
#include "../nativeguest/hook/kept.c"
#include "../nativeguest/hook/handoff.c"
void exit(int status) {
g_exit_status = status;
void (*real)(int) = (void (*)(int))dlsym(RTLD_NEXT, "exit");
if (real) real(status);
syscall(SYS_exit_group, status);
__builtin_unreachable();
}
static int ddh_is_linker(const char *path) {
const char *base = path ? strrchr(path, '/') : NULL;
return base && strcmp(base + 1, "linker64") == 0;
}
static int ddh_regular(const char *path, int mode) {
struct stat st;
return path && stat(path, &st) == 0 && S_ISREG(st.st_mode) && access(path, mode) == 0;
}
// Android refuses execve() of a file in the app's data unless SELinux is permissive (execshim.c makes the
// dynamic ones linker64 starts). An unreadable setting counts as enforcing.
static int ddh_selinux_permissive(void) {
char c = 0;
int fd = (int)syscall(SYS_openat, AT_FDCWD, "/sys/fs/selinux/enforce", O_RDONLY | O_CLOEXEC, 0);
if (fd < 0) return 0;
long n = syscall(SYS_read, fd, &c, 1);
syscall(SYS_close, fd);
return n == 1 && c == '0';
}
// A handed-off start that fails fails in the worker, where the caller cannot see it and try its next
// candidate (Wine tries its preloader, then its loader), so only a start that would succeed here goes.
static int ddh_bionic_startable(const char *file, char *const args[]) {
char real[PATH_MAX];
// env takes an argument with '=' for a variable, and looks a name without '/' up in PATH
if (!file || strchr(file, '=') || !strchr(file, '/')) return 0;
if (!ddh_regular(file, X_OK) || !realpath(file, real)) return 0;
if (ddh_is_linker(real))
return args && args[0] && args[1] && args[1][0] != '-' && ddh_regular(args[1], R_OK) && ddh_startable(args[1]);
if (strncmp(real, "/data/", 6) == 0 && !ddh_selinux_permissive()) return 0;
// env starts FILE with FILE as argv[0]
return args && args[0] && strcmp(args[0], file) == 0 && ddh_startable(file);
}
void ddh_bionic_exec(const char *file, char *const args[], char *const envp[], const char *path, char *const argv[]) {
if (ddh_env(envp, "DD_HANDOFF_DEBUG")) {
char why[200];
struct ddh_table *own = __atomic_load_n(&g_ddh, __ATOMIC_ACQUIRE);
snprintf(why, sizeof(why), "bionic exec (spawn %d list %d table %d owner %d up %d ppid %d) of", ddh_env(envp, "DD_SPAWN") != NULL,
ddh_env(envp, "DD_HANDOFF") != NULL, own != NULL, own ? (int)g_ddh_owner : 0, g_ddh_up != NULL, (int)getppid());
ddh_debug(envp, why, path ? path : "(null)");
}
if (!ddh_env(envp, "DD_SPAWN") || !ddh_env(envp, "DD_HANDOFF")) return;
if (!ddh_bionic_startable(file, args)) {
ddh_debug(envp, "bionic exec stays here (not startable as a handoff):", path ? path : "(null)");
return;
}
// Wine's own starts through the system linker ("/system/bin/linker64 PROGRAM ARGS") are listed by PROGRAM
const char *match = path;
char *const *match_argv = argv;
if (ddh_is_linker(path) && argv && argv[0] && argv[1]) {
match = argv[1];
match_argv = argv + 1;
}
// The app starts a handed-off program from the glibc root's shell (GuestWorkers), which cannot load this
// runtime's LD_PRELOAD and LD_LIBRARY_PATH (bionic libraries). The request carries them as arguments of
// Android's env instead, which the shell execs and which puts them back for the program: the worker's main
// process ends up as the program all the same. Stack only (this may run in a vfork child).
int nargs = 0, nenv = 0;
while (args[nargs]) nargs++;
while (envp && envp[nenv]) nenv++;
// env, up to two loader variables, FILE, args[1..], NULL (nargs >= 1: ddh_bionic_startable)
char *wrapped[nargs + 4];
char *trimmed[nenv + 1];
int w = 0, t = 0;
wrapped[w++] = (char *)"/system/bin/env";
for (int i = 0; i < nenv; i++) {
if (strncmp(envp[i], "LD_PRELOAD=", 11) == 0 || strncmp(envp[i], "LD_LIBRARY_PATH=", 16) == 0) {
if (w < 3) wrapped[w++] = envp[i];
} else {
trimmed[t++] = envp[i];
}
}
trimmed[t] = NULL;
// env runs the program by the path its first argument gives: the start's file, then the rest of its argv
wrapped[w++] = (char *)file;
for (int i = 1; i < nargs; i++) wrapped[w++] = args[i];
wrapped[w] = NULL;
ddh_try_as("/system/bin/env", wrapped, trimmed, match, match_argv);
ddh_debug(envp, "bionic exec stays here:", path ? path : "(null)");
}
// bionic's exec functions call the execve system call stub inside libc, past execshim.c's execve(): Wine
// starts its programs with execv() (its preloader) and execvp(), so these go through execve() here.
extern char **environ;
int execv(const char *path, char *const argv[]) { return execve(path, argv, environ); }
// bionic's execvpe(), through execve() here: an unset PATH is libc's default (Android 14's; an empty one, and an empty
// entry, are the current directory), and a file the kernel cannot start (ENOEXEC) runs under /system/bin/sh.
#define DDH_DEFPATH "/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin"
static int exec_as_script(const char *file, char *const argv[], char *const envp[]) {
int n = 0;
while (argv && argv[n]) n++;
char *script[(n > 0 ? n : 1) + 2];
int s = 0;
script[s++] = (char *)"sh";
script[s++] = (char *)file;
for (int i = 1; i < n; i++) script[s++] = argv[i];
script[s] = NULL;
return execve("/system/bin/sh", script, envp);
}
int execvpe(const char *file, char *const argv[], char *const envp[]) {
if (!file || !*file) {
errno = ENOENT;
return -1;
}
if (strchr(file, '/')) {
execve(file, argv, envp);
return errno == ENOEXEC ? exec_as_script(file, argv, envp) : -1;
}
const char *dirs = getenv("PATH");
if (!dirs) dirs = DDH_DEFPATH;
int saw_eacces = 0;
size_t flen = strlen(file);
for (const char *p = dirs;;) {
const char *end = strchr(p, ':');
size_t len = end ? (size_t)(end - p) : strlen(p);
const char *dir = len ? p : ".";
if (!len) len = 1;
char full[PATH_MAX];
if (len + flen + 2 > sizeof(full)) {
errno = ENAMETOOLONG;
} else {
memcpy(full, dir, len);
full[len] = '/';
memcpy(full + len + 1, file, flen + 1);
execve(full, argv, envp);
}
switch (errno) {
case EISDIR:
case ELOOP:
case ENAMETOOLONG:
case ENOENT:
case ENOTDIR:
break;
case ENOEXEC:
return exec_as_script(full, argv, envp);
case EACCES:
saw_eacces = 1;
break;
default:
return -1;
}
if (!end) break;
p = end + 1;
}
if (saw_eacces) errno = EACCES;
return -1;
}
int execvp(const char *file, char *const argv[]) { return execvpe(file, argv, environ); }
// execl(), execlp(), execle(): the list as an argv on the stack
#define EXECL_ARGV(first, ap, n) \
do { \
va_list count_ap; \
va_copy(count_ap, ap); \
n = first ? 1 : 0; \
if (first) \
while (va_arg(count_ap, const char *)) n++; \
va_end(count_ap); \
} while (0)
int execl(const char *path, const char *arg0, ...) {
va_list ap;
va_start(ap, arg0);
int n;
EXECL_ARGV(arg0, ap, n);
char *argv[n + 1];
argv[0] = (char *)arg0;
for (int i = 1; i < n; i++) argv[i] = va_arg(ap, char *);
argv[n] = NULL;
va_end(ap);
return execve(path, argv, environ);
}
int execlp(const char *file, const char *arg0, ...) {
va_list ap;
va_start(ap, arg0);
int n;
EXECL_ARGV(arg0, ap, n);
char *argv[n + 1];
argv[0] = (char *)arg0;
for (int i = 1; i < n; i++) argv[i] = va_arg(ap, char *);
argv[n] = NULL;
va_end(ap);
return execvp(file, argv);
}
int execle(const char *path, const char *arg0, ...) {
va_list ap;
va_start(ap, arg0);
int n;
EXECL_ARGV(arg0, ap, n);
char *argv[n + 1];
argv[0] = (char *)arg0;
for (int i = 1; i < n; i++) argv[i] = va_arg(ap, char *);
argv[n] = NULL;
if (arg0) (void)va_arg(ap, char *); // the list's NULL
char *const *envp = va_arg(ap, char *const *);
va_end(ap);
return execve(path, argv, envp);
}
pid_t fork(void) {
static pid_t (*orig_fork)(void) = NULL;
if (!orig_fork) orig_fork = (pid_t (*)(void))dlsym(RTLD_NEXT, "fork");
if (!orig_fork) {
errno = ENOSYS;
return -1;
}
ddh_prepare();
pid_t forker = (pid_t)syscall(SYS_gettid);
pid_t pid = orig_fork();
if (pid == 0) {
kept_close_forked();
ddh_drop_worker_binder();
ddh_forked(forker);
} else if (pid > 0) {
ddh_child_created(pid, 1);
}
return pid;
}
int close(int fd) {
static int (*orig_close)(int) = NULL;
if (!orig_close) orig_close = (int (*)(int))dlsym(RTLD_NEXT, "close");
uint64_t ticket = kept_close_begin();
if (g_kept_fd_count > 0 && is_kept_fd(fd)) {
kept_close_end(ticket);
return 0;
}
int r = orig_close ? orig_close(fd) : (errno = ENOSYS, -1);
int saved = errno;
kept_close_end(ticket);
errno = saved;
return r;
}
static int dup_moved(int (*dup_fn)(int, int, int), int oldfd, int newfd, int flags) {
int pidfd_from = -1, locked = 0;
if (oldfd != newfd) {
locked = ddh_parent_pidfd_lock(newfd);
pidfd_from = ddh_parent_pidfd_moves(newfd);
}
int ret = dup_fn(oldfd, newfd, flags);
ddh_parent_pidfd_settle(pidfd_from, ret >= 0);
int saved = errno;
ddh_parent_pidfd_unlock(locked);
errno = saved;
return ret;
}
static int (*g_orig_dup2)(int, int);
static int (*g_orig_dup3)(int, int, int);
static int call_dup2(int oldfd, int newfd, int flags) {
(void)flags;
return g_orig_dup2 ? g_orig_dup2(oldfd, newfd) : (errno = ENOSYS, -1);
}
static int call_dup3(int oldfd, int newfd, int flags) {
return g_orig_dup3 ? g_orig_dup3(oldfd, newfd, flags) : (errno = ENOSYS, -1);
}
int dup2(int oldfd, int newfd) {
if (!g_orig_dup2) g_orig_dup2 = (int (*)(int, int))dlsym(RTLD_NEXT, "dup2");
return dup_moved(call_dup2, oldfd, newfd, 0);
}
int dup3(int oldfd, int newfd, int flags) {
if (!g_orig_dup3) g_orig_dup3 = (int (*)(int, int, int))dlsym(RTLD_NEXT, "dup3");
return dup_moved(call_dup3, oldfd, newfd, flags);
}
static int close_range_part(unsigned int first, unsigned int last, void *flags) {
return (int)syscall(__NR_close_range, first, last, *(int *)flags);
}
int close_range(unsigned int first, unsigned int last, int flags) {
// what the kernel refuses, refused before the range is split or the table unshared
if (first > last || (flags & ~(int)(CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC))) {
errno = EINVAL;
return -1;
}
uint64_t ticket = kept_close_begin();
int snapshot[DDNATV_MAX_KEPT_FDS];
const int *kept = (flags & CLOSE_RANGE_CLOEXEC) ? g_cloexec_kept_fds : snapshot;
int count = (flags & CLOSE_RANGE_CLOEXEC) ? g_cloexec_kept_count : kept_snapshot(snapshot);
int r;
if (count == 0) {
r = close_range_part(first, last, &flags);
} else {
r = 0;
if (flags & CLOSE_RANGE_UNSHARE) {
r = (int)syscall(__NR_close_range, ~0U, ~0U, CLOSE_RANGE_UNSHARE);
flags &= ~(int)CLOSE_RANGE_UNSHARE;
}
if (r == 0) r = for_each_range_without(first, last, kept, count, close_range_part, &flags);
}
int saved = errno;
kept_close_end(ticket);
errno = saved;
return r;
}
// The native hook's own uses of these (exec.c) have no counterpart here
__attribute__((unused)) static void *const glibc_only[] = {(void *)ddh_try, (void *)ddh_spawn_wanted};
+6 -9
View File
@@ -52,10 +52,6 @@ for v in $(env | sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p'); do
DROIDDECK_GPU_LOAD|DROIDDECK_GPU_LOAD_DIR|DROIDDECK_VRAM_CAP|DROIDDECK_VRAM_CAP_MB|DROIDDECK_DISPLAY_DRIVER) ;;
DROIDDECK_GUEST_ROOT) ;;
VKD3D_FEATURE_LEVEL|VKD3D_SHADER_MODEL|vk_x11_strict_image_count) ;;
# The exec handoff (../handoff.c): the app's spawn socket and list (the app starts a handed-off program from the
# glibc root's shell, so its path too), and what a worker hands the program it runs (this script, when it runs
# in one): the first Wine process's hook knows the worker's binder fds are not its own.
DD_SPAWN|DD_SPAWN_SESSION|DD_HANDOFF|DD_HANDOFF_DEBUG|DD_HANDOFF_PRESSURE|DDH_*|DDNATV_ROOT) ;;
*) unset "$v" 2>/dev/null ;;
esac
done
@@ -90,7 +86,8 @@ RTD=$APP/.wayland-rt
export VK_ICD_FILENAMES=$PACK/adapter/icd.json ADRENOTOOLS_DRIVER_PATH=$DRVDIR/ ADRENOTOOLS_HOOKS_PATH=$PACK/lib
export ADRENOTOOLS_DRIVER_NAME=$(drvlib "$DRVDIR")
export VK_ADD_IMPLICIT_LAYER_PATH=$PACK/layer ENABLE_GAMESCOPE_WSI=1 GAMESCOPE_WAYLAND_DISPLAY=${GAMESCOPE_WAYLAND_DISPLAY:-gamescope-0}
export XDG_RUNTIME_DIR=$RTD DROIDDECK_WSI_BYPASS_CHECK_MS=100 GAMESCOPE_WSI_FORCE_BYPASS=1
export XDG_RUNTIME_DIR=$RTD DROIDDECK_WSI_BYPASS_CHECK_MS=100 GAMESCOPE_WSI_FORCE_BYPASS=0
echo "WSI forced XWayland bypass disabled (GAMESCOPE_WSI_FORCE_BYPASS=$GAMESCOPE_WSI_FORCE_BYPASS)"
[ -e "$RTD/droiddeck-gamescope-limiter" ] && export GAMESCOPE_LIMITER_FILE=$RTD/droiddeck-gamescope-limiter
# Wine: DXVK/VKD3D over the builtins, X11 inside gamescope (winewayland would pick DroidDeck's compositor),
@@ -262,7 +259,7 @@ prepare_prefix() {
prefix_busy() { # a process of this prefix is running
for p in /proc/[0-9]*; do
[ "${p#/proc/}" = "$$" ] && continue
tr '\0' '\n' 2>/dev/null < "$p/environ" | grep -qx "WINEPREFIX=$COMPAT/pfx" && return 0
tr '\0' '\n' < "$p/environ" 2>/dev/null | grep -qx "WINEPREFIX=$COMPAT/pfx" && return 0
done
return 1
}
@@ -277,7 +274,7 @@ programs_left() { # a program of this prefix is still running, apart from Wine's
""|wineserver|services.exe|winedevice.exe|plugplay.exe|explorer.exe|svchost.exe|rpcss.exe|conhost.exe|start.exe|\
winemenubuilder|wineboot.exe|tabtip.exe) continue ;;
esac
tr '\0' '\n' 2>/dev/null < "$p/environ" | grep -qx "WINEPREFIX=$COMPAT/pfx" && return 0
tr '\0' '\n' < "$p/environ" 2>/dev/null | grep -qx "WINEPREFIX=$COMPAT/pfx" && return 0
done
return 1
}
@@ -286,7 +283,7 @@ stop_wine() { # wineserver -k, then whatever of this prefix is left (e.g. a game
wineserver_ -k 2>/dev/null
sleep 1
for p in /proc/[0-9]*; do
tr '\0' '\n' 2>/dev/null < "$p/environ" | grep -qx "WINEPREFIX=$COMPAT/pfx" || continue
tr '\0' '\n' < "$p/environ" 2>/dev/null | grep -qx "WINEPREFIX=$COMPAT/pfx" || continue
[ "${p#/proc/}" = "$$" ] && continue
echo "$(date +%H:%M:%S) left over: ${p#/proc/} $(cat "$p/comm" 2>/dev/null)"
kill -9 "${p#/proc/}" 2>/dev/null
@@ -430,7 +427,7 @@ comm=$(echo "$name" | cut -c1-15)
game_pids() { # processes of this prefix with the game's name (two prefixes can run programs with the same name)
for p in $(grep -lFx "$comm" /proc/[0-9]*/comm 2>/dev/null); do
p=${p%/comm}
tr '\0' '\n' 2>/dev/null < "$p/environ" | grep -qxF "WINEPREFIX=$COMPAT/pfx" && echo "${p#/proc/}"
tr '\0' '\n' < "$p/environ" 2>/dev/null | grep -qxF "WINEPREFIX=$COMPAT/pfx" && echo "${p#/proc/}"
done
}
# The game's windows go straight to gamescope's X server, as with DroidDeck-Proton (no Wine desktop): the game
+1 -1
View File
@@ -71,7 +71,7 @@ both build jobs verify the Arch Linux ARM signature and pinned SHA-256 as for ev
The desktop workflow replaces the same-version `kwin_wayland` executable and `libkwin.so`; the rest
comes from the signature-checked Arch packages. `desktop-kde.kwin.txt` records the source, patch,
executable, library and build package hashes. Corresponding source is
https://download.kde.org/stable/plasma/6.8.2/kwin-6.8.2.tar.xz plus the patch in this repository.
https://download.kde.org/stable/plasma/6.8.3/kwin-6.8.3.tar.xz plus the patch in this repository.
The inventories use `.gzip` rather than `.gz`: Android's asset packer expands `.gz` and strips
its suffix. The shared local/CI runtime payload check verifies the exact APK names and bytes.
+1 -1
View File
@@ -6,7 +6,7 @@ here=$(cd "$(dirname "$0")" && pwd)
source "$here/kwin.env"
source "$here/mesa.env"
version=$DESKTOP_KWIN_VERSION
source_sha=ea5e68d957c7d70abed97222a592d4445fda29129e20942658badd224ee138b4
source_sha=fd5cb783f220ea4526a9afee2f72b582c3e87ef7f91b19bc5c7a6662ffe7fbdc
mirror=https://fl.us.mirror.archlinuxarm.org/aarch64
builder=68B3537F39A313B3E574D06777193F152BDBE6A6
work=$(mktemp -d)
+1 -1
View File
@@ -1 +1 @@
DESKTOP_KWIN_VERSION=6.8.2
DESKTOP_KWIN_VERSION=6.8.3
@@ -8,8 +8,8 @@ Third-party files in DroidDeck's KDE desktop package (tools/desktop-kde/overlay)
- steam.svg: Papirus icon theme (https://github.com/PapirusDevelopmentTeam/papirus-icon-theme),
GPL-3.0.
- kwin_wayland: KWin 6.8.2, GPL-2.0-or-later. Built with DroidDeck's nested desktop scale patch.
Corresponding source: https://download.kde.org/stable/plasma/6.8.2/kwin-6.8.2.tar.xz and
- kwin_wayland: KWin 6.8.3, GPL-2.0-or-later. Built with DroidDeck's nested desktop scale patch.
Corresponding source: https://download.kde.org/stable/plasma/6.8.3/kwin-6.8.3.tar.xz and
https://github.com/Droid-Deck/DroidDeck/tree/fix/kde-desktop-followups/tools/desktop-kde/patches
(the source and patch hashes are recorded in desktop-kde.kwin.txt beside the package).
+83 -17
View File
@@ -750,13 +750,16 @@ def uinput_commands(samples: list[dict], tool: str, viewport: dict) -> list[dict
return {"code": code, "info": {"value": 0, "minimum": low, "maximum": high, "fuzz": 0, "flat": 0, "resolution": 0}}
commands = [
{"id": 1, "command": "register", "name": "DroidDeck agent pen", "bus": "virtual", "configuration": [
# The bus comes after the codes: a `uinput` without the virtual bus fails on it with no "Error reading in
# object", while symbolic codes read first produce that message and send the script round again as numbers.
{"id": 1, "command": "register", "name": "DroidDeck agent pen", "configuration": [
{"type": "UI_SET_EVBIT", "data": ["EV_KEY", "EV_ABS"]},
{"type": "UI_SET_KEYBIT", "data": ["BTN_TOOL_PEN", "BTN_TOOL_RUBBER", "BTN_TOUCH", "BTN_STYLUS", "BTN_STYLUS2"]},
{"type": "UI_SET_ABSBIT", "data": ["ABS_X", "ABS_Y", "ABS_PRESSURE", "ABS_DISTANCE", "ABS_TILT_X", "ABS_TILT_Y"]},
{"type": "UI_SET_PROPBIT", "data": ["INPUT_PROP_DIRECT"]},
], "abs_info": [axis("ABS_X", 0, width - 1), axis("ABS_Y", 0, height - 1), axis("ABS_PRESSURE", 0, UINPUT_PRESSURE),
axis("ABS_DISTANCE", 0, UINPUT_DISTANCE), axis("ABS_TILT_X", -90, 90), axis("ABS_TILT_Y", -90, 90)]},
axis("ABS_DISTANCE", 0, UINPUT_DISTANCE), axis("ABS_TILT_X", -90, 90), axis("ABS_TILT_Y", -90, 90)],
"bus": "virtual"},
{"id": 1, "command": "delay", "duration": UINPUT_REGISTER_MS},
]
sent = {tool_key: 0, "BTN_TOUCH": 0, "BTN_STYLUS": 0, "BTN_STYLUS2": 0}
@@ -792,27 +795,91 @@ def uinput_commands(samples: list[dict], tool: str, viewport: dict) -> list[dict
{"id": 1, "command": "sync", "syncToken": UINPUT_SYNC}]
def uinput_check(adb: str, serial: str) -> None:
def uinput_check(adb: str, serial: str) -> int:
"""Checks the device can inject through `uinput` and returns its SDK level."""
probe = run_adb(adb, serial, "shell",
"command -v uinput >/dev/null 2>&1 || echo no-uinput; [ -w /dev/uinput ] || echo no-dev-uinput")
"command -v uinput >/dev/null 2>&1 || echo no-uinput; [ -w /dev/uinput ] || echo no-dev-uinput; "
"echo sdk=$(getprop ro.build.version.sdk)")
if probe.returncode != 0:
raise ControlError((probe.stdout + probe.stderr).decode(errors="replace").strip() or "adb shell failed", "ADB_FAILED")
missing = probe.stdout.decode(errors="replace").split()
if "no-uinput" in missing:
words = probe.stdout.decode(errors="replace").split()
if "no-uinput" in words:
raise ControlError("This device's shell has no `uinput` command", "UINPUT_UNAVAILABLE")
if "no-dev-uinput" in missing:
if "no-dev-uinput" in words:
raise ControlError("The ADB shell cannot write /dev/uinput on this device", "UINPUT_UNAVAILABLE")
sdk = next((w[4:] for w in words if w.startswith("sdk=")), "")
return int(sdk) if sdk.isdigit() else UINPUT_NAMED_SDK
# Android 14 QPR2 taught `uinput` symbolic event names, the `sync` command and the virtual bus. Earlier versions stop at
# the register line with "Error reading in object" before any device exists, so their scripts carry Linux's numeric
# codes, register on the USB bus and end without `sync`. SDK 34 covers both sides of QPR2, so it is tried named first.
UINPUT_NAMED_SDK = 34
UINPUT_REJECTED = "Error reading in object"
UINPUT_CODES = {
"EV_SYN": 0, "EV_KEY": 1, "EV_ABS": 3, "SYN_REPORT": 0, "INPUT_PROP_DIRECT": 1,
"BTN_SOUTH": 304, "BTN_EAST": 305, "BTN_NORTH": 307, "BTN_WEST": 308, "BTN_TL": 310, "BTN_TR": 311,
"BTN_SELECT": 314, "BTN_START": 315, "BTN_MODE": 316, "BTN_THUMBL": 317, "BTN_THUMBR": 318,
"BTN_TOOL_PEN": 320, "BTN_TOOL_RUBBER": 321, "BTN_TOUCH": 330, "BTN_STYLUS": 331, "BTN_STYLUS2": 332,
"ABS_X": 0, "ABS_Y": 1, "ABS_RX": 3, "ABS_RY": 4, "ABS_HAT0X": 16, "ABS_HAT0Y": 17,
"ABS_PRESSURE": 24, "ABS_DISTANCE": 25, "ABS_TILT_X": 26, "ABS_TILT_Y": 27,
}
UINPUT_CONFIG_CODES = {"UI_SET_EVBIT": 100, "UI_SET_KEYBIT": 101, "UI_SET_ABSBIT": 103, "UI_SET_PROPBIT": 110}
def uinput_script(commands: list[dict], legacy: bool) -> str:
"""The `uinput -` input: as written, or for [legacy] `uinput` numeric, on the USB bus and without `sync`."""
if legacy:
def code(value):
return UINPUT_CODES[value] if isinstance(value, str) else value
numeric = []
for command in commands:
if command["command"] == "sync":
continue
command = dict(command)
if command["command"] == "register":
if command.get("bus") == "virtual":
command["bus"] = "usb"
command["configuration"] = [{"type": UINPUT_CONFIG_CODES[c["type"]], "data": [code(d) for d in c["data"]]}
for c in command["configuration"]]
command["abs_info"] = [dict(a, code=code(a["code"])) for a in command.get("abs_info", [])]
elif command["command"] == "inject":
command["events"] = [code(e) for e in command["events"]]
numeric.append(command)
commands = numeric
return "".join(json.dumps(command) + "\n" for command in commands)
def uinput_finished(result: subprocess.CompletedProcess, token: str, legacy: bool) -> bool:
"""Whether `uinput` ran the whole script: by its sync token, or for [legacy] `uinput` by a clean exit."""
out = result.stdout.decode(errors="replace")
if not legacy:
return token in out
text = out + (result.stderr or b"").decode(errors="replace")
return result.returncode == 0 and "Error" not in text and "Exception" not in text
def uinput_run(adb: str, serial: str, sdk: int, commands: list[dict], token: str,
timeout: float) -> tuple[subprocess.CompletedProcess, bool]:
"""Runs [commands] through `uinput -` in the form the device reads; returns the result and whether it finished."""
legacy = sdk < UINPUT_NAMED_SDK
result = run_adb(adb, serial, "shell", "uinput", "-", stdin=uinput_script(commands, legacy).encode(), timeout=timeout)
out = result.stdout.decode(errors="replace")
if not legacy and UINPUT_REJECTED in out and token not in out:
legacy = True
result = run_adb(adb, serial, "shell", "uinput", "-", stdin=uinput_script(commands, legacy).encode(), timeout=timeout)
return result, uinput_finished(result, token, legacy)
def pen_uinput(adb: str, serial: str, samples: list[dict], tool: str) -> dict:
uinput_check(adb, serial)
sdk = uinput_check(adb, serial)
viewport = input_viewport(run_adb(adb, serial, "shell", "dumpsys", "input").stdout.decode(errors="replace"))
script = "".join(json.dumps(command) + "\n" for command in uinput_commands(samples, tool, viewport))
started = time.monotonic()
result = run_adb(adb, serial, "shell", "uinput", "-", stdin=script.encode(),
timeout=(UINPUT_REGISTER_MS + samples[-1]["t"] + UINPUT_TAIL_MS) / 1000 + 30)
result, finished = uinput_run(adb, serial, sdk, uinput_commands(samples, tool, viewport), UINPUT_SYNC,
(UINPUT_REGISTER_MS + samples[-1]["t"] + UINPUT_TAIL_MS) / 1000 + 30)
elapsed = round((time.monotonic() - started) * 1000)
if UINPUT_SYNC not in result.stdout.decode(errors="replace"):
if not finished:
detail = (result.stderr or result.stdout).decode(errors="replace").strip()[-400:]
raise ControlError(f"uinput stopped before the end of the gesture (exit {result.returncode})"
+ (f": {detail}" if detail else "") + "; `adb logcat -s UINPUT UinputDevice` tells why",
@@ -869,13 +936,12 @@ def gamepad_commands(buttons: list[str], hold: int, gap: int) -> list[dict]:
def gamepad_uinput(adb: str, serial: str, buttons: list[str], hold: int, gap: int) -> dict:
commands = gamepad_commands(buttons, hold, gap)
uinput_check(adb, serial)
script = "".join(json.dumps(command) + "\n" for command in commands)
sdk = uinput_check(adb, serial)
started = time.monotonic()
result = run_adb(adb, serial, "shell", "uinput", "-", stdin=script.encode(),
timeout=(UINPUT_REGISTER_MS + len(buttons) * (hold + gap) + UINPUT_TAIL_MS) / 1000 + 30)
result, finished = uinput_run(adb, serial, sdk, commands, GAMEPAD_SYNC,
(UINPUT_REGISTER_MS + len(buttons) * (hold + gap) + UINPUT_TAIL_MS) / 1000 + 30)
elapsed = round((time.monotonic() - started) * 1000)
if GAMEPAD_SYNC not in result.stdout.decode(errors="replace"):
if not finished:
detail = (result.stderr or result.stdout).decode(errors="replace").strip()[-400:]
raise ControlError(f"uinput stopped before the last button (exit {result.returncode})"
+ (f": {detail}" if detail else "") + "; `adb logcat -s UINPUT UinputDevice` tells why",
+25 -3
View File
@@ -21,9 +21,10 @@ library list, before anything is published.
trip to Xwayland on the paint thread; with no image, wlserver's position is used as upstream does.
- `0101-nested-wayland-cursor-routing.patch` - this app: `gamescope_cursor_composite=2` lets the
nested Wayland session paint its cursor in the output using the real X pointer position; client
cursor surfaces are cleared to prevent a duplicate at the host pointer, while Gamescope's original
default host-cursor fallback is preserved when its no-keyboard-focus policy selects it. Empty
client cursor images and Gamescope's hidden flag still suppress the painted cursor.
cursor surfaces are cleared to prevent a duplicate at the host pointer, and so is Gamescope's
default host-cursor fallback, which would otherwise show a second arrow until Gamescope gets
keyboard focus. Empty client cursor images and Gamescope's hidden flag still suppress the
painted cursor.
- `0110-wayland-backend-touch.patch` - this app: the nested Wayland backend bound only the host's
pointer and keyboard, so a finger on the phone's screen never reached Steam. It now binds
`wl_touch` too and hands each finger to wlserver's touch path (`wlserver_touchdown` / `motion` /
@@ -484,3 +485,24 @@ not wait on fences attached to a dma-buf, so the composite now checks each outpu
It picks the next image that is neither held by the host nor still being scanned out. Only when every free image is
still on the display does it wait for one, up to 100 ms. On kernels that cannot attach the fence, the host keeps
waiting itself and nothing changes. `tools/gamescope/tests/nested-swapchain.cpp` covers the choice and the busy check.
## 0147 Wayland backend: a forwarded client buffer goes back to its client only after scanout
When no composite is needed, gamescope hands a client's own buffer to the host compositor as a plane. The host now
releases a buffer as soon as the display latches the next one and leaves its release fence on the buffer's dma-buf.
gamescope returned the buffer to the client on that release, and a client whose Vulkan driver does not wait on
fences attached to a dma-buf then drew into it while the display was still scanning it out, which showed as black
tiles in compressed buffers. A forwarded client buffer now stays held until `poll(POLLOUT)` on its dma-buf reports
that the display has finished with it, on a waiter thread so nothing else blocks. A release that arrives after the
buffer was shown again is dropped, so the later release decides. A pending wait holds its own reference on the
buffer, since that later release can drop the host's reference before the wait ends. Composite output images keep the 0146 path, and a
host that waits for the fence itself releases buffers that are already idle, so nothing changes there.
## 0148 Wayland backend: composite every frame when the host releases buffers before scanout
With 0147 a forwarded client buffer stays held until the display has finished scanning it out, about one refresh after
the host releases it. Steam's web helper cycles three buffers of its own, so forwarding them held the Steam UI at 80 fps
on a 120 Hz screen (frames alternately one and two refreshes apart). The first time a forwarded buffer comes back while
it is still being scanned out, the backend now composites every frame into its own output images. Those are reused at
latch under 0146, and the client's buffers return as soon as the composite has read them: the Steam UI then runs at
the full 120 fps. Hosts that release a buffer only after scanout never take this path and keep forwarding.
@@ -74,7 +74,7 @@ index 0000000..d7c21da
+
+ constexpr bool CursorShouldBeForwardedToHost( int cursorCompositeMode, bool useHostCursorFallback )
+ {
+ return cursorCompositeMode != 2 || useHostCursorFallback;
+ return cursorCompositeMode != 2;
+ }
+
+ constexpr bool CursorImageShouldBePainted( bool imageEmpty, bool cursorHidden )
@@ -176,10 +176,10 @@ index 0000000..9c622db
+ REQUIRE( CursorShouldBeComposited( 2, false, false, true, false ) );
+}
+
+TEST_CASE("manual composition retains only the no-focus default cursor fallback", "[cursor_routing]")
+TEST_CASE("manual composition never forwards a cursor to the host", "[cursor_routing]")
+{
+ REQUIRE_FALSE( CursorShouldBeForwardedToHost( 2, false ) );
+ REQUIRE( CursorShouldBeForwardedToHost( 2, true ) );
+ REQUIRE_FALSE( CursorShouldBeForwardedToHost( 2, true ) );
+ REQUIRE( CursorShouldBeForwardedToHost( 1, false ) );
+ REQUIRE( CursorShouldBeForwardedToHost( 0, false ) );
+}
Loaded 100 of 157 files, more files were not shown because too many files have changed in this diff. Show more