Compare commits

...
Author SHA1 Message Date
maxjivi05 0eeae70046 feat(session): remove the Memory readout overlay 2026-11-30 19:37:35 -05:00
LunaDL fcd197934a test: fix effects source cache harness initialization (#3490) 2026-11-30 18:15:04 -05:00
FryMcNuggetandFryMcNugget 768661928e feat(agent): connect the agent on Quest, which has no pairing screen (#3445)
* feat(agent): connect the agent on Quest, which has no pairing screen

Quest hides Android's Wireless debugging pairing, so the agent's connection
step could not be completed there. On a Quest the step's action is now Allow:
DroidDeck connects to adbd on 127.0.0.1:5555 (after a one-time `adb tcpip 5555`
from a computer) and the headset asks "Allow debugging?" for DroidDeck's key.
Wireless debugging accepts a key allowed that way, so the saved loopback
connection then works like a pairing.

DroidDeck also declares WRITE_SECURE_SETTINGS. When it is granted over adb,
DroidDeck turns Wireless debugging on itself before looking for its port.

* fix(agent): keep the Quest setup hint visible and report a declined prompt correctly

A late connection lookup no longer overwrites an Allow that is running.
On a Quest, the connection row shows its status above the full hint, which
holds the one-time commands. The failure message no longer claims port 5555
was silent, since a declined or unanswered prompt fails the same way.

* fix(agent): connection checks from before an Allow no longer overwrite it

A check started before Allow could land after it and mark the step as not
done, or replace the prompt instructions while Allow was still waiting.
Each Allow now starts a new generation, and older connection results are
dropped, as are results that land while Allow is running.

* ci: rerun after the Maven 429 rate limit

* fix(quest): turn Wireless debugging on by itself only on Quest

Other devices keep exactly their pairing flow even if WRITE_SECURE_SETTINGS
is granted. Once connected, the Quest agent row shows its usual short hint
instead of the setup instructions.

* fix(quest): connect after a reboot without a second Allow

After a reboot, turning Wireless debugging on makes the Quest ask again to
allow it on this network, and the 2 s wait ran out before that was
answered, so the row showed Allow. Allow then failed, since port 5555 is
closed after a reboot. The lookup now keeps trying for up to 30 s after
turning Wireless debugging on, and Allow first tries the already-trusted
key over Wireless debugging before asking on port 5555.

* ci: rerun after download timeouts in the Python tests

---------

Co-authored-by: FryMcNugget <358046012+FryMcNugget@users.noreply.github.com>
2026-11-30 15:10:08 -05:00
LunaDLandmaxjivi05 18cd1cf07f Fix: reclaim DD-FG scratch resources on rebuild (#3456)
* Prepare FrameGen for instance-owned scratch lifecycle

* Make DD-FG rebuild and teardown completion-aware

* Restore DD-FG namespace boundary

* Isolate DD-FG scratch state and reclaim resources on rebuild

* Declare per-instance scratch builder before recording code

* Make DD-FG ring teardown report unsafe GPU completion

* Retain DD-FG input ring until GPU completion is confirmed

* Add DD-FG lifecycle and resource-isolation tests

* Cover DD-FG teardown and rebuild failure cases

* Document DD-FG scratch ownership and teardown semantics

* Guard DD-FG teardown when GPU completion cannot be queried

* docs: clarify DD-FG device-loss teardown

* fix: define DD-FG scratch state before resize

* fix: define DD-FG scratch state before resize

* fix(ddfg): wait for the GPU before replacing the input ring on resize

* Fix DD-FG ring cleanup after device loss

* Propagate DD-FG device-loss status

* Retain DD-FG resources when GPU completion is unknown

* Retain DD-FG resources when GPU completion is unknown

* Retain DD-FG resources when GPU completion is unknown

* Retain DD-FG resources when GPU completion is unknown

* Retain DD-FG resources when GPU completion is unknown

* Retry DD-FG cleanup after an idle-wait failure

* Test DD-FG cleanup retry after GPU wait failure

---------

Co-authored-by: maxjivi05 <maxjividen@gmail.com>
2026-11-30 15:04:16 -05:00
LunaDL 41f15b03bb feat(framegen): add spatial post-upscale per presentation (#3454)
* feat(framegen): add spatial post-upscale per presentation

* Fix framegen post-upscale expectations

* test: run framegen post-upscale assertions

* test: verify framegen postprocessing image handles

* test: capture framegen screen blit source
2026-11-30 15:03:52 -05:00
LunaDL 5c887bfc59 Perf: Create screen-effect pipelines on demand (#3453)
* perf: create screen-effect pipelines on demand

* fix: prepare screen-effect fallback pipelines

* docs: describe lazy screen-effect pipelines

* test: guard lazy screen-effect pipeline setup
2026-11-30 15:03:30 -05:00
LunaDL 430d777c5c Fix: Fix right stick highlights and preserve zoom bindings (#3440)
* fix(input): stop stale right-stick page scrolling

* fix(input): preserve other bindings when saving an action

* test(input): cover zoom commands on same control category

* test(input): remove unnecessary zoom binding cases

* style(input): remove added inline comment
2026-11-30 15:02:30 -05:00
MaxsTechReview 5f129fb4db fix(native): allocated getcwd and realpath results name the guest mount (#3481)
getcwd(NULL, ...) and realpath(path, NULL) returned the host path of a
session mount whenever its guest path was longer than the host path,
because the translation had to fit the buffer the C library allocated.
Shells export that host path as PWD, and Wine prefers a valid PWD, so a
program started from an added game folder on a removable card got a
working directory it could not open and started in the Windows folder.
Grow the allocated result to fit the guest path.
2026-11-30 14:24:10 -05:00
MaxsTechReview 7404fba5a3 fix(battlenet): an install folder chosen in Battle.net on the library's drive is kept (#3479)
* fix(battlenet): an install folder chosen in Battle.net on the library's drive is kept

Every open set Battle.net's default install folder back to the library folder whenever the two differed, so a folder the user picked in Battle.net on the same drive was replaced on the next open. The folder is now only moved to the library when it is unset, missing, or on another drive.

* fix(battlenet): check the trimmed folder against the rootfs drives
2026-11-30 14:24:05 -05:00
MaxsTechReview 54ca518553 fix(storage): a card library the session cannot open by its raw path is opened by its storage path (#3475)
A game storage folder saved as a raw volume path is opened through the volume's /storage path when only that one is usable, and its private directories are kept under either path. Battle.net is only given a library folder when the configured one is attached, so a missing card no longer moves its install folder to internal storage.
2026-11-30 12:00:05 -05:00
MaxsTechReview 72c8b8426d fix(input): Windows games see the gamepad again when the pad is not read through SDL (#3469)
Since each pad was described to Wine's udev backend with the identity its
SDL backend sees, the udev backend left every pad to SDL. Where SDL does
not open the pad, such as a session without proot, Windows games lost both
the gamepad and the on-screen controls.

The udev backend owns the pads again with the Steam Input identity it had
before. SDL inside Wine's bus driver now reads the same identity for those
pads and skips them as it skips any Steam Input pad, so each pad is still
listed once and both triggers keep reading together.
2026-11-30 08:53:12 -05:00
xlulx 6dc3d01674 fix(display): apply a client's commit only after its GPU has finished writing the buffer (#3004) 2026-11-30 04:23:04 -05:00
MaxsTechReview df2cfa40b3 test(xbox): cover device-limit diagnostic routing (#3458) 2026-11-30 01:38:08 -05:00
MaxsTechReview e101a78791 fix(stores): the front end no longer crashes on start when the Steam engine starts on the refresh thread (#3457)
Keep the Steam install picker state out of the Steam engine object

The picker state lived on SteamStore, which is first touched from the
background stores refresh thread. On the Compose runtime in use, a state
object created outside a snapshot while the composition holds an open
snapshot is unreadable inside it, so the front end crashed on startup
with "Reading a state that was created after the snapshot was taken".
The state now lives on StoresState next to the other UI-facing store
state, and SteamStore holds no Compose state.
2026-11-30 00:02:07 -05:00
The412Banner aaa9fb129c fix(nativeguest): programs on a mount kept at its host path start as guest programs (#3211) 2026-11-29 23:58:32 -05:00
MaxsTechReview 23d7e639ca fix(steam): mark ARM64-uninstallable tool dependencies installed (#3443)
* fix(steam): mark ARM64-uninstallable tool dependencies installed

The ARM64 client cannot install Proton EasyAntiCheat Runtime (1826330),
which it refuses as an invalid platform, or that tool's Steam Linux
Runtime 1.0 (scout) dependency (1070560), which has no ARM64 depot. After
the EULA hand-off the client starts the dependency install and aborts in
glibc's smallbin check.

Write the bare installed manifest DroidDeck already uses for adopted games
for those two tools before the client starts: only on the ARM64 client,
only when appinfo shows no ARM64 depot, and never over a fully installed
manifest.

Refs: ValveSoftware/steam-for-linux#13937, DroidDeck #2313

* fix(steam): seed a tool only when no library has it installed, and write manifests atomically

A partial manifest in the first library no longer hides a full install in
another one, and a failed write leaves no truncated or stray manifest.

* fix(steam): publish tool manifests without replacing concurrent installs
2026-11-29 23:38:39 -05:00
MaxsTechReview 4ef23ed0e9 Return to the DroidDeck UI when logging out of the desktop (#3374)
* fix(desktop): Log Out returns to DroidDeck, Return to Gaming Mode opens Steam

Both ended Plasma through the same logout call and the desktop script always
started Steam afterwards. Return to Gaming Mode now leaves a request that the
script reads; a plain Log Out ends the desktop. The app ships the shortcut
with the script so both always change together.

* Wait for the logout reply so a cold Shutdown service still gets the request

* Forget the return to gaming mode when the logout request fails
2026-11-29 23:04:31 -05:00
ff35cce127 fix(steam): GTA III on Steam starts a new game (full x87 precision for app 12100) (#3197)
The Steam copy (AppID 12100) died on "Start new game" at 0042A703: FEX's reduced x87 precision turns a float into a bad pointer. GameEnvironment.knownGames sets FEX_X87REDUCEDPRECISION=0 for it, above the shared settings and below the game's own, and picking a FEX preset for the game keeps the fix.

Co-authored-by: Unixcision <14082251+Unixcision@users.noreply.github.com>
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-11-29 22:51:35 -05:00
Tamim KabirandKurt Himebauch 0951b602b7 fix(input): programs built with _FORTIFY_SOURCE read the virtual pads (#2916)
* fix(input): programs built with _FORTIFY_SOURCE read the virtual pads

Fortified builds, Flatpak runtimes among them, call __read_chk, __poll_chk
and __ppoll_chk in place of read, poll and ppoll, and glibc's versions go
straight to the kernel. Such programs opened a pad through the shim but read
its backing ring file instead of events, so they never saw input: Marathon
Recompiled's SDL reads the pad through __read_chk.

The shim now provides all three, with glibc's bounds checks, on the same
paths as read, poll and ppoll.

* fix(input): keep glibc's __read_chk for descriptors that are not pads

Only pad descriptors take the shim's read path; the rest go to the next
__read_chk, so fortified reads keep libc's cancellation point. The test
also polls the empty ring with a zero timeout, which a __poll_chk that
bypasses the shim would report as ready.

---------

Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-11-29 22:51:30 -05:00
LarzVaderandKurt Himebauch 57055be6fb fix(ci): Robolectric's jar cache is saved again, and a Maven 429 runs the unit tests again (#3418)
* fix(ci): Robolectric's jar cache is saved again, and a Maven 429 runs the unit tests again

* fix(ci): retry Gradle artifact download rate limits too

* fix(ci): restrict Maven retry to dependency download exceptions

---------

Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-11-29 21:13:54 -05:00
MaxsTechReview c6743730aa Keep a signed-in store's Library tab when its game list is empty or failed to load (#3449) 2026-11-29 20:24:34 -05:00
MaxsTechReview 780c5658d0 fix(input): each pad is listed once in Windows games so both triggers read together (#3436)
* fix(input): each pad is listed once in Windows games so both triggers read together

A pad that Wine's SDL backend also reads was described to Wine's udev
backend as a Steam Input virtual pad, so Wine built two devices for one
pad. SDL RawInput games could not match the two and read held triggers as
released. The pad now keeps the identity the SDL backend sees unless that
backend is told to skip it.

Rumble that Wine starts through SDL is now held until the next update,
matching the udev path, instead of stopping after one second.

* fix(input): hold only the rumble Wine starts through SDL, not later SDL rumble in the same process

* fix(input): read @file SDL ignore lists when choosing the pad identity

SDL reads the ignore and except lists from a file when the value starts
with @. Match the ring pad ID against that file's contents too.

* fix(input): parse SDL controller ID lists the way SDL does when choosing the pad identity
2026-11-29 20:24:20 -05:00
MaxsTechReview a9e8a01bb6 fix(native): prepare the rootfs before a helper starts outside a session (#3447)
Prepare the rootfs before a native program starts outside a session

The linker and libc are patched for Android's seccomp filter only when a
session starts. A helper started between sessions, after a runtime
update and before the first session, ran the unpatched linker and died
of SIGSYS (exit code 159). The shared native process builder now
prepares the rootfs itself when no session is running.
2026-11-29 19:44:11 -05:00
MaxsTechReview 861121144c fix(xbox): try the next listed executable when one is missing (#3446)
A package can list several PC executables while shipping only some of them. Try each listed executable in order and fail only when none of them exist.
2026-11-29 19:33:55 -05:00
122 changed files with 3370 additions and 789 deletions

No files matched your search

+17 -5
View File
@@ -740,7 +740,8 @@ jobs:
echo "version=$(grep -o "org.robolectric:robolectric:[0-9.]*" app/build.gradle | cut -d: -f3)" >> "$GITHUB_OUTPUT"
# Robolectric downloads these from Maven Central on first use without retrying, and 429s fail whole test classes.
# The cache path sits beside the workspace because runner homes are at different depths from it, and
# actions/cache stores paths relative to the workspace. Runners that keep their own ~/.m2 skip the cache.
# actions/cache stores paths relative to the workspace. It is passed as an absolute path: the save action rejects
# "..". Runners that keep their own ~/.m2 skip the cache.
- name: Place Robolectric's Android jars beside the workspace
id: robolectric-jars
run: |
@@ -751,7 +752,9 @@ jobs:
echo "cache=false" >> "$GITHUB_OUTPUT"
else
mkdir -p "$jars" "$(dirname "$m2")"
ln -sfn "$(cd "$jars" && pwd)" "$m2"
jars=$(cd "$jars" && pwd)
ln -sfn "$jars" "$m2"
echo "path=$jars" >> "$GITHUB_OUTPUT"
echo "cache=true" >> "$GITHUB_OUTPUT"
fi
- name: Restore Robolectric's Android jars
@@ -759,7 +762,7 @@ jobs:
if: steps.robolectric-jars.outputs.cache == 'true'
uses: actions/cache/restore@v4
with:
path: ../robolectric-jars
path: ${{ steps.robolectric-jars.outputs.path }}
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
restore-keys: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-
- name: Count the restored Robolectric jars
@@ -773,7 +776,16 @@ jobs:
run: |
set -o pipefail
mkdir -p app/build
./gradlew testReleaseUnitTest --console=plain --info --stacktrace -Drobolectric.logging=stderr -PndkVersion="$NDK_VERSION" 2>&1 | tee app/build/unit-tests.log
# A Maven 429 fails every test class that needs the missing jar. The jars an attempt did get stay for the next.
for wait in 60 180 0; do
status=0
./gradlew testReleaseUnitTest --console=plain --info --stacktrace -Drobolectric.logging=stderr -PndkVersion="$NDK_VERSION" 2>&1 | tee app/build/unit-tests.log || status=$?
if [ "$status" = 0 ] || [ "$wait" = 0 ] || ! grep -Eq '^[[:space:]]*(Caused by: org\.gradle\.internal\.resource\.transport\.http\.HttpErrorStatusCodeException: Could not GET .*https://repo\.maven\.apache\.org/.*Received status code 429 from server|Caused by: java\.io\.IOException: Server returned HTTP response code: 429 for URL: https://repo\.maven\.apache\.org/)' app/build/unit-tests.log; then
exit "$status"
fi
echo "::warning::Maven Central answered 429; running the unit tests again in ${wait}s"
sleep "$wait"
done
# actions/cache only saves when the job succeeds, so a run whose tests died on a Maven 429 never filled the cache.
# Save the complete jars even after a failed test step, when this run added some; a partial download is dropped first.
@@ -800,7 +812,7 @@ jobs:
if: always() && steps.robolectric-jars-final.outputs.save == 'true'
uses: actions/cache/save@v4
with:
path: ../robolectric-jars
path: ${{ steps.robolectric-jars.outputs.path }}
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
- name: Upload unit test diagnostics
+3
View File
@@ -33,6 +33,9 @@
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<!-- Granted only with adb shell pm grant; lets the agent turn Wireless debugging on where Settings hides it (Quest). -->
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+22
View File
@@ -4130,6 +4130,17 @@ EXPORT ssize_t read(int fd, void *buf, size_t count) {
return read_input(fd, buf, count);
}
extern "C" [[noreturn]] void __chk_fail(void);
/* Programs built with _FORTIFY_SOURCE (Flatpak runtimes among them) call these instead of read, poll
* and ppoll, and glibc's versions go straight to the kernel. */
EXPORT ssize_t __read_chk(int fd, void *buf, size_t count, size_t buflen) {
static auto next_read_chk = reinterpret_cast<ssize_t (*)(int, void *, size_t, size_t)>(dlsym(RTLD_NEXT, "__read_chk"));
if (count > buflen) __chk_fail();
if (next_read_chk && !is_fake_input_fd(fd)) return next_read_chk(fd, buf, count, buflen);
return read_input(fd, buf, count);
}
EXPORT ssize_t readv(int fd, const struct iovec *iov, int iovcnt) {
if (!is_fake_input_fd(fd)) return syscall(SYS_readv, fd, iov, iovcnt);
if (iovcnt < 0 || iovcnt > IOV_MAX) {
@@ -4378,6 +4389,17 @@ EXPORT int ppoll(struct pollfd *fds, nfds_t nfds,
return my_ppoll(fds, nfds, timeout, sigmask);
}
EXPORT int __poll_chk(struct pollfd *fds, nfds_t nfds, int timeout, size_t fdslen) {
if (fdslen / sizeof(*fds) < nfds) __chk_fail();
return poll(fds, nfds, timeout);
}
EXPORT int __ppoll_chk(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
const sigset_t *sigmask, size_t fdslen) {
if (fdslen / sizeof(*fds) < nfds) __chk_fail();
return ppoll(fds, nfds, timeout, sigmask);
}
EXPORT int select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout) {
const auto my_select = next_symbol<decltype(&::select)>(Next::select);
+73 -9
View File
@@ -27,7 +27,31 @@ VkImageMemoryBarrier bar(VkImage img, VkImageLayout from, VkImageLayout to,
}
Engine::Engine() = default;
Engine::~Engine() { destroyRing(); fg_.destroy(); }
Engine::~Engine() { (void)destroy(); }
bool Engine::destroy() {
if (!fg_.destroy()) {
DDFG_LOGE("native: retaining the input ring because GPU completion is unknown");
return false;
}
if (!destroyRing(true)) {
DDFG_LOGE("native: could not release the input ring during teardown");
return false;
}
dev_ = VK_NULL_HANDLE;
unavailable_ = true;
return true;
}
void Engine::abandon() {
fg_.abandon();
ring_[0] = Slot{};
ring_[1] = Slot{};
dev_ = VK_NULL_HANDLE;
queue_ = VK_NULL_HANDLE;
phys_ = VK_NULL_HANDLE;
unavailable_ = true;
}
bool Engine::init(const VkTable& table, VkPhysicalDevice phys, VkDevice dev,
uint32_t queueFamily, VkQueue queue) {
@@ -59,15 +83,29 @@ bool Engine::prepare(uint32_t w, uint32_t h, VkFormat fmt) {
if (unavailable_ || w == 0 || h == 0 || fmt == VK_FORMAT_UNDEFINED) return false;
if (builtW_ == w && builtH_ == h && builtFmt_ == fmt && fg_.valid()) return true;
if (!fg_.onResize(VkExtent2D{w, h}, fmt, false)) {
const bool formatChanged = fmt != builtFmt_;
if (!fg_.onResize(VkExtent2D{w, h}, fmt, formatChanged)) {
DDFG_LOGE("native: onResize %ux%u failed; frame generation unavailable", w, h);
unavailable_ = true;
return false;
}
destroyRing();
bool deviceLost = false;
if (!destroyRing(false, &deviceLost)) {
DDFG_LOGE("native: could not safely release the previous input ring");
unavailable_ = true;
return false;
}
if (deviceLost) {
DDFG_LOGE("native: device lost while releasing the input ring");
unavailable_ = true;
return false;
}
for (Slot& s : ring_) {
if (!makeSlot(s, w, h, fmt)) { destroyRing(); unavailable_ = true; return false; }
if (!makeSlot(s, w, h, fmt)) {
destroyRing(true);
unavailable_ = true;
return false;
}
}
builtW_ = w; builtH_ = h; builtFmt_ = fmt;
history_ = 0; curr_ = 0; frames_ = 0;
@@ -178,11 +216,37 @@ void Engine::destroySlot(Slot& s) {
s = Slot{};
}
void Engine::destroyRing() {
if (dev_ == VK_NULL_HANDLE || !dd_.DeviceWaitIdle) return;
if (ring_[0].img || ring_[1].img) dd_.DeviceWaitIdle(dev_);
destroySlot(ring_[0]); destroySlot(ring_[1]);
bool Engine::destroyRing(bool deviceIdleConfirmed, bool* deviceLost) {
if (deviceLost) *deviceLost = false;
const bool hasResources = ring_[0].img || ring_[0].mem || ring_[0].view ||
ring_[1].img || ring_[1].mem || ring_[1].view;
if (!hasResources) {
history_ = 0;
return true;
}
if (dev_ == VK_NULL_HANDLE) {
DDFG_LOGE("native: cannot release the input ring without a valid device");
return false;
}
if (!deviceIdleConfirmed) {
if (!dd_.DeviceWaitIdle) {
DDFG_LOGE("native: cannot release the input ring without vkDeviceWaitIdle");
return false;
}
const VkResult result = dd_.DeviceWaitIdle(dev_);
if (result == VK_ERROR_DEVICE_LOST) {
if (deviceLost) *deviceLost = true;
unavailable_ = true;
} else if (result != VK_SUCCESS) {
DDFG_LOGE("native: DeviceWaitIdle failed (%d); retaining the input ring", (int)result);
unavailable_ = true;
return false;
}
}
destroySlot(ring_[0]);
destroySlot(ring_[1]);
history_ = 0;
return true;
}
}
+3 -1
View File
@@ -36,13 +36,15 @@ public:
uint32_t width, uint32_t height);
void reset();
bool destroy();
void abandon();
private:
struct Slot { VkImage img = VK_NULL_HANDLE; VkDeviceMemory mem = VK_NULL_HANDLE;
VkImageView view = VK_NULL_HANDLE; bool valid = false; };
bool makeSlot(Slot& s, uint32_t w, uint32_t h, VkFormat fmt);
void destroySlot(Slot& s);
void destroyRing();
bool destroyRing(bool deviceIdleConfirmed = false, bool* deviceLost = nullptr);
uint32_t memType(uint32_t bits, VkMemoryPropertyFlags props) const;
DeviceDispatch dd_{};
+115 -27
View File
@@ -7,6 +7,31 @@
namespace ddfg {
struct ScratchState {
VkDevice ownerDevice = VK_NULL_HANDLE;
VkBuffer synthUbo[ddfg::FrameGen::kSynthSlots]{};
VkDeviceMemory synthUboMem[ddfg::FrameGen::kSynthSlots]{};
void* synthUboPtr[ddfg::FrameGen::kSynthSlots]{};
std::vector<VkBuffer> flowUbo; std::vector<VkDeviceMemory> flowUboMem; std::vector<void*> flowUboPtr;
VkBuffer expandUbo = VK_NULL_HANDLE; VkDeviceMemory expandUboMem = VK_NULL_HANDLE; void* expandUboPtr = nullptr;
VkBuffer flowRegUbo = VK_NULL_HANDLE; VkDeviceMemory flowRegUboMem = VK_NULL_HANDLE; void* flowRegUboPtr = nullptr;
VkBuffer gmUbo[ddfg::FrameGen::kGmSlots]{};
VkDeviceMemory gmUboMem[ddfg::FrameGen::kGmSlots]{};
void* gmUboPtr[ddfg::FrameGen::kGmSlots]{};
VkDescriptorSet sLumaCurr = VK_NULL_HANDLE, sLumaPrev = VK_NULL_HANDLE;
std::vector<VkDescriptorSet> sDownA, sDownB, sFlow;
VkDescriptorSet sExpand[ddfg::FrameGen::kGmSlots]{};
VkDescriptorSet sFlowReg0 = VK_NULL_HANDLE, sFlowRegAB = VK_NULL_HANDLE, sFlowRegBA = VK_NULL_HANDLE;
VkDescriptorSet sSynth[ddfg::FrameGen::kSynthSlots]{};
VkDescriptorSet sGmReduce[ddfg::FrameGen::kGmSlots]{};
std::vector<VkDescriptorSet> sGmPrewarp[ddfg::FrameGen::kGmSlots];
VkExtent2D builtFor{0,0};
uint64_t builtGeneration = 0;
bool built = false;
bool flowInited = false;
bool flowReady = false;
};
#define VKOK(x) do { if ((x) != VK_SUCCESS) { DDFG_LOGE("vk fail: %s", #x); return false; } } while (0)
uint32_t FrameGen::findMemType(uint32_t bits, VkMemoryPropertyFlags props) const {
@@ -108,6 +133,10 @@ static bool buildSetLayout(const DeviceDispatch* dd, VkDevice dev,
bool FrameGen::init(const DeviceDispatch* dd, const InstanceDispatch* id,
VkPhysicalDevice phys, VkDevice dev, uint32_t queueFamily, VkQueue queue) {
if (device_ || completionUnknown_ || deviceLost_) {
DDFG_LOGE("framegen: refusing to initialize an instance that still owns device resources");
return false;
}
dd_ = dd; id_ = id; phys_ = phys; device_ = dev; queueFamily_ = queueFamily; queue_ = queue;
id_->GetPhysicalDeviceMemoryProperties(phys_, &memProps_);
@@ -166,16 +195,19 @@ static VkExtent2D levelExtent(VkExtent2D e, int l) {
}
bool FrameGen::onResize(VkExtent2D extent, VkFormat , bool force) {
if (!force && ready_ && extent.width == extent_.width && extent.height == extent_.height) return true;
if (ready_) {
const VkResult idleResult = dd_->DeviceWaitIdle(device_);
if (idleResult != VK_SUCCESS) {
DDFG_LOGE("framegen resize: DeviceWaitIdle failed (%d); keeping existing images", (int)idleResult);
return false;
}
if (completionUnknown_ || deviceLost_) return false;
if (!device_) {
DDFG_LOGE("framegen: cannot resize before device initialization");
return false;
}
if (!force && ready_ && extent.width == extent_.width && extent.height == extent_.height) return true;
if (ready_ && !waitIdle("resize")) return false;
if (scratch_ && scratch_->ownerDevice != VK_NULL_HANDLE && !destroyScratchResources()) {
DDFG_LOGE("framegen resize: scratch cleanup failed; retaining the previous image set");
return false;
}
ready_ = false;
++imageGeneration_;
for (auto& i : pyrA_) destroyImage(i); pyrA_.clear();
for (auto& i : pyrB_) destroyImage(i); pyrB_.clear();
@@ -183,7 +215,17 @@ bool FrameGen::onResize(VkExtent2D extent, VkFormat , bool force) {
for (auto& i : flowLvl_) destroyImage(i); flowLvl_.clear();
destroyImage(flowExpA_); destroyImage(flowExpB_);
destroyImage(flowRegA_); destroyImage(flowRegB_);
extent_ = extent; ready_ = false;
extent_ = extent;
for (int i = 0; i < 6; ++i) gmRun_[i] = 0.0;
for (int s = 0; s < kGmSlots; ++s) {
gmSlotValid_[s] = false;
for (int i = 0; i < 6; ++i) gmLinAt_[s][i] = 0.0;
}
gmHaveEst_ = false;
gmEngaged_ = false;
gmStableCount_ = 0;
gmLastTransPx_ = 0.0f;
const VkImageUsageFlags lumaUsage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT;
const VkImageUsageFlags flowUsage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
@@ -234,21 +276,37 @@ void FrameGen::initializeImage(VkCommandBuffer cmd, VkImage img, VkImageLayout t
}
void FrameGen::destroy() {
if (!device_) return;
const VkResult idleResult = dd_->DeviceWaitIdle(device_);
if (idleResult != VK_SUCCESS && idleResult != VK_ERROR_DEVICE_LOST) {
DDFG_LOGE("framegen destroy: DeviceWaitIdle failed (%d); preserving resources for safe retry", (int)idleResult);
return;
}
if (idleResult == VK_ERROR_DEVICE_LOST) {
// A lost device cannot become idle again. Still explicitly destroy its
// child objects; skip descriptor-pool reset and release scratch ownership.
DDFG_LOGE("framegen destroy: device lost; releasing owned resources without waiting");
destroyScratchResources(false);
} else {
destroyScratchResources();
bool FrameGen::destroy() {
if (!device_) return true;
if (!deviceLost_) {
// A previous wait failure leaves completion unknown, but a later
// teardown attempt may safely retry the wait before releasing resources.
if (!dd_ || !dd_->DeviceWaitIdle) {
ready_ = false;
completionUnknown_ = true;
DDFG_LOGE("framegen destroy: vkDeviceWaitIdle is unavailable; preserving GPU resources");
return false;
}
const VkResult idleResult = dd_->DeviceWaitIdle(device_);
if (idleResult == VK_SUCCESS) completionUnknown_ = false;
if (idleResult != VK_SUCCESS) {
ready_ = false;
if (idleResult == VK_ERROR_DEVICE_LOST) {
deviceLost_ = true;
DDFG_LOGE("framegen destroy: device lost; releasing owned resources without waiting");
} else {
completionUnknown_ = true;
DDFG_LOGE("framegen destroy: DeviceWaitIdle failed (%d); preserving resources because GPU completion is unknown",
(int)idleResult);
return false;
}
}
}
ready_ = false;
if (descPool_) dd_->DestroyDescriptorPool(device_, descPool_, nullptr);
descPool_ = VK_NULL_HANDLE;
releaseScratch();
for (auto& i : pyrA_) destroyImage(i); pyrA_.clear();
for (auto& i : pyrB_) destroyImage(i); pyrB_.clear();
for (auto& i : pyrAs_) destroyImage(i); pyrAs_.clear();
@@ -260,15 +318,45 @@ void FrameGen::destroy() {
destroyPipe(pGmReduce_); destroyPipe(pGmPrewarp_);
destroyPipe(pFlowReg_);
for (int s = 0; s < kGmSlots; ++s) {
if (gmSsboMem_[s]) dd_->UnmapMemory(device_, gmSsboMem_[s]);
if (gmSsboPtr_[s] && gmSsboMem_[s]) dd_->UnmapMemory(device_, gmSsboMem_[s]);
if (gmSsbo_[s]) dd_->DestroyBuffer(device_, gmSsbo_[s], nullptr);
if (gmSsboMem_[s]) dd_->FreeMemory(device_, gmSsboMem_[s], nullptr);
gmSsbo_[s] = VK_NULL_HANDLE; gmSsboMem_[s] = VK_NULL_HANDLE; gmSsboPtr_[s] = nullptr;
}
gmBuffersReady_ = false;
if (descPool_) dd_->DestroyDescriptorPool(device_, descPool_, nullptr);
if (linear_) dd_->DestroySampler(device_, linear_, nullptr);
descPool_ = VK_NULL_HANDLE; linear_ = VK_NULL_HANDLE; device_ = VK_NULL_HANDLE; ready_ = false;
linear_ = VK_NULL_HANDLE;
device_ = VK_NULL_HANDLE;
ready_ = false;
deviceLost_ = false;
return true;
}
void FrameGen::abandon() {
device_ = VK_NULL_HANDLE;
dd_ = nullptr;
id_ = nullptr;
phys_ = VK_NULL_HANDLE;
queue_ = VK_NULL_HANDLE;
linear_ = VK_NULL_HANDLE;
descPool_ = VK_NULL_HANDLE;
scratch_.reset();
pyrA_.clear(); pyrB_.clear(); pyrAs_.clear(); flowLvl_.clear();
flowExpA_ = Img{}; flowExpB_ = Img{};
flowRegA_ = Img{}; flowRegB_ = Img{};
pLuma_ = Pipe{}; pDown_ = Pipe{}; pFlow_ = Pipe{}; pFlowM4_ = Pipe{};
pExpand_ = Pipe{}; pExpandM4_ = Pipe{}; pSynth_ = Pipe{};
pGmReduce_ = Pipe{}; pGmPrewarp_ = Pipe{}; pFlowReg_ = Pipe{};
for (int s = 0; s < kGmSlots; ++s) {
gmSsbo_[s] = VK_NULL_HANDLE;
gmSsboMem_[s] = VK_NULL_HANDLE;
gmSsboPtr_[s] = nullptr;
gmSlotValid_[s] = false;
}
gmBuffersReady_ = false;
ready_ = false;
completionUnknown_ = false;
deviceLost_ = false;
}
}
+16 -2
View File
@@ -1,12 +1,20 @@
#pragma once
#include "vk_dispatch.hpp"
#include "config.hpp"
#include <memory>
#include <vector>
namespace ddfg {
struct ScratchState;
class FrameGen {
public:
FrameGen();
~FrameGen();
FrameGen(const FrameGen&) = delete;
FrameGen& operator=(const FrameGen&) = delete;
bool init(const DeviceDispatch* dd, const InstanceDispatch* id,
VkPhysicalDevice phys, VkDevice dev, uint32_t queueFamily, VkQueue queue);
void configure(const Config& c);
@@ -14,7 +22,8 @@ public:
void record(VkCommandBuffer cmd, VkImageView prevView, VkImageView currView,
VkImageView outView, float alpha, uint32_t gmSlot = 0,
uint32_t synthSlot = 0, bool reuseFlow = false);
void destroy();
bool destroy();
void abandon();
bool valid() const { return device_ != VK_NULL_HANDLE && ready_; }
const Config& config() const { return cfg_; }
@@ -64,7 +73,9 @@ private:
void destroyPipe(Pipe& p);
void barrier(VkCommandBuffer cmd, VkImage img, VkImageLayout from, VkImageLayout to);
void initializeImage(VkCommandBuffer cmd, VkImage img, VkImageLayout to);
void destroyScratchResources(bool resetPool = true);
bool waitIdle(const char* operation);
bool destroyScratchResources(bool resetPool = true);
void releaseScratch();
const DeviceDispatch* dd_ = nullptr;
const InstanceDispatch* id_ = nullptr;
@@ -80,7 +91,10 @@ private:
VkExtent2D extent_{};
uint64_t imageGeneration_ = 0;
bool ready_ = false;
bool completionUnknown_ = false;
bool deviceLost_ = false;
int flowFinest_ = kFlowFinestDefault;
std::unique_ptr<ScratchState> scratch_;
Pipe pLuma_, pDown_, pFlow_, pFlowM4_, pExpand_, pExpandM4_, pSynth_;
Pipe pGmReduce_, pGmPrewarp_;
+95 -89
View File
@@ -1,33 +1,7 @@
namespace {
struct ScratchState {
VkDevice ownerDevice = VK_NULL_HANDLE;
VkBuffer synthUbo[ddfg::FrameGen::kSynthSlots]{};
VkDeviceMemory synthUboMem[ddfg::FrameGen::kSynthSlots]{};
void* synthUboPtr[ddfg::FrameGen::kSynthSlots]{};
std::vector<VkBuffer> flowUbo; std::vector<VkDeviceMemory> flowUboMem; std::vector<void*> flowUboPtr;
VkBuffer expandUbo = VK_NULL_HANDLE; VkDeviceMemory expandUboMem = VK_NULL_HANDLE; void* expandUboPtr = nullptr;
VkBuffer flowRegUbo = VK_NULL_HANDLE; VkDeviceMemory flowRegUboMem = VK_NULL_HANDLE; void* flowRegUboPtr = nullptr;
VkBuffer gmUbo[ddfg::FrameGen::kGmSlots]{};
VkDeviceMemory gmUboMem[ddfg::FrameGen::kGmSlots]{};
void* gmUboPtr[ddfg::FrameGen::kGmSlots]{};
VkDescriptorSet sLumaCurr = VK_NULL_HANDLE, sLumaPrev = VK_NULL_HANDLE;
std::vector<VkDescriptorSet> sDownA, sDownB, sFlow;
VkDescriptorSet sExpand[ddfg::FrameGen::kGmSlots]{};
VkDescriptorSet sFlowReg0 = VK_NULL_HANDLE, sFlowRegAB = VK_NULL_HANDLE, sFlowRegBA = VK_NULL_HANDLE;
VkDescriptorSet sSynth[ddfg::FrameGen::kSynthSlots]{};
VkDescriptorSet sGmReduce[ddfg::FrameGen::kGmSlots]{};
std::vector<VkDescriptorSet> sGmPrewarp[ddfg::FrameGen::kGmSlots];
VkExtent2D builtFor{0,0};
uint64_t builtGeneration = 0;
bool built = false;
bool flowInited = false;
bool flowReady = false;
};
ScratchState g_scratch;
namespace ddfg {
FrameGen::FrameGen() : scratch_(std::make_unique<ScratchState>()) {}
FrameGen::~FrameGen() { (void)destroy(); }
}
static bool makeUbo(const ddfg::DeviceDispatch* dd, VkDevice dev,
@@ -144,7 +118,7 @@ static void mulAff(const double A[3][3], const double B[3][3], double out[3][3])
namespace ddfg {
static bool ensureScratch(FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
static bool ensureScratch(ScratchState& S, FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
const VkPhysicalDeviceMemoryProperties& mp, VkDescriptorPool pool,
VkSampler samp, VkExtent2D ext,
std::vector<FrameGen::Img>& pyrA, std::vector<FrameGen::Img>& pyrB,
@@ -157,30 +131,72 @@ static bool ensureScratch(FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
FrameGen::Img& flowRegA, FrameGen::Img& flowRegB, VkBuffer* gmSsbo,
int kLevels, const Config& cfg, uint64_t imageGeneration);
static void destroyScratch(const DeviceDispatch* dd, VkDevice dev, VkDescriptorPool pool,
bool resetPool = true) {
if (g_scratch.ownerDevice != VK_NULL_HANDLE && g_scratch.ownerDevice != dev) return;
bool FrameGen::waitIdle(const char* operation) {
if (completionUnknown_ || deviceLost_ || !device_) return false;
if (!dd_ || !dd_->DeviceWaitIdle) {
completionUnknown_ = true;
ready_ = false;
DDFG_LOGE("framegen: %s cannot confirm GPU completion; this instance is stopped and its resources are retained",
operation);
return false;
}
const VkResult result = dd_->DeviceWaitIdle(device_);
if (result == VK_SUCCESS) return true;
ready_ = false;
if (result == VK_ERROR_DEVICE_LOST) {
deviceLost_ = true;
DDFG_LOGE("framegen: %s reported device loss; cleanup will skip further waits", operation);
} else {
completionUnknown_ = true;
DDFG_LOGE("framegen: %s vkDeviceWaitIdle failed (%d); this instance is stopped and its GPU resources retained",
operation, (int)result);
}
return false;
}
bool FrameGen::destroyScratchResources(bool resetPool) {
if (!scratch_) return true;
if (resetPool && descPool_ && !deviceLost_) {
if (!dd_ || !dd_->ResetDescriptorPool) {
ready_ = false;
DDFG_LOGE("framegen: descriptor-pool reset is unavailable; retaining scratch resources");
return false;
}
const VkResult result = dd_->ResetDescriptorPool(device_, descPool_, 0);
if (result != VK_SUCCESS) {
ready_ = false;
if (result == VK_ERROR_DEVICE_LOST) deviceLost_ = true;
DDFG_LOGE("framegen: descriptor-pool reset failed (%d); retaining scratch resources",
(int)result);
return false;
}
}
releaseScratch();
return true;
}
void FrameGen::releaseScratch() {
if (!scratch_) return;
auto& S = *scratch_;
auto freeUbo = [&](VkBuffer& b, VkDeviceMemory& m, void*& p) {
if (m) dd->UnmapMemory(dev, m);
if (b) dd->DestroyBuffer(dev, b, nullptr);
if (m) dd->FreeMemory(dev, m, nullptr);
b = VK_NULL_HANDLE; m = VK_NULL_HANDLE; p = nullptr;
if (p && m) dd_->UnmapMemory(device_, m);
if (b) dd_->DestroyBuffer(device_, b, nullptr);
if (m) dd_->FreeMemory(device_, m, nullptr);
b = VK_NULL_HANDLE;
m = VK_NULL_HANDLE;
p = nullptr;
};
auto& S = g_scratch;
for (int s = 0; s < FrameGen::kSynthSlots; ++s) freeUbo(S.synthUbo[s], S.synthUboMem[s], S.synthUboPtr[s]);
freeUbo(S.expandUbo, S.expandUboMem, S.expandUboPtr);
freeUbo(S.expandUbo, S.expandUboMem, S.expandUboPtr);
freeUbo(S.flowRegUbo, S.flowRegUboMem, S.flowRegUboPtr);
for (size_t i = 0; i < S.flowUbo.size(); ++i) freeUbo(S.flowUbo[i], S.flowUboMem[i], S.flowUboPtr[i]);
for (int s = 0; s < FrameGen::kGmSlots; ++s) freeUbo(S.gmUbo[s], S.gmUboMem[s], S.gmUboPtr[s]);
if (resetPool && pool && dd->ResetDescriptorPool) dd->ResetDescriptorPool(dev, pool, 0);
S = ScratchState{};
}
void FrameGen::destroyScratchResources(bool resetPool) {
destroyScratch(dd_, device_, descPool_, resetPool);
}
void FrameGen::configure(const Config& c) {
if (completionUnknown_ || deviceLost_) return;
Config nextCfg = c;
nextCfg.sanitize();
int want = flowFinestForPreset(nextCfg.perfPreset);
@@ -203,16 +219,12 @@ void FrameGen::configure(const Config& c) {
return;
}
// Keep the previous configuration and image set if the device cannot idle.
const VkResult idleResult = dd_->DeviceWaitIdle(device_);
if (idleResult != VK_SUCCESS) {
DDFG_LOGE("framegen configure: DeviceWaitIdle failed (%d); keeping previous configuration and images",
(int)idleResult);
if (!waitIdle("live preset rebuild")) return;
if (scratch_ && scratch_->ownerDevice != VK_NULL_HANDLE && !destroyScratchResources()) {
DDFG_LOGE("perf-preset live rebuild: scratch cleanup failed; keeping the previous configuration");
return;
}
// The device is idle, so reset motion history before rebuilding. This
// also leaves the predictor reset if onResize fails.
for (int i = 0; i < 6; ++i) gmRun_[i] = 0.0;
for (int s = 0; s < kGmSlots; ++s) {
gmSlotValid_[s] = false;
@@ -223,20 +235,17 @@ void FrameGen::configure(const Config& c) {
gmStableCount_ = 0;
gmLastTransPx_ = 0.0f;
// Prevent onResize from issuing a second wait.
destroyScratch(dd_, device_, descPool_);
cfg_ = nextCfg;
flowFinest_ = want;
ready_ = false;
if (!onResize(extent_, VK_FORMAT_UNDEFINED, true)) {
ready_ = false;
DDFG_LOGE("perf-preset live rebuild: onResize FAILED at %ux%u - FG disabled until next resize",
DDFG_LOGE("perf-preset live rebuild: onResize FAILED at %ux%u - frame generation unavailable",
extent_.width, extent_.height);
return;
}
DDFG_LOGI("perf-preset live rebuild DONE (kFlowFinest=%d, flow predictor reset)", flowFinest_);
}
bool FrameGen::updateGlobalMotion(uint32_t gmSlot, VkExtent2D fullExtent) {
++gmFrames_;
if (!gmBuffersReady_ || cfg_.gmMode == 2 ) {
@@ -306,35 +315,33 @@ bool FrameGen::updateGlobalMotion(uint32_t gmSlot, VkExtent2D fullExtent) {
void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView currView,
VkImageView outView, float alpha, uint32_t gmSlot, uint32_t synthSlot, bool reuseFlow) {
if (!valid()) return;
auto& S = *scratch_;
if (gmSlot >= (uint32_t)kGmSlots) gmSlot = 0;
if (synthSlot >= (uint32_t)kSynthSlots) synthSlot = 0;
const bool m4 = (cfg_.model == 4);
const Pipe& flowP = m4 ? pFlowM4_ : pFlow_;
const Pipe& expandP = m4 ? pExpandM4_ : pExpand_;
if (!g_scratch.built || g_scratch.builtFor.width != extent_.width ||
g_scratch.builtFor.height != extent_.height ||
g_scratch.builtGeneration != imageGeneration_) {
if (g_scratch.built) {
const VkResult idleResult = dd_->DeviceWaitIdle(device_);
if (idleResult != VK_SUCCESS) {
DDFG_LOGE("framegen record: DeviceWaitIdle failed (%d); skipping scratch rebuild", (int)idleResult);
return;
}
destroyScratch(dd_, device_, descPool_);
if (!S.built || S.builtFor.width != extent_.width ||
S.builtFor.height != extent_.height ||
S.builtGeneration != imageGeneration_) {
if (S.built && !waitIdle("scratch rebuild")) return;
if (S.ownerDevice != VK_NULL_HANDLE && !destroyScratchResources()) {
DDFG_LOGE("framegen record: scratch cleanup failed; skipping this frame");
return;
}
if (!ensureScratch(this, dd_, device_, memProps_, descPool_, linear_, extent_,
if (!ensureScratch(S, this, dd_, device_, memProps_, descPool_, linear_, extent_,
pyrA_, pyrB_, pyrAs_, flowLvl_, flowExpA_, flowExpB_,
pLuma_, pDown_, flowP, expandP, pSynth_, pGmReduce_, pGmPrewarp_,
pFlowReg_, flowRegA_, flowRegB_, gmSsbo_, kLevels, cfg_, imageGeneration_))
return;
}
if (g_scratch.ownerDevice != device_) return;
if (reuseFlow && !g_scratch.flowReady) return;
if (S.ownerDevice != device_) return;
if (reuseFlow && !S.flowReady) return;
if (!reuseFlow) {
bool gmEngaged = updateGlobalMotion(gmSlot, extent_);
if (g_scratch.gmUboPtr[gmSlot]) {
if (S.gmUboPtr[gmSlot]) {
GMUBO g{};
g.lin[0]=(float)gmRun_[0]; g.lin[1]=(float)gmRun_[1]; g.lin[2]=(float)gmRun_[2]; g.lin[3]=(float)gmRun_[3];
g.linT[0]=(float)gmRun_[4]; g.linT[1]=(float)gmRun_[5]; g.linT[2]=gmEngaged?1.0f:0.0f; g.linT[3]=0.0f;
@@ -342,7 +349,7 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
g.app[0]=(float)gmRun_[0]; g.app[1]=(float)gmRun_[1]; g.app[2]=(float)gmRun_[2]; g.app[3]=(float)gmRun_[3];
g.appT[0]=(float)gmRun_[4]; g.appT[1]=(float)gmRun_[5];
}
std::memcpy(g_scratch.gmUboPtr[gmSlot], &g, sizeof(g));
std::memcpy(S.gmUboPtr[gmSlot], &g, sizeof(g));
}
{
static int lastEng = -1;
@@ -353,7 +360,7 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
}
}
const VkDescriptorSet lumaSets[] = {g_scratch.sLumaCurr, g_scratch.sLumaPrev};
const VkDescriptorSet lumaSets[] = {S.sLumaCurr, S.sLumaPrev};
const uint32_t lumaBindings[] = {32, 32};
const VkDescriptorType lumaTypes[] = {
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER};
@@ -367,9 +374,9 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
SynthUBO su{cfg_.flowScale, alpha, cfg_.beta, cfg_.lambda, cfg_.epsilon, cfg_.photoScale, 0, 0,
cfg_.hudX0, cfg_.hudY0, cfg_.hudX1, cfg_.hudY1};
if (g_scratch.synthUboPtr[synthSlot]) std::memcpy(g_scratch.synthUboPtr[synthSlot], &su, sizeof(su));
if (S.synthUboPtr[synthSlot]) std::memcpy(S.synthUboPtr[synthSlot], &su, sizeof(su));
const VkDescriptorSet synthSet = g_scratch.sSynth[synthSlot];
const VkDescriptorSet synthSet = S.sSynth[synthSlot];
const VkDescriptorSet synthSets[] = {synthSet, synthSet, synthSet};
const uint32_t synthBindings[] = {32, 33, 48};
const VkDescriptorType synthTypes[] = {
@@ -468,17 +475,17 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, 0, nullptr, 1, &b);
}
disp(pLuma_, g_scratch.sLumaCurr, levelExtent(extent_, 0));
disp(pLuma_, g_scratch.sLumaPrev, levelExtent(extent_, 0));
disp(pLuma_, S.sLumaCurr, levelExtent(extent_, 0));
disp(pLuma_, S.sLumaPrev, levelExtent(extent_, 0));
barPair(pyrA_[0], pyrB_[0]);
for (int l = 1; l < kLevels; ++l) {
disp(pDown_, g_scratch.sDownA[l - 1], levelExtent(extent_, l));
disp(pDown_, g_scratch.sDownB[l - 1], levelExtent(extent_, l));
disp(pDown_, S.sDownA[l - 1], levelExtent(extent_, l));
disp(pDown_, S.sDownB[l - 1], levelExtent(extent_, l));
barPair(pyrA_[l], pyrB_[l]);
}
if (gmBuffersReady_ && g_scratch.sGmReduce[gmSlot]) {
if (gmBuffersReady_ && S.sGmReduce[gmSlot]) {
dd_->CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pGmReduce_.pipeline);
dd_->CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pGmReduce_.layout, 0, 1, &g_scratch.sGmReduce[gmSlot], 0, nullptr);
dd_->CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pGmReduce_.layout, 0, 1, &S.sGmReduce[gmSlot], 0, nullptr);
dd_->CmdDispatch(cmd, (uint32_t)(kGmThreads / 64), 1, 1);
VkMemoryBarrier mb{VK_STRUCTURE_TYPE_MEMORY_BARRIER};
mb.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; mb.dstAccessMask = VK_ACCESS_HOST_READ_BIT;
@@ -486,27 +493,27 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
0, 1, &mb, 0, nullptr, 0, nullptr);
}
for (int l = flowFinest_; l < kLevels; ++l) {
disp(pGmPrewarp_, g_scratch.sGmPrewarp[gmSlot][l], levelExtent(extent_, l));
disp(pGmPrewarp_, S.sGmPrewarp[gmSlot][l], levelExtent(extent_, l));
bar(pyrAs_[l]);
}
for (int l = kLevels - 1; l >= flowFinest_; --l) {
disp(flowP, g_scratch.sFlow[l], levelExtent(extent_, l));
disp(flowP, S.sFlow[l], levelExtent(extent_, l));
bar(flowLvl_[l]);
}
if (frEngaged) {
const int F = flowFinest_;
const VkExtent2D fe = levelExtent(extent_, F);
if (g_scratch.flowRegUboPtr) {
if (S.flowRegUboPtr) {
FlowRegUBO fu{cfg_.frDt, cfg_.frLambda, cfg_.frEdge, cfg_.frEps};
std::memcpy(g_scratch.flowRegUboPtr, &fu, sizeof(fu));
std::memcpy(S.flowRegUboPtr, &fu, sizeof(fu));
}
FrameGen::Img* last = nullptr;
for (int it = 0; it < cfg_.frIters; ++it) {
VkDescriptorSet set; FrameGen::Img* outImg;
if (it == 0) { set = g_scratch.sFlowReg0; outImg = &flowRegA_; }
else if (it % 2 == 1) { set = g_scratch.sFlowRegAB; outImg = &flowRegB_; }
else { set = g_scratch.sFlowRegBA; outImg = &flowRegA_; }
if (it == 0) { set = S.sFlowReg0; outImg = &flowRegA_; }
else if (it % 2 == 1) { set = S.sFlowRegAB; outImg = &flowRegB_; }
else { set = S.sFlowRegBA; outImg = &flowRegA_; }
dd_->CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pFlowReg_.pipeline);
dd_->CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pFlowReg_.layout, 0, 1, &set, 0, nullptr);
dd_->CmdDispatch(cmd, (fe.width + 15) / 16, (fe.height + 15) / 16, 1);
@@ -540,14 +547,14 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
}
}
disp(expandP, g_scratch.sExpand[gmSlot], levelExtent(extent_, 0));
disp(expandP, S.sExpand[gmSlot], levelExtent(extent_, 0));
barPair(flowExpA_, flowExpB_);
g_scratch.flowReady = true;
S.flowReady = true;
}
disp(pSynth_, synthSet, levelExtent(extent_, 0));
}
static bool ensureScratch(FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
static bool ensureScratch(ScratchState& S, FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
const VkPhysicalDeviceMemoryProperties& mp, VkDescriptorPool pool,
VkSampler samp, VkExtent2D ext,
std::vector<FrameGen::Img>& pyrA, std::vector<FrameGen::Img>& pyrB,
@@ -559,7 +566,6 @@ static bool ensureScratch(FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
const FrameGen::Pipe& pGmPrewarp, const FrameGen::Pipe& pFlowReg,
FrameGen::Img& flowRegA, FrameGen::Img& flowRegB, VkBuffer* gmSsbo,
int kLevels, const Config& cfg, uint64_t imageGeneration) {
auto& S = g_scratch;
if (S.ownerDevice != VK_NULL_HANDLE && S.ownerDevice != dev) return false;
S = ScratchState{};
S.ownerDevice = dev;
+286 -39
View File
@@ -242,6 +242,10 @@ struct surface {
enum surface_role role;
struct wl_resource *idle_buffer;
struct wl_listener idle_buffer_destroy;
struct surface_state *waiting;
struct wl_event_source *waiting_source, *waiting_timer;
int waiting_fd;
int64_t waiting_since_ns;
uint32_t *idle_px;
int idle_w, idle_h;
struct wl_resource *xdg_surface, *xdg_toplevel;
@@ -373,6 +377,8 @@ static struct {
unsigned copy_scenes;
unsigned releases, releases_held;
int64_t release_ns, release_max_ns;
unsigned commit_waits, commit_wait_limits;
int64_t commit_wait_ns, commit_wait_max_ns;
} g_perf;
static void schedule_render(void);
@@ -846,6 +852,55 @@ static void on_pending_buffer_destroyed(struct wl_listener *l, void *data) {
s->pending_buffer = NULL;
}
struct surface_state {
struct wl_resource *buffer;
struct wl_listener buffer_destroy;
int attach;
int src_set, dst_set, opaque_set;
float src[4];
int dst[2], opaque[4];
struct damage_list damage_buf, damage_local;
struct wl_list frames, feedback;
};
static void on_state_buffer_destroyed(struct wl_listener *l, void *data) {
struct surface_state *st = wl_container_of(l, st, buffer_destroy);
wl_list_remove(&st->buffer_destroy.link);
wl_list_init(&st->buffer_destroy.link);
st->buffer = NULL;
st->attach = 0;
}
static void surface_state_take(struct surface *s, struct surface_state *st) {
st->attach = s->pending_attach;
st->buffer = s->pending_buffer;
wl_list_init(&st->buffer_destroy.link);
if (st->buffer) {
wl_list_remove(&s->pending_buffer_destroy.link);
wl_list_init(&s->pending_buffer_destroy.link);
st->buffer_destroy.notify = on_state_buffer_destroyed;
wl_resource_add_destroy_listener(st->buffer, &st->buffer_destroy);
}
s->pending_buffer = NULL;
s->pending_attach = 0;
st->src_set = s->pending_src_set;
memcpy(st->src, s->pending_src, sizeof(st->src));
st->dst_set = s->pending_dst_set;
memcpy(st->dst, s->pending_dst, sizeof(st->dst));
st->opaque_set = s->pending_opaque_set;
memcpy(st->opaque, s->pending_opaque, sizeof(st->opaque));
s->pending_src_set = s->pending_dst_set = s->pending_opaque_set = 0;
st->damage_buf = s->pending_damage_buf;
st->damage_local = s->pending_damage_local;
s->pending_damage_buf.n = s->pending_damage_local.n = 0;
wl_list_init(&st->frames);
wl_list_insert_list(&st->frames, &s->pending_frames);
wl_list_init(&s->pending_frames);
wl_list_init(&st->feedback);
wl_list_insert_list(&st->feedback, &s->pending_feedback);
wl_list_init(&s->pending_feedback);
}
static void fire_frames(struct wl_list *frames) {
struct wl_resource *cb, *tmp;
uint32_t t;
@@ -1363,35 +1418,23 @@ static void surface_drop_idle(struct surface *s) {
if (buffer) send_buffer_release(buffer);
}
static void surface_commit(struct wl_client *c, struct wl_resource *r) {
struct surface *s = wl_resource_get_user_data(r);
static void surface_state_apply(struct surface *s, struct surface_state *st) {
struct surface *child;
if (s->xdg_toplevel && !s->toplevel_committed) {
s->toplevel_committed = 1;
send_toplevel_configure(s);
if (st->src_set) {
s->src_set = st->src[2] > 0;
memcpy(s->src, st->src, sizeof(s->src));
}
if (st->dst_set) {
s->dst_set = st->dst[0] > 0;
memcpy(s->dst, st->dst, sizeof(s->dst));
}
if (st->opaque_set) memcpy(s->opaque, st->opaque, sizeof(s->opaque));
if (s->pending_src_set) {
s->src_set = s->pending_src[2] > 0;
memcpy(s->src, s->pending_src, sizeof(s->src));
s->pending_src_set = 0;
}
if (s->pending_dst_set) {
s->dst_set = s->pending_dst[0] > 0;
memcpy(s->dst, s->pending_dst, sizeof(s->dst));
s->pending_dst_set = 0;
}
if (s->pending_opaque_set) {
memcpy(s->opaque, s->pending_opaque, sizeof(s->opaque));
s->pending_opaque_set = 0;
}
s->damage_buf = s->pending_damage_buf;
s->damage_local = s->pending_damage_local;
s->pending_damage_buf.n = s->pending_damage_local.n = 0;
if (s->pending_attach) {
struct wl_resource *buffer = s->pending_buffer;
s->damage_buf = st->damage_buf;
s->damage_local = st->damage_local;
if (st->attach) {
struct wl_resource *buffer = st->buffer;
struct dmabuf_buffer *db = get_dmabuf(buffer);
struct wl_shm_buffer *shm = buffer && !db ? wl_shm_buffer_get(buffer) : NULL;
uint8_t pixel[4];
@@ -1400,12 +1443,10 @@ static void surface_commit(struct wl_client *c, struct wl_resource *r) {
if (!buffer) g_pace.null_attaches++;
else if (!db) s->last_dmabuf = NULL;
if (buffer) {
wl_list_remove(&s->pending_buffer_destroy.link);
wl_list_init(&s->pending_buffer_destroy.link);
}
s->pending_buffer = NULL;
s->pending_attach = 0;
wl_list_remove(&st->buffer_destroy.link);
wl_list_init(&st->buffer_destroy.link);
st->buffer = NULL;
st->attach = 0;
surface_drop_idle(s);
buf_trace_attach(buffer);
@@ -1442,10 +1483,10 @@ static void surface_commit(struct wl_client *c, struct wl_resource *r) {
}
}
wl_list_insert_list(s->frames.prev, &s->pending_frames);
wl_list_init(&s->pending_frames);
wl_list_insert_list(s->feedback.prev, &s->pending_feedback);
wl_list_init(&s->pending_feedback);
wl_list_insert_list(s->frames.prev, &st->frames);
wl_list_init(&st->frames);
wl_list_insert_list(s->feedback.prev, &st->feedback);
wl_list_init(&st->feedback);
constraints_surface_commit(s);
droiddeck_color_commit(s->resource);
@@ -1455,6 +1496,186 @@ static void surface_commit(struct wl_client *c, struct wl_resource *r) {
}
schedule_render();
}
#define COMMIT_WAIT_LIMIT_MS 1000
static struct surface *g_zero_copy_shown, *g_unwaited;
static int state_unfinished_fd(const struct surface *s, const struct surface_state *st, int *unwaited) {
struct dmabuf_buffer *db = st->attach ? get_dmabuf(st->buffer) : NULL;
int fd = -1;
*unwaited = 0;
for (int i = 0; db && fd < 0 && i < db->n_planes; i++) {
if (db->fd[i] < 0) continue;
struct pollfd p = {.fd = db->fd[i], .events = POLLIN};
int r;
do { r = poll(&p, 1, 0); } while (r < 0 && errno == EINTR);
if (r == 0) fd = db->fd[i];
}
if (fd >= 0 && s == g_zero_copy_shown && ahb_swapchain_has_ahb(db)) {
*unwaited = 1;
return -1;
}
return fd;
}
static void settle_unwaited(void) {
struct surface *s = g_unwaited;
if (!s) return;
g_unwaited = NULL;
struct dmabuf_buffer *db = s->dmabuf_buf;
const int64_t deadline = now_ns() + 100000000LL;
for (int i = 0; db && i < db->n_planes; i++) {
if (db->fd[i] < 0) continue;
struct pollfd p = {.fd = db->fd[i], .events = POLLIN};
for (;;) {
const int64_t left = deadline - now_ns();
const int r = poll(&p, 1, left > 0 ? (int)((left + 999999) / 1000000) : 0);
if (r >= 0 || errno != EINTR || left <= 0) break;
}
}
}
static void surface_state_discard(struct surface_state *st) {
struct wl_resource *cb, *tmp;
wl_list_remove(&st->buffer_destroy.link);
wl_resource_for_each_safe(cb, tmp, &st->frames) wl_resource_destroy(cb);
feedback_discard_all(&st->feedback);
free(st);
}
static void surface_state_merge(struct surface_state *older, struct surface_state *newer) {
if (older->attach && !newer->attach) {
newer->attach = 1;
newer->buffer = older->buffer;
wl_list_remove(&older->buffer_destroy.link);
wl_list_init(&older->buffer_destroy.link);
if (newer->buffer) {
newer->buffer_destroy.notify = on_state_buffer_destroyed;
wl_resource_add_destroy_listener(newer->buffer, &newer->buffer_destroy);
}
wl_list_insert_list(&newer->feedback, &older->feedback);
wl_list_init(&older->feedback);
} else if (older->attach) {
if (older->buffer && older->buffer != newer->buffer) send_buffer_release(older->buffer);
g_pace.replaced += feedback_discard_all(&older->feedback);
}
if (older->src_set && !newer->src_set) {
newer->src_set = 1;
memcpy(newer->src, older->src, sizeof(newer->src));
}
if (older->dst_set && !newer->dst_set) {
newer->dst_set = 1;
memcpy(newer->dst, older->dst, sizeof(newer->dst));
}
if (older->opaque_set && !newer->opaque_set) {
newer->opaque_set = 1;
memcpy(newer->opaque, older->opaque, sizeof(newer->opaque));
}
for (int i = 0; i < older->damage_buf.n; i++)
note_damage(&newer->damage_buf, older->damage_buf.r[i][0], older->damage_buf.r[i][1],
older->damage_buf.r[i][2], older->damage_buf.r[i][3]);
for (int i = 0; i < older->damage_local.n; i++)
note_damage(&newer->damage_local, older->damage_local.r[i][0], older->damage_local.r[i][1],
older->damage_local.r[i][2], older->damage_local.r[i][3]);
wl_list_insert_list(&newer->frames, &older->frames);
wl_list_init(&older->frames);
surface_state_discard(older);
}
static void surface_wait_stop(struct surface *s) {
if (s->waiting_source) wl_event_source_remove(s->waiting_source);
if (s->waiting_timer) wl_event_source_remove(s->waiting_timer);
if (s->waiting_fd >= 0) close(s->waiting_fd);
s->waiting_source = s->waiting_timer = NULL;
s->waiting_fd = -1;
}
static void surface_wait_end(struct surface *s, int over_limit) {
struct surface_state *st = s->waiting;
if (!st) return;
surface_wait_stop(s);
s->waiting = NULL;
const int64_t waited = now_ns() - s->waiting_since_ns;
g_perf.commit_waits++;
g_perf.commit_wait_ns += waited;
if (waited > g_perf.commit_wait_max_ns) g_perf.commit_wait_max_ns = waited;
if (over_limit) g_perf.commit_wait_limits++;
if (st->attach && g_unwaited == s) g_unwaited = NULL;
surface_state_apply(s, st);
free(st);
}
static int on_commit_ready(int fd, uint32_t mask, void *data) {
surface_wait_end(data, 0);
return 0;
}
static int on_commit_wait_limit(void *data) {
static int said;
if (!said) {
said = 1;
droiddeck_log("compositor", "a client's GPU writes ran past %d ms; its frame is shown as it is", COMMIT_WAIT_LIMIT_MS);
}
surface_wait_end(data, 1);
return 0;
}
static int surface_wait_start(struct surface *s, int fd, int timeout_ms) {
struct wl_event_loop *loop = wl_display_get_event_loop(g_display);
s->waiting_fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
if (s->waiting_fd >= 0) {
s->waiting_source = wl_event_loop_add_fd(loop, s->waiting_fd, WL_EVENT_READABLE, on_commit_ready, s);
s->waiting_timer = wl_event_loop_add_timer(loop, on_commit_wait_limit, s);
}
if (!s->waiting_source || !s->waiting_timer ||
wl_event_source_timer_update(s->waiting_timer, timeout_ms) != 0) {
surface_wait_stop(s);
return -1;
}
return 0;
}
static void surface_commit(struct wl_client *c, struct wl_resource *r) {
struct surface *s = wl_resource_get_user_data(r);
if (s->xdg_toplevel && !s->toplevel_committed) {
s->toplevel_committed = 1;
send_toplevel_configure(s);
}
struct surface_state *st = calloc(1, sizeof(*st));
if (!st) {
struct surface_state now;
surface_state_take(s, &now);
surface_state_apply(s, &now);
return;
}
surface_state_take(s, st);
const int was_waiting = s->waiting != NULL;
if (was_waiting) {
surface_wait_stop(s);
surface_state_merge(s->waiting, st);
s->waiting = NULL;
}
int unwaited;
const int fd = state_unfinished_fd(s, st, &unwaited);
if (!was_waiting) s->waiting_since_ns = now_ns();
const int64_t left_ms = COMMIT_WAIT_LIMIT_MS - (now_ns() - s->waiting_since_ns) / 1000000;
if (fd >= 0 && left_ms > 0 && surface_wait_start(s, fd, (int)left_ms) == 0) {
s->waiting = st;
return;
}
const int attaches = st->attach;
if (was_waiting) {
s->waiting = st;
surface_wait_end(s, fd >= 0 && left_ms <= 0);
} else {
surface_state_apply(s, st);
free(st);
}
if (unwaited) g_unwaited = s;
else if (attaches && g_unwaited == s) g_unwaited = NULL;
}
static void surface_set_buffer_transform(struct wl_client *c, struct wl_resource *r, int32_t t) {}
static void surface_set_buffer_scale(struct wl_client *c, struct wl_resource *r, int32_t s) {}
static void surface_damage_buffer(struct wl_client *c, struct wl_resource *r,
@@ -1516,6 +1737,13 @@ static void surface_resource_destroy(struct wl_resource *r) {
child->parent = NULL;
}
if (s->pending_buffer) wl_list_remove(&s->pending_buffer_destroy.link);
if (s->waiting) {
surface_wait_stop(s);
surface_state_discard(s->waiting);
s->waiting = NULL;
}
if (g_zero_copy_shown == s) g_zero_copy_shown = NULL;
if (g_unwaited == s) g_unwaited = NULL;
pending_releases_forget_surface(s);
drop_dmabuf(s, 0);
ahb_swapchain_surface_gone(s);
@@ -1579,6 +1807,7 @@ static void compositor_create_surface(struct wl_client *c, struct wl_resource *r
wl_list_init(&s->child_link);
wl_list_init(&s->toplevel_link);
wl_list_init(&s->pending_buffer_destroy.link);
s->waiting_fd = -1;
wl_list_init(&s->idle_buffer_destroy.link);
wl_list_insert(&g_surfaces, &s->link);
wl_resource_set_implementation(s->resource, &surface_impl, s, surface_resource_destroy);
@@ -2502,7 +2731,13 @@ static int64_t scene_next_due(int64_t now, int64_t due, int limit) {
static void render_scene(void) {
g_scene_due_ns = scene_next_due(now_ns(), g_scene_due_ns, g_fps_limit);
if (atomic_load(&g_stream_on)) { g_dirty_since_ns = 0; render_stream(); return; }
if (atomic_load(&g_stream_on)) {
g_dirty_since_ns = 0;
g_zero_copy_shown = NULL;
settle_unwaited();
render_stream();
return;
}
struct draw_list dl = {0};
struct surface *s;
int w, h;
@@ -2576,6 +2811,8 @@ static void render_scene(void) {
} else {
cursor_hdr_said = 0;
}
g_zero_copy_shown = NULL;
if (hdr_route == 1 || hdr_route == 2) settle_unwaited();
if (hdr_route == 1) {
static int fell_back;
vkp_apply_window_request();
@@ -2609,6 +2846,7 @@ static void render_scene(void) {
}
if (hdr_route == 0 && vkp_quest_layer_presentation() && !framegen && !cardboard && !cursor_on &&
!ahb_only) {
settle_unwaited();
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
} else if (hdr_route == 0 || hdr_route == 3) {
const int pass_on = fx_on || framegen;
@@ -2658,6 +2896,7 @@ static void render_scene(void) {
vkp_apply_window_request();
int r = -1;
const int fg_pass = framegen && fx_on && li >= 0;
if (framegen && li >= 0) settle_unwaited();
const int generated = (framegen && li >= 0)
? sc_layer_present_generated(&dl.d[li], 1, NULL, w, h, fg_pass,
ls ? droiddeck_surface_color(ls) : NULL) : 0;
@@ -2671,6 +2910,8 @@ 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 (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);
@@ -2681,6 +2922,7 @@ static void render_scene(void) {
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) {
settle_unwaited();
sc_layer_hide();
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
copy = 1;
@@ -2690,12 +2932,14 @@ static void render_scene(void) {
g_scene_queues = sc_layer_queues();
}
} else {
settle_unwaited();
sc_layer_hide();
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
copy = 1;
hdr_copy = "its display layer was unavailable this frame";
}
} else {
settle_unwaited();
sc_layer_hide();
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
copy = 1;
@@ -4344,11 +4588,12 @@ static int on_stats_timer(void *data) {
unsigned aimed_next, aimed_later, aimed_even;
sc_layer_aim_take(&aimed_next, &aimed_later, &aimed_even);
#define PERF_MS(sum, n) ((n) ? (double)(sum) / 1e6 / (double)(n) : 0.0)
if (g_perf.scenes || vp.presents || g_perf.releases || drops)
if (g_perf.scenes || vp.presents || g_perf.releases || drops || g_perf.commit_waits)
droiddeck_log("perf", "last 10 s: %u ticks, %u scenes, %u on screen (copy %u, zero-copy %u, layer copy %u) | "
"render_scene %.2f/%.2f ms | base %u black kept, %u presented | acquire %.2f/%.2f ms | "
"present %.2f/%.2f ms (%u) | fence wait %.2f/%.2f ms (%u, %u GPU release waits) | "
"release %.2f/%.2f ms (%u, %u held) | %u pool drops | layer frames timed for the next refresh %u, "
"release %.2f/%.2f ms (%u, %u held) | commits held for client writes %.2f/%.2f ms (%u, %u past the limit) | "
"%u pool drops | layer frames timed for the next refresh %u, "
"the one after %u, held to an even step %u",
g_perf.ticks, g_perf.scenes, g_stat_frames, g_perf.copy_scenes, zero_copy, layer_frames,
PERF_MS(g_perf.scene_ns, g_perf.scenes), (double)g_perf.scene_max_ns / 1e6,
@@ -4357,7 +4602,9 @@ static int on_stats_timer(void *data) {
PERF_MS(vp.present_ns, vp.presents), (double)vp.present_max_ns / 1e6, vp.presents,
PERF_MS(vp.wait_ns, vp.waits), (double)vp.wait_max_ns / 1e6, vp.waits, vp.gpu_release_waits,
PERF_MS(g_perf.release_ns, g_perf.releases), (double)g_perf.release_max_ns / 1e6,
g_perf.releases, g_perf.releases_held, drops, aimed_next, aimed_later, aimed_even);
g_perf.releases, g_perf.releases_held,
PERF_MS(g_perf.commit_wait_ns, g_perf.commit_waits), (double)g_perf.commit_wait_max_ns / 1e6,
g_perf.commit_waits, g_perf.commit_wait_limits, drops, aimed_next, aimed_later, aimed_even);
#undef PERF_MS
memset(&g_perf, 0, sizeof(g_perf));
}
+210 -86
View File
@@ -3,6 +3,7 @@
#include "blend_pass.h"
#include "vk_loader.h"
#include "vk_present.h"
#include "framegen_bridge.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
@@ -69,6 +70,7 @@ static struct fx_settings g_set = {
.gamma = 1.0f, .saturation = 1.0f, .s_raw = 100.0f, .look = "Off"};
static volatile int g_changed;
static struct fx_settings g_cur;
static struct fx_settings g_generated_settings;
static int g_cur_valid;
static void set_begin(void) { pthread_mutex_lock(&g_lock); }
@@ -235,13 +237,24 @@ static VkDescriptorPool g_dpool;
static VkSampler g_sampler;
enum { P_SGSR, P_SGSR_HQ, P_NIS, P_EASU, P_RCAS, P_CAS, P_COLOR, P_FXAA, P_FXAA_TOON, P_SMAA_EDGE, P_SMAA_WEIGHTS, P_SMAA_BLEND, P_TOON, P_TOON_COLOR, P_HDR, P_NTSC, P_CRT, P_DEBAND, P_NIS_LUMA, P_COUNT };
static VkPipeline g_pipe[P_COUNT];
static struct fx_target g_t[2], g_mid, g_smaa_edges, g_smaa_weights;
struct fx_context {
struct fx_target targets[2], mid, nissrc;
struct { VkImage img; VkImageView view; VkDescriptorSet ds; int w, h; } scene;
};
#define FX_CONTEXTS (VKP_FG_MAX_GENERATIONS + 2)
static struct fx_context g_contexts[FX_CONTEXTS];
static int g_context;
#define g_t (g_contexts[g_context].targets)
#define g_mid (g_contexts[g_context].mid)
#define g_nissrc (g_contexts[g_context].nissrc)
static struct fx_target g_smaa_edges, g_smaa_weights;
/* Half set: NIS = nis_luma prepass (scene rgb + luma in alpha, scene size) into g_nissrc, then
* nis3 gathers its luma from that alpha, its coefficient banks (nis_coef.h) in a uniform buffer
* at descriptor set 1 (g_pl_nis = {g_dsl, g_coef_dsl}, same push-constant range as g_pl).
* Old set (or no buffer): nis.frag on the scene, P_NIS_LUMA unused. */
static struct fx_target g_nissrc;
static int g_nis_fast;
static int g_nis_attempted;
static int g_upscale_half;
static VkDescriptorSetLayout g_coef_dsl;
static VkPipelineLayout g_pl_nis;
static VkDescriptorPool g_coef_pool;
@@ -249,7 +262,7 @@ static VkDescriptorSet g_coef_ds;
static VkBuffer g_coef_buf;
static VkDeviceMemory g_coef_mem;
static struct { VkImage img; VkImageView view; VkDescriptorSet ds; int w, h; } g_scene;
#define g_scene (g_contexts[g_context].scene)
void vkp_effects_bind_device(VkDevice dev, VkPhysicalDevice pd,
const VkPhysicalDeviceMemoryProperties *memprops) {
@@ -347,7 +360,15 @@ static void scene_release(void) {
}
void vkp_effects_forget_image(VkImage img) {
if (img && g_scene.img == img) scene_release();
int saved = g_context;
for (g_context = 0; g_context < FX_CONTEXTS; g_context++)
if (img && g_scene.img == img) scene_release();
g_context = saved;
}
void vkp_effects_release_generated_sources(void) {
for (g_context = 1; g_context < FX_CONTEXTS; g_context++) scene_release();
g_context = 0;
}
static int scene_ensure(VkImage img, int w, int h) {
@@ -473,9 +494,14 @@ static int upscale_half_set(void) {
static void objects_destroy(void) {
if (!g_dev) return;
scene_release();
target_destroy(&g_t[0]); target_destroy(&g_t[1]); target_destroy(&g_mid);
target_destroy(&g_smaa_edges); target_destroy(&g_smaa_weights); target_destroy(&g_nissrc);
int saved = g_context;
for (g_context = 0; g_context < FX_CONTEXTS; g_context++) {
scene_release();
target_destroy(&g_t[0]); target_destroy(&g_t[1]); target_destroy(&g_mid);
target_destroy(&g_nissrc);
}
g_context = saved;
target_destroy(&g_smaa_edges); target_destroy(&g_smaa_weights);
for (int i = 0; i < P_COUNT; i++) { if (g_pipe[i]) g_vk.DestroyPipeline(g_dev, g_pipe[i], NULL); g_pipe[i] = VK_NULL_HANDLE; }
if (g_dpool) g_vk.DestroyDescriptorPool(g_dev, g_dpool, NULL);
if (g_pl) g_vk.DestroyPipelineLayout(g_dev, g_pl, NULL);
@@ -486,6 +512,7 @@ static void objects_destroy(void) {
if (g_rp) g_vk.DestroyRenderPass(g_dev, g_rp, NULL);
g_dpool = VK_NULL_HANDLE; g_pl = VK_NULL_HANDLE; g_dsl = VK_NULL_HANDLE;
g_sampler = VK_NULL_HANDLE; g_rp = VK_NULL_HANDLE; g_smaa_rp = VK_NULL_HANDLE;
g_nis_fast = 0; g_nis_attempted = 0; g_upscale_half = 0;
g_ready = 0;
}
@@ -505,7 +532,9 @@ void vkp_effects_set_formats(VkFormat scene_fmt, VkFormat target_fmt, int scene_
: target_fmt == VK_FORMAT_R16G16B16A16_SFLOAT ? "the HDR picture for frame generation"
: "the HDR composition's picture: PQ, or tone-mapped SDR with HDR output off");
} else if (scene_fmt != g_scene_fmt) {
scene_release();
int saved = g_context;
for (g_context = 0; g_context < FX_CONTEXTS; g_context++) scene_release();
g_context = saved;
g_scene_fmt = scene_fmt;
}
}
@@ -556,75 +585,17 @@ static int objects_ensure(void) {
VkPipelineLayoutCreateInfo pli = {.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, .setLayoutCount = 2, .pSetLayouts = set_layouts,
.pushConstantRangeCount = 1, .pPushConstantRanges = &pcr};
if (g_vk.CreatePipelineLayout(g_dev, &pli, NULL, &g_pl) != VK_SUCCESS) goto fail;
VkDescriptorPoolSize ps = {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 10};
VkDescriptorPoolSize ps = {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, FX_CONTEXTS * 5 + 2};
VkDescriptorPoolCreateInfo dpi = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, .maxSets = 10,
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, .maxSets = FX_CONTEXTS * 5 + 2,
.poolSizeCount = 1, .pPoolSizes = &ps};
if (g_vk.CreateDescriptorPool(g_dev, &dpi, NULL, &g_dpool) != VK_SUCCESS) goto fail;
VkShaderModule vert = shader(upscale_vert_code, sizeof(upscale_vert_code));
if (!vert) goto fail;
#define MKL(slot, code, name, layout) do { g_pipe[slot] = post_pipeline_for_renderpass(vert, code, sizeof(code), g_rp, name, layout); if (!g_pipe[slot]) { g_vk.DestroyShaderModule(g_dev, vert, NULL); goto fail; } } while (0)
#define MK(slot, code, name) MKL(slot, code, name, g_pl)
const int half = upscale_half_set();
g_upscale_half = upscale_half_set();
g_nis_fast = 0;
if (half && !fx_alpha_holds_luma(g_fx_fmt))
droiddeck_log("effects", "NIS uses nis.frag: the chain format has no 8-bit alpha for the luma prepass");
else if (half && coef_create() != 0)
droiddeck_log("effects", "NIS coefficient buffer unavailable; NIS uses nis.frag");
else if (half)
g_nis_fast = 1;
if (half) {
MK(P_SGSR, sgsr_half_code, "sgsr_half");
MK(P_SGSR_HQ, sgsr_quality_half_code, "sgsr_quality_half");
if (g_nis_fast) {
/* optional: a driver that rejects either fast NIS pipeline gets nis.frag, not a dead chain */
g_pipe[P_NIS] = post_pipeline_for_renderpass(vert, nis3_half_code, sizeof(nis3_half_code), g_rp, "nis3_half", g_pl_nis);
g_pipe[P_NIS_LUMA] = g_pipe[P_NIS]
? post_pipeline_for_renderpass(vert, nis_luma_half_code, sizeof(nis_luma_half_code), g_rp, "nis_luma_half", g_pl)
: VK_NULL_HANDLE;
if (!g_pipe[P_NIS] || !g_pipe[P_NIS_LUMA]) {
if (g_pipe[P_NIS]) g_vk.DestroyPipeline(g_dev, g_pipe[P_NIS], NULL);
g_pipe[P_NIS] = VK_NULL_HANDLE;
coef_destroy();
g_nis_fast = 0;
droiddeck_log("effects", "fast NIS pipelines failed to build; NIS uses nis.frag");
}
}
if (!g_nis_fast) MK(P_NIS, nis_code, "nis");
MK(P_EASU, fsr_easu_half_code, "fsr_easu_half");
MK(P_RCAS, fsr_rcas_half_code, "fsr_rcas_half");
MK(P_CAS, cas_ffx_half_code, "cas_ffx_half");
} else {
MK(P_SGSR, sgsr_code, "sgsr");
MK(P_SGSR_HQ, sgsr_quality_code, "sgsr_quality");
MK(P_NIS, nis_code, "nis");
MK(P_EASU, fsr_easu_code, "fsr_easu");
MK(P_RCAS, fsr_rcas_code, "fsr_rcas");
MK(P_CAS, cas_code, "cas");
}
MK(P_COLOR, color_code, "color");
MK(P_FXAA, fxaa_code, "fxaa");
MK(P_FXAA_TOON, fxaa_toon_code, "fxaa_toon");
g_pipe[P_SMAA_EDGE] = post_pipeline_for_renderpass(
vert, smaa_edge_code, sizeof(smaa_edge_code), g_smaa_rp, "smaa_edge", g_pl);
if (!g_pipe[P_SMAA_EDGE]) { g_vk.DestroyShaderModule(g_dev, vert, NULL); goto fail; }
g_pipe[P_SMAA_WEIGHTS] = post_pipeline_for_renderpass(
vert, smaa_weights_code, sizeof(smaa_weights_code), g_smaa_rp, "smaa_weights", g_pl);
if (!g_pipe[P_SMAA_WEIGHTS]) { g_vk.DestroyShaderModule(g_dev, vert, NULL); goto fail; }
MK(P_SMAA_BLEND, smaa_blend_code, "smaa_blend");
MK(P_TOON, toon_code, "toon");
MK(P_TOON_COLOR, toon_color_code, "toon_color");
MK(P_HDR, hdr_code, "hdr");
MK(P_NTSC, ntsc_code, "ntsc");
MK(P_CRT, crt_code, "crt");
MK(P_DEBAND, deband_code, "deband");
#undef MK
#undef MKL
g_vk.DestroyShaderModule(g_dev, vert, NULL);
g_nis_attempted = 0;
g_ready = 1;
droiddeck_log("effects", "chain ready: 16 pipelines (SGSR, SGSR HQ, NIS, FSR EASU+RCAS, CAS, colour, FXAA, SMAA edge/weights/blend, Toon, HDR, NTSC, CRT, deband), %s upscalers%s, on %s",
half ? "half-precision" : "old fp32", g_nis_fast ? " + NIS luma prepass" : "", vkp_gpu_name());
droiddeck_log("effects", "shared resources ready on %s; effect pipelines are created when needed", vkp_gpu_name());
return 0;
fail:
objects_destroy();
@@ -633,6 +604,95 @@ fail:
return -1;
}
static int chain_failed(void) {
objects_destroy();
g_ready = -1;
droiddeck_log("error", "effects: the screen-effect chain could not be built on this driver; effects are off for this session");
return -1;
}
static int pipelines_ensure(int spatial, const struct fx_settings *s) {
VkShaderModule vert = VK_NULL_HANDLE;
#define MKL(needed, slot, code, name, render_pass, layout) do { \
if ((needed) && !g_pipe[slot]) { \
if (!vert && !(vert = shader(upscale_vert_code, sizeof(upscale_vert_code)))) goto fail; \
g_pipe[slot] = post_pipeline_for_renderpass(vert, code, sizeof(code), render_pass, name, layout); \
if (!g_pipe[slot]) goto fail; \
} \
} while (0)
#define MK(needed, slot, code, name) MKL(needed, slot, code, name, g_rp, g_pl)
if (spatial == 3) {
if (g_upscale_half) MK(1, P_SGSR, sgsr_half_code, "sgsr_half");
else MK(1, P_SGSR, sgsr_code, "sgsr");
}
if (spatial == 8) {
if (g_upscale_half) MK(1, P_SGSR_HQ, sgsr_quality_half_code, "sgsr_quality_half");
else MK(1, P_SGSR_HQ, sgsr_quality_code, "sgsr_quality");
}
if (spatial == 4 || spatial == 5) {
if (g_upscale_half) MK(1, P_EASU, fsr_easu_half_code, "fsr_easu_half");
else MK(1, P_EASU, fsr_easu_code, "fsr_easu");
if (s->sharp_pct != 0) {
if (g_upscale_half) MK(1, P_RCAS, fsr_rcas_half_code, "fsr_rcas_half");
else MK(1, P_RCAS, fsr_rcas_code, "fsr_rcas");
}
}
if (spatial == 6) {
if (g_upscale_half) MK(1, P_RCAS, fsr_rcas_half_code, "fsr_rcas_half");
else MK(1, P_RCAS, fsr_rcas_code, "fsr_rcas");
}
if (spatial == 7) {
if (g_upscale_half && !g_nis_attempted) {
g_nis_attempted = 1;
if (!fx_alpha_holds_luma(g_fx_fmt))
droiddeck_log("effects", "NIS uses nis.frag: the chain format has no 8-bit alpha for the luma prepass");
else if (coef_create() != 0)
droiddeck_log("effects", "NIS coefficient buffer unavailable; NIS uses nis.frag");
else {
if (!vert && !(vert = shader(upscale_vert_code, sizeof(upscale_vert_code)))) goto fail;
g_pipe[P_NIS] = post_pipeline_for_renderpass(vert, nis3_half_code, sizeof(nis3_half_code), g_rp, "nis3_half", g_pl_nis);
if (g_pipe[P_NIS])
g_pipe[P_NIS_LUMA] = post_pipeline_for_renderpass(vert, nis_luma_half_code, sizeof(nis_luma_half_code), g_rp, "nis_luma_half", g_pl);
if (g_pipe[P_NIS] && g_pipe[P_NIS_LUMA]) g_nis_fast = 1;
else {
if (g_pipe[P_NIS]) g_vk.DestroyPipeline(g_dev, g_pipe[P_NIS], NULL);
if (g_pipe[P_NIS_LUMA]) g_vk.DestroyPipeline(g_dev, g_pipe[P_NIS_LUMA], NULL);
g_pipe[P_NIS] = VK_NULL_HANDLE;
g_pipe[P_NIS_LUMA] = VK_NULL_HANDLE;
coef_destroy();
droiddeck_log("effects", "fast NIS pipelines failed to build; NIS uses nis.frag");
}
}
}
if (!g_nis_fast) MK(1, P_NIS, nis_code, "nis");
else if (g_upscale_half) MK(1, P_SGSR, sgsr_half_code, "sgsr_half");
}
if (cas_active(s)) {
if (g_upscale_half) MK(1, P_CAS, cas_ffx_half_code, "cas_ffx_half");
else MK(1, P_CAS, cas_code, "cas");
}
if (s->color_on && !(s->toon && g_fx_fmt == FX_FORMAT)) MK(1, P_COLOR, color_code, "color");
if (s->aa_mode == 1 || s->aa_mode == 2) MK(1, P_FXAA, fxaa_code, "fxaa");
if (s->aa_mode == 2) {
MKL(1, P_SMAA_EDGE, smaa_edge_code, "smaa_edge", g_smaa_rp, g_pl);
MKL(1, P_SMAA_WEIGHTS, smaa_weights_code, "smaa_weights", g_smaa_rp, g_pl);
MK(1, P_SMAA_BLEND, smaa_blend_code, "smaa_blend");
}
if (s->toon && s->color_on && g_fx_fmt == FX_FORMAT) MK(1, P_TOON_COLOR, toon_color_code, "toon_color");
else if (s->toon) MK(1, P_TOON, toon_code, "toon");
if (s->hdr_on) MK(1, P_HDR, hdr_code, "hdr");
if (s->ntsc) MK(1, P_NTSC, ntsc_code, "ntsc");
if (s->crt) MK(1, P_CRT, crt_code, "crt");
if (deband_active(s)) MK(1, P_DEBAND, deband_code, "deband");
#undef MK
#undef MKL
if (vert) g_vk.DestroyShaderModule(g_dev, vert, NULL);
return 0;
fail:
if (vert) g_vk.DestroyShaderModule(g_dev, vert, NULL);
return chain_failed();
}
static void barrier(VkCommandBuffer cmd, VkImage img, VkImageLayout from, VkImageLayout to,
VkPipelineStageFlags src_stage, VkAccessFlags src_access,
@@ -681,14 +741,26 @@ static void pass_dual(VkCommandBuffer cmd, VkPipeline p, struct fx_target *dst,
static const float FULL_NDC[4] = {-1.0f, -1.0f, 1.0f, 1.0f};
#define SET_NDC(pc) memcpy((pc).ndc, FULL_NDC, sizeof(FULL_NDC))
VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
int out_w, int out_h, int *res_w, int *res_h) {
struct fx_source_state {
VkImageLayout layout;
VkPipelineStageFlags stage;
VkAccessFlags access;
};
static VkImage effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
int out_w, int out_h, int *res_w, int *res_h,
VkImageLayout input_layout, const struct fx_settings *frozen,
struct fx_source_state *source_state) {
struct fx_settings snapshot;
const struct fx_settings *s;
vkp_effects_sync();
pthread_mutex_lock(&g_lock);
snapshot = g_cur;
pthread_mutex_unlock(&g_lock);
if (frozen) {
snapshot = *frozen;
} else {
vkp_effects_sync();
pthread_mutex_lock(&g_lock);
snapshot = g_cur;
pthread_mutex_unlock(&g_lock);
}
s = &snapshot;
*res_w = scene_w; *res_h = scene_h;
@@ -723,7 +795,7 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
effect_count(s) - (fuse_toon_color ? 1 : 0) -
(fuse_fxaa_toon ? 1 : 0);
if ((spatial || nfx) && objects_ensure() == 0 && scene_ensure(scene, scene_w, scene_h) == 0 &&
if ((spatial || nfx) && objects_ensure() == 0 && pipelines_ensure(spatial, s) == 0 && scene_ensure(scene, scene_w, scene_h) == 0 &&
target_ensure(&g_t[0], cw, ch, FX_TARGET_USAGE, "chain") == 0 && (chain_passes < 2 || target_ensure(&g_t[1], cw, ch, FX_TARGET_USAGE, "chain") == 0) &&
(!(spatial == 4 || spatial == 5) || s->sharp_pct == 0 ||
target_ensure(&g_mid, cw, ch, FX_SCRATCH_USAGE, "EASU") == 0)) {
@@ -748,8 +820,10 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
g_vk.CmdSetScissor(cmd, 0, 1, &chain_sc);
if (spatial) {
barrier(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
if (source_state) *source_state = (struct fx_source_state){VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT};
barrier(cmd, scene, input_layout, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_WRITE_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
struct fx_target *dst = FREE_TARGET();
if (spatial == 3 || spatial == 8 || spatial == 7) {
@@ -809,8 +883,10 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
cur = dst; cur_ds = dst->ds;
} else if (resize) {
struct fx_target *dst = FREE_TARGET();
barrier(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
if (source_state) *source_state = (struct fx_source_state){VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT};
barrier(cmd, scene, input_layout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_WRITE_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT);
barrier(cmd, dst->img, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT);
@@ -823,8 +899,10 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
cur = dst; cur_ds = dst->ds;
} else {
barrier(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
if (source_state) *source_state = (struct fx_source_state){VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT};
barrier(cmd, scene, input_layout, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_WRITE_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
cur = NULL; cur_ds = g_scene.ds;
}
@@ -907,8 +985,54 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
return scene;
}
barrier(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
if (source_state) *source_state = (struct fx_source_state){VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT};
barrier(cmd, scene, input_layout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_WRITE_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT);
return scene;
}
VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
int out_w, int out_h, int *res_w, int *res_h) {
return effects_run(cmd, scene, scene_w, scene_h, out_w, out_h, res_w, res_h,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, NULL, NULL);
}
int vkp_effects_prepare_generated(void) {
vkp_effects_sync();
pthread_mutex_lock(&g_lock);
g_generated_settings = g_cur;
pthread_mutex_unlock(&g_lock);
return spatial_mode(g_generated_settings.scaling) && g_generated_settings.scaling != 6 &&
effect_count(&g_generated_settings) == 0;
}
VkImage vkp_effects_run_before_generated(VkCommandBuffer cmd, VkImage scene, int w, int h,
int *res_w, int *res_h) {
struct fx_settings settings = g_generated_settings;
settings.scaling = 0;
return effects_run(cmd, scene, w, h, w, h, res_w, res_h,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &settings, NULL);
}
VkImage vkp_effects_run_generated(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
int out_w, int out_h, int slot, int *res_w, int *res_h) {
if (slot < 0 || slot > VKP_FG_MAX_GENERATIONS) {
*res_w = scene_w; *res_h = scene_h;
return scene;
}
g_context = slot + 1;
struct fx_source_state source_state = {0};
VkImage result = effects_run(cmd, scene, scene_w, scene_h, out_w, out_h, res_w, res_h,
VK_IMAGE_LAYOUT_GENERAL, &g_generated_settings, &source_state);
barrier(cmd, result, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT);
if (result != scene)
barrier(cmd, scene, source_state.layout, VK_IMAGE_LAYOUT_GENERAL,
source_state.stage, source_state.access,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT);
g_context = 0;
return result;
}
@@ -18,6 +18,12 @@ VkFilter vkp_effects_blit_filter(void);
VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
int out_w, int out_h, int *res_w, int *res_h);
int vkp_effects_prepare_generated(void);
void vkp_effects_release_generated_sources(void);
VkImage vkp_effects_run_before_generated(VkCommandBuffer cmd, VkImage scene, int w, int h,
int *res_w, int *res_h);
VkImage vkp_effects_run_generated(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
int out_w, int out_h, int slot, int *res_w, int *res_h);
void vkp_effects_destroy(void);
@@ -1,6 +1,7 @@
#define _POSIX_C_SOURCE 200809L
#include "framegen_bridge.h"
#include "framegen_engine.h"
#include "effects_chain.h"
#include "vk_loader.h"
#include <pthread.h>
#include <stdatomic.h>
@@ -226,7 +227,10 @@ static void destroy_ring(void) {
if (vk.DeviceWaitIdle) vk.DeviceWaitIdle(g_dev);
for (uint32_t i = 0; i < g_ring_n; i++) {
if (g_ring[i].view) vk.DestroyImageView(g_dev, g_ring[i].view, NULL);
if (g_ring[i].img) vk.DestroyImage(g_dev, g_ring[i].img, NULL);
if (g_ring[i].img) {
vkp_effects_forget_image(g_ring[i].img);
vk.DestroyImage(g_dev, g_ring[i].img, NULL);
}
if (g_ring[i].mem) vk.FreeMemory(g_dev, g_ring[i].mem, NULL);
memset(&g_ring[i], 0, sizeof(g_ring[i]));
}
@@ -31,6 +31,7 @@ bool g_probed = false, g_ready = false;
std::unique_ptr<lsfg::Engine> g_lsfg;
std::unique_ptr<ddfg::Engine> g_ddfg;
std::vector<std::unique_ptr<ddfg::Engine>> g_retained_ddfg;
int g_kind = -1;
char g_build[96] = "";
@@ -128,7 +129,14 @@ void fge_device_ready(PFN_vkGetInstanceProcAddr gipa, VkInstance inst, VkPhysica
void fge_device_lost(void) {
g_lsfg.reset();
g_ddfg.reset();
if (g_ddfg) {
if (g_ddfg->destroy()) g_ddfg.reset();
else g_retained_ddfg.push_back(std::move(g_ddfg));
}
// The device is being torn down. Unknown-completion resources must not be
// passed to Vulkan destruction calls; the VkDevice teardown reclaims them.
for (auto& engine : g_retained_ddfg) engine->abandon();
g_retained_ddfg.clear();
g_kind = -1;
g_dev = VK_NULL_HANDLE;
g_queue = VK_NULL_HANDLE;
@@ -193,9 +201,21 @@ int fge_start(int kind, const char *cache_path) {
}
void fge_stop(void) {
if ((g_lsfg || g_ddfg) && g_table.DeviceWaitIdle && g_dev) g_table.DeviceWaitIdle(g_dev);
g_lsfg.reset();
g_ddfg.reset();
if (g_lsfg) {
if (g_table.DeviceWaitIdle && g_dev) g_table.DeviceWaitIdle(g_dev);
g_lsfg.reset();
}
for (auto it = g_retained_ddfg.begin(); it != g_retained_ddfg.end();) {
if ((*it)->destroy()) it = g_retained_ddfg.erase(it);
else ++it;
}
if (g_ddfg) {
if (g_ddfg->destroy()) g_ddfg.reset();
else {
ELOGE("ddfg-native: retaining engine until GPU completion is known or device teardown");
g_retained_ddfg.push_back(std::move(g_ddfg));
}
}
g_kind = -1;
}
+32 -3
View File
@@ -2759,6 +2759,21 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
pass_n = 1;
overlay_start = source_end;
}
const int upscale_w = (int)(scene_w * g_map.kx + 0.5f);
const int upscale_h = (int)(scene_h * g_map.ky + 0.5f);
const int post_upscale = fx && fg && !hf && !cb && vkp_effects_upscaling() &&
vkp_effects_prepare_generated() &&
(upscale_w > input_w || upscale_h > input_h);
if (post_upscale) {
static int last_input_w, last_input_h, last_output_w, last_output_h;
if (input_w != last_input_w || input_h != last_input_h ||
upscale_w != last_output_w || upscale_h != last_output_h) {
droiddeck_log("framegen", "post-upscale: interpolate %dx%d, spatial filter each present to %dx%d",
input_w, input_h, upscale_w, upscale_h);
last_input_w = input_w; last_input_h = input_h;
last_output_w = upscale_w; last_output_h = upscale_h;
}
}
const int deep = hf && n > 0 && fg && g_swap_is_hdr && !hf->tonemap && vkp_framegen_format_ok(FG_HDR_FMT) &&
ensure_img(&g_fgscene, scene_w, scene_h, FG_HDR_FMT,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT |
@@ -2894,8 +2909,11 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
if (fx) {
int mapped_w = (int)(scene_w * g_map.kx + 0.5f), mapped_h = (int)(scene_h * g_map.ky + 0.5f);
if (fg && !vkp_effects_sharpening()) { mapped_w = scene_w; mapped_h = scene_h; }
if (post_upscale) { mapped_w = input_w; mapped_h = input_h; }
vkp_effects_set_formats(scene_fmt, scene_fmt, hdr_how == 1 || hdr_unconverted);
result = vkp_effects_run(cmd, scene_img, input_w, input_h, mapped_w, mapped_h, &rw, &rh);
result = post_upscale
? vkp_effects_run_before_generated(cmd, scene_img, input_w, input_h, &rw, &rh)
: vkp_effects_run(cmd, scene_img, input_w, input_h, mapped_w, mapped_h, &rw, &rh);
effects_overlay_draws(cmd, result, rw, rh, scene_w, scene_h,
draws ? draws + overlay_start : NULL, n - overlay_start);
release_external_client_draws(cmd, draws, n);
@@ -2918,7 +2936,12 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
if (ngen > VKP_FG_MAX_GENERATIONS) ngen = VKP_FG_MAX_GENERATIONS;
}
record_screen_blit(cmd, ngen ? gens[0] : result, rw, rh, scene_w, scene_h, img, blit_filter, cb);
VkImage screen = ngen ? gens[0] : result;
int screen_w = rw, screen_h = rh;
if (post_upscale)
screen = vkp_effects_run_generated(cmd, screen, rw, rh, upscale_w, upscale_h,
0, &screen_w, &screen_h);
record_screen_blit(cmd, screen, screen_w, screen_h, scene_w, scene_h, img, blit_filter, cb);
}
g_vk.EndCommandBuffer(cmd);
@@ -2942,7 +2965,12 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
VkCommandBuffer ck = g_cmds[k];
g_vk.ResetCommandBuffer(ck, 0);
g_vk.BeginCommandBuffer(ck, &bi);
record_screen_blit(ck, k < ngen ? gens[k] : result, rw, rh, scene_w, scene_h, img, blit_filter, cb);
VkImage screen = k < ngen ? gens[k] : result;
int screen_w = rw, screen_h = rh;
if (post_upscale)
screen = vkp_effects_run_generated(ck, screen, rw, rh, upscale_w, upscale_h,
k, &screen_w, &screen_h);
record_screen_blit(ck, screen, screen_w, screen_h, scene_w, scene_h, img, blit_filter, cb);
g_vk.EndCommandBuffer(ck);
}
const int last = (k + 1 == presents);
@@ -2988,6 +3016,7 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
VkResult fr = timed_wait(g_fence, UINT64_MAX);
if (fr == VK_ERROR_DEVICE_LOST || pr == VK_ERROR_DEVICE_LOST) { device_lost("present"); return -1; }
if (fr != VK_SUCCESS) return -1;
vkp_effects_release_generated_sources();
if (fg) vkp_framegen_presented(presented_gen);
if (pr == VK_ERROR_OUT_OF_DATE_KHR || pr == VK_ERROR_SURFACE_LOST_KHR) {
droiddeck_log("gpu", "screen surface %s on present: rebuilding the swapchain", vk_result_name(pr));
@@ -701,7 +701,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
private var bridgeFellBackMemory by mutableStateOf(false)
private var clearCachedApps by mutableStateOf(false)
private var adbPaired by mutableStateOf(false)
private var memoryHud by mutableStateOf(SessionPrefs.MEMORY_HUD_OFF)
private var backgroundAppLimit by mutableStateOf(com.droiddeck.launcher.core.BackgroundAppLimit.OFF)
private var showRoms by mutableStateOf(false)
private var homeAppSelected by mutableStateOf(false)
@@ -1431,7 +1430,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
vacDiagnostics = vacDiagnostics, agentCommands = agentCommands,
graphicsLogs = graphicsLogs, steamGpuDrawing = steamGpuDrawing, bridgeFellBack = bridgeFellBack, bridgeFellBackMemory = bridgeFellBackMemory,
buildWatermark = buildWatermark,
clearCachedApps = clearCachedApps, adbPaired = adbPaired, memoryHud = memoryHud, backgroundAppLimit = backgroundAppLimit,
clearCachedApps = clearCachedApps, adbPaired = adbPaired, backgroundAppLimit = backgroundAppLimit,
tpUbwcMode = drivers.tpUbwcModeForDevice(), tpUbwcRestartRequired = drivers.tpUbwcRestartRequired(), canRestartApp = !runtimeChangesBlocked(),
steamGames = steamGames, steamGamesX64 = steamGamesX64, emulators = emulatorList, running = runningLabel,
frameGen = FrameGen.mode(this),
@@ -1702,7 +1701,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
agentCommands = com.droiddeck.launcher.agent.AgentAccess.commandsEnabled(this)
},
onClearCachedApps = { on -> SessionPrefs.setClearCachedApps(this, on); clearCachedApps = on },
onMemoryHud = { value -> SessionPrefs.setMemoryHud(this, value); memoryHud = value },
onTpUbwcMode = { drivers.chooseTpUbwcMode(it) },
onRestartApp = { drivers.restartApp() },
onBackgroundAppLimit = { limit ->
@@ -2264,7 +2262,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
!com.droiddeck.launcher.input.PadBridge.isControllerMotionEvent(event)) return
val device = event.device ?: return
val rxRy = com.droiddeck.launcher.input.PadBridge.rightStickUsesRxRy(event, device, rightStickLayouts)
?: return
?: run {
if (rightStickScrollDeviceId == event.deviceId) stopRightStickScroll()
return
}
val axis = if (rxRy) android.view.MotionEvent.AXIS_RY else android.view.MotionEvent.AXIS_RZ
val value = event.getAxisValue(axis)
if (kotlin.math.abs(value) < 0.55f) {
@@ -3456,7 +3457,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
bridgeFellBackMemory = SessionPrefs.bridgeFellBackForMemory(this)
clearCachedApps = SessionPrefs.clearCachedApps(this)
adbPaired = WirelessAdbFix.hasSavedPairing(this)
memoryHud = SessionPrefs.memoryHud(this)
backgroundAppLimit = SessionPrefs.backgroundAppLimit(this)
runningLabel = if (SessionState.running) when (SessionState.mode) {
SessionService.MODE_DESKTOP -> getString(R.string.rail_desktop)
@@ -137,7 +137,6 @@ import com.droiddeck.launcher.session.WinComponents
import com.droiddeck.launcher.ui.CursorOverlay
import androidx.compose.ui.graphics.asImageBitmap
import com.droiddeck.launcher.ui.DrawerActions
import com.droiddeck.launcher.ui.HudText
import com.droiddeck.launcher.ui.LoadingOverlay
import com.droiddeck.launcher.ui.SessionDrawer
import com.droiddeck.launcher.ui.SessionPausedOverlay
@@ -286,7 +285,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
private lateinit var sessionOverlay: ComposeView
private lateinit var loading: LoadingState
private lateinit var hud: DroidDeckHudHost
private lateinit var memoryHud: com.droiddeck.launcher.session.MemoryHud
private var padBridge: PadBridge? = null
private val physicalShortcuts = PhysicalShortcutRouter()
private var joyConVr: com.droiddeck.launcher.input.JoyConVr? = null
@@ -636,8 +634,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
private var hudOn by mutableStateOf(true)
private var gpuClockPin by mutableStateOf(false)
private var hudConfig by mutableStateOf<Map<String, String>>(emptyMap())
private var hudColor by mutableStateOf(SessionPrefs.HUD_COLOR_MINT)
private var hudOpacity by mutableStateOf(SessionPrefs.HUD_OPACITY_DEFAULT)
private var upscaler by mutableStateOf(0)
private var upscaleSharpness by mutableStateOf(75)
private var effects by mutableStateOf(ScreenEffects.OFF)
@@ -1060,14 +1056,12 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
hud.onConfigChanged = { hudConfig = DroidDeckHudConfig.load(this) }
hud.passesTouchAt = ::controlTakesTouchAt
hud.attach(root, root.childCount)
memoryHud = com.droiddeck.launcher.session.MemoryHud(this)
hud.onPresentingWindowChanged = {
CompositorHost.rearmFrameGen { applyFrameGen(force = true) }
}
if (SessionState.running && SessionState.firstFrameSeen) {
loading.visible = false
hud.start()
memoryHud.start()
}
readPrefs()
@@ -1244,7 +1238,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
resources.displayMetrics.density,
cursorImage, cursorHotX, cursorHotY, cursorImageScale)
if (memoryHud.text.isNotEmpty()) HudText(memoryHud.text, hudColor, hudOpacity)
if (bottomOutputActive && !loading.visible) SwappedTopPanel()
val phonePanel = glassesOutputActive && !loading.visible && !drawerOpen && !pcKeyboardOpen
if (phonePanel) GlassesPhonePanel(glasses, steamVrStatus == SteamVr.Status.RUNNING, headTracking)
@@ -2678,8 +2671,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
hdrWanted = SessionPrefs.hdr(this, hdrPrefMode())
hdrAvailable = HdrSupport.probe(this, glassesScreen?.display).reason == null
hudConfig = DroidDeckHudConfig.load(this)
hudColor = SessionPrefs.hudColor(this)
hudOpacity = SessionPrefs.hudOpacity(this)
upscaler = SessionPrefs.screenEffectsUpscaler(this, screenEffectsProfileIdForTarget(screenEffectsTarget))
upscaleSharpness = SessionPrefs.upscaleSharpness(this)
effects = SessionPrefs.screenEffects(this, screenEffectsProfileIdForTarget(screenEffectsTarget))
@@ -6378,7 +6369,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
if (!SessionState.suspended) pausedFrame = null
com.droiddeck.launcher.ui.Motion.refresh(this)
refreshHomeApp()
if (::memoryHud.isInitialized && SessionState.running && SessionState.firstFrameSeen) memoryHud.refresh()
if (intent?.action == SessionService.ACTION_RESUME) {
intent.action = null
SessionService.resume(this)
@@ -7114,7 +7104,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
if (isFinishing || isDestroyed) return@runOnUiThread
loading.visible = false
hud.start()
memoryHud.start()
if (started) {
settleDualScreenControls()
openDualScreenControls()
@@ -7153,7 +7142,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
bottomGame?.let { screen -> bottomGame = null; runCatching { screen.dismiss() } }
headTracker?.stop()
if (::hud.isInitialized) hud.stop()
if (::memoryHud.isInitialized) memoryHud.stop()
joyConVr?.close()
joyConVr = null
handCamera?.stop()
@@ -8,8 +8,11 @@ import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableStateMapOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.droiddeck.launcher.R
import com.droiddeck.launcher.core.WirelessAdbFix
import com.droiddeck.launcher.runtime.LinuxRuntime
import com.droiddeck.launcher.session.OrphanReaper
import com.droiddeck.launcher.session.QuestExperimental
import java.io.File
import java.util.concurrent.TimeUnit
@@ -88,6 +91,8 @@ object AgentSetup {
private fun completedKey(harness: AgentHarness) = "setup_completed_${harness.id}"
private val main = Handler(Looper.getMainLooper())
/** Advanced by every Allow, so a connection check started before it cannot overwrite what it found. */
private var connectionGeneration = 0
private const val REPO = "https://github.com/Droid-Deck/DroidDeck.git"
private const val CHECKOUT = "/root/DroidDeck"
private val HELPERS = listOf("android-open", "dd-gh-login", "droiddeckctl", "droiddeck-scenario")
@@ -104,6 +109,7 @@ object AgentSetup {
val harness = AgentHost.harness
keys = harness.keys(LinuxRuntime.rootDir(app))
val probes = mutableListOf<Pair<Step, List<String>>>()
val generation = connectionGeneration
for (step in Step.entries) if (status[step] != Status.WORKING) {
when (step) {
Step.INSTALL -> set(step, if (harness.files.all { AgentHost.guestFileExists(app, it) }) Status.DONE else Status.TODO)
@@ -114,7 +120,9 @@ object AgentSetup {
detail.remove(step)
Thread({
val live = com.droiddeck.launcher.core.WirelessAdbFix.liveConnectAddress(app) != null
set(step, if (live) Status.DONE else Status.TODO)
main.post {
if (generation == connectionGeneration && status[step] != Status.WORKING) status[step] = if (live) Status.DONE else Status.TODO
}
}, "agent-connection").start()
} else probes += step to listOf("sh", "-c",
"for i in 1 2 3; do adb connect \"\$ADB_SERIAL\" >/dev/null 2>&1; " +
@@ -123,7 +131,7 @@ object AgentSetup {
Step.GITHUB -> probes += step to listOf("gh", "auth", "status")
}
}
Thread({ for ((step, command) in probes) probe(app, harness, step, command) }, "agent-checks").start()
Thread({ for ((step, command) in probes) probe(app, harness, step, command, generation) }, "agent-checks").start()
}
/** The last failed refresh ends the script: the installs after it would run from stale indexes and could report success. */
@@ -141,6 +149,22 @@ object AgentSetup {
/** Runs [step]'s action. [CONNECTION] is the app's own pairing flow, so the caller opens it. */
fun run(context: Context, step: Step) = run(context, step, null)
/** The [Step.CONNECTION] action on a Quest, which has no pairing screen; see [WirelessAdbFix.trustOnDevice]. */
fun trustOnDevice(context: Context) {
val app = context.applicationContext
connectionGeneration++
status[Step.CONNECTION] = Status.WORKING
detail[Step.CONNECTION] = app.getString(R.string.agent_connection_quest_waiting)
Thread({
val ok = runCatching { WirelessAdbFix.trustOnDevice(app) }.isSuccess
main.post {
status[Step.CONNECTION] = if (ok) Status.DONE else Status.FAILED
if (ok) detail.remove(Step.CONNECTION) else detail[Step.CONNECTION] = app.getString(R.string.agent_connection_quest_failed)
if (ok) check(app)
}
}, "agent-quest-trust").start()
}
/** Opens the page where a provider's key is made, as the sign-in of a harness that takes pasted keys. */
fun openKeyPage(context: Context, page: String) = run(context, Step.SIGN_IN, listOf("/root/.local/bin/android-open", page))
@@ -216,7 +240,7 @@ object AgentSetup {
detail.clear()
}
private fun probe(app: Context, harness: AgentHarness, step: Step, command: List<String>) {
private fun probe(app: Context, harness: AgentHarness, step: Step, command: List<String>, generation: Int) {
var output = ""
val ok = runCatching {
val child = AgentHost.guest(app, command, connectAdb = step == Step.CONNECTION).start()
@@ -232,11 +256,14 @@ object AgentSetup {
}.onFailure { output = it.message.orEmpty() }.getOrDefault(false)
main.post {
if (AgentHost.harness != harness) return@post
// A running or newer Allow owns the row, including the instructions it shows while it waits.
if (step == Step.CONNECTION && (generation != connectionGeneration || status[step] == Status.WORKING)) return@post
if (status[step] != Status.WORKING) status[step] = if (ok) Status.DONE else Status.TODO
val last = output.lines().lastOrNull { it.isNotBlank() && !noise(it.trim()) }?.trim()?.take(160)
when {
ok -> detail.remove(step)
step == Step.CONNECTION -> detail[step] = app.getString(com.droiddeck.launcher.R.string.agent_connection_off)
step == Step.CONNECTION -> detail[step] = app.getString(
if (QuestExperimental.isSupported()) R.string.agent_connection_quest_off else R.string.agent_connection_off)
step.required && last != null -> detail[step] = last
}
if (ready) AgentHost.prefs(app).edit().putBoolean(completedKey(harness), true).apply()
@@ -61,7 +61,19 @@ object GameEnvironment {
}
fun effective(config: Config, preset: String, scope: String, forceSsbs: Boolean = false): Map<String, String?> =
defaults(preset, forceSsbs) + config.shared + if (scope.isEmpty()) emptyMap() else config.games[scope].orEmpty()
defaults(preset, forceSsbs) + config.shared + if (scope.isEmpty()) emptyMap() else knownGames[scope].orEmpty() + config.games[scope].orEmpty()
/**
* What some Steam games need here whatever the shared settings say; the game's own settings still win.
* GTA III dies at 0042A703 when a new game starts with FEX's reduced x87 precision, as the Rockstar store copy does.
*/
val knownGames: Map<String, Map<String, String?>> = mapOf(
"12100" to mapOf("FEX_X87REDUCEDPRECISION" to "0"),
)
/** [config] with [knownGames] folded under each game's own settings, for the guest to read. */
fun withKnownGames(config: Config): Config =
config.copy(games = config.games + knownGames.mapValues { (scope, known) -> known + config.games[scope].orEmpty() })
fun hasOverride(config: Config, scope: String, name: String): Boolean =
scope.isNotEmpty() && config.entries(scope).containsKey(name)
@@ -78,7 +90,7 @@ object GameEnvironment {
val entries = config.games[scope].orEmpty()
if (FexPreset.environmentKeys.none(entries::containsKey)) return null
return FexPreset.all.firstOrNull { preset ->
val expected = FexPreset.environment(preset.id)
val expected = presetFor(scope, preset.id)
FexPreset.environmentKeys.all { key -> entries.containsKey(key) && entries[key] == expected[key] }
}?.id ?: CUSTOM_FEX_PRESET
}
@@ -88,12 +100,16 @@ object GameEnvironment {
require(preset == null || FexPreset.all.any { it.id == preset })
val entries = config.entries(scope).filterKeys { it !in FexPreset.environmentKeys }.toMutableMap()
if (preset != null) {
val values = FexPreset.environment(preset)
val values = presetFor(scope, preset)
FexPreset.environmentKeys.forEach { key -> entries[key] = values[key] }
}
return config.withEntries(scope, entries)
}
/** A FEX preset as a game gets it: picking one never undoes a fix the game is known to need. */
private fun presetFor(scope: String, preset: String): Map<String, String?> =
FexPreset.environment(preset) + knownGames[scope].orEmpty().filterKeys { it in FexPreset.environmentKeys }
const val CUSTOM_FEX_PRESET = "__custom__"
val syncBackends = listOf(SessionPrefs.SYNC_NTSYNC, SessionPrefs.SYNC_FSYNC, SessionPrefs.SYNC_ESYNC, SessionPrefs.SYNC_WINESERVER)
@@ -1,6 +1,7 @@
package com.droiddeck.launcher.core
import android.content.Context
import android.content.pm.PackageManager
import android.net.Uri
import android.provider.Settings
@@ -19,4 +20,14 @@ object GlobalSettings {
fun developerOptionsOn(context: Context): Boolean = isOn(context, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED)
fun wirelessDebuggingOn(context: Context): Boolean = isOn(context, "adb_wifi_enabled")
/**
* True when it was off and is now on. Quest only, where Settings has no switch for it; it needs
* WRITE_SECURE_SETTINGS granted over adb.
*/
fun turnOnWirelessDebugging(context: Context): Boolean {
if (!com.droiddeck.launcher.session.QuestExperimental.isSupported() || wirelessDebuggingOn(context)) return false
if (context.checkSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) return false
return runCatching { Settings.Global.putInt(context.contentResolver, "adb_wifi_enabled", 1) }.getOrDefault(false)
}
}
@@ -22,6 +22,9 @@ object WirelessAdbFix {
private const val HOST_FILE = "wireless-adb-host.txt"
private const val CONNECTION_FILE = "wireless-adb-connection.txt"
const val LOOPBACK = "127.0.0.1"
private const val TCP_PORT = 5555
private const val WIRELESS_START_MS = 2_000L
private const val NETWORK_PROMPT_MS = 30_000L
private data class SavedConnection(val host: String, val port: Int?)
@@ -55,6 +58,23 @@ object WirelessAdbFix {
writeAtomically(context, File(context.noBackupFilesDir, CONNECTION_FILE), ByteArray(0))
}
/**
* Quest has no pairing screen. adbd in TCP mode (`adb tcpip 5555`) asks "Allow debugging?" for an
* unknown key, and Wireless debugging accepts a key allowed there, so this stands in for pairing.
* Blocks until the prompt is answered or times out.
*/
fun trustOnDevice(context: Context) {
val app = context.applicationContext
// Already trusted, as after a reboot: Wireless debugging takes the key, and port 5555 is closed by then.
val live = if (savedConnection(app) != null) liveConnectAddress(app) else null
if (live != null && acceptsKey(app, live.substringBeforeLast(':').trim('[', ']'), live.substringAfterLast(':').toInt())) return
GlobalSettings.turnOnWirelessDebugging(app)
loadOrCreateIdentity(app)
Kadb.create(LOOPBACK, TCP_PORT, 2_000, 120_000).use { check(it.shell("true").exitCode == 0) }
writeAtomically(app, File(app.noBackupFilesDir, HOST_FILE), LOOPBACK.toByteArray())
writeAtomically(app, File(app.noBackupFilesDir, CONNECTION_FILE), ByteArray(0))
}
private fun savedConnection(context: Context): SavedConnection? {
val directory = context.applicationContext.noBackupFilesDir
if (!File(directory, CERT_FILE).isFile || !File(directory, KEY_FILE).isFile) return null
@@ -78,10 +98,17 @@ object WirelessAdbFix {
fun liveConnectAddress(context: Context): String? {
val app = context.applicationContext
val saved = savedConnection(app) ?: return null
val turnedOn = GlobalSettings.turnOnWirelessDebugging(app)
val host = if (':' in saved.host) "[${saved.host}]" else saved.host
saved.port?.takeIf { answers(saved.host, it) }?.let { return "$host:$it" }
if (!turnedOn) saved.port?.takeIf { answers(saved.host, it) }?.let { return "$host:$it" }
val loopback = runCatching { InetAddress.getByName(saved.host).isLoopbackAddress }.getOrDefault(false)
val port = if (loopback) loopbackAdbPort(app) else findConnectPort(app, saved.host, accept = { answers(saved.host, it) })
// Turning it on can first ask "Allow wireless debugging on this network?", so keep looking while that is answered.
val deadline = android.os.SystemClock.elapsedRealtime() + if (turnedOn) NETWORK_PROMPT_MS else 0L
var port: Int?
do {
if (turnedOn) Thread.sleep(WIRELESS_START_MS)
port = if (loopback) loopbackAdbPort(app) else findConnectPort(app, saved.host, accept = { answers(saved.host, it) })
} while (port == null && android.os.SystemClock.elapsedRealtime() < deadline)
port ?: return null
saveConnection(app, saved.host, port)
return "$host:$port"
@@ -105,10 +132,12 @@ object WirelessAdbFix {
}
}.apply { start() }
}.forEach { it.join() }
return open.sorted().firstOrNull { port -> acceptsKey(app, LOOPBACK, port) }
}
private fun acceptsKey(app: Context, host: String, port: Int): Boolean {
loadOrCreateIdentity(app)
return open.sorted().firstOrNull { port ->
runCatching { Kadb.create(LOOPBACK, port, 1_000, 3_000).use { it.shell("true").exitCode == 0 } }.getOrDefault(false)
}
return runCatching { Kadb.create(host, port, 1_000, 3_000).use { it.shell("true").exitCode == 0 } }.getOrDefault(false)
}
private val EPHEMERAL_PORTS = 32768..60999
@@ -112,8 +112,9 @@ object NativeGuest {
File(BwrapSpawner.hostPath(binds.map { BwrapSpawner.Bind.parse(it) }, root.path, cwd)).takeIf { it.isDirectory } ?: root
/** A process for [guest] (argv) started as proot would with [binds], in guest directory [cwd]. */
fun processBuilder(context: Context, root: File, binds: List<String>, guest: List<String>, cwd: String = "/root"): ProcessBuilder =
ProcessBuilder(command(root, guest.first(), guest.drop(1)))
fun processBuilder(context: Context, root: File, binds: List<String>, guest: List<String>, cwd: String = "/root"): ProcessBuilder {
if (sessionMode == null) prepare(context, root)
return ProcessBuilder(command(root, guest.first(), guest.drop(1)))
.directory(workingDirectory(root, binds, cwd))
.also { builder ->
builder.environment().apply {
@@ -121,6 +122,7 @@ object NativeGuest {
putAll(sessionEnvironment(root, binds, guest.first(), SessionPrefs.guestHostname(context)))
}
}
}
private const val RUNPATH_CONF = "etc/ld.so.conf.d/zz-droiddeck-native.conf"
private val SCAN_DIRS = listOf("usr/lib", "usr/local/lib", "opt")
@@ -149,6 +151,7 @@ object NativeGuest {
}
/** What a rootfs needs before anything runs in it natively; cheap once done. */
@Synchronized
fun prepare(context: Context, root: File) {
val relinked = relinkAbsoluteSymlinks(context, root)
if (relinked > 0) android.util.Log.i(TAG, "native userland: $relinked absolute symlinks made relative")
@@ -114,7 +114,7 @@ object GameEnvironmentStore {
) {
publishGameCores(context)
val stored = config ?: read(context)
val resolved = stored.copy(shared = GameEnvironment.defaults(SessionPrefs.fexPreset(context), SessionPrefs.forceSsbs(context)) + stored.shared)
val resolved = GameEnvironment.withKnownGames(stored).copy(shared = GameEnvironment.defaults(SessionPrefs.fexPreset(context), SessionPrefs.forceSsbs(context)) + stored.shared)
val json = encode(resolved)
val dxvk = TextureFiltering.dxvkOptions(
SessionPrefs.textureAnisotropy(context), SessionPrefs.textureLodBias(context),
@@ -59,13 +59,18 @@ object GameStorage {
return when {
pref == SessionPrefs.GAME_STORAGE_OFF -> null
pref.isEmpty() -> options(context).firstOrNull()?.let { Option(it.name, it.path) }
else -> Option(SessionPrefs.gameStorageLabel(context), pref).takeIf { attached(File(pref)) }
else -> reachable(pref).let { path -> Option(SessionPrefs.gameStorageLabel(context), path).takeIf { attached(File(path)) } }
}
}
fun disconnected(context: Context): Boolean {
val pref = SessionPrefs.gameStorage(context)
return pref.isNotEmpty() && pref != SessionPrefs.GAME_STORAGE_OFF && !attached(File(pref))
return pref.isNotEmpty() && pref != SessionPrefs.GAME_STORAGE_OFF && !attached(File(reachable(pref)))
}
internal fun reachable(path: String, usable: (File) -> Boolean = { it.isDirectory && it.canWrite() }): String {
val alias = UsbLink.storagePath(path)
return if (alias != path && !usable(File(path)) && usable(File(alias))) alias else path
}
internal fun attached(
@@ -1,14 +1,6 @@
package com.droiddeck.launcher.session
import android.content.Context
import android.os.Handler
import android.os.Looper
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.droiddeck.launcher.R
import java.io.File
import java.util.Locale
internal object MemoryReadout {
data class Device(val totalKb: Long, val availableKb: Long, val swapTotalKb: Long, val swapFreeKb: Long) {
@@ -45,8 +37,6 @@ internal object MemoryReadout {
fun androidKb(device: Device, split: Split): Long =
(device.usedKb - split.gameKb - split.droiddeckKb - (split.gpuKb ?: 0)).coerceAtLeast(0)
fun gb(kb: Long): String = String.format(Locale.US, "%.1f", kb / (1024.0 * 1024.0))
fun availableMb(): Long? = runCatching { parseMeminfo(File("/proc/meminfo").readText())?.availableKb?.div(1024) }.getOrNull()
fun device(): Device? = runCatching { parseMeminfo(File("/proc/meminfo").readText()) }.getOrNull()
@@ -116,60 +106,3 @@ object MemoryLog {
thread = null
}
}
class MemoryHud(context: Context) {
var text by mutableStateOf("")
private set
private val context = context.applicationContext
private val handler = Handler(Looper.getMainLooper())
@Volatile private var running = false
@Volatile private var generation = 0
private var thread: Thread? = null
fun refresh() {
if (SessionPrefs.memoryHud(context) == SessionPrefs.MEMORY_HUD_OFF) stop() else start()
}
fun start() {
if (running || SessionPrefs.memoryHud(context) == SessionPrefs.MEMORY_HUD_OFF) return
running = true
val token = ++generation
thread = Thread({
while (running && generation == token) {
val line = runCatching { sample() }.getOrDefault("")
handler.post { if (running && generation == token) text = line }
try { Thread.sleep(PERIOD_MS) } catch (e: InterruptedException) { break }
}
}, "memory-hud").apply { isDaemon = true; start() }
}
fun stop() {
running = false
generation++
thread?.interrupt()
thread = null
text = ""
}
private fun sample(): String {
val device = MemoryReadout.device() ?: return ""
val memory = context.getString(
R.string.memory_hud_simple,
MemoryReadout.gb(device.usedKb), MemoryReadout.gb(device.totalKb),
MemoryReadout.gb(device.swapUsedKb), MemoryReadout.gb(device.swapTotalKb),
)
if (SessionPrefs.memoryHud(context) != SessionPrefs.MEMORY_HUD_ADVANCED) return memory
val split = MemoryReadout.split()
val parts = context.getString(
R.string.memory_hud_split,
MemoryReadout.gb(split.gameKb), MemoryReadout.gb(split.droiddeckKb), MemoryReadout.gb(MemoryReadout.androidKb(device, split)),
)
val gpu = split.gpuKb?.let { context.getString(R.string.memory_hud_gpu, MemoryReadout.gb(it)) }
return listOfNotNull(memory, parts, gpu).joinToString("\n")
}
private companion object {
const val PERIOD_MS = 2000L
}
}
@@ -46,7 +46,16 @@ object SecondaryLibrary {
}
fun privateRoot(files: File, library: File): File {
val digest = MessageDigest.getInstance("SHA-256").digest(library.canonicalPath.toByteArray())
val own = privateDir(files, library.canonicalPath)
if (own.exists()) return own
val raw = UsbLink.rawPath(library.absolutePath)
val alias = if (raw != library.absolutePath) raw else UsbLink.storagePath(library.absolutePath)
if (alias == library.absolutePath) return own
return privateDir(files, runCatching { File(alias).canonicalPath }.getOrDefault(alias)).takeIf { it.exists() } ?: own
}
private fun privateDir(files: File, path: String): File {
val digest = MessageDigest.getInstance("SHA-256").digest(path.toByteArray())
.joinToString("") { "%02x".format(it.toInt() and 255) }
return File(files, "steam-libraries/$digest")
}
@@ -35,6 +35,7 @@ object SessionFiles {
"usr/local/bin/kwin_wayland_wrapper" to "usr/local/bin/kwin_wayland_wrapper",
"usr/lib/firefox/defaults/pref/droiddeck.js" to "usr/lib/firefox/defaults/pref/droiddeck.js",
"etc/xdg/autostart/droiddeck-clipboard.desktop" to "etc/xdg/autostart/droiddeck-clipboard.desktop",
"usr/share/applications/droiddeck-return-gaming.desktop" to "usr/share/applications/droiddeck-return-gaming.desktop",
"etc/xdg/fastfetch/config.jsonc" to "etc/xdg/fastfetch/config.jsonc",
)
@@ -587,13 +587,6 @@ object SessionPrefs {
prefs(context).edit().putBoolean("hudGraph", on).apply()
}
fun hudColor(context: Context): String =
prefs(context).getString("hudColor", HUD_COLOR_MINT)?.takeIf { it in HUD_COLORS } ?: HUD_COLOR_MINT
fun setHudColor(context: Context, color: String) {
if (color in HUD_COLORS) prefs(context).edit().putString("hudColor", color).apply()
}
fun hudOpacity(context: Context): Int =
prefs(context).getInt("hudOpacity", HUD_OPACITY_DEFAULT).takeIf { it in HUD_OPACITY_RANGE } ?: HUD_OPACITY_DEFAULT
@@ -650,8 +643,6 @@ object SessionPrefs {
prefs(context).edit().putString("__KEEP_droidDeckHudPos__", "$x,$y").apply()
}
const val HUD_COLOR_MINT = "mint"
val HUD_COLORS = listOf(HUD_COLOR_MINT, "white", "sky", "amber", "violet")
val HUD_OPACITY_RANGE = 30..100
const val HUD_OPACITY_DEFAULT = 70
@@ -1383,18 +1374,6 @@ object SessionPrefs {
prefs(context).edit().putInt("backgroundAppLimit", limit).apply()
}
const val MEMORY_HUD_OFF = "off"
const val MEMORY_HUD_SIMPLE = "simple"
const val MEMORY_HUD_ADVANCED = "advanced"
fun memoryHud(context: Context): String =
prefs(context).getString("memoryHud", MEMORY_HUD_OFF)
?.takeIf { it == MEMORY_HUD_SIMPLE || it == MEMORY_HUD_ADVANCED } ?: MEMORY_HUD_OFF
fun setMemoryHud(context: Context, value: String) {
require(value == MEMORY_HUD_OFF || value == MEMORY_HUD_SIMPLE || value == MEMORY_HUD_ADVANCED)
prefs(context).edit().putString("memoryHud", value).apply()
}
fun storageDiagnosticsEnabled(context: Context): Boolean =
prefs(context).getBoolean("storageDiagnostics", false)
@@ -121,6 +121,8 @@ object StoresState {
var unfinished by mutableStateOf<List<StoreInstallRoot.Unfinished>>(emptyList())
internal set
var steamPicking by mutableStateOf<CatalogItem?>(null)
fun isUnfinished(item: CatalogItem): Boolean = unfinished.any {
it.store == item.store && (it.id == item.id || (it.id == null && it.folder.name == StoreInstallRoot.folderName(item.title, item.id)))
}
@@ -7,6 +7,7 @@ import com.droiddeck.launcher.R
import com.droiddeck.launcher.frontend.AddedGames
import com.droiddeck.launcher.runtime.BattleNet
import com.droiddeck.launcher.runtime.LinuxRuntime
import com.droiddeck.launcher.session.GameStorage
import com.droiddeck.launcher.stores.CatalogItem
import com.droiddeck.launcher.stores.InstalledStoreGame
import com.droiddeck.launcher.stores.Store
@@ -130,13 +131,13 @@ object BattleNetClient {
StoresState.post { opener?.invoke(args) }
}
fun library(context: Context, root: File = preferred(context)): List<String> =
AddedGames.guestPath(context, StoreInstallRoot.storeDir(root, Store.BATTLENET))?.let { listOf("--library", it) }.orEmpty()
fun library(context: Context, root: File? = preferred(context)): List<String> =
root?.let { AddedGames.guestPath(context, StoreInstallRoot.storeDir(it, Store.BATTLENET)) }?.let { listOf("--library", it) }.orEmpty()
internal fun preferred(context: Context): File {
internal fun preferred(context: Context): File? {
val second = StoreInstallRoot.libraryRoot(context)?.absolutePath
return StoreInstallRoot.targets(context).firstOrNull { it.root.absolutePath == second && (it.root.isDirectory || it.root.mkdirs()) }?.root
?: StoreInstallRoot.internalRoot(context)
?: StoreInstallRoot.internalRoot(context).takeIf { second == null && !GameStorage.disconnected(context) }
}
fun installGame(context: Context, uid: String, root: File) {
@@ -6,9 +6,6 @@ import android.net.Uri
import android.util.Log
import android.widget.Toast
import androidx.annotation.StringRes
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.droiddeck.launcher.R
import com.droiddeck.launcher.frontend.Library
import com.droiddeck.launcher.session.SessionService
@@ -46,8 +43,6 @@ internal object SteamStore {
/** InvalidPassword, AccessDenied, AccountNotFound, Revoked, Expired, AccountLogonDenied. */
private val REFUSALS = setOf(5, 15, 18, 26, 27, 63)
var picking by mutableStateOf<CatalogItem?>(null)
class Plan(val installDir: String, val downloadBytes: Long, val installBytes: Long, val buildId: String, val linuxBuild: Boolean) {
companion object {
fun of(json: JSONObject): Plan? {
@@ -222,7 +217,7 @@ internal object SteamStore {
toast(context, R.string.steam_store_close_steam)
return
}
picking = item
StoresState.steamPicking = item
}
fun install(context: Context, item: CatalogItem, target: SteamClient.Target) {
@@ -94,17 +94,16 @@ internal object XboxManifest {
}
fun executable(folder: File): String {
for (path in read(folder).executables) {
val listed = read(folder).executables
for (path in listed) {
require(!path.startsWith('/') && !path.contains(':') && path.split('/').none { it == ".." || it.isEmpty() })
var file = folder
for (part in path.split('/')) {
val matches = file.listFiles().orEmpty().filter { it.name.equals(part, true) }
require(matches.size == 1) { "Missing or ambiguous Xbox launch path." }
file = matches.single()
}
val file = path.split('/').fold<String, File?>(folder) { dir, part ->
dir?.listFiles().orEmpty().filter { it.name.equals(part, true) }.singleOrNull()
} ?: continue
require(file.canonicalPath.startsWith(folder.canonicalPath + File.separator))
if (file.isFile) return forwarded(folder, file) ?: file.relativeTo(folder).invariantSeparatorsPath
}
require(listed.isEmpty()) { "Missing or ambiguous Xbox launch path." }
error("The Xbox package has no supported PC launch executable.")
}
@@ -46,6 +46,7 @@ import androidx.compose.ui.platform.testTag
import com.droiddeck.launcher.agent.AgentSetup.Status
import com.droiddeck.launcher.agent.AgentSetup.Step
import com.droiddeck.launcher.core.WirelessAdbPairingService
import com.droiddeck.launcher.session.QuestExperimental
@Composable
internal fun AgentSetupView(modifier: Modifier, firstControl: Modifier = Modifier, onDone: () -> Unit = {}) {
@@ -104,11 +105,16 @@ internal fun AgentSetupView(modifier: Modifier, firstControl: Modifier = Modifie
var keyOpen by rememberSaveable(harness.id) { mutableStateOf(false) }
val (title, hint) = labels(step, harness.name, keyed)
val lab = AgentHost.lab?.takeIf { it.prepare && it.running }
val questConnection = step == Step.CONNECTION && status != Status.DONE && QuestExperimental.isSupported()
val detail = when {
step == Step.PREPARE && lab != null ->
stringResource(R.string.agent_prepare_progress, lab.permille / 10, clock(lab.etaSeconds.toLong().coerceAtLeast(0)))
keyed && status == Status.DONE && AgentSetup.detail[step] == null ->
harness.providers.filter { it.id in AgentSetup.keys }.joinToString(" · ") { it.name }.ifEmpty { stringResource(R.string.agent_step_free_models) }
// The Quest hint holds the one-time commands, so it stays under the status until the step passes.
questConnection -> AgentSetup.detail[step]?.let { "$it\n$hint" } ?: hint
// The Quest hint is setup instructions; once connected, the row says what it is for.
step == Step.CONNECTION && QuestExperimental.isSupported() -> AgentSetup.detail[step] ?: stringResource(R.string.agent_step_connection_hint)
else -> AgentSetup.detail[step] ?: hint
}
// Shown while the sign-in is pending, so it is still there after a trip to the browser for the key.
@@ -121,6 +127,7 @@ internal fun AgentSetupView(modifier: Modifier, firstControl: Modifier = Modifie
Status.TODO, Status.FAILED -> CheckState.WARN
},
title, detail, divider = index < steps.lastIndex && !showKey,
detailLines = if (questConnection) Int.MAX_VALUE else 2,
) {
val blocked = (step in setOf(Step.SIGN_IN, Step.GITHUB, Step.BUILD_TOOLS) && AgentSetup.status[Step.INSTALL] != Status.DONE) ||
(step == Step.PREPARE && AgentSetup.status[Step.BUILD_TOOLS] != Status.DONE)
@@ -258,7 +265,9 @@ internal fun agentStorageWarning(item: AgentStorage.Item) = when (item) {
@Composable
private fun labels(step: Step, harness: String, keyed: Boolean = false): Pair<String, String> = when (step) {
Step.CONNECTION -> stringResource(R.string.agent_step_connection) to stringResource(R.string.agent_step_connection_hint)
Step.CONNECTION -> stringResource(R.string.agent_step_connection) to
if (QuestExperimental.isSupported()) stringResource(R.string.agent_step_connection_quest_hint, LocalContext.current.packageName)
else stringResource(R.string.agent_step_connection_hint)
Step.INSTALL -> stringResource(R.string.agent_step_install, harness) to stringResource(R.string.agent_step_install_hint)
Step.SIGN_IN -> stringResource(R.string.agent_step_sign_in, harness) to stringResource(if (keyed) R.string.agent_step_sign_in_key_hint else R.string.agent_step_sign_in_hint)
Step.GITHUB -> stringResource(R.string.agent_step_github) to stringResource(R.string.agent_step_github_hint)
@@ -267,7 +276,7 @@ private fun labels(step: Step, harness: String, keyed: Boolean = false): Pair<St
}
private fun action(step: Step): Int = when (step) {
Step.CONNECTION -> R.string.agent_action_pair
Step.CONNECTION -> if (QuestExperimental.isSupported()) R.string.agent_action_allow else R.string.agent_action_pair
Step.INSTALL -> R.string.agent_action_install
Step.SIGN_IN, Step.GITHUB -> R.string.agent_action_sign_in
Step.BUILD_TOOLS -> R.string.agent_action_install
@@ -276,6 +285,7 @@ private fun action(step: Step): Int = when (step) {
/** The pairing DroidDeck already uses for the phantom process fix; the agent reuses its key. */
private fun pair(context: android.content.Context) {
if (QuestExperimental.isSupported()) return AgentSetup.trustOnDevice(context)
if (!WirelessAdbPairingService.notificationsEnabled(context)) {
context.startActivity(android.content.Intent(android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS)
.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE, context.packageName)
@@ -120,7 +120,6 @@ class FrontEndState(
val clearCachedApps: Boolean = false,
val adbPaired: Boolean = false,
val backgroundAppLimit: Int = -1,
val memoryHud: String = "off",
val tpUbwcMode: String? = null,
val tpUbwcRestartRequired: Boolean = false,
val canRestartApp: Boolean = false,
@@ -263,7 +262,6 @@ class FrontEndActions(
val onBuildWatermark: () -> Unit = {},
val onSteamGpuDrawing: () -> Unit = {},
val onClearCachedApps: (Boolean) -> Unit = {},
val onMemoryHud: (String) -> Unit = {},
val onTpUbwcMode: (String) -> Unit = {},
val onRestartApp: () -> Unit = {},
val onBackgroundAppLimit: (Int) -> Unit = {},
@@ -847,7 +845,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
com.droiddeck.launcher.stores.StoresState.pendingInstall?.let { item -> StoreTheme(item.store) { InstallWhere(item) } }
com.droiddeck.launcher.stores.StoresState.itchPicking?.let { item -> StoreTheme(item.store) { ItchBuildPicker(item) { com.droiddeck.launcher.stores.StoresState.itchPicking = null } } }
com.droiddeck.launcher.stores.StoresState.gameJoltPicking?.let { item -> StoreTheme(item.store) { GameJoltBuildPicker(item) { com.droiddeck.launcher.stores.StoresState.gameJoltPicking = null } } }
com.droiddeck.launcher.stores.steam.SteamStore.picking?.let { item -> StoreTheme(item.store) { SteamInstallWhereDialog(item) { com.droiddeck.launcher.stores.steam.SteamStore.picking = null } } }
com.droiddeck.launcher.stores.StoresState.steamPicking?.let { item -> StoreTheme(item.store) { SteamInstallWhereDialog(item) { com.droiddeck.launcher.stores.StoresState.steamPicking = null } } }
StepsLayer(screenAt)
UiZooSheet()
SessionDrawerPreview(s.secondScreenDisplays)
@@ -103,7 +103,7 @@ internal object SetupTabs {
}
@Composable
internal fun CheckRow(state: CheckState, title: String, detail: String?, divider: Boolean = true, action: (@Composable () -> Unit)? = null) {
internal fun CheckRow(state: CheckState, title: String, detail: String?, divider: Boolean = true, detailLines: Int = 2, action: (@Composable () -> Unit)? = null) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val tint = when (state) {
@@ -135,7 +135,7 @@ internal fun CheckRow(state: CheckState, title: String, detail: String?, divider
}
Column(modifier = Modifier.weight(1f)) {
Text(title, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
if (detail != null) Text(detail, fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 2, overflow = TextOverflow.Ellipsis)
if (detail != null) Text(detail, fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = detailLines, overflow = TextOverflow.Ellipsis)
}
if (action != null) action()
}
@@ -736,15 +736,6 @@ private fun MemoryGroup(s: FrontEndState, a: FrontEndActions, host: MenuHost, on
s.backgroundAppLimit, enabled = s.adbPaired || s.backgroundAppLimit != com.droiddeck.launcher.core.BackgroundAppLimit.OFF,
onPick = a.onBackgroundAppLimit,
)
ChoiceRow(
host, "memory-hud", stringResource(R.string.setup_memory_hud), stringResource(R.string.setup_memory_hud_hint),
listOf(
com.droiddeck.launcher.session.SessionPrefs.MEMORY_HUD_OFF to stringResource(R.string.game_env_off),
com.droiddeck.launcher.session.SessionPrefs.MEMORY_HUD_SIMPLE to stringResource(R.string.setup_memory_hud_simple),
com.droiddeck.launcher.session.SessionPrefs.MEMORY_HUD_ADVANCED to stringResource(R.string.setup_memory_hud_advanced),
),
s.memoryHud, onPick = a.onMemoryHud,
)
if (!s.adbPaired) ActionRow(
stringResource(R.string.setup_adb_pair), stringResource(R.string.setup_adb_pair_hint),
stringResource(R.string.setup_adb_pair_button), onPairWirelessDebugging,
@@ -174,14 +174,15 @@ private fun InputSettingsContent(onBack: () -> Unit, onChanged: () -> Unit, embe
detail = if (library.usersOfBindings(b.id).size > 1) stringResource(R.string.input_shared_detail, b.name, library.usersOfBindings(b.id).size)
else "${profile.name} · ${roleLabel(role)}", onSave = { action ->
if (update { l ->
val currentPreset = l.preset(editing.preset)
val geometry = if (!editing.click && elementProperties != null && layout != null) l.withLayout(layout.copy(elements = layout.elements.map {
if (it.id == elementProperties!!.id) elementProperties!!.copy(name = elementProperties!!.name.trim().ifBlank { it.name }) else it
})) else l
geometry.withPreset(when {
editing.element != null && editing.click -> b.copy(clicks = b.clicks + (editing.element.id to action))
editing.element != null -> b.copy(elements = b.elements + (editing.element.id to action))
editing.key != null -> b.copy(keys = b.keys.filterNot { it.key == editing.key } + PhysicalInputBinding(editing.key, action))
else -> b.copy(controls = b.controls + (editing.control to action))
editing.element != null && editing.click -> currentPreset.copy(clicks = currentPreset.clicks + (editing.element.id to action))
editing.element != null -> currentPreset.copy(elements = currentPreset.elements + (editing.element.id to action))
editing.key != null -> currentPreset.copy(keys = currentPreset.keys.filterNot { it.key == editing.key } + PhysicalInputBinding(editing.key, action))
else -> currentPreset.copy(controls = currentPreset.controls + (editing.control to action))
}) }) edit = null
})
} else if (!surface) key(page, profileId, role) {
@@ -195,6 +195,10 @@ internal fun librarySources(
}
}
internal fun alwaysLibraryTabs(signedIn: Collection<Store>, stores: Boolean, soundMode: Boolean): Set<String> =
(if (soundMode) emptyList() else signedIn.map { it.librarySource }).toSet() +
listOfNotNull(Library.ADDED.takeIf { stores }, Store.BATTLENET.id.takeIf { stores })
internal object LibraryDisplay {
const val DEFAULT_LEVEL = 2
val scales = listOf(0.75f, 0.875f, 1f, 1.2f, 1.45f)
@@ -374,7 +378,7 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String,
.map { it.store.id }.toSet()
val sources = librarySources(
all, storeTabs.map { it.store.id },
listOfNotNull(Store.ITCH.id.takeIf { itchSignedIn && !soundMode }, Store.GAMEJOLT.id.takeIf { gameJoltSignedIn && !soundMode }, Library.ADDED.takeIf { stores }, Store.BATTLENET.id.takeIf { stores }).toSet() + signInChips,
alwaysLibraryTabs(owned.keys, stores, soundMode) + signInChips,
favorites, concealed,
offStores = if (soundMode) emptySet() else storeTabs.filterNot { it.shown }.map { it.store.id }.toSet(),
places = if (soundMode) DEFAULT_LIBRARY_PLACES else StoreTabsState.libraryPlaces,
@@ -79,48 +79,6 @@ import androidx.compose.ui.text.style.LineHeightStyle
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.platform.testTag
@Composable
fun HudText(text: String, color: String = "mint", opacity: Int = 70) {
if (text.isEmpty()) return
val accent = hudInk(color)
val wash = (opacity.coerceIn(30, 100) / 100f)
val ink = accent.copy(alpha = (0.5f + wash * 0.5f).coerceIn(0.62f, 1f))
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.TopEnd) {
Column(
horizontalAlignment = Alignment.End,
modifier = Modifier
.padding(12.dp)
.background(
Brush.verticalGradient(
listOf(accent.copy(alpha = wash * 0.28f), Color.Black.copy(alpha = wash * 0.72f)),
),
RoundedCornerShape(8.dp),
)
.padding(horizontal = 8.dp, vertical = 5.dp),
) {
Text(
text,
fontFamily = FontFamily.Monospace,
fontSize = 12.sp,
color = ink,
textAlign = TextAlign.End,
)
}
}
}
private fun hudInk(color: String): Color = Color(
when (color) {
"white" -> 0xFFF2F5F8
"sky" -> 0xFF66C0F4
"amber" -> 0xFFFFB74D
"violet" -> 0xFFD0A2FF
else -> 0xFF3DDC84
}.toInt(),
)
private class LoadStage(@androidx.annotation.StringRes val label: Int, @androidx.annotation.StringRes val detail: Int)
private fun loadStages(steam: Boolean): List<LoadStage> = if (steam) listOf(
@@ -78,7 +78,6 @@ internal object SettingsIndex {
s(SettingsSection.PERFORMANCE, R.string.perf_gpuclock, "gpu", "clock", "max"),
s(SettingsSection.PERFORMANCE, R.string.setup_clear_cached, "memory", "ram", "crash", "sleep", "killed"),
s(SettingsSection.PERFORMANCE, R.string.setup_bg_limit, "memory", "ram", "background apps"),
s(SettingsSection.PERFORMANCE, R.string.setup_memory_hud, "memory", "ram", "overlay"),
s(SettingsSection.PERFORMANCE, R.string.perf_sysmem),
s(SettingsSection.PERFORMANCE, R.string.perf_xalia),
s(SettingsSection.PERFORMANCE, R.string.perf_esync, "esync", "sync", "wine"),
+5 -7
View File
@@ -1265,6 +1265,11 @@
<string name="agent_action_prepare">تحضير</string>
<string name="agent_connection_off">تعذّر الوصول إلى تصحيح الأخطاء اللاسلكي؛ زر الاقتران يشغّله</string>
<string name="agent_action_pair">اقتران</string>
<string name="agent_step_connection_quest_hint">لا يحتوي Quest على شاشة اقتران. من حاسوب، شغّل مرة واحدة: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS و adb tcpip 5555. ثم اضغط «السماح» واقبل الطلب في النظارة</string>
<string name="agent_action_allow">السماح</string>
<string name="agent_connection_quest_waiting">اقبل «السماح بتصحيح الأخطاء؟» في النظارة مع تحديد «السماح دائمًا»</string>
<string name="agent_connection_quest_failed">تعذّر الاتصال. اقبل طلب تصحيح الأخطاء في النظارة، وإن لم يظهر، شغّل adb tcpip 5555 من حاسوب ثم حاول مجددًا</string>
<string name="agent_connection_quest_off">تعذّر الوصول إلى تصحيح الأخطاء اللاسلكي. اضغط «السماح» لإعداده من جديد</string>
<string name="agent_action_install">تثبيت</string>
<string name="agent_action_sign_in">تسجيل الدخول</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3957,13 +3962,6 @@
<string name="setup_clear_cached">إغلاق التطبيقات المخزّنة مؤقتًا قبل الجلسة</string>
<string name="setup_clear_cached_hint">عند بدء الجلسة، يُغلق DroidDeck التطبيقات التي يُبقيها Android في الخلفية، لتحصل اللعبة على ذاكرة أكبر. يجب تفعيل تصحيح الأخطاء اللاسلكي.</string>
<string name="setup_clear_cached_unpaired">يتطلّب إقران DroidDeck بتصحيح الأخطاء اللاسلكي (إقران، أدناه).</string>
<string name="setup_memory_hud">مؤشر الذاكرة</string>
<string name="setup_memory_hud_hint">الذاكرة وswap المستخدمة، على شاشة الجلسة. يقسّمها الوضع المتقدّم بين اللعبة وDroidDeck وAndroid وGPU.</string>
<string name="setup_memory_hud_simple">بسيط</string>
<string name="setup_memory_hud_advanced">متقدّم</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">اللعبة %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">التطبيقات في الخلفية أثناء الجلسة</string>
<string name="setup_bg_limit_hint">أثناء تشغيل الجلسة، يُبقي Android هذا العدد من التطبيقات كحد أقصى في الذاكرة المؤقتة ويُغلق الباقي، لتحصل اللعبة على ذاكرتها. يُعيد DroidDeck الحد إلى ما كان عليه عند انتهاء الجلسة. يجب تفعيل تصحيح الأخطاء اللاسلكي.</string>
<string name="setup_bg_limit_4">4 كحد أقصى</string>
+5 -7
View File
@@ -1280,6 +1280,11 @@
<string name="agent_action_prepare">Preparar</string>
<string name="agent_connection_off">No se puede acceder a la depuración inalámbrica; Vincular la activa</string>
<string name="agent_action_pair">Vincular</string>
<string name="agent_step_connection_quest_hint">Quest no tiene pantalla de vinculación. Desde una computadora, ejecuta una vez: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS y adb tcpip 5555. Luego toca Permitir y acepta el aviso en el visor</string>
<string name="agent_action_allow">Permitir</string>
<string name="agent_connection_quest_waiting">Acepta «¿Permitir depuración?» en el visor, con Permitir siempre marcado</string>
<string name="agent_connection_quest_failed">No se pudo conectar. Acepta el aviso de depuración en el visor o, si no apareció, ejecuta adb tcpip 5555 desde una computadora y vuelve a intentarlo</string>
<string name="agent_connection_quest_off">No se puede acceder a la depuración inalámbrica. Toca Permitir para configurarla de nuevo</string>
<string name="agent_action_install">Instalar</string>
<string name="agent_action_sign_in">Iniciar sesión</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3840,13 +3845,6 @@
<string name="setup_clear_cached">Cerrar apps en caché antes de una sesión</string>
<string name="setup_clear_cached_hint">Al iniciar una sesión, DroidDeck cierra las apps que Android mantiene en segundo plano para que el juego tenga más memoria. La Depuración inalámbrica debe estar activada.</string>
<string name="setup_clear_cached_unpaired">DroidDeck debe estar vinculado con la Depuración inalámbrica (Vincular, abajo).</string>
<string name="setup_memory_hud">Indicador de memoria</string>
<string name="setup_memory_hud_hint">Memoria y swap en uso, en la pantalla de la sesión. Avanzado lo divide entre el juego, DroidDeck, Android y la GPU.</string>
<string name="setup_memory_hud_simple">Simple</string>
<string name="setup_memory_hud_advanced">Avanzado</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">juego %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Apps en segundo plano durante una sesión</string>
<string name="setup_bg_limit_hint">Mientras una sesión está en curso, Android mantiene en caché como máximo esta cantidad de apps y cierra las demás para que el juego use su memoria. DroidDeck restablece el límite anterior cuando termina la sesión. La Depuración inalámbrica debe estar activada.</string>
<string name="setup_bg_limit_4">Como máximo 4</string>
+5 -7
View File
@@ -1249,6 +1249,11 @@
<string name="agent_action_prepare">Подготви</string>
<string name="agent_connection_off">Безжичното отстраняване на грешки не е достъпно; сдвояването го включва</string>
<string name="agent_action_pair">Сдвой</string>
<string name="agent_step_connection_quest_hint">Quest няма екран за сдвояване. От компютър изпълнете веднъж: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS и adb tcpip 5555. След това докоснете „Разреши“ и приемете запитването в шлема</string>
<string name="agent_action_allow">Разреши</string>
<string name="agent_connection_quest_waiting">Приемете „Разрешаване на отстраняването на грешки?“ в шлема с отметка „Винаги разрешавай“</string>
<string name="agent_connection_quest_failed">Неуспешно свързване. Приемете запитването за отстраняване на грешки в шлема, а ако не се е появило, изпълнете adb tcpip 5555 от компютър и опитайте отново</string>
<string name="agent_connection_quest_off">Безжичното отстраняване на грешки не е достъпно. Докоснете „Разреши“, за да го настроите отново</string>
<string name="agent_action_install">Инсталирай</string>
<string name="agent_action_sign_in">Влез</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3801,13 +3806,6 @@
<string name="setup_clear_cached">Затваряне на кешираните приложения преди сесия</string>
<string name="setup_clear_cached_hint">При стартиране на сесия DroidDeck затваря приложенията, които Android държи във фонов режим, за да има играта повече памет. Безжичното отстраняване на грешки трябва да е включено.</string>
<string name="setup_clear_cached_unpaired">Изисква DroidDeck да е сдвоен чрез безжично отстраняване на грешки (Сдвояване, по-долу).</string>
<string name="setup_memory_hud">Показател за паметта</string>
<string name="setup_memory_hud_hint">Използвана памет и swap на екрана на сесията. Разширеният режим я разделя между играта, DroidDeck, Android и GPU.</string>
<string name="setup_memory_hud_simple">Опростен</string>
<string name="setup_memory_hud_advanced">Разширен</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">игра %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Фонови приложения по време на сесия</string>
<string name="setup_bg_limit_hint">Докато сесията работи, Android държи в кеша най-много толкова приложения и затваря останалите, за да получи играта тяхната памет. DroidDeck връща предишното ограничение, когато сесията приключи. Безжичното отстраняване на грешки трябва да е включено.</string>
<string name="setup_bg_limit_4">Най-много 4</string>
+5 -7
View File
@@ -1257,6 +1257,11 @@
<string name="agent_action_prepare">Připravit</string>
<string name="agent_connection_off">Bezdrátové ladění není dostupné; Spárovat ho zapne</string>
<string name="agent_action_pair">Spárovat</string>
<string name="agent_step_connection_quest_hint">Quest nemá obrazovku párování. Z počítače jednou spusťte: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS a adb tcpip 5555. Pak klepněte na Povolit a potvrďte výzvu v headsetu</string>
<string name="agent_action_allow">Povolit</string>
<string name="agent_connection_quest_waiting">V headsetu potvrďte „Povolit ladění?“ se zaškrtnutým Vždy povolit</string>
<string name="agent_connection_quest_failed">Nepodařilo se připojit. Potvrďte výzvu k ladění v headsetu, a pokud se neobjevila, spusťte z počítače adb tcpip 5555 a zkuste to znovu</string>
<string name="agent_connection_quest_off">Bezdrátové ladění není dostupné. Klepnutím na Povolit ho nastavíte znovu</string>
<string name="agent_action_install">Instalovat</string>
<string name="agent_action_sign_in">Přihlásit se</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3879,13 +3884,6 @@
<string name="setup_clear_cached">Zavřít aplikace v mezipaměti před relací</string>
<string name="setup_clear_cached_hint">Při spuštění relace DroidDeck zavře aplikace, které Android drží na pozadí, aby hra měla více paměti. Musí být zapnuté Bezdrátové ladění.</string>
<string name="setup_clear_cached_unpaired">Vyžaduje DroidDeck spárovaný přes Bezdrátové ladění (Spárovat, níže).</string>
<string name="setup_memory_hud">Ukazatel paměti</string>
<string name="setup_memory_hud_hint">Využitá paměť a swap na obrazovce relace. Pokročilé zobrazení ji rozdělí na hru, DroidDeck, Android a GPU.</string>
<string name="setup_memory_hud_simple">Jednoduché</string>
<string name="setup_memory_hud_advanced">Pokročilé</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">hra %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Aplikace na pozadí během relace</string>
<string name="setup_bg_limit_hint">Během relace Android ponechá v mezipaměti nejvýše tolik aplikací a ostatní zavře, aby hra dostala jejich paměť. Po skončení relace DroidDeck vrátí limit na původní hodnotu. Musí být zapnuté Bezdrátové ladění.</string>
<string name="setup_bg_limit_4">Nejvýše 4</string>
+5 -7
View File
@@ -1249,6 +1249,11 @@
<string name="agent_action_prepare">Forbered</string>
<string name="agent_connection_off">Trådløs fejlfinding kan ikke nås; Par slår den til</string>
<string name="agent_action_pair">Par</string>
<string name="agent_step_connection_quest_hint">Quest har ingen parringsskærm. Kør én gang fra en computer: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS og adb tcpip 5555. Tryk derefter på Tillad, og godkend prompten i headsettet</string>
<string name="agent_action_allow">Tillad</string>
<string name="agent_connection_quest_waiting">Godkend “Tillad fejlretning?” i headsettet med Tillad altid markeret</string>
<string name="agent_connection_quest_failed">Kunne ikke oprette forbindelse. Godkend fejlretningsprompten i headsettet, eller kør adb tcpip 5555 fra en computer og prøv igen, hvis den ikke dukkede op</string>
<string name="agent_connection_quest_off">Trådløs fejlretning kan ikke nås. Tryk på Tillad for at konfigurere den igen</string>
<string name="agent_action_install">Installer</string>
<string name="agent_action_sign_in">Log ind</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3801,13 +3806,6 @@
<string name="setup_clear_cached">Luk cachelagrede apps før en session</string>
<string name="setup_clear_cached_hint">Når en session starter, lukker DroidDeck de apps, Android holder parkeret i baggrunden, så spillet får mere hukommelse. Trådløs fejlretning skal være slået til.</string>
<string name="setup_clear_cached_unpaired">Kræver, at DroidDeck er parret med Trådløs fejlretning (Par, nedenfor).</string>
<string name="setup_memory_hud">Hukommelsesvisning</string>
<string name="setup_memory_hud_hint">Hukommelse og swap i brug på sessionsskærmen. Avanceret fordeler det på spillet, DroidDeck, Android og GPU\'en.</string>
<string name="setup_memory_hud_simple">Enkel</string>
<string name="setup_memory_hud_advanced">Avanceret</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">spil %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Baggrundsapps under en session</string>
<string name="setup_bg_limit_hint">Mens en session kører, holder Android højst så mange apps i cache og lukker resten, så spillet får deres hukommelse. DroidDeck sætter grænsen tilbage, som den var, når sessionen slutter. Trådløs fejlretning skal være slået til.</string>
<string name="setup_bg_limit_4">Højst 4</string>
+5 -7
View File
@@ -1241,6 +1241,11 @@
<string name="agent_action_prepare">Vorbereiten</string>
<string name="agent_connection_off">Wireless-Debugging ist nicht erreichbar; Koppeln schaltet es ein</string>
<string name="agent_action_pair">Koppeln</string>
<string name="agent_step_connection_quest_hint">Quest hat keinen Kopplungsbildschirm. Führe einmal an einem Computer aus: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS und adb tcpip 5555. Tippe dann auf Zulassen und bestätige die Abfrage im Headset</string>
<string name="agent_action_allow">Zulassen</string>
<string name="agent_connection_quest_waiting">Bestätige „Debugging zulassen?“ im Headset mit aktiviertem „Immer zulassen“</string>
<string name="agent_connection_quest_failed">Verbindung fehlgeschlagen. Bestätige die Debugging-Abfrage im Headset. Falls keine erschienen ist, führe adb tcpip 5555 an einem Computer aus und versuche es erneut</string>
<string name="agent_connection_quest_off">Kabelloses Debugging ist nicht erreichbar. Tippe auf Zulassen, um es neu einzurichten</string>
<string name="agent_action_install">Installieren</string>
<string name="agent_action_sign_in">Anmelden</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3801,13 +3806,6 @@
<string name="setup_clear_cached">Apps im Cache vor einer Sitzung schließen</string>
<string name="setup_clear_cached_hint">Beim Start einer Sitzung schließt DroidDeck die Apps, die Android im Hintergrund vorhält, damit das Spiel mehr Arbeitsspeicher hat. „Debugging über WLAN“ muss aktiviert sein.</string>
<string name="setup_clear_cached_unpaired">DroidDeck muss über „Debugging über WLAN“ gekoppelt sein (Koppeln, unten).</string>
<string name="setup_memory_hud">Speicheranzeige</string>
<string name="setup_memory_hud_hint">Belegter Arbeitsspeicher und Swap auf dem Sitzungsbildschirm. „Erweitert“ schlüsselt ihn nach Spiel, DroidDeck, Android und GPU auf.</string>
<string name="setup_memory_hud_simple">Einfach</string>
<string name="setup_memory_hud_advanced">Erweitert</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · Swap %3$s/%4$s GB</string>
<string name="memory_hud_split">Spiel %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Hintergrund-Apps während einer Sitzung</string>
<string name="setup_bg_limit_hint">Während eine Sitzung läuft, hält Android höchstens so viele Apps im Cache und schließt die übrigen, damit das Spiel deren Speicher bekommt. DroidDeck stellt das vorherige Limit wieder her, wenn die Sitzung endet. „Debugging über WLAN“ muss aktiviert sein.</string>
<string name="setup_bg_limit_4">Höchstens 4</string>
+5 -7
View File
@@ -1249,6 +1249,11 @@
<string name="agent_action_prepare">Προετοιμασία</string>
<string name="agent_connection_off">Η ασύρματη αποσφαλμάτωση δεν είναι προσβάσιμη · η Σύζευξη την ενεργοποιεί</string>
<string name="agent_action_pair">Σύζευξη</string>
<string name="agent_step_connection_quest_hint">Το Quest δεν έχει οθόνη σύζευξης. Από έναν υπολογιστή, εκτελέστε μία φορά: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS και adb tcpip 5555. Μετά πατήστε «Να επιτραπεί» και αποδεχτείτε το μήνυμα στο headset</string>
<string name="agent_action_allow">Να επιτραπεί</string>
<string name="agent_connection_quest_waiting">Αποδεχτείτε το «Να επιτραπεί ο εντοπισμός σφαλμάτων;» στο headset, με επιλεγμένο το «Να επιτρέπεται πάντα»</string>
<string name="agent_connection_quest_failed">Δεν ήταν δυνατή η σύνδεση. Αποδεχτείτε το μήνυμα εντοπισμού σφαλμάτων στο headset ή, αν δεν εμφανίστηκε, εκτελέστε adb tcpip 5555 από υπολογιστή και δοκιμάστε ξανά</string>
<string name="agent_connection_quest_off">Ο ασύρματος εντοπισμός σφαλμάτων δεν είναι προσβάσιμος. Πατήστε «Να επιτραπεί» για να τον ρυθμίσετε ξανά</string>
<string name="agent_action_install">Εγκατάσταση</string>
<string name="agent_action_sign_in">Σύνδεση</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3801,13 +3806,6 @@
<string name="setup_clear_cached">Κλείσιμο εφαρμογών στην προσωρινή μνήμη πριν από τη συνεδρία</string>
<string name="setup_clear_cached_hint">Όταν ξεκινά μια συνεδρία, το DroidDeck κλείνει τις εφαρμογές που το Android κρατά στο παρασκήνιο, ώστε το παιχνίδι να έχει περισσότερη μνήμη. Ο Ασύρματος εντοπισμός σφαλμάτων πρέπει να είναι ενεργός.</string>
<string name="setup_clear_cached_unpaired">Απαιτεί σύζευξη του DroidDeck με τον Ασύρματο εντοπισμό σφαλμάτων (Σύζευξη, παρακάτω).</string>
<string name="setup_memory_hud">Ένδειξη μνήμης</string>
<string name="setup_memory_hud_hint">Μνήμη και swap σε χρήση, στην οθόνη της συνεδρίας. Με την επιλογή «Για προχωρημένους» χωρίζεται σε παιχνίδι, DroidDeck, Android και GPU.</string>
<string name="setup_memory_hud_simple">Απλή</string>
<string name="setup_memory_hud_advanced">Για προχωρημένους</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">παιχνίδι %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Εφαρμογές παρασκηνίου κατά τη συνεδρία</string>
<string name="setup_bg_limit_hint">Όσο εκτελείται μια συνεδρία, το Android κρατά στην προσωρινή μνήμη το πολύ τόσες εφαρμογές και κλείνει τις υπόλοιπες, ώστε το παιχνίδι να πάρει τη μνήμη τους. Το DroidDeck επαναφέρει το όριο όπως ήταν όταν τελειώσει η συνεδρία. Ο Ασύρματος εντοπισμός σφαλμάτων πρέπει να είναι ενεργός.</string>
<string name="setup_bg_limit_4">Το πολύ 4</string>
+5 -7
View File
@@ -1253,6 +1253,11 @@
<string name="agent_action_prepare">Preparar</string>
<string name="agent_connection_off">No se puede acceder a la depuración inalámbrica; Emparejar la activa</string>
<string name="agent_action_pair">Emparejar</string>
<string name="agent_step_connection_quest_hint">Quest no tiene pantalla de vinculación. Desde un ordenador, ejecuta una vez: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS y adb tcpip 5555. Después toca Permitir y acepta el aviso en el visor</string>
<string name="agent_action_allow">Permitir</string>
<string name="agent_connection_quest_waiting">Acepta «¿Permitir depuración?» en el visor, con Permitir siempre marcado</string>
<string name="agent_connection_quest_failed">No se pudo conectar. Acepta el aviso de depuración en el visor o, si no apareció, ejecuta adb tcpip 5555 desde un ordenador y vuelve a intentarlo</string>
<string name="agent_connection_quest_off">No se puede acceder a la depuración inalámbrica. Toca Permitir para configurarla de nuevo</string>
<string name="agent_action_install">Instalar</string>
<string name="agent_action_sign_in">Iniciar sesión</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3840,13 +3845,6 @@
<string name="setup_clear_cached">Cerrar apps en caché antes de una sesión</string>
<string name="setup_clear_cached_hint">Al empezar una sesión, cierra las apps que Android mantiene en segundo plano para que el juego tenga más memoria. La depuración inalámbrica debe estar activada.</string>
<string name="setup_clear_cached_unpaired">DroidDeck debe estar vinculado con la depuración inalámbrica (Vincular, abajo).</string>
<string name="setup_memory_hud">Indicador de memoria</string>
<string name="setup_memory_hud_hint">Memoria y swap en uso, en la pantalla de la sesión. Avanzado lo divide entre el juego, DroidDeck, Android y la GPU.</string>
<string name="setup_memory_hud_simple">Simple</string>
<string name="setup_memory_hud_advanced">Avanzado</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">juego %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Apps en segundo plano durante una sesión</string>
<string name="setup_bg_limit_hint">Mientras una sesión está en marcha, Android mantiene en caché como máximo este número de apps y cierra las demás, para que el juego tenga su memoria. Se restablece al terminar la sesión. La depuración inalámbrica debe estar activada.</string>
<string name="setup_bg_limit_4">Como máximo 4</string>
+5 -7
View File
@@ -1249,6 +1249,11 @@
<string name="agent_action_prepare">Valmistele</string>
<string name="agent_connection_off">Langaton virheenkorjaus ei ole tavoitettavissa; Parita ottaa sen käyttöön</string>
<string name="agent_action_pair">Parita</string>
<string name="agent_step_connection_quest_hint">Questissa ei ole laiteparinäkymää. Suorita kerran tietokoneelta: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS ja adb tcpip 5555. Napauta sitten Salli ja hyväksy kehote laseissa</string>
<string name="agent_action_allow">Salli</string>
<string name="agent_connection_quest_waiting">Hyväksy ”Sallitaanko virheenkorjaus?” laseissa, kun Salli aina on valittuna</string>
<string name="agent_connection_quest_failed">Yhteyttä ei saatu. Hyväksy virheenkorjauskehote laseissa, tai jos sitä ei näkynyt, suorita adb tcpip 5555 tietokoneelta ja yritä uudelleen</string>
<string name="agent_connection_quest_off">Langatonta virheenkorjausta ei tavoiteta. Määritä se uudelleen napauttamalla Salli</string>
<string name="agent_action_install">Asenna</string>
<string name="agent_action_sign_in">Kirjaudu sisään</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3801,13 +3806,6 @@
<string name="setup_clear_cached">Sulje välimuistissa olevat sovellukset ennen istuntoa</string>
<string name="setup_clear_cached_hint">Kun istunto alkaa, DroidDeck sulkee sovellukset, joita Android pitää taustalla, jotta pelillä on enemmän muistia. Langattoman virheenkorjauksen on oltava päällä.</string>
<string name="setup_clear_cached_unpaired">Vaatii, että DroidDeck on pariutettu Langattoman virheenkorjauksen kautta (Pariuta, alla).</string>
<string name="setup_memory_hud">Muistinäyttö</string>
<string name="setup_memory_hud_hint">Käytössä oleva muisti ja swap istuntonäytöllä. Laajennettu näyttää erikseen pelin, DroidDeckin, Androidin ja GPU:n osuuden.</string>
<string name="setup_memory_hud_simple">Yksinkertainen</string>
<string name="setup_memory_hud_advanced">Laajennettu</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">peli %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Taustasovellukset istunnon aikana</string>
<string name="setup_bg_limit_hint">Istunnon aikana Android pitää välimuistissa enintään näin monta sovellusta ja sulkee loput, jotta peli saa niiden muistin. DroidDeck palauttaa rajan ennalleen, kun istunto päättyy. Langattoman virheenkorjauksen on oltava päällä.</string>
<string name="setup_bg_limit_4">Enintään 4</string>
+5 -7
View File
@@ -1252,6 +1252,11 @@
<string name="agent_action_prepare">Préparer</string>
<string name="agent_connection_off">Le débogage sans fil n\'est pas accessible ; « Associer » l\'active</string>
<string name="agent_action_pair">Associer</string>
<string name="agent_step_connection_quest_hint">Le Quest n\'a pas d\'écran d\'association. Depuis un ordinateur, exécutez une fois : adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS et adb tcpip 5555. Touchez ensuite Autoriser et acceptez la demande dans le casque</string>
<string name="agent_action_allow">Autoriser</string>
<string name="agent_connection_quest_waiting">Acceptez « Autoriser le débogage ? » dans le casque, avec Toujours autoriser coché</string>
<string name="agent_connection_quest_failed">Connexion impossible. Acceptez la demande de débogage dans le casque ou, si elle n\'est pas apparue, exécutez adb tcpip 5555 depuis un ordinateur et réessayez</string>
<string name="agent_connection_quest_off">Le débogage sans fil est injoignable. Touchez Autoriser pour le configurer à nouveau</string>
<string name="agent_action_install">Installer</string>
<string name="agent_action_sign_in">Se connecter</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3839,13 +3844,6 @@
<string name="setup_clear_cached">Fermer les applis en cache avant une session</string>
<string name="setup_clear_cached_hint">Au début d\'une session, ferme les applis qu\'Android garde en arrière-plan, pour laisser plus de mémoire au jeu. Le débogage sans fil doit être activé.</string>
<string name="setup_clear_cached_unpaired">DroidDeck doit être associé au débogage sans fil (Associer, ci-dessous).</string>
<string name="setup_memory_hud">Indicateur de mémoire</string>
<string name="setup_memory_hud_hint">Mémoire et swap utilisés, sur l\'écran de la session. Avancé détaille le jeu, DroidDeck, Android et le GPU.</string>
<string name="setup_memory_hud_simple">Simple</string>
<string name="setup_memory_hud_advanced">Avancé</string>
<string name="memory_hud_simple">RAM %1$s/%2$s Go · swap %3$s/%4$s Go</string>
<string name="memory_hud_split">jeu %1$s · DroidDeck %2$s · Android %3$s Go</string>
<string name="memory_hud_gpu">GPU %1$s Go</string>
<string name="setup_bg_limit">Applis en arrière-plan pendant une session</string>
<string name="setup_bg_limit_hint">Pendant une session, Android garde au plus ce nombre d\'applis en cache et ferme les autres, pour laisser leur mémoire au jeu. Rétabli à la fin de la session. Le débogage sans fil doit être activé.</string>
<string name="setup_bg_limit_4">4 au maximum</string>
+5 -7
View File
@@ -1249,6 +1249,11 @@
<string name="agent_action_prepare">तैयार करें</string>
<string name="agent_connection_off">वायरलेस डिबगिंग से कनेक्ट नहीं हो पा रहा; पेयर करने से यह चालू हो जाता है</string>
<string name="agent_action_pair">पेयर करें</string>
<string name="agent_step_connection_quest_hint">Quest में पेयरिंग स्क्रीन नहीं है। किसी कंप्यूटर से एक बार चलाएँ: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS और adb tcpip 5555। फिर अनुमति दें पर टैप करें और हेडसेट में संकेत स्वीकार करें</string>
<string name="agent_action_allow">अनुमति दें</string>
<string name="agent_connection_quest_waiting">हेडसेट में “डीबगिंग की अनुमति दें?” स्वीकार करें, हमेशा अनुमति दें चुना हुआ रखें</string>
<string name="agent_connection_quest_failed">कनेक्ट नहीं हो सका। हेडसेट में डीबगिंग संकेत स्वीकार करें, या अगर वह नहीं दिखा, तो कंप्यूटर से adb tcpip 5555 चलाएँ और दोबारा कोशिश करें</string>
<string name="agent_connection_quest_off">वायरलेस डीबगिंग तक नहीं पहुँचा जा सकता। इसे फिर से सेट करने के लिए अनुमति दें पर टैप करें</string>
<string name="agent_action_install">इंस्टॉल करें</string>
<string name="agent_action_sign_in">साइन इन करें</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3801,13 +3806,6 @@
<string name="setup_clear_cached">सेशन से पहले कैश्ड ऐप बंद करें</string>
<string name="setup_clear_cached_hint">सेशन शुरू होने पर DroidDeck उन ऐप को बंद कर देता है जिन्हें Android बैकग्राउंड में रखता है, ताकि गेम को ज़्यादा मेमोरी मिले। वायरलेस डीबगिंग चालू होनी चाहिए।</string>
<string name="setup_clear_cached_unpaired">DroidDeck को वायरलेस डीबगिंग से पेयर करना ज़रूरी है (नीचे, पेयर करें)।</string>
<string name="setup_memory_hud">मेमोरी रीडआउट</string>
<string name="setup_memory_hud_hint">सेशन स्क्रीन पर इस्तेमाल हो रही मेमोरी और swap। एडवांस्ड इसे गेम, DroidDeck, Android और GPU में बांटकर दिखाता है।</string>
<string name="setup_memory_hud_simple">सिंपल</string>
<string name="setup_memory_hud_advanced">एडवांस्ड</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">गेम %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">सेशन के दौरान बैकग्राउंड ऐप</string>
<string name="setup_bg_limit_hint">सेशन चलते समय Android ज़्यादा से ज़्यादा इतने ऐप कैश में रखता है और बाकी बंद कर देता है, ताकि गेम को उनकी मेमोरी मिले। सेशन खत्म होने पर DroidDeck सीमा को पहले जैसा कर देता है। वायरलेस डीबगिंग चालू होनी चाहिए।</string>
<string name="setup_bg_limit_4">ज़्यादा से ज़्यादा 4</string>
+5 -7
View File
@@ -1249,6 +1249,11 @@
<string name="agent_action_prepare">Előkészítés</string>
<string name="agent_connection_off">A vezeték nélküli hibakeresés nem érhető el; a Párosítás bekapcsolja</string>
<string name="agent_action_pair">Párosítás</string>
<string name="agent_step_connection_quest_hint">A Quest nem rendelkezik párosítási képernyővel. Egy számítógépről futtasd egyszer: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS és adb tcpip 5555. Ezután koppints az Engedélyezés gombra, és fogadd el a kérdést a headsetben</string>
<string name="agent_action_allow">Engedélyezés</string>
<string name="agent_connection_quest_waiting">Fogadd el az „Engedélyezed a hibakeresést?” kérdést a headsetben, a Mindig engedélyez bejelölésével</string>
<string name="agent_connection_quest_failed">Nem sikerült csatlakozni. Fogadd el a hibakeresési kérdést a headsetben, vagy ha nem jelent meg, futtasd az adb tcpip 5555 parancsot egy számítógépről, és próbáld újra</string>
<string name="agent_connection_quest_off">A vezeték nélküli hibakeresés nem érhető el. Koppints az Engedélyezés gombra az újbóli beállításhoz</string>
<string name="agent_action_install">Telepítés</string>
<string name="agent_action_sign_in">Bejelentkezés</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3799,13 +3804,6 @@
<string name="setup_clear_cached">Gyorsítótárazott alkalmazások bezárása munkamenet előtt</string>
<string name="setup_clear_cached_hint">Munkamenet indításakor a DroidDeck bezárja azokat az alkalmazásokat, amelyeket az Android a háttérben tart, így a játéknak több memória jut. A vezeték nélküli hibakeresésnek bekapcsolva kell lennie.</string>
<string name="setup_clear_cached_unpaired">A DroidDecket párosítani kell a vezeték nélküli hibakereséssel (Párosítás, lent).</string>
<string name="setup_memory_hud">Memóriakijelzés</string>
<string name="setup_memory_hud_hint">A használt memória és swap a munkamenet képernyőjén. A Speciális nézet szétbontja a játék, a DroidDeck, az Android és a GPU között.</string>
<string name="setup_memory_hud_simple">Egyszerű</string>
<string name="setup_memory_hud_advanced">Speciális</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">játék %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Háttéralkalmazások munkamenet közben</string>
<string name="setup_bg_limit_hint">Munkamenet közben az Android legfeljebb ennyi alkalmazást tart a gyorsítótárban, a többit bezárja, így azok memóriája a játéké lesz. A munkamenet végén a DroidDeck visszaállítja a korábbi korlátot. A vezeték nélküli hibakeresésnek bekapcsolva kell lennie.</string>
<string name="setup_bg_limit_4">Legfeljebb 4</string>
+5 -7
View File
@@ -1246,6 +1246,11 @@
<string name="agent_action_prepare">Siapkan</string>
<string name="agent_connection_off">Debug nirkabel tidak dapat dijangkau; Pasangkan menyalakannya</string>
<string name="agent_action_pair">Pasangkan</string>
<string name="agent_step_connection_quest_hint">Quest tidak memiliki layar penyambungan. Dari komputer, jalankan sekali: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS dan adb tcpip 5555. Lalu ketuk Izinkan dan terima permintaan di headset</string>
<string name="agent_action_allow">Izinkan</string>
<string name="agent_connection_quest_waiting">Terima “Izinkan debugging?” di headset, dengan Selalu izinkan dicentang</string>
<string name="agent_connection_quest_failed">Tidak dapat terhubung. Terima permintaan debugging di headset, atau jika tidak muncul, jalankan adb tcpip 5555 dari komputer lalu coba lagi</string>
<string name="agent_connection_quest_off">Debugging nirkabel tidak dapat dijangkau. Ketuk Izinkan untuk menyiapkannya lagi</string>
<string name="agent_action_install">Pasang</string>
<string name="agent_action_sign_in">Masuk</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3772,13 +3777,6 @@
<string name="setup_clear_cached">Tutup aplikasi dalam cache sebelum sesi</string>
<string name="setup_clear_cached_hint">Saat sesi dimulai, DroidDeck menutup aplikasi yang disimpan Android di latar belakang agar gim mendapat lebih banyak memori. Debugging nirkabel harus aktif.</string>
<string name="setup_clear_cached_unpaired">DroidDeck harus disandingkan dengan Debugging nirkabel (Pasangkan, di bawah).</string>
<string name="setup_memory_hud">Tampilan memori</string>
<string name="setup_memory_hud_hint">Memori dan swap yang digunakan, di layar sesi. Lanjutan merincinya menjadi gim, DroidDeck, Android, dan GPU.</string>
<string name="setup_memory_hud_simple">Sederhana</string>
<string name="setup_memory_hud_advanced">Lanjutan</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">gim %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Aplikasi latar belakang selama sesi</string>
<string name="setup_bg_limit_hint">Selama sesi berjalan, Android menyimpan paling banyak sejumlah ini aplikasi di cache dan menutup sisanya agar gim mendapat memorinya. DroidDeck mengembalikan batas seperti semula saat sesi berakhir. Debugging nirkabel harus aktif.</string>
<string name="setup_bg_limit_4">Paling banyak 4</string>
+5 -7
View File
@@ -1244,6 +1244,11 @@
<string name="agent_action_prepare">Prepara</string>
<string name="agent_connection_off">Il debug wireless non è raggiungibile; Associa lo attiva</string>
<string name="agent_action_pair">Associa</string>
<string name="agent_step_connection_quest_hint">Quest non ha una schermata di accoppiamento. Da un computer, esegui una volta: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS e adb tcpip 5555. Poi tocca Consenti e accetta la richiesta nel visore</string>
<string name="agent_action_allow">Consenti</string>
<string name="agent_connection_quest_waiting">Accetta «Consentire il debug?» nel visore, con Consenti sempre selezionato</string>
<string name="agent_connection_quest_failed">Impossibile connettersi. Accetta la richiesta di debug nel visore oppure, se non è comparsa, esegui adb tcpip 5555 da un computer e riprova</string>
<string name="agent_connection_quest_off">Il debug wireless non è raggiungibile. Tocca Consenti per configurarlo di nuovo</string>
<string name="agent_action_install">Installa</string>
<string name="agent_action_sign_in">Accedi</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3837,13 +3842,6 @@
<string name="setup_clear_cached">Chiudi le app in cache prima di una sessione</string>
<string name="setup_clear_cached_hint">All\'avvio di una sessione, DroidDeck chiude le app che Android tiene parcheggiate in background, così il gioco ha più memoria. Il Debug wireless deve essere attivo.</string>
<string name="setup_clear_cached_unpaired">Richiede DroidDeck accoppiato con il Debug wireless (Accoppia, qui sotto).</string>
<string name="setup_memory_hud">Indicatore della memoria</string>
<string name="setup_memory_hud_hint">Memoria e swap in uso, nella schermata della sessione. Avanzato la suddivide tra gioco, DroidDeck, Android e GPU.</string>
<string name="setup_memory_hud_simple">Semplice</string>
<string name="setup_memory_hud_advanced">Avanzato</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">gioco %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">App in background durante una sessione</string>
<string name="setup_bg_limit_hint">Durante una sessione, Android tiene in cache al massimo questo numero di app e chiude le altre, così il gioco ha la loro memoria. Al termine della sessione DroidDeck ripristina il limite precedente. Il Debug wireless deve essere attivo.</string>
<string name="setup_bg_limit_4">Al massimo 4</string>
+5 -7
View File
@@ -1246,6 +1246,11 @@
<string name="agent_action_prepare">準備</string>
<string name="agent_connection_off">ワイヤレスデバッグに接続できません。ペアリングで有効になります</string>
<string name="agent_action_pair">ペアリング</string>
<string name="agent_step_connection_quest_hint">Quest にはペア設定画面がありません。パソコンから一度だけ adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS と adb tcpip 5555 を実行し、[許可] をタップしてヘッドセットの確認を承認してください</string>
<string name="agent_action_allow">許可</string>
<string name="agent_connection_quest_waiting">ヘッドセットで「デバッグを許可しますか?」を、[常に許可] にチェックを入れて承認してください</string>
<string name="agent_connection_quest_failed">接続できませんでした。ヘッドセットでデバッグの確認を承認してください。表示されなかった場合は、パソコンから adb tcpip 5555 を実行してもう一度お試しください</string>
<string name="agent_connection_quest_off">ワイヤレス デバッグに接続できません。[許可] をタップして設定し直してください</string>
<string name="agent_action_install">インストール</string>
<string name="agent_action_sign_in">サインイン</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3772,13 +3777,6 @@
<string name="setup_clear_cached">セッション前にキャッシュ済みアプリを閉じる</string>
<string name="setup_clear_cached_hint">セッションの開始時に、Android がバックグラウンドに保持しているアプリを閉じ、ゲームに使えるメモリを増やします。ワイヤレスデバッグをオンにする必要があります。</string>
<string name="setup_clear_cached_unpaired">DroidDeck をワイヤレスデバッグとペア設定する必要があります(下の「ペア設定」)。</string>
<string name="setup_memory_hud">メモリ表示</string>
<string name="setup_memory_hud_hint">使用中のメモリとスワップをセッション画面に表示します。詳細設定では、ゲーム、DroidDeck、Android、GPU に分けて表示します。</string>
<string name="setup_memory_hud_simple">シンプル</string>
<string name="setup_memory_hud_advanced">詳細設定</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · スワップ %3$s/%4$s GB</string>
<string name="memory_hud_split">ゲーム %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">セッション中のバックグラウンドアプリ</string>
<string name="setup_bg_limit_hint">セッション中、Android がキャッシュに保持するアプリをこの数までに抑え、残りを閉じてゲームにメモリを回します。セッション終了時に元に戻します。ワイヤレスデバッグをオンにする必要があります。</string>
<string name="setup_bg_limit_4">最大 4 個</string>
+5 -7
View File
@@ -1246,6 +1246,11 @@
<string name="agent_action_prepare">준비</string>
<string name="agent_connection_off">무선 디버깅에 연결할 수 없습니다. 페어링하면 켜집니다</string>
<string name="agent_action_pair">페어링</string>
<string name="agent_step_connection_quest_hint">Quest에는 페어링 화면이 없습니다. 컴퓨터에서 한 번 실행하세요: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS 및 adb tcpip 5555. 그런 다음 허용을 탭하고 헤드셋에서 요청을 수락하세요</string>
<string name="agent_action_allow">허용</string>
<string name="agent_connection_quest_waiting">헤드셋에서 \'디버깅을 허용하시겠습니까?\'를 항상 허용을 선택한 채로 수락하세요</string>
<string name="agent_connection_quest_failed">연결하지 못했습니다. 헤드셋에서 디버깅 요청을 수락하거나, 요청이 나타나지 않았다면 컴퓨터에서 adb tcpip 5555를 실행한 뒤 다시 시도하세요</string>
<string name="agent_connection_quest_off">무선 디버깅에 연결할 수 없습니다. 허용을 탭해 다시 설정하세요</string>
<string name="agent_action_install">설치</string>
<string name="agent_action_sign_in">로그인</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3772,13 +3777,6 @@
<string name="setup_clear_cached">세션 전에 캐시된 앱 닫기</string>
<string name="setup_clear_cached_hint">세션이 시작될 때 Android가 백그라운드에 보관 중인 앱을 닫아 게임이 메모리를 더 쓸 수 있게 합니다. 무선 디버깅이 켜져 있어야 합니다.</string>
<string name="setup_clear_cached_unpaired">DroidDeck을 무선 디버깅과 페어링해야 합니다(아래 페어링).</string>
<string name="setup_memory_hud">메모리 표시</string>
<string name="setup_memory_hud_hint">사용 중인 메모리와 스왑을 세션 화면에 표시합니다. 고급에서는 게임, DroidDeck, Android, GPU로 나눠 보여 줍니다.</string>
<string name="setup_memory_hud_simple">간단</string>
<string name="setup_memory_hud_advanced">고급</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · 스왑 %3$s/%4$s GB</string>
<string name="memory_hud_split">게임 %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">세션 중 백그라운드 앱</string>
<string name="setup_bg_limit_hint">세션이 실행되는 동안 Android가 캐시에 두는 앱을 이 개수까지로 제한하고 나머지는 닫아 게임이 그 메모리를 쓰게 합니다. 세션이 끝나면 원래대로 돌아갑니다. 무선 디버깅이 켜져 있어야 합니다.</string>
<string name="setup_bg_limit_4">최대 4개</string>
+5 -7
View File
@@ -1246,6 +1246,11 @@
<string name="agent_action_prepare">Sediakan</string>
<string name="agent_connection_off">Penyahpepijatan wayarles tidak dapat dicapai; Pasangkan menghidupkannya</string>
<string name="agent_action_pair">Pasangkan</string>
<string name="agent_step_connection_quest_hint">Quest tiada skrin pasangan. Dari komputer, jalankan sekali: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS dan adb tcpip 5555. Kemudian ketik Benarkan dan terima gesaan dalam set kepala</string>
<string name="agent_action_allow">Benarkan</string>
<string name="agent_connection_quest_waiting">Terima “Benarkan penyahpepijatan?” dalam set kepala, dengan Sentiasa benarkan ditanda</string>
<string name="agent_connection_quest_failed">Tidak dapat bersambung. Terima gesaan penyahpepijatan dalam set kepala, atau jika tiada, jalankan adb tcpip 5555 dari komputer dan cuba lagi</string>
<string name="agent_connection_quest_off">Penyahpepijatan wayarles tidak dapat dicapai. Ketik Benarkan untuk menyediakannya semula</string>
<string name="agent_action_install">Pasang</string>
<string name="agent_action_sign_in">Log masuk</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3770,13 +3775,6 @@
<string name="setup_clear_cached">Tutup apl dalam cache sebelum sesi</string>
<string name="setup_clear_cached_hint">Apabila sesi bermula, DroidDeck menutup apl yang disimpan Android di latar belakang supaya permainan mendapat lebih banyak memori. Debugging Wayarles mesti dihidupkan.</string>
<string name="setup_clear_cached_unpaired">Memerlukan DroidDeck digandingkan dengan Debugging Wayarles (Gandingkan, di bawah).</string>
<string name="setup_memory_hud">Paparan memori</string>
<string name="setup_memory_hud_hint">Memori dan swap yang digunakan, pada skrin sesi. Lanjutan memecahkannya kepada permainan, DroidDeck, Android dan GPU.</string>
<string name="setup_memory_hud_simple">Ringkas</string>
<string name="setup_memory_hud_advanced">Lanjutan</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">permainan %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Apl latar belakang semasa sesi</string>
<string name="setup_bg_limit_hint">Semasa sesi berjalan, Android menyimpan paling banyak bilangan apl ini dalam cache dan menutup selebihnya, supaya permainan mendapat memori apl tersebut. DroidDeck memulihkan had seperti asal apabila sesi tamat. Debugging Wayarles mesti dihidupkan.</string>
<string name="setup_bg_limit_4">Paling banyak 4</string>
+5 -7
View File
@@ -1249,6 +1249,11 @@
<string name="agent_action_prepare">Forbered</string>
<string name="agent_connection_off">Trådløs feilsøking er ikke tilgjengelig; Par slår den på</string>
<string name="agent_action_pair">Par</string>
<string name="agent_step_connection_quest_hint">Quest har ingen sammenkoblingsskjerm. Kjør én gang fra en datamaskin: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS og adb tcpip 5555. Trykk deretter på Tillat og godta spørsmålet i hodesettet</string>
<string name="agent_action_allow">Tillat</string>
<string name="agent_connection_quest_waiting">Godta «Vil du tillate feilsøking?» i hodesettet med Tillat alltid avkrysset</string>
<string name="agent_connection_quest_failed">Kunne ikke koble til. Godta feilsøkingsspørsmålet i hodesettet, eller kjør adb tcpip 5555 fra en datamaskin og prøv igjen hvis det ikke dukket opp</string>
<string name="agent_connection_quest_off">Trådløs feilsøking kan ikke nås. Trykk på Tillat for å sette den opp på nytt</string>
<string name="agent_action_install">Installer</string>
<string name="agent_action_sign_in">Logg inn</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3801,13 +3806,6 @@
<string name="setup_clear_cached">Lukk bufrede apper før en sesjon</string>
<string name="setup_clear_cached_hint">Når en sesjon starter, lukker DroidDeck appene Android holder parkert i bakgrunnen, slik at spillet får mer minne. Trådløs feilsøking må være på.</string>
<string name="setup_clear_cached_unpaired">Krever at DroidDeck er paret med trådløs feilsøking (Koble sammen, nedenfor).</string>
<string name="setup_memory_hud">Minnevisning</string>
<string name="setup_memory_hud_hint">Minne og swap i bruk, på sesjonsskjermen. Avansert fordeler det på spillet, DroidDeck, Android og GPU-en.</string>
<string name="setup_memory_hud_simple">Enkel</string>
<string name="setup_memory_hud_advanced">Avansert</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">spill %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Bakgrunnsapper under en sesjon</string>
<string name="setup_bg_limit_hint">Mens en sesjon kjører, holder Android høyst så mange apper i hurtiglageret og lukker resten, slik at spillet får minnet deres. DroidDeck setter grensen tilbake slik den var når sesjonen avsluttes. Trådløs feilsøking må være på.</string>
<string name="setup_bg_limit_4">Høyst 4</string>
+5 -7
View File
@@ -1249,6 +1249,11 @@
<string name="agent_action_prepare">Voorbereiden</string>
<string name="agent_connection_off">Draadloze foutopsporing is niet bereikbaar; Koppelen schakelt dit in</string>
<string name="agent_action_pair">Koppelen</string>
<string name="agent_step_connection_quest_hint">Quest heeft geen koppelscherm. Voer vanaf een computer één keer uit: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS en adb tcpip 5555. Tik daarna op Toestaan en accepteer de melding in de headset</string>
<string name="agent_action_allow">Toestaan</string>
<string name="agent_connection_quest_waiting">Accepteer ‘Foutopsporing toestaan?’ in de headset, met Altijd toestaan aangevinkt</string>
<string name="agent_connection_quest_failed">Verbinden mislukt. Accepteer de foutopsporingsmelding in de headset, of voer adb tcpip 5555 uit vanaf een computer en probeer het opnieuw als er geen verscheen</string>
<string name="agent_connection_quest_off">Draadloze foutopsporing is niet bereikbaar. Tik op Toestaan om het opnieuw in te stellen</string>
<string name="agent_action_install">Installeren</string>
<string name="agent_action_sign_in">Inloggen</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3799,13 +3804,6 @@
<string name="setup_clear_cached">Gecachete apps sluiten voor een sessie</string>
<string name="setup_clear_cached_hint">Als een sessie start, sluit DroidDeck de apps die Android op de achtergrond geparkeerd houdt, zodat de game meer geheugen heeft. Draadloos debuggen moet aanstaan.</string>
<string name="setup_clear_cached_unpaired">DroidDeck moet gekoppeld zijn met Draadloos debuggen (Koppelen, hieronder).</string>
<string name="setup_memory_hud">Geheugenweergave</string>
<string name="setup_memory_hud_hint">Gebruikt geheugen en swap, op het sessiescherm. Geavanceerd verdeelt het over de game, DroidDeck, Android en de GPU.</string>
<string name="setup_memory_hud_simple">Eenvoudig</string>
<string name="setup_memory_hud_advanced">Geavanceerd</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">game %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Achtergrond-apps tijdens een sessie</string>
<string name="setup_bg_limit_hint">Tijdens een sessie houdt Android maximaal dit aantal apps in de cache en sluit de rest, zodat de game hun geheugen krijgt. DroidDeck zet de limiet terug zoals hij was als de sessie eindigt. Draadloos debuggen moet aanstaan.</string>
<string name="setup_bg_limit_4">Maximaal 4</string>
+5 -7
View File
@@ -1257,6 +1257,11 @@
<string name="agent_action_prepare">Przygotuj</string>
<string name="agent_connection_off">Debugowanie bezprzewodowe jest niedostępne; Paruj, aby je włączyć</string>
<string name="agent_action_pair">Paruj</string>
<string name="agent_step_connection_quest_hint">Quest nie ma ekranu parowania. Na komputerze uruchom raz: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS oraz adb tcpip 5555. Następnie dotknij Zezwól i zaakceptuj monit w goglach</string>
<string name="agent_action_allow">Zezwól</string>
<string name="agent_connection_quest_waiting">Zaakceptuj „Zezwolić na debugowanie?” w goglach z zaznaczonym Zawsze zezwalaj</string>
<string name="agent_connection_quest_failed">Nie udało się połączyć. Zaakceptuj monit debugowania w goglach, a jeśli się nie pojawił, uruchom adb tcpip 5555 na komputerze i spróbuj ponownie</string>
<string name="agent_connection_quest_off">Debugowanie bezprzewodowe jest nieosiągalne. Dotknij Zezwól, aby skonfigurować je ponownie</string>
<string name="agent_action_install">Zainstaluj</string>
<string name="agent_action_sign_in">Zaloguj się</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3875,13 +3880,6 @@
<string name="setup_clear_cached">Zamykaj aplikacje z pamięci podręcznej przed sesją</string>
<string name="setup_clear_cached_hint">Na początku sesji DroidDeck zamyka aplikacje, które Android trzyma w tle, aby gra miała więcej pamięci. Debugowanie bezprzewodowe musi być włączone.</string>
<string name="setup_clear_cached_unpaired">Wymaga sparowania DroidDeck przez Debugowanie bezprzewodowe (Sparuj, poniżej).</string>
<string name="setup_memory_hud">Wskaźnik pamięci</string>
<string name="setup_memory_hud_hint">Używana pamięć i swap na ekranie sesji. Tryb Zaawansowany dzieli ją na grę, DroidDeck, Androida i GPU.</string>
<string name="setup_memory_hud_simple">Prosty</string>
<string name="setup_memory_hud_advanced">Zaawansowany</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">gra %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Aplikacje w tle podczas sesji</string>
<string name="setup_bg_limit_hint">W trakcie sesji Android trzyma w pamięci podręcznej najwyżej tyle aplikacji, a resztę zamyka, aby gra dostała ich pamięć. Po zakończeniu sesji DroidDeck przywraca poprzedni limit. Debugowanie bezprzewodowe musi być włączone.</string>
<string name="setup_bg_limit_4">Najwyżej 4</string>
+5 -7
View File
@@ -1244,6 +1244,11 @@
<string name="agent_action_prepare">Preparar</string>
<string name="agent_connection_off">A depuração sem fios não está acessível; Emparelhar ativa-a</string>
<string name="agent_action_pair">Emparelhar</string>
<string name="agent_step_connection_quest_hint">O Quest não tem ecrã de emparelhamento. Num computador, execute uma vez: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS e adb tcpip 5555. Depois toque em Permitir e aceite o pedido no headset</string>
<string name="agent_action_allow">Permitir</string>
<string name="agent_connection_quest_waiting">Aceite “Permitir depuração?” no headset, com Permitir sempre assinalado</string>
<string name="agent_connection_quest_failed">Não foi possível ligar. Aceite o pedido de depuração no headset ou, se não apareceu, execute adb tcpip 5555 num computador e tente novamente</string>
<string name="agent_connection_quest_off">A depuração sem fios não está acessível. Toque em Permitir para a configurar de novo</string>
<string name="agent_action_install">Instalar</string>
<string name="agent_action_sign_in">Iniciar sessão</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3853,13 +3858,6 @@
<string name="setup_clear_cached">Fechar apps em cache antes de uma sessão</string>
<string name="setup_clear_cached_hint">Quando uma sessão começa, o DroidDeck fecha as apps que o Android mantém em segundo plano, para que o jogo tenha mais memória. A Depuração sem fios tem de estar ativada.</string>
<string name="setup_clear_cached_unpaired">É necessário sincronizar o DroidDeck com a Depuração sem fios (Sincronizar, abaixo).</string>
<string name="setup_memory_hud">Indicador de memória</string>
<string name="setup_memory_hud_hint">Memória e swap em uso, no ecrã da sessão. O modo Avançado divide-a entre o jogo, o DroidDeck, o Android e a GPU.</string>
<string name="setup_memory_hud_simple">Simples</string>
<string name="setup_memory_hud_advanced">Avançado</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">jogo %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Apps em segundo plano durante uma sessão</string>
<string name="setup_bg_limit_hint">Enquanto uma sessão decorre, o Android mantém em cache no máximo este número de apps e fecha as restantes, para que o jogo fique com a memória delas. O DroidDeck repõe o limite anterior quando a sessão termina. A Depuração sem fios tem de estar ativada.</string>
<string name="setup_bg_limit_4">No máximo 4</string>
+5 -7
View File
@@ -1252,6 +1252,11 @@
<string name="agent_action_prepare">Preparar</string>
<string name="agent_connection_off">A depuração sem fio não está acessível; Parear a ativa</string>
<string name="agent_action_pair">Parear</string>
<string name="agent_step_connection_quest_hint">O Quest não tem tela de pareamento. Em um computador, execute uma vez: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS e adb tcpip 5555. Depois toque em Permitir e aceite o aviso no headset</string>
<string name="agent_action_allow">Permitir</string>
<string name="agent_connection_quest_waiting">Aceite “Permitir depuração?” no headset, com Sempre permitir marcado</string>
<string name="agent_connection_quest_failed">Não foi possível conectar. Aceite o aviso de depuração no headset ou, se ele não apareceu, execute adb tcpip 5555 em um computador e tente novamente</string>
<string name="agent_connection_quest_off">A depuração sem fio não está acessível. Toque em Permitir para configurá-la de novo</string>
<string name="agent_action_install">Instalar</string>
<string name="agent_action_sign_in">Entrar</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3863,13 +3868,6 @@
<string name="setup_clear_cached">Fechar apps em cache antes de uma sessão</string>
<string name="setup_clear_cached_hint">Quando uma sessão começa, o DroidDeck fecha os apps que o Android mantém em segundo plano, para que o jogo tenha mais memória. A Depuração por Wi-Fi precisa estar ativada.</string>
<string name="setup_clear_cached_unpaired">O DroidDeck precisa estar pareado com a Depuração por Wi-Fi (Parear, abaixo).</string>
<string name="setup_memory_hud">Indicador de memória</string>
<string name="setup_memory_hud_hint">Memória e swap em uso, na tela da sessão. O modo Avançado divide entre o jogo, o DroidDeck, o Android e a GPU.</string>
<string name="setup_memory_hud_simple">Simples</string>
<string name="setup_memory_hud_advanced">Avançado</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">jogo %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Apps em segundo plano durante uma sessão</string>
<string name="setup_bg_limit_hint">Enquanto uma sessão está em andamento, o Android mantém no máximo esse número de apps em cache e fecha o restante, para que o jogo fique com a memória deles. O DroidDeck restaura o limite anterior quando a sessão termina. A Depuração por Wi-Fi precisa estar ativada.</string>
<string name="setup_bg_limit_4">No máximo 4</string>
+5 -7
View File
@@ -1253,6 +1253,11 @@
<string name="agent_action_prepare">Pregătește</string>
<string name="agent_connection_off">Depanarea fără fir nu este accesibilă; „Asociază” o activează</string>
<string name="agent_action_pair">Asociază</string>
<string name="agent_step_connection_quest_hint">Quest nu are ecran de asociere. De pe un computer, rulează o dată: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS și adb tcpip 5555. Apoi atinge Permite și acceptă solicitarea în cască</string>
<string name="agent_action_allow">Permite</string>
<string name="agent_connection_quest_waiting">Acceptă „Permiți remedierea erorilor?” în cască, cu Permite întotdeauna bifat</string>
<string name="agent_connection_quest_failed">Conectarea a eșuat. Acceptă solicitarea de remediere a erorilor în cască sau, dacă nu a apărut, rulează adb tcpip 5555 de pe un computer și încearcă din nou</string>
<string name="agent_connection_quest_off">Remedierea wireless a erorilor nu este accesibilă. Atinge Permite pentru a o configura din nou</string>
<string name="agent_action_install">Instalează</string>
<string name="agent_action_sign_in">Conectați-vă</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3840,13 +3845,6 @@
<string name="setup_clear_cached">Închide aplicațiile din cache înainte de o sesiune</string>
<string name="setup_clear_cached_hint">La pornirea unei sesiuni, DroidDeck închide aplicațiile pe care Android le ține în fundal, ca jocul să aibă mai multă memorie. Depanarea wireless trebuie să fie activată.</string>
<string name="setup_clear_cached_unpaired">DroidDeck trebuie asociat prin Depanarea wireless (Asociază, mai jos).</string>
<string name="setup_memory_hud">Indicator de memorie</string>
<string name="setup_memory_hud_hint">Memoria și swap-ul folosite, pe ecranul sesiunii. Avansat le împarte între joc, DroidDeck, Android și GPU.</string>
<string name="setup_memory_hud_simple">Simplu</string>
<string name="setup_memory_hud_advanced">Avansat</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">joc %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Aplicații în fundal în timpul unei sesiuni</string>
<string name="setup_bg_limit_hint">Cât timp rulează o sesiune, Android păstrează în cache cel mult atâtea aplicații și le închide pe celelalte, ca jocul să primească memoria lor. DroidDeck readuce limita la valoarea anterioară când se termină sesiunea. Depanarea wireless trebuie să fie activată.</string>
<string name="setup_bg_limit_4">Cel mult 4</string>
+5 -7
View File
@@ -1257,6 +1257,11 @@
<string name="agent_action_prepare">Подготовить</string>
<string name="agent_connection_off">Беспроводная отладка недоступна; «Сопряжение» включит её</string>
<string name="agent_action_pair">Сопряжение</string>
<string name="agent_step_connection_quest_hint">В Quest нет экрана сопряжения. Один раз выполните на компьютере: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS и adb tcpip 5555. Затем нажмите «Разрешить» и подтвердите запрос в шлеме</string>
<string name="agent_action_allow">Разрешить</string>
<string name="agent_connection_quest_waiting">Подтвердите «Разрешить отладку?» в шлеме, отметив «Всегда разрешать»</string>
<string name="agent_connection_quest_failed">Не удалось подключиться. Подтвердите запрос на отладку в шлеме, а если он не появился, выполните adb tcpip 5555 на компьютере и повторите попытку</string>
<string name="agent_connection_quest_off">Беспроводная отладка недоступна. Нажмите «Разрешить», чтобы настроить её заново</string>
<string name="agent_action_install">Установить</string>
<string name="agent_action_sign_in">Войти</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3880,13 +3885,6 @@
<string name="setup_clear_cached">Закрывать фоновые приложения перед сеансом</string>
<string name="setup_clear_cached_hint">При запуске сеанса закрывает приложения, которые Android держит в фоне, чтобы игре досталось больше памяти. Отладка по Wi-Fi должна быть включена.</string>
<string name="setup_clear_cached_unpaired">DroidDeck должен быть сопряжён через отладку по Wi-Fi (кнопка «Сопрячь» ниже).</string>
<string name="setup_memory_hud">Индикатор памяти</string>
<string name="setup_memory_hud_hint">Используемая память и подкачка на экране сеанса. «Дополнительно» показывает отдельно игру, DroidDeck, Android и GPU.</string>
<string name="setup_memory_hud_simple">Простой</string>
<string name="setup_memory_hud_advanced">Дополнительно</string>
<string name="memory_hud_simple">ОЗУ %1$s/%2$s ГБ · подкачка %3$s/%4$s ГБ</string>
<string name="memory_hud_split">игра %1$s · DroidDeck %2$s · Android %3$s ГБ</string>
<string name="memory_hud_gpu">GPU %1$s ГБ</string>
<string name="setup_bg_limit">Фоновые приложения во время сеанса</string>
<string name="setup_bg_limit_hint">Пока идёт сеанс, Android хранит в кэше не больше этого числа приложений и закрывает остальные, чтобы их память досталась игре. После сеанса всё возвращается как было. Отладка по Wi-Fi должна быть включена.</string>
<string name="setup_bg_limit_4">Не больше 4</string>
+5 -7
View File
@@ -1249,6 +1249,11 @@
<string name="agent_action_prepare">Förbered</string>
<string name="agent_connection_off">Trådlös felsökning kan inte nås; Para slår på den</string>
<string name="agent_action_pair">Para</string>
<string name="agent_step_connection_quest_hint">Quest har ingen parkopplingsskärm. Kör en gång från en dator: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS och adb tcpip 5555. Tryck sedan på Tillåt och godkänn frågan i headsetet</string>
<string name="agent_action_allow">Tillåt</string>
<string name="agent_connection_quest_waiting">Godkänn ”Tillåt felsökning?” i headsetet med Tillåt alltid markerat</string>
<string name="agent_connection_quest_failed">Det gick inte att ansluta. Godkänn felsökningsfrågan i headsetet, eller kör adb tcpip 5555 från en dator och försök igen om ingen visades</string>
<string name="agent_connection_quest_off">Trådlös felsökning går inte att nå. Tryck på Tillåt för att konfigurera den igen</string>
<string name="agent_action_install">Installera</string>
<string name="agent_action_sign_in">Logga in</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3800,13 +3805,6 @@
<string name="setup_clear_cached">Stäng cachade appar före en session</string>
<string name="setup_clear_cached_hint">När en session startar stänger DroidDeck apparna som Android håller parkerade i bakgrunden, så att spelet får mer minne. Trådlös felsökning måste vara på.</string>
<string name="setup_clear_cached_unpaired">Kräver att DroidDeck är ihopparat via Trådlös felsökning (Para ihop, nedan).</string>
<string name="setup_memory_hud">Minnesvisning</string>
<string name="setup_memory_hud_hint">Minne och swap som används, på sessionsskärmen. Avancerat delar upp det på spelet, DroidDeck, Android och GPU:n.</string>
<string name="setup_memory_hud_simple">Enkel</string>
<string name="setup_memory_hud_advanced">Avancerat</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">spel %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Bakgrundsappar under en session</string>
<string name="setup_bg_limit_hint">Medan en session pågår håller Android högst så här många appar cachade och stänger resten, så att spelet får deras minne. DroidDeck återställer gränsen som den var när sessionen slutar. Trådlös felsökning måste vara på.</string>
<string name="setup_bg_limit_4">Högst 4</string>
+5 -7
View File
@@ -1246,6 +1246,11 @@
<string name="agent_action_prepare">เตรียม</string>
<string name="agent_connection_off">เชื่อมต่อการดีบักแบบไร้สายไม่ได้; จับคู่จะเปิดใช้งาน</string>
<string name="agent_action_pair">จับคู่</string>
<string name="agent_step_connection_quest_hint">Quest ไม่มีหน้าจอจับคู่ จากคอมพิวเตอร์ ให้รันหนึ่งครั้ง: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS และ adb tcpip 5555 จากนั้นแตะอนุญาตและยอมรับข้อความในเฮดเซ็ต</string>
<string name="agent_action_allow">อนุญาต</string>
<string name="agent_connection_quest_waiting">ยอมรับ “อนุญาตการแก้ไขข้อบกพร่องไหม” ในเฮดเซ็ต โดยเลือกอนุญาตเสมอ</string>
<string name="agent_connection_quest_failed">เชื่อมต่อไม่ได้ ยอมรับข้อความแก้ไขข้อบกพร่องในเฮดเซ็ต หรือหากไม่มีข้อความขึ้น ให้รัน adb tcpip 5555 จากคอมพิวเตอร์แล้วลองอีกครั้ง</string>
<string name="agent_connection_quest_off">เข้าถึงการแก้ไขข้อบกพร่องแบบไร้สายไม่ได้ แตะอนุญาตเพื่อตั้งค่าใหม่</string>
<string name="agent_action_install">ติดตั้ง</string>
<string name="agent_action_sign_in">ลงชื่อเข้าใช้</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3771,13 +3776,6 @@
<string name="setup_clear_cached">ปิดแอปที่แคชไว้ก่อนเริ่มเซสชัน</string>
<string name="setup_clear_cached_hint">เมื่อเซสชันเริ่ม DroidDeck จะปิดแอปที่ Android พักไว้ในพื้นหลัง เพื่อให้เกมมีหน่วยความจำมากขึ้น ต้องเปิด Wireless debugging ไว้</string>
<string name="setup_clear_cached_unpaired">ต้องจับคู่ DroidDeck กับ Wireless debugging ก่อน (จับคู่ ด้านล่าง)</string>
<string name="setup_memory_hud">การแสดงหน่วยความจำ</string>
<string name="setup_memory_hud_hint">หน่วยความจำและ swap ที่ใช้อยู่ บนหน้าจอเซสชัน โหมดขั้นสูงจะแยกเป็นเกม, DroidDeck, Android และ GPU</string>
<string name="setup_memory_hud_simple">แบบง่าย</string>
<string name="setup_memory_hud_advanced">ขั้นสูง</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">เกม %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">แอปพื้นหลังระหว่างเซสชัน</string>
<string name="setup_bg_limit_hint">ระหว่างที่เซสชันทำงาน Android จะเก็บแอปไว้ในแคชไม่เกินจำนวนนี้และปิดแอปที่เหลือ เพื่อให้เกมได้หน่วยความจำของแอปเหล่านั้น DroidDeck จะคืนค่าขีดจำกัดเดิมเมื่อเซสชันสิ้นสุด ต้องเปิด Wireless debugging ไว้</string>
<string name="setup_bg_limit_4">ไม่เกิน 4</string>
+5 -7
View File
@@ -1241,6 +1241,11 @@
<string name="agent_action_prepare">Hazırla</string>
<string name="agent_connection_off">Kablosuz hata ayıklamaya ulaşılamıyor; Eşleştir ile açılır</string>
<string name="agent_action_pair">Eşleştir</string>
<string name="agent_step_connection_quest_hint">Quest\'te eşleme ekranı yok. Bir bilgisayardan bir kez çalıştırın: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS ve adb tcpip 5555. Ardından İzin ver\'e dokunun ve kulaklıktaki istemi kabul edin</string>
<string name="agent_action_allow">İzin ver</string>
<string name="agent_connection_quest_waiting">Kulaklıkta “Hata ayıklamaya izin verilsin mi?” istemini Her zaman izin ver işaretliyken kabul edin</string>
<string name="agent_connection_quest_failed">Bağlanılamadı. Kulaklıktaki hata ayıklama istemini kabul edin veya istem görünmediyse bir bilgisayardan adb tcpip 5555 çalıştırıp tekrar deneyin</string>
<string name="agent_connection_quest_off">Kablosuz hata ayıklamaya ulaşılamıyor. Yeniden ayarlamak için İzin ver\'e dokunun</string>
<string name="agent_action_install">Yükle</string>
<string name="agent_action_sign_in">Giriş yap</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3798,13 +3803,6 @@
<string name="setup_clear_cached">Oturumdan önce önbellekteki uygulamaları kapat</string>
<string name="setup_clear_cached_hint">Bir oturum başladığında DroidDeck, Android\'in arka planda tuttuğu uygulamaları kapatır; böylece oyuna daha fazla bellek kalır. Kablosuz hata ayıklama açık olmalıdır.</string>
<string name="setup_clear_cached_unpaired">DroidDeck\'in Kablosuz hata ayıklama ile eşlenmesi gerekir (Eşle, aşağıda).</string>
<string name="setup_memory_hud">Bellek göstergesi</string>
<string name="setup_memory_hud_hint">Oturum ekranında kullanılan bellek ve swap. Gelişmiş, bunu oyun, DroidDeck, Android ve GPU olarak ayırır.</string>
<string name="setup_memory_hud_simple">Basit</string>
<string name="setup_memory_hud_advanced">Gelişmiş</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">oyun %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Oturum sırasında arka plan uygulamaları</string>
<string name="setup_bg_limit_hint">Oturum sürerken Android önbellekte en fazla bu kadar uygulama tutar ve gerisini kapatır; böylece onların belleği oyuna kalır. Oturum bittiğinde DroidDeck sınırı eski haline getirir. Kablosuz hata ayıklama açık olmalıdır.</string>
<string name="setup_bg_limit_4">En fazla 4</string>
+5 -7
View File
@@ -1257,6 +1257,11 @@
<string name="agent_action_prepare">Підготувати</string>
<string name="agent_connection_off">Бездротове налагодження недоступне; «Сполучити» увімкне його</string>
<string name="agent_action_pair">Сполучити</string>
<string name="agent_step_connection_quest_hint">У Quest немає екрана підключення. Один раз виконайте на комп’ютері: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS і adb tcpip 5555. Потім торкніться «Дозволити» й підтвердьте запит у шоломі</string>
<string name="agent_action_allow">Дозволити</string>
<string name="agent_connection_quest_waiting">Підтвердьте «Дозволити налагодження?» у шоломі, позначивши «Завжди дозволяти»</string>
<string name="agent_connection_quest_failed">Не вдалося підключитися. Підтвердьте запит на налагодження в шоломі, а якщо його не було, виконайте adb tcpip 5555 на комп’ютері й спробуйте ще раз</string>
<string name="agent_connection_quest_off">Бездротове налагодження недоступне. Торкніться «Дозволити», щоб налаштувати його знову</string>
<string name="agent_action_install">Установити</string>
<string name="agent_action_sign_in">Увійти</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3878,13 +3883,6 @@
<string name="setup_clear_cached">Закривати кешовані додатки перед сеансом</string>
<string name="setup_clear_cached_hint">Коли починається сеанс, DroidDeck закриває додатки, які Android тримає у фоні, щоб грі дісталося більше пам\'яті. Бездротове налагодження має бути ввімкнене.</string>
<string name="setup_clear_cached_unpaired">Потрібно поєднати DroidDeck через бездротове налагодження («Поєднати», нижче).</string>
<string name="setup_memory_hud">Показник пам\'яті</string>
<string name="setup_memory_hud_hint">Використана пам\'ять і swap на екрані сеансу. «Розширений» розподіляє її між грою, DroidDeck, Android і GPU.</string>
<string name="setup_memory_hud_simple">Простий</string>
<string name="setup_memory_hud_advanced">Розширений</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">гра %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Фонові додатки під час сеансу</string>
<string name="setup_bg_limit_hint">Під час сеансу Android тримає в кеші не більше ніж стільки додатків і закриває решту, щоб гра отримала їхню пам\'ять. Коли сеанс завершується, DroidDeck повертає попереднє обмеження. Бездротове налагодження має бути ввімкнене.</string>
<string name="setup_bg_limit_4">Не більше 4</string>
+5 -7
View File
@@ -1246,6 +1246,11 @@
<string name="agent_action_prepare">Chuẩn bị</string>
<string name="agent_connection_off">Không truy cập được gỡ lỗi không dây; Ghép đôi sẽ bật tính năng này</string>
<string name="agent_action_pair">Ghép đôi</string>
<string name="agent_step_connection_quest_hint">Quest không có màn hình ghép nối. Từ máy tính, chạy một lần: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS và adb tcpip 5555. Sau đó nhấn Cho phép và chấp nhận lời nhắc trong kính</string>
<string name="agent_action_allow">Cho phép</string>
<string name="agent_connection_quest_waiting">Chấp nhận “Cho phép gỡ lỗi?” trong kính, với Luôn cho phép được chọn</string>
<string name="agent_connection_quest_failed">Không thể kết nối. Chấp nhận lời nhắc gỡ lỗi trong kính, hoặc nếu không thấy lời nhắc, hãy chạy adb tcpip 5555 từ máy tính rồi thử lại</string>
<string name="agent_connection_quest_off">Không thể kết nối gỡ lỗi không dây. Nhấn Cho phép để thiết lập lại</string>
<string name="agent_action_install">Cài đặt</string>
<string name="agent_action_sign_in">Đăng nhập</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3771,13 +3776,6 @@
<string name="setup_clear_cached">Đóng ứng dụng đã lưu đệm trước phiên</string>
<string name="setup_clear_cached_hint">Khi phiên bắt đầu, DroidDeck đóng các ứng dụng mà Android giữ ở nền để game có thêm bộ nhớ. Phải bật Gỡ lỗi qua mạng không dây.</string>
<string name="setup_clear_cached_unpaired">Cần ghép nối DroidDeck với Gỡ lỗi qua mạng không dây (Ghép nối, bên dưới).</string>
<string name="setup_memory_hud">Chỉ báo bộ nhớ</string>
<string name="setup_memory_hud_hint">Bộ nhớ và swap đang dùng, trên màn hình phiên. Nâng cao chia theo game, DroidDeck, Android và GPU.</string>
<string name="setup_memory_hud_simple">Đơn giản</string>
<string name="setup_memory_hud_advanced">Nâng cao</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">game %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Ứng dụng nền trong phiên</string>
<string name="setup_bg_limit_hint">Trong khi phiên chạy, Android chỉ giữ tối đa chừng này ứng dụng trong bộ nhớ đệm và đóng phần còn lại để game có bộ nhớ của chúng. DroidDeck đặt lại giới hạn như cũ khi phiên kết thúc. Phải bật Gỡ lỗi qua mạng không dây.</string>
<string name="setup_bg_limit_4">Tối đa 4</string>
+5 -7
View File
@@ -1329,6 +1329,11 @@
<string name="agent_action_prepare">准备</string>
<string name="agent_connection_off">无线调试无法连接;配对即可开启</string>
<string name="agent_action_pair">配对</string>
<string name="agent_step_connection_quest_hint">Quest 没有配对界面。请在电脑上运行一次:adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS 和 adb tcpip 5555。然后点按“允许”,并在头显中接受提示</string>
<string name="agent_action_allow">允许</string>
<string name="agent_connection_quest_waiting">在头显中接受“允许调试吗?”,并勾选“始终允许”</string>
<string name="agent_connection_quest_failed">无法连接。请在头显中接受调试提示;如果没有出现提示,请在电脑上运行 adb tcpip 5555 后重试</string>
<string name="agent_connection_quest_off">无法连接无线调试。点按“允许”重新设置</string>
<string name="agent_action_install">安装</string>
<string name="agent_action_sign_in">登录</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3772,13 +3777,6 @@
<string name="setup_clear_cached">会话前关闭缓存的应用</string>
<string name="setup_clear_cached_hint">会话开始时关闭 Android 留在后台的应用,让游戏有更多内存可用。需要开启无线调试。</string>
<string name="setup_clear_cached_unpaired">需要先将 DroidDeck 与无线调试配对(见下方“配对”)。</string>
<string name="setup_memory_hud">内存读数</string>
<string name="setup_memory_hud_hint">在会话画面上显示已用内存和交换空间。高级模式会分别显示游戏、DroidDeck、Android 和 GPU。</string>
<string name="setup_memory_hud_simple">简单</string>
<string name="setup_memory_hud_advanced">高级</string>
<string name="memory_hud_simple">内存 %1$s/%2$s GB · 交换 %3$s/%4$s GB</string>
<string name="memory_hud_split">游戏 %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">会话期间的后台应用</string>
<string name="setup_bg_limit_hint">会话运行期间,Android 最多缓存这么多个应用并关闭其余应用,让游戏使用它们的内存。会话结束后恢复原状。需要开启无线调试。</string>
<string name="setup_bg_limit_4">最多 4 个</string>
+5 -7
View File
@@ -1245,6 +1245,11 @@
<string name="agent_action_prepare">準備</string>
<string name="agent_connection_off">無線偵錯無法連線;按「配對」即可開啟</string>
<string name="agent_action_pair">配對</string>
<string name="agent_step_connection_quest_hint">Quest 沒有配對畫面。請在電腦上執行一次:adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS 及 adb tcpip 5555。然後輕按「允許」,並在頭戴裝置中接受提示</string>
<string name="agent_action_allow">允許</string>
<string name="agent_connection_quest_waiting">在頭戴裝置中接受「要允許偵錯嗎?」,並剔選「一律允許」</string>
<string name="agent_connection_quest_failed">無法連接。請在頭戴裝置中接受偵錯提示;如果沒有出現提示,請在電腦上執行 adb tcpip 5555 後再試一次</string>
<string name="agent_connection_quest_off">無法連接無線偵錯。輕按「允許」重新設定</string>
<string name="agent_action_install">安裝</string>
<string name="agent_action_sign_in">登入</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3769,13 +3774,6 @@
<string name="setup_clear_cached">工作階段前關閉快取的應用程式</string>
<string name="setup_clear_cached_hint">工作階段開始時關閉 Android 留在背景的應用程式,讓遊戲有更多記憶體可用。需要開啟無線偵錯。</string>
<string name="setup_clear_cached_unpaired">需要先將 DroidDeck 與無線偵錯配對(見下方「配對」)。</string>
<string name="setup_memory_hud">記憶體讀數</string>
<string name="setup_memory_hud_hint">在工作階段畫面上顯示已用記憶體和交換空間。進階模式會分別顯示遊戲、DroidDeck、Android 和 GPU。</string>
<string name="setup_memory_hud_simple">簡單</string>
<string name="setup_memory_hud_advanced">進階</string>
<string name="memory_hud_simple">記憶體 %1$s/%2$s GB · 交換 %3$s/%4$s GB</string>
<string name="memory_hud_split">遊戲 %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">工作階段期間的背景應用程式</string>
<string name="setup_bg_limit_hint">工作階段執行期間,Android 最多快取這麼多個應用程式並關閉其餘的,讓遊戲使用它們的記憶體。工作階段結束後還原。需要開啟無線偵錯。</string>
<string name="setup_bg_limit_4">最多 4 個</string>
+5 -7
View File
@@ -1245,6 +1245,11 @@
<string name="agent_action_prepare">準備</string>
<string name="agent_connection_off">無線偵錯無法連線;配對即可開啟</string>
<string name="agent_action_pair">配對</string>
<string name="agent_step_connection_quest_hint">Quest 沒有配對畫面。請在電腦上執行一次:adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS 和 adb tcpip 5555。接著輕觸「允許」,並在頭戴式裝置中接受提示</string>
<string name="agent_action_allow">允許</string>
<string name="agent_connection_quest_waiting">在頭戴式裝置中接受「要允許偵錯嗎?」,並勾選「一律允許」</string>
<string name="agent_connection_quest_failed">無法連線。請在頭戴式裝置中接受偵錯提示;如果沒有出現提示,請在電腦上執行 adb tcpip 5555 後再試一次</string>
<string name="agent_connection_quest_off">無法連上無線偵錯。輕觸「允許」重新設定</string>
<string name="agent_action_install">安裝</string>
<string name="agent_action_sign_in">登入</string>
<string name="upd_pr">PR #%1$d</string>
@@ -3769,13 +3774,6 @@
<string name="setup_clear_cached">工作階段前關閉快取的應用程式</string>
<string name="setup_clear_cached_hint">工作階段開始時關閉 Android 留在背景的應用程式,讓遊戲有更多記憶體可用。需要開啟無線偵錯。</string>
<string name="setup_clear_cached_unpaired">需要先將 DroidDeck 與無線偵錯配對(見下方「配對」)。</string>
<string name="setup_memory_hud">記憶體讀數</string>
<string name="setup_memory_hud_hint">在工作階段畫面上顯示已用記憶體和交換空間。進階模式會分別顯示遊戲、DroidDeck、Android 和 GPU。</string>
<string name="setup_memory_hud_simple">簡單</string>
<string name="setup_memory_hud_advanced">進階</string>
<string name="memory_hud_simple">記憶體 %1$s/%2$s GB · 交換 %3$s/%4$s GB</string>
<string name="memory_hud_split">遊戲 %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">工作階段期間的背景應用程式</string>
<string name="setup_bg_limit_hint">工作階段執行期間,Android 最多快取這麼多個應用程式並關閉其餘的,讓遊戲使用它們的記憶體。工作階段結束後還原。需要開啟無線偵錯。</string>
<string name="setup_bg_limit_4">最多 4 個</string>
+5 -7
View File
@@ -1392,6 +1392,11 @@
<string name="agent_action_prepare">Prepare</string>
<string name="agent_connection_off">Wireless debugging isn\'t reachable; Pair turns it on</string>
<string name="agent_action_pair">Pair</string>
<string name="agent_step_connection_quest_hint">Quest has no pairing screen. From a computer, run once: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS and adb tcpip 5555. Then tap Allow and accept the prompt in the headset</string>
<string name="agent_action_allow">Allow</string>
<string name="agent_connection_quest_waiting">Accept “Allow debugging?” in the headset, with Always allow ticked</string>
<string name="agent_connection_quest_failed">Couldn\'t connect. Accept the debugging prompt in the headset, or if none appeared, run adb tcpip 5555 from a computer and try again</string>
<string name="agent_connection_quest_off">Wireless debugging isn\'t reachable. Tap Allow to set it up again</string>
<string name="agent_action_install">Install</string>
<string name="agent_action_sign_in">Sign in</string>
<string name="agent_action_free">Free models</string>
@@ -4109,13 +4114,6 @@
<string name="setup_clear_cached">Clear cached apps before a session</string>
<string name="setup_clear_cached_hint">When a session starts, DroidDeck closes the apps Android keeps parked in the background, so the game has more memory. Wireless debugging must be on.</string>
<string name="setup_clear_cached_unpaired">Needs DroidDeck paired with Wireless debugging (Pair, below).</string>
<string name="setup_memory_hud">Memory readout</string>
<string name="setup_memory_hud_hint">Memory and swap in use, on the session screen. Advanced splits it into the game, DroidDeck, Android and the GPU.</string>
<string name="setup_memory_hud_simple">Simple</string>
<string name="setup_memory_hud_advanced">Advanced</string>
<string name="memory_hud_simple">RAM %1$s/%2$s GB · swap %3$s/%4$s GB</string>
<string name="memory_hud_split">game %1$s · DroidDeck %2$s · Android %3$s GB</string>
<string name="memory_hud_gpu">GPU %1$s GB</string>
<string name="setup_bg_limit">Background apps during a session</string>
<string name="setup_bg_limit_hint">While a session runs, Android keeps at most this many apps cached and closes the rest, so the game has their memory. DroidDeck puts the limit back as it was when the session ends. Wireless debugging must be on.</string>
<string name="setup_bg_limit_4">At most 4</string>
@@ -20,6 +20,24 @@ class GameEnvironmentTest {
assertEquals("1", GameEnvironment.effective(config, "", "43", forceSsbs = true)[GameEnvironment.FORCE_SSBS])
}
@Test fun knownGameFixesBeatSharedSettingsButNotTheGamesOwn() {
val shared = GameEnvironment.Config(shared = mapOf("FEX_X87REDUCEDPRECISION" to "1"))
assertEquals("0", GameEnvironment.effective(shared, "PERFORMANCE_TSO", "12100")["FEX_X87REDUCEDPRECISION"])
assertEquals("1", GameEnvironment.effective(shared, "PERFORMANCE_TSO", "12110")["FEX_X87REDUCEDPRECISION"])
val own = shared.withEntries("12100", mapOf("FEX_X87REDUCEDPRECISION" to "1"))
assertEquals("1", GameEnvironment.effective(own, "PERFORMANCE_TSO", "12100")["FEX_X87REDUCEDPRECISION"])
assertEquals("1", GameEnvironment.withKnownGames(own).games["12100"]?.get("FEX_X87REDUCEDPRECISION"))
assertEquals("0", GameEnvironment.withKnownGames(shared).games["12100"]?.get("FEX_X87REDUCEDPRECISION"))
}
@Test fun aGamePresetKeepsTheGamesKnownFix() {
val picked = GameEnvironment.withGameFexPreset(GameEnvironment.Config(), "12100", "PERFORMANCE")
assertEquals("0", GameEnvironment.effective(picked, "PERFORMANCE_TSO", "12100")["FEX_X87REDUCEDPRECISION"])
assertEquals("PERFORMANCE", GameEnvironment.gameFexPreset(picked, "12100"))
val other = GameEnvironment.withGameFexPreset(GameEnvironment.Config(), "12110", "PERFORMANCE")
assertEquals("1", GameEnvironment.effective(other, "PERFORMANCE_TSO", "12110")["FEX_X87REDUCEDPRECISION"])
}
@Test fun gameOverridesSharedAndPresetWithoutLeakingToOtherGames() {
val config = GameEnvironment.Config(
shared = mapOf("FEX_MULTIBLOCK" to "0", "VKD3D_FEATURE_LEVEL" to "12_2"),
@@ -0,0 +1,79 @@
package com.droiddeck.launcher.runtime
import androidx.test.core.app.ApplicationProvider
import java.io.File
import java.nio.ByteBuffer
import java.nio.ByteOrder
import java.nio.file.Files
import org.junit.After
import org.junit.Assert.assertArrayEquals
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
@RunWith(RobolectricTestRunner::class)
class NativeGuestPrepareTest {
private val svc = 0xd4000001.toInt()
private val rseq = 0xd28024a8.toInt()
private val enosys = 0x928004a0.toInt()
private fun unpatchedLoader(): ByteArray {
val data = ByteArray(0x200)
val b = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN)
b.put(0, 0x7f); b.put(1, 'E'.code.toByte()); b.put(2, 'L'.code.toByte()); b.put(3, 'F'.code.toByte())
b.put(4, 2); b.put(5, 1)
b.putShort(18, 183)
b.putLong(32, 64)
b.putShort(54, 56); b.putShort(56, 1)
b.putInt(64, 1); b.putInt(68, 5)
b.putLong(72, 0x100); b.putLong(96, 0x100)
b.putInt(0x100, rseq); b.putInt(0x104, svc)
return data
}
private fun rootWithUnpatchedLoader(): Pair<File, File> {
val root = Files.createTempDirectory("native-prepare").toFile()
val loader = File(root, "usr/lib/ld-linux-aarch64.so.1")
loader.parentFile!!.mkdirs()
loader.writeBytes(unpatchedLoader())
return root to loader
}
private fun instructionAfterRseq(loader: File): Int =
ByteBuffer.wrap(loader.readBytes()).order(ByteOrder.LITTLE_ENDIAN).getInt(0x104)
@After
fun endSession() {
NativeGuest.sessionMode = null
}
@Test
fun aProgramStartedOutsideASessionGetsALoaderThatSurvivesSeccomp() {
val (root, loader) = rootWithUnpatchedLoader()
NativeGuest.sessionMode = null
NativeGuest.processBuilder(ApplicationProvider.getApplicationContext(), root, emptyList(), listOf("/usr/bin/true"))
assertEquals(enosys, instructionAfterRseq(loader))
}
@Test
fun aProgramStartedInARunningSessionLeavesTheRootfsAsTheSessionPreparedIt() {
val (root, loader) = rootWithUnpatchedLoader()
val before = loader.readBytes()
NativeGuest.sessionMode = true
NativeGuest.processBuilder(ApplicationProvider.getApplicationContext(), root, emptyList(), listOf("/usr/bin/true"))
assertArrayEquals(before, loader.readBytes())
}
@Test
fun anAlreadyPreparedLoaderIsNotRewritten() {
val (root, loader) = rootWithUnpatchedLoader()
NativeGuest.processBuilder(ApplicationProvider.getApplicationContext(), root, emptyList(), listOf("/usr/bin/true"))
val modified = loader.lastModified()
val bytes = loader.readBytes()
loader.setLastModified(modified - 10_000)
NativeGuest.processBuilder(ApplicationProvider.getApplicationContext(), root, emptyList(), listOf("/usr/bin/true"))
assertArrayEquals(bytes, loader.readBytes())
assertEquals(modified - 10_000, loader.lastModified())
}
}
@@ -202,11 +202,19 @@ class GameEnvironmentStoreTest {
assertEquals("false", published.shared["MESA_SHADER_CACHE_DISABLE"])
assertFalse(published.shared.containsKey("VKD3D_FEATURE_LEVEL"))
assertFalse(published.shared.containsKey("VKD3D_SHADER_MODEL"))
assertEquals(config.games, published.games)
assertEquals(config.games + GameEnvironment.knownGames, published.games)
assertEquals(config.shared["LITERAL"], published.shared["LITERAL"])
assertEquals("", published.shared["EMPTY"])
}
@Test fun aKnownGamesFixReachesTheGuestWithoutBeingSavedAsTheUsersSetting() {
GameEnvironmentStore.save(context, GameEnvironment.Config())
assertEquals(emptyMap<String, Map<String, String?>>(), GameEnvironmentStore.read(context).games)
val published = GameEnvironmentStore.decode(JSONObject(guest.readText()))
assertEquals(GameEnvironment.knownGames, published.games)
assertEquals("0", published.entries("12100")["FEX_X87REDUCEDPRECISION"])
}
@Test fun publishingPreservesExplicitSharedGraphicsCapabilities() {
val config = GameEnvironment.Config(shared = mapOf(
"VKD3D_FEATURE_LEVEL" to "12_1", "VKD3D_SHADER_MODEL" to "6_6",
@@ -266,7 +274,7 @@ class GameEnvironmentStoreTest {
assertEquals(original.entries("43"), saved.entries("43"))
assertEquals("PERFORMANCE_TSO", SessionPrefs.fexPreset(context))
val published = GameEnvironmentStore.decode(JSONObject(guest.readText()))
assertEquals(saved.games, published.games)
assertEquals(saved.games + GameEnvironment.knownGames, published.games)
assertEquals("0", published.shared["FEX_HALFBARRIERTSOENABLED"])
assertEquals("1", published.entries("42")["FEX_HALFBARRIERTSOENABLED"])
}
@@ -114,6 +114,19 @@ class GameStorageTest {
assertFalse(GameStorage.disconnected(app))
}
@Test fun aRawCardPathTheProcessCannotUseFallsBackToItsStoragePath() {
val usable = setOf("/storage/A042-9B16/Games")
assertEquals("/storage/A042-9B16/Games", GameStorage.reachable("/mnt/media_rw/A042-9B16/Games") { it.path in usable })
}
@Test fun aUsableRawPathAndOtherPathsAreKept() {
assertEquals("/mnt/media_rw/A042-9B16/Games", GameStorage.reachable("/mnt/media_rw/A042-9B16/Games") { true })
assertEquals("/mnt/media_rw/0000-0000/Games", GameStorage.reachable("/mnt/media_rw/0000-0000/Games") { false })
assertEquals("/storage/A042-9B16/Games", GameStorage.reachable("/storage/A042-9B16/Games") { false })
val folder = tmp.newFolder("library").path
assertEquals(folder, GameStorage.reachable(folder) { false })
}
@Test fun onlyAVfatMountCountsAsFat32() {
val mounts = """
/dev/fuse /storage/emulated fuse rw 0 0
@@ -20,8 +20,6 @@ class MemoryReadoutTest {
val device = MemoryReadout.parseMeminfo(meminfo)!!
assertEquals(11379920L - 3235768L, device.usedKb)
assertEquals(16777212L - 10358080L, device.swapUsedKb)
assertEquals("7.8", MemoryReadout.gb(device.usedKb))
assertEquals("10.9", MemoryReadout.gb(device.totalKb))
assertEquals(0L, MemoryReadout.parseMeminfo("MemTotal: 100 kB\nMemAvailable: 40 kB\n")!!.swapUsedKb)
assertNull(MemoryReadout.parseMeminfo("MemTotal: 100 kB\n"))
}
@@ -21,6 +21,24 @@ class SecondaryLibraryTest {
assertFalse(SecondaryLibrary.privateRoot(files, content).exists())
}
@Test fun aCardReachedThroughItsOtherPathKeepsItsPrivateDirectories() {
val files = tmp.newFolder("files")
val raw = SecondaryLibrary.privateRoot(files, File("/mnt/media_rw/A042-9B16/Games")).apply { mkdirs() }
assertEquals(raw, SecondaryLibrary.privateRoot(files, File("/storage/A042-9B16/Games")))
val storage = SecondaryLibrary.privateRoot(files, File("/storage/B2BD-BCFC/Games")).apply { mkdirs() }
assertEquals(storage, SecondaryLibrary.privateRoot(files, File("/mnt/media_rw/B2BD-BCFC/Games")))
}
@Test fun aLibraryWithItsOwnPrivateDirectoriesKeepsThem() {
val files = tmp.newFolder("files")
val own = SecondaryLibrary.privateRoot(files, File("/storage/A042-9B16/Games")).apply { mkdirs() }
val raw = File(own.parentFile, SecondaryLibrary.privateRoot(tmp.newFolder("other"), File("/mnt/media_rw/A042-9B16/Games")).name)
raw.mkdirs()
assertEquals(own, SecondaryLibrary.privateRoot(files, File("/storage/A042-9B16/Games")))
assertEquals(raw, SecondaryLibrary.privateRoot(files, File("/mnt/media_rw/A042-9B16/Games")))
assertFalse(SecondaryLibrary.privateRoot(files, File("/storage/emulated/0/Games")).exists())
}
@Test fun aWritableAliasIsSelectedAndItsProbeIsRemoved() {
val library = tmp.newFolder("shared")
val candidate = File(tmp.root, "direct")
@@ -48,7 +48,6 @@ class SettingsResetTest {
SessionPrefs.setHudShowFps(app, false)
SessionPrefs.setHudShowBattery(app, false)
SessionPrefs.setHudShowGraph(app, false)
SessionPrefs.setHudColor(app, "amber")
SessionPrefs.setHudOpacity(app, 40)
SessionPrefs.setDroidDeckHudConfig(app, "hudSize=mega,showFPSGraph=0")
SessionPrefs.setDroidDeckHudPosition(app, 120f, 40f)
@@ -77,7 +76,6 @@ class SettingsResetTest {
assertTrue(SessionPrefs.hudShowFps(app))
assertTrue(SessionPrefs.hudShowBattery(app))
assertTrue(SessionPrefs.hudShowGraph(app))
assertEquals(SessionPrefs.HUD_COLOR_MINT, SessionPrefs.hudColor(app))
assertEquals(SessionPrefs.HUD_OPACITY_DEFAULT, SessionPrefs.hudOpacity(app))
assertNull(SessionPrefs.droidDeckHudConfig(app))
assertNull(SessionPrefs.droidDeckHudPosition(app))
@@ -0,0 +1,34 @@
package com.droiddeck.launcher.stores.battlenet
import com.droiddeck.launcher.session.SessionPrefs
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [33])
class BattleNetLibraryTest {
private val app get() = RuntimeEnvironment.getApplication()
@get:Rule val tmp = TemporaryFolder()
@Test fun aMissingLibraryLeavesBattleNetsInstallFolderAlone() {
SessionPrefs.setGameStorage(app, "/storage/0000-0000/Games", "SD card")
assertTrue(BattleNetClient.library(app).isEmpty())
}
@Test fun anAttachedLibraryIsHandedToBattleNet() {
SessionPrefs.setGameStorage(app, tmp.newFolder("card").path, "SD card")
assertEquals("--library", BattleNetClient.library(app).firstOrNull())
}
@Test fun internalStorageIsHandedToBattleNetWhenItIsTheChoice() {
SessionPrefs.setGameStorage(app, SessionPrefs.GAME_STORAGE_OFF, "")
assertEquals("--library", BattleNetClient.library(app).firstOrNull())
}
}
@@ -0,0 +1,37 @@
package com.droiddeck.launcher.stores.steam
import androidx.compose.runtime.State
import androidx.compose.runtime.snapshots.Snapshot
import androidx.compose.runtime.snapshots.StateObject
import com.droiddeck.launcher.stores.StoresState
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import kotlin.concurrent.thread
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [33], manifest = Config.NONE)
class SteamPickingSnapshotTest {
@Test
fun theInstallPickerIsReadableInASnapshotOpenedBeforeTheSteamEngineStarts() {
StoresState.steamPicking = null
val snapshot = Snapshot.takeMutableSnapshot()
try {
thread { SteamStore.hashCode() }.join()
assertNull(snapshot.enter { StoresState.steamPicking })
} finally {
snapshot.dispose()
}
}
@Test
fun theSteamEngineHoldsNoComposeState() {
val stateFields = SteamStore::class.java.declaredFields.filter {
StateObject::class.java.isAssignableFrom(it.type) || State::class.java.isAssignableFrom(it.type)
}
assertTrue(stateFields.joinToString { it.name }, stateFields.isEmpty())
}
}
@@ -16,6 +16,34 @@ class XboxManifestTest {
java.io.File(root, "MicrosoftGame.Config").writeText("<Game><ExecutableList><Executable Name=\"bin\\GAME.EXE\" TargetDeviceFamily=\"PC\"/></ExecutableList></Game>")
assertEquals("Bin/Game.exe", XboxInstaller.executable(root))
}
@Test fun aListedExecutableThePackageDoesNotShipFallsThroughToTheNextOne() {
val root = temporary.newFolder()
java.io.File(root, "bin/x64_dx12").mkdirs()
java.io.File(root, "bin/x64_dx12/game.exe").writeText("encrypted")
java.io.File(root, "MicrosoftGame.config").writeText("<Game><ExecutableList>" +
"<Executable Name=\"bin\\x64\\game.exe\" TargetDeviceFamily=\"PC\"/>" +
"<Executable Name=\"Launcher\\start.exe\" TargetDeviceFamily=\"PC\"/>" +
"<Executable Name=\"bin\\x64_dx12\\game.exe\" TargetDeviceFamily=\"PC\"/></ExecutableList></Game>")
assertEquals("bin/x64_dx12/game.exe", XboxInstaller.executable(root))
}
@Test fun anAmbiguouslyCasedExecutableFallsThroughToTheNextOne() {
val root = temporary.newFolder()
java.io.File(root, "Game.exe").writeText("one")
java.io.File(root, "GAME.exe").writeText("two")
java.io.File(root, "Other.exe").writeText("three")
org.junit.Assume.assumeTrue(root.listFiles().orEmpty().count { it.name.equals("game.exe", true) } == 2)
java.io.File(root, "MicrosoftGame.config").writeText("<Game><ExecutableList>" +
"<Executable Name=\"game.exe\"/><Executable Name=\"Other.exe\"/></ExecutableList></Game>")
assertEquals("Other.exe", XboxInstaller.executable(root))
}
@Test fun aPackageWithNoneOfItsListedExecutablesStillFails() {
val root = temporary.newFolder()
java.io.File(root, "Unlisted.exe").writeText("encrypted")
java.io.File(root, "MicrosoftGame.config").writeText("<Game><ExecutableList>" +
"<Executable Name=\"bin\\Game.exe\"/><Executable Name=\"Game.exe\"/></ExecutableList></Game>")
val failure = assertThrows(IllegalArgumentException::class.java) { XboxInstaller.executable(root) }
assertEquals("Missing or ambiguous Xbox launch path.", failure.message)
}
@Test fun aLauncherMenuIsSkippedForTheProgramItNames() {
val root = temporary.newFolder()
java.io.File(root, "EmuMenu").mkdir()
@@ -9,6 +9,25 @@ import org.junit.Test
class XodusDiagnosticsTest {
private val rejected = Regex(Xodus.SIGN_IN_REJECTED)
@Test fun aDeviceLimitReachesTheInstallerWithoutBecomingASignInFailure() {
val line = "NEXUS_CONTENT_LICENSE_DIAGNOSTIC_V1 content-device-limit 200"
val tail = listOf(line).filter { it.matches(Xodus.reportable) }
assertEquals(listOf(line), tail)
assertFalse(line.matches(rejected))
assertEquals(com.droiddeck.launcher.R.string.stores_xbox_device_group_full, XboxInstaller.licenseRefusal(tail))
}
@Test fun aLaterLicenseSuccessClearsTheDeviceLimitThroughTheDiagnosticFilter() {
val stderr = listOf(
"NEXUS_CONTENT_LICENSE_DIAGNOSTIC_V1 content-device-limit 200",
"NEXUS_CONTENT_LICENSE_DIAGNOSTIC_V1 content-parsed 200",
"NEXUS_EXTRACT_DIAGNOSTIC_V1 extract-failed"
)
val tail = stderr.filter { it.matches(Xodus.reportable) }
assertEquals(stderr, tail)
assertNull(XboxInstaller.licenseRefusal(tail))
}
@Test fun aContentLicenseRejectionIsRecognised() {
assertTrue("Microsoft content licensing rejected sign-in (HTTP 401). Sign in again in Settings.".matches(rejected))
}
@@ -122,6 +122,19 @@ class LibraryEntriesTest {
assertEquals(listOf("steam", "xbox", "itch", "gamejolt"), librarySources(entries, listOf("xbox", "itch", "gamejolt"), setOf("itch", "gamejolt")))
}
@Test fun everySignedInStoreKeepsItsTabWhenItsLibraryIsEmptyOrFailedToLoad() {
val entries = listOf(LibraryEntry("epic:1", "epic", "Game", null, null, true))
val order = listOf("epic", Store.ROCKSTAR.id, "gog")
val always = alwaysLibraryTabs(listOf(Store.STEAM, Store.ROCKSTAR), stores = true, soundMode = false)
assertEquals(listOf("steam", "epic", "rockstar", "battlenet", "added"), librarySources(entries, order, always))
}
@Test fun signedOutStoresAndSoundtrackModeDoNotGainEmptyTabs() {
assertEquals(setOf("added", "battlenet"), alwaysLibraryTabs(emptyList(), stores = true, soundMode = false))
assertEquals(setOf("added", "battlenet"), alwaysLibraryTabs(listOf(Store.STEAM, Store.ROCKSTAR), stores = true, soundMode = true))
assertEquals(emptySet<String>(), alwaysLibraryTabs(emptyList(), stores = false, soundMode = false))
}
@Test fun gameKeysNameEitherAnAppOrAStoreProduct() {
GameRef.parse("app:440").let { assertEquals(440, it.appId); assertNull(it.store) }
GameRef.parse("app:-12").let { assertEquals(-12, it.appId) }
+28
View File
@@ -27,6 +27,28 @@ bytes for dimensions at least four pixels:
These are pixel payloads, not driver allocation sizes or measured FPS gains.
## Scratch ownership and rebuilds
Each `FrameGen` instance owns its scratch buffers, mappings and descriptor sets.
A size or live-preset rebuild first confirms GPU completion and resets that
instance's descriptor pool, then releases the old scratch and image resources.
Motion/history validity is reset with the rebuilt images. Repeated preparation
at the same size and ordinary frame recording do not add device-idle waits.
Healthy destruction releases the descriptor pool, mapped scratch buffers and
images. The native engine releases its input ring only after the chain confirms
completion, so an input image is not destroyed before the wait.
If `vkDeviceWaitIdle` fails with an error other than
`VK_ERROR_DEVICE_LOST`, the affected instance becomes unusable: further
recording and rebuilding stop, and its Vulkan resources and input ring are
intentionally retained because GPU completion is unknown. Device loss follows
a separate teardown path: `FrameGen::destroy()` releases its owned resources
without another wait and returns true, allowing the Engine to release the
input ring. This is local DD-FG containment, not compositor-wide GPU recovery.
A descriptor-pool reset failure also stops that resize without releasing the
resources, but healthy teardown can still release them.
## Validation
Run `python3 -m unittest discover -s tools/tests -p 'test_ddfg_flow_levels.py'`.
@@ -35,4 +57,10 @@ selected through the usual SDK/NDK environment variables. It compiles the actual
DD-FG chain against a mock Vulkan dispatch table and checks resource counts,
dispatch order and sizes, valid descriptor bindings, both models, every preset,
2x/3x/4x generation, small/odd extents, resize and live preset changes.
The same harness enforces descriptor-pool capacity, accounts for all live
resources, and models pending GPU work to reject early cleanup. Lifecycle cases
cover repeated rebuilds, same-size restarts, two simultaneous instances,
automatic/idempotent destruction, partial resize allocation, failed GPU waits,
and failed descriptor-pool resets. The actual native `Engine` is included to
check the input-ring destruction order.
It does not execute shaders on a GPU or replace on-device validation.
+1 -1
View File
@@ -172,7 +172,7 @@ Register + launch: droiddeck-ubisoft (guest, like droiddeck-battlenet)
| U2 | Can the app-side LSX server on 127.0.0.1:3216 be reached from proot + Wine, and do games connect with our registry keys (Maxima #71)? | Spike with a Steam EA title already in the library | EA launch, Steam EA titles |
| U3 | What does EA's CDN serve for a current title: one ZIP, multiple, or delta? How do language selection and `installerdata.xml` work? | Maxima `content/` + `downloadUrl.gql`, one real download through the Rust engine | EA install |
| U4 | Does Connect accept a tree we downloaded once the `Installs` registry key is written, or does it re-verify or re-download? Does `connect-seed` work under FEX on a phone? | Spike with a small owned title (ubi-cli-mvp used Splinter Cell / product 109). #1445's registry work is the start | Ubisoft stage 2 |
| U5 | Does Ubisoft Connect (Qt + CEF) run acceptably under FEX in our prefix? How much RAM does it hold while a game runs? | Install it like Battle.net; measure with the Memory readout from #979 | Ubisoft stage 1 |
| U5 | Does Ubisoft Connect (Qt + CEF) run acceptably under FEX in our prefix? How much RAM does it hold while a game runs? | Install it like Battle.net; measure with the performance HUD's Memory reading | Ubisoft stage 1 |
| U6 | Ubisoft's WebAuth page in an Android WebView: captcha, 2FA, `Ubi-Challenge` | Real sign-in on device | Ubisoft sign-in |
| U7 | Demux over TLS from Android (certificate pinning, patch-version negotiation drift) | Rust spike against `dmx.upc.ubisoft.com` | Ubisoft library and downloads |
| U8 | Ubisoft+ subscription entitlements in Demux ownership | Account with Ubisoft+ | Library completeness |
+68
View File
@@ -0,0 +1,68 @@
# Experimental spatial upscaling after frame generation
The compositor limits effects output to the logical scene size while frame
generation is active. This avoids running interpolation over the full phone
panel, but can make FSR/GSR/NIS see equal input and output sizes and skip their
spatial pass. Version 0.5.0 instead upscaled before interpolation, which made
the interpolation workload scale with panel resolution.
This experiment keeps the existing source-resolution selection and runs frame
generation at the effects input size. Each generated frame and the final real
frame then uses the selected spatial filter at the mapped display size.
It introduces no extra frame queue or CPU fence wait. Performance and latency
improvements are hypotheses, not measured results.
## Scope and activation
Use an SDR game with a real input buffer smaller than the mapped output.
Enable frame generation and select AMD FSR 1, FSR Fit, Snapdragon GSR/GSR HQ,
or NIS in the scaling filter setting. Keep additional effects (CAS, color,
FXAA, CRT, etc.) off for this experiment. Sharpen-only, linear, nearest,
frame-generation-off, HDR and cardboard paths retain their existing behavior.
Combining a spatial filter with additional effects also retains the old path;
this experiment does not claim to fix that combination.
Source selection remains conservative. A game already rendering a native-size
backbuffer cannot recover its lower internal rendering resolution here.
Overlays included in the low-resolution input are interpolated/upscaled with
that input; this is not a separate native-resolution HUD reconstruction.
GPU targets and source descriptors are separate for each presentation slot so
recording one generated frame cannot replace another frame's bindings.
Source views are released after the existing frame-completion fence; targets
are cached and destroyed with the effects device. This increases GPU memory
use with interpolation multiplier and panel resolution. Allocation failures
retain the input-sized image and the existing screen blit fallback.
## Applying and reverting
Install the test APK produced for this PR. Check its signing/package identity
before replacing an installed release: an Actions test-key APK is not a
release-signed update. An official signed test build requires the repository's
normal publication authorization. Back up session logs and record the exact
APK commit, GPU driver, engine and game settings for comparisons.
No setting migration is required. Disable frame generation or select Linear
to return to the previous presentation path. Do not mix this test with Vulkan
feature-level or game compatibility changes.
## Device validation required before merge
- Compare the same scene on baseline main and this branch: FG off/on, Linear,
FSR, GSR, GSR HQ, NIS, FSR Fit, sharpen-only and nearest.
- Test each supported interpolation multiplier, both engines, warm-up/no
generated frames, 720p-to-1080p and 1080p-to-panel scaling, and no upscale.
- Check real and generated frames for consistent sharpness, halos, ghosting,
text/cursor artifacts, black bars, stretching and frame-order errors.
- Change resolution/filter/engine/multiplier live; open Steam/QAM, rotate,
suspend/resume and stop/restart. Verify no stale image, GPU loss or crash.
- Confirm HDR, cardboard, FG-off and additional-effects fallback behavior.
- Compare sustained frame pacing, generated vs real FPS, GPU load, memory,
temperature and battery use after warm-up; do not treat output FPS alone as
lower input latency. Measure input-to-display latency if equipment permits.
- Test memory pressure and allocation failure fallback; inspect Vulkan
validation for descriptor lifetime, image layouts and synchronization.
Host harnesses exercise resolution routing, generated/real frame counts,
filter gates, fallback and source descriptor lifetime. They do not validate
shader output, mobile-driver behavior, performance or physical input latency.
+28
View File
@@ -0,0 +1,28 @@
# Screen-effect pipeline creation
The screen-effect chain creates its shared render passes, sampler, descriptor
layout/pool and pipeline layout when first used. Graphics pipelines are created
only when the frame's settings require them, then reused until output-format
reset or explicit chain teardown. Source-image and size changes keep the cache.
Pipeline preparation happens before any effect draw is recorded. If a required
pipeline fails to initialize, the chain follows its existing whole-chain
fallback and returns the unprocessed scene; it does not record a partial stack.
Settings are snapshotted at frame entry, so changes during recording apply to
the next invocation.
Spatial upscalers are prepared only when their dispatch path is active. FSR
creates EASU and creates RCAS only when sharpening is enabled; sharpen-only
mode creates RCAS. SMAA prepares its three passes only when selected, while
keeping FXAA available for the existing SMAA scratch-allocation fallback.
Half-precision shaders remain selected by the existing debug property. The
optional fast NIS path and its coefficient resources are deferred until NIS is
actually used; the existing fragment-shader fallback is retained.
This reduces unused pipeline creation and first-use setup work. It does not
reduce the shader work performed each frame, and first use of a newly selected
effect may still compile its pipelines. No background precompilation is added.
Pipeline-count reductions are not measurements of startup latency or FPS.
Validation still requires the native effect-chain tests and on-device visual
testing. Static source checks alone do not establish Vulkan runtime correctness.
-1
View File
@@ -21,7 +21,6 @@ Links of the form `droiddeck://settings/<section>` open a Settings section direc
| Hold the GPU at its top clock | Settings › Performance (`droiddeck://settings/performance`) | gpu, clock, max |
| Clear cached apps before a session | Settings › Performance (`droiddeck://settings/performance`) | memory, ram, crash, sleep, killed |
| Background apps during a session | Settings › Performance (`droiddeck://settings/performance`) | memory, ram, background apps |
| Memory readout | Settings › Performance (`droiddeck://settings/performance`) | memory, ram, overlay |
| Turnip: sysmem rendering | Settings › Performance (`droiddeck://settings/performance`) | |
| Skip Steam's xalia helper | Settings › Performance (`droiddeck://settings/performance`) | |
| droiddeck-esync | Settings › Performance (`droiddeck://settings/performance`) | esync, sync, wine |
@@ -1,9 +0,0 @@
[Desktop Entry]
Name=Return to Gaming Mode
Comment=Log out of the desktop and go back to Steam
Exec=dbus-send --session --type=method_call --dest=org.kde.Shutdown /Shutdown org.kde.Shutdown.logout
Icon=steamdeck-gaming-return
Terminal=false
Type=Application
StartupNotify=false
NoDisplay=true
+5 -1
View File
@@ -229,12 +229,16 @@ fi
if ! /usr/local/bin/droiddeck-pipewire start; then
echo "== pipewire: not running; screen capture has no picture"
fi
return_gaming=/run/droiddeck/return-gaming
mkdir -p /run/droiddeck
rm -f "$return_gaming"
echo "== droiddeck-desktop: Plasma on $WAYLAND_DISPLAY"
dbus-run-session -- startplasma-wayland
rc=$?
/usr/local/bin/droiddeck-pipewire stop
echo "== droiddeck-desktop: Plasma ended ($rc)"
if [ "$rc" -eq 0 ] && [ -z "${DD_BOTTOM_DESKTOP:-}" ]; then
if [ "$rc" -eq 0 ] && [ -z "${DD_BOTTOM_DESKTOP:-}" ] && [ -e "$return_gaming" ]; then
rm -f "$return_gaming"
/usr/local/bin/droiddeck-steam-launch bigpicture
sleep 30
fi
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Return to Gaming Mode
Comment=Log out of the desktop and go back to Steam
Exec=sh -c ": > /run/droiddeck/return-gaming; dbus-send --session --print-reply --type=method_call --dest=org.kde.Shutdown /Shutdown org.kde.Shutdown.logout >/dev/null || rm -f /run/droiddeck/return-gaming"
Icon=steamdeck-gaming-return
Terminal=false
Type=Application
StartupNotify=false
NoDisplay=true
@@ -350,6 +350,17 @@ def keeps_open(root):
return isinstance(client, dict) and LAUNCH_BEHAVIOR[0] in client and client[LAUNCH_BEHAVIOR[0]] != LAUNCH_BEHAVIOR[1]
def chosen_folder(root, current, library):
current = current.strip()
folder = windows_path(root, current) if current else None
if not folder or rootfs_drive(root, current) or not os.path.isdir(folder):
return False
try:
return volume_root(os.path.realpath(folder)) == volume_root(os.path.realpath(library))
except OSError:
return False
def write_config(root, library=None):
path = os.path.join(drive_c(root), *CONFIG)
key, value = LAUNCH_BEHAVIOR
@@ -374,6 +385,7 @@ def write_config(root, library=None):
client["HardwareAcceleration"] = "false"
changes.append("acceleration")
if library and isinstance(client.setdefault("Install", {}), dict) \
and not chosen_folder(root, str(client["Install"].get("DefaultInstallPath", "")), library) \
and str(client["Install"].get("DefaultInstallPath", "")).rstrip("/\\") != install_path(root, library).rstrip("\\"):
client["Install"]["DefaultInstallPath"] = install_path(root, library)
changes.append("library")
@@ -1149,6 +1149,7 @@ case $mode in
droiddeck-steam-library "$steam_root" || true
step "setting up the ARM64 Proton compatibility tool"
steam-compatibility "$steam_root" || true
steam-compatibility "$steam_root" --seed-arm64-tools || true
if [ -z "${DD_DESKTOP:-}" ] && [ "${DD_STEAM_UI:-}" != desktop ]; then
droiddeck-steam-ui-scale "$steam_root" "${DD_WIDTH:-1280}" "${DD_HEIGHT:-720}" || true
fi
@@ -5,6 +5,7 @@ import re
import runpy
import shutil
import sys
import tempfile
TOOL = "droiddeck-proton-arm64"
TOOL_11 = "droiddeck-proton-11-arm64"
@@ -26,6 +27,8 @@ SNIPER_APPID = "1628350"
SLR4_APPID = "4183110"
FEX_DEPENDENCIES = (FEX_APPID, SNIPER_APPID, SLR4_APPID)
REQUIRED_TOOLS = (PROTON_ARM64_APPID,) + FEX_DEPENDENCIES
ARM64_TOOL_DEPENDENCIES = (("1826330", "Proton EasyAntiCheat Runtime"),
("1070560", "Steam Linux Runtime 1.0 (scout)"))
# "0" = the app's "Valve Proton only when needed": Valve's ARM64 Proton is fetched only for a title or
# default set to a tool built from it, or while no own Proton build is installed.
VALVE_PROTON_ENV = "DD_VALVE_PROTON"
@@ -1012,10 +1015,15 @@ def manifest_text(appid, name, installdir, bare=False):
return text[:-2] + ' "AutoUpdateBehavior" "1"\n}\n' if bare else text
def app_manifest(steam_root, app):
def manifest_paths(steam_root, app):
for library in libraries(steam_root):
yield os.path.join(library, "steamapps", "appmanifest_%s.acf" % app)
def app_manifest(steam_root, app):
for path in manifest_paths(steam_root, app):
try:
with open(os.path.join(library, "steamapps", "appmanifest_%s.acf" % app), encoding="utf-8", errors="replace") as f:
with open(path, encoding="utf-8", errors="replace") as f:
return tokenize(f.read())
except OSError:
continue
@@ -1030,6 +1038,57 @@ def manifest_flags(tokens):
return 0
def installed_manifest(path):
try:
with open(path, encoding="utf-8", errors="replace") as f:
return bool(manifest_flags(tokenize(f.read())) & FULLY_INSTALLED)
except OSError:
return False
def seed_unavailable_arm64_tools(steam_root):
entries = appinfo_entries(os.path.join(steam_root, "appcache", "appinfo.vdf"),
[app for app, _ in ARM64_TOOL_DEPENDENCIES])
steamapps = os.path.join(steam_root, "steamapps")
os.makedirs(steamapps, exist_ok=True)
seeded = []
for app, display in ARM64_TOOL_DEPENDENCIES:
entry = entries.get(app)
if entry is not None:
if entry["type"] not in ("", "tool"):
continue
if "arm64" in entry["osarch"] or "aarch64" in entry["osarch"]:
continue
existing = [p for p in manifest_paths(steam_root, app) if os.path.isfile(p)]
if any(installed_manifest(p) for p in existing):
continue
name = (entry or {}).get("name") or display
installdir = (entry or {}).get("installdir") or name
path = existing[0] if existing else os.path.join(steamapps, "appmanifest_%s.acf" % app)
temporary = None
try:
with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8",
dir=os.path.dirname(path),
prefix=".appmanifest_", delete=False) as f:
temporary = f.name
f.write(manifest_text(app, name, installdir, True))
if existing:
os.replace(temporary, path)
else:
os.link(temporary, path)
except OSError as e:
print("steam-compatibility: could not mark %s installed (%s)" % (app, e))
continue
finally:
if temporary is not None:
try:
os.unlink(temporary)
except OSError:
pass
seeded.append(app)
return seeded
def valve_proton_on_demand():
return os.environ.get(VALVE_PROTON_ENV) == "0"
@@ -1801,6 +1860,11 @@ def main():
steam_root = sys.argv[1]
if "--valve-proton-needed" in sys.argv[2:]:
sys.exit(0 if valve_proton_needed(steam_root) else 1)
if "--seed-arm64-tools" in sys.argv[2:]:
seeded = seed_unavailable_arm64_tools(steam_root)
if seeded:
print("steam-compatibility: marked unavailable ARM64 tool(s) installed: %s" % ", ".join(seeded))
return
if "--x64" in sys.argv[2:]:
x64_repoint(steam_root, os.environ.get("DD_COMPAT_TOOL"), "--live" in sys.argv[2:])
return
+112 -8
View File
@@ -6,6 +6,7 @@
#include <dlfcn.h>
#include <errno.h>
#include <limits.h>
#include <link.h>
#include <linux/input.h>
#include <pthread.h>
#include <stdatomic.h>
@@ -15,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <sys/types.h>
#include <unistd.h>
@@ -34,6 +36,9 @@
"NAME=\"Xbox 360 Controller (%d)\"\n" \
"PHYS=\"usb-fakeinput/input%d\"\n"
#define STEAM_VIRTUAL_VENDOR 0x28de
#define STEAM_VIRTUAL_PRODUCT 0x11ff
#define PARENT_NAME "droiddeck-input"
#define PARENT_SYSPATH_FORMAT "/sys/devices/droiddeck%d/" PARENT_NAME "%d"
#define EVENT_SYSPATH_FORMAT PARENT_SYSPATH_FORMAT "/event%d"
@@ -49,6 +54,8 @@ struct pad {
int live;
};
static const char *ring_uevent_format(void);
static struct pad pads[PAD_MAX];
static struct pad parents[PAD_MAX];
static int pad_count;
@@ -89,7 +96,7 @@ static void discover_pads(void) {
snprintf(pad->syspath, sizeof(pad->syspath), EVENT_SYSPATH_FORMAT, (int)slot, (int)slot,
(int)slot);
snprintf(pad->devnode, sizeof(pad->devnode), "/dev/input/event%ld", slot);
snprintf(pad->uevent, sizeof(pad->uevent), PAD_UEVENT_FORMAT, (int)slot, (int)slot);
snprintf(pad->uevent, sizeof(pad->uevent), ring_uevent_format(), (int)slot, (int)slot);
pad->devnum = makedev(13, EVENT_MINOR_BASE + (unsigned int)slot);
pad->node = (int)slot;
pad->live = 1;
@@ -137,6 +144,10 @@ static int any_virtual_pad(void) {
return 0;
}
static const char *ring_uevent_format(void) {
return uinput_enabled() && any_virtual_pad() ? PAD_PHYSICAL_UEVENT_FORMAT : PAD_UEVENT_FORMAT;
}
static void refresh_locked(int node) {
struct pad *pad = &pads[node];
@@ -167,9 +178,7 @@ static void refresh_locked(int node) {
} else {
snprintf(pad->devnode, sizeof(pad->devnode), "/dev/input/event%d", node);
pad->live = 1;
if (uinput_enabled())
snprintf(pad->uevent, sizeof(pad->uevent),
any_virtual_pad() ? PAD_PHYSICAL_UEVENT_FORMAT : PAD_UEVENT_FORMAT, node, node);
snprintf(pad->uevent, sizeof(pad->uevent), ring_uevent_format(), node, node);
}
}
sync_parent(node);
@@ -441,11 +450,102 @@ static void *next_symbol(const char *name) {
char *dd_cached_realpath(const char *path, char *resolved, char *(*real)(const char *, char *))
__attribute__((visibility("hidden")));
static int caller_is_winebus(void *caller) {
static int caller_in_library(void *caller, const char *library) {
Dl_info info;
if (dladdr(caller, &info) == 0 || info.dli_fname == NULL) return 0;
return strstr(info.dli_fname, "winebus.so") != NULL;
return strstr(info.dli_fname, library) != NULL;
}
static int caller_is_winebus(void *caller) { return caller_in_library(caller, "winebus.so"); }
static int note_winebus(struct dl_phdr_info *info, size_t size, void *data) {
(void)size;
if (info->dlpi_name == NULL || strstr(info->dlpi_name, "winebus.so") == NULL) return 0;
*(int *)data = 1;
return 1;
}
static int winebus_reads_udev(void) {
const char *x360 = getenv("FAKE_EVDEV_STEAM_PAD_AS_X360");
int loaded = 0;
if (x360 != NULL && atoi(x360) != 0) return 0;
dl_iterate_phdr(note_winebus, &loaded);
return loaded;
}
static int ring_pad_fd(int fd) {
const char *spec = getenv("FAKE_EVDEV_MEMFD_PATHS");
const char *entry;
struct stat opened;
struct stat ring;
char path[PATH_MAX];
if (spec == NULL || fstat(fd, &opened) != 0) return 0;
for (entry = spec; *entry != '\0';) {
char *end;
long slot = strtol(entry, &end, 10);
const char *next = strchr(entry, ';');
size_t length;
if (end != entry && *end == '=' && slot >= 0 && slot < RING_MAX) {
length = next != NULL ? (size_t)(next - end - 1) : strlen(end + 1);
if (length < sizeof(path)) {
memcpy(path, end + 1, length);
path[length] = '\0';
if (stat(path, &ring) == 0 && ring.st_dev == opened.st_dev && ring.st_ino == opened.st_ino) return 1;
}
}
if (next == NULL) break;
entry = next + 1;
}
return 0;
}
__attribute__((visibility("hidden"))) void dd_ring_pad_sdl_id(int fd, unsigned long request, void *arg,
void *caller, int rc) {
struct input_id *id = arg;
if (rc != 0 || request != EVIOCGID || id == NULL) return;
if (!caller_in_library(caller, "libSDL") || !winebus_reads_udev() || !ring_pad_fd(fd)) return;
id->vendor = STEAM_VIRTUAL_VENDOR;
id->product = STEAM_VIRTUAL_PRODUCT;
}
typedef int (*sdl_rumble_fn)(void *, uint16_t, uint16_t, uint32_t);
static _Atomic(sdl_rumble_fn) real_sdl_rumble;
static __thread int winebus_sdl_call;
static int winebus_sdl_rumble(void *joystick, uint16_t low, uint16_t high, uint32_t duration) {
sdl_rumble_fn real = atomic_load_explicit(&real_sdl_rumble, memory_order_acquire);
int result;
if (!caller_is_winebus(__builtin_return_address(0))) return real(joystick, low, high, duration);
if (low != 0 || high != 0) duration = 0;
winebus_sdl_call = 1;
result = real(joystick, low, high, duration);
winebus_sdl_call = 0;
return result;
}
static void *winebus_sdl_rumble_dlsym(void *handle, const char *name) {
(void)handle;
(void)name;
return (void *)winebus_sdl_rumble;
}
static void *sdl_rumble_target(void *handle, void *(*forward)(void *, const char *)) {
sdl_rumble_fn expected = NULL;
sdl_rumble_fn found;
if (handle == RTLD_NEXT || handle == RTLD_DEFAULT) return NULL;
found = (sdl_rumble_fn)forward(handle, "SDL_JoystickRumble");
if (found == NULL) return NULL;
atomic_compare_exchange_strong_explicit(&real_sdl_rumble, &expected, found, memory_order_acq_rel,
memory_order_acquire);
if (atomic_load_explicit(&real_sdl_rumble, memory_order_acquire) != found) return NULL;
return (void *)winebus_sdl_rumble_dlsym;
}
__attribute__((visibility("hidden"))) int dd_winebus_rumble_ioctl(int (*real)(int, unsigned long, void *), int fd,
@@ -454,7 +554,8 @@ __attribute__((visibility("hidden"))) int dd_winebus_rumble_ioctl(int (*real)(in
struct ff_effect *effect = arg;
__u16 length;
if (request != EVIOCSFF || effect == NULL || effect->type != FF_RUMBLE || !caller_is_winebus(caller)) return 0;
if (request != EVIOCSFF || effect == NULL || effect->type != FF_RUMBLE) return 0;
if (!caller_is_winebus(caller) && !(winebus_sdl_call && caller_in_library(caller, "libSDL"))) return 0;
length = effect->replay.length;
effect->replay.length = 0;
*rc = real(fd, request, arg);
@@ -1195,7 +1296,10 @@ static void *own_dlsym(void *handle, const char *name) {
__attribute__((visibility("hidden"), used)) void *inputudev_dlsym_target(void *handle, const char *name) {
void *forward = real_dlsym();
(void)handle;
if (forward != NULL && name != NULL && strcmp(name, "SDL_JoystickRumble") == 0) {
void *rumble = sdl_rumble_target(handle, forward);
if (rumble != NULL) return rumble;
}
if (name != NULL && strncmp(name, "udev_", 5) == 0 && own_udev_symbol(name) != NULL &&
!steam_client_process())
return (void *)own_dlsym;
+3
View File
@@ -424,6 +424,8 @@ int dd_venc_ioctl(int fd, unsigned long request, void *arg, int *rc) __attribute
int dd_vdec_ioctl(int fd, unsigned long request, void *arg, int *rc) __attribute__((visibility("hidden")));
int dd_winebus_rumble_ioctl(int (*real)(int, unsigned long, void *), int fd, unsigned long request,
void *arg, void *caller, int *rc) __attribute__((visibility("hidden")));
void dd_ring_pad_sdl_id(int fd, unsigned long request, void *arg, void *caller, int rc)
__attribute__((visibility("hidden")));
int dd_writewatch_ioctl(int (*real)(int, unsigned long, void *), int fd, unsigned long request, void *arg,
int *rc) __attribute__((visibility("hidden")));
@@ -444,6 +446,7 @@ int ioctl(int fd, unsigned long request, ...) {
if (dd_winebus_rumble_ioctl(real, fd, request, arg, __builtin_return_address(0), &rc)) return rc;
if (dd_writewatch_ioctl(real, fd, request, arg, &rc)) return rc;
if (!dd_kgsl_poll(real, fd, request, arg, &rc)) rc = quest_kgsl_ioctl(real, fd, request, arg);
dd_ring_pad_sdl_id(fd, request, arg, __builtin_return_address(0), rc);
dd_kgsl_track(real, fd, request, arg, &rc);
dd_kgsl_chip_id_fixup(request, arg, rc);
if (arg == NULL || !is_link_query(request)) return rc;
+4 -2
View File
@@ -452,7 +452,8 @@ static int ddnatv_execve(const char *filename, char *const argv[], char *const e
char resolved_target[PATH_MAX];
// Only intercept binaries/scripts within DDNATV_ROOT
if ((g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0) || is_mapped_guest_path(filename)) {
if ((g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0) || is_mapped_guest_path(filename) ||
is_bound_guest_program(target)) {
struct exec_probe probe;
const char *elf_target = select_exec_target(target, resolved_target, sizeof(resolved_target), &probe);
if (probe.is_elf && !probe.is_dynamic) static_elf = elf_target;
@@ -969,7 +970,8 @@ static int ddnatv_posix_spawn(pid_t *pid, const char *path,
}
char *const *orig_ep = envp ? envp : environ;
int in_root = (g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0) || is_mapped_guest_path(path);
int in_root = (g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0) || is_mapped_guest_path(path) ||
is_bound_guest_program(target);
struct exec_probe probe;
char resolved_target[PATH_MAX];
+8
View File
@@ -983,6 +983,14 @@ static int is_host_interpreter(const char *interp, const char *rewritten) {
return probe.android_interp;
}
static int is_bound_guest_program(const char *path) {
if (g_ddnatv_root[0] == '\0' || !is_identity_bound_path(path)) return 0;
struct exec_probe probe;
probe_exec_file(path, &probe);
if (probe.is_elf) return probe.is_dynamic && !probe.android_interp;
return probe.n >= 2 && probe.hdr[0] == '#' && probe.hdr[1] == '!';
}
// argv for running `script` with its interpreter: interp [arg] script args... (the script's own
// argv[0] is dropped, as the kernel does). free() the result.
static char **build_script_argv(const char *interp, const char *interp_arg, const char *script, char *const argv[]) {
+4 -5
View File
@@ -739,10 +739,8 @@ char *getcwd(char *buf, size_t size) {
static char *(*orig_getcwd)(char *, size_t) = NULL;
if (!orig_getcwd) orig_getcwd = (char *(*)(char *, size_t))dlsym(RTLD_NEXT, "getcwd");
char *res = orig_getcwd ? orig_getcwd(buf, size) : NULL;
if (res) {
size_t len = strlen(res);
guest_path_of_mount_source(res, len, buf ? size : len + 1, NULL);
}
if (res && !buf) return guest_path_of_allocated_mount_source(res);
if (res) guest_path_of_mount_source(res, strlen(res), size, NULL);
return res;
}
@@ -790,7 +788,8 @@ char *realpath(const char *path, char *resolved_path) {
}
}
}
if (res) guest_path_of_mount_source(res, strlen(res), resolved_path ? PATH_MAX : strlen(res) + 1, NULL);
if (res && !resolved_path) return guest_path_of_allocated_mount_source(res);
if (res) guest_path_of_mount_source(res, strlen(res), PATH_MAX, NULL);
return res;
}
+21
View File
@@ -234,6 +234,13 @@ static int is_mapped_guest_path(const char *path) {
return 0;
}
static int is_identity_bound_path(const char *path) {
if (!path || path[0] != '/') return 0;
for (int i = 0; i < g_nbinds; i++)
if (g_binds[i].identity && is_path_prefix(path, g_binds[i].dst, g_binds[i].dst_len)) return 1;
return 0;
}
// Android's own mounts and files, which must never be redirected into the rootfs.
// `path` starts with '/'; a prefix can only match when its second character does.
static int is_android_host_path(const char *path) {
@@ -968,6 +975,20 @@ static size_t guest_path_of_mount_source(char *buf, size_t len, size_t cap, int
return best->dst_len + rest;
}
static char *guest_path_of_allocated_mount_source(char *res) {
size_t len = strlen(res);
char tmp[PATH_MAX];
if (len >= sizeof(tmp)) return res;
memcpy(tmp, res, len + 1);
int converted = 0;
size_t n = guest_path_of_mount_source(tmp, len, sizeof(tmp), &converted);
if (!converted) return res;
char *grown = realloc(res, n + 1);
if (!grown) return res;
memcpy(grown, tmp, n + 1);
return grown;
}
static ssize_t postprocess_readlink(const char *linkpath, char *buf, ssize_t ret, size_t bufsiz) {
if (ret <= 0) return ret;
if ((size_t)ret < bufsiz) {
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff. Show more