mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
Merge remote-tracking branch 'droiddeck/main' into HEAD
# Conflicts: # tools/linuxfs/overlay/usr/local/bin/droiddeck-fex # tools/tests/test_droiddeck_fex.py
This commit is contained in:
commit
b36e5425d7
227 files changed
+12088
-1987
No files matched your search
@@ -849,7 +849,7 @@ jobs:
|
||||
run: test "$(git rev-parse 'HEAD^{tree}')" = "$XBOX_SOURCE_TREE"
|
||||
- name: Install Python test dependencies
|
||||
timeout-minutes: 7
|
||||
run: bash tools/ci/install-ubuntu-packages.sh python3-yaml gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user libvulkan-dev mesa-vulkan-drivers
|
||||
run: bash tools/ci/install-ubuntu-packages.sh python3-yaml gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user libvulkan-dev mesa-vulkan-drivers spirv-tools
|
||||
- name: Resolve the pinned Android NDK
|
||||
run: bash tools/ci/resolve-ndk.sh
|
||||
|
||||
@@ -879,6 +879,16 @@ jobs:
|
||||
-ldl -o /tmp/test-presenter-shutdown
|
||||
timeout 10 /tmp/test-presenter-shutdown
|
||||
|
||||
- name: Fetch the Mali compatibility layer's headers
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sdk=$(sed -n 's/^SDK=//p' tools/venus/ci-build.sh)
|
||||
bcdec=$(grep -o 'https://raw.githubusercontent.com/iOrange/bcdec/[^ ]*' tools/venus/ci-build.sh)
|
||||
mkdir -p build/layer-deps/bcdec
|
||||
git -c advice.detachedHead=false clone -q --depth 1 -b "$sdk" https://github.com/KhronosGroup/Vulkan-Headers.git build/layer-deps/vulkan
|
||||
git -c advice.detachedHead=false clone -q --depth 1 -b "$sdk" https://github.com/KhronosGroup/SPIRV-Headers.git build/layer-deps/spirv
|
||||
curl -sSfL -o build/layer-deps/bcdec/bcdec.h "$bcdec"
|
||||
|
||||
- name: Steam import and game environment tests
|
||||
run: bash tools/ci/run-python-tests.sh
|
||||
|
||||
@@ -982,3 +992,35 @@ jobs:
|
||||
if: ${{ always() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && needs.announce.result != 'skipped' }}
|
||||
uses: ./.github/workflows/update-catalog.yml
|
||||
secrets: inherit
|
||||
|
||||
retire-tests:
|
||||
needs: catalog
|
||||
if: ${{ always() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && needs.catalog.result == 'success' }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.sha }}
|
||||
persist-credentials: false
|
||||
- uses: actions/create-github-app-token@v2
|
||||
id: ci-token
|
||||
with:
|
||||
app-id: ${{ vars.DROIDDECK_CI_APP_ID }}
|
||||
private-key: ${{ secrets.DROIDDECK_CI_APP_KEY }}
|
||||
owner: Droid-Deck
|
||||
repositories: DroidDeck-CI
|
||||
- name: Delete the test builds this Preview build replaces
|
||||
env:
|
||||
SOURCE_GITHUB_TOKEN: ${{ github.token }}
|
||||
CI_GITHUB_TOKEN: ${{ steps.ci-token.outputs.token }}
|
||||
run: python3 tools/release/retire_test_builds.py
|
||||
|
||||
catalog-after-retire:
|
||||
needs: retire-tests
|
||||
if: ${{ always() && needs.retire-tests.result == 'success' }}
|
||||
uses: ./.github/workflows/update-catalog.yml
|
||||
secrets: inherit
|
||||
@@ -40,36 +40,19 @@ jobs:
|
||||
private-key: ${{ secrets.DROIDDECK_CI_APP_KEY }}
|
||||
owner: Droid-Deck
|
||||
repositories: DroidDeck-CI
|
||||
- name: Delete the test build
|
||||
if: ${{ steps.state.outputs.closed == 'true' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.ci-token.outputs.token }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
retry() {
|
||||
for attempt in 1 2 3 4; do
|
||||
"$@" && return 0
|
||||
[ "$attempt" = 4 ] || sleep $((attempt * 20))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
existing=$(retry gh api --paginate "repos/Droid-Deck/DroidDeck-CI/releases?per_page=100" --jq '.[].tag_name')
|
||||
found=0
|
||||
for tag in "pr-$PR_NUMBER" "pr-$PR_NUMBER.0"; do
|
||||
if grep -qxF "$tag" <<<"$existing"; then
|
||||
retry gh release delete "$tag" -R Droid-Deck/DroidDeck-CI --yes --cleanup-tag
|
||||
echo "Deleted $tag"
|
||||
found=1
|
||||
fi
|
||||
done
|
||||
[ "$found" = 1 ] || echo "No test build for PR #$PR_NUMBER"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
if: ${{ steps.state.outputs.closed == 'true' }}
|
||||
with:
|
||||
ref: main
|
||||
persist-credentials: false
|
||||
- name: Delete the test build unless main still needs it
|
||||
if: ${{ steps.state.outputs.closed == 'true' }}
|
||||
env:
|
||||
SOURCE_GITHUB_TOKEN: ${{ github.token }}
|
||||
CI_GITHUB_TOKEN: ${{ steps.ci-token.outputs.token }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
# A merged PR's build stays until a Preview build carries the merge; build.yml and the sweep remove it then.
|
||||
run: python3 tools/release/retire_test_builds.py --pr "$PR_NUMBER"
|
||||
- name: Retire the Discord PR announcement
|
||||
if: ${{ steps.state.outputs.closed == 'true' }}
|
||||
env:
|
||||
|
||||
@@ -226,6 +226,8 @@ jobs:
|
||||
publish:
|
||||
needs: [authorize, sign]
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
keep: ${{ steps.publish.outputs.keep }}
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
@@ -322,12 +324,8 @@ jobs:
|
||||
cp pr-packs/* signed/ 2>/dev/null || true
|
||||
gh release upload "$tag" signed/* -R "$repo" --clobber
|
||||
gh release edit "$tag" -R "$repo" --title "PR #$PR_NUMBER" --notes "$notes" --prerelease
|
||||
keep=$(cd signed && ls | jq -R . | jq -sc .)
|
||||
gh api "repos/$repo/releases/tags/$tag" |
|
||||
jq -r --argjson keep "$keep" '.assets[] | select(.name as $n | $keep | index($n) | not) | .id' |
|
||||
while IFS= read -r id; do
|
||||
gh api --method DELETE "repos/$repo/releases/assets/$id" >/dev/null
|
||||
done
|
||||
# The previous push's files stay until the catalog names these (the prune job), so a download started from the old catalog still finds its APK.
|
||||
echo "keep=$(cd signed && ls | jq -R . | jq -sc .)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
published=$(gh release view "$tag" -R "$repo" --json tagName,assets)
|
||||
jq -e --arg tag "$tag" '.tagName == $tag and (.assets | length) > 0' <<<"$published" >/dev/null
|
||||
@@ -417,3 +415,41 @@ jobs:
|
||||
if: ${{ always() && needs.publish.result != 'skipped' }}
|
||||
uses: ./.github/workflows/update-catalog.yml
|
||||
secrets: inherit
|
||||
|
||||
prune:
|
||||
needs: [authorize, publish, catalog]
|
||||
if: ${{ always() && needs.publish.result == 'success' && needs.catalog.result == 'success' }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v2
|
||||
id: ci-token
|
||||
with:
|
||||
app-id: ${{ vars.DROIDDECK_CI_APP_ID }}
|
||||
private-key: ${{ secrets.DROIDDECK_CI_APP_KEY }}
|
||||
owner: Droid-Deck
|
||||
repositories: DroidDeck-CI
|
||||
- name: Remove the previous push's files
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.ci-token.outputs.token }}
|
||||
PR_NUMBER: ${{ needs.authorize.outputs.pr_number }}
|
||||
KEEP: ${{ needs.publish.outputs.keep }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
repo=Droid-Deck/DroidDeck-CI
|
||||
tag="pr-$PR_NUMBER"
|
||||
# An app that read the catalog just before it changed may still be starting that download.
|
||||
sleep 300
|
||||
# Delete nothing the published catalog still names.
|
||||
named=$(gh api -H "Accept: application/vnd.github.raw+json" "repos/$repo/contents/catalog.json?ref=main" |
|
||||
jq -c --argjson pr "$PR_NUMBER" '[.tests[] | select(.pr == $pr) | .apks[].name]')
|
||||
stale=$(jq -nr --argjson named "$named" --argjson keep "$KEEP" '$named - $keep | join(" ")')
|
||||
if [ -n "$stale" ]; then
|
||||
echo "::warning::The catalog still names $stale; keeping every file of $tag"
|
||||
exit 0
|
||||
fi
|
||||
gh api "repos/$repo/releases/tags/$tag" |
|
||||
jq -r --argjson keep "$KEEP" '.assets[] | select(.name as $n | $keep | index($n) | not) | .id' |
|
||||
while IFS= read -r id; do
|
||||
gh api --method DELETE "repos/$repo/releases/assets/$id" >/dev/null
|
||||
done
|
||||
@@ -26,35 +26,15 @@ jobs:
|
||||
private-key: ${{ secrets.DROIDDECK_CI_APP_KEY }}
|
||||
owner: Droid-Deck
|
||||
repositories: DroidDeck-CI
|
||||
- name: Delete test builds whose PR is no longer open
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
persist-credentials: false
|
||||
- name: Delete test builds of closed PRs, and of merged PRs a Preview build carries
|
||||
env:
|
||||
CI_TOKEN: ${{ steps.ci-token.outputs.token }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
retry() {
|
||||
for attempt in 1 2 3 4; do
|
||||
"$@" && return 0
|
||||
[ "$attempt" = 4 ] || sleep $((attempt * 20))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
tags=$(GH_TOKEN="$CI_TOKEN" retry gh api --paginate "repos/Droid-Deck/DroidDeck-CI/releases?per_page=100" --jq '.[].tag_name' |
|
||||
grep -E '^pr-[0-9]+(\.0)?$' || true)
|
||||
failed=0
|
||||
for tag in $tags; do
|
||||
number=${tag#pr-}
|
||||
number=${number%.0}
|
||||
state=$(retry gh api "repos/$GITHUB_REPOSITORY/pulls/$number" --jq .state) || { failed=1; continue; }
|
||||
if [ "$state" != open ]; then
|
||||
if GH_TOKEN="$CI_TOKEN" retry gh release delete "$tag" -R Droid-Deck/DroidDeck-CI --yes --cleanup-tag; then
|
||||
echo "Deleted $tag (PR #$number is $state)"
|
||||
else
|
||||
failed=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
exit "$failed"
|
||||
SOURCE_GITHUB_TOKEN: ${{ github.token }}
|
||||
CI_GITHUB_TOKEN: ${{ steps.ci-token.outputs.token }}
|
||||
run: python3 tools/release/retire_test_builds.py
|
||||
|
||||
catalog:
|
||||
needs: sweep
|
||||
|
||||
@@ -80,7 +80,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
- The proot fast path orders bindings like [PRoot](https://github.com/proot-me/proot)'s `path/binding.c` (GPL-2.0-or-later).
|
||||
- DiRT 3 and DiRT Showdown keep their telemetry socket the way RoccoC's DiRTTelemetryErrorFix (MIT) does, based on the fix by Carsten Gottschling.
|
||||
- Zink on PowerVR keeps colour textures in colour with Icenowy Zheng's upstream [Mesa](https://gitlab.freedesktop.org/mesa/mesa) fix d55418dae7 (MIT), carried as a runtime patch.
|
||||
- Games and AppImage, Flatpak and Snap programs such as emulators use [Mesa](https://gitlab.freedesktop.org/mesa/mesa) Turnip's per render pass memory choice. The Steam client and Chromium-based apps keep `TU_DEBUG=sysmem`.
|
||||
- Games and AppImage, Flatpak and Snap programs such as emulators use `TU_DEBUG=sysmem` by default, as does the Steam client. Turnip sysmem rendering can be turned off in Performance settings, except with the Adreno 710/720 driver, which always uses it.
|
||||
- Black Ops III and Dark Souls Remastered start without [umu-protonfixes](https://github.com/Open-Wine-Components/umu-protonfixes) (BSD-2-Clause), whose `311210.py` and `570940.py` fail under ARM64 Proton.
|
||||
- [ReSkate](https://github.com/Dingo-Shenanigans/ReSkate) (GPL-3.0) by Dingo Shenanigans uses the launch option from its README and D3D12 feature level 12_1.
|
||||
- The arm64 client's sign in was checked by reading Steam's saved token with the `ConnectCache` format from [deadlock-api-ingest](https://github.com/deadlock-api/deadlock-api-ingest).
|
||||
@@ -90,7 +90,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
<details>
|
||||
<summary><b>Stores</b></summary>
|
||||
|
||||
- Epic Games and GOG build on [Phobos](https://github.com/phobos665)'s adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl). GOG install script registry entries are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher) (GPL-3.0) reads them.
|
||||
- Epic Games and GOG build on [Phobos](https://github.com/phobos665)'s adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl). GOG install script registry entries are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher) (GPL-3.0) reads them. GOG cloud storage requests send the Galaxy communication-service User-Agent that gogdl and [Lutris](https://github.com/lutris/lutris) (GPL-3.0) send.
|
||||
- Epic's official Linux launcher preview runs through FEX. That setup is outside Epic's listed Linux support.
|
||||
- The launcher's .deb gets the WebKitGTK and GTK 3 libraries it needs from unmodified [Debian](https://www.debian.org) 13 packages, following [@zooluis](https://github.com/zooluis)'s research in [#2268](https://github.com/Droid-Deck/DroidDeck/pull/2268).
|
||||
- Battle.net is by [@kayakyakr](https://github.com/kayakyakr). It runs Blizzard's own client in Proton (downloaded from Blizzard, not included) and shows key art from the [Battle.net Shop](https://shop.battle.net). Without Steam, its games see the pad as an Xbox 360 controller via `PROTON_SPOOF_STEAMINPUT_VIDPID` in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/winebus.sys`.
|
||||
@@ -98,7 +98,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
- Battle.net installs drive Blizzard's Agent the way [@barncastle](https://github.com/barncastle)'s [Battle.Net-Installer](https://github.com/barncastle/Battle.Net-Installer) does, with requests from [wowdev.wiki](https://wowdev.wiki/Agent). Read without taking code: [@mubaraknumann](https://github.com/mubaraknumann)'s [unifideck](https://github.com/mubaraknumann/unifideck), [@djmittens](https://github.com/djmittens)'s [neo-mittens](https://github.com/djmittens/neo-mittens) `bnetswitch`, [@BCD1210](https://github.com/BCD1210)'s [soju](https://github.com/BCD1210/soju) and [Lutris](https://github.com/lutris/lutris)'s `product.db` reader.
|
||||
- World of Warcraft addon imports replace an addon's folder from a temporary copy, as [WowUp](https://github.com/WowUp/WowUp) does, and read flavour folders the way [WoWDeck](https://github.com/sigboe/wowdeck) does. No code from either is used.
|
||||
- The World of Warcraft addon Download window searches [WoWInterface](https://www.wowinterface.com) through its MMOUI API. [CurseForge](https://www.curseforge.com/wow) opens in the user's browser, with no API and no key.
|
||||
- Xbox games load [@domsvoboda](https://github.com/domsvoboda)'s [xodus-nexus](https://github.com/domsvoboda/xodus-nexus) modules (LGPL-2.1-or-later), including `wintypes.dll`. Minecraft's GameInput setup was checked against [@Wyze3306](https://github.com/Wyze3306)'s [BedrockOnLinux](https://github.com/Wyze3306/BedrockOnLinux) (MIT).
|
||||
- Xbox games load [@domsvoboda](https://github.com/domsvoboda)'s [xodus-nexus](https://github.com/domsvoboda/xodus-nexus) modules (LGPL-2.1-or-later), including `wintypes.dll`. Content licensing sends delegation-compact device tickets in the licensing wire form, following the [nexus-backend](https://github.com/domsvoboda/nexus-backend) commit `27c335e`. Minecraft's GameInput setup was checked against [@Wyze3306](https://github.com/Wyze3306)'s [BedrockOnLinux](https://github.com/Wyze3306/BedrockOnLinux) (MIT).
|
||||
- The Xbox Cloud Gaming player uses the WebRTC client of [@unknownskl](https://github.com/unknownskl)'s [Greenlight](https://github.com/unknownskl/greenlight) (MIT), and its offer tweaks and sharpening follow [@redphx](https://github.com/redphx)'s [Better xCloud](https://github.com/redphx/better-xcloud) (MIT). See `tools/xcloud-player/NOTICE.md`.
|
||||
- The itch.io butler pack ships butler's `7z.so`, itch.io's build of [7-Zip](https://www.7-zip.org) by Igor Pavlov (LGPL-2.1, unRAR restriction on RAR code), unmodified. Other archives use Apache Commons Compress and the runtime's bsdtar (libarchive).
|
||||
- The Store uses [Flatpak](https://github.com/flatpak/flatpak) (LGPL-2.1) through DroidDeck's own bubblewrap shim. Chromium and Electron apps start directly, since [zypak](https://github.com/refi64/zypak) by [@refi64](https://github.com/refi64) (BSD-3-Clause) always uses Flatpak's spawn portal.
|
||||
|
||||
@@ -295,6 +295,16 @@ if (uvcDir) {
|
||||
}
|
||||
tasks.named('preBuild').configure { dependsOn(stageRuntimeAssets) }
|
||||
|
||||
android.sourceSets.main.java.srcDir(rootProject.file('shortcuts/src/protocol/java'))
|
||||
def stageShortcuts = tasks.register('stageShortcuts', Copy) {
|
||||
dependsOn(':shortcuts:assembleRelease')
|
||||
from(project(':shortcuts').layout.buildDirectory.file('outputs/apk/release/shortcuts-release.apk'))
|
||||
into(layout.buildDirectory.dir('shortcutsAssets'))
|
||||
rename { 'shortcuts.apk' }
|
||||
}
|
||||
android.sourceSets.main.assets.srcDir(layout.buildDirectory.dir('shortcutsAssets'))
|
||||
tasks.named('preBuild').configure { dependsOn(stageShortcuts) }
|
||||
|
||||
def stageGogNotices = tasks.register('stageGogNotices', Copy) {
|
||||
from(layout.projectDirectory.dir('src/main/rust/stores/vendor/xdelta3')) { include 'LICENSE', 'README.droiddeck.md' }
|
||||
into(layout.buildDirectory.dir('gogNotices/licenses/xdelta3'))
|
||||
|
||||
@@ -89,21 +89,11 @@
|
||||
android:label="@string/steam_wall_label"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
||||
android:exported="true" />
|
||||
<service android:name=".input.HomeButtonService"
|
||||
android:label="@string/integration_shortcuts_service"
|
||||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
|
||||
android:exported="true">
|
||||
<service android:name=".input.ShortcutsRelay" android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.accessibilityservice.AccessibilityService" />
|
||||
<action android:name="com.droiddeck.shortcuts.RELAY" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.accessibilityservice" android:resource="@xml/home_button_service" />
|
||||
</service>
|
||||
<receiver android:name=".core.ShortcutsListingReceiver" android:exported="false"
|
||||
android:process=":shortcuts_sync">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<meta-data android:name="com.oculus.supportedDevices" android:value="quest2|quest3|quest3s" />
|
||||
<activity android:name=".QuestXrActivity" android:exported="true" android:launchMode="singleTask"
|
||||
android:permission="android.permission.DUMP"
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/eventfd.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/inotify.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
@@ -157,6 +158,8 @@ struct FakeController {
|
||||
bool closed = false;
|
||||
bool needs_keyframe = true;
|
||||
bool mouse = false;
|
||||
int playing_ff = -1;
|
||||
pid_t owner = getpid();
|
||||
|
||||
~FakeController() {
|
||||
if (ring) munmap(ring, mapping_size);
|
||||
@@ -195,6 +198,7 @@ static constexpr size_t kSnapshotButtonCount =
|
||||
|
||||
namespace Logger {
|
||||
void init();
|
||||
void log(const char *message, ...);
|
||||
}
|
||||
|
||||
static void controller_fork_prepare();
|
||||
@@ -286,6 +290,68 @@ static bool fake_vibration_enabled() { return config().vibration_enabled; }
|
||||
static bool fake_xbox360_identity() { return config().xbox360_identity; }
|
||||
static bool fake_uinput_enabled() { return config().uinput_enabled; }
|
||||
|
||||
static bool process_is_steam_client();
|
||||
|
||||
// Steam and its Remote Play client write the same shared slots; the caller's mutex serialises its own threads.
|
||||
// Without the lock Steam stays the only writer, as before streaming_client could open these devices. The wait
|
||||
// is bounded because a session freeze can stop the holder, and callers wait with controller_mutex held.
|
||||
class ProcessSlotLock {
|
||||
public:
|
||||
ProcessSlotLock(int &fd, const char *name, int timeout_ms) : fd_(fd) {
|
||||
int saved_errno = errno;
|
||||
if (fd_ < 0) {
|
||||
std::string path = std::string(fake_hook_dir()) + "/." + name + ".lock";
|
||||
fd_ = fd = static_cast<int>(syscall(SYS_openat, AT_FDCWD, path.c_str(), O_CREAT | O_RDWR | O_CLOEXEC, 0600));
|
||||
}
|
||||
int error = fd_ < 0 ? errno : 0;
|
||||
if (fd_ >= 0) {
|
||||
struct timespec start, now, pause = {0, 1000 * 1000};
|
||||
clock_gettime(CLOCK_MONOTONIC, &start);
|
||||
for (;;) {
|
||||
if (flock(fd_, LOCK_EX | LOCK_NB) == 0) {
|
||||
locked_ = true;
|
||||
break;
|
||||
}
|
||||
if (errno == EINTR) continue;
|
||||
if (errno != EWOULDBLOCK) {
|
||||
error = errno;
|
||||
break;
|
||||
}
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
if ((now.tv_sec - start.tv_sec) * 1000 + (now.tv_nsec - start.tv_nsec) / 1000000 >= timeout_ms) {
|
||||
busy_ = true;
|
||||
break;
|
||||
}
|
||||
nanosleep(&pause, nullptr);
|
||||
}
|
||||
}
|
||||
if (busy_) {
|
||||
static std::atomic<unsigned> waits;
|
||||
unsigned n = ++waits;
|
||||
if ((n & (n - 1)) == 0) Logger::log("lock: %s still held after %d ms, skipped (x%u)\n", name, timeout_ms, n);
|
||||
} else if (!locked_) {
|
||||
static std::atomic<bool> noted{false};
|
||||
if (!noted.exchange(true))
|
||||
Logger::log("lock: %s not taken (%s)%s\n", name, strerror(error),
|
||||
process_is_steam_client() ? "" : "; this process leaves the shared slots alone");
|
||||
}
|
||||
errno = saved_errno;
|
||||
}
|
||||
~ProcessSlotLock() {
|
||||
int saved_errno = errno;
|
||||
if (locked_) flock(fd_, LOCK_UN);
|
||||
errno = saved_errno;
|
||||
}
|
||||
bool may_write() const { return locked_ || (!busy_ && process_is_steam_client()); }
|
||||
ProcessSlotLock(const ProcessSlotLock &) = delete;
|
||||
ProcessSlotLock &operator=(const ProcessSlotLock &) = delete;
|
||||
|
||||
private:
|
||||
int fd_;
|
||||
bool locked_ = false;
|
||||
bool busy_ = false;
|
||||
};
|
||||
|
||||
static bool ring_paths_loaded = false;
|
||||
static int next_ff_id = 0;
|
||||
|
||||
@@ -411,22 +477,49 @@ __attribute__((visibility("hidden"))) static void send_ff_effect(const struct ff
|
||||
send_vibration(effect.u.periodic.magnitude, effect.u.periodic.magnitude, duration, slot);
|
||||
}
|
||||
|
||||
static std::unordered_map<int, const FakeController *> &ff_players() {
|
||||
static auto *players = new std::unordered_map<int, const FakeController *>();
|
||||
return *players;
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static void ff_played(FakeController &controller, int id) {
|
||||
controller.playing_ff = id;
|
||||
controller.owner = getpid();
|
||||
ff_players()[controller.slot] = &controller;
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static bool ff_release(FakeController &controller) {
|
||||
auto player = ff_players().find(controller.slot);
|
||||
bool current = player != ff_players().end() && player->second == &controller;
|
||||
if (current) ff_players().erase(player);
|
||||
controller.playing_ff = -1;
|
||||
return current;
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static void
|
||||
check_ff_event(const struct input_event *ev, uint16_t slot) {
|
||||
check_ff_event(const struct input_event *ev, FakeController &controller) {
|
||||
if (ev->type != EV_FF)
|
||||
return;
|
||||
|
||||
uint16_t slot = static_cast<uint16_t>(controller.slot);
|
||||
int id = ev->code;
|
||||
if (ev->value > 0) {
|
||||
auto it = ff_effects().find(id);
|
||||
if (it == ff_effects().end())
|
||||
return;
|
||||
send_ff_effect(it->second, slot);
|
||||
ff_played(controller, id);
|
||||
} else {
|
||||
send_vibration(0, 0, 0, slot);
|
||||
ff_release(controller);
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static void stop_ff(FakeController &controller) {
|
||||
bool playing = controller.playing_ff >= 0 && controller.owner == getpid();
|
||||
if (ff_release(controller) && playing) send_vibration(0, 0, 0, static_cast<uint16_t>(controller.slot));
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) char *
|
||||
from_real_to_fake_path(const char *pathname) {
|
||||
const char *event = strrchr(pathname, '/') + 1;
|
||||
@@ -1185,10 +1278,13 @@ struct DeckImu {
|
||||
uint32_t controls;
|
||||
uint32_t pad_type;
|
||||
uint32_t latency;
|
||||
uint32_t remote_imu_mode;
|
||||
uint32_t remote_imu_pid;
|
||||
};
|
||||
static_assert(offsetof(DeckImu, pad_type) == FAKE_INPUT_RING_PAD_TYPE_OFFSET,
|
||||
"DeckImu::pad_type matches FakeInputWriter and the ring reader");
|
||||
static_assert(offsetof(DeckImu, latency) == 48, "DeckImu::latency matches FakeInputWriter");
|
||||
static_assert(offsetof(DeckImu, remote_imu_mode) == 52, "DeckImu::remote_imu_mode matches FakeInputWriter");
|
||||
static constexpr uint32_t LATENCY_CONTROLLER = 1, LATENCY_TOUCH = 2;
|
||||
static constexpr int LOW_LATENCY_REPORT_INTERVAL_US = 1000;
|
||||
static constexpr uint32_t DECK_EXTRA_L4 = 1, DECK_EXTRA_R4 = 2, DECK_EXTRA_L5 = 4,
|
||||
@@ -1395,6 +1491,25 @@ __attribute__((visibility("hidden"))) static bool process_is_steam_client() {
|
||||
return known == 1;
|
||||
}
|
||||
|
||||
// Steam's Remote Play client reads the controller itself, in its own streaming_client process.
|
||||
__attribute__((visibility("hidden"))) static bool process_reads_pads() {
|
||||
static int known;
|
||||
if (known == 0) {
|
||||
bool reader = process_is_steam_client();
|
||||
if (!reader) {
|
||||
char exe[PATH_MAX];
|
||||
ssize_t length = readlink("/proc/self/exe", exe, sizeof(exe) - 1);
|
||||
if (length > 0) {
|
||||
exe[length] = '\0';
|
||||
const char *name = strrchr(exe, '/');
|
||||
reader = !strcmp(name ? name + 1 : exe, "streaming_client");
|
||||
}
|
||||
}
|
||||
known = reader ? 1 : -1;
|
||||
}
|
||||
return known == 1;
|
||||
}
|
||||
|
||||
__attribute__((constructor)) static void log_client_start() {
|
||||
config();
|
||||
if (process_is_steam_client())
|
||||
@@ -1439,7 +1554,7 @@ __attribute__((visibility("hidden"))) static bool is_withdrawn_pad_path(const ch
|
||||
free(fake);
|
||||
return !exposed;
|
||||
}
|
||||
return number == 0 || !process_is_steam_client();
|
||||
return number == 0 || !process_reads_pads();
|
||||
}
|
||||
|
||||
static bool fake_pad_withdrawn(const FakeController &fake) {
|
||||
@@ -1654,7 +1769,7 @@ __attribute__((visibility("hidden"))) static void *sony_report_thread(void *arg)
|
||||
__attribute__((visibility("hidden"))) static int open_deck_hidraw(int flags, uint8_t sony = 0) {
|
||||
const char *path = sony == 4 ? DS4_HIDRAW_PATH : sony == 5 ? DUALSENSE_HIDRAW_PATH : DECK_HIDRAW_PATH;
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
if (!process_is_steam_client()) {
|
||||
if (!process_reads_pads()) {
|
||||
Logger::log("deck: %s refused: not the Steam client\n", path);
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
@@ -1863,7 +1978,7 @@ __attribute__((visibility("hidden"))) static void *triton_pad_thread(void *arg)
|
||||
|
||||
__attribute__((visibility("hidden"))) static int open_triton_hidraw(int flags, bool emulated) {
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
if (!process_is_steam_client()) {
|
||||
if (!process_reads_pads()) {
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
@@ -2004,15 +2119,19 @@ __attribute__((visibility("hidden"))) static bool touch_plugged() {
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static bool is_touch_hidraw_path(const char *pathname) {
|
||||
return pathname && !strcmp(pathname, TOUCH_HIDRAW_PATH) && process_is_steam_client() && touch_ring();
|
||||
return pathname && !strcmp(pathname, TOUCH_HIDRAW_PATH) && process_reads_pads() && touch_ring();
|
||||
}
|
||||
|
||||
static std::mutex touch_state_mutex;
|
||||
static int touch_state_lock_fd = -1;
|
||||
|
||||
template <typename F>
|
||||
__attribute__((visibility("hidden"))) static void touch_state(F &&write) {
|
||||
TouchRingFile *ring = touch_ring();
|
||||
if (!ring) return;
|
||||
static std::mutex mutex;
|
||||
std::lock_guard<std::mutex> guard(mutex);
|
||||
std::lock_guard<std::mutex> guard(touch_state_mutex);
|
||||
ProcessSlotLock slot(touch_state_lock_fd, "touch-state", 20);
|
||||
if (!slot.may_write()) return;
|
||||
__atomic_fetch_add(&ring->state_seq, 1, __ATOMIC_ACQ_REL);
|
||||
write(*ring);
|
||||
__atomic_fetch_add(&ring->state_seq, 1, __ATOMIC_ACQ_REL);
|
||||
@@ -2264,9 +2383,10 @@ __attribute__((visibility("hidden"))) static void *pad_type_thread(void *) {
|
||||
struct timespec settle = {0, 300 * 1000 * 1000};
|
||||
nanosleep(&settle, nullptr);
|
||||
int added = pad_type_uevent(now, "add");
|
||||
if (was != PAD_TYPE_XBOX) poke_hidraw_watchers(pad_type_minor(was));
|
||||
if (now != PAD_TYPE_XBOX) poke_hidraw_watchers(pad_type_minor(now));
|
||||
if (was == PAD_TYPE_XBOX || now == PAD_TYPE_XBOX) {
|
||||
bool shared = process_is_steam_client();
|
||||
if (shared && was != PAD_TYPE_XBOX) poke_hidraw_watchers(pad_type_minor(was));
|
||||
if (shared && now != PAD_TYPE_XBOX) poke_hidraw_watchers(pad_type_minor(now));
|
||||
if (shared && (was == PAD_TYPE_XBOX || now == PAD_TYPE_XBOX)) {
|
||||
std::string node = std::string(fake_hook_dir()) + "/event0";
|
||||
std::string aside = std::string(fake_hook_dir()) + "/.event0-switching";
|
||||
if (rename(node.c_str(), aside.c_str()) == 0) {
|
||||
@@ -2285,7 +2405,7 @@ __attribute__((visibility("hidden"))) static void *pad_type_thread(void *) {
|
||||
|
||||
__attribute__((constructor)) static void start_pad_type_watch() {
|
||||
config();
|
||||
if (!process_is_steam_client() || !fake_deck_enabled()) return;
|
||||
if (!process_reads_pads() || !fake_deck_enabled()) return;
|
||||
pthread_t thread;
|
||||
if (pthread_create(&thread, nullptr, pad_type_thread, nullptr) == 0) pthread_detach(thread);
|
||||
}
|
||||
@@ -2306,7 +2426,7 @@ __attribute__((visibility("hidden"))) static void *touch_plug_thread(void *) {
|
||||
|
||||
__attribute__((constructor)) static void start_touch_controller() {
|
||||
config();
|
||||
if (!process_is_steam_client() || !touch_ring()) return;
|
||||
if (!process_reads_pads() || !touch_ring()) return;
|
||||
pthread_t thread;
|
||||
if (pthread_create(&thread, nullptr, touch_plug_thread, nullptr) == 0) pthread_detach(thread);
|
||||
}
|
||||
@@ -2413,8 +2533,13 @@ __attribute__((visibility("hidden"))) static void publish_imu_mode(const DeckHid
|
||||
std::string path = get_ring_path_for_slot(0);
|
||||
int fd = path.empty() ? -1 : my_open(path.c_str(), O_WRONLY | O_CLOEXEC);
|
||||
if (fd < 0) return;
|
||||
uint32_t value = 0x80000000u | static_cast<uint32_t>(mode);
|
||||
if (pwrite(fd, &value, sizeof(value), FAKE_INPUT_RING_SIZE + offsetof(DeckImu, imu_mode)) != sizeof(value))
|
||||
// Steam and its Remote Play client each keep their own word, so one turning motion off does not starve the
|
||||
// other; Android reads motion while either wants it. The pid lets it ignore a Remote Play client that has gone.
|
||||
uint32_t value[2] = {0x80000000u | static_cast<uint32_t>(mode), static_cast<uint32_t>(getpid())};
|
||||
bool steam = process_is_steam_client();
|
||||
size_t length = steam ? sizeof(value[0]) : sizeof(value);
|
||||
off_t offset = FAKE_INPUT_RING_SIZE + (steam ? offsetof(DeckImu, imu_mode) : offsetof(DeckImu, remote_imu_mode));
|
||||
if (pwrite(fd, value, length, offset) != static_cast<ssize_t>(length))
|
||||
Logger::log("deck: imu mode not published (%s)\n", strerror(errno));
|
||||
syscall(SYS_close, fd);
|
||||
}
|
||||
@@ -2619,7 +2744,10 @@ __attribute__((visibility("hidden"))) static void triton_queue_output(DeckHidraw
|
||||
auto *shared = reinterpret_cast<TritonSharedData *>(reinterpret_cast<uint8_t *>(triton.ring) + TRITON_SHARED_OFFSET);
|
||||
if (__atomic_load_n(&shared->magic, __ATOMIC_ACQUIRE) != TRITON_SHARED_MAGIC) return;
|
||||
static std::mutex one_at_a_time;
|
||||
static int lock_fd = -1;
|
||||
std::lock_guard<std::mutex> guard(one_at_a_time);
|
||||
ProcessSlotLock slot(lock_fd, "triton-output", TRITON_OUTPUT_TIMEOUT_MS * 2);
|
||||
if (!slot.may_write()) return;
|
||||
for (int waited = 0;
|
||||
static_cast<uint32_t>(__atomic_load_n(&shared->output_seq, __ATOMIC_ACQUIRE)) !=
|
||||
__atomic_load_n(&shared->output_ack, __ATOMIC_ACQUIRE) &&
|
||||
@@ -2651,7 +2779,13 @@ __attribute__((visibility("hidden"))) static int triton_get_feature(DeckHidraw &
|
||||
}
|
||||
auto *shared = reinterpret_cast<TritonSharedData *>(reinterpret_cast<uint8_t *>(triton.ring) + TRITON_SHARED_OFFSET);
|
||||
static std::mutex one_at_a_time;
|
||||
static int lock_fd = -1;
|
||||
std::lock_guard<std::mutex> guard(one_at_a_time);
|
||||
ProcessSlotLock slot(lock_fd, "triton-feature", TRITON_FEATURE_TIMEOUT_MS);
|
||||
if (!slot.may_write()) {
|
||||
errno = EIO;
|
||||
return -1;
|
||||
}
|
||||
uint8_t report_id = report[0];
|
||||
__atomic_store_n(&shared->get_report_id, report_id, __ATOMIC_RELAXED);
|
||||
uint64_t request = __atomic_add_fetch(&shared->get_request, 1, __ATOMIC_RELEASE);
|
||||
@@ -2839,7 +2973,7 @@ __attribute__((visibility("hidden"))) static int ioctl_triton(DeckHidraw &triton
|
||||
__attribute__((visibility("hidden"))) static std::string note_sys_failure(int dirfd, const char *pathname) {
|
||||
int saved_errno = errno;
|
||||
std::string path;
|
||||
if (saved_errno == ENOENT || !pathname || !process_is_steam_client()) {
|
||||
if (saved_errno == ENOENT || !pathname || !process_reads_pads()) {
|
||||
errno = saved_errno;
|
||||
return path;
|
||||
}
|
||||
@@ -2878,7 +3012,7 @@ __attribute__((visibility("hidden"))) static std::string note_sys_failure(int di
|
||||
|
||||
__attribute__((visibility("hidden"))) static std::string deck_listing_for(const char *path) {
|
||||
const char *listing = deck_listing_dir();
|
||||
if (!path || !listing || errno != EACCES || !fake_deck_enabled() || !process_is_steam_client()) return {};
|
||||
if (!path || !listing || errno != EACCES || !fake_deck_enabled() || !process_reads_pads()) return {};
|
||||
std::string p(path);
|
||||
while (p.size() > 1 && p.back() == '/') p.pop_back();
|
||||
int which = p == "/sys" ? 0 : p == "/sys/class" ? 1 : p == "/sys/bus" ? 2 : -1;
|
||||
@@ -2947,7 +3081,7 @@ EXPORT int statx(int dirfd, const char *path, int flags, unsigned mask, struct s
|
||||
constexpr unsigned unique_mount_id = 0x4000;
|
||||
if (result == 0 && (mask & STATX_MNT_ID) &&
|
||||
!(buf->stx_mask & (STATX_MNT_ID | unique_mount_id)) && fake_deck_enabled() &&
|
||||
process_is_steam_client() && deck_device_library(__builtin_return_address(0))) {
|
||||
process_reads_pads() && deck_device_library(__builtin_return_address(0))) {
|
||||
bool recovered = deck_mount_id_from_fdinfo(dirfd, path, flags, buf);
|
||||
static std::atomic<bool> noted_success{false}, noted_failure{false};
|
||||
if (!(recovered ? noted_success : noted_failure).exchange(true))
|
||||
@@ -3136,7 +3270,7 @@ template <typename S, typename Real>
|
||||
static int fake_stat_path(const char *pathname, S *statbuf, Real real) {
|
||||
if (is_withdrawn_pad_path(pathname) ||
|
||||
((is_deck_hidraw_path(pathname) || is_triton_hidraw_path(pathname) || is_triton_pad_path(pathname) ||
|
||||
sony_pad_path(pathname)) && !process_is_steam_client())) {
|
||||
sony_pad_path(pathname)) && !process_reads_pads())) {
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
@@ -3261,9 +3395,9 @@ EXPORT int fstat(int fd, struct stat *buf) {
|
||||
EXPORT int access(const char *pathname, int mode) {
|
||||
static auto my_access = reinterpret_cast<decltype(&::access)>(dlsym(RTLD_NEXT, "access"));
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return 0;
|
||||
if (is_deck_hidraw_path(pathname) && process_is_steam_client()) return 0;
|
||||
if (is_deck_hidraw_path(pathname) && process_reads_pads()) return 0;
|
||||
if ((is_triton_hidraw_path(pathname) || is_triton_pad_path(pathname) || sony_pad_path(pathname)) &&
|
||||
process_is_steam_client())
|
||||
process_reads_pads())
|
||||
return 0;
|
||||
if (is_touch_hidraw_path(pathname)) return 0;
|
||||
if (is_withdrawn_pad_path(pathname) || is_deck_hidraw_path(pathname) || is_triton_hidraw_path(pathname) ||
|
||||
@@ -3302,9 +3436,9 @@ EXPORT int access(const char *pathname, int mode) {
|
||||
EXPORT int faccessat(int dirfd, const char *pathname, int mode, int flags) {
|
||||
static auto my_faccessat = reinterpret_cast<decltype(&::faccessat)>(dlsym(RTLD_NEXT, "faccessat"));
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return 0;
|
||||
if (is_deck_hidraw_path(pathname) && process_is_steam_client()) return 0;
|
||||
if (is_deck_hidraw_path(pathname) && process_reads_pads()) return 0;
|
||||
if ((is_triton_hidraw_path(pathname) || is_triton_pad_path(pathname) || sony_pad_path(pathname)) &&
|
||||
process_is_steam_client())
|
||||
process_reads_pads())
|
||||
return 0;
|
||||
if (is_touch_hidraw_path(pathname)) return 0;
|
||||
if (is_withdrawn_pad_path(pathname) || is_deck_hidraw_path(pathname) || is_triton_hidraw_path(pathname) ||
|
||||
@@ -3371,7 +3505,7 @@ EXPORT int inotify_add_watch(int fd, const char *pathname, uint32_t mask) {
|
||||
pathname = fake_path;
|
||||
} else if (!strcmp(pathname, "/dev/input")) {
|
||||
pathname = fake_hook_dir();
|
||||
} else if (!strcmp(pathname, "/dev") && fake_deck_enabled() && process_is_steam_client()) {
|
||||
} else if (!strcmp(pathname, "/dev") && fake_deck_enabled() && process_reads_pads()) {
|
||||
std::string events = hidraw_event_dir();
|
||||
mkdir(events.c_str(), 0700);
|
||||
my_inotify_add_watch(fd, events.c_str(), mask);
|
||||
@@ -3657,10 +3791,12 @@ EXPORT int ioctl(int fd, ioctl_request_t op, ...) {
|
||||
effect->id = next_ff_id++;
|
||||
ff_effects()[effect->id] = *effect;
|
||||
send_ff_effect(*effect, static_cast<uint16_t>(event_number));
|
||||
ff_played(*controller->second, effect->id);
|
||||
return 0;
|
||||
} else if (type == 0x45 && number == 0x81) {
|
||||
int id = (intptr_t)argp;
|
||||
ff_effects().erase(id);
|
||||
if (controller->second->playing_ff == id) stop_ff(*controller->second);
|
||||
return 0;
|
||||
} else if (type == 0x45 && number == 0x84) {
|
||||
int max_effects = 16;
|
||||
@@ -3740,6 +3876,7 @@ EXPORT int close(int fd) {
|
||||
if (controller != controller_map().end()) {
|
||||
Logger::log("Removing controller, fd %d event %s\n", controller->first,
|
||||
controller->second->event ? controller->second->event : "(unknown)");
|
||||
stop_ff(*controller->second);
|
||||
controller->second->closed = true;
|
||||
controller_map().erase(fd);
|
||||
}
|
||||
@@ -3937,12 +4074,8 @@ EXPORT ssize_t write(int fd, const void *buf, size_t count) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
const struct input_event *ev = nullptr;
|
||||
uint16_t slot = static_cast<uint16_t>(controller->second->slot);
|
||||
if (count == sizeof(struct input_event)) {
|
||||
ev = static_cast<const struct input_event *>(buf);
|
||||
check_ff_event(ev, slot);
|
||||
}
|
||||
if (count == sizeof(struct input_event))
|
||||
check_ff_event(static_cast<const struct input_event *>(buf), *controller->second);
|
||||
|
||||
return static_cast<ssize_t>(count);
|
||||
}
|
||||
@@ -3982,14 +4115,10 @@ EXPORT ssize_t writev(int fd, const struct iovec *iov, int iovcnt) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint16_t slot = static_cast<uint16_t>(controller->second->slot);
|
||||
ssize_t total = 0;
|
||||
for (int i = 0; i < iovcnt; i++) {
|
||||
if (iov[i].iov_len == sizeof(struct input_event)) {
|
||||
const struct input_event *ev =
|
||||
static_cast<const struct input_event *>(iov[i].iov_base);
|
||||
check_ff_event(ev, slot);
|
||||
}
|
||||
if (iov[i].iov_len == sizeof(struct input_event))
|
||||
check_ff_event(static_cast<const struct input_event *>(iov[i].iov_base), *controller->second);
|
||||
total += static_cast<ssize_t>(iov[i].iov_len);
|
||||
}
|
||||
return total;
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
#pragma once
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vulkan/vulkan_android.h>
|
||||
|
||||
struct VkTable {
|
||||
|
||||
PFN_vkCreateInstance CreateInstance;
|
||||
|
||||
PFN_vkDestroyInstance DestroyInstance;
|
||||
PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
|
||||
PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
|
||||
PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
|
||||
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR;
|
||||
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
|
||||
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR;
|
||||
PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties;
|
||||
PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
|
||||
PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
|
||||
PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2;
|
||||
PFN_vkCreateDevice CreateDevice;
|
||||
PFN_vkDestroySurfaceKHR DestroySurfaceKHR;
|
||||
PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR;
|
||||
|
||||
PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
|
||||
PFN_vkDestroyDevice DestroyDevice;
|
||||
PFN_vkGetDeviceQueue GetDeviceQueue;
|
||||
PFN_vkDeviceWaitIdle DeviceWaitIdle;
|
||||
PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
|
||||
PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
|
||||
PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
|
||||
PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
|
||||
PFN_vkQueuePresentKHR QueuePresentKHR;
|
||||
PFN_vkQueueSubmit QueueSubmit;
|
||||
PFN_vkCreateQueryPool CreateQueryPool;
|
||||
PFN_vkDestroyQueryPool DestroyQueryPool;
|
||||
PFN_vkCmdResetQueryPool CmdResetQueryPool;
|
||||
PFN_vkCmdWriteTimestamp CmdWriteTimestamp;
|
||||
PFN_vkGetQueryPoolResults GetQueryPoolResults;
|
||||
PFN_vkCreateRenderPass CreateRenderPass;
|
||||
PFN_vkDestroyRenderPass DestroyRenderPass;
|
||||
PFN_vkCreateFramebuffer CreateFramebuffer;
|
||||
PFN_vkDestroyFramebuffer DestroyFramebuffer;
|
||||
PFN_vkCreateImageView CreateImageView;
|
||||
PFN_vkDestroyImageView DestroyImageView;
|
||||
PFN_vkCreateImage CreateImage;
|
||||
PFN_vkDestroyImage DestroyImage;
|
||||
PFN_vkCreateBuffer CreateBuffer;
|
||||
PFN_vkDestroyBuffer DestroyBuffer;
|
||||
PFN_vkAllocateMemory AllocateMemory;
|
||||
PFN_vkFreeMemory FreeMemory;
|
||||
PFN_vkMapMemory MapMemory;
|
||||
PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
|
||||
PFN_vkBindBufferMemory BindBufferMemory;
|
||||
PFN_vkBindImageMemory BindImageMemory;
|
||||
PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements;
|
||||
PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements;
|
||||
PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout;
|
||||
PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout;
|
||||
PFN_vkCreateDescriptorPool CreateDescriptorPool;
|
||||
PFN_vkDestroyDescriptorPool DestroyDescriptorPool;
|
||||
PFN_vkAllocateDescriptorSets AllocateDescriptorSets;
|
||||
PFN_vkFreeDescriptorSets FreeDescriptorSets;
|
||||
PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
|
||||
PFN_vkCreatePipelineLayout CreatePipelineLayout;
|
||||
PFN_vkDestroyPipelineLayout DestroyPipelineLayout;
|
||||
PFN_vkCreateShaderModule CreateShaderModule;
|
||||
PFN_vkDestroyShaderModule DestroyShaderModule;
|
||||
PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines;
|
||||
PFN_vkDestroyPipeline DestroyPipeline;
|
||||
PFN_vkCreateCommandPool CreateCommandPool;
|
||||
PFN_vkDestroyCommandPool DestroyCommandPool;
|
||||
PFN_vkAllocateCommandBuffers AllocateCommandBuffers;
|
||||
PFN_vkFreeCommandBuffers FreeCommandBuffers;
|
||||
PFN_vkBeginCommandBuffer BeginCommandBuffer;
|
||||
PFN_vkEndCommandBuffer EndCommandBuffer;
|
||||
PFN_vkResetCommandBuffer ResetCommandBuffer;
|
||||
PFN_vkCmdBeginRenderPass CmdBeginRenderPass;
|
||||
PFN_vkCmdEndRenderPass CmdEndRenderPass;
|
||||
PFN_vkCmdBindPipeline CmdBindPipeline;
|
||||
PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets;
|
||||
PFN_vkCmdDraw CmdDraw;
|
||||
PFN_vkCmdPushConstants CmdPushConstants;
|
||||
PFN_vkCmdSetViewport CmdSetViewport;
|
||||
PFN_vkCmdSetScissor CmdSetScissor;
|
||||
PFN_vkCmdPipelineBarrier CmdPipelineBarrier;
|
||||
PFN_vkCmdCopyImage CmdCopyImage;
|
||||
PFN_vkCmdBlitImage CmdBlitImage;
|
||||
|
||||
PFN_vkCmdDispatch CmdDispatch;
|
||||
PFN_vkCreateComputePipelines CreateComputePipelines;
|
||||
PFN_vkUnmapMemory UnmapMemory;
|
||||
PFN_vkCmdClearColorImage CmdClearColorImage;
|
||||
PFN_vkResetDescriptorPool ResetDescriptorPool;
|
||||
PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage;
|
||||
PFN_vkCreateSampler CreateSampler;
|
||||
PFN_vkDestroySampler DestroySampler;
|
||||
PFN_vkCreateSemaphore CreateSemaphore;
|
||||
PFN_vkDestroySemaphore DestroySemaphore;
|
||||
PFN_vkCreateFence CreateFence;
|
||||
PFN_vkDestroyFence DestroyFence;
|
||||
PFN_vkWaitForFences WaitForFences;
|
||||
PFN_vkResetFences ResetFences;
|
||||
PFN_vkGetFenceStatus GetFenceStatus;
|
||||
|
||||
PFN_vkGetAndroidHardwareBufferPropertiesANDROID GetAndroidHardwareBufferPropertiesANDROID;
|
||||
};
|
||||
@@ -1,680 +0,0 @@
|
||||
#pragma once
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <list>
|
||||
#include <vulkan/vulkan_android.h>
|
||||
struct VkTable {
|
||||
|
||||
PFN_vkCreateInstance CreateInstance;
|
||||
|
||||
PFN_vkDestroyInstance DestroyInstance;
|
||||
PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
|
||||
PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
|
||||
PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
|
||||
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR;
|
||||
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
|
||||
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR;
|
||||
PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties;
|
||||
PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
|
||||
PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
|
||||
PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2;
|
||||
PFN_vkCreateDevice CreateDevice;
|
||||
PFN_vkDestroySurfaceKHR DestroySurfaceKHR;
|
||||
PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR;
|
||||
|
||||
PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
|
||||
PFN_vkDestroyDevice DestroyDevice;
|
||||
PFN_vkGetDeviceQueue GetDeviceQueue;
|
||||
PFN_vkDeviceWaitIdle DeviceWaitIdle;
|
||||
PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
|
||||
PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
|
||||
PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
|
||||
PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
|
||||
PFN_vkQueuePresentKHR QueuePresentKHR;
|
||||
PFN_vkQueueSubmit QueueSubmit;
|
||||
PFN_vkCreateQueryPool CreateQueryPool;
|
||||
PFN_vkDestroyQueryPool DestroyQueryPool;
|
||||
PFN_vkCmdResetQueryPool CmdResetQueryPool;
|
||||
PFN_vkCmdWriteTimestamp CmdWriteTimestamp;
|
||||
PFN_vkGetQueryPoolResults GetQueryPoolResults;
|
||||
PFN_vkCreateRenderPass CreateRenderPass;
|
||||
PFN_vkDestroyRenderPass DestroyRenderPass;
|
||||
PFN_vkCreateFramebuffer CreateFramebuffer;
|
||||
PFN_vkDestroyFramebuffer DestroyFramebuffer;
|
||||
PFN_vkCreateImageView CreateImageView;
|
||||
PFN_vkDestroyImageView DestroyImageView;
|
||||
PFN_vkCreateImage CreateImage;
|
||||
PFN_vkDestroyImage DestroyImage;
|
||||
PFN_vkCreateBuffer CreateBuffer;
|
||||
PFN_vkDestroyBuffer DestroyBuffer;
|
||||
PFN_vkAllocateMemory AllocateMemory;
|
||||
PFN_vkFreeMemory FreeMemory;
|
||||
PFN_vkMapMemory MapMemory;
|
||||
PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
|
||||
PFN_vkBindBufferMemory BindBufferMemory;
|
||||
PFN_vkBindImageMemory BindImageMemory;
|
||||
PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements;
|
||||
PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements;
|
||||
PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout;
|
||||
PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout;
|
||||
PFN_vkCreateDescriptorPool CreateDescriptorPool;
|
||||
PFN_vkDestroyDescriptorPool DestroyDescriptorPool;
|
||||
PFN_vkAllocateDescriptorSets AllocateDescriptorSets;
|
||||
PFN_vkFreeDescriptorSets FreeDescriptorSets;
|
||||
PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
|
||||
PFN_vkCreatePipelineLayout CreatePipelineLayout;
|
||||
PFN_vkDestroyPipelineLayout DestroyPipelineLayout;
|
||||
PFN_vkCreateShaderModule CreateShaderModule;
|
||||
PFN_vkDestroyShaderModule DestroyShaderModule;
|
||||
PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines;
|
||||
PFN_vkDestroyPipeline DestroyPipeline;
|
||||
PFN_vkCreateCommandPool CreateCommandPool;
|
||||
PFN_vkDestroyCommandPool DestroyCommandPool;
|
||||
PFN_vkAllocateCommandBuffers AllocateCommandBuffers;
|
||||
PFN_vkFreeCommandBuffers FreeCommandBuffers;
|
||||
PFN_vkBeginCommandBuffer BeginCommandBuffer;
|
||||
PFN_vkEndCommandBuffer EndCommandBuffer;
|
||||
PFN_vkResetCommandBuffer ResetCommandBuffer;
|
||||
PFN_vkCmdBeginRenderPass CmdBeginRenderPass;
|
||||
PFN_vkCmdEndRenderPass CmdEndRenderPass;
|
||||
PFN_vkCmdBindPipeline CmdBindPipeline;
|
||||
PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets;
|
||||
PFN_vkCmdDraw CmdDraw;
|
||||
PFN_vkCmdPushConstants CmdPushConstants;
|
||||
PFN_vkCmdSetViewport CmdSetViewport;
|
||||
PFN_vkCmdSetScissor CmdSetScissor;
|
||||
PFN_vkCmdPipelineBarrier CmdPipelineBarrier;
|
||||
PFN_vkCmdCopyImage CmdCopyImage;
|
||||
PFN_vkCmdBlitImage CmdBlitImage;
|
||||
|
||||
PFN_vkCmdDispatch CmdDispatch;
|
||||
PFN_vkCreateComputePipelines CreateComputePipelines;
|
||||
PFN_vkUnmapMemory UnmapMemory;
|
||||
PFN_vkCmdClearColorImage CmdClearColorImage;
|
||||
PFN_vkResetDescriptorPool ResetDescriptorPool;
|
||||
PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage;
|
||||
PFN_vkCreateSampler CreateSampler;
|
||||
PFN_vkDestroySampler DestroySampler;
|
||||
PFN_vkCreateSemaphore CreateSemaphore;
|
||||
PFN_vkDestroySemaphore DestroySemaphore;
|
||||
PFN_vkCreateFence CreateFence;
|
||||
PFN_vkDestroyFence DestroyFence;
|
||||
PFN_vkWaitForFences WaitForFences;
|
||||
PFN_vkResetFences ResetFences;
|
||||
PFN_vkGetFenceStatus GetFenceStatus;
|
||||
|
||||
PFN_vkGetAndroidHardwareBufferPropertiesANDROID GetAndroidHardwareBufferPropertiesANDROID;
|
||||
};
|
||||
|
||||
#include <android/log.h>
|
||||
#include <string>
|
||||
#define WLOG_TAG "DroidDeck_Renderer"
|
||||
#define RLOG(...) if(verboseLog) __android_log_print(ANDROID_LOG_DEBUG,WLOG_TAG,__VA_ARGS__)
|
||||
#define RLOG_E(...) __android_log_print(ANDROID_LOG_ERROR,WLOG_TAG,__VA_ARGS__)
|
||||
#define SCANOUT_LOG(...) __android_log_print(ANDROID_LOG_DEBUG,"DroidDeck_Scanout",__VA_ARGS__)
|
||||
|
||||
#include <vulkan/vulkan_android.h>
|
||||
#include <android/hardware_buffer.h>
|
||||
#include <android/native_window.h>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <shared_mutex>
|
||||
#include <condition_variable>
|
||||
#include <chrono>
|
||||
|
||||
#include "../scanout/ScanoutContext.h"
|
||||
|
||||
#include "lsfg/lsfg_probe.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace lsfg { class Engine; }
|
||||
namespace ddfg { class Engine; }
|
||||
|
||||
static constexpr uint32_t MAX_FRAMES_IN_FLIGHT = 2;
|
||||
|
||||
|
||||
|
||||
|
||||
struct SgsrPushConstants {
|
||||
float ndc[4];
|
||||
float viewportInfo[4];
|
||||
float edgeSharpness;
|
||||
};
|
||||
struct NisPushConstants {
|
||||
float ndc[4];
|
||||
float viewportInfo[4];
|
||||
float sharpness;
|
||||
};
|
||||
struct EasuPushConstants {
|
||||
float ndc[4];
|
||||
uint32_t con0[4], con1[4], con2[4], con3[4];
|
||||
float outW, outH;
|
||||
};
|
||||
struct RcasPushConstants {
|
||||
float ndc[4];
|
||||
uint32_t con[4];
|
||||
float outW, outH;
|
||||
};
|
||||
|
||||
|
||||
struct CasPushConstants {
|
||||
float ndc[4];
|
||||
float resolution[2];
|
||||
float sharpness;
|
||||
float _pad;
|
||||
};
|
||||
struct HdrPushConstants {
|
||||
float ndc[4];
|
||||
float resolution[2];
|
||||
};
|
||||
|
||||
|
||||
struct FxaaPushConstants {
|
||||
float ndc[4];
|
||||
float resolution[2];
|
||||
};
|
||||
struct ToonPushConstants {
|
||||
float ndc[4];
|
||||
float resolution[2];
|
||||
};
|
||||
struct ColorPushConstants {
|
||||
float ndc[4];
|
||||
float brightness;
|
||||
float contrast;
|
||||
float gamma;
|
||||
float saturation;
|
||||
|
||||
|
||||
};
|
||||
struct NtscPushConstants {
|
||||
float ndc[4];
|
||||
float resolution[2];
|
||||
float frameCount;
|
||||
};
|
||||
struct CrtPushConstants {
|
||||
float ndc[4];
|
||||
float resolution[2];
|
||||
};
|
||||
struct DebandPushConstants {
|
||||
float ndc[4];
|
||||
float resolution[2];
|
||||
float strength;
|
||||
};
|
||||
|
||||
class VulkanRendererContext {
|
||||
public:
|
||||
VulkanRendererContext(ANativeWindow* window, int cWidth, int cHeight, void* adrenotoolsHandle = nullptr,
|
||||
bool lsfgVk11Compat = false);
|
||||
~VulkanRendererContext();
|
||||
|
||||
void onSurfaceResized(int width, int height);
|
||||
void setTransform(float ox, float oy, float sx, float sy);
|
||||
void setClipRegion(int x, int y, int w, int h);
|
||||
void updatePointerPosition(short x, short y);
|
||||
void updateWindowContent(int64_t id, void* pixels, short w, short h, short stride, int x, int y);
|
||||
void updateWindowContentAHB(int64_t id, AHardwareBuffer* ahb, short w, short h, int x, int y);
|
||||
void updateCursorImage(void* pixels, short w, short h, short hotX, short hotY);
|
||||
void setCursorVisible(bool visible);
|
||||
void setRenderList(const int64_t* ids, const int* xs, const int* ys, int count);
|
||||
void removeWindow(int64_t id);
|
||||
void clearBackbuffer() {}
|
||||
void beginBatch() {}
|
||||
void endBatch() {}
|
||||
void initScanout();
|
||||
void destroyScanout();
|
||||
void applyScanoutBuffer();
|
||||
void initScanoutFromWindows(ANativeWindow* gameWin, ANativeWindow* cursorWin);
|
||||
void scanoutSetDst(int x, int y, int w, int h);
|
||||
void scanoutSetBuffer(AHardwareBuffer* ahb, int x, int y, int w, int h, int fenceFd = -1);
|
||||
void scanoutSetCursorImage(void* pixels, short w, short h, short stride);
|
||||
void scanoutSetCursorPos(short x, short y, short hotX, short hotY);
|
||||
ScanoutContext scanout;
|
||||
std::atomic<bool>& scanoutActive = scanout.scanoutActive;
|
||||
std::atomic<bool>& gameFrameDelivered = scanout.gameFrameDelivered;
|
||||
std::atomic<bool> surfaceDetached{false};
|
||||
|
||||
void detachSurface();
|
||||
bool reattachSurface(ANativeWindow* newWindow);
|
||||
|
||||
bool verboseLog = true;
|
||||
void setVerboseLog(bool v) { verboseLog = v; scanout.setVerboseLog(v); }
|
||||
void dumpRendererInfo();
|
||||
|
||||
std::string adrenoDriverPath;
|
||||
std::string adrenoDriverName;
|
||||
std::string adrenoNativeLibDir;
|
||||
void* vulkanHandle = nullptr;
|
||||
std::atomic<bool> scanoutBlackFrameDone{false};
|
||||
PFN_vkGetInstanceProcAddr gipa = nullptr;
|
||||
VkTable vk_ = {};
|
||||
void loadCustomDriver();
|
||||
void loadInstanceDispatch();
|
||||
void loadDeviceDispatch();
|
||||
|
||||
void setFilterMode(int mode);
|
||||
void setUpscaler(int mode);
|
||||
void setHqDownscale(bool enabled);
|
||||
void setCas(bool enabled, int sharpness);
|
||||
void setHdr(bool enabled);
|
||||
void setDeband(bool enabled, int strength);
|
||||
void setUpscaleSharpness(int sharpness);
|
||||
void setFxaa(bool enabled);
|
||||
void setToon(bool enabled);
|
||||
void setCrt(bool enabled);
|
||||
void setNtsc(bool enabled);
|
||||
void setColorGrade(float brightness, float contrast, float gamma, float saturation);
|
||||
void setSwapRB(bool enabled);
|
||||
void setPresentMode(VkPresentModeKHR mode);
|
||||
std::vector<int> getSupportedPresentModes() const;
|
||||
|
||||
const lsfg::Caps& lsfgCaps() const { return lsfgCaps_; }
|
||||
|
||||
void setFrameGenArmed(bool armed, int multiplier);
|
||||
bool frameGenArmed() const { return fgArmed_.load(std::memory_order_relaxed); }
|
||||
void frameGenStats(float out[6]) const;
|
||||
int frameGenProblem() const;
|
||||
void setLsfgCachePath(const char* path);
|
||||
static constexpr int32_t kFgCaptureGame = -1;
|
||||
void setFrameGenTuning(float flowScale, float refreshHz, int32_t captureHeight = 0);
|
||||
void setFrameGenEngine(int kind);
|
||||
void setDdFgTuning(int model, int perfPreset);
|
||||
|
||||
private:
|
||||
struct WinTex {
|
||||
VkImage img = VK_NULL_HANDLE;
|
||||
VkDeviceMemory mem = VK_NULL_HANDLE;
|
||||
VkImageView view = VK_NULL_HANDLE;
|
||||
VkDescriptorSet ds = VK_NULL_HANDLE;
|
||||
VkBuffer stg = VK_NULL_HANDLE;
|
||||
VkDeviceMemory stgMem = VK_NULL_HANDLE;
|
||||
void* mapped = nullptr;
|
||||
VkDeviceSize cap = 0;
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
bool dirty = false;
|
||||
bool isAHB = false;
|
||||
bool needsTransition = false;
|
||||
AHardwareBuffer* ahb = nullptr;
|
||||
};
|
||||
|
||||
struct RenderEntry { int64_t id; int x, y; };
|
||||
struct DrawEntry {
|
||||
VkImage img = VK_NULL_HANDLE;
|
||||
VkDescriptorSet ds = VK_NULL_HANDLE;
|
||||
VkBuffer upload = VK_NULL_HANDLE;
|
||||
int x=0, y=0, w=0, h=0;
|
||||
bool needsTransition = false;
|
||||
bool isAHB = false;
|
||||
};
|
||||
|
||||
ANativeWindow* window;
|
||||
int surfaceWidth, surfaceHeight, containerWidth, containerHeight;
|
||||
std::atomic<int> clipRegionX{0}, clipRegionY{0}, clipRegionW{0}, clipRegionH{0};
|
||||
void* adrenotoolsHandle = nullptr;
|
||||
bool lsfgVk11Compat_ = false;
|
||||
int filterMode = 0;
|
||||
bool swapRB = false;
|
||||
float maxAnisotropy = 1.0f;
|
||||
bool cubicSupported = false;
|
||||
VkPhysicalDeviceMemoryProperties memProperties{};
|
||||
VkPresentModeKHR requestedPresentMode = VK_PRESENT_MODE_FIFO_KHR;
|
||||
uint32_t graphicsQueueFamilyIndex = 0;
|
||||
std::vector<VkPresentModeKHR> availablePresentModes;
|
||||
|
||||
std::unordered_map<int64_t, WinTex> texMap;
|
||||
|
||||
std::unordered_map<AHardwareBuffer*, WinTex> ahbImportCache;
|
||||
std::unordered_map<int64_t, std::vector<AHardwareBuffer*>> windowAhbs;
|
||||
|
||||
std::vector<WinTex> deleteQueue;
|
||||
std::vector<RenderEntry> renderList;
|
||||
|
||||
std::vector<DrawEntry> frameDraws;
|
||||
std::vector<VkImageMemoryBarrier> frameAhbTransitions;
|
||||
std::vector<VkImageMemoryBarrier> framePreUpload;
|
||||
std::vector<VkImageMemoryBarrier> framePostUpload;
|
||||
|
||||
|
||||
std::atomic<int> pointerX{0}, pointerY{0};
|
||||
float sceneOffsetX=0.f, sceneOffsetY=0.f, sceneScaleX=1.f, sceneScaleY=1.f;
|
||||
|
||||
std::atomic<bool> cursorVisible{false};
|
||||
short cursorHotX=0, cursorHotY=0, cursorTexW=0, cursorTexH=0;
|
||||
std::vector<uint32_t> cursorPixels;
|
||||
std::atomic<bool> isCursorImageDirty{false};
|
||||
std::atomic<bool> cursorMoved{false};
|
||||
|
||||
VkImage cursorImg = VK_NULL_HANDLE;
|
||||
VkDeviceMemory cursorMem = VK_NULL_HANDLE;
|
||||
VkImageView cursorView = VK_NULL_HANDLE;
|
||||
VkDescriptorSet cursorDS = VK_NULL_HANDLE;
|
||||
VkBuffer cursorStg = VK_NULL_HANDLE;
|
||||
VkDeviceMemory cursorStgM = VK_NULL_HANDLE;
|
||||
void* cursorStgP = nullptr;
|
||||
VkDeviceSize cursorStgC = 0;
|
||||
VkDeviceSize cursorUploadSize = 0;
|
||||
|
||||
VkInstance instance;
|
||||
VkSurfaceKHR surface;
|
||||
VkPhysicalDevice physicalDevice;
|
||||
VkDevice device;
|
||||
VkQueue graphicsQueue;
|
||||
VkSwapchainKHR swapchain = VK_NULL_HANDLE;
|
||||
VkFormat swapchainFmt;
|
||||
VkExtent2D swapchainExt;
|
||||
|
||||
std::vector<VkImage> swapchainImages;
|
||||
std::vector<VkImageView> swapchainViews;
|
||||
std::vector<VkFramebuffer> swapchainFBs;
|
||||
|
||||
VkRenderPass renderPass = VK_NULL_HANDLE;
|
||||
VkDescriptorSetLayout dsLayout = VK_NULL_HANDLE;
|
||||
VkPipelineLayout pipeLayout = VK_NULL_HANDLE;
|
||||
|
||||
VkPipeline pipeline = VK_NULL_HANDLE;
|
||||
|
||||
int upscalerMode = 0;
|
||||
bool hqDownscale = false;
|
||||
|
||||
bool casEnabled = false;
|
||||
int casSharpness = 60;
|
||||
bool hdrEnabled = false;
|
||||
float upscaleSharpness01 = 0.75f;
|
||||
|
||||
bool debandEnabled = false;
|
||||
int debandStrength = 100;
|
||||
|
||||
bool fxaaEnabled = false;
|
||||
bool toonEnabled = false;
|
||||
bool crtEnabled = false;
|
||||
bool ntscEnabled = false;
|
||||
bool colorEnabled = false;
|
||||
float colorBrightness = 0.0f;
|
||||
float colorContrast = 0.0f;
|
||||
float colorGamma = 1.0f;
|
||||
float colorSaturation = 1.0f;
|
||||
uint32_t ntscFrameCounter = 0;
|
||||
|
||||
VkSampler upscaleSampler = VK_NULL_HANDLE;
|
||||
|
||||
struct CompositeTarget {
|
||||
VkImage img = VK_NULL_HANDLE;
|
||||
VkDeviceMemory mem = VK_NULL_HANDLE;
|
||||
VkImageView view = VK_NULL_HANDLE;
|
||||
VkImageView storageView = VK_NULL_HANDLE;
|
||||
VkFramebuffer fb = VK_NULL_HANDLE;
|
||||
VkDescriptorSet ds = VK_NULL_HANDLE;
|
||||
};
|
||||
static constexpr uint32_t kMaxCompositeTargets = 7;
|
||||
|
||||
std::vector<CompositeTarget> compositeTargets;
|
||||
VkRenderPass compositeRenderPass = VK_NULL_HANDLE;
|
||||
uint32_t compositeW = 0, compositeH = 0;
|
||||
uint32_t compositeIndex = 0;
|
||||
bool compositeArmed = false;
|
||||
bool swapchainTransferDst = false;
|
||||
|
||||
std::atomic<bool> fgArmed_{false};
|
||||
std::atomic<int> fgMultiplier_{0};
|
||||
std::atomic<float> fgFlowScale_{1.0f};
|
||||
std::atomic<float> fgRefreshHz_{0.0f};
|
||||
std::atomic<bool> fgConfigDirty_{true};
|
||||
std::atomic<int32_t> fgCaptureHeight_{0};
|
||||
void compositeExtentFor(uint32_t& w, uint32_t& h) const;
|
||||
VkExtent2D renderExtent() const {
|
||||
if (compositeActive() && (compositeW != swapchainExt.width || compositeH != swapchainExt.height))
|
||||
return VkExtent2D{compositeW, compositeH};
|
||||
return swapchainExt;
|
||||
}
|
||||
void recordCompositeToSwapchainTransfer(VkCommandBuffer cb, VkImage src, uint32_t imgIdx);
|
||||
|
||||
bool createCompositeRenderPass();
|
||||
bool ensureCompositeTargets(uint32_t w, uint32_t h, uint32_t count);
|
||||
void destroyCompositeTargets();
|
||||
bool compositeActive() const;
|
||||
VkRenderPass targetRenderPass() const;
|
||||
VkFramebuffer targetFramebuffer(uint32_t imgIdx) const;
|
||||
void copyCompositeToSwapchain(VkCommandBuffer cb, uint32_t imgIdx);
|
||||
|
||||
VkRenderPass cursorOverlayRenderPass = VK_NULL_HANDLE;
|
||||
struct CursorOverlay {
|
||||
bool draw = false;
|
||||
float ox = 0, oy = 0, sx = 0, sy = 0, cw = 0, ch = 0;
|
||||
short ptrX = 0, ptrY = 0, hotX = 0, hotY = 0, w = 0, h = 0;
|
||||
};
|
||||
CursorOverlay cursorOverlay_{};
|
||||
|
||||
bool createCursorOverlayRenderPass();
|
||||
void recordCursorOverlay(VkCommandBuffer cb, uint32_t imgIdx);
|
||||
bool cursorDrawnPerPresent() const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static constexpr uint32_t kMaxPresentsPerFrame = 4;
|
||||
struct FrameGenPlan {
|
||||
uint32_t generations = 0;
|
||||
uint32_t presents = 1;
|
||||
uint32_t imgIdx[kMaxPresentsPerFrame] = {};
|
||||
};
|
||||
FrameGenPlan fgPlan_{};
|
||||
std::unique_ptr<lsfg::Engine> lsfgEngine_;
|
||||
uint64_t fgSourceFrames_ = 0;
|
||||
std::string lsfgCachePath_;
|
||||
bool lsfgEngineTried_ = false;
|
||||
std::unique_ptr<ddfg::Engine> ddfgEngine_;
|
||||
bool ddfgEngineTried_ = false;
|
||||
std::atomic<int> fgEngineKind_{0};
|
||||
std::atomic<int> fgModel_{4};
|
||||
std::atomic<int> fgPerfPreset_{1};
|
||||
bool ensureDdFgEngine();
|
||||
bool fgCapsOk() const;
|
||||
|
||||
uint32_t syncSlot(uint32_t k) const { return currentFrame * kMaxPresentsPerFrame + k; }
|
||||
void recreateSyncObjects();
|
||||
uint32_t fgAcquireFailLog_ = 0;
|
||||
|
||||
float fgPresentedRate_ = 0.0f;
|
||||
float fgSourceRate_ = 0.0f;
|
||||
uint32_t fgSourceAccum_ = 0;
|
||||
uint32_t fgPresentAccum_ = 0;
|
||||
std::chrono::steady_clock::time_point fgRateWindowStart_{};
|
||||
bool fgRateWindowOpen_ = false;
|
||||
void trackPresentedRate(uint32_t presents);
|
||||
|
||||
bool ensureLsfgEngine();
|
||||
uint32_t cmdSlot(uint32_t k) const { return currentFrame * kMaxPresentsPerFrame + k; }
|
||||
void recordFrameGenProcess(VkCommandBuffer cb);
|
||||
void recordFrameGenGeneration(VkCommandBuffer cb, uint32_t g);
|
||||
|
||||
VkQueryPool fgQueryPool_ = VK_NULL_HANDLE;
|
||||
bool fgTimestampsOk_ = false;
|
||||
float fgTimestampPeriodNs_ = 0.0f;
|
||||
bool fgQueryPending_[MAX_FRAMES_IN_FLIGHT] = {};
|
||||
uint32_t fgQueryGens_[MAX_FRAMES_IN_FLIGHT] = {};
|
||||
float fgChainMsPerGen_ = -1.0f;
|
||||
uint32_t fgChainLogCount_ = 0;
|
||||
void ensureFgQueryPool();
|
||||
void destroyFgQueryPool();
|
||||
void readFgQueryResult();
|
||||
|
||||
VkFormat offscreenFmt = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
VkRenderPass offscreenRenderPass = VK_NULL_HANDLE;
|
||||
VkPipelineLayout postPipeLayout = VK_NULL_HANDLE;
|
||||
VkPipeline sgsrPipeline = VK_NULL_HANDLE;
|
||||
VkPipeline nisPipeline = VK_NULL_HANDLE;
|
||||
VkPipeline sgsrQualityPipeline = VK_NULL_HANDLE;
|
||||
VkPipeline easuPipeline = VK_NULL_HANDLE;
|
||||
VkPipeline rcasPipeline = VK_NULL_HANDLE;
|
||||
VkPipeline downscalePipeline = VK_NULL_HANDLE;
|
||||
|
||||
|
||||
|
||||
VkPipeline casPipelineOff = VK_NULL_HANDLE;
|
||||
VkPipeline casPipelineSwap = VK_NULL_HANDLE;
|
||||
VkPipeline hdrPipelineOff = VK_NULL_HANDLE;
|
||||
VkPipeline hdrPipelineSwap = VK_NULL_HANDLE;
|
||||
VkPipeline fxaaPipelineOff = VK_NULL_HANDLE;
|
||||
VkPipeline fxaaPipelineSwap = VK_NULL_HANDLE;
|
||||
VkPipeline toonPipelineOff = VK_NULL_HANDLE;
|
||||
VkPipeline toonPipelineSwap = VK_NULL_HANDLE;
|
||||
VkPipeline colorPipelineOff = VK_NULL_HANDLE;
|
||||
VkPipeline colorPipelineSwap = VK_NULL_HANDLE;
|
||||
VkPipeline ntscPipelineOff = VK_NULL_HANDLE;
|
||||
VkPipeline ntscPipelineSwap = VK_NULL_HANDLE;
|
||||
VkPipeline crtPipelineOff = VK_NULL_HANDLE;
|
||||
VkPipeline crtPipelineSwap = VK_NULL_HANDLE;
|
||||
VkPipeline debandPipelineSwap = VK_NULL_HANDLE;
|
||||
|
||||
VkImage offscreenImg = VK_NULL_HANDLE;
|
||||
VkDeviceMemory offscreenMem = VK_NULL_HANDLE;
|
||||
VkImageView offscreenView = VK_NULL_HANDLE;
|
||||
VkFramebuffer offscreenFB = VK_NULL_HANDLE;
|
||||
VkDescriptorSet offscreenDS = VK_NULL_HANDLE;
|
||||
int offscreenW = 0, offscreenH = 0;
|
||||
|
||||
VkImage midImg = VK_NULL_HANDLE;
|
||||
VkDeviceMemory midMem = VK_NULL_HANDLE;
|
||||
VkImageView midView = VK_NULL_HANDLE;
|
||||
VkFramebuffer midFB = VK_NULL_HANDLE;
|
||||
VkDescriptorSet midDS = VK_NULL_HANDLE;
|
||||
int midW = 0, midH = 0;
|
||||
|
||||
VkImage fx1Img = VK_NULL_HANDLE;
|
||||
VkDeviceMemory fx1Mem = VK_NULL_HANDLE;
|
||||
VkImageView fx1View = VK_NULL_HANDLE;
|
||||
VkFramebuffer fx1FB = VK_NULL_HANDLE;
|
||||
VkDescriptorSet fx1DS = VK_NULL_HANDLE;
|
||||
int fx1W = 0, fx1H = 0;
|
||||
|
||||
VkImage fx2Img = VK_NULL_HANDLE;
|
||||
VkDeviceMemory fx2Mem = VK_NULL_HANDLE;
|
||||
VkImageView fx2View = VK_NULL_HANDLE;
|
||||
VkFramebuffer fx2FB = VK_NULL_HANDLE;
|
||||
VkDescriptorSet fx2DS = VK_NULL_HANDLE;
|
||||
int fx2W = 0, fx2H = 0;
|
||||
|
||||
struct UpscaleFrame {
|
||||
bool active = false;
|
||||
int mode = 0;
|
||||
int outX = 0, outY = 0, outW = 0, outH = 0;
|
||||
bool cas = false;
|
||||
bool hdr = false;
|
||||
bool fxaa = false;
|
||||
bool toon = false;
|
||||
bool color = false;
|
||||
bool ntsc = false;
|
||||
bool crt = false;
|
||||
bool deband = false;
|
||||
SgsrPushConstants sgsrPC{};
|
||||
NisPushConstants nisPC{};
|
||||
EasuPushConstants easuPC{};
|
||||
RcasPushConstants rcasPC{};
|
||||
CasPushConstants casPC{};
|
||||
HdrPushConstants hdrPC{};
|
||||
FxaaPushConstants fxaaPC{};
|
||||
ToonPushConstants toonPC{};
|
||||
ColorPushConstants colorPC{};
|
||||
NtscPushConstants ntscPC{};
|
||||
CrtPushConstants crtPC{};
|
||||
DebandPushConstants debandPC{};
|
||||
} upFrame;
|
||||
|
||||
VkCommandPool cmdPool = VK_NULL_HANDLE;
|
||||
std::vector<VkCommandBuffer> cmdBufs;
|
||||
|
||||
std::vector<VkSemaphore> imgAvailSems;
|
||||
std::vector<VkSemaphore> renderDoneSems;
|
||||
std::vector<VkFence> inFlightFences;
|
||||
std::vector<VkFence> imgInFlight;
|
||||
uint32_t currentFrame = 0;
|
||||
|
||||
VkSampler sampler = VK_NULL_HANDLE;
|
||||
VkDescriptorPool winTexPool = VK_NULL_HANDLE;
|
||||
|
||||
std::atomic<bool> needsRender{false};
|
||||
std::thread renderThread;
|
||||
std::atomic<bool> isRunning{false};
|
||||
std::atomic<bool> fbResized{false};
|
||||
std::mutex renderMutex;
|
||||
std::mutex dirtyMutex;
|
||||
std::condition_variable dirtyCV;
|
||||
std::shared_mutex frameMutex;
|
||||
|
||||
void createInstance();
|
||||
void createSurface();
|
||||
void pickPhysicalDevice();
|
||||
lsfg::Caps lsfgCaps_{};
|
||||
|
||||
void createLogicalDevice();
|
||||
void createSwapchain();
|
||||
void createRenderPass();
|
||||
void createDSLayout();
|
||||
void createPipeline(bool blend, VkPipeline& out);
|
||||
void createFramebuffers();
|
||||
void createCmdPool();
|
||||
void createSampler();
|
||||
void createUpscaleSampler();
|
||||
void createOffscreenRenderPass();
|
||||
void createPostPipelines();
|
||||
VkPipeline createPostPipeline(const uint32_t* fragCode, size_t fragSz, VkRenderPass rp);
|
||||
bool createColorTarget(int w, int h, VkImage& img, VkDeviceMemory& mem,
|
||||
VkImageView& view, VkFramebuffer& fb, VkDescriptorSet& ds);
|
||||
void destroyColorTarget(VkImage& img, VkDeviceMemory& mem, VkImageView& view,
|
||||
VkFramebuffer& fb, VkDescriptorSet& ds);
|
||||
bool ensureOffscreen(int w, int h);
|
||||
bool ensureMid(int w, int h);
|
||||
bool ensureFx1(int w, int h);
|
||||
bool ensureFx2(int w, int h);
|
||||
void recordUpscalePasses(VkCommandBuffer cb, uint32_t imgIdx,
|
||||
const std::vector<DrawEntry>& draws, bool cursorDrawn,
|
||||
short ptrX, short ptrY, short curHotX, short curHotY,
|
||||
short curW, short curH,
|
||||
float ox, float oy, float sx, float sy,
|
||||
float cw, float ch);
|
||||
void planUpscaleFrame();
|
||||
void createWinTexPool();
|
||||
void createCursorPipeline();
|
||||
void createCursorDS();
|
||||
void createCmdBufs();
|
||||
void createSyncObjects();
|
||||
void cleanupSwapchain();
|
||||
|
||||
bool createWinTexResources(WinTex& wt, int w, int h);
|
||||
bool importAHBToWinTex(WinTex& wt, AHardwareBuffer* ahb);
|
||||
void cleanupAllAHBCache();
|
||||
void flushDeleteQueue();
|
||||
void destroyWinTex(WinTex& wt);
|
||||
void ensureCursorTex(short w, short h);
|
||||
void cleanupCursorTex();
|
||||
void ensureCursorStaging(VkDeviceSize sz);
|
||||
|
||||
void recordCmdBuf(VkCommandBuffer cb, uint32_t imgIdx,
|
||||
const std::vector<DrawEntry>& draws,
|
||||
std::vector<VkImageMemoryBarrier>& ahbTransitions,
|
||||
std::vector<VkImageMemoryBarrier>& preUpload,
|
||||
std::vector<VkImageMemoryBarrier>& postUpload,
|
||||
VkBuffer cursorUpload, bool hasCursorUpload,
|
||||
float ox, float oy, float sx, float sy, float cw, float ch,
|
||||
short ptrX, short ptrY, short curHotX, short curHotY,
|
||||
short curW, short curH, bool curVis);
|
||||
void renderLoop();
|
||||
void renderFrame();
|
||||
|
||||
uint32_t findMemType(uint32_t filter, VkMemoryPropertyFlags props);
|
||||
void createBuffer(VkDeviceSize sz, VkBufferUsageFlags usage,
|
||||
VkMemoryPropertyFlags props, VkBuffer& buf, VkDeviceMemory& mem);
|
||||
VkCommandBuffer beginOneTime();
|
||||
void endOneTime(VkCommandBuffer cmd);
|
||||
void transition(VkCommandBuffer cmd, VkImage img,
|
||||
VkImageLayout oldL, VkImageLayout newL,
|
||||
VkAccessFlags srcA, VkAccessFlags dstA,
|
||||
VkPipelineStageFlags srcS, VkPipelineStageFlags dstS);
|
||||
VkShaderModule makeShader(const uint32_t* code, size_t sz);
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "ddfg_vkd.h"
|
||||
#include "../VulkanRendererContext.h"
|
||||
#include "../VkDispatchTable.h"
|
||||
#include <android/log.h>
|
||||
|
||||
bool ddfgVkdInit(const VkTable& table, ddfg::DeviceDispatch& dd, ddfg::InstanceDispatch& id) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#include "lsfg_probe.h"
|
||||
#include "../VulkanRendererContext.h"
|
||||
#include "../VkDispatchTable.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#include "lsfg_vkd.h"
|
||||
#include "../VulkanRendererContext.h"
|
||||
#include "../VkDispatchTable.h"
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <android/hardware_buffer.h>
|
||||
#include <android/native_window.h>
|
||||
#include <android/rect.h>
|
||||
#include <android/log.h>
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <cstdint>
|
||||
|
||||
#ifndef SCANOUT_LOG
|
||||
#define SCANOUT_LOG(...) __android_log_print(ANDROID_LOG_DEBUG,"DroidDeck_Scanout",__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
class ScanoutContext {
|
||||
public:
|
||||
bool loadApi();
|
||||
void initFromWindow(ANativeWindow* win = nullptr);
|
||||
void initFromWindows(ANativeWindow* gameWin, ANativeWindow* cursorWin);
|
||||
void destroy();
|
||||
|
||||
void setBuffer(AHardwareBuffer* ahb, int x, int y, int w, int h, int fenceFd = -1);
|
||||
|
||||
bool setCursorImage(void* pixels, short w, short h, short stride);
|
||||
bool setCursorPos(short x, short y, short hotX, short hotY);
|
||||
void applyPendingCursor();
|
||||
|
||||
void setDst(int x, int y, int w, int h);
|
||||
void setContainerSize(int w, int h) { containerWidth = w; containerHeight = h; }
|
||||
void setSurfaceSize(int w, int h) { surfaceWidth = w; surfaceHeight = h; }
|
||||
void setFallbackWindow(ANativeWindow* win) { window = win; }
|
||||
void setVerboseLog(bool v) { verboseLog = v; }
|
||||
|
||||
bool isActive() const { return scanoutActive.load(); }
|
||||
bool isGameFrameDelivered() const {
|
||||
return gameFrameDelivered.load(std::memory_order_acquire);
|
||||
}
|
||||
void* debugGameSC() const { return scanoutGameSC; }
|
||||
|
||||
std::atomic<bool> scanoutActive{false};
|
||||
std::atomic<bool> gameFrameDelivered{false};
|
||||
|
||||
private:
|
||||
ANativeWindow* window = nullptr;
|
||||
bool verboseLog = true;
|
||||
|
||||
int surfaceWidth = 0, surfaceHeight = 0, containerWidth = 0, containerHeight = 0;
|
||||
|
||||
void* scanoutGameSC = nullptr;
|
||||
void* scanoutCursorSC = nullptr;
|
||||
void* scanoutCursorBuf = nullptr;
|
||||
int32_t scanoutCursorBufW = 0;
|
||||
int32_t scanoutCursorBufH = 0;
|
||||
|
||||
void* scanoutTx = nullptr;
|
||||
void* scanoutGameTx = nullptr;
|
||||
|
||||
ARect scanoutLastSrc{}, scanoutLastDst{};
|
||||
bool scanoutGeoDirty = true;
|
||||
bool scanoutVisShown = false;
|
||||
bool scanoutApiLoaded = false;
|
||||
|
||||
void* fnSCCreateFromWin = nullptr;
|
||||
void* fnSCRelease = nullptr;
|
||||
void* fnSTCreate = nullptr;
|
||||
void* fnSTDelete = nullptr;
|
||||
void* fnSTApply = nullptr;
|
||||
void* fnSTSetBuffer = nullptr;
|
||||
void* fnSTSetZOrder = nullptr;
|
||||
void* fnSTSetVisibility = nullptr;
|
||||
void* fnSTSetGeometry = nullptr;
|
||||
|
||||
int32_t scanoutDstX = 0, scanoutDstY = 0, scanoutDstW = 0, scanoutDstH = 0;
|
||||
bool gameScVisible = false;
|
||||
|
||||
std::mutex scanoutMutex;
|
||||
|
||||
short pendingCursorX = 0, pendingCursorY = 0, pendingCursorHotX = 0, pendingCursorHotY = 0;
|
||||
bool cursorPosDirty = false;
|
||||
bool cursorImageDirty = false;
|
||||
};
|
||||
@@ -127,6 +127,9 @@ static int log_budget(void) {
|
||||
#ifndef BTN_RIGHT
|
||||
#define BTN_RIGHT 0x111
|
||||
#endif
|
||||
#ifndef BTN_MIDDLE
|
||||
#define BTN_MIDDLE 0x112
|
||||
#endif
|
||||
|
||||
#define INPUT_SPACE_W 1920
|
||||
#define INPUT_SPACE_H 1080
|
||||
@@ -582,6 +585,13 @@ int droiddeck_cursor_snapshot(int *out, int cap) {
|
||||
}
|
||||
struct active_touch { struct surface *surface; int pointer_fallback; };
|
||||
static struct active_touch g_touch_points[MAX_TOUCH_POINTS];
|
||||
#define PEN_IN (1 << 0)
|
||||
#define PEN_TIP (1 << 1)
|
||||
#define PEN_RIGHT (1 << 2)
|
||||
#define PEN_MIDDLE (1 << 3)
|
||||
#define PEN_BIT(button) (1 << ((button) - BTN_LEFT))
|
||||
struct pen_state { int in, buttons; struct surface *grab; };
|
||||
static struct pen_state g_pen;
|
||||
static void touch_cancel_surface(struct surface *surface);
|
||||
static struct surface *g_grab;
|
||||
static void publish_query_state(void);
|
||||
@@ -1339,6 +1349,7 @@ static void surface_resource_destroy(struct wl_resource *r) {
|
||||
if (g_grab == s) g_grab = NULL;
|
||||
if (g_key_target == s) g_key_target = NULL;
|
||||
if (g_ime_click == s) g_ime_click = NULL;
|
||||
if (g_pen.grab == s) g_pen.grab = NULL;
|
||||
droiddeck_text_input_surface_gone(r);
|
||||
if (g_desktop == s) { g_desktop = NULL; droiddeck_log("desktop", "the desktop closed"); }
|
||||
if (g_hud_surface == s) { g_hud_surface = NULL; droiddeck_on_game_surface(NULL, NULL); }
|
||||
@@ -3240,14 +3251,14 @@ static void deliver_pointer(const struct input_msg *m) {
|
||||
pointer_event(x, y, m->p1 == 1 ? 0 : BTN_LEFT, m->p1 == 0);
|
||||
}
|
||||
|
||||
static void input_output_to_scene(int px, int py, double *x, double *y) {
|
||||
static void input_output_to_scene(double px, double py, double *x, double *y) {
|
||||
int w, h, ow, oh;
|
||||
scene_size(&w, &h);
|
||||
vkp_output_size(&ow, &oh);
|
||||
if (ow <= 0 || oh <= 0 ||
|
||||
!vkp_output_to_scene((double)px * ow / INPUT_SPACE_W, (double)py * oh / INPUT_SPACE_H, x, y)) {
|
||||
*x = (double)px * w / INPUT_SPACE_W;
|
||||
*y = (double)py * h / INPUT_SPACE_H;
|
||||
!vkp_output_to_scene(px * ow / INPUT_SPACE_W, py * oh / INPUT_SPACE_H, x, y)) {
|
||||
*x = px * w / INPUT_SPACE_W;
|
||||
*y = py * h / INPUT_SPACE_H;
|
||||
}
|
||||
if (*x < 0) *x = 0;
|
||||
if (*y < 0) *y = 0;
|
||||
@@ -3476,6 +3487,57 @@ static void deliver_touch(const struct input_msg *m) {
|
||||
publish_query_state();
|
||||
}
|
||||
|
||||
static void pen_log_target(void) {
|
||||
static struct wl_client *said;
|
||||
for (int i = 0; i < g_nptrs; i++) {
|
||||
if (!g_ptrs[i].focus) continue;
|
||||
struct wl_client *client = wl_resource_get_client(g_ptrs[i].focus);
|
||||
if (client != said && log_budget()) {
|
||||
char name[160];
|
||||
describe(wl_resource_get_user_data(g_ptrs[i].focus), name, sizeof(name));
|
||||
droiddeck_log("pen", "%s gets the pen as the pointer", name);
|
||||
}
|
||||
said = client;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static int pen_buttons(int flags) {
|
||||
int held = 0;
|
||||
if (flags & PEN_TIP) held |= PEN_BIT(BTN_LEFT);
|
||||
if (flags & PEN_RIGHT) held |= PEN_BIT(BTN_RIGHT);
|
||||
if (flags & PEN_MIDDLE) held |= PEN_BIT(BTN_MIDDLE);
|
||||
return held;
|
||||
}
|
||||
|
||||
static void pen_release(int buttons) {
|
||||
for (uint32_t button = BTN_LEFT; button <= BTN_MIDDLE; button++)
|
||||
if (buttons & PEN_BIT(button)) pointer_button(button, 0);
|
||||
}
|
||||
|
||||
static void deliver_pen(const struct input_msg *m) {
|
||||
if (!(m->p1 & PEN_IN)) {
|
||||
pen_release(g_pen.buttons);
|
||||
if (g_pen.in) g_raw_valid = 0;
|
||||
memset(&g_pen, 0, sizeof(g_pen));
|
||||
return;
|
||||
}
|
||||
int held = pen_buttons(m->p1);
|
||||
if (!g_pen.in) g_raw_valid = 0;
|
||||
g_pen.in = 1;
|
||||
double x, y;
|
||||
input_output_to_scene(m->p2 / 256.0, m->p3 / 256.0, &x, &y);
|
||||
if (g_pen.buttons) g_grab = g_pen.grab;
|
||||
if (!pointer_locked_for_cursor()) pointer_event(x, y, 0, 0);
|
||||
for (uint32_t button = BTN_LEFT; button <= BTN_MIDDLE; button++)
|
||||
if (held & ~g_pen.buttons & PEN_BIT(button)) pointer_button(button, 1);
|
||||
g_pen.grab = g_grab;
|
||||
pen_release(g_pen.buttons & ~held);
|
||||
if (held) g_grab = g_pen.grab;
|
||||
g_pen.buttons = held;
|
||||
pen_log_target();
|
||||
}
|
||||
|
||||
static void key_event(uint32_t evdev, int pressed);
|
||||
struct wl_resource *droiddeck_ime_target(void);
|
||||
static void deliver_key(const struct input_msg *m) {
|
||||
@@ -3627,6 +3689,7 @@ static int on_input_readable(int fd, uint32_t mask, void *data) {
|
||||
case 10: break;
|
||||
case 11: axis_event(m.p1, m.p2, 0); break;
|
||||
case 12: axis_event(m.p1, m.p2, 1); break;
|
||||
case 13: deliver_pen(&m); break;
|
||||
case 20: stream_take(); break;
|
||||
case 21: if (!m.p1) stream_forget_all(); schedule_render(); break;
|
||||
case 22: schedule_render(); break;
|
||||
@@ -3666,6 +3729,13 @@ void droiddeck_wayland_send_touch(int action, int pointer_id, int x, int y) {
|
||||
(void)n;
|
||||
}
|
||||
|
||||
void droiddeck_wayland_send_pen(int flags, int x, int y) {
|
||||
if (g_input_pipe[1] < 0) return;
|
||||
struct input_msg m = { 13, flags, x, y, 0 };
|
||||
ssize_t n = write(g_input_pipe[1], &m, sizeof(m));
|
||||
(void)n;
|
||||
}
|
||||
|
||||
void droiddeck_wayland_send_key(int evdev, int state) {
|
||||
if (g_input_pipe[1] < 0) return;
|
||||
struct input_msg m = { 1, evdev, state, 0, 0 };
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
#include "VulkanRendererContext.h"
|
||||
#include "VkDispatchTable.h"
|
||||
#include "lsfg/lsfg_engine.h"
|
||||
#include "lsfg/lsfg_probe.h"
|
||||
#include "lsfg/lsfg_vkd.h"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <android/log.h>
|
||||
#include <string.h>
|
||||
|
||||
#define TAG "DroidDeckWayland"
|
||||
|
||||
@@ -45,6 +46,13 @@ int vk_loader_open(const char *driver_path, const char *library_name,
|
||||
return g_vk.CreateInstance ? 0 : -1;
|
||||
}
|
||||
|
||||
void vk_loader_close(void) {
|
||||
if (g_handle) dlclose(g_handle);
|
||||
g_handle = NULL;
|
||||
g_gip = NULL;
|
||||
memset(&g_vk, 0, sizeof(g_vk));
|
||||
}
|
||||
|
||||
PFN_vkGetInstanceProcAddr vk_loader_gipa(void) { return g_gip; }
|
||||
|
||||
void vk_loader_load_instance(VkInstance instance) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define VK_GLOBAL_FUNCS(X) X(CreateInstance) X(EnumerateInstanceExtensionProperties)
|
||||
|
||||
#define VK_INSTANCE_FUNCS(X) \
|
||||
X(EnumeratePhysicalDevices) X(GetPhysicalDeviceProperties) \
|
||||
X(DestroyInstance) X(EnumeratePhysicalDevices) X(GetPhysicalDeviceProperties) \
|
||||
X(GetPhysicalDeviceQueueFamilyProperties) X(GetPhysicalDeviceSurfaceSupportKHR) \
|
||||
X(GetPhysicalDeviceSurfaceCapabilitiesKHR) X(GetPhysicalDeviceSurfaceFormatsKHR) \
|
||||
X(CreateAndroidSurfaceKHR) X(DestroySurfaceKHR) X(CreateDevice) \
|
||||
@@ -43,6 +43,7 @@ extern struct vk_api g_vk;
|
||||
|
||||
int vk_loader_open(const char *driver_path, const char *library_name,
|
||||
const char *native_lib_dir);
|
||||
void vk_loader_close(void);
|
||||
void vk_loader_load_instance(VkInstance instance);
|
||||
void vk_loader_load_device(VkDevice device);
|
||||
PFN_vkGetInstanceProcAddr vk_loader_gipa(void);
|
||||
|
||||
@@ -46,6 +46,7 @@ struct vkp_image {
|
||||
static ANativeWindow *g_window;
|
||||
static int g_ahb_import;
|
||||
static char *g_driver_path, *g_library_name, *g_native_lib_dir;
|
||||
static int g_allow_driver_fallback;
|
||||
static int g_dev_state;
|
||||
static void device_lost(const char *where);
|
||||
static const char *vk_result_name(VkResult r);
|
||||
@@ -250,6 +251,8 @@ void vk_present_set_driver(const char *driver_path, const char *library_name,
|
||||
g_native_lib_dir = native_lib_dir ? strdup(native_lib_dir) : NULL;
|
||||
}
|
||||
|
||||
void vk_present_set_driver_fallback(int allow) { g_allow_driver_fallback = allow; }
|
||||
|
||||
static void reset_sync(void) {
|
||||
VkSemaphoreCreateInfo semci = {.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO};
|
||||
for (int k = 0; k < MAX_PRESENTS; k++) {
|
||||
@@ -426,7 +429,7 @@ static void update_map(int scene_w, int scene_h) {
|
||||
else if (align == VKP_ALIGN_PICTURE_RIGHT) g_map.off_x = W - scene_w * g_map.kx;
|
||||
g_map.valid = 1;
|
||||
pthread_mutex_lock(&g_game_picture_lock);
|
||||
g_game_picture_placed = align == VKP_ALIGN_PICTURE_TOP || align == VKP_ALIGN_PICTURE_BOTTOM || align == VKP_ALIGN_PICTURE_LEFT || align == VKP_ALIGN_PICTURE_RIGHT;
|
||||
g_game_picture_placed = mode == VKP_MODE_INTEGER || align == VKP_ALIGN_PICTURE_TOP || align == VKP_ALIGN_PICTURE_BOTTOM || align == VKP_ALIGN_PICTURE_LEFT || align == VKP_ALIGN_PICTURE_RIGHT;
|
||||
g_game_picture_rect[0] = g_map.off_x;
|
||||
g_game_picture_rect[1] = g_map.off_y;
|
||||
g_game_picture_rect[2] = g_map.off_x + scene_w * g_map.kx;
|
||||
@@ -549,6 +552,18 @@ static int dev_init(void) {
|
||||
uint32_t npd = 0;
|
||||
g_vk.EnumeratePhysicalDevices(g_inst, &npd, NULL);
|
||||
if (!npd) {
|
||||
if (g_allow_driver_fallback && g_driver_path && g_library_name) {
|
||||
LOGE("present: display driver exposed no physical devices; retrying the system Vulkan driver");
|
||||
g_vk.DestroyInstance(g_inst, NULL);
|
||||
g_inst = VK_NULL_HANDLE;
|
||||
vk_loader_close();
|
||||
free(g_driver_path); g_driver_path = NULL;
|
||||
free(g_library_name); g_library_name = NULL;
|
||||
g_allow_driver_fallback = 0;
|
||||
g_colorspace_ext = 0;
|
||||
g_dev_state = 0;
|
||||
return dev_init();
|
||||
}
|
||||
LOGE("present: no physical devices"); g_dev_state = -1;
|
||||
set_fault("the display driver exposed no GPU to the app");
|
||||
return -1;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
void vk_present_set_driver(const char *driver_path, const char *library_name,
|
||||
const char *native_lib_dir);
|
||||
void vk_present_set_driver_fallback(int allow);
|
||||
|
||||
void vk_present_set_window(ANativeWindow *window);
|
||||
int vkp_apply_window_request(void);
|
||||
|
||||
@@ -24,6 +24,7 @@ extern int droiddeck_wayland_run(void);
|
||||
extern void droiddeck_wayland_set_scale_mode(int mode, int alignment);
|
||||
extern void droiddeck_wayland_send_pointer(int action, int x, int y);
|
||||
extern void droiddeck_wayland_send_touch(int action, int pointer_id, int x, int y);
|
||||
extern void droiddeck_wayland_send_pen(int flags, int x, int y);
|
||||
extern int droiddeck_cursor_snapshot(int *out, int cap);
|
||||
extern int droiddeck_cursor_serial(void);
|
||||
extern int droiddeck_hud_frame_times(float *out, int len, int64_t *total);
|
||||
@@ -253,12 +254,13 @@ static char *dup_jstr(JNIEnv *env, jstring s) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeStartWithSurface(
|
||||
JNIEnv *env, jclass clazz, jobject surface, jstring xdgRuntimeDir,
|
||||
jstring driverPath, jstring libraryName, jstring nativeLibDir) {
|
||||
jstring driverPath, jstring libraryName, jstring nativeLibDir, jboolean allowDriverFallback) {
|
||||
set_runtime_dir(env, xdgRuntimeDir);
|
||||
char *dp = dup_jstr(env, driverPath);
|
||||
char *ln = dup_jstr(env, libraryName);
|
||||
char *nl = dup_jstr(env, nativeLibDir);
|
||||
vk_present_set_driver(dp, ln, nl);
|
||||
vk_present_set_driver_fallback(allowDriverFallback == JNI_TRUE);
|
||||
free(dp); free(ln); free(nl);
|
||||
if (surface) {
|
||||
ANativeWindow *win = ANativeWindow_fromSurface(env, surface);
|
||||
@@ -280,6 +282,12 @@ Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSendTouch(
|
||||
droiddeck_wayland_send_touch(action, pointer_id, x, y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSendPen(
|
||||
JNIEnv *env, jclass clazz, jint flags, jint x, jint y) {
|
||||
droiddeck_wayland_send_pen(flags, x, y);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeCursorSnapshot(
|
||||
JNIEnv *env, jclass clazz, jintArray out) {
|
||||
@@ -448,6 +456,18 @@ Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeGamePictureRect(JNIE
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeOutputSize(JNIEnv *env, jclass clazz, jintArray out) {
|
||||
(void)clazz;
|
||||
if (!out || (*env)->GetArrayLength(env, out) < 2) return JNI_FALSE;
|
||||
int width = 0, height = 0;
|
||||
vkp_output_size(&width, &height);
|
||||
if (width <= 0 || height <= 0) return JNI_FALSE;
|
||||
jint size[2] = {(jint)width, (jint)height};
|
||||
(*env)->SetIntArrayRegion(env, out, 0, 2, size);
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetUpscaler(JNIEnv *env, jclass clazz, jint mode) {
|
||||
vkp_effects_set_scaling(mode);
|
||||
|
||||
@@ -48,7 +48,6 @@ class App : Application() {
|
||||
com.droiddeck.launcher.ui.AgentPet.install(this)
|
||||
if (com.droiddeck.launcher.agent.AgentTab.visible) com.droiddeck.launcher.lab.LabNotice.openOnInstall = "agent"
|
||||
com.droiddeck.launcher.lab.LabNotice.started(this)
|
||||
com.droiddeck.launcher.core.SteamIntegration.syncShortcutsListing(this)
|
||||
com.droiddeck.launcher.session.QuestExperimental.initialize(this)
|
||||
com.droiddeck.launcher.session.SessionPrefs.applyNtsyncDefault(this)
|
||||
com.droiddeck.launcher.session.SessionPrefs.settleGpuDriverMode(this)
|
||||
@@ -57,6 +56,7 @@ class App : Application() {
|
||||
com.droiddeck.launcher.core.DownloadSource.init(this)
|
||||
prefetchAddonPacks()
|
||||
GpuClockPin.clearLeftover(this)
|
||||
com.droiddeck.launcher.input.UsbMouse.returnLeftover(this)
|
||||
com.droiddeck.launcher.glasses.Glasses.init(this)
|
||||
com.droiddeck.launcher.glasses.GlassesMenuMirror.initialize(this)
|
||||
BwrapSpawner.start(this)
|
||||
|
||||
@@ -286,7 +286,13 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
|
||||
// Builds before 0.5.0-nad1 turned the bridge on under Auto without recording it, and
|
||||
// left it on for good (it wins over the pair). Under Auto that switch is taken as Auto's.
|
||||
if (!SessionPrefs.maliFallbackKnown(activity))
|
||||
SessionPrefs.setMaliFallbackByAuto(activity, if (SessionPrefs.vkBridge(activity)) "bridge" else "")
|
||||
SessionPrefs.setMaliFallbackByAuto(
|
||||
activity,
|
||||
MaliAutoRoute.initialOwnership(
|
||||
SessionPrefs.vkBridge(activity), bridgeExplicit(),
|
||||
SessionPrefs.venus(activity), venusExplicit(),
|
||||
),
|
||||
)
|
||||
// A lone imported PanVK Android driver set by hand stalls the display the same way
|
||||
// ("black screen with the start-up logo"), so under Auto any imported display goes.
|
||||
val display = SessionPrefs.androidDriver(activity)
|
||||
@@ -356,8 +362,14 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
|
||||
val pair = pairs.firstOrNull { it.key == key }
|
||||
val row = pairRows.firstOrNull { it.key == key }
|
||||
when {
|
||||
row?.active == true -> autoStatus = problem?.let { activity.getString(R.string.drivers_up_to_date_check_failed, it) }
|
||||
?: activity.getString(R.string.upd_current_status)
|
||||
row?.active == true -> {
|
||||
if (MaliAutoRoute.shouldEnd(
|
||||
SessionPrefs.maliFallbackByAuto(activity), gpu.family.mali,
|
||||
pair?.key?.let { DriverPairs.isNonAdreno(it) } == true,
|
||||
)) endMaliFallback()
|
||||
autoStatus = problem?.let { activity.getString(R.string.drivers_up_to_date_check_failed, it) }
|
||||
?: activity.getString(R.string.upd_current_status)
|
||||
}
|
||||
gpu.family == GpuInfo.Family.POWERVR && (pair == null || !pair.complete) -> {
|
||||
// RADV is not published right now: the Xclipse falls back to the system route.
|
||||
SessionPrefs.ensurePowerVrAutoDrivers(activity)
|
||||
@@ -397,6 +409,12 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
|
||||
}, "gpu-driver-auto").start()
|
||||
}
|
||||
|
||||
private fun bridgeExplicit(): Boolean =
|
||||
MaliAutoRoute.userChoice(SessionPrefs.vkBridgeExplicit(activity), SessionPrefs.maliFallbackByAuto(activity), MaliAutoRoute.BRIDGE)
|
||||
|
||||
private fun venusExplicit(): Boolean =
|
||||
MaliAutoRoute.userChoice(SessionPrefs.venusExplicit(activity), SessionPrefs.maliFallbackByAuto(activity), MaliAutoRoute.VENUS)
|
||||
|
||||
/**
|
||||
* A Mali with no open driver pair to install ([missing] names the unpublished pair, or null when
|
||||
* no PanVK build covers this GPU) runs through the phone's own driver: Mali (Venus) where this
|
||||
@@ -410,12 +428,21 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
|
||||
val oldVulkan = com.droiddeck.launcher.session.VenusComponent.hostVulkanTooOld(activity)
|
||||
val venus = oldVulkan == null && com.droiddeck.launcher.session.VenusComponent.available(activity)
|
||||
if (oldVulkan != null) Log.i(TAG, "auto: Mali driver reports Vulkan $oldVulkan; Venus needs 1.2, the bridge stands in")
|
||||
val ownership = MaliAutoRoute.fallbackOwnership(
|
||||
venus,
|
||||
SessionPrefs.vkBridge(activity), bridgeExplicit(),
|
||||
SessionPrefs.venus(activity), venusExplicit(),
|
||||
)
|
||||
if (venus && !SessionPrefs.venus(activity)) {
|
||||
SessionPrefs.setVenus(activity, true)
|
||||
SessionPrefs.setMaliFallbackByAuto(activity, "venus")
|
||||
if (SessionPrefs.vkBridge(activity) && !bridgeExplicit())
|
||||
SessionPrefs.setVkBridge(activity, false)
|
||||
SessionPrefs.setMaliFallbackByAuto(activity, ownership)
|
||||
} else if (!venus && !SessionPrefs.vkBridge(activity)) {
|
||||
SessionPrefs.setVkBridge(activity, true)
|
||||
SessionPrefs.setMaliFallbackByAuto(activity, "bridge")
|
||||
SessionPrefs.setMaliFallbackByAuto(activity, ownership)
|
||||
} else if (ownership != MaliAutoRoute.NONE) {
|
||||
SessionPrefs.setMaliFallbackByAuto(activity, ownership)
|
||||
}
|
||||
val route = activity.getString(if (venus) R.string.drivers_route_venus else R.string.drivers_route_bridge)
|
||||
Log.i(TAG, "auto: Mali stand-in route $route (missing pair: ${missing ?: "none covers ${gpu.name}"})")
|
||||
@@ -503,7 +530,9 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
|
||||
// A route Auto switched on in place of a missing pair goes off now that one is
|
||||
// here. A Mali bridge or Venus switch the user set stays: it wins for the session
|
||||
// (DeviceSupport.vkBridge, VenusComponent.wanted) and the pair waits.
|
||||
if (gpu.family.mali && DriverPairs.isNonAdreno(pair.key)) endMaliFallback()
|
||||
if (MaliAutoRoute.shouldEnd(
|
||||
SessionPrefs.maliFallbackByAuto(activity), gpu.family.mali, DriverPairs.isNonAdreno(pair.key),
|
||||
)) endMaliFallback()
|
||||
val restart = displayChanged && CompositorHost.isStarted
|
||||
if (auto) {
|
||||
val trial = AutoDriverTrial.current(activity)
|
||||
@@ -744,4 +773,3 @@ internal fun Context.displayNameOf(uri: Uri): String? = if (uri.scheme == "file"
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
}
|
||||
|
||||
@@ -182,6 +182,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var paceCores by mutableStateOf(true)
|
||||
private var ramCapMb by mutableStateOf(0)
|
||||
private var zramClient by mutableStateOf(true)
|
||||
private var zramIdle by mutableStateOf(true)
|
||||
private var vramCapMb by mutableStateOf(0)
|
||||
private var gpuClockPin by mutableStateOf(false)
|
||||
private var prootNoSeccomp by mutableStateOf(false)
|
||||
@@ -366,15 +367,78 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
SteamIntegration.Feature.BRIGHTNESS -> integrationSettings(SteamIntegration.brightnessSettings(this))
|
||||
SteamIntegration.Feature.HOME -> if (HomeApp.isDefault(this)) HomeApp.openSystemHomeSettings(this) else offerHomeScreen()
|
||||
SteamIntegration.Feature.SHORTCUTS -> {
|
||||
if (!integrationState.shortcuts) shortcutsTried = true
|
||||
SteamIntegration.setShortcutsListed(this, true)
|
||||
integrationSettings(SteamIntegration.shortcutSettings(this), android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS)
|
||||
if (integrationState.shortcuts) openShortcutSettings() else installShortcuts()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun openAppInfo() =
|
||||
integrationSettings(Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:$packageName")))
|
||||
private fun openShortcutSettings() =
|
||||
integrationSettings(SteamIntegration.shortcutSettings(this), android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS)
|
||||
|
||||
private fun installShortcuts() {
|
||||
if (ShortcutsInstall.running) return
|
||||
ShortcutsInstall.running = true
|
||||
Thread({
|
||||
val result = runCatching {
|
||||
val apk = SteamIntegration.bundledShortcuts(this)
|
||||
when {
|
||||
SteamIntegration.shortcutsInstalled(this, apk) -> {
|
||||
ShortcutsInstall.running = false
|
||||
ui.post { shortcutsReady() }
|
||||
}
|
||||
!com.droiddeck.launcher.update.SelfInstaller.canInstall(this) -> {
|
||||
ShortcutsInstall.running = false
|
||||
ui.post { integrationSettings(com.droiddeck.launcher.update.SelfInstaller.permissionIntent(this)) }
|
||||
}
|
||||
else -> com.droiddeck.launcher.update.SelfInstaller.install(this, apk, com.droiddeck.shortcuts.Relay.PACKAGE,
|
||||
SteamIntegration.SHORTCUTS_STATUS) { id -> ShortcutsInstall.session = id }
|
||||
}
|
||||
}
|
||||
result.onFailure { e ->
|
||||
ShortcutsInstall.running = false
|
||||
ui.post { shortcutsFailed(e.message) }
|
||||
}
|
||||
}, "shortcuts-install").start()
|
||||
}
|
||||
|
||||
private fun shortcutsReady() {
|
||||
shortcutsTried = true
|
||||
Thread({
|
||||
val deadline = android.os.SystemClock.uptimeMillis() + 3000
|
||||
while (!SteamIntegration.shortcutsListed(this) && android.os.SystemClock.uptimeMillis() < deadline) Thread.sleep(100)
|
||||
ui.post { openShortcutSettings() }
|
||||
}, "shortcuts-listed").start()
|
||||
}
|
||||
|
||||
private fun shortcutsFailed(message: String?) {
|
||||
android.widget.Toast.makeText(this, message?.let { getString(R.string.integration_shortcuts_install_failed_with, it) }
|
||||
?: getString(R.string.integration_shortcuts_install_failed), android.widget.Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
private val shortcutsInstallStatus = object : android.content.BroadcastReceiver() {
|
||||
override fun onReceive(context: android.content.Context, intent: Intent) {
|
||||
val session = intent.getIntExtra(android.content.pm.PackageInstaller.EXTRA_SESSION_ID, -1)
|
||||
if (session < 0 || session != ShortcutsInstall.session) return
|
||||
val status = intent.getIntExtra(android.content.pm.PackageInstaller.EXTRA_STATUS,
|
||||
android.content.pm.PackageInstaller.STATUS_FAILURE)
|
||||
if (status != android.content.pm.PackageInstaller.STATUS_PENDING_USER_ACTION) {
|
||||
ShortcutsInstall.session = -1
|
||||
ShortcutsInstall.running = false
|
||||
}
|
||||
when (status) {
|
||||
android.content.pm.PackageInstaller.STATUS_PENDING_USER_ACTION -> {
|
||||
val confirm = if (android.os.Build.VERSION.SDK_INT >= 33) intent.getParcelableExtra(Intent.EXTRA_INTENT, Intent::class.java)
|
||||
else @Suppress("DEPRECATION") intent.getParcelableExtra(Intent.EXTRA_INTENT)
|
||||
val safe = confirm?.let { com.droiddeck.launcher.update.SelfInstaller.safeConfirmIntent(this@FrontEndActivity, it) }
|
||||
if (safe == null || runCatching { startActivity(safe) }.isFailure) shortcutsFailed(null)
|
||||
}
|
||||
android.content.pm.PackageInstaller.STATUS_SUCCESS -> shortcutsReady()
|
||||
else -> shortcutsFailed(intent.getStringExtra(android.content.pm.PackageInstaller.EXTRA_STATUS_MESSAGE))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun openAppInfo() = integrationSettings(SteamIntegration.shortcutsAppInfo())
|
||||
|
||||
private fun openWifiDiscoverySettings() {
|
||||
if (!WifiDiscovery.permissionGranted(this)) {
|
||||
@@ -535,6 +599,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var upscaleSharpness by mutableStateOf(75)
|
||||
private var hdrReason by mutableStateOf<String?>(null)
|
||||
private var touchMode by mutableStateOf(SessionPrefs.TOUCH_AUTO)
|
||||
private var pen by mutableStateOf<SessionPrefs.Pen?>(null)
|
||||
private var suspendPolicy by mutableStateOf(SessionPrefs.SUSPEND_MANUAL)
|
||||
private var steamDownloadsInBackground by mutableStateOf(false)
|
||||
private var oscMode by mutableStateOf(SessionPrefs.OSC_AUTO)
|
||||
@@ -1138,6 +1203,9 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
homeChoiceOpen = savedInstanceState?.getBoolean(STATE_HOME_CHOICE_OPEN) == true
|
||||
gameSpaceOffered = savedInstanceState?.getBoolean(STATE_GAME_SPACE_OFFERED) == true
|
||||
if (savedInstanceState == null) readIntegrationIntent(intent)
|
||||
val shortcutsFilter = android.content.IntentFilter(SteamIntegration.SHORTCUTS_STATUS)
|
||||
if (android.os.Build.VERSION.SDK_INT >= 33) registerReceiver(shortcutsInstallStatus, shortcutsFilter, RECEIVER_NOT_EXPORTED)
|
||||
else registerReceiver(shortcutsInstallStatus, shortcutsFilter)
|
||||
readGameIntent(intent)
|
||||
// A Lab build is usually the agent's work, so the app comes back where the agent is.
|
||||
if (savedInstanceState == null && navRequest == null && com.droiddeck.launcher.lab.LabOverlay.promoted && com.droiddeck.launcher.agent.AgentTab.visible) navRequest = "agent"
|
||||
@@ -1974,7 +2042,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
launcherOrientation = com.droiddeck.launcher.core.AppUiPrefs.orientation(this)
|
||||
requestedOrientation = launcherOrientation
|
||||
homePage = com.droiddeck.launcher.core.AppUiPrefs.homePage(this)
|
||||
SteamIntegration.syncShortcutsListing(this)
|
||||
refreshWifiDiscovery()
|
||||
com.droiddeck.launcher.stores.StoresState.refresh(this)
|
||||
com.droiddeck.launcher.stores.StoresState.libraryListener = { refreshAddedGames(); refresh() }
|
||||
@@ -2083,6 +2150,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
gameLaunchRequest.incrementAndGet()
|
||||
cancelCompatLaunch()
|
||||
updates.unregister()
|
||||
runCatching { unregisterReceiver(shortcutsInstallStatus) }
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
@@ -2471,6 +2539,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
upscaler = upscaler, upscaleSharpness = upscaleSharpness,
|
||||
gpuDrivers = drivers.summary(),
|
||||
touchMode = touchMode,
|
||||
pen = pen,
|
||||
suspendPolicy = suspendPolicy,
|
||||
steamDownloadsInBackground = steamDownloadsInBackground,
|
||||
pipSupported = com.droiddeck.launcher.session.SessionPipController.supported(this),
|
||||
@@ -2523,6 +2592,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
onUpscaler = { m -> SessionPrefs.setUpscaler(this, m); upscaler = m },
|
||||
onUpscaleSharpness = { pct -> SessionPrefs.setUpscaleSharpness(this, pct); upscaleSharpness = pct },
|
||||
onTouch = { t -> SessionPrefs.setTouchMode(this, t); touchMode = t },
|
||||
onPen = { key, value -> SessionPrefs.setPenSetting(this, key, value); pen = SessionPrefs.pen(this) },
|
||||
onSuspendPolicy = { policy -> SessionPrefs.setSuspendPolicy(this, mode, policy); suspendPolicy = policy },
|
||||
onSteamDownloadsInBackground = { enabled ->
|
||||
SessionPrefs.setSteamDownloadsInBackground(this, enabled)
|
||||
@@ -2632,7 +2702,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
fsyncFirst = fsyncFirst,
|
||||
gamescopeRealtime = gamescopeRealtime,
|
||||
gpuClockPin = gpuClockPin,
|
||||
ramCapMb = ramCapMb, vramCapMb = vramCapMb, zramClient = zramClient,
|
||||
ramCapMb = ramCapMb, vramCapMb = vramCapMb, zramClient = zramClient, zramIdle = zramIdle,
|
||||
deviceRamMb = (android.app.ActivityManager.MemoryInfo()
|
||||
.also((getSystemService(ACTIVITY_SERVICE) as android.app.ActivityManager)::getMemoryInfo).totalMem / (1024 * 1024)).toInt(),
|
||||
ramCapAvailable = com.droiddeck.launcher.core.ZramSupport.supported(),
|
||||
@@ -2652,6 +2722,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
onGpuClockPin = { on -> SessionPrefs.setGpuClockPin(this, on); gpuClockPin = on },
|
||||
onRamCapMb = { mb -> SessionPrefs.setRamCapMb(this, mb); ramCapMb = mb },
|
||||
onZramClient = { on -> SessionPrefs.setZramClient(this, on); zramClient = on },
|
||||
onZramIdle = { on -> SessionPrefs.setZramIdle(this, on); zramIdle = on },
|
||||
onVramCapMb = { mb -> SessionPrefs.setVramCapMb(this, mb); vramCapMb = mb },
|
||||
onProotNoSeccomp = { on -> SessionPrefs.setProotNoSeccomp(this, on); prootNoSeccomp = on },
|
||||
onProotFastPath = { on -> SessionPrefs.setProotFastPath(this, on); prootFastPath = on },
|
||||
@@ -2869,6 +2940,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
upscaleSharpness = SessionPrefs.upscaleSharpness(this)
|
||||
hdrReason = com.droiddeck.launcher.wayland.HdrSupport.probe(this).reason
|
||||
touchMode = SessionPrefs.touchMode(this)
|
||||
if (!SessionPrefs.penSeen(this) && com.droiddeck.launcher.input.PenStream.penConnected()) SessionPrefs.setPenSeen(this)
|
||||
pen = SessionPrefs.pen(this).takeIf { SessionPrefs.penSeen(this) }
|
||||
suspendPolicy = SessionPrefs.suspendPolicy(this, mode)
|
||||
steamDownloadsInBackground = SessionPrefs.steamDownloadsInBackground(this)
|
||||
oscMode = SessionPrefs.oscMode(this)
|
||||
@@ -2949,6 +3022,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
paceCores = SessionPrefs.paceCores(this)
|
||||
ramCapMb = SessionPrefs.ramCapMb(this)
|
||||
zramClient = SessionPrefs.zramClient(this)
|
||||
zramIdle = SessionPrefs.zramIdle(this)
|
||||
vramCapMb = SessionPrefs.vramCapMb(this)
|
||||
gpuClockPin = SessionPrefs.gpuClockPin(this)
|
||||
prootNoSeccomp = SessionPrefs.prootNoSeccomp(this)
|
||||
@@ -3300,3 +3374,9 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private val WCP_EXT = listOf("wcp")
|
||||
}
|
||||
}
|
||||
|
||||
// The install session outlives the activity when Android recreates it mid-install.
|
||||
private object ShortcutsInstall {
|
||||
@Volatile var session = -1
|
||||
@Volatile var running = false
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.droiddeck.launcher
|
||||
|
||||
internal object MaliAutoRoute {
|
||||
const val NONE = ""
|
||||
const val BRIDGE = "bridge"
|
||||
const val VENUS = "venus"
|
||||
|
||||
fun initialOwnership(bridgeOn: Boolean, bridgeExplicit: Boolean, venusOn: Boolean, venusExplicit: Boolean): String =
|
||||
when {
|
||||
venusOn && !venusExplicit -> VENUS
|
||||
bridgeOn && !bridgeExplicit -> BRIDGE
|
||||
else -> NONE
|
||||
}
|
||||
|
||||
fun fallbackOwnership(
|
||||
venusAvailable: Boolean,
|
||||
bridgeOn: Boolean,
|
||||
bridgeExplicit: Boolean,
|
||||
venusOn: Boolean,
|
||||
venusExplicit: Boolean,
|
||||
): String = if (venusAvailable) {
|
||||
if (!venusOn || !venusExplicit) VENUS else NONE
|
||||
} else {
|
||||
if (!bridgeOn || !bridgeExplicit) BRIDGE else NONE
|
||||
}
|
||||
|
||||
fun userChoice(keyStored: Boolean, owner: String, route: String): Boolean = keyStored && owner != route
|
||||
|
||||
fun shouldEnd(ownsRoute: String, mali: Boolean, installedPair: Boolean): Boolean =
|
||||
mali && installedPair && ownsRoute != NONE
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -96,7 +96,17 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl
|
||||
percent = 0
|
||||
Thread({
|
||||
val result = runCatching {
|
||||
val file = SelfInstaller.download(activity, apk) { pct -> ui.post { percent = pct } }
|
||||
val file = try {
|
||||
SelfInstaller.download(activity, apk) { pct -> ui.post { percent = pct } }
|
||||
} catch (e: java.io.IOException) {
|
||||
// Each push replaces a test build's APK, so a list read before the push names a file that is gone.
|
||||
if (r.pr <= 0) throw e
|
||||
val fresh = runCatching { AppUpdates.refresh(activity) }.getOrNull() ?: throw e
|
||||
ui.post { catalog = fresh }
|
||||
val newer = fresh.tests.firstOrNull { it.tag == r.tag }?.apk?.takeIf { it.url != apk.url } ?: throw e
|
||||
ui.post { percent = 0 }
|
||||
SelfInstaller.download(activity, newer) { pct -> ui.post { percent = pct } }
|
||||
}
|
||||
ui.post { stage = activity.getString(R.string.upd_stage_installing); percent = -1 }
|
||||
SelfInstaller.install(activity, file) { id -> session = id }
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import java.nio.file.Files;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.IntConsumer;
|
||||
import java.util.function.IntSupplier;
|
||||
|
||||
public class PulseAudioComponent extends SessionPart {
|
||||
private static final String TAG = "PulseAudio";
|
||||
@@ -29,7 +31,55 @@ public class PulseAudioComponent extends SessionPart {
|
||||
private final File deviceControls;
|
||||
private File logFile;
|
||||
private final String micFifoPath;
|
||||
private volatile int pid = -1;
|
||||
private final HostLifecycle host = new HostLifecycle(Process::killProcess);
|
||||
|
||||
static final class HostLifecycle {
|
||||
volatile int pid = -1;
|
||||
private long generation;
|
||||
private long launches;
|
||||
private final IntConsumer terminate;
|
||||
|
||||
HostLifecycle(IntConsumer terminate) {
|
||||
this.terminate = terminate;
|
||||
}
|
||||
|
||||
synchronized long begin() {
|
||||
stop();
|
||||
return generation;
|
||||
}
|
||||
|
||||
synchronized void stop() {
|
||||
generation++;
|
||||
if (pid > 1) terminate.accept(pid);
|
||||
pid = -1;
|
||||
}
|
||||
|
||||
synchronized boolean launch(long expected, IntSupplier launch) {
|
||||
if (expected != generation) return false;
|
||||
launches++;
|
||||
pid = launch.getAsInt();
|
||||
return true;
|
||||
}
|
||||
|
||||
synchronized boolean current(long expected) {
|
||||
return expected == generation;
|
||||
}
|
||||
|
||||
/** The latest launch; a sink guard holds it so it never reconfigures a host started after its own. */
|
||||
synchronized long token() {
|
||||
return launches;
|
||||
}
|
||||
|
||||
synchronized boolean live(long token) {
|
||||
return token == launches && pid > 1;
|
||||
}
|
||||
|
||||
synchronized boolean exited(long expected) {
|
||||
if (expected != generation || pid <= 1) return false;
|
||||
pid = -1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public PulseAudioComponent(Context context) {
|
||||
this(context, null);
|
||||
@@ -64,7 +114,12 @@ public class PulseAudioComponent extends SessionPart {
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
stop();
|
||||
start(host.begin());
|
||||
}
|
||||
|
||||
private synchronized void start(long generation) {
|
||||
// An exit callback's restart can be overtaken by a newer start; it must not touch the newer host's socket.
|
||||
if (!host.current(generation)) return;
|
||||
if (!workingDir.isDirectory()) {
|
||||
workingDir.mkdirs();
|
||||
FileUtils.chmod(workingDir, 0771);
|
||||
@@ -118,17 +173,23 @@ public class PulseAudioComponent extends SessionPart {
|
||||
+ " -n --file=default.pa --daemonize=false --use-pid-file=false --exit-idle-time=-1"
|
||||
+ " --log-level=info";
|
||||
final java.io.PrintWriter out = openLog();
|
||||
pid = HostProcess.start(command, env.toArray(new String[0]), workingDir, null,
|
||||
if (!host.launch(generation, () -> HostProcess.start(command, env.toArray(new String[0]), workingDir, status -> {
|
||||
if (host.exited(generation)) {
|
||||
Log.w(TAG, "audio host exited with status " + status + "; restarting");
|
||||
start(generation);
|
||||
}
|
||||
},
|
||||
line -> {
|
||||
Log.i(TAG, line);
|
||||
if (out != null) synchronized (out) { out.println(line); out.flush(); }
|
||||
});
|
||||
Thread guard = new Thread(() -> ensureClientSink(out), "pulse-sink-guard");
|
||||
}))) return;
|
||||
long token = host.token();
|
||||
Thread guard = new Thread(() -> ensureClientSink(out, token), "pulse-sink-guard");
|
||||
guard.setDaemon(true);
|
||||
guard.start();
|
||||
}
|
||||
|
||||
private void ensureClientSink(java.io.PrintWriter out) {
|
||||
private void ensureClientSink(java.io.PrintWriter out, long token) {
|
||||
try {
|
||||
// Nothing that may block (a sink whose AAudio open hangs: a Galaxy S24 FE (US) hung the
|
||||
// daemon's start-up loading one from default.pa) is loaded by the daemon itself; the
|
||||
@@ -137,14 +198,14 @@ public class PulseAudioComponent extends SessionPart {
|
||||
long deadline = started + 30000L;
|
||||
String sinks = null;
|
||||
boolean socketSeen = false;
|
||||
while (System.currentTimeMillis() < deadline && pid > 1) {
|
||||
while (System.currentTimeMillis() < deadline && host.live(token)) {
|
||||
socketSeen |= socket().exists();
|
||||
if (socketSeen && (sinks = pactl("list", "short", "sinks")) != null) break;
|
||||
if (socketSeen && (sinks = pactlFor(token, "list", "short", "sinks")) != null) break;
|
||||
try { Thread.sleep(250L); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; }
|
||||
}
|
||||
note(out, "client sink: daemon " + (sinks != null ? "answered" : "did not answer") + " after "
|
||||
+ (System.currentTimeMillis() - started) + " ms (socket " + (socketSeen ? "present" : "never appeared") + ", pactl "
|
||||
+ (new File(workingDir, "pactl").isFile() ? "present" : "MISSING") + ", daemon pid " + pid + ")");
|
||||
+ (new File(workingDir, "pactl").isFile() ? "present" : "MISSING") + ", daemon pid " + host.pid + ")");
|
||||
String line;
|
||||
if (sinks == null) {
|
||||
line = "== client sink: the daemon did not answer in 30 s; no fallback attempted";
|
||||
@@ -155,15 +216,15 @@ public class PulseAudioComponent extends SessionPart {
|
||||
// still switching the output route as the session starts (seen on a Galaxy S24 FE):
|
||||
// try DirectAudio again, then the plain sink, a few times over ten seconds.
|
||||
String loadedAs = null;
|
||||
for (int attempt = 1; attempt <= 5 && loadedAs == null && pid > 1; attempt++) {
|
||||
for (int attempt = 1; attempt <= 5 && loadedAs == null && host.live(token); attempt++) {
|
||||
try { Thread.sleep(2000L); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; }
|
||||
if (pactl("load-module", "module-directaudio-native-sink", "sink_name=DirectAudio", "performance_mode=1",
|
||||
if (pactlFor(token, "load-module", "module-directaudio-native-sink", "sink_name=DirectAudio", "performance_mode=1",
|
||||
"adaptive=1", "decay=0", "limiter=1", "watchdog=1", "volume=1.0", "control_dir=" + deviceControls) != null
|
||||
&& pactl("set-default-sink", "DirectAudio") != null) {
|
||||
&& pactlFor(token, "set-default-sink", "DirectAudio") != null) {
|
||||
loadedAs = "DirectAudio on attempt " + attempt;
|
||||
} else if (pactl("load-module", "module-aaudio-sink", "sink_name=AAudioSink",
|
||||
} else if (pactlFor(token, "load-module", "module-aaudio-sink", "sink_name=AAudioSink",
|
||||
"performance_mode=" + (attempt == 1 ? "1" : "0"), "adaptive=1", "volume=1.0", "control_dir=" + deviceControls) != null
|
||||
&& pactl("set-default-sink", "AAudioSink") != null) {
|
||||
&& pactlFor(token, "set-default-sink", "AAudioSink") != null) {
|
||||
loadedAs = "the plain AAudio sink (AAudioSink) on attempt " + attempt;
|
||||
}
|
||||
}
|
||||
@@ -186,10 +247,14 @@ public class PulseAudioComponent extends SessionPart {
|
||||
if (out != null) synchronized (out) { out.println(line); out.flush(); }
|
||||
}
|
||||
|
||||
private String pactlFor(long token, String... args) {
|
||||
return host.live(token) ? pactl(args) : null;
|
||||
}
|
||||
|
||||
/** Runs pactl against this daemon; its stdout, or null when it failed or timed out. */
|
||||
private String pactl(String... args) {
|
||||
File pactl = new File(workingDir, "pactl");
|
||||
if (!pactl.isFile() || pid <= 1) return null;
|
||||
if (!pactl.isFile() || host.pid <= 1) return null;
|
||||
java.lang.Process process = null;
|
||||
try {
|
||||
File modules = new File(workingDir, "modules/arm64");
|
||||
@@ -231,10 +296,7 @@ public class PulseAudioComponent extends SessionPart {
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if (pid != -1) {
|
||||
Process.killProcess(pid);
|
||||
pid = -1;
|
||||
}
|
||||
host.stop();
|
||||
}
|
||||
|
||||
public boolean setSinkSuspended(boolean suspended) {
|
||||
@@ -247,7 +309,7 @@ public class PulseAudioComponent extends SessionPart {
|
||||
|
||||
private boolean suspend(String kind, String name, boolean suspended) {
|
||||
File pactl = new File(workingDir, "pactl");
|
||||
if (!pactl.isFile() || pid <= 1) {
|
||||
if (!pactl.isFile() || host.pid <= 1) {
|
||||
Log.w(TAG, "cannot change " + kind + " state: PulseAudio control client or server unavailable");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -233,6 +233,10 @@ object DeviceReport {
|
||||
else "${turnip.displayName(displayId)} ${turnip.driverVersion(displayId)}".trim()
|
||||
k("Display driver (chosen)", if (androidChoice.isEmpty()) "Auto -> $displayLabel" else androidChoice)
|
||||
k(" name / version", displayLabel)
|
||||
turnip.effectiveId().takeIf { it != displayId }?.let { used ->
|
||||
k(" in use", if (used == "system") DeviceInfo.builtinDriverLabel(SystemVulkanDriver.isPowerVr(), runtime = false)
|
||||
else "${turnip.displayName(used)} ${turnip.driverVersion(used)}".trim())
|
||||
}
|
||||
k(" imported available", turnip.enumerateImported().ifEmpty { listOf("none") }.joinToString(", "))
|
||||
val lm = LinuxVulkanDriverManager(context)
|
||||
run {
|
||||
@@ -242,7 +246,9 @@ object DeviceReport {
|
||||
lm.getMinGlibc(id).let { if (it.isEmpty()) "" else " (glibc $it+)" } +
|
||||
if (lm.isInstalled(id)) "" else if (SystemVulkanDriver.isPowerVr()) " [MISSING - select an installed driver or Auto]"
|
||||
else " [MISSING - falls back to the runtime's own]"
|
||||
k("Linux driver", label)
|
||||
val route = DeviceInfo.hostRoute(context)
|
||||
k("Linux driver", route ?: label)
|
||||
if (route != null) k(" chosen, not used", label)
|
||||
}
|
||||
k("Runtime's own ICD", LinuxRuntime.vulkanIcd(context)?.path)
|
||||
k("Mali (Venus)", if (com.droiddeck.launcher.session.VenusComponent.wanted(context)) "in use"
|
||||
@@ -290,6 +296,8 @@ object DeviceReport {
|
||||
k("Microphone", SessionPrefs.micEnabled(context))
|
||||
k("On-screen controls", SessionPrefs.oscMode(context))
|
||||
k("Touch mode", SessionPrefs.touchMode(context))
|
||||
k("Pen mode", SessionPrefs.penMode(context))
|
||||
k("Pen side button", SessionPrefs.penButton(context))
|
||||
k("Performance HUD", SessionPrefs.hudEnabled(context))
|
||||
k("Game storage", when (val g = SessionPrefs.gameStorage(context)) {
|
||||
"" -> "automatic (" + (com.droiddeck.launcher.session.GameStorage.effective(context)?.path ?: "no card present") + ")"
|
||||
|
||||
@@ -18,7 +18,7 @@ object SessionLogCapture {
|
||||
private var syncer: Thread? = null
|
||||
|
||||
@Synchronized
|
||||
fun start(target: File) {
|
||||
fun start(target: File, sinceMillis: Long) {
|
||||
stop()
|
||||
try {
|
||||
val out = target.bufferedWriter()
|
||||
@@ -28,7 +28,7 @@ object SessionLogCapture {
|
||||
writer = out
|
||||
this.target = target
|
||||
pid = HostProcess.start(
|
||||
"/system/bin/logcat -v threadtime -T 1 --pid=" + Process.myPid(),
|
||||
command(Process.myPid(), sinceMillis),
|
||||
null, target.parentFile, null,
|
||||
) { line ->
|
||||
synchronized(this) {
|
||||
@@ -49,6 +49,11 @@ object SessionLogCapture {
|
||||
}
|
||||
}
|
||||
|
||||
internal fun command(pid: Int, sinceMillis: Long): String {
|
||||
val since = if (sinceMillis > 0) "%d.%03d".format(java.util.Locale.US, sinceMillis / 1000, sinceMillis % 1000) else "1"
|
||||
return "/system/bin/logcat -v threadtime -T $since --pid=$pid"
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun stopFor(dir: File) {
|
||||
val t = target ?: return
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.droiddeck.launcher.core
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
|
||||
class ShortcutsListingReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (intent.action == Intent.ACTION_MY_PACKAGE_REPLACED) SteamIntegration.syncShortcutsListing(context)
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,21 @@
|
||||
package com.droiddeck.launcher.core
|
||||
|
||||
import android.accessibilityservice.AccessibilityServiceInfo
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.provider.Settings
|
||||
import android.view.accessibility.AccessibilityManager
|
||||
import com.droiddeck.launcher.HomeApp
|
||||
import com.droiddeck.launcher.input.HomeButtonService
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.shortcuts.Relay
|
||||
import java.io.File
|
||||
|
||||
object SteamIntegration {
|
||||
const val ACTION_SETUP = "com.droiddeck.launcher.STEAM_INTEGRATION"
|
||||
const val EXTRA_FEATURE = "integration_feature"
|
||||
const val SHORTCUTS_STATUS = "com.droiddeck.launcher.SHORTCUTS_INSTALL_STATUS"
|
||||
private const val SHORTCUTS_ASSET = "shortcuts.apk"
|
||||
enum class Feature { WIFI, BRIGHTNESS, HOME, SHORTCUTS }
|
||||
|
||||
data class State(
|
||||
@@ -36,11 +37,7 @@ object SteamIntegration {
|
||||
locationOn = WifiDiscovery.locationEnabled(context),
|
||||
brightness = Settings.System.canWrite(context),
|
||||
home = HomeApp.isDefault(context),
|
||||
shortcuts = context.getSystemService(AccessibilityManager::class.java)
|
||||
.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_ALL_MASK).any {
|
||||
val service = it.resolveInfo.serviceInfo
|
||||
ComponentName(service.packageName, service.name) == ComponentName(context, HomeButtonService::class.java)
|
||||
},
|
||||
shortcuts = shortcutsEnabled(context),
|
||||
shortcutsRestricted = restrictedSettings(context),
|
||||
suggested = !SessionPrefs.sessionPrefs(context).getBoolean("steam_integration_seen", false),
|
||||
)
|
||||
@@ -48,48 +45,53 @@ object SteamIntegration {
|
||||
private fun restrictedSettings(context: Context): Boolean {
|
||||
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.TIRAMISU) return false
|
||||
val mode = runCatching {
|
||||
val uid = context.packageManager.getApplicationInfo(Relay.PACKAGE, 0).uid
|
||||
context.getSystemService(android.app.AppOpsManager::class.java)
|
||||
.unsafeCheckOpNoThrow("android:access_restricted_settings", android.os.Process.myUid(), context.packageName)
|
||||
.unsafeCheckOpNoThrow("android:access_restricted_settings", uid, Relay.PACKAGE)
|
||||
}.getOrDefault(android.app.AppOpsManager.MODE_ALLOWED)
|
||||
return mode == android.app.AppOpsManager.MODE_ERRORED || mode == android.app.AppOpsManager.MODE_IGNORED
|
||||
}
|
||||
|
||||
private fun shortcutsComponent(context: Context) = ComponentName(context, HomeButtonService::class.java)
|
||||
private val shortcutsComponent = ComponentName(Relay.PACKAGE, Relay.SERVICE)
|
||||
|
||||
fun shortcutsChosen(context: Context): Boolean = shortcutsSelection(context) == true
|
||||
|
||||
private fun shortcutsSelection(context: Context): Boolean? {
|
||||
val target = shortcutsComponent(context)
|
||||
fun shortcutsEnabled(context: Context): Boolean {
|
||||
val enabled = runCatching {
|
||||
Settings.Secure.getString(context.contentResolver, Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES)
|
||||
}.getOrElse { return null }.orEmpty()
|
||||
return enabled.split(':').any { ComponentName.unflattenFromString(it.trim()) == target }
|
||||
}.getOrNull().orEmpty()
|
||||
return enabled.split(':').any { ComponentName.unflattenFromString(it.trim()) == shortcutsComponent }
|
||||
}
|
||||
|
||||
fun setShortcutsListed(context: Context, listed: Boolean) {
|
||||
fun shortcutsListed(context: Context): Boolean =
|
||||
context.getSystemService(android.view.accessibility.AccessibilityManager::class.java)
|
||||
?.installedAccessibilityServiceList.orEmpty()
|
||||
.any { ComponentName(it.resolveInfo.serviceInfo.packageName, it.resolveInfo.serviceInfo.name) == shortcutsComponent }
|
||||
|
||||
fun bundledShortcuts(context: Context): File {
|
||||
val target = File(context.cacheDir, SHORTCUTS_ASSET)
|
||||
context.assets.open(SHORTCUTS_ASSET).use { input -> target.outputStream().use { input.copyTo(it) } }
|
||||
return target
|
||||
}
|
||||
|
||||
fun shortcutsInstalled(context: Context, bundled: File): Boolean {
|
||||
val packages = context.packageManager
|
||||
val component = shortcutsComponent(context)
|
||||
val state = if (listed) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
||||
runCatching {
|
||||
if (packages.getComponentEnabledSetting(component) != state) {
|
||||
packages.setComponentEnabledSetting(component, state, PackageManager.DONT_KILL_APP)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun syncShortcutsListing(context: Context) {
|
||||
shortcutsSelection(context)?.let { setShortcutsListed(context, it) }
|
||||
@Suppress("DEPRECATION")
|
||||
val installed = runCatching { packages.getPackageInfo(Relay.PACKAGE, 0).versionCode }.getOrNull() ?: return false
|
||||
@Suppress("DEPRECATION")
|
||||
val shipped = packages.getPackageArchiveInfo(bundled.absolutePath, 0)?.versionCode ?: return true
|
||||
return installed >= shipped
|
||||
}
|
||||
|
||||
fun dismissSuggestion(context: Context) {
|
||||
SessionPrefs.sessionPrefs(context).edit().putBoolean("steam_integration_seen", true).apply()
|
||||
}
|
||||
|
||||
fun shortcutsAppInfo() = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:${Relay.PACKAGE}"))
|
||||
|
||||
fun brightnessSettings(context: Context) = Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS,
|
||||
Uri.parse("package:${context.packageName}"))
|
||||
|
||||
fun shortcutSettings(context: Context): Intent {
|
||||
val service = ComponentName(context, HomeButtonService::class.java).flattenToString()
|
||||
val service = shortcutsComponent.flattenToString()
|
||||
return Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)
|
||||
.putExtra(":settings:fragment_args_key", service)
|
||||
.putExtra(":settings:show_fragment_args", android.os.Bundle().apply { putString(":settings:fragment_args_key", service) })
|
||||
|
||||
@@ -112,6 +112,10 @@ private const val HISTORY_LIMIT = 50
|
||||
internal fun canNavigateUp(currentDir: File, currentRoot: File): Boolean =
|
||||
currentDir != currentRoot && currentDir.parentFile?.exists() == true
|
||||
|
||||
// Back leaves after a drive hop instead of replaying a stack of hops one press at a time.
|
||||
internal fun backExitsAtRootHop(currentDir: File, currentRoot: File, previous: Pair<File, File>): Boolean =
|
||||
currentDir == currentRoot && previous.first == previous.second
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun FileManagerScreen(
|
||||
@@ -269,8 +273,10 @@ fun FileManagerScreen(
|
||||
if (showFavorites) showFavorites = false
|
||||
else {
|
||||
while (history.isNotEmpty() && !history.last().first.isDirectory) history.removeAt(history.lastIndex)
|
||||
val previous = history.removeLastOrNull()
|
||||
if (previous != null) {
|
||||
val previous = history.lastOrNull()
|
||||
if (previous != null && backExitsAtRootHop(currentDir, currentRoot, previous)) onExit?.invoke()
|
||||
else if (previous != null) {
|
||||
history.removeLastOrNull()
|
||||
currentRoot = previous.second
|
||||
loadDirectory(previous.first, record = false)
|
||||
} else if (canNavigateUp(currentDir, currentRoot)) currentDir.parentFile?.let { loadDirectory(it, record = false) }
|
||||
|
||||
@@ -43,11 +43,14 @@ object GameFileSync {
|
||||
val storageSetting = SessionPrefs.gameStorage(context)
|
||||
val previousStorage = prefs(context).getString("storagePath", null)
|
||||
if (storageSetting.isEmpty() && prefs(context).getString("storageSetting", null) == storageSetting && previousStorage != null) {
|
||||
check(File(previousStorage).isDirectory) { context.getString(R.string.game_sync_err_previous_sd) }
|
||||
check(libraryReadable(File(previousStorage))) { context.getString(R.string.game_sync_err_previous_sd) }
|
||||
}
|
||||
storage?.let { check(File(it.path).listFiles() != null) { context.getString(R.string.game_sync_err_game_storage) } }
|
||||
storage?.let { check(libraryReadable(File(it.path))) { context.getString(R.string.game_sync_err_game_storage) } }
|
||||
AddedGames.roots(context).forEach { check(it.host.listFiles() != null) { context.getString(R.string.game_sync_err_added_games) } }
|
||||
GameFiles.sync(context, folder, Library.launchableGames(context, strictRead = true))
|
||||
prefs(context).edit().putString("storageSetting", storageSetting).putString("storagePath", storage?.path).apply()
|
||||
}
|
||||
|
||||
internal fun libraryReadable(dir: File): Boolean =
|
||||
dir.listFiles() != null || (!dir.exists() && dir.parentFile?.isDirectory == true)
|
||||
}
|
||||
@@ -563,7 +563,7 @@ object Glasses {
|
||||
val device = selected?.first
|
||||
val m = selected?.second
|
||||
val controllable = m?.let(::canOpenModel) == true
|
||||
val permitted = controllable && device != null && (m === XrealModel || usb.hasPermission(device))
|
||||
val permitted = controllable && device != null && (m is XrealModel || usb.hasPermission(device))
|
||||
val identity = device?.let {
|
||||
GlassesModeState.Device(it.productId, if (permitted) runCatching { it.serialNumber }.getOrNull() else null)
|
||||
}
|
||||
@@ -614,9 +614,9 @@ object Glasses {
|
||||
sbs = sbsByDisplay,
|
||||
switching3d = modeState.pendingStereo,
|
||||
brightnessMax = m?.brightnessMax ?: 8, volumeMax = m?.volumeMax ?: 8,
|
||||
sunblock = if (m === XrealModel) it.sunblock else _settings.value.sunblock ?: it.sunblock,
|
||||
sunblock = if (m is XrealModel) it.sunblock else _settings.value.sunblock ?: it.sunblock,
|
||||
hardwareControls = m?.hardwareControls == true &&
|
||||
(device?.vendorId == VitureProtocol.VENDOR_ID || m === XrealModel || m is RokidModel),
|
||||
(device?.vendorId == VitureProtocol.VENDOR_ID || m is XrealModel || m is RokidModel),
|
||||
supportsDisplayModeControl = m?.supportsDisplayModeControl == true,
|
||||
hasSunblock = m?.hasSunblock == true,
|
||||
diagonalFovDeg = m?.diagonalFovDeg ?: 46f,
|
||||
@@ -624,7 +624,7 @@ object Glasses {
|
||||
noSignal = noSignal,
|
||||
sbs90 = m?.sbs90 == true,
|
||||
rates2d = m?.rates2d ?: listOf(60, 90, 120),
|
||||
experimental = m === XrealModel || (m is VitureProtocol.Model && m.family == VitureProtocol.Family.PRO2 && !m.needsSdk),
|
||||
experimental = m is XrealModel || (m is VitureProtocol.Model && m.family == VitureProtocol.Family.PRO2 && !m.needsSdk),
|
||||
supportsScreen3dof = link?.hasImu == true,
|
||||
supports30Hz = display?.let(::supports30Hz) == true,
|
||||
supportsSpatial = (link as? VitureSdkLink)?.isCarina == true,
|
||||
@@ -660,8 +660,8 @@ object Glasses {
|
||||
else VitureSdk.marketName(device.productId)?.let(VitureProtocol::sdkModel)
|
||||
?: VitureProtocol.model(device.productId, name)
|
||||
}
|
||||
else if (XrealModel.matches(device.vendorId, device.productId)) XrealModel
|
||||
else RokidModel.model(device.vendorId, device.productId, name)
|
||||
else XrealModel.model(device.vendorId, device.productId)
|
||||
?: RokidModel.model(device.vendorId, device.productId, name)
|
||||
?: RayNeoModel.model(device.vendorId, device.productId, name)
|
||||
}
|
||||
|
||||
@@ -729,8 +729,8 @@ object Glasses {
|
||||
VitureSdkLink.open(usb, device, File(app.noBackupFilesDir, "viture"), sdkListener(generation),
|
||||
(model as? VitureProtocol.Model)?.family, spatial)
|
||||
} else VitureLink.open(usb, device, linkListener(generation))
|
||||
} else if (model === XrealModel) {
|
||||
XrealLink.open(app, xrealListener(generation))
|
||||
} else if (model is XrealModel) {
|
||||
XrealLink.open(app, model as XrealModel, xrealListener(generation))
|
||||
} else if (model is RokidModel) {
|
||||
RokidLink.open(usb, device, rokidListener(generation))
|
||||
} else {
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.concurrent.atomic.AtomicReference
|
||||
internal class XrealLink internal constructor(
|
||||
private val connector: XrealConnector,
|
||||
private val listener: Listener,
|
||||
private val model: XrealModel = XrealModel.ONE_S,
|
||||
) : GlassesLink {
|
||||
interface Listener {
|
||||
fun onReady()
|
||||
@@ -29,7 +30,8 @@ internal class XrealLink internal constructor(
|
||||
private val worker = Thread(::run, "xreal-control").apply { isDaemon = true; start() }
|
||||
|
||||
companion object {
|
||||
fun open(context: Context, listener: Listener) = XrealLink(AndroidXrealConnector(context), listener)
|
||||
fun open(context: Context, model: XrealModel, listener: Listener) =
|
||||
XrealLink(AndroidXrealConnector(context), listener, model)
|
||||
}
|
||||
|
||||
override fun send(msgId: Int, payload: ByteArray): Boolean {
|
||||
@@ -43,9 +45,10 @@ internal class XrealLink internal constructor(
|
||||
if (msgId == VitureProtocol.MSG_GET_IMU) return true
|
||||
val valid = when (msgId) {
|
||||
VitureProtocol.MSG_GET_DISPLAY -> true
|
||||
VitureProtocol.MSG_DISPLAY -> value in 2..5 || value == XrealModel.NATIVE_60HZ
|
||||
VitureProtocol.MSG_BRIGHTNESS -> value in 0..9
|
||||
VitureProtocol.MSG_FILM -> value in 0..1
|
||||
VitureProtocol.MSG_DISPLAY -> if (model.stereoOnlyControl) value == 5 || value == XrealModel.NATIVE_60HZ
|
||||
else value in 2..5 || value == XrealModel.NATIVE_60HZ
|
||||
VitureProtocol.MSG_BRIGHTNESS -> !model.stereoOnlyControl && value in 0..9
|
||||
VitureProtocol.MSG_FILM -> !model.stereoOnlyControl && value in 0..1
|
||||
else -> false
|
||||
}
|
||||
return valid && commands.offer(Command(msgId, value))
|
||||
@@ -61,12 +64,12 @@ internal class XrealLink internal constructor(
|
||||
channels = connector.connect()
|
||||
connection.set(channels)
|
||||
if (!running) break
|
||||
val control = XrealControl(channels)
|
||||
val control = XrealControl(channels, stereoOnly = model.stereoOnlyControl)
|
||||
listener.onValue(VitureProtocol.MSG_GET_DISPLAY, control.display())
|
||||
val current = channels
|
||||
reports = Thread({
|
||||
try {
|
||||
var filter = XrealOrientationFilter()
|
||||
var filter = XrealOrientationFilter(model.flipsYz)
|
||||
var wasTracking = false
|
||||
var lastSensor = System.nanoTime()
|
||||
while (running && connection.get() === current) {
|
||||
@@ -75,7 +78,7 @@ internal class XrealLink internal constructor(
|
||||
if (sample != null) {
|
||||
lastSensor = System.nanoTime()
|
||||
val enabled = tracking
|
||||
if (enabled && !wasTracking) filter = XrealOrientationFilter()
|
||||
if (enabled && !wasTracking) filter = XrealOrientationFilter(model.flipsYz)
|
||||
wasTracking = enabled
|
||||
if (enabled) filter.update(sample)?.let {
|
||||
if (running && ready && tracking && connection.get() === current)
|
||||
@@ -149,7 +152,11 @@ internal class XrealLink internal constructor(
|
||||
}
|
||||
}
|
||||
|
||||
internal class XrealControl(private val channels: XrealChannels, private val settleDelayMs: Long = 150) {
|
||||
internal class XrealControl(
|
||||
private val channels: XrealChannels,
|
||||
private val settleDelayMs: Long = 150,
|
||||
private val stereoOnly: Boolean = false,
|
||||
) {
|
||||
private var transaction = 0
|
||||
private fun exchange(command: Int, value: Int? = null): ByteArray {
|
||||
transaction = if (transaction == Int.MAX_VALUE) 1 else transaction + 1
|
||||
@@ -163,26 +170,42 @@ internal class XrealControl(private val channels: XrealChannels, private val set
|
||||
throw IOException("XREAL control response was not received")
|
||||
}
|
||||
fun display(): Int {
|
||||
if (stereoOnly) return stereoDisplay()
|
||||
val reply = exchange(XrealProtocol.GET_DISPLAY)
|
||||
return XrealProtocol.numeric(reply)?.takeIf { it in 2..5 || it == XrealModel.NATIVE_60HZ }
|
||||
?: throw IOException("Unsupported XREAL display response: ${reply.take(32).joinToString("") { "%02x".format(it) }}")
|
||||
}
|
||||
private fun stereoDisplay(): Int {
|
||||
val reply = exchange(XrealProtocol.GET_INPUT)
|
||||
return when {
|
||||
XrealProtocol.acknowledged(reply) -> XrealModel.NATIVE_60HZ
|
||||
else -> when (XrealProtocol.numeric(reply)) {
|
||||
0 -> XrealModel.NATIVE_60HZ
|
||||
1 -> 5
|
||||
else -> throw IOException("Unsupported XREAL stereo response: ${reply.take(32).joinToString("") { "%02x".format(it) }}")
|
||||
}
|
||||
}
|
||||
}
|
||||
fun changeDisplay(mode: Int): Int {
|
||||
val stereo = mode == 5
|
||||
set(XrealProtocol.SET_INPUT, if (stereo) 1 else 0)
|
||||
val current = awaitDisplay { (it == 5) == stereo }
|
||||
if (current == mode) return current
|
||||
if (current == mode || stereoOnly) return current
|
||||
set(XrealProtocol.SET_DISPLAY, mode)
|
||||
return awaitDisplay { it == mode }
|
||||
}
|
||||
private fun awaitDisplay(matches: (Int) -> Boolean): Int {
|
||||
val deadline = System.nanoTime() + 8_000_000_000L
|
||||
repeat(40) {
|
||||
val reply = exchange(XrealProtocol.GET_DISPLAY)
|
||||
val value = XrealProtocol.numeric(reply)
|
||||
if (value != null && matches(value)) return value
|
||||
if (value == null && !XrealProtocol.acknowledged(reply))
|
||||
throw IOException("Invalid XREAL display transition response")
|
||||
if (stereoOnly) {
|
||||
stereoDisplay().let { if (matches(it)) return it }
|
||||
} else {
|
||||
val reply = exchange(XrealProtocol.GET_DISPLAY)
|
||||
val value = XrealProtocol.numeric(reply)
|
||||
if (value != null && matches(value)) return value
|
||||
if (value == null && !XrealProtocol.acknowledged(reply))
|
||||
throw IOException("Invalid XREAL display transition response")
|
||||
}
|
||||
if (System.nanoTime() > deadline) throw IOException("XREAL display transition timed out")
|
||||
Thread.sleep(settleDelayMs)
|
||||
}
|
||||
|
||||
@@ -1,25 +1,63 @@
|
||||
package com.droiddeck.launcher.glasses
|
||||
|
||||
object XrealModel : GlassesModel {
|
||||
const val VENDOR_ID = 0x3318
|
||||
const val PRODUCT_1S = 0x043e
|
||||
const val NATIVE_60HZ = 29
|
||||
override val name = "XREAL 1S"
|
||||
internal class XrealModel private constructor(
|
||||
override val name: String,
|
||||
val family: Family,
|
||||
override val diagonalFovDeg: Float,
|
||||
) : GlassesModel {
|
||||
enum class Family {
|
||||
ONE_S,
|
||||
ONE,
|
||||
AURA,
|
||||
}
|
||||
|
||||
override val controllable = true
|
||||
override val brightnessMax = 9
|
||||
override val volumeMax = 0
|
||||
override val hasSunblock = true
|
||||
override val diagonalFovDeg = 52f
|
||||
override val hasSunblock get() = family == Family.ONE_S
|
||||
override val hardwareControls get() = family == Family.ONE_S
|
||||
override val sbs90 = false
|
||||
override val rates2d get() = if (family == Family.ONE_S) super.rates2d else listOf(60)
|
||||
|
||||
fun matches(vid: Int, pid: Int) = vid == VENDOR_ID && pid == PRODUCT_1S
|
||||
fun isDisplay(name: String) = name.contains("XREAL", ignoreCase = true)
|
||||
// Only the 1S has been exercised with SET_DISPLAY; the Aura is known to reboot on an unexpected index.
|
||||
val stereoOnlyControl get() = family != Family.ONE_S
|
||||
|
||||
// The Aura reports x right, y up, z back; the rest of the One family is a half turn about x from it.
|
||||
val flipsYz get() = family != Family.AURA
|
||||
|
||||
override fun mode(hz: Int, sbs: Boolean) = when {
|
||||
sbs -> 5
|
||||
stereoOnlyControl -> NATIVE_60HZ
|
||||
hz >= 120 -> 4
|
||||
hz >= 90 -> 3
|
||||
else -> NATIVE_60HZ
|
||||
}
|
||||
override fun modeForStep(step: Int): Int? = null
|
||||
|
||||
override fun toString() = name
|
||||
|
||||
companion object {
|
||||
const val VENDOR_ID = 0x3318
|
||||
const val PRODUCT_1S = 0x043e
|
||||
const val NATIVE_60HZ = 29
|
||||
|
||||
val ONE_S = XrealModel("XREAL 1S", Family.ONE_S, 52f)
|
||||
val ONE = XrealModel("XREAL One", Family.ONE, 50f)
|
||||
val ONE_PRO = XrealModel("XREAL One Pro", Family.ONE, 57f)
|
||||
val ONE_PRO_PLUS = XrealModel("XREAL One Pro+", Family.ONE, 57f)
|
||||
val AURA = XrealModel("XREAL Aura", Family.AURA, 70f)
|
||||
|
||||
// The odd product ids one below these are the glasses' recovery mode.
|
||||
private val products = mapOf(
|
||||
PRODUCT_1S to ONE_S,
|
||||
0x0438 to ONE,
|
||||
0x0436 to ONE_PRO,
|
||||
0x0444 to ONE_PRO_PLUS,
|
||||
0x043a to AURA,
|
||||
)
|
||||
|
||||
fun model(vid: Int, pid: Int): XrealModel? = if (vid == VENDOR_ID) products[pid] else null
|
||||
fun matches(vid: Int, pid: Int) = model(vid, pid) != null
|
||||
fun isDisplay(name: String) = name.contains("XREAL", ignoreCase = true)
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,13 @@ package com.droiddeck.launcher.glasses
|
||||
|
||||
import kotlin.math.abs
|
||||
|
||||
internal class XrealOrientationFilter {
|
||||
internal class XrealOrientationFilter(private val flipYz: Boolean = true) {
|
||||
private val fusion = ImuFusion()
|
||||
|
||||
fun update(sample: XrealProtocol.Sample): FloatArray? = fusion.update(sample.timeNs,
|
||||
Vec3(sample.accel.x, -sample.accel.y, -sample.accel.z),
|
||||
Vec3(sample.gyro.x, -sample.gyro.y, -sample.gyro.z))
|
||||
sample.accel.headAxes(), sample.gyro.headAxes())
|
||||
|
||||
private fun Vec3.headAxes() = if (flipYz) Vec3(x, -y, -z) else this
|
||||
}
|
||||
|
||||
internal class ImuFusion {
|
||||
|
||||
@@ -13,6 +13,7 @@ internal object XrealProtocol {
|
||||
const val REPORT = 0x2836
|
||||
const val GET_DISPLAY = 0x275e
|
||||
const val SET_DISPLAY = 0x275f
|
||||
const val GET_INPUT = 0x2821
|
||||
const val SET_INPUT = 0x2822
|
||||
const val SET_BRIGHTNESS = 0x271c
|
||||
const val SET_DIMMER = 0x2727
|
||||
|
||||
@@ -145,16 +145,22 @@ object DeviceInfo {
|
||||
private fun drivers(context: Context, gpu: GpuInfo) = Section("Drivers DroidDeck uses", buildList<Pair<String, String>> {
|
||||
add("Driver mode", SessionPrefs.gpuDriverMode(context))
|
||||
val turnip = TurnipDriver(context)
|
||||
val choice = SessionPrefs.androidDriver(context).ifEmpty { turnip.autoId() }
|
||||
val choice = turnip.effectiveId()
|
||||
val powerVr = gpu.family == GpuInfo.Family.POWERVR
|
||||
add("Display driver", if (choice == "system") builtinDriverLabel(powerVr, runtime = false)
|
||||
else "${turnip.displayName(choice)} ${turnip.driverVersion(choice)}".trim())
|
||||
val linux = LinuxVulkanDriverManager(context)
|
||||
val id = SessionPrefs.linuxDriver(context)
|
||||
add("Game driver", if (id.isEmpty()) builtinDriverLabel(powerVr, runtime = true) else "${linux.getDriverName(id)} ${linux.getDriverVersion(id)}".trim())
|
||||
add("Game driver", hostRoute(context) ?: if (id.isEmpty()) builtinDriverLabel(powerVr, runtime = true) else "${linux.getDriverName(id)} ${linux.getDriverVersion(id)}".trim())
|
||||
if (gpu.oneUi8Gen2) add("Note", "One UI on an 8 Gen 2: needs the OneUI Turnip build")
|
||||
})
|
||||
|
||||
internal fun hostRoute(context: Context): String? = when {
|
||||
com.droiddeck.launcher.session.VenusComponent.wanted(context) -> "Mali (Venus)"
|
||||
com.droiddeck.launcher.core.DeviceSupport.vkBridge(context) -> "the Mali bridge"
|
||||
else -> null
|
||||
}
|
||||
|
||||
/** Shared by the device card and the session report, which are written in English. */
|
||||
internal fun builtinDriverLabel(powerVr: Boolean, runtime: Boolean): String = when {
|
||||
powerVr -> "System PowerVR"
|
||||
|
||||
@@ -34,6 +34,8 @@ public final class TurnipDriver {
|
||||
public static final List<String> BUNDLED = Collections.unmodifiableList(Arrays.asList(
|
||||
DRIVER_A7XX, DRIVER_A8XX, com.droiddeck.launcher.session.QuestExperimental.DRIVER,
|
||||
DRIVER_A6XX, com.droiddeck.launcher.session.QuestExperimental.DRIVER_A6XX));
|
||||
private static final String KGSL_NODE = "/dev/kgsl-3d0";
|
||||
private static final String KGSL_SYSFS = "/sys/class/kgsl/kgsl-3d0";
|
||||
private static final String OVERRIDE_FILE = "Download/droiddeck-driver";
|
||||
private static final String PREFS = "graphics_driver";
|
||||
private static final String KEY_HIDDEN = "hiddenBundled";
|
||||
@@ -140,6 +142,25 @@ public final class TurnipDriver {
|
||||
return id == null ? "system" : id;
|
||||
}
|
||||
|
||||
public String effectiveId() {
|
||||
String id = choose();
|
||||
return id == null || !reachesGpu(id) ? "system" : id;
|
||||
}
|
||||
|
||||
public boolean reachesGpu(String driverId) {
|
||||
String library = libraryName(driverId);
|
||||
return library == null || !needsMissingKgsl(new File(new File(contentDir, driverId), library),
|
||||
kgslPresent(new File(KGSL_NODE), new File(KGSL_SYSFS)));
|
||||
}
|
||||
|
||||
static boolean kgslPresent(File node, File sysfs) {
|
||||
return node.exists() || sysfs.exists();
|
||||
}
|
||||
|
||||
static boolean needsMissingKgsl(File library, boolean kgsl) {
|
||||
return !kgsl && library.isFile() && LinuxVulkanDriverManager.containsAscii(library, KGSL_NODE);
|
||||
}
|
||||
|
||||
public void remove(String driverId) {
|
||||
if (driverId == null || driverId.isEmpty() || BUNDLED.contains(driverId)
|
||||
|| driverId.contains("/") || driverId.contains("..")) return;
|
||||
@@ -257,6 +278,11 @@ public final class TurnipDriver {
|
||||
Log.e(TAG, id + " unpacked without " + library);
|
||||
return null;
|
||||
}
|
||||
if (!reachesGpu(id)) {
|
||||
Log.w(TAG, id + " needs " + KGSL_NODE + ", which this GPU does not have; display on the system Vulkan loader");
|
||||
DriverSetupLog.write(context, "install.no-kgsl driver=" + id);
|
||||
return null;
|
||||
}
|
||||
Log.i(TAG, "graphics driver " + id + " (" + library + ")");
|
||||
DriverSetupLog.write(context, "install.ready driver=" + id + " library=" + library);
|
||||
return id;
|
||||
@@ -282,6 +308,12 @@ public final class TurnipDriver {
|
||||
}
|
||||
}
|
||||
if (chosen != null && !chosen.isEmpty()) {
|
||||
if (SessionPrefs.GPU_DRIVERS_AUTO.equals(SessionPrefs.INSTANCE.gpuDriverMode(context))
|
||||
&& SessionPrefs.INSTANCE.gpuAutoInstalled(context).contains(chosen)
|
||||
&& gpuDetector.get().getFamily() == GpuInfo.Family.A7XX_LOW) {
|
||||
Log.i(TAG, "Auto-selected display driver does not cover Adreno 710/720/722; leaving the display driver to the system");
|
||||
return null;
|
||||
}
|
||||
if (BUNDLED.contains(chosen)) {
|
||||
Log.i(TAG, "driver pinned by the user: " + chosen);
|
||||
return chosen;
|
||||
@@ -318,6 +350,10 @@ public final class TurnipDriver {
|
||||
Log.i(TAG, "not an Adreno GPU; leaving the display driver to the system");
|
||||
return null;
|
||||
}
|
||||
if (gpu.getFamily() == GpuInfo.Family.A7XX_LOW) {
|
||||
Log.i(TAG, "no bundled display driver covers Adreno 710/720/722; leaving the display driver to the system");
|
||||
return null;
|
||||
}
|
||||
int model = gpu.getModel();
|
||||
Log.i(TAG, "gpu model: " + (model == 0 ? "unknown" : model));
|
||||
return chooseByModel(model, android.os.Build.VERSION.SDK_INT);
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import android.accessibilityservice.AccessibilityService
|
||||
import android.accessibilityservice.AccessibilityServiceInfo
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.graphics.Rect
|
||||
import android.hardware.display.DisplayManager
|
||||
import android.os.Build
|
||||
import android.os.Handler
|
||||
@@ -12,9 +10,9 @@ import android.os.HandlerThread
|
||||
import android.os.SystemClock
|
||||
import android.util.Log
|
||||
import android.view.Display
|
||||
import android.view.accessibility.AccessibilityEvent
|
||||
import android.view.accessibility.AccessibilityWindowInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import com.droiddeck.shortcuts.Relay
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
object BottomScreenGuests {
|
||||
@@ -45,7 +43,7 @@ object BottomScreenGuests {
|
||||
sdk >= 33 && DualScreen.yieldsBottom(model)
|
||||
}
|
||||
|
||||
class BottomScreenWatch(private val service: AccessibilityService) {
|
||||
class BottomScreenWatch(private val service: Context) {
|
||||
private class Arrival(val pkg: String, val at: Long)
|
||||
|
||||
private val thread = HandlerThread("bottom-screen").apply { start() }
|
||||
@@ -57,33 +55,22 @@ class BottomScreenWatch(private val service: AccessibilityService) {
|
||||
private var holders: Map<Int, String?> = emptyMap()
|
||||
private var ownWindows: Map<Int, Set<Int>> = emptyMap()
|
||||
private val ownShownAt = mutableMapOf<Int, Long>()
|
||||
private val check = Runnable { evaluate() }
|
||||
|
||||
fun start() {
|
||||
current = this
|
||||
service.serviceInfo = service.serviceInfo?.apply {
|
||||
eventTypes = eventTypes or AccessibilityEvent.TYPE_WINDOWS_CHANGED or AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
|
||||
flags = flags or AccessibilityServiceInfo.FLAG_RETRIEVE_INTERACTIVE_WINDOWS
|
||||
}
|
||||
handler.post {
|
||||
homes = homePackages()
|
||||
keyboards = keyboardPackages()
|
||||
evaluate()
|
||||
}
|
||||
}
|
||||
|
||||
fun onEvent(event: AccessibilityEvent) {
|
||||
when (event.eventType) {
|
||||
AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED -> {
|
||||
val pkg = event.packageName?.toString() ?: return
|
||||
if (event.displayId == Display.DEFAULT_DISPLAY || pkg == own || pkg == SYSTEM_UI) return
|
||||
arrivals[event.displayId] = Arrival(pkg, event.eventTime)
|
||||
}
|
||||
AccessibilityEvent.TYPE_WINDOWS_CHANGED -> Unit
|
||||
else -> return
|
||||
}
|
||||
handler.removeCallbacks(check)
|
||||
handler.postDelayed(check, 150)
|
||||
fun onArrival(displayId: Int, pkg: String, at: Long) {
|
||||
if (displayId == Display.DEFAULT_DISPLAY || pkg == own || pkg == SYSTEM_UI) return
|
||||
arrivals[displayId] = Arrival(pkg, at)
|
||||
}
|
||||
|
||||
fun onWindows(all: Map<Int, List<Relay.Window>>) {
|
||||
handler.post { evaluate(all) }
|
||||
}
|
||||
|
||||
fun stop() {
|
||||
@@ -97,25 +84,22 @@ class BottomScreenWatch(private val service: AccessibilityService) {
|
||||
thread.quitSafely()
|
||||
}
|
||||
|
||||
private fun evaluate() {
|
||||
private fun evaluate(all: Map<Int, List<Relay.Window>>) {
|
||||
val seen = HashMap(arrivals)
|
||||
val all = runCatching { service.windowsOnAllDisplays }.getOrNull() ?: return
|
||||
val displays = service.getSystemService(DisplayManager::class.java) ?: return
|
||||
val taken = mutableMapOf<Int, String?>()
|
||||
val shown = mutableMapOf<Int, Set<Int>>()
|
||||
val now = SystemClock.uptimeMillis()
|
||||
for (i in 0 until all.size()) {
|
||||
val id = all.keyAt(i)
|
||||
for ((id, list) in all) {
|
||||
if (id == Display.DEFAULT_DISPLAY) continue
|
||||
val display = displays.getDisplay(id)?.takeIf(DualScreen::builtIn) ?: continue
|
||||
val windows = all.valueAt(i)
|
||||
val windows = list
|
||||
.filter { !BottomScreenGuests.ignorable(it.type) && cover(it, display) >= BottomScreenGuests.MIN_COVER }
|
||||
.sortedByDescending { it.layer }
|
||||
.map { it to packageOf(it) }
|
||||
val ours = windows.filter { it.second == own }.map { it.first.id }.toSet()
|
||||
val ours = windows.filter { it.pkg == own }.map { it.id }.toSet()
|
||||
if (!ownWindows[id].orEmpty().containsAll(ours)) ownShownAt[id] = now
|
||||
shown[id] = ours
|
||||
val topPkg = windows.firstNotNullOfOrNull { it.second?.takeUnless { pkg -> pkg == own } }
|
||||
val topPkg = windows.firstNotNullOfOrNull { it.pkg?.takeUnless { pkg -> pkg == own } }
|
||||
val arrival = seen[id]?.takeIf { BottomScreenGuests.current(it.at, ownShownAt[id]) }
|
||||
seen[id]?.takeIf { topPkg != null || arrival == null }?.let { arrivals.remove(id, it) }
|
||||
BottomScreenGuests.holder(topPkg, arrival?.pkg?.takeUnless { it in keyboards }, homes)?.let { taken[id] = it }
|
||||
@@ -127,15 +111,11 @@ class BottomScreenWatch(private val service: AccessibilityService) {
|
||||
DualScreen.setTaken(taken.keys)
|
||||
}
|
||||
|
||||
private fun cover(window: AccessibilityWindowInfo, display: Display): Float {
|
||||
val bounds = Rect().also(window::getBoundsInScreen)
|
||||
private fun cover(window: Relay.Window, display: Display): Float {
|
||||
val area = display.mode.physicalWidth.toFloat() * display.mode.physicalHeight
|
||||
return if (area <= 0f) 0f else bounds.width().toFloat() * bounds.height() / area
|
||||
return if (area <= 0f) 0f else window.bounds.width().toFloat() * window.bounds.height() / area
|
||||
}
|
||||
|
||||
private fun packageOf(window: AccessibilityWindowInfo): String? =
|
||||
runCatching { window.getRoot(0)?.packageName?.toString() }.getOrNull()
|
||||
|
||||
private fun homePackages(): Set<String> {
|
||||
val pm = service.packageManager
|
||||
return listOf(Intent.CATEGORY_HOME, Intent.CATEGORY_SECONDARY_HOME).flatMap { category ->
|
||||
@@ -154,6 +134,7 @@ class BottomScreenWatch(private val service: AccessibilityService) {
|
||||
|
||||
private companion object {
|
||||
@Volatile var current: BottomScreenWatch? = null
|
||||
|
||||
const val TAG = "BottomScreen"
|
||||
const val SYSTEM_UI = "com.android.systemui"
|
||||
}
|
||||
|
||||
@@ -82,6 +82,8 @@ public class FakeInputWriter {
|
||||
private static final int PAD_TYPE_OFFSET = IMU_OFFSET + 44;
|
||||
private static final int PAD_TYPE_SET = 0x80000000;
|
||||
private static final int LATENCY_OFFSET = IMU_OFFSET + 48;
|
||||
private static final int REMOTE_IMU_MODE_OFFSET = IMU_OFFSET + 52;
|
||||
private static final int REMOTE_IMU_PID_OFFSET = IMU_OFFSET + 56;
|
||||
public static final int LATENCY_CONTROLLER = 1;
|
||||
public static final int LATENCY_TOUCH = 2;
|
||||
private static volatile int latency = 0;
|
||||
@@ -231,6 +233,8 @@ public class FakeInputWriter {
|
||||
}
|
||||
data.putInt(IMU_OFFSET, 0);
|
||||
data.putInt(IMU_MODE_OFFSET, 0);
|
||||
data.putInt(REMOTE_IMU_MODE_OFFSET, 0);
|
||||
data.putInt(REMOTE_IMU_PID_OFFSET, 0);
|
||||
data.putLong(IMU_SEQ_OFFSET, 0L);
|
||||
for (int i = 0; i < 12; i++) {
|
||||
data.putShort(IMU_ACCEL_OFFSET + (i * 2), (short) 0);
|
||||
@@ -494,8 +498,11 @@ public class FakeInputWriter {
|
||||
if (ringSlot == null) return -1;
|
||||
synchronized (ringSlot) {
|
||||
ByteBuffer ring = ringSlot.data;
|
||||
int value = ring == null ? 0 : ring.getInt(IMU_MODE_OFFSET);
|
||||
return value < 0 ? value & 0xffff : -1;
|
||||
if (ring == null) return 0;
|
||||
int remote = ring.getInt(REMOTE_IMU_MODE_OFFSET);
|
||||
int pid = ring.getInt(REMOTE_IMU_PID_OFFSET);
|
||||
return ImuModes.combine(ring.getInt(IMU_MODE_OFFSET), remote,
|
||||
remote < 0 && pid > 0 && new File("/proc/" + pid).exists());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
/** Where a USB mouse's input report keeps its buttons, motion and wheel, as its HID report descriptor lays them out. */
|
||||
class HidMouseReport(
|
||||
val reportId: Int,
|
||||
private val buttons: List<Field?>,
|
||||
private val x: Field,
|
||||
private val y: Field,
|
||||
private val wheel: Field?,
|
||||
) {
|
||||
class Field(private val bit: Int, private val size: Int, private val signed: Boolean) {
|
||||
fun read(report: ByteArray, length: Int, base: Int): Int {
|
||||
var value = 0
|
||||
for (i in 0 until minOf(size, 32)) {
|
||||
val at = base + bit + i
|
||||
if (at / 8 >= length) break
|
||||
if ((report[at / 8].toInt() shr (at % 8)) and 1 != 0) value = value or (1 shl i)
|
||||
}
|
||||
return if (signed && size in 1..31 && value and (1 shl (size - 1)) != 0) value - (1 shl size) else value
|
||||
}
|
||||
}
|
||||
|
||||
/** [buttons] has bit 0 set for the first button. */
|
||||
data class State(val buttons: Int, val dx: Int, val dy: Int, val wheel: Int)
|
||||
|
||||
/** Returns null for reports with another ID, such as a receiver's media keys. */
|
||||
fun decode(report: ByteArray, length: Int): State? {
|
||||
val base = if (reportId == 0) 0 else {
|
||||
if (length < 1 || (report[0].toInt() and 0xff) != reportId) return null
|
||||
8
|
||||
}
|
||||
var pressed = 0
|
||||
buttons.forEachIndexed { i, field -> if (field != null && field.read(report, length, base) != 0) pressed = pressed or (1 shl i) }
|
||||
return State(pressed, x.read(report, length, base), y.read(report, length, base), wheel?.read(report, length, base) ?: 0)
|
||||
}
|
||||
|
||||
companion object {
|
||||
/** The report every boot mouse sends after SET_PROTOCOL(boot): three buttons, then X and Y as signed bytes. */
|
||||
val BOOT = HidMouseReport(0, List(3) { Field(it, 1, false) }, Field(8, 8, true), Field(16, 8, true), null)
|
||||
|
||||
private const val BUTTON_PAGE = 0x09
|
||||
private const val MOUSE = 0x00010002
|
||||
private const val X = 0x00010030
|
||||
private const val Y = 0x00010031
|
||||
private const val WHEEL = 0x00010038
|
||||
private const val MAX_BUTTONS = 8
|
||||
private const val MAX_FIELD_BITS = 32
|
||||
private const val MAX_REPORT_COUNT = 4096
|
||||
|
||||
private class Global(var usagePage: Int = 0, var logicalMin: Int = 0, var reportSize: Int = 0,
|
||||
var reportCount: Int = 0, var reportId: Int = 0) {
|
||||
fun copy() = Global(usagePage, logicalMin, reportSize, reportCount, reportId)
|
||||
}
|
||||
|
||||
private class Placed(val reportId: Int, val field: Field)
|
||||
|
||||
/** Returns null if [descriptor] has no mouse collection with X and Y in one report. */
|
||||
fun parse(descriptor: ByteArray): HidMouseReport? {
|
||||
var global = Global()
|
||||
val pushed = ArrayDeque<Global>()
|
||||
val usages = mutableListOf<Int>()
|
||||
var usageMin = -1
|
||||
var usageMax = -1
|
||||
val offsets = HashMap<Int, Int>()
|
||||
var depth = 0
|
||||
var mouseDepth = -1
|
||||
var mouseDone = false
|
||||
val placed = HashMap<Int, Placed>()
|
||||
|
||||
fun usage(index: Int): Int = when {
|
||||
usages.isNotEmpty() -> usages.getOrElse(index) { usages.last() }
|
||||
usageMin >= 0 && usageMax >= usageMin -> minOf(usageMin + index, usageMax)
|
||||
else -> -1
|
||||
}
|
||||
|
||||
var i = 0
|
||||
while (i < descriptor.size) {
|
||||
val prefix = descriptor[i].toInt() and 0xff
|
||||
if (prefix == 0xfe) {
|
||||
if (i + 1 >= descriptor.size) break
|
||||
i += 3 + (descriptor[i + 1].toInt() and 0xff)
|
||||
continue
|
||||
}
|
||||
val size = intArrayOf(0, 1, 2, 4)[prefix and 3]
|
||||
if (i + 1 + size > descriptor.size) break
|
||||
var data = 0
|
||||
for (b in 0 until size) data = data or ((descriptor[i + 1 + b].toInt() and 0xff) shl (8 * b))
|
||||
val signedData = when (size) {
|
||||
1 -> data.toByte().toInt()
|
||||
2 -> data.toShort().toInt()
|
||||
else -> data
|
||||
}
|
||||
val tag = prefix shr 4
|
||||
when ((prefix shr 2) and 3) {
|
||||
0 -> {
|
||||
when (tag) {
|
||||
0x8 -> {
|
||||
if (global.reportSize !in 0..MAX_FIELD_BITS || global.reportCount !in 0..MAX_REPORT_COUNT) return null
|
||||
val start = offsets[global.reportId] ?: 0
|
||||
val isData = data and 1 == 0
|
||||
val isVariable = data and 2 != 0
|
||||
if (mouseDepth >= 0 && !mouseDone && isData && isVariable) {
|
||||
for (n in 0 until global.reportCount) {
|
||||
val u = usage(n)
|
||||
if (u < 0) break
|
||||
val field = Placed(global.reportId, Field(start + n * global.reportSize, global.reportSize, global.logicalMin < 0))
|
||||
val button = if (u ushr 16 == BUTTON_PAGE) u and 0xffff else 0
|
||||
when {
|
||||
u == X || u == Y || u == WHEEL -> placed.putIfAbsent(u, field)
|
||||
button in 1..MAX_BUTTONS -> placed.putIfAbsent(u, field)
|
||||
}
|
||||
}
|
||||
}
|
||||
offsets[global.reportId] = start + global.reportSize * global.reportCount
|
||||
}
|
||||
0xa -> {
|
||||
depth++
|
||||
if (mouseDepth < 0 && data == 1 && usage(0) == MOUSE) mouseDepth = depth
|
||||
}
|
||||
0xc -> {
|
||||
if (depth == mouseDepth) mouseDone = true
|
||||
depth--
|
||||
}
|
||||
}
|
||||
usages.clear()
|
||||
usageMin = -1
|
||||
usageMax = -1
|
||||
}
|
||||
1 -> when (tag) {
|
||||
0x0 -> global.usagePage = data
|
||||
0x1 -> global.logicalMin = signedData
|
||||
0x7 -> global.reportSize = data
|
||||
0x8 -> global.reportId = data
|
||||
0x9 -> global.reportCount = data
|
||||
0xa -> pushed.addLast(global.copy())
|
||||
0xb -> global = pushed.removeLastOrNull() ?: global
|
||||
}
|
||||
2 -> {
|
||||
val full = if (size == 4) data else (global.usagePage shl 16) or data
|
||||
when (tag) {
|
||||
0x0 -> usages += full
|
||||
0x1 -> usageMin = full
|
||||
0x2 -> usageMax = full
|
||||
}
|
||||
}
|
||||
}
|
||||
i += 1 + size
|
||||
}
|
||||
|
||||
val x = placed[X] ?: return null
|
||||
val y = placed[Y]?.takeIf { it.reportId == x.reportId } ?: return null
|
||||
val id = x.reportId
|
||||
val buttons = (1..MAX_BUTTONS).map { n -> placed[(BUTTON_PAGE shl 16) or n]?.takeIf { it.reportId == id }?.field }
|
||||
return HidMouseReport(id, buttons.dropLastWhile { it == null }, x.field, y.field,
|
||||
placed[WHEEL]?.takeIf { it.reportId == id }?.field)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.droiddeck.launcher.input;
|
||||
|
||||
final class ImuModes {
|
||||
private ImuModes() {}
|
||||
|
||||
// Steam and its Remote Play client each keep their own mode word, with the top bit set once written. Motion is
|
||||
// read while either process wants it, and a word that has not been set leaves the choice to the other one.
|
||||
// -1 means neither has set a mode yet.
|
||||
static int combine(int steam, int remote, boolean remoteRunning) {
|
||||
boolean remoteSet = remote < 0 && remoteRunning;
|
||||
if (steam >= 0 && !remoteSet) return -1;
|
||||
return ((steam < 0 ? steam : 0) | (remoteSet ? remote : 0)) & 0xffff;
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,16 @@ package com.droiddeck.launcher.input
|
||||
object InputSpace {
|
||||
const val WIDTH = 1920
|
||||
const val HEIGHT = 1080
|
||||
const val FIXED_ONE = 256
|
||||
|
||||
fun x(position: Float, viewWidth: Int): Int = scale(position, viewWidth, WIDTH)
|
||||
|
||||
fun y(position: Float, viewHeight: Int): Int = scale(position, viewHeight, HEIGHT)
|
||||
|
||||
fun fixedX(position: Float, viewWidth: Int): Int = scale(position, viewWidth, WIDTH * FIXED_ONE)
|
||||
|
||||
fun fixedY(position: Float, viewHeight: Int): Int = scale(position, viewHeight, HEIGHT * FIXED_ONE)
|
||||
|
||||
private fun scale(position: Float, extent: Int, size: Int): Int =
|
||||
if (extent <= 0) 0 else (position / extent * size).toInt().coerceIn(0, size - 1)
|
||||
}
|
||||
@@ -57,6 +57,16 @@ class MouseBackInput(private val sendRight: (Boolean) -> Unit, private val mouse
|
||||
!device.supportsSource(InputDevice.SOURCE_TOUCHSCREEN)
|
||||
}
|
||||
|
||||
/** A controller's own mouse interface (8BitDo Ultimate Mobile) is not a mouse the user right-clicks with. */
|
||||
fun externalMouse(devices: List<InputDevice?>): InputDevice? {
|
||||
val controllers = devices.filterNotNull().filter { PadBridge.isFromController(it) }
|
||||
return devices.filterNotNull().firstOrNull { mouse ->
|
||||
isExternalMouse(mouse) && controllers.none {
|
||||
it.vendorId != 0 && it.vendorId == mouse.vendorId && it.productId == mouse.productId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val VIRTUAL_NAME = Regex("\\bvirtual\\b", RegexOption.IGNORE_CASE)
|
||||
|
||||
fun declaresVirtual(name: String?): Boolean = name != null && VIRTUAL_NAME.containsMatchIn(name)
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import kotlin.math.abs
|
||||
|
||||
/**
|
||||
* Holding the middle button still opens the session menu. While the session reads the mouse over USB, Android has
|
||||
* no cursor, so this is how a mouse reaches the menu and, through it, the system again.
|
||||
*/
|
||||
class MouseMenuHold(
|
||||
private val schedule: (Runnable, Long) -> Unit,
|
||||
private val cancel: (Runnable) -> Unit,
|
||||
private val onMenu: () -> Unit,
|
||||
) {
|
||||
private var holding = false
|
||||
private var travel = 0
|
||||
private val fire = Runnable {
|
||||
if (!holding) return@Runnable
|
||||
holding = false
|
||||
onMenu()
|
||||
}
|
||||
|
||||
fun onButton(index: Int, down: Boolean) {
|
||||
if (index != MIDDLE) return
|
||||
cancel(fire)
|
||||
holding = down
|
||||
travel = 0
|
||||
if (down) schedule(fire, HOLD_MS)
|
||||
}
|
||||
|
||||
fun onMove(dx: Int, dy: Int) {
|
||||
if (!holding) return
|
||||
travel += abs(dx) + abs(dy)
|
||||
if (travel > SLOP) reset()
|
||||
}
|
||||
|
||||
fun reset() {
|
||||
holding = false
|
||||
cancel(fire)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val MIDDLE = 2
|
||||
const val HOLD_MS = 2000L
|
||||
const val SLOP = 48
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
|
||||
object PenRouter {
|
||||
enum class Route { BLOCKED, PEN, RELATIVE, TOUCH }
|
||||
|
||||
fun decide(uiBlocking: Boolean, mode: String, glasses: Boolean, programLock: Boolean): Route = when {
|
||||
uiBlocking -> Route.BLOCKED
|
||||
mode == SessionPrefs.PEN_TOUCH -> Route.TOUCH
|
||||
glasses || programLock -> Route.RELATIVE
|
||||
else -> Route.PEN
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import android.graphics.RectF
|
||||
import android.os.Build
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.SystemClock
|
||||
import android.view.InputDevice
|
||||
import android.view.KeyEvent
|
||||
import android.view.MotionEvent
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
|
||||
class PenStream(private val sink: Sink) {
|
||||
fun interface Sink {
|
||||
fun sample(flags: Int, x: Int, y: Int)
|
||||
}
|
||||
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
private val exitLater = Runnable { if (exitPending) leave() }
|
||||
private val hoverWatchdog = Runnable { checkHover() }
|
||||
private var watching = false
|
||||
private var contact = false
|
||||
private var barrel = 0
|
||||
private var keyDown = false
|
||||
private var keyDevice = Int.MIN_VALUE
|
||||
private var keyCode = 0
|
||||
private var exitPending = false
|
||||
private var exitTime = 0L
|
||||
private var deviceId = Int.MIN_VALUE
|
||||
private var x = 0
|
||||
private var y = 0
|
||||
private var sampleTime = 0L
|
||||
|
||||
var sideButton = SessionPrefs.PEN_BUTTON_RIGHT
|
||||
|
||||
var inProximity = false
|
||||
private set
|
||||
|
||||
fun onMotion(event: MotionEvent, pointer: Int, area: RectF, width: Int, height: Int): Boolean {
|
||||
val action = event.actionMasked
|
||||
val time = event.eventTime
|
||||
val own = isPenAction(event, pointer)
|
||||
expire(time)
|
||||
when (action) {
|
||||
MotionEvent.ACTION_HOVER_ENTER, MotionEvent.ACTION_HOVER_MOVE -> {
|
||||
continueAt(time)
|
||||
contact = false
|
||||
enter(event)
|
||||
samples(event, pointer, area, width, height)
|
||||
}
|
||||
MotionEvent.ACTION_HOVER_EXIT -> if (inProximity && !exitPending && !contact) pendExit(time)
|
||||
MotionEvent.ACTION_BUTTON_PRESS, MotionEvent.ACTION_BUTTON_RELEASE -> {
|
||||
continueAt(time)
|
||||
if (!inProximity) return true
|
||||
barrel = event.buttonState
|
||||
samples(event, pointer, area, width, height)
|
||||
}
|
||||
MotionEvent.ACTION_DOWN, MotionEvent.ACTION_POINTER_DOWN -> if (own) {
|
||||
continueAt(time)
|
||||
enter(event)
|
||||
contact = true
|
||||
samples(event, pointer, area, width, height)
|
||||
} else if (contact) samples(event, pointer, area, width, height)
|
||||
MotionEvent.ACTION_MOVE -> if (contact) {
|
||||
barrel = event.buttonState
|
||||
samples(event, pointer, area, width, height)
|
||||
}
|
||||
MotionEvent.ACTION_UP, MotionEvent.ACTION_POINTER_UP -> if (!own) {
|
||||
if (contact) samples(event, pointer, area, width, height)
|
||||
} else if (contact) {
|
||||
if (event.flags and MotionEvent.FLAG_CANCELED != 0) cancel()
|
||||
else {
|
||||
barrel = event.buttonState
|
||||
samples(event, pointer, area, width, height, lift = true)
|
||||
pendExit(time)
|
||||
}
|
||||
}
|
||||
MotionEvent.ACTION_CANCEL -> cancel()
|
||||
else -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
fun onKey(event: KeyEvent): Boolean {
|
||||
expire(event.eventTime)
|
||||
val down = event.action == KeyEvent.ACTION_DOWN
|
||||
val repeat = event.repeatCount > 0
|
||||
if (exitPending && !repeat) leave()
|
||||
if (!inProximity || exitPending) {
|
||||
if (!repeat && event.deviceId == keyDevice && event.keyCode == keyCode) keyDown = down
|
||||
return true
|
||||
}
|
||||
if (down == keyDown) return true
|
||||
val before = state()
|
||||
keyDown = down
|
||||
if (down) {
|
||||
keyDevice = event.deviceId
|
||||
keyCode = event.keyCode
|
||||
}
|
||||
if (state() == before) return true
|
||||
emit(state())
|
||||
return true
|
||||
}
|
||||
|
||||
fun cancel(releaseKey: Boolean = false) {
|
||||
if (releaseKey) keyDown = false
|
||||
leave()
|
||||
}
|
||||
|
||||
fun holdsKey(event: KeyEvent): Boolean = keyDown && event.deviceId == keyDevice && event.keyCode == keyCode
|
||||
|
||||
fun deviceRemoved(deviceId: Int) {
|
||||
if (deviceId == this.deviceId) cancel()
|
||||
if (!keyDown || deviceId != keyDevice) return
|
||||
val before = state()
|
||||
keyDown = false
|
||||
if (inProximity && state() != before) emit(state())
|
||||
}
|
||||
|
||||
private fun enter(event: MotionEvent) {
|
||||
barrel = event.buttonState
|
||||
if (inProximity) return
|
||||
inProximity = true
|
||||
deviceId = event.deviceId
|
||||
}
|
||||
|
||||
private fun continueAt(time: Long) {
|
||||
if (!exitPending) return
|
||||
if (time - exitTime > EXIT_GRACE_MS) { leave(); return }
|
||||
exitPending = false
|
||||
handler.removeCallbacks(exitLater)
|
||||
}
|
||||
|
||||
private fun pendExit(time: Long) {
|
||||
exitPending = true
|
||||
exitTime = time
|
||||
handler.removeCallbacks(exitLater)
|
||||
handler.postDelayed(exitLater, EXIT_GRACE_MS)
|
||||
}
|
||||
|
||||
private fun expire(time: Long) {
|
||||
if (inProximity && !contact && time - sampleTime >= HOVER_TIMEOUT_MS) leave()
|
||||
}
|
||||
|
||||
private fun watchHover(delay: Long = HOVER_TIMEOUT_MS) {
|
||||
if (watching || contact) return
|
||||
watching = true
|
||||
handler.postDelayed(hoverWatchdog, delay)
|
||||
}
|
||||
|
||||
private fun checkHover() {
|
||||
watching = false
|
||||
if (!inProximity || contact || exitPending) return
|
||||
val silent = SystemClock.uptimeMillis() - sampleTime
|
||||
if (silent >= HOVER_TIMEOUT_MS) leave() else watchHover(HOVER_TIMEOUT_MS - silent)
|
||||
}
|
||||
|
||||
private fun leave() {
|
||||
if (!inProximity) return
|
||||
emit(0)
|
||||
handler.removeCallbacks(exitLater)
|
||||
handler.removeCallbacks(hoverWatchdog)
|
||||
watching = false
|
||||
inProximity = false
|
||||
contact = false
|
||||
exitPending = false
|
||||
barrel = 0
|
||||
}
|
||||
|
||||
private fun samples(event: MotionEvent, pointer: Int, area: RectF, width: Int, height: Int, lift: Boolean = false) {
|
||||
for (h in 0 until event.historySize) sample(event, pointer, h, area, width, height)
|
||||
if (lift) contact = false
|
||||
sample(event, pointer, -1, area, width, height)
|
||||
}
|
||||
|
||||
private fun sample(event: MotionEvent, pointer: Int, h: Int, area: RectF, width: Int, height: Int) {
|
||||
x = InputSpace.fixedX(event.axis(MotionEvent.AXIS_X, pointer, h).coerceIn(area.left, area.right), width)
|
||||
y = InputSpace.fixedY(event.axis(MotionEvent.AXIS_Y, pointer, h).coerceIn(area.top, area.bottom), height)
|
||||
sampleTime = if (h < 0) event.eventTime else event.getHistoricalEventTime(h)
|
||||
emit(state())
|
||||
watchHover()
|
||||
}
|
||||
|
||||
private fun emit(flags: Int) = sink.sample(flags, x, y)
|
||||
|
||||
private fun state(): Int =
|
||||
PEN_IN or (if (contact) PEN_TIP else 0) or buttonFlags(keyDown || barrel and MotionEvent.BUTTON_STYLUS_PRIMARY != 0,
|
||||
barrel and MotionEvent.BUTTON_STYLUS_SECONDARY != 0, sideButton)
|
||||
|
||||
private fun MotionEvent.axis(axis: Int, pointer: Int, h: Int): Float =
|
||||
if (h < 0) getAxisValue(axis, pointer) else getHistoricalAxisValue(axis, pointer, h)
|
||||
|
||||
companion object {
|
||||
const val PEN_IN = 1 shl 0
|
||||
const val PEN_TIP = 1 shl 1
|
||||
const val PEN_RIGHT = 1 shl 2
|
||||
const val PEN_MIDDLE = 1 shl 3
|
||||
const val HOVER_TIMEOUT_MS = 2_000L
|
||||
const val EXIT_GRACE_MS = 50L
|
||||
|
||||
private val PEN_NAME = Regex("\\b(pen|stylus)", RegexOption.IGNORE_CASE)
|
||||
|
||||
fun isPen(event: MotionEvent, index: Int): Boolean = when (event.getToolType(index)) {
|
||||
MotionEvent.TOOL_TYPE_STYLUS, MotionEvent.TOOL_TYPE_ERASER -> true
|
||||
MotionEvent.TOOL_TYPE_UNKNOWN -> event.isFromSource(InputDevice.SOURCE_STYLUS)
|
||||
else -> false
|
||||
}
|
||||
|
||||
fun penConnected(): Boolean =
|
||||
InputDevice.getDeviceIds().any { id -> InputDevice.getDevice(id)?.let { isPenDevice(it.sources) } == true }
|
||||
|
||||
// Before Android 14 a touchscreen that declares ABS_MT_TOOL_TYPE reports SOURCE_STYLUS without any pen.
|
||||
fun isPenDevice(sources: Int, sdk: Int = Build.VERSION.SDK_INT): Boolean =
|
||||
sources and InputDevice.SOURCE_STYLUS == InputDevice.SOURCE_STYLUS &&
|
||||
(sources and InputDevice.SOURCE_TOUCHSCREEN != InputDevice.SOURCE_TOUCHSCREEN || sdk >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
|
||||
fun penIndex(event: MotionEvent): Int {
|
||||
for (index in 0 until event.pointerCount) if (isPen(event, index)) return index
|
||||
return -1
|
||||
}
|
||||
|
||||
fun isPenAction(event: MotionEvent, index: Int): Boolean = when (event.actionMasked) {
|
||||
MotionEvent.ACTION_DOWN, MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> true
|
||||
MotionEvent.ACTION_POINTER_DOWN, MotionEvent.ACTION_POINTER_UP -> event.actionIndex == index
|
||||
else -> false
|
||||
}
|
||||
|
||||
fun isPenKey(event: KeyEvent): Boolean {
|
||||
val device = event.device ?: return false
|
||||
return isPenKeyboard(device.name, device.sources, Build.VERSION.SDK_INT < Build.VERSION_CODES.Q || device.isExternal,
|
||||
device.keyboardType == InputDevice.KEYBOARD_TYPE_ALPHABETIC)
|
||||
}
|
||||
|
||||
fun isPenKeyboard(name: String?, sources: Int, external: Boolean, alphabetic: Boolean): Boolean =
|
||||
external && !alphabetic && sources == InputDevice.SOURCE_KEYBOARD && name != null && PEN_NAME.containsMatchIn(name)
|
||||
|
||||
fun buttonFlags(primary: Boolean, secondary: Boolean, sideButton: String): Int {
|
||||
val first = when (sideButton) {
|
||||
SessionPrefs.PEN_BUTTON_RIGHT -> PEN_RIGHT
|
||||
SessionPrefs.PEN_BUTTON_MIDDLE -> PEN_MIDDLE
|
||||
else -> 0
|
||||
}
|
||||
val second = if (sideButton == SessionPrefs.PEN_BUTTON_RIGHT) PEN_MIDDLE else PEN_RIGHT
|
||||
return (if (primary) first else 0) or (if (secondary) second else 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,13 +23,20 @@ internal fun MotionEvent.pointerSubset(pointerIdBits: Int): MotionEvent? {
|
||||
}
|
||||
val properties = Array(indices.size) { MotionEvent.PointerProperties() }
|
||||
val coordinates = Array(indices.size) { MotionEvent.PointerCoords() }
|
||||
indices.forEachIndexed { target, index ->
|
||||
getPointerProperties(index, properties[target])
|
||||
getPointerCoords(index, coordinates[target])
|
||||
indices.forEachIndexed { target, index -> getPointerProperties(index, properties[target]) }
|
||||
fun sample(position: Int): Array<MotionEvent.PointerCoords> {
|
||||
indices.forEachIndexed { target, index ->
|
||||
if (position < historySize) getHistoricalPointerCoords(index, position, coordinates[target])
|
||||
else getPointerCoords(index, coordinates[target])
|
||||
}
|
||||
return coordinates
|
||||
}
|
||||
return MotionEvent.obtain(
|
||||
downTime, eventTime, splitAction, indices.size, properties, coordinates,
|
||||
fun time(position: Int) = if (position < historySize) getHistoricalEventTime(position) else eventTime
|
||||
val split = MotionEvent.obtain(
|
||||
downTime, time(0), splitAction, indices.size, properties, sample(0),
|
||||
metaState, buttonState, xPrecision, yPrecision,
|
||||
deviceId, edgeFlags, source, flags,
|
||||
)
|
||||
for (position in 1..historySize) split.addBatch(time(position), sample(position), metaState)
|
||||
return split
|
||||
}
|
||||
+64
-21
@@ -1,14 +1,17 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import android.accessibilityservice.AccessibilityService
|
||||
import android.app.Service
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.hardware.input.InputManager
|
||||
import android.os.Binder
|
||||
import android.os.Handler
|
||||
import android.os.IBinder
|
||||
import android.os.Looper
|
||||
import android.os.Parcel
|
||||
import android.view.KeyEvent
|
||||
import android.view.accessibility.AccessibilityEvent
|
||||
import com.droiddeck.launcher.HomeApp
|
||||
import com.droiddeck.shortcuts.Relay
|
||||
|
||||
object HomeButtonShortcuts {
|
||||
private var owner: Any? = null
|
||||
@@ -101,38 +104,78 @@ object SystemKeyCapture {
|
||||
}
|
||||
}
|
||||
|
||||
class HomeButtonService : AccessibilityService(), InputManager.InputDeviceListener {
|
||||
class ShortcutsRelay : Service(), InputManager.InputDeviceListener {
|
||||
private val main = Handler(Looper.getMainLooper())
|
||||
private val trusted = java.util.concurrent.ConcurrentHashMap.newKeySet<Int>()
|
||||
private var bottomScreen: BottomScreenWatch? = null
|
||||
|
||||
override fun onServiceConnected() {
|
||||
getSystemService(InputManager::class.java).registerInputDeviceListener(this, Handler(Looper.getMainLooper()))
|
||||
if (bottomScreen == null && BottomScreenGuests.supported()) bottomScreen = BottomScreenWatch(this).also { it.start() }
|
||||
private val binder = object : Binder() {
|
||||
override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean {
|
||||
if (code !in Relay.CONFIG..Relay.WINDOWS) return super.onTransact(code, data, reply, flags)
|
||||
data.enforceInterface(Relay.DESCRIPTOR)
|
||||
if (!trusts(Binder.getCallingUid())) return false
|
||||
when (code) {
|
||||
Relay.CONFIG -> reply?.writeInt(if (bottomScreen != null) Relay.WANTS_WINDOWS else 0)
|
||||
Relay.KEY -> reply?.writeInt(if (onMain(KeyEvent.CREATOR.createFromParcel(data))) 1 else 0)
|
||||
Relay.INTERRUPT -> main.post { HomeButtonShortcuts.release() }
|
||||
Relay.ARRIVAL -> bottomScreen?.onArrival(data.readInt(), data.readString() ?: return true, data.readLong())
|
||||
Relay.WINDOWS -> bottomScreen?.onWindows(Relay.decode(data.createByteArray() ?: return true))
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
private fun stopBottomScreen() {
|
||||
bottomScreen?.stop()
|
||||
bottomScreen = null
|
||||
private fun trusts(uid: Int): Boolean {
|
||||
if (uid !in trusted) {
|
||||
if (!packageManager.getPackagesForUid(uid).orEmpty().contains(Relay.PACKAGE)) return false
|
||||
trusted += uid
|
||||
}
|
||||
return com.droiddeck.launcher.core.SteamIntegration.shortcutsEnabled(this)
|
||||
}
|
||||
|
||||
private fun onMain(event: KeyEvent): Boolean {
|
||||
// A key the companion already gave up on must not run later and leave a press without its release.
|
||||
val claimed = java.util.concurrent.atomic.AtomicBoolean(false)
|
||||
val task = java.util.concurrent.FutureTask {
|
||||
claimed.compareAndSet(false, true) &&
|
||||
(SystemKeyCapture.onKeyEvent(event) || HomeButtonShortcuts.onKeyEvent(this, event))
|
||||
}
|
||||
main.postAtFrontOfQueue(task)
|
||||
return try {
|
||||
task.get(KEY_TIMEOUT_MS, java.util.concurrent.TimeUnit.MILLISECONDS)
|
||||
} catch (e: java.util.concurrent.TimeoutException) {
|
||||
if (claimed.compareAndSet(false, true)) false else runCatching { task.get() }.getOrDefault(false)
|
||||
} catch (e: Exception) {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
getSystemService(InputManager::class.java).registerInputDeviceListener(this, main)
|
||||
if (BottomScreenGuests.supported()) bottomScreen = BottomScreenWatch(this).also { it.start() }
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder = binder
|
||||
|
||||
override fun onUnbind(intent: Intent?): Boolean {
|
||||
HomeButtonShortcuts.release()
|
||||
return super.onUnbind(intent)
|
||||
}
|
||||
|
||||
override fun onKeyEvent(event: KeyEvent) =
|
||||
SystemKeyCapture.onKeyEvent(event) || HomeButtonShortcuts.onKeyEvent(this, event)
|
||||
override fun onAccessibilityEvent(event: AccessibilityEvent?) { event?.let { bottomScreen?.onEvent(it) } }
|
||||
override fun onInterrupt() { HomeButtonShortcuts.release() }
|
||||
override fun onInputDeviceAdded(deviceId: Int) {}
|
||||
override fun onInputDeviceChanged(deviceId: Int) {}
|
||||
override fun onInputDeviceRemoved(deviceId: Int) { HomeButtonShortcuts.onDeviceRemoved(deviceId) }
|
||||
|
||||
override fun onUnbind(intent: Intent?): Boolean {
|
||||
HomeButtonShortcuts.release()
|
||||
stopBottomScreen()
|
||||
com.droiddeck.launcher.core.SteamIntegration.syncShortcutsListing(this)
|
||||
return super.onUnbind(intent)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
HomeButtonShortcuts.release()
|
||||
stopBottomScreen()
|
||||
bottomScreen?.stop()
|
||||
bottomScreen = null
|
||||
getSystemService(InputManager::class.java).unregisterInputDeviceListener(this)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val KEY_TIMEOUT_MS = 200L
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import android.app.PendingIntent
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.hardware.usb.UsbConstants
|
||||
import android.hardware.usb.UsbDevice
|
||||
import android.hardware.usb.UsbDeviceConnection
|
||||
import android.hardware.usb.UsbEndpoint
|
||||
import android.hardware.usb.UsbInterface
|
||||
import android.hardware.usb.UsbManager
|
||||
import android.os.Build
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.SystemClock
|
||||
import android.util.Log
|
||||
import android.view.InputDevice
|
||||
|
||||
/**
|
||||
* Reads a USB mouse from its HID interface, detaching it from Android meanwhile. Android only grants pointer
|
||||
* capture on the focused display, so an app shown elsewhere, as in REDMAGIC's cast mode, gets a cursor that
|
||||
* stops at the screen edge.
|
||||
*/
|
||||
class UsbMouse(private val context: Context, private val listener: Listener) {
|
||||
interface Listener {
|
||||
fun onMove(dx: Int, dy: Int)
|
||||
fun onButton(index: Int, down: Boolean)
|
||||
fun onWheel(steps: Int)
|
||||
fun onChanged()
|
||||
/** The mouse stopped responding while read here, so buttons held then never got their releases. */
|
||||
fun onLost()
|
||||
}
|
||||
|
||||
private val usb by lazy { context.getSystemService(Context.USB_SERVICE) as UsbManager }
|
||||
private val main = Handler(Looper.getMainLooper())
|
||||
private val permissionAction by lazy { context.packageName + ".USB_MOUSE_PERMISSION" }
|
||||
private val asked = mutableSetOf<String>()
|
||||
private val failed = mutableSetOf<String>()
|
||||
private var receiverRegistered = false
|
||||
@Volatile private var grab: Grab? = null
|
||||
private var lastReader: Thread? = null
|
||||
|
||||
val active: Boolean get() = grab != null
|
||||
|
||||
private val receiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
val granted = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)
|
||||
Log.i(TAG, "USB mouse access ${if (granted) "granted" else "denied"}")
|
||||
if (granted) listener.onChanged()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the mouse is now read here, setting it up on the reader thread; asks for access once per
|
||||
* plugged-in mouse. A mouse that fails setup after being claimed isn't tried again until it is replugged, since
|
||||
* releasing it re-adds Android's mouse, which would start another attempt.
|
||||
*/
|
||||
fun grab(): Boolean {
|
||||
if (grab != null) return true
|
||||
val (device, mouse) = findMouse() ?: return false
|
||||
if (device.deviceName in failed) return false
|
||||
if (!usb.hasPermission(device)) {
|
||||
if (asked.add(device.deviceName)) askPermission(device)
|
||||
return false
|
||||
}
|
||||
val endpoint = (0 until mouse.endpointCount).map(mouse::getEndpoint).firstOrNull {
|
||||
it.direction == UsbConstants.USB_DIR_IN && it.type == UsbConstants.USB_ENDPOINT_XFER_INT
|
||||
} ?: return false
|
||||
grab = Grab(device, mouse, endpoint, lastReader).also {
|
||||
lastReader = it.thread
|
||||
it.thread.start()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/** Hands the mouse back to Android. */
|
||||
fun release() {
|
||||
val current = grab ?: return
|
||||
grab = null
|
||||
current.cancel()
|
||||
}
|
||||
|
||||
fun close() {
|
||||
release()
|
||||
if (receiverRegistered) runCatching { context.unregisterReceiver(receiver) }
|
||||
receiverRegistered = false
|
||||
}
|
||||
|
||||
private fun findMouse(): Pair<UsbDevice, UsbInterface>? {
|
||||
val androidMice = InputDevice.getDeviceIds().asList().mapNotNull { InputDevice.getDevice(it) }
|
||||
.filter { !it.isVirtual && it.supportsSource(InputDevice.SOURCE_MOUSE) }
|
||||
.map { it.vendorId to it.productId }.toSet()
|
||||
return usb.deviceList.values.filter { (it.vendorId to it.productId) in androidMice }.firstNotNullOfOrNull { device ->
|
||||
(0 until device.interfaceCount).map(device::getInterface).firstOrNull(::isBootMouse)?.let { device to it }
|
||||
}
|
||||
}
|
||||
|
||||
private fun askPermission(device: UsbDevice) {
|
||||
if (!receiverRegistered) {
|
||||
val filter = IntentFilter(permissionAction)
|
||||
if (Build.VERSION.SDK_INT >= 33) context.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED)
|
||||
else context.registerReceiver(receiver, filter)
|
||||
receiverRegistered = true
|
||||
}
|
||||
val flags = if (Build.VERSION.SDK_INT >= 31) PendingIntent.FLAG_MUTABLE else 0
|
||||
val intent = PendingIntent.getBroadcast(context, 0, Intent(permissionAction).setPackage(context.packageName), flags)
|
||||
runCatching { usb.requestPermission(device, intent) }.onFailure {
|
||||
asked.remove(device.deviceName)
|
||||
Log.w(TAG, "requestPermission", it)
|
||||
}
|
||||
}
|
||||
|
||||
private inner class Grab(
|
||||
private val device: UsbDevice,
|
||||
private val mouse: UsbInterface,
|
||||
private val endpoint: UsbEndpoint,
|
||||
private val previous: Thread?,
|
||||
) {
|
||||
@Volatile private var running = true
|
||||
private val claimLock = Any()
|
||||
val thread = Thread(::run, "usb-mouse")
|
||||
|
||||
/** Once this returns, the reader either never claims the interface or sees the cancellation after claiming. */
|
||||
fun cancel() = synchronized(claimLock) { running = false }
|
||||
|
||||
// The reader owns the connection: closing it while a transfer is pending would free it under the transfer.
|
||||
// A previous reader may still hold the interface, which would make this claim fail.
|
||||
private fun run() {
|
||||
runCatching { previous?.join() }
|
||||
val connection = if (running) usb.openDevice(device) else null
|
||||
if (connection == null) {
|
||||
main.post { ended(markFailed = false) }
|
||||
return
|
||||
}
|
||||
var claimed = false
|
||||
var boot = false
|
||||
try {
|
||||
claimed = synchronized(claimLock) { running && connection.claimInterface(mouse, true) }
|
||||
if (!claimed) {
|
||||
main.post { ended(markFailed = false) }
|
||||
return
|
||||
}
|
||||
if (!running) return
|
||||
val format = setUp(connection)
|
||||
if (format == null) {
|
||||
main.post { ended(markFailed = true) }
|
||||
return
|
||||
}
|
||||
boot = format === HidMouseReport.BOOT
|
||||
if (!running) return
|
||||
Log.i(TAG, String.format(java.util.Locale.ROOT, "reading USB mouse %04x:%04x \"%s\" directly (%s)",
|
||||
device.vendorId, device.productId, device.productName, if (boot) "boot protocol" else "report ${format.reportId}"))
|
||||
read(connection, format)
|
||||
} finally {
|
||||
if (claimed) {
|
||||
if (boot) connection.controlTransfer(0x21, SET_PROTOCOL, HID_REPORT_PROTOCOL, mouse.id, null, 0, CONTROL_TIMEOUT_MS)
|
||||
connection.releaseInterface(mouse)
|
||||
}
|
||||
connection.close()
|
||||
}
|
||||
}
|
||||
|
||||
/** HID 1.11 7.2.6: a host must not assume the protocol a device is in, so it is set either way. */
|
||||
private fun setUp(connection: UsbDeviceConnection): HidMouseReport? {
|
||||
val descriptor = ByteArray(1024)
|
||||
val length = connection.controlTransfer(0x81, GET_DESCRIPTOR, HID_REPORT_DESCRIPTOR shl 8, mouse.id,
|
||||
descriptor, descriptor.size, CONTROL_TIMEOUT_MS)
|
||||
val parsed = if (length > 0) HidMouseReport.parse(descriptor.copyOf(length)) else null
|
||||
if (parsed != null && running &&
|
||||
connection.controlTransfer(0x21, SET_PROTOCOL, HID_REPORT_PROTOCOL, mouse.id, null, 0, CONTROL_TIMEOUT_MS) >= 0) return parsed
|
||||
val boot = running &&
|
||||
connection.controlTransfer(0x21, SET_PROTOCOL, HID_BOOT_PROTOCOL, mouse.id, null, 0, CONTROL_TIMEOUT_MS) >= 0
|
||||
return HidMouseReport.BOOT.takeIf { boot }
|
||||
}
|
||||
|
||||
private fun read(connection: UsbDeviceConnection, format: HidMouseReport) {
|
||||
val report = ByteArray(maxOf(endpoint.maxPacketSize, 8))
|
||||
var buttons = 0
|
||||
var failures = 0
|
||||
while (running) {
|
||||
val started = SystemClock.uptimeMillis()
|
||||
val length = connection.bulkTransfer(endpoint, report, report.size, READ_TIMEOUT_MS)
|
||||
if (length <= 0) {
|
||||
if (SystemClock.uptimeMillis() - started < READ_TIMEOUT_MS / 2 && ++failures >= MAX_FAILURES) {
|
||||
main.post { lost() }
|
||||
return
|
||||
}
|
||||
continue
|
||||
}
|
||||
failures = 0
|
||||
val state = format.decode(report, length) ?: continue
|
||||
val changed = buttons xor state.buttons
|
||||
buttons = state.buttons
|
||||
main.post { deliver(state, changed) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun ended(markFailed: Boolean) {
|
||||
if (grab !== this) return
|
||||
if (markFailed) failed += device.deviceName
|
||||
Log.i(TAG, "USB mouse \"${device.productName}\" could not be set up")
|
||||
grab = null
|
||||
}
|
||||
|
||||
private fun deliver(state: HidMouseReport.State, changed: Int) {
|
||||
if (grab !== this) return
|
||||
if (state.dx != 0 || state.dy != 0) listener.onMove(state.dx, state.dy)
|
||||
for (i in 0 until BUTTONS) if (changed and (1 shl i) != 0) listener.onButton(i, state.buttons and (1 shl i) != 0)
|
||||
if (state.wheel != 0) listener.onWheel(state.wheel)
|
||||
}
|
||||
|
||||
private fun lost() {
|
||||
if (grab !== this) return
|
||||
failed += device.deviceName
|
||||
Log.i(TAG, "USB mouse stopped responding")
|
||||
grab = null
|
||||
listener.onLost()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "UsbMouse"
|
||||
private const val GET_DESCRIPTOR = 0x06
|
||||
private const val SET_PROTOCOL = 0x0b
|
||||
private const val HID_BOOT_PROTOCOL = 0
|
||||
private const val HID_REPORT_PROTOCOL = 1
|
||||
private const val HID_REPORT_DESCRIPTOR = 0x22
|
||||
private const val SUBCLASS_BOOT = 1
|
||||
private const val PROTOCOL_MOUSE = 2
|
||||
private const val CONTROL_TIMEOUT_MS = 1000
|
||||
private const val READ_TIMEOUT_MS = 100
|
||||
private const val MAX_FAILURES = 5
|
||||
private const val BUTTONS = 5
|
||||
|
||||
private fun isBootMouse(iface: UsbInterface) = iface.interfaceClass == UsbConstants.USB_CLASS_HID &&
|
||||
iface.interfaceSubclass == SUBCLASS_BOOT && iface.interfaceProtocol == PROTOCOL_MOUSE
|
||||
|
||||
/**
|
||||
* A process killed while reading a mouse leaves it with no driver until it is replugged. Claiming without
|
||||
* force only succeeds when no driver has the interface, and releasing it reattaches Android's.
|
||||
*/
|
||||
fun returnLeftover(context: Context) {
|
||||
Thread({
|
||||
runCatching {
|
||||
val usb = context.getSystemService(Context.USB_SERVICE) as UsbManager
|
||||
for (device in usb.deviceList.values) {
|
||||
if (!usb.hasPermission(device)) continue
|
||||
val mouse = (0 until device.interfaceCount).map(device::getInterface).firstOrNull(::isBootMouse) ?: continue
|
||||
val connection = usb.openDevice(device) ?: continue
|
||||
if (connection.claimInterface(mouse, false)) {
|
||||
connection.releaseInterface(mouse)
|
||||
Log.i(TAG, "returned USB mouse \"${device.productName}\" to Android")
|
||||
}
|
||||
connection.close()
|
||||
}
|
||||
}.onFailure { Log.w(TAG, "returning a USB mouse to Android failed", it) }
|
||||
}, "usb-mouse-return").start()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ object BottomDesktop {
|
||||
send(target, Message.obtain(null, Comp.MSG_POINTER, x, y))
|
||||
}
|
||||
|
||||
/** Button (3), wheel (4) and smooth-scroll (12) input, as `WaylandCompositor.nativeSendSceneInput` takes it. */
|
||||
/** Button, wheel and finger-scroll input, using the `WaylandCompositor.SCENE_*` types `nativeSendSceneInput` takes. */
|
||||
fun sendScene(type: Int, a: Int, b: Int = 0) {
|
||||
val target = service ?: return
|
||||
send(target, Message.obtain(null, Comp.MSG_SCENE, type, a).apply {
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.os.Process
|
||||
import android.system.Os
|
||||
import android.system.OsConstants
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.gpu.SocNames
|
||||
import com.droiddeck.launcher.wayland.WaylandCompositor
|
||||
import java.io.File
|
||||
import kotlin.math.abs
|
||||
@@ -26,13 +27,14 @@ object GameThreadHints {
|
||||
private const val PACE_TOLERANCE = 0.08
|
||||
|
||||
private val NOT_GAMES = setOf("steam", "steamwebhelper")
|
||||
private val SOCS = setOf("CQ8725S", "SM8750")
|
||||
|
||||
private var worker: Thread? = null
|
||||
|
||||
@Synchronized
|
||||
fun start(context: Context): String {
|
||||
if (!SessionPrefs.gameThreadHints(context)) return "game thread hints: off"
|
||||
if (Build.VERSION.SDK_INT < 31 || Build.SOC_MODEL != "CQ8725S") return "game thread hints: Odin 3 only"
|
||||
if (Build.VERSION.SDK_INT < 31 || !supported(Build.SOC_MODEL)) return "game thread hints: Snapdragon 8 Elite only"
|
||||
val hm = context.getSystemService(PerformanceHintManager::class.java)
|
||||
?: return "game thread hints: no PerformanceHintManager"
|
||||
val pm = context.getSystemService(PowerManager::class.java)
|
||||
@@ -99,6 +101,8 @@ object GameThreadHints {
|
||||
}
|
||||
}
|
||||
|
||||
internal fun supported(soc: String): Boolean = SocNames.normalizedModel(soc) in SOCS
|
||||
|
||||
internal fun holdsPace(fps: Double, refreshHz: Double): Boolean =
|
||||
fps >= 10 && refreshHz > 0 && (1..4).any { k -> abs(fps - refreshHz / k) < PACE_TOLERANCE * refreshHz / k }
|
||||
|
||||
|
||||
@@ -60,17 +60,19 @@ object GraphicsReport {
|
||||
appendLine("-- path")
|
||||
appendLine("path: " + path(context))
|
||||
appendLine("driver mode: " + SessionPrefs.gpuDriverMode(context))
|
||||
appendLine("display driver (compositor): " + SessionPrefs.androidDriver(context).ifEmpty {
|
||||
if (DeviceSupport.adreno()) "(auto: bundled Turnip)" else "(auto: the phone's own Vulkan driver, ${SystemVulkanDriver.hal() ?: "vendor HAL"})"
|
||||
})
|
||||
val display = SessionPrefs.androidDriver(context)
|
||||
val shown = com.droiddeck.launcher.gpu.TurnipDriver(context).effectiveId()
|
||||
appendLine("display driver (compositor): " +
|
||||
(if (shown == "system") "the phone's own Vulkan driver, ${SystemVulkanDriver.hal() ?: "vendor HAL"}" else shown) +
|
||||
if (display.isEmpty()) " (auto)" else if (display != shown) " (picked $display, not used)" else "")
|
||||
appendLine("display driver chosen by: " + when {
|
||||
display.isEmpty() -> "auto (or a pair on a non-Adreno GPU: the phone's own driver)"
|
||||
DriverBundle.containing(context, display, false) != null -> "pair (its display half)"
|
||||
else -> "user (picked on its own)"
|
||||
})
|
||||
val linux = SessionPrefs.linuxDriver(context)
|
||||
appendLine("runtime driver: " + linux.ifEmpty { "(runtime default)" })
|
||||
appendLine("runtime driver: " + (com.droiddeck.launcher.gpu.DeviceInfo.hostRoute(context)
|
||||
?.let { "$it (picked ${linux.ifEmpty { "runtime default" }}, not used)" } ?: linux.ifEmpty { "(runtime default)" }))
|
||||
if (linux.isNotEmpty()) {
|
||||
val dir = com.droiddeck.launcher.gpu.LinuxVulkanDriverManager(context).getDriverDir(linux)
|
||||
appendLine("runtime driver dir: ${dir.path} (" + (dir.listFiles()?.filter { it.name.endsWith(".so") }?.joinToString { it.name } ?: "missing") + ")")
|
||||
@@ -161,8 +163,8 @@ object GraphicsReport {
|
||||
private fun read(path: String): String? = FileUtils.readString(File(path))?.trim()?.takeIf { it.isNotEmpty() }
|
||||
|
||||
/** The compositor's driver lines from the app's own log. */
|
||||
private val COMPOSITOR = Regex(
|
||||
"""vk_present|waylandcomp|vk_loader|compositor|vkCreateDevice|extension|adrenotools|TurnipDriver|""" +
|
||||
internal val COMPOSITOR = Regex(
|
||||
"""vk_present|waylandcomp|vk_loader|compositor|vkCreateDevice|extension|adrenotools|hook_impl|TurnipDriver|""" +
|
||||
"""graphics driver|display driver|DD_PRESENT_FAULT|SystemVulkan|vkbridge|VkBridge|mali_gralloc|panvk|PanVK|radv|MESA|native buffer|first frame|present|""" +
|
||||
"""lsfg|FrameGen|device gates|AAudio|directaudio|pulse|gralloc|dma.?buf|modifier|import""",
|
||||
RegexOption.IGNORE_CASE,
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.droiddeck.launcher.input.ControllerPrefs
|
||||
import com.droiddeck.launcher.input.JoyCon
|
||||
import com.droiddeck.launcher.input.PadBridge
|
||||
import java.io.DataInputStream
|
||||
import java.io.File
|
||||
import kotlin.math.max
|
||||
|
||||
class RumbleComponent : SessionPart() {
|
||||
@@ -39,6 +40,10 @@ class RumbleComponent : SessionPart() {
|
||||
|
||||
internal var controllerMotors: (Int) -> Motors? = ::lookupController
|
||||
internal var motorLooper: Looper? = null
|
||||
internal var processStart: (Int) -> String? = ::readProcessStart
|
||||
internal var gameRunning: () -> Boolean = { SteamGameProcess.running() }
|
||||
private var gameCheckedAt = Long.MIN_VALUE
|
||||
private var gameLastSeen = false
|
||||
|
||||
@Synchronized private fun refreshEnabled() {
|
||||
enabled = app()?.let { ControllerPrefs.rumbleEnabled(it) } == true
|
||||
@@ -66,7 +71,9 @@ class RumbleComponent : SessionPart() {
|
||||
try {
|
||||
val bytes = ByteArray(8)
|
||||
DataInputStream(client.inputStream).readFully(bytes)
|
||||
buzz(u16(bytes, 0), u16(bytes, 2), u16(bytes, 4), u16(bytes, 6))
|
||||
val peer = runCatching { client.peerCredentials }.getOrNull()
|
||||
buzz(u16(bytes, 0), u16(bytes, 2), u16(bytes, 4), u16(bytes, 6), peer?.pid ?: 0,
|
||||
peer?.uid == android.os.Process.myUid())
|
||||
} catch (e: Exception) {
|
||||
} finally {
|
||||
try { client.close() } catch (e: Exception) { }
|
||||
@@ -94,7 +101,9 @@ class RumbleComponent : SessionPart() {
|
||||
|
||||
private fun u16(b: ByteArray, at: Int): Int = (b[at].toInt() and 0xFF) or ((b[at + 1].toInt() and 0xFF) shl 8)
|
||||
|
||||
@Synchronized private fun buzz(strong: Int, weak: Int, ms: Int, slot: Int) {
|
||||
private fun buzz(strong: Int, weak: Int, ms: Int, slot: Int) = buzz(strong, weak, ms, slot, 0, false)
|
||||
|
||||
@Synchronized private fun buzz(strong: Int, weak: Int, ms: Int, slot: Int, sender: Int, ownUser: Boolean) {
|
||||
if (!enabled || quiet) return
|
||||
val target = target(slot)
|
||||
val previous = playing[slot]
|
||||
@@ -105,10 +114,19 @@ class RumbleComponent : SessionPart() {
|
||||
target?.let { Log.i(TAG, "rumble: slot $slot playing on ${it.name}") }
|
||||
}
|
||||
if (target == null) return
|
||||
if ((strong == 0 && weak == 0) || ms == 0) { target.cancel(); forget(slot); return }
|
||||
if ((strong == 0 && weak == 0) || ms == 0) {
|
||||
val from = effects[slot]?.from ?: 0
|
||||
if (sender > 0 && from > 0 && from != sender) return
|
||||
target.cancel()
|
||||
forget(slot)
|
||||
return
|
||||
}
|
||||
val handler = handler ?: return
|
||||
val effect = effects.getOrPut(slot) { Effect(slot) }
|
||||
val held = effect.hold
|
||||
effect.want(strong, weak, ms)
|
||||
effect.from = sender
|
||||
if (effect.hold && (!held || effect.owner != sender)) effect.claim(sender, ownUser)
|
||||
val now = SystemClock.uptimeMillis()
|
||||
if (effect.playing(now)) return
|
||||
handler.removeCallbacks(effect)
|
||||
@@ -116,19 +134,37 @@ class RumbleComponent : SessionPart() {
|
||||
if (wait > 0) handler.postDelayed(effect, wait) else play(effect)
|
||||
}
|
||||
|
||||
@Synchronized private fun play(effect: Effect) {
|
||||
@Synchronized private fun play(effect: Effect, keepalive: Boolean = false) {
|
||||
val target = playing[effect.slot]
|
||||
if (target == null || effects[effect.slot] !== effect) return
|
||||
if (keepalive && effect.hold && effect.armed) effect.orphaned()?.let { why ->
|
||||
Log.i(TAG, "rumble: slot ${effect.slot} stopped, $why")
|
||||
target.cancel()
|
||||
forget(effect.slot)
|
||||
return
|
||||
}
|
||||
val duration = if (effect.hold) HOLD_EFFECT_MS else effect.ms.toLong().coerceIn(1L, 5000L)
|
||||
try {
|
||||
target.play(effect.strong, effect.weak, duration)
|
||||
effect.played(SystemClock.uptimeMillis(), duration)
|
||||
if (effect.hold) handler?.postDelayed(effect, KEEPALIVE_MS)
|
||||
if (effect.hold) {
|
||||
effect.armed = true
|
||||
handler?.postDelayed(effect, KEEPALIVE_MS)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "rumble: ${target.name}: $e")
|
||||
}
|
||||
}
|
||||
|
||||
private fun gameRecently(): Boolean {
|
||||
val now = SystemClock.uptimeMillis()
|
||||
if (!gameLastSeen || now - gameCheckedAt >= GAME_CHECK_MS) {
|
||||
gameLastSeen = gameRunning()
|
||||
gameCheckedAt = now
|
||||
}
|
||||
return gameLastSeen
|
||||
}
|
||||
|
||||
private fun forget(slot: Int) {
|
||||
effects.remove(slot)?.let { handler?.removeCallbacks(it) }
|
||||
}
|
||||
@@ -170,8 +206,32 @@ class RumbleComponent : SessionPart() {
|
||||
private var playedWeak = 0
|
||||
private var playedMs = 0
|
||||
private var until = 0L
|
||||
var owner = 0
|
||||
var from = 0
|
||||
private var ownerSeen = false
|
||||
private var ownerStart: String? = null
|
||||
private var duringGame = false
|
||||
var armed = false
|
||||
val hold get() = ms == HOLD_MS
|
||||
|
||||
fun claim(sender: Int, ownUser: Boolean) {
|
||||
owner = sender
|
||||
val start = if (sender > 0) processStart(sender) else null
|
||||
ownerSeen = sender > 0 && (start != null || ownUser)
|
||||
ownerStart = start?.takeIf { it != UNKNOWN_START }
|
||||
duringGame = gameRecently()
|
||||
armed = false
|
||||
}
|
||||
|
||||
fun orphaned(): String? {
|
||||
if (ownerSeen) {
|
||||
val start = processStart(owner)
|
||||
if (start == null || (ownerStart != null && start != UNKNOWN_START && start != ownerStart))
|
||||
return "process $owner that started it is gone"
|
||||
}
|
||||
return if (duringGame && !gameRunning()) "the game it started in has exited" else null
|
||||
}
|
||||
|
||||
fun want(strong: Int, weak: Int, ms: Int) { this.strong = strong; this.weak = weak; this.ms = ms }
|
||||
|
||||
fun playing(now: Long) = playedMs != 0 && playedStrong == strong && playedWeak == weak && playedMs == ms &&
|
||||
@@ -185,7 +245,7 @@ class RumbleComponent : SessionPart() {
|
||||
until = now + duration
|
||||
}
|
||||
|
||||
override fun run() = play(this)
|
||||
override fun run() = play(this, keepalive = true)
|
||||
}
|
||||
|
||||
internal interface Motors {
|
||||
@@ -256,6 +316,7 @@ class RumbleComponent : SessionPart() {
|
||||
const val HOLD_MS = 0xFFFF
|
||||
const val HOLD_EFFECT_MS = 2000L
|
||||
const val KEEPALIVE_MS = 1500L
|
||||
const val GAME_CHECK_MS = 1000L
|
||||
|
||||
private fun oneShot(vibrator: Vibrator, strength: Int, ms: Long): VibrationEffect {
|
||||
val amplitude = if (vibrator.hasAmplitudeControl()) (strength * 255L / 65535L).toInt().coerceIn(1, 255)
|
||||
@@ -263,6 +324,13 @@ class RumbleComponent : SessionPart() {
|
||||
return VibrationEffect.createOneShot(ms, amplitude)
|
||||
}
|
||||
|
||||
const val UNKNOWN_START = "?"
|
||||
|
||||
internal fun readProcessStart(pid: Int): String? = runCatching {
|
||||
val stat = File("/proc/$pid/stat").readText()
|
||||
stat.substring(stat.lastIndexOf(')') + 2).split(' ')[19]
|
||||
}.getOrElse { if (File("/proc/$pid").exists()) UNKNOWN_START else null }
|
||||
|
||||
private fun lookupController(id: Int): Motors? {
|
||||
val device = InputDevice.getDevice(id) ?: return null
|
||||
val name = "\"${device.name}\""
|
||||
|
||||
@@ -73,6 +73,7 @@ object SessionFiles {
|
||||
"rockstar/helpers/Launcher32.exe" to "usr/local/lib/droiddeck-rockstar/Launcher32.exe",
|
||||
"rockstar/helpers/Launcher64.exe" to "usr/local/lib/droiddeck-rockstar/Launcher64.exe",
|
||||
"usr/local/bin/droiddeck-game-env" to "usr/local/bin/droiddeck-game-env",
|
||||
"usr/local/bin/droiddeck-game-debug" to "usr/local/bin/droiddeck-game-debug",
|
||||
"usr/local/bin/droiddeck-game-gpu" to "usr/local/bin/droiddeck-game-gpu",
|
||||
"usr/local/bin/droiddeck-diagnostic-inventory" to "usr/local/bin/droiddeck-diagnostic-inventory",
|
||||
"usr/local/bin/droiddeck-wincomponents" to "usr/local/bin/droiddeck-wincomponents",
|
||||
|
||||
@@ -23,6 +23,9 @@ object SessionPaths {
|
||||
@Volatile
|
||||
private var ended: File? = null
|
||||
|
||||
@Volatile
|
||||
private var startedAt = 0L
|
||||
|
||||
@Synchronized
|
||||
fun beginOrCurrent(context: Context, label: String? = null): File {
|
||||
dir?.let { if (it.isDirectory) return it }
|
||||
@@ -38,6 +41,7 @@ object SessionPaths {
|
||||
var made = File(parent, "$day-${"%02d".format(Locale.US, number)}-$what")
|
||||
while (made.exists()) made = File(parent, "$day-${"%02d".format(Locale.US, ++number)}-$what")
|
||||
EnhancedDiagnostics.clearRecordFor(context, made)
|
||||
startedAt = System.currentTimeMillis()
|
||||
if (!made.isDirectory && !made.mkdirs()) Log.e(TAG, "could not create $made")
|
||||
dir = made
|
||||
if (enhanced && !EnhancedDiagnostics.consumeInto(context, made)) {
|
||||
@@ -49,6 +53,8 @@ object SessionPaths {
|
||||
|
||||
fun current(): File? = dir
|
||||
|
||||
fun startedAt(folder: File): Long = if (dir == folder) startedAt else 0L
|
||||
|
||||
fun currentSessionLogsRetained(context: Context): Boolean =
|
||||
dir?.let { it.parentFile == SessionFiles.logDirectory(context) } ?: true
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ import com.droiddeck.launcher.gpu.TurnipDriver
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
|
||||
private const val SCREEN_EFFECTS_PROFILE_UPSCALER_KEY = "upscaler"
|
||||
|
||||
object SessionPrefs {
|
||||
data class GameTextureFiltering(val anisotropy: Int? = null, val lodBias: String? = null)
|
||||
|
||||
@@ -514,6 +516,38 @@ object SessionPrefs {
|
||||
prefs(context).edit().putString("touch", mode).apply()
|
||||
}
|
||||
|
||||
const val PEN_MOUSE = "mouse"
|
||||
const val PEN_TOUCH = "touch"
|
||||
const val PEN_BUTTON_RIGHT = "right"
|
||||
const val PEN_BUTTON_MIDDLE = "middle"
|
||||
const val PEN_BUTTON_OFF = "off"
|
||||
|
||||
data class Pen(val mode: String = PEN_MOUSE, val button: String = PEN_BUTTON_RIGHT)
|
||||
|
||||
private val PEN_SETTINGS = mapOf(
|
||||
"pen" to setOf(PEN_MOUSE, PEN_TOUCH),
|
||||
"penButton" to setOf(PEN_BUTTON_RIGHT, PEN_BUTTON_MIDDLE, PEN_BUTTON_OFF),
|
||||
)
|
||||
|
||||
private fun penSetting(context: Context, key: String, default: String): String =
|
||||
prefs(context).getString(key, default)?.takeIf { it in PEN_SETTINGS.getValue(key) } ?: default
|
||||
|
||||
fun setPenSetting(context: Context, key: String, value: String) {
|
||||
require(value in PEN_SETTINGS.getValue(key))
|
||||
prefs(context).edit().putString(key, value).apply()
|
||||
}
|
||||
|
||||
fun penMode(context: Context): String = penSetting(context, "pen", PEN_MOUSE)
|
||||
fun penButton(context: Context): String = penSetting(context, "penButton", PEN_BUTTON_RIGHT)
|
||||
|
||||
fun pen(context: Context): Pen = Pen(penMode(context), penButton(context))
|
||||
|
||||
fun penSeen(context: Context): Boolean = prefs(context).getBoolean("penSeen", false)
|
||||
|
||||
fun setPenSeen(context: Context) {
|
||||
if (!penSeen(context)) prefs(context).edit().putBoolean("penSeen", true).apply()
|
||||
}
|
||||
|
||||
const val SHAPE_AUTO = "auto"
|
||||
const val SHAPE_WIDE = "16:9"
|
||||
const val SHAPE_EXACT = "exact"
|
||||
@@ -780,6 +814,12 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean("zramClient", on).apply()
|
||||
}
|
||||
|
||||
fun zramIdle(context: Context): Boolean = prefs(context).getBoolean("zramIdle", true)
|
||||
|
||||
fun setZramIdle(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("zramIdle", on).apply()
|
||||
}
|
||||
|
||||
fun vramCapMb(context: Context): Int = prefs(context).getInt("vramCapMb", 0).coerceAtLeast(0)
|
||||
|
||||
fun setVramCapMb(context: Context, mb: Int) {
|
||||
@@ -873,8 +913,12 @@ object SessionPrefs {
|
||||
@JvmStatic
|
||||
fun vkBridge(context: Context): Boolean = prefs(context).getBoolean("vkBridge", com.droiddeck.launcher.core.DeviceSupport.mali())
|
||||
|
||||
fun vkBridgeExplicit(context: Context): Boolean = prefs(context).contains("vkBridge")
|
||||
|
||||
fun venus(context: Context): Boolean = prefs(context).getBoolean("venus", false)
|
||||
|
||||
fun venusExplicit(context: Context): Boolean = prefs(context).contains("venus")
|
||||
|
||||
fun hostVulkanApi(context: Context): String = prefs(context).getString("hostVulkanApi", "").orEmpty()
|
||||
|
||||
fun setHostVulkanApi(context: Context, api: String) {
|
||||
@@ -1374,6 +1418,13 @@ object SessionPrefs {
|
||||
prefs(context).edit().putInt("gradientPrimary", primary).putInt("gradientSecondary", secondary).apply()
|
||||
}
|
||||
|
||||
fun trueBlackHighlight(context: Context): Int =
|
||||
prefs(context).getInt("trueBlackHighlight", com.droiddeck.launcher.ui.Themes.DEFAULT_HIGHLIGHT)
|
||||
|
||||
fun setTrueBlackHighlight(context: Context, highlight: Int) {
|
||||
prefs(context).edit().putInt("trueBlackHighlight", highlight).apply()
|
||||
}
|
||||
|
||||
private fun customResolution(context: Context, mode: String): Pair<Int, Int>? =
|
||||
parseResolution(prefs(context).getString("customRes.$mode", null))
|
||||
|
||||
@@ -1443,15 +1494,136 @@ object SessionPrefs {
|
||||
}
|
||||
|
||||
|
||||
private const val SCREEN_EFFECTS_PROFILES_KEY = "screenEffects.profiles"
|
||||
const val SCREEN_EFFECTS_ACTIVE_PROFILE_KEY = "screenEffects.activeProfile"
|
||||
|
||||
fun screenEffectsProfileId(mode: String, gameId: String?, program: String?): String? {
|
||||
if (mode == SessionService.MODE_DESKTOP) return "desktop"
|
||||
val id = gameId?.trim()?.takeIf { it.isNotEmpty() }
|
||||
if (id != null) return "game:$id"
|
||||
return if (mode == SessionService.MODE_RUN) {
|
||||
program?.trim()?.takeIf { it.isNotEmpty() }?.let { "program:$it" }
|
||||
} else null
|
||||
}
|
||||
|
||||
fun activeScreenEffectsProfileId(context: Context): String? =
|
||||
prefs(context).getString(SCREEN_EFFECTS_ACTIVE_PROFILE_KEY, null)?.takeIf { it.isNotBlank() }
|
||||
|
||||
fun setActiveScreenEffectsProfile(context: Context, profileId: String?) {
|
||||
prefs(context).edit().putString(SCREEN_EFFECTS_ACTIVE_PROFILE_KEY, profileId.orEmpty()).apply()
|
||||
}
|
||||
|
||||
fun screenEffects(context: Context): ScreenEffects {
|
||||
val text = prefs(context).getString("screenEffects", null) ?: return ScreenEffects.OFF
|
||||
return runCatching { ScreenEffects.decode(JSONObject(text)) }.getOrDefault(ScreenEffects.OFF)
|
||||
}
|
||||
|
||||
fun screenEffects(context: Context, profileId: String?): ScreenEffects {
|
||||
if (profileId.isNullOrBlank()) return screenEffects(context)
|
||||
val storedProfiles = prefs(context).getString(SCREEN_EFFECTS_PROFILES_KEY, null)
|
||||
val profile = storedProfiles?.let { raw ->
|
||||
runCatching { JSONObject(raw).optJSONObject(profileId) }.getOrNull()
|
||||
}
|
||||
return profile?.let {
|
||||
runCatching { ScreenEffects.decode(it) }.getOrDefault(ScreenEffects.OFF)
|
||||
} ?: screenEffects(context)
|
||||
}
|
||||
|
||||
fun setScreenEffects(context: Context, effects: ScreenEffects) {
|
||||
prefs(context).edit().putString("screenEffects", effects.encode().toString()).apply()
|
||||
}
|
||||
|
||||
fun setScreenEffects(context: Context, profileId: String?, effects: ScreenEffects) {
|
||||
if (profileId.isNullOrBlank()) {
|
||||
setScreenEffects(context, effects)
|
||||
return
|
||||
}
|
||||
val sessionPrefs = prefs(context)
|
||||
val profiles = runCatching {
|
||||
JSONObject(sessionPrefs.getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
|
||||
}.getOrDefault(JSONObject())
|
||||
val encoded = effects.encode()
|
||||
profiles.optJSONObject(profileId)?.let { savedProfile ->
|
||||
if (savedProfile.has(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY)) {
|
||||
encoded.put(
|
||||
SCREEN_EFFECTS_PROFILE_UPSCALER_KEY,
|
||||
savedProfile.optInt(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY),
|
||||
)
|
||||
}
|
||||
}
|
||||
profiles.put(profileId, encoded)
|
||||
sessionPrefs.edit().putString(SCREEN_EFFECTS_PROFILES_KEY, profiles.toString()).apply()
|
||||
}
|
||||
|
||||
fun hasScreenEffectsUpscalerOverride(context: Context, profileId: String?): Boolean {
|
||||
if (profileId.isNullOrBlank()) return false
|
||||
return runCatching {
|
||||
val profiles = JSONObject(prefs(context).getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
|
||||
profiles.optJSONObject(profileId)?.has(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY) == true
|
||||
}.getOrDefault(false)
|
||||
}
|
||||
|
||||
fun screenEffectsUpscaler(context: Context, profileId: String?): Int {
|
||||
if (profileId.isNullOrBlank()) return upscaler(context)
|
||||
val stored = runCatching {
|
||||
val profiles = JSONObject(prefs(context).getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
|
||||
val profile = profiles.optJSONObject(profileId)
|
||||
if (profile?.has(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY) == true) {
|
||||
profile.optInt(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY, -1)
|
||||
} else -1
|
||||
}.getOrDefault(-1)
|
||||
return if (stored >= 0) canonicalUpscaler(stored) else upscaler(context)
|
||||
}
|
||||
|
||||
fun setScreenEffectsUpscaler(context: Context, profileId: String?, mode: Int) {
|
||||
if (profileId.isNullOrBlank()) {
|
||||
setUpscaler(context, mode)
|
||||
return
|
||||
}
|
||||
val sessionPrefs = prefs(context)
|
||||
val profiles = runCatching {
|
||||
JSONObject(sessionPrefs.getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
|
||||
}.getOrDefault(JSONObject())
|
||||
val profile = profiles.optJSONObject(profileId)
|
||||
?: screenEffects(context, profileId).encode()
|
||||
profile.put(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY, canonicalUpscaler(mode))
|
||||
profiles.put(profileId, profile)
|
||||
sessionPrefs.edit().putString(SCREEN_EFFECTS_PROFILES_KEY, profiles.toString()).apply()
|
||||
}
|
||||
|
||||
fun screenEffectsProfileIds(context: Context): Set<String> {
|
||||
val profiles = runCatching {
|
||||
JSONObject(prefs(context).getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
|
||||
}.getOrElse { JSONObject() }
|
||||
return buildSet {
|
||||
val keys = profiles.keys()
|
||||
while (keys.hasNext()) add(keys.next())
|
||||
}
|
||||
}
|
||||
|
||||
fun hasScreenEffectsOverride(context: Context, profileId: String?): Boolean {
|
||||
if (profileId.isNullOrBlank()) return prefs(context).contains("screenEffects")
|
||||
return profileId in screenEffectsProfileIds(context)
|
||||
}
|
||||
|
||||
fun resetScreenEffectsProfile(context: Context, profileId: String?) {
|
||||
setScreenEffects(context, profileId, ScreenEffects.OFF)
|
||||
}
|
||||
|
||||
fun deleteScreenEffectsProfile(context: Context, profileId: String?) {
|
||||
if (profileId.isNullOrBlank()) return
|
||||
val sessionPrefs = prefs(context)
|
||||
val profiles = runCatching {
|
||||
JSONObject(sessionPrefs.getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
|
||||
}.getOrElse { JSONObject() }
|
||||
if (!profiles.has(profileId)) return
|
||||
profiles.remove(profileId)
|
||||
sessionPrefs.edit().apply {
|
||||
if (profiles.length() == 0) remove(SCREEN_EFFECTS_PROFILES_KEY)
|
||||
else putString(SCREEN_EFFECTS_PROFILES_KEY, profiles.toString())
|
||||
}.apply()
|
||||
}
|
||||
|
||||
const val CARDBOARD_KEY = "cardboard"
|
||||
|
||||
fun cardboard(context: Context): Cardboard {
|
||||
|
||||
@@ -114,7 +114,10 @@ class SessionService : Service() {
|
||||
private var freezePending = false
|
||||
private var freezeCancelled = false
|
||||
private var pendingSteamGameId: String? = null
|
||||
private var pendingSteamPreviousGameId: String? = null
|
||||
private var pendingSteamPreviousGamePending = false
|
||||
private var pendingSteamGameGeneration = -1
|
||||
private var pendingSteamGameExitWatchToken = -1
|
||||
@Volatile private var gameExitWatchToken = 0
|
||||
private val flushSteamGame = object : Runnable {
|
||||
override fun run() = flushQueuedSteamGame()
|
||||
@@ -390,9 +393,28 @@ class SessionService : Service() {
|
||||
pipTask = false
|
||||
SessionState.program = intent?.getStringExtra(EXTRA_PROGRAM)
|
||||
SessionState.programArgs = intent?.getStringArrayExtra(EXTRA_PROGRAM_ARGS)?.toList().orEmpty()
|
||||
SessionState.gameId = intent?.getStringExtra(EXTRA_GAME_ID)
|
||||
SessionState.steamUi = intent?.getStringExtra(EXTRA_STEAM_UI)
|
||||
SessionState.steamUrl = intent?.getStringExtra(EXTRA_STEAM_URL)
|
||||
val steamUrlGameId = SessionState.steamUrl
|
||||
?.let { url ->
|
||||
when {
|
||||
url.startsWith(GAME_URL_PREFIX) ->
|
||||
url.removePrefix(GAME_URL_PREFIX)
|
||||
url.startsWith("steam://run/") ->
|
||||
url.removePrefix("steam://run/")
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
?.takeIf(GameLaunchLink::validId)
|
||||
val resolvedGameId = intent?.getStringExtra(EXTRA_GAME_ID)
|
||||
?.trim()
|
||||
?.takeIf(GameLaunchLink::validId)
|
||||
?: steamUrlGameId
|
||||
SessionState.gameId = resolvedGameId
|
||||
SessionPrefs.setActiveScreenEffectsProfile(
|
||||
this,
|
||||
SessionPrefs.screenEffectsProfileId(SessionState.mode, resolvedGameId, SessionState.program),
|
||||
)
|
||||
com.droiddeck.launcher.stores.battlenet.BattleNetClient.clearRequests(LinuxRuntime.sessionRoot(this))
|
||||
val gen = synchronized(stopLock) {
|
||||
SessionState.steamClientArch = null
|
||||
@@ -413,8 +435,9 @@ class SessionService : Service() {
|
||||
if (SessionPrefs.clearCachedApps(this)) clearCachedApps()
|
||||
cancelQueuedSteamGame(clearMailbox = false)
|
||||
clearSteamGameMailbox()
|
||||
if (SessionState.mode == MODE_STEAM) SessionState.steamUrl
|
||||
?.takeIf { it.startsWith(GAME_URL_PREFIX) }?.let { watchGameExit(it.removePrefix(GAME_URL_PREFIX), gen) }
|
||||
if (SessionState.mode == MODE_STEAM) {
|
||||
resolvedGameId?.let { watchGameExit(it, gen, ++gameExitWatchToken) }
|
||||
}
|
||||
acquireLocks()
|
||||
Thread({
|
||||
OrphanReaper.reap("session starting")
|
||||
@@ -893,7 +916,7 @@ class SessionService : Service() {
|
||||
if (EnhancedDiagnostics.isActive(this, sessionDir)) SessionEvents.record("diagnostics.enhanced", mapOf("schema" to 1))
|
||||
DeviceReport.write(this, File(sessionDir, "device.txt"), SessionState.mode)
|
||||
NetworkReport.write(this, File(sessionDir, "network.txt"))
|
||||
SessionLogCapture.start(File(sessionDir, "app.log"))
|
||||
SessionLogCapture.start(File(sessionDir, "app.log"), SessionPaths.startedAt(sessionDir))
|
||||
MemoryLog.start()
|
||||
return sessionDir
|
||||
}
|
||||
@@ -1014,13 +1037,13 @@ class SessionService : Service() {
|
||||
guest.add("BL_ZRAM=1")
|
||||
if (steamHere) SessionPrefs.ramCapMb(this).takeIf { it > 0 }?.let { guest.add("BL_RAM_CAP_MB=$it") }
|
||||
if (!SessionPrefs.zramClient(this)) guest.add("BL_ZRAM_CLIENT=0")
|
||||
if (!SessionPrefs.zramIdle(this)) guest.add("BL_ZRAM_IDLE=0")
|
||||
}
|
||||
SessionPrefs.vramCapMb(this).takeIf { it > 0 }?.let { guest.add("BL_VRAM_MB=$it") }
|
||||
guest.add("AUDIO_DIRECT_DECAY=0")
|
||||
val extra = extraEnv() + agentEnvironment
|
||||
mapOf("TU_DEBUG" to (tuOverride ?: if (tuDriver) "sysmem" else ""), "MESA_NO_ERROR" to "").forEach { (name, game) ->
|
||||
if (extra.none { it.startsWith("$name=") }) guest.add("$GAME_PREFIX$name=$game")
|
||||
}
|
||||
guest.addAll(TurnipEnvironment.gameEnvironment(tuOverride, tuDriver, SessionPrefs.tuSysmem(this), extra))
|
||||
if (extra.none { it.startsWith("MESA_NO_ERROR=") }) guest.add("${GAME_PREFIX}MESA_NO_ERROR=")
|
||||
extra.forEach { guest.add(it) }
|
||||
com.droiddeck.launcher.gpu.TpUbwcHint.forThisDevice(this)?.let { guest.add("${com.droiddeck.launcher.gpu.TpUbwcHint.ENV}=$it") }
|
||||
val clientPinned = steamHere && SessionPrefs.clientCpusOverride(this)
|
||||
@@ -1521,7 +1544,19 @@ class SessionService : Service() {
|
||||
return
|
||||
}
|
||||
val accepted = gameId!!
|
||||
if (pendingSteamGameId != null) Log.i(TAG, "replacing a queued game launch with $accepted")
|
||||
if (!pendingSteamPreviousGamePending) {
|
||||
pendingSteamPreviousGameId = SessionState.gameId
|
||||
pendingSteamPreviousGamePending = true
|
||||
}
|
||||
if (pendingSteamGameId != null) {
|
||||
Log.i(TAG, "replacing queued game ${pendingSteamGameId} with $accepted")
|
||||
}
|
||||
pendingSteamGameExitWatchToken = ++gameExitWatchToken
|
||||
SessionState.gameId = accepted
|
||||
val effectsProfileId = SessionPrefs.screenEffectsProfileId(MODE_STEAM, accepted, null)
|
||||
SessionPrefs.setActiveScreenEffectsProfile(this, effectsProfileId)
|
||||
SessionPrefs.screenEffects(this, effectsProfileId)
|
||||
.push(SessionPrefs.screenEffectsUpscaler(this, effectsProfileId))
|
||||
pendingSteamGameId = accepted
|
||||
pendingSteamGameGeneration = sessionGen
|
||||
if (SessionState.suspended) resumeSession()
|
||||
@@ -1532,9 +1567,29 @@ class SessionService : Service() {
|
||||
private fun flushQueuedSteamGame() {
|
||||
val gameId = pendingSteamGameId ?: return
|
||||
val gen = pendingSteamGameGeneration
|
||||
val exitWatchToken = pendingSteamGameExitWatchToken
|
||||
if (exitWatchToken != gameExitWatchToken) return
|
||||
if (gen != sessionGen || !SessionState.running || SessionState.stopRequested ||
|
||||
SessionState.mode != MODE_STEAM || !GameLaunchLink.validId(gameId)) {
|
||||
SessionState.mode != MODE_STEAM || SessionState.gameId != gameId ||
|
||||
!GameLaunchLink.validId(gameId)) {
|
||||
val previousGameId = pendingSteamPreviousGameId
|
||||
val queuedProfileId = SessionPrefs.screenEffectsProfileId(MODE_STEAM, gameId, null)
|
||||
val canRestore = gen == sessionGen &&
|
||||
SessionState.running && !SessionState.stopRequested &&
|
||||
SessionState.mode == MODE_STEAM &&
|
||||
SessionState.gameId == gameId &&
|
||||
SessionPrefs.activeScreenEffectsProfileId(this) == queuedProfileId
|
||||
|
||||
cancelQueuedSteamGame()
|
||||
|
||||
if (canRestore) {
|
||||
SessionState.gameId = previousGameId
|
||||
val previousProfileId =
|
||||
SessionPrefs.screenEffectsProfileId(MODE_STEAM, previousGameId, null)
|
||||
SessionPrefs.setActiveScreenEffectsProfile(this, previousProfileId)
|
||||
SessionPrefs.screenEffects(this, previousProfileId)
|
||||
.push(SessionPrefs.screenEffectsUpscaler(this, previousProfileId))
|
||||
}
|
||||
return
|
||||
}
|
||||
if (SessionState.suspended) {
|
||||
@@ -1561,33 +1616,95 @@ class SessionService : Service() {
|
||||
}
|
||||
pendingSteamGameId = null
|
||||
pendingSteamGameGeneration = -1
|
||||
pendingSteamGameExitWatchToken = -1
|
||||
SessionEvents.record("steam.game_launch_requested", mapOf("gameId" to gameId, "generation" to gen))
|
||||
watchGameExit(gameId, gen)
|
||||
watchGameExit(gameId, gen, exitWatchToken, pendingSteamPreviousGameId)
|
||||
Log.i(TAG, "queued Steam game $gameId for the running client")
|
||||
}
|
||||
|
||||
private fun watchGameExit(gameId: String, gen: Int) {
|
||||
if (!SessionPrefs.returnAfterGame(this)) return
|
||||
val token = ++gameExitWatchToken
|
||||
private fun watchGameExit(
|
||||
gameId: String,
|
||||
gen: Int,
|
||||
token: Int,
|
||||
previousGameId: String? = null
|
||||
) {
|
||||
Thread({
|
||||
val startBy = android.os.SystemClock.elapsedRealtime() + GAME_START_TIMEOUT_MS
|
||||
var startupRemaining = GAME_START_TIMEOUT_MS
|
||||
var lastStartupCheck = android.os.SystemClock.elapsedRealtime()
|
||||
var startupWasSuspended = false
|
||||
var seen = false
|
||||
var goneSince = 0L
|
||||
while (token == gameExitWatchToken && gen == sessionGen && SessionState.running && !SessionState.stopRequested) {
|
||||
val now = android.os.SystemClock.elapsedRealtime()
|
||||
if (steamGameRunning()) {
|
||||
if (!seen) Log.i(TAG, "game $gameId started; returning to the launcher when it closes")
|
||||
val startupSuspended = SessionState.suspended || SessionState.suspending || SessionState.phase != SessionPhase.READY
|
||||
if (!seen) {
|
||||
if (startupSuspended) {
|
||||
startupWasSuspended = true
|
||||
lastStartupCheck = now
|
||||
} else if (startupWasSuspended) {
|
||||
startupWasSuspended = false
|
||||
lastStartupCheck = now
|
||||
} else {
|
||||
startupRemaining -= (now - lastStartupCheck).coerceAtLeast(0L)
|
||||
lastStartupCheck = now
|
||||
}
|
||||
}
|
||||
if (steamGameRunning(gameId)) {
|
||||
if (!seen) {
|
||||
Log.i(TAG, "game $gameId started; tracking its exit")
|
||||
mainHandler.post {
|
||||
if (token == gameExitWatchToken && gen == sessionGen &&
|
||||
pendingSteamPreviousGamePending &&
|
||||
pendingSteamPreviousGameId == previousGameId) {
|
||||
pendingSteamPreviousGameId = null
|
||||
pendingSteamPreviousGamePending = false
|
||||
}
|
||||
}
|
||||
}
|
||||
seen = true
|
||||
goneSince = 0L
|
||||
} else if (!seen) {
|
||||
if (now > startBy) {
|
||||
Log.i(TAG, "game $gameId did not start; not watching for its exit")
|
||||
if (!startupSuspended && startupRemaining <= 0L) {
|
||||
mainHandler.post {
|
||||
if (token != gameExitWatchToken || gen != sessionGen ||
|
||||
!SessionState.running || SessionState.stopRequested) {
|
||||
return@post
|
||||
}
|
||||
|
||||
if (previousGameId != null && steamGameRunning(previousGameId)) {
|
||||
Log.w(TAG, "game $gameId did not start; restoring previous game $previousGameId")
|
||||
SessionState.gameId = previousGameId
|
||||
val previousProfileId =
|
||||
SessionPrefs.screenEffectsProfileId(MODE_STEAM, previousGameId, null)
|
||||
val failedGameProfileId =
|
||||
SessionPrefs.screenEffectsProfileId(MODE_STEAM, gameId, null)
|
||||
if (SessionPrefs.activeScreenEffectsProfileId(this@SessionService) == failedGameProfileId) {
|
||||
SessionPrefs.setActiveScreenEffectsProfile(this@SessionService, previousProfileId)
|
||||
SessionPrefs.screenEffects(this@SessionService, previousProfileId)
|
||||
.push(SessionPrefs.screenEffectsUpscaler(this@SessionService, previousProfileId))
|
||||
}
|
||||
pendingSteamPreviousGameId = null
|
||||
pendingSteamPreviousGamePending = false
|
||||
watchGameExit(previousGameId, gen, token)
|
||||
} else {
|
||||
Log.i(TAG, "game $gameId did not start; clearing its screen effects profile")
|
||||
pendingSteamPreviousGameId = null
|
||||
pendingSteamPreviousGamePending = false
|
||||
clearActiveScreenEffectsProfile(gameId, gen, token)
|
||||
}
|
||||
}
|
||||
return@Thread
|
||||
}
|
||||
} else if (goneSince == 0L) {
|
||||
goneSince = now
|
||||
} else if (now - goneSince >= GAME_EXIT_GRACE_MS) {
|
||||
mainHandler.post { returnAfterGame(gameId, gen, token) }
|
||||
mainHandler.post {
|
||||
if (SessionPrefs.returnAfterGame(this@SessionService)) {
|
||||
returnAfterGame(gameId, gen, token)
|
||||
} else {
|
||||
clearActiveScreenEffectsProfile(gameId, gen, token)
|
||||
}
|
||||
}
|
||||
return@Thread
|
||||
}
|
||||
try { Thread.sleep(GAME_EXIT_POLL_MS) } catch (e: InterruptedException) { return@Thread }
|
||||
@@ -1595,17 +1712,52 @@ class SessionService : Service() {
|
||||
}, "game-exit-watch").start()
|
||||
}
|
||||
|
||||
private fun returnAfterGame(gameId: String, gen: Int, token: Int) {
|
||||
if (token != gameExitWatchToken || gen != sessionGen || !SessionState.running ||
|
||||
SessionState.stopRequested || SessionState.mode != MODE_STEAM || !SessionPrefs.returnAfterGame(this)) return
|
||||
val written = runCatching { File(LinuxRuntime.sessionRoot(this), "steam-stop").writeText("") }
|
||||
.onFailure { Log.w(TAG, "could not ask the client to exit after game $gameId", it) }.isSuccess
|
||||
if (!written) return
|
||||
SessionEvents.record("steam.return_after_game", mapOf("gameId" to gameId))
|
||||
Log.i(TAG, "game $gameId closed: asking the client to exit and returning to the launcher")
|
||||
private fun clearActiveScreenEffectsProfile(gameId: String, gen: Int, token: Int) {
|
||||
if (token != gameExitWatchToken || gen != sessionGen || !SessionState.running || SessionState.stopRequested) return
|
||||
val gameProfileId = SessionPrefs.screenEffectsProfileId(MODE_STEAM, gameId, null)
|
||||
if (SessionPrefs.activeScreenEffectsProfileId(this) != gameProfileId) return
|
||||
SessionPrefs.setActiveScreenEffectsProfile(this, null)
|
||||
SessionPrefs.screenEffects(this, null).push(SessionPrefs.screenEffectsUpscaler(this, null))
|
||||
}
|
||||
|
||||
private fun steamGameRunning(): Boolean = SteamGameProcess.running()
|
||||
private fun returnAfterGame(gameId: String, gen: Int, token: Int) {
|
||||
mainHandler.postDelayed({
|
||||
if (token != gameExitWatchToken || gen != sessionGen || !SessionState.running ||
|
||||
SessionState.stopRequested || SessionState.mode != MODE_STEAM ||
|
||||
SessionState.gameId != gameId || pendingSteamGameId != null) {
|
||||
return@postDelayed
|
||||
}
|
||||
|
||||
if (steamGameRunning(gameId)) {
|
||||
Log.i(TAG, "game $gameId is running again; restarting its exit watcher")
|
||||
watchGameExit(gameId, gen, token)
|
||||
return@postDelayed
|
||||
}
|
||||
|
||||
if (SteamGameProcess.running()) {
|
||||
Log.i(TAG, "another Steam game is still running after $gameId; checking again")
|
||||
returnAfterGame(gameId, gen, token)
|
||||
return@postDelayed
|
||||
}
|
||||
|
||||
clearActiveScreenEffectsProfile(gameId, gen, token)
|
||||
|
||||
if (!SessionPrefs.returnAfterGame(this)) {
|
||||
Log.i(TAG, "return after game disabled; keeping the Steam session open")
|
||||
return@postDelayed
|
||||
}
|
||||
|
||||
val written = runCatching { File(LinuxRuntime.sessionRoot(this), "steam-stop").writeText("") }
|
||||
.onFailure { Log.w(TAG, "could not ask the client to exit after game $gameId", it) }.isSuccess
|
||||
if (!written) return@postDelayed
|
||||
|
||||
SessionEvents.record("steam.return_after_game", mapOf("gameId" to gameId))
|
||||
Log.i(TAG, "game $gameId closed: asking the client to exit and returning to the launcher")
|
||||
}, GAME_EXIT_CONFIRM_MS)
|
||||
}
|
||||
|
||||
private fun steamGameRunning(gameId: String): Boolean =
|
||||
SteamGameProcess.running(gameId)
|
||||
|
||||
private fun resumeSession(panelVisible: Boolean = true) {
|
||||
if (SessionState.suspended) SessionState.resumeRequested = true
|
||||
@@ -1625,7 +1777,11 @@ class SessionService : Service() {
|
||||
private fun cancelQueuedSteamGame(clearMailbox: Boolean = true) {
|
||||
mainHandler.removeCallbacks(flushSteamGame)
|
||||
pendingSteamGameId = null
|
||||
pendingSteamPreviousGameId = null
|
||||
pendingSteamPreviousGamePending = false
|
||||
pendingSteamGameGeneration = -1
|
||||
pendingSteamGameExitWatchToken = -1
|
||||
gameExitWatchToken++
|
||||
if (clearMailbox) clearSteamGameMailbox()
|
||||
}
|
||||
|
||||
@@ -2108,10 +2264,11 @@ class SessionService : Service() {
|
||||
syncWatcher = null
|
||||
val prootPid = sessionPid
|
||||
sessionPid = -1
|
||||
// The kept shell goes through the same teardown, which reads its descendants before signalling it.
|
||||
val shell = SessionTerminal.detach(sessionGen)?.let { pid -> readStat(pid)?.second?.let { pid to it } }
|
||||
val auxiliary = synchronized(auxiliaryProcessesLock) {
|
||||
auxiliaryProcesses.toMap().also { auxiliaryProcesses.clear() }
|
||||
}
|
||||
SessionTerminal.clear(sessionGen)
|
||||
} + listOfNotNull(shell)
|
||||
BottomDesktop.stop(this, stoppedGen)
|
||||
val controller = suspendController
|
||||
suspendController = null
|
||||
@@ -2448,6 +2605,7 @@ class SessionService : Service() {
|
||||
private const val GAME_URL_PREFIX = "steam://rungameid/"
|
||||
private const val GAME_START_TIMEOUT_MS = 20 * 60_000L
|
||||
private const val GAME_EXIT_GRACE_MS = 10_000L
|
||||
private const val GAME_EXIT_CONFIRM_MS = 2_000L
|
||||
private const val GAME_EXIT_POLL_MS = 2_000L
|
||||
private const val NO_PAD_SWITCH = "Download/droiddeck-no-pad"
|
||||
private const val NO_UINPUT_SWITCH = "Download/droiddeck-no-uinput"
|
||||
|
||||
@@ -14,6 +14,12 @@ object SessionTerminal {
|
||||
|
||||
@Volatile private var launch: Launch? = null
|
||||
|
||||
private class Kept(val session: TerminalSession, val generation: Int)
|
||||
|
||||
// The bottom screen's presentation is dismissed whenever another app covers that display
|
||||
// (a browser opened for a sign-in), so its shell is kept for the next panel.
|
||||
@Volatile private var kept: Kept? = null
|
||||
|
||||
fun prepare(
|
||||
command: List<String>,
|
||||
hostEnvironment: Array<String>,
|
||||
@@ -32,8 +38,41 @@ object SessionTerminal {
|
||||
).also { it.mSessionName = "DroidDeck Linux shell" }
|
||||
}
|
||||
|
||||
fun reuse(client: TerminalSessionClient): TerminalSession? {
|
||||
val current = kept ?: return null
|
||||
if (current.generation != launch?.generation || !current.session.isRunning) {
|
||||
kept = null
|
||||
return null
|
||||
}
|
||||
current.session.updateTerminalSessionClient(client)
|
||||
return current.session
|
||||
}
|
||||
|
||||
fun keep(session: TerminalSession) {
|
||||
val generation = launch?.generation ?: return
|
||||
kept = Kept(session, generation)
|
||||
}
|
||||
|
||||
fun release(session: TerminalSession?) {
|
||||
if (session != null && kept?.session === session) kept = null
|
||||
}
|
||||
|
||||
fun clear(generation: Int? = null) {
|
||||
val current = launch ?: return
|
||||
if (generation == null || current.generation == generation) launch = null
|
||||
if (generation == null || current.generation == generation) {
|
||||
launch = null
|
||||
kept?.session?.takeIf { it.pid > 0 }?.finishIfRunning()
|
||||
kept = null
|
||||
}
|
||||
}
|
||||
|
||||
/** Ends this generation's terminal without killing its shell, and returns the shell's pid if it still runs. */
|
||||
fun detach(generation: Int): Int? {
|
||||
val current = launch ?: return null
|
||||
if (current.generation != generation) return null
|
||||
launch = null
|
||||
val pid = kept?.session?.takeIf { it.isRunning && it.pid > 0 }?.pid
|
||||
kept = null
|
||||
return pid
|
||||
}
|
||||
}
|
||||
@@ -16,11 +16,11 @@ object SettingsReset {
|
||||
"dualScreenMode", "dualScreenSessionMode", "dualScreenLauncher", "dualScreenSessionControls", "androidTextFieldKeyboard",
|
||||
"gameStoresEnabled", "soundtracksEnabled", "soundtracksIngame", "gameStoresSpeedTier", "gameStoresParallel", "storesOpenTab", "storesShowMature",
|
||||
"storesInstallLanguage",
|
||||
"hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "__KEEP_droidDeckHud__", "__KEEP_droidDeckHudPos__", "backHold", "backActionsInverted", "backDoubleTapMs", "touch", "osc", "shape", "steamController",
|
||||
"hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "__KEEP_droidDeckHud__", "__KEEP_droidDeckHudPos__", "backHold", "backActionsInverted", "backDoubleTapMs", "touch", "pen", "penButton", "osc", "shape", "steamController",
|
||||
"gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "unfoldedControlsWithController",
|
||||
"stretch16x9", "picturePosition", "railLabels", "agentTab", "navTabOrder", "navTabShelved", "navTabHidden", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys",
|
||||
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
|
||||
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "paceCores", "ramCapMb", "vramCapMb", "zramClient",
|
||||
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "paceCores", "ramCapMb", "vramCapMb", "zramClient", "zramIdle",
|
||||
"directAudio", "mic", "wifiDiscovery", "clientCpusOverride", "clientCpus", "gameCpus",
|
||||
"noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "nativeUserland", "cursorComposite",
|
||||
"guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", "buildWatermark",
|
||||
|
||||
@@ -5,14 +5,59 @@ import java.io.File
|
||||
object SteamGameProcess {
|
||||
fun matches(cmdline: ByteArray): Boolean {
|
||||
val args = String(cmdline).split('\u0000')
|
||||
for (i in args.indices) {
|
||||
if (args[i] == "waitforexitandrun") return true
|
||||
if (args[i] == "SteamLaunch" && args.getOrNull(i + 1)?.startsWith("AppId=") == true) return true
|
||||
return args.indices.any { i ->
|
||||
args[i] == "waitforexitandrun" ||
|
||||
(args[i] == "SteamLaunch" &&
|
||||
args.getOrNull(i + 1)?.startsWith("AppId=") == true)
|
||||
}
|
||||
}
|
||||
|
||||
fun running(): Boolean =
|
||||
File("/proc").listFiles()?.any { p ->
|
||||
p.name.all(Char::isDigit) &&
|
||||
runCatching { File(p, "cmdline").readBytes() }
|
||||
.getOrNull()?.let(::matches) == true
|
||||
} == true
|
||||
private fun steamAppIdForGameId(gameId: String): String? {
|
||||
if (gameId.isEmpty() || !gameId.all(Char::isDigit)) return null
|
||||
|
||||
val numericId = gameId.toULongOrNull() ?: return null
|
||||
val appId = if (numericId > UInt.MAX_VALUE.toULong()) {
|
||||
numericId shr 32
|
||||
} else {
|
||||
numericId
|
||||
}
|
||||
|
||||
return appId.takeIf { it != 0uL }?.toString()
|
||||
}
|
||||
|
||||
fun matches(cmdline: ByteArray, gameId: String): Boolean {
|
||||
val expectedAppId = steamAppIdForGameId(gameId) ?: return false
|
||||
val args = String(cmdline).split('\u0000')
|
||||
|
||||
for (i in args.indices) {
|
||||
if (args[i] == "SteamLaunch") {
|
||||
val appId = args.getOrNull(i + 1)
|
||||
?.takeIf { it.startsWith("AppId=") }
|
||||
?.removePrefix("AppId=")
|
||||
|
||||
if (appId == expectedAppId) return true
|
||||
}
|
||||
|
||||
if (args[i] == "-applaunch" &&
|
||||
args.getOrNull(i + 1) == expectedAppId
|
||||
) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
fun running(proc: File = File("/proc")): Boolean = proc.listFiles()?.any { p ->
|
||||
p.name.all(Char::isDigit) && runCatching { File(p, "cmdline").readBytes() }.getOrNull()?.let(::matches) == true
|
||||
} == true
|
||||
fun running(gameId: String, proc: File = File("/proc")): Boolean =
|
||||
proc.listFiles()?.any { p ->
|
||||
p.name.all(Char::isDigit) &&
|
||||
runCatching { File(p, "cmdline").readBytes() }
|
||||
.getOrNull()?.let { matches(it, gameId) } == true
|
||||
} == true
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
internal object TurnipEnvironment {
|
||||
const val GAME_TU_DEBUG = "DROIDDECK_GAME_TU_DEBUG"
|
||||
|
||||
fun gameEnvironment(
|
||||
tuOverride: String?,
|
||||
tuDriver: Boolean,
|
||||
tuSysmem: Boolean,
|
||||
extra: List<String>,
|
||||
): List<String> = if (extra.none { it.startsWith("TU_DEBUG=") }) {
|
||||
listOf("$GAME_TU_DEBUG=${tuOverride ?: if (tuDriver || tuSysmem) "sysmem" else ""}")
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
@@ -25,9 +25,11 @@ object CloudSaves {
|
||||
private const val PARALLEL = 6
|
||||
private const val CLOUD_LAYOUT = 2
|
||||
|
||||
class Result(val result: String, val files: Int, val bytes: Long, val reason: String, val conflicts: Int = 0) {
|
||||
class Result(val result: String, val files: Int, val bytes: Long, val reason: String, val conflicts: Int = 0, val detail: String = "") {
|
||||
val ok: Boolean get() = result != "failed"
|
||||
val line: String get() = "result=$result files=$files bytes=$bytes reason=$reason" + if (conflicts > 0) " conflicts=$conflicts" else ""
|
||||
val line: String get() = "result=$result files=$files bytes=$bytes reason=$reason" +
|
||||
(if (conflicts > 0) " conflicts=$conflicts" else "") +
|
||||
if (detail.isNotEmpty()) " detail=\"$detail\"" else ""
|
||||
}
|
||||
|
||||
class Status(val supported: Boolean, val folder: File?, val lastSync: Long, val reason: String, val conflicts: List<String> = emptyList())
|
||||
@@ -126,7 +128,7 @@ object CloudSaves {
|
||||
)
|
||||
if (picked == null) GogConfig("", "") else GogConfig(picked.name, picked.template)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "gog remote-config: ${e.javaClass.simpleName}")
|
||||
Log.w(TAG, "gog remote-config: ${cloudFailureDetail(e)}")
|
||||
null
|
||||
}
|
||||
}
|
||||
@@ -166,7 +168,7 @@ object CloudSaves {
|
||||
val galaxy = GogAuth.validToken(context)
|
||||
val clientId = gogClientId(context, id, folder)
|
||||
if (userId.isEmpty() || galaxy == null || clientId == null) null
|
||||
else GogCloud(userId, clientId, gogScopedToken(context, id, clientId) ?: galaxy, gogLocationName(context, id, folder))
|
||||
else GogCloud(userId, clientId, gogScopedToken(context, id, clientId) ?: galaxy, gogLocationName(context, id, folder), tempDir = context.cacheDir)
|
||||
}
|
||||
Store.EPIC -> {
|
||||
val token = EpicCredentialStore.getValidAccessToken(context)
|
||||
@@ -312,7 +314,7 @@ object CloudSaves {
|
||||
rememberNoCloud(prefs(context, store), id)
|
||||
Result("skipped", 0, 0, "no-cloud-saves")
|
||||
} catch (e: Exception) {
|
||||
Result("failed", 0, 0, e.javaClass.simpleName)
|
||||
Result("failed", 0, 0, e.javaClass.simpleName, detail = cloudFailureDetail(e))
|
||||
}
|
||||
return done(store, id, way, result)
|
||||
}
|
||||
|
||||
@@ -59,6 +59,69 @@ private fun httpDate(s: String?): Long = try {
|
||||
SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).apply { timeZone = TimeZone.getTimeZone("GMT") }.parse(s!!.trim())?.time ?: -1L
|
||||
} catch (e: Exception) { -1L }
|
||||
|
||||
private val SECRET_PARAM = Regex("(?i)(token|secret|code|password|authorization)([\"']?\\s*[:=]\\s*[\"']?)[^\\s&\"',;}]+")
|
||||
private val BEARER = Regex("(?i)bearer\\s+\\S+")
|
||||
private val URL_TEXT = Regex("(?i)https?://(?:[^/\\s?#@]*@)?([^/\\s?#@]+)[^\\s]*")
|
||||
private val LONG_TOKEN = Regex("[A-Za-z0-9._~+/=-]{32,}")
|
||||
private val SPACES = Regex("\\s+")
|
||||
private const val DETAIL_MAX = 400
|
||||
|
||||
internal fun scrubCloudText(text: String, longTokens: Boolean = true): String = text
|
||||
.replace(BEARER, "Bearer <redacted>")
|
||||
.replace(URL_TEXT) { it.groupValues[1] }
|
||||
.replace(SECRET_PARAM) { it.groupValues[1] + it.groupValues[2] + "<redacted>" }
|
||||
.let { if (longTokens) it.replace(LONG_TOKEN, "<redacted>") else it }
|
||||
.replace(SPACES, " ")
|
||||
.trim()
|
||||
|
||||
internal fun cloudFailureDetail(e: Throwable): String {
|
||||
val parts = ArrayList<String>()
|
||||
var t: Throwable? = e
|
||||
while (t != null && parts.size < 3) {
|
||||
val message = t.message?.let { scrubCloudText(it, longTokens = false) }.orEmpty()
|
||||
parts += if (message.isEmpty()) t.javaClass.simpleName else "${t.javaClass.simpleName}: $message"
|
||||
t = t.cause?.takeIf { it !== t }
|
||||
}
|
||||
return parts.joinToString(" <- ").take(DETAIL_MAX)
|
||||
}
|
||||
|
||||
private const val SNIPPET_READ_MAX = 4096
|
||||
private const val SNIPPET_MAX = 120
|
||||
|
||||
private data class CloudErrorPrefix(val text: String, val truncated: Boolean) {
|
||||
fun snippet(): String {
|
||||
val safe = if (truncated) text.substring(0, text.indexOfLast { it.isWhitespace() }.coerceAtLeast(0)) else text
|
||||
return scrubCloudText(safe).take(SNIPPET_MAX)
|
||||
}
|
||||
}
|
||||
|
||||
private fun cloudErrorPrefix(input: InputStream?): CloudErrorPrefix {
|
||||
if (input == null) return CloudErrorPrefix("", false)
|
||||
return input.use { stream ->
|
||||
val buffer = ByteArray(SNIPPET_READ_MAX + 1)
|
||||
var read = 0
|
||||
while (read < buffer.size) {
|
||||
val n = stream.read(buffer, read, buffer.size - read)
|
||||
if (n < 0) break
|
||||
read += n
|
||||
}
|
||||
CloudErrorPrefix(buffer.decodeToString(0, minOf(read, SNIPPET_READ_MAX)), read > SNIPPET_READ_MAX)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun cloudErrorSnippet(input: InputStream?): String =
|
||||
cloudErrorPrefix(input).snippet()
|
||||
|
||||
private fun HttpURLConnection.errorSnippet(): String =
|
||||
runCatching { cloudErrorSnippet(errorStream) }.getOrDefault("")
|
||||
|
||||
private fun httpFailure(step: String, name: String?, code: Int, error: String): java.io.IOException =
|
||||
java.io.IOException(buildString {
|
||||
append("GOG cloud ").append(step).append(" HTTP ").append(code)
|
||||
if (name != null) append(" file=").append(name)
|
||||
if (error.isNotEmpty()) append(" body=").append(error)
|
||||
})
|
||||
|
||||
internal fun isGzip(data: ByteArray) =
|
||||
data.size >= 10 && data[0] == 0x1f.toByte() && data[1] == 0x8b.toByte() && data[2] == 0x08.toByte()
|
||||
|
||||
@@ -183,6 +246,8 @@ private fun gzipFile(src: File, dst: File): GzipFile {
|
||||
}
|
||||
}
|
||||
|
||||
internal const val GOG_CLOUD_UA = "GOGGalaxyCommunicationService/2.0.13.27 (Windows_32bit) dont_sync_marker/true installation_source/gog"
|
||||
|
||||
/** GOG Galaxy parses `X-Object-Meta-LocalLastModified`; objects without it fail as "invalid data". */
|
||||
private val GOG_STAMP = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx", Locale.US)
|
||||
|
||||
@@ -195,9 +260,10 @@ class GogCloud(
|
||||
private val token: String,
|
||||
private val location: String? = null,
|
||||
baseUrl: String? = null,
|
||||
private val tempDir: File? = null,
|
||||
) : CloudTransport {
|
||||
private val base = baseUrl ?: "https://cloudstorage.gog.com/v1/$userId/$clientId"
|
||||
private val ua = "GOG Galaxy"
|
||||
private val ua = GOG_CLOUD_UA
|
||||
private var prefix: String? = location?.let { "$it/" }
|
||||
|
||||
private fun key(name: String) = URLEncoder.encode(name, "UTF-8").replace("+", "%20")
|
||||
@@ -209,10 +275,10 @@ class GogCloud(
|
||||
val code = c.responseCode
|
||||
if (code == 404) { c.disconnect(); return emptyList() }
|
||||
if (code !in 200..299) {
|
||||
val err = runCatching { c.errorStream?.readBytes()?.decodeToString().orEmpty() }.getOrDefault("")
|
||||
val err = runCatching { cloudErrorPrefix(c.errorStream) }.getOrDefault(CloudErrorPrefix("", false))
|
||||
c.disconnect()
|
||||
if ("not_enabled_for_client" in err || "disabled" in err) throw NoCloudSaves()
|
||||
throw java.io.IOException("GOG cloud list HTTP $code")
|
||||
if ("not_enabled_for_client" in err.text || "disabled" in err.text) throw NoCloudSaves()
|
||||
throw httpFailure("list", null, code, err.snippet())
|
||||
}
|
||||
val text = c.body().decodeToString().trim()
|
||||
c.disconnect()
|
||||
@@ -255,12 +321,20 @@ class GogCloud(
|
||||
override fun get(file: CloudFile): Pair<ByteArray, Long> {
|
||||
val c = open("$base/${cloudKey(file.name)}", "GET", token, ua)
|
||||
c.setRequestProperty("Accept-Encoding", "identity")
|
||||
if (c.responseCode !in 200..299) { val code = c.responseCode; c.disconnect(); throw java.io.IOException("GOG cloud get HTTP $code") }
|
||||
if (c.responseCode !in 200..299) {
|
||||
val code = c.responseCode
|
||||
val err = c.errorSnippet()
|
||||
c.disconnect()
|
||||
throw httpFailure("get", file.name, code, err)
|
||||
}
|
||||
val modified = httpDate(c.getHeaderField("Last-Modified"))
|
||||
val encoding = c.getHeaderField("Content-Encoding")
|
||||
val data = c.body()
|
||||
c.disconnect()
|
||||
return gogDecodeCloudBody(data, encoding) to modified
|
||||
val data = try { c.body() } finally { c.disconnect() }
|
||||
return try {
|
||||
gogDecodeCloudBody(data, encoding) to modified
|
||||
} catch (e: java.io.IOException) {
|
||||
throw java.io.IOException("GOG cloud get file=${file.name} bytes=${data.size} encoding=$encoding", e)
|
||||
}
|
||||
}
|
||||
|
||||
override fun put(files: Map<String, ByteArray>, modifiedMs: Map<String, Long>): Map<String, Long> = files.mapValues { (name, data) ->
|
||||
@@ -269,7 +343,11 @@ class GogCloud(
|
||||
}
|
||||
|
||||
override fun putFiles(files: Map<String, File>, modifiedMs: Map<String, Long>): Map<String, CloudPut> = files.mapValues { (name, file) ->
|
||||
val compressed = File.createTempFile("gog-cloud-", ".gz")
|
||||
val compressed = try {
|
||||
File.createTempFile("gog-cloud-", ".gz", tempDir?.apply { mkdirs() })
|
||||
} catch (e: java.io.IOException) {
|
||||
throw java.io.IOException("GOG cloud put file=$name temp file", e)
|
||||
}
|
||||
try {
|
||||
val gz = gzipFile(file, compressed)
|
||||
val modified = putBody(name, compressed.inputStream(), gz.length, gz.etag, modifiedMs[name] ?: file.lastModified())
|
||||
@@ -287,10 +365,16 @@ class GogCloud(
|
||||
c.setRequestProperty("Content-Encoding", "gzip")
|
||||
c.setRequestProperty("Etag", etag)
|
||||
c.setRequestProperty("X-Object-Meta-LocalLastModified", gogStamp(modified))
|
||||
c.setRequestProperty("X-Object-Meta-User-Agent", ua)
|
||||
c.setFixedLengthStreamingMode(length)
|
||||
c.outputStream.use { out -> source.use { it.copyTo(out, 64 * 1024) } }
|
||||
try {
|
||||
c.outputStream.use { out -> source.use { it.copyTo(out, 64 * 1024) } }
|
||||
} catch (e: java.io.IOException) {
|
||||
val code = runCatching { c.responseCode }.getOrNull()
|
||||
throw java.io.IOException("GOG cloud put file=$name bytes=$length" + (code?.let { " HTTP $it" } ?: ""), e)
|
||||
}
|
||||
val code = c.responseCode
|
||||
if (code !in 200..299) throw java.io.IOException("GOG cloud put HTTP $code")
|
||||
if (code !in 200..299) throw httpFailure("put", name, code, c.errorSnippet())
|
||||
return CloudFile(name, -1L).also { details(it) }.modifiedMs
|
||||
} finally {
|
||||
c.disconnect()
|
||||
|
||||
@@ -84,6 +84,11 @@ object EpicBackend : StoreBackend, EpicLaunchSupport {
|
||||
Store.EPIC, item.id, item.title, cover = item.imageUrl, bytesTotal = item.sizeBytes,
|
||||
location = StoreInstallRoot.labelFor(app, folder),
|
||||
)
|
||||
val launcher = item.extra["thirdPartyManagedApp"].orEmpty()
|
||||
if (launcher.isNotBlank()) {
|
||||
DownloadQueue.recordFailed(app, entry, app.getString(R.string.epic_third_party_managed, launcher))
|
||||
return
|
||||
}
|
||||
DownloadQueue.enqueue(app, entry) { EpicInstaller(app, item, folder) }
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ data class EpicGame(
|
||||
val publisher: String = "",
|
||||
val isDlc: Boolean = false,
|
||||
val artLogo: String = "",
|
||||
val thirdPartyManagedApp: String = "",
|
||||
)
|
||||
|
||||
object EpicLibrary {
|
||||
@@ -52,7 +53,10 @@ object EpicLibrary {
|
||||
.put("developer", g.developer).put("description", g.description).put("version", g.version)
|
||||
.put("installSize", g.installSize).put("canRunOffline", g.canRunOffline)
|
||||
.put("releaseDate", g.releaseDate).put("publisher", g.publisher)
|
||||
.apply { if (g.artLogo.isNotEmpty()) put("artLogo", g.artLogo) },
|
||||
.apply {
|
||||
if (g.artLogo.isNotEmpty()) put("artLogo", g.artLogo)
|
||||
if (g.thirdPartyManagedApp.isNotEmpty()) put("thirdPartyManagedApp", g.thirdPartyManagedApp)
|
||||
},
|
||||
)
|
||||
}.toString()
|
||||
|
||||
@@ -76,6 +80,7 @@ object EpicLibrary {
|
||||
releaseDate = o.optString("releaseDate", ""),
|
||||
publisher = o.optString("publisher", ""),
|
||||
artLogo = o.optString("artLogo", ""),
|
||||
thirdPartyManagedApp = o.optString("thirdPartyManagedApp", ""),
|
||||
)
|
||||
}
|
||||
return tidy(games)
|
||||
@@ -108,7 +113,12 @@ object EpicLibrary {
|
||||
owned = true,
|
||||
sizeBytes = prefs.getLong("size_${game.appName}", 0L).takeIf { it > 0 } ?: game.installSize,
|
||||
storeUrl = "https://store.epicgames.com/en-US/browse?q=" + URLEncoder.encode(title, "UTF-8"),
|
||||
extra = mapOf("namespace" to game.namespace, "catalogItemId" to game.catalogItemId, "version" to game.version),
|
||||
extra = mapOf(
|
||||
"namespace" to game.namespace,
|
||||
"catalogItemId" to game.catalogItemId,
|
||||
"version" to game.version,
|
||||
"thirdPartyManagedApp" to game.thirdPartyManagedApp,
|
||||
),
|
||||
logoUrl = game.artLogo.ifEmpty { null },
|
||||
)
|
||||
}
|
||||
@@ -133,6 +143,7 @@ object EpicLibrary {
|
||||
publisher = pick("publisher", before?.publisher.orEmpty()),
|
||||
isDlc = d.optBoolean("dlc", false),
|
||||
artLogo = pick("logo", before?.artLogo.orEmpty()),
|
||||
thirdPartyManagedApp = details?.optString("thirdPartyManagedApp", "") ?: before?.thirdPartyManagedApp.orEmpty(),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -145,11 +145,30 @@ internal fun AgentPage(
|
||||
internal fun AgentPageWithControls(
|
||||
modifier: Modifier, inputModifier: Modifier = Modifier, visible: Boolean = true, startTyping: Boolean = true,
|
||||
showControlsWithoutKeyboard: Boolean,
|
||||
) = AgentPageContent(modifier, inputModifier, visible, hidesPet = true)
|
||||
) = AgentPageContent(modifier, inputModifier, visible, hidesPet = true, drawer = true)
|
||||
|
||||
/** Whether the session drawer's chat keeps the model, usage and menu in the editor's row, giving the conversation that row's height. */
|
||||
internal object AgentDrawerLayout {
|
||||
private const val KEY = "drawer_inline_controls"
|
||||
var inline by mutableStateOf(true)
|
||||
private set
|
||||
private var loaded = false
|
||||
|
||||
fun load(context: android.content.Context) {
|
||||
if (loaded) return
|
||||
loaded = true
|
||||
inline = AgentHost.prefs(context).getBoolean(KEY, true)
|
||||
}
|
||||
|
||||
fun set(context: android.content.Context, on: Boolean) {
|
||||
inline = on
|
||||
AgentHost.prefs(context).edit().putBoolean(KEY, on).apply()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AgentPageContent(
|
||||
modifier: Modifier, inputModifier: Modifier, visible: Boolean, hidesPet: Boolean, menuSlot: AgentMenuSlot? = null,
|
||||
modifier: Modifier, inputModifier: Modifier, visible: Boolean, hidesPet: Boolean, menuSlot: AgentMenuSlot? = null, drawer: Boolean = false,
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val view = LocalView.current
|
||||
@@ -164,6 +183,8 @@ private fun AgentPageContent(
|
||||
}
|
||||
}
|
||||
remember { AgentHost.refresh(context) }
|
||||
remember { AgentDrawerLayout.load(context) }
|
||||
val inline = drawer && AgentDrawerLayout.inline
|
||||
LaunchedEffect(AgentHost.unseen, visible) { if (visible) AgentHost.seen() }
|
||||
// A stopped activity keeps its composition; the page is only on screen while its host is started.
|
||||
val lifecycle = androidx.compose.ui.platform.LocalLifecycleOwner.current.lifecycle
|
||||
@@ -190,11 +211,15 @@ private fun AgentPageContent(
|
||||
val focusManager = LocalFocusManager.current
|
||||
val togglePanel: (AgentPanel) -> Unit = { panel = if (panel == it) AgentPanel.NONE else it }
|
||||
var menuOpen by rememberSaveable { mutableStateOf(false) }
|
||||
val topBar: @Composable () -> Unit = {
|
||||
AgentTopBar(panel, togglePanel, inputModifier) {
|
||||
AgentMenu(menuOpen, { menuOpen = it }, onPanel = { panel = it }, onSetup = { setup = true })
|
||||
}
|
||||
val menu: @Composable () -> Unit = {
|
||||
AgentMenu(menuOpen, { menuOpen = it }, onPanel = { panel = it }, onSetup = { setup = true })
|
||||
}
|
||||
val topBar: @Composable () -> Unit = { AgentTopBar(panel, togglePanel, inputModifier, menu) }
|
||||
val inlineControls: (@Composable () -> Unit)? = if (inline) ({
|
||||
ModelChip(panel, togglePanel, inputModifier, compact = true)
|
||||
ContextRing("agent-usage", onClick = { togglePanel(AgentPanel.USAGE) })
|
||||
menu()
|
||||
}) else null
|
||||
// A host with a title bar shows the top bar there.
|
||||
val inSlot = menuSlot != null && panel != AgentPanel.HISTORY && panel != AgentPanel.PROCESSES && panel != AgentPanel.TOOLS
|
||||
if (menuSlot != null) DisposableEffect(menuSlot, inSlot) {
|
||||
@@ -226,7 +251,7 @@ private fun AgentPageContent(
|
||||
AgentToolsPanel(Modifier.weight(1f))
|
||||
}
|
||||
else -> {
|
||||
if (menuSlot == null) Box(Modifier.padding(bottom = 6.dp)) { topBar() }
|
||||
if (menuSlot == null && !inline) Box(Modifier.padding(bottom = 6.dp)) { topBar() }
|
||||
when (panel) {
|
||||
AgentPanel.MODEL -> Box(Modifier.padding(bottom = 8.dp)) { AgentModelPicker() }
|
||||
AgentPanel.USAGE -> Box(Modifier.padding(bottom = 8.dp)) { AgentUsage() }
|
||||
@@ -279,7 +304,7 @@ private fun AgentPageContent(
|
||||
}
|
||||
}
|
||||
androidx.compose.animation.AnimatedVisibility(!hidden, enter = expandVertically() + fadeIn(), exit = shrinkVertically() + fadeOut()) {
|
||||
AgentComposer(composer, draft, visible, onPanel = { panel = it }, onSent = toLatest)
|
||||
AgentComposer(composer, draft, visible, inlineControls, onPanel = { panel = it }, onSent = toLatest)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,27 +340,34 @@ internal class AgentMenuSlot {
|
||||
/** The model and how full the context is, then the [menu]. */
|
||||
@Composable
|
||||
private fun AgentTopBar(panel: AgentPanel, onPanel: (AgentPanel) -> Unit, firstControl: Modifier, menu: @Composable () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
val pal = LocalPalette.current
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.weight(1f)) {
|
||||
val model = AgentHost.models(context).firstOrNull { it.id == AgentHost.model }?.label ?: AgentHost.model ?: stringResource(R.string.agent_model_default)
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.weight(1f, fill = false).height(36.dp).clip(Shape12).then(firstControl).clickable { onPanel(AgentPanel.MODEL) }
|
||||
.padding(horizontal = 8.dp).testTag("agent-model"),
|
||||
) {
|
||||
val parts = listOfNotNull(AgentHost.harness.name, model, AgentHost.effort, stringResource(R.string.agent_plan_short).takeIf { AgentHost.plan && AgentHost.harness.plans })
|
||||
Text(parts.joinToString(" · "), fontSize = 13.sp, color = if (panel == AgentPanel.MODEL) pal.primary else pal.onSurfaceVariant,
|
||||
maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f, fill = false))
|
||||
Icon(Icons.Outlined.ExpandMore, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(16.dp))
|
||||
}
|
||||
ModelChip(panel, onPanel, firstControl, Modifier.weight(1f, fill = false))
|
||||
ContextRing("agent-usage", onClick = { onPanel(AgentPanel.USAGE) })
|
||||
}
|
||||
menu()
|
||||
}
|
||||
}
|
||||
|
||||
/** The harness, model, effort and plan mode, opening the model picker; [compact] names only the model. */
|
||||
@Composable
|
||||
private fun ModelChip(panel: AgentPanel, onPanel: (AgentPanel) -> Unit, firstControl: Modifier, modifier: Modifier = Modifier, compact: Boolean = false) {
|
||||
val context = LocalContext.current
|
||||
val pal = LocalPalette.current
|
||||
val model = AgentHost.models(context).firstOrNull { it.id == AgentHost.model }?.label ?: AgentHost.model ?: stringResource(R.string.agent_model_default)
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = modifier.then(if (compact) Modifier.widthIn(max = 120.dp) else Modifier).height(36.dp).clip(Shape12).then(firstControl)
|
||||
.clickable { onPanel(AgentPanel.MODEL) }.padding(horizontal = 8.dp).testTag("agent-model"),
|
||||
) {
|
||||
val parts = if (compact) listOf(model)
|
||||
else listOfNotNull(AgentHost.harness.name, model, AgentHost.effort, stringResource(R.string.agent_plan_short).takeIf { AgentHost.plan && AgentHost.harness.plans })
|
||||
Text(parts.joinToString(" · "), fontSize = 13.sp, color = if (panel == AgentPanel.MODEL) pal.primary else pal.onSurfaceVariant,
|
||||
maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f, fill = false))
|
||||
Icon(Icons.Outlined.ExpandMore, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(16.dp))
|
||||
}
|
||||
}
|
||||
|
||||
/** History, processes, a new conversation, the pet and setup, folded behind one button. */
|
||||
@Composable
|
||||
private fun AgentMenu(open: Boolean, onOpen: (Boolean) -> Unit, onPanel: (AgentPanel) -> Unit, onSetup: () -> Unit) {
|
||||
@@ -620,7 +652,10 @@ internal fun usagePercent(): Int? {
|
||||
internal fun liveUsed(limit: AgentHost.Limit) = if (limit.resetsAt > 0 && limit.resetsAt * 1000 < System.currentTimeMillis()) 0 else limit.usedPercent
|
||||
|
||||
@Composable
|
||||
private fun AgentComposer(composer: ComposerState, draftState: MutableState<String>, visible: Boolean, onPanel: (AgentPanel) -> Unit, onSent: () -> Unit) {
|
||||
private fun AgentComposer(
|
||||
composer: ComposerState, draftState: MutableState<String>, visible: Boolean, controls: (@Composable () -> Unit)?,
|
||||
onPanel: (AgentPanel) -> Unit, onSent: () -> Unit,
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
var draft by draftState
|
||||
var labOpen by rememberSaveable { mutableStateOf(false) }
|
||||
@@ -650,13 +685,13 @@ private fun AgentComposer(composer: ComposerState, draftState: MutableState<Stri
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.padding(top = 8.dp).fillMaxWidth().horizontalScroll(rememberScrollState()),
|
||||
) { AgentActivity(labOpen) { labOpen = !labOpen } }
|
||||
AgentEditor(composer, draftState, visible, send)
|
||||
AgentEditor(composer, draftState, visible, controls, send)
|
||||
}
|
||||
}
|
||||
|
||||
/** The text with attach, stop and send beside it. */
|
||||
/** The text with attach, stop and send beside it, and [controls] while the text is not being typed in. */
|
||||
@Composable
|
||||
private fun AgentEditor(composer: ComposerState, draftState: MutableState<String>, visible: Boolean, send: () -> Unit) {
|
||||
private fun AgentEditor(composer: ComposerState, draftState: MutableState<String>, visible: Boolean, controls: (@Composable () -> Unit)?, send: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
@@ -717,6 +752,7 @@ private fun AgentEditor(composer: ComposerState, draftState: MutableState<String
|
||||
maxLines = 8,
|
||||
)
|
||||
}
|
||||
if (controls != null && !focused) Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.height(42.dp)) { controls() }
|
||||
if (working) RoundButton(Icons.Outlined.Stop, stringResource(R.string.agent_stop), pal.error.copy(alpha = 0.22f), colors.error, "agent-stop") {
|
||||
AgentHost.stop(context)
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.ui.Alignment
|
||||
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
|
||||
@@ -118,6 +119,15 @@ internal fun AgentSetupView(modifier: Modifier, onDone: () -> Unit = {}) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(horizontal = 2.dp)) {
|
||||
Column(Modifier.weight(1f)) {
|
||||
Text(stringResource(R.string.agent_drawer_inline), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
||||
Text(stringResource(R.string.agent_drawer_inline_hint), fontSize = 12.5.sp, color = pal.onSurfaceVariant)
|
||||
}
|
||||
ToggleSwitch(AgentDrawerLayout.inline, label = stringResource(R.string.agent_drawer_inline), modifier = Modifier.testTag("setting-agent-drawer-inline")) {
|
||||
AgentDrawerLayout.set(context, it)
|
||||
}
|
||||
}
|
||||
if (AgentSetup.ready || AgentSetup.completed(context)) PrimaryButton(stringResource(R.string.agent_setup_done), main = true, onClick = onDone)
|
||||
StorageCard()
|
||||
}
|
||||
|
||||
@@ -341,7 +341,28 @@ internal fun AndroidAppsPage(s: FrontEndState, a: FrontEndActions, modifier: Mod
|
||||
openFolder = f.id
|
||||
}
|
||||
|
||||
Box(modifier) {
|
||||
val ff = LocalFrontFocus.current
|
||||
var holdFocus by remember { mutableStateOf<String?>(null) }
|
||||
var pageFocused by remember { mutableStateOf(false) }
|
||||
LaunchedEffect(holdFocus) {
|
||||
val key = "tile:folder:${holdFocus ?: return@LaunchedEffect}"
|
||||
// A folder closed from its name field: the platform field and the fading sheet both drop focus after the sheet asked for the tile, so keep asking until the sheet is gone.
|
||||
val until = System.nanoTime() + 400_000_000L
|
||||
while (System.nanoTime() < until) {
|
||||
androidx.compose.runtime.withFrameNanos { }
|
||||
if (ff != null && !(ff.last == key && pageFocused)) runCatching { ff.items[key]?.requestFocus() }
|
||||
}
|
||||
holdFocus = null
|
||||
}
|
||||
Box(
|
||||
modifier.onFocusChanged { pageFocused = it.hasFocus }
|
||||
// A fresh press means the user is moving on, so the hold must not pull focus back to the folder.
|
||||
.onPreviewKeyEvent { event ->
|
||||
val k = event.nativeKeyEvent
|
||||
if (holdFocus != null && k.action == KeyEvent.ACTION_DOWN && k.repeatCount == 0) holdFocus = null
|
||||
false
|
||||
},
|
||||
) {
|
||||
Column(Modifier.fillMaxSize().imePadding()) {
|
||||
Box(Modifier.fillMaxWidth().padding(start = padH, end = padH, top = if (narrow) 8.dp else 12.dp)) {
|
||||
ModeHeader(
|
||||
@@ -443,7 +464,7 @@ internal fun AndroidAppsPage(s: FrontEndState, a: FrontEndActions, modifier: Mod
|
||||
var last by remember { mutableStateOf(folder) }
|
||||
if (folder != null) last = folder
|
||||
last?.let { f ->
|
||||
FolderSheet(f, f.apps.mapNotNull(member).filter { it.key !in hidden }.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.label }), renameOnOpen, onLaunch, newFolder, { iconFor = it }) {
|
||||
FolderSheet(f, f.apps.mapNotNull(member).filter { it.key !in hidden }.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.label }), renameOnOpen, onLaunch, newFolder, { iconFor = it }, onHoldFocus = { holdFocus = f.id }) {
|
||||
openFolder = null
|
||||
renameOnOpen = false
|
||||
}
|
||||
@@ -813,7 +834,7 @@ private fun FolderTile(entry: AppEntry.Folder, first: Boolean, onOpen: () -> Uni
|
||||
private fun FolderSheet(
|
||||
folder: HomeFolders.Folder, apps: List<HomeApp.LaunchableApp>, renameFirst: Boolean,
|
||||
onLaunch: (HomeApp.LaunchableApp) -> Unit, onNewFolder: (HomeApp.LaunchableApp) -> Unit,
|
||||
onChangeIcon: (HomeApp.LaunchableApp) -> Unit, onClose: () -> Unit,
|
||||
onChangeIcon: (HomeApp.LaunchableApp) -> Unit, onHoldFocus: () -> Unit, onClose: () -> Unit,
|
||||
) {
|
||||
SwipeLock()
|
||||
val ctx = LocalContext.current
|
||||
@@ -831,20 +852,24 @@ private fun FolderSheet(
|
||||
val ff = LocalFrontFocus.current
|
||||
val grid = rememberLazyGridState()
|
||||
var closing by remember { mutableStateOf(false) }
|
||||
var inside by remember { mutableStateOf(false) }
|
||||
LaunchedEffect(renaming, inputMode) {
|
||||
if (!renaming && !closing && inputMode == InputMode.Keyboard && apps.isNotEmpty()) {
|
||||
grid.scrollToItem(0)
|
||||
repeat(2) { androidx.compose.runtime.withFrameNanos { } }
|
||||
if (!closing) runCatching { firstApp.requestFocus() }
|
||||
androidx.compose.runtime.withFrameNanos { }
|
||||
// After touch, focus starts outside the page and the first request is turned to the page's own entry, behind the sheet. Ask until it is in here.
|
||||
focusWithinFrames({ inside || closing }) { firstApp }
|
||||
}
|
||||
}
|
||||
val close = {
|
||||
val wasRenaming = renaming
|
||||
closing = true
|
||||
if (renaming) commit()
|
||||
onClose()
|
||||
if (inputMode == InputMode.Keyboard && ff != null) {
|
||||
runCatching { ff.items.getValue("tile:folder:${folder.id}").requestFocus() }
|
||||
.onFailure { runCatching { ff.firstTile.requestFocus() } }
|
||||
if (wasRenaming) onHoldFocus()
|
||||
}
|
||||
}
|
||||
BackHandler { close() }
|
||||
@@ -861,6 +886,7 @@ private fun FolderSheet(
|
||||
.glideBorder(false, Shape16, pal.signal, pal.signal.copy(alpha = 0.22f))
|
||||
.pointerInput(Unit) { awaitEachGesture { awaitFirstDown(requireUnconsumed = false).consume() } }
|
||||
.controllerBack(close)
|
||||
.onFocusChanged { inside = it.hasFocus }
|
||||
.focusProperties {
|
||||
exit = { dir ->
|
||||
if (dir == FocusDirection.Up || dir == FocusDirection.Down || dir == FocusDirection.Left || dir == FocusDirection.Right) FocusRequester.Cancel
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.droiddeck.launcher.input.PointerGestures
|
||||
import com.droiddeck.launcher.input.TouchpadGestures
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.session.BottomDesktop
|
||||
import com.droiddeck.launcher.wayland.WaylandCompositor
|
||||
|
||||
@SuppressLint("ViewConstructor")
|
||||
class BottomDesktopPanel(
|
||||
@@ -289,10 +290,10 @@ class BottomDesktopPanel(
|
||||
|
||||
override fun onButton(button: Int, pressed: Boolean, x: Float, y: Float) {
|
||||
movePointer(x, y)
|
||||
BottomDesktop.sendScene(SCENE_BUTTON, button, if (pressed) 1 else 0)
|
||||
BottomDesktop.sendScene(WaylandCompositor.SCENE_BUTTON, button, if (pressed) 1 else 0)
|
||||
}
|
||||
|
||||
override fun onWheel(steps: Int) = BottomDesktop.sendScene(SCENE_WHEEL, steps)
|
||||
override fun onWheel(steps: Int) = BottomDesktop.sendScene(WaylandCompositor.SCENE_WHEEL, steps)
|
||||
|
||||
override fun onScroll(dx: Float, dy: Float) {
|
||||
val (outW, outH) = BottomDesktop.outputSize
|
||||
@@ -303,18 +304,18 @@ class BottomDesktopPanel(
|
||||
if (h == 0 && v == 0) return
|
||||
scrollRestX -= h
|
||||
scrollRestY -= v
|
||||
BottomDesktop.sendScene(SCENE_AXIS, v, h)
|
||||
BottomDesktop.sendScene(WaylandCompositor.SCENE_AXIS_FINGER, v, h)
|
||||
}
|
||||
|
||||
override fun onScrollEnd() {
|
||||
scrollRestX = 0f
|
||||
scrollRestY = 0f
|
||||
BottomDesktop.sendScene(SCENE_AXIS, 0, 0)
|
||||
BottomDesktop.sendScene(WaylandCompositor.SCENE_AXIS_FINGER, 0, 0)
|
||||
}
|
||||
|
||||
override fun onZoom(steps: Int) {
|
||||
BottomDesktop.sendKey(KEY_LEFTCTRL, true)
|
||||
BottomDesktop.sendScene(SCENE_WHEEL, steps)
|
||||
BottomDesktop.sendScene(WaylandCompositor.SCENE_WHEEL, steps)
|
||||
BottomDesktop.sendKey(KEY_LEFTCTRL, false)
|
||||
}
|
||||
|
||||
@@ -331,9 +332,6 @@ class BottomDesktopPanel(
|
||||
private fun dp(value: Int): Int = (value * resources.displayMetrics.density + 0.5f).toInt()
|
||||
|
||||
private companion object {
|
||||
const val SCENE_BUTTON = 3
|
||||
const val SCENE_WHEEL = 4
|
||||
const val SCENE_AXIS = 12
|
||||
const val KEY_LEFTCTRL = 29
|
||||
const val AXIS_UNITS_PER_PIXEL = 3f
|
||||
const val TEXT_FIELD_TAP_MS = 1_000L
|
||||
|
||||
@@ -19,6 +19,7 @@ class BottomGameScreen(
|
||||
display: Display,
|
||||
private val callback: SurfaceHolder.Callback,
|
||||
private val onTouch: (MotionEvent) -> Boolean,
|
||||
private val onHover: (MotionEvent) -> Boolean,
|
||||
) : Presentation(activity, display) {
|
||||
val surfaceView = SurfaceView(getContext())
|
||||
val holder: SurfaceHolder get() = surfaceView.holder
|
||||
@@ -51,7 +52,7 @@ class BottomGameScreen(
|
||||
activity.dispatchKeyEvent(event) || super.dispatchKeyEvent(event)
|
||||
|
||||
override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean =
|
||||
activity.dispatchGenericMotionEvent(event) || super.dispatchGenericMotionEvent(event)
|
||||
onHover(event) || activity.dispatchGenericMotionEvent(event) || super.dispatchGenericMotionEvent(event)
|
||||
}
|
||||
|
||||
object GameScreenSwap {
|
||||
|
||||
@@ -212,6 +212,8 @@ internal fun inPane(o: Origin): Origin =
|
||||
private fun Backdrop(art: File?) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
// True black keeps the page unlit: no art wash and no corner glow.
|
||||
if (pal.id == Themes.TRUE_BLACK) return
|
||||
Crossfade(targetState = art, animationSpec = Motion.tw(700), label = "backdrop") { a ->
|
||||
if (a != null && Build.VERSION.SDK_INT >= 31) {
|
||||
Box(modifier = Modifier.fillMaxSize().alpha(0.26f).blur(70.dp)) {
|
||||
|
||||
@@ -436,6 +436,7 @@ internal fun SetupPanel(
|
||||
}
|
||||
if (s.theme == Themes.INNER_GAMER) RgbSpeedRow()
|
||||
if (s.theme == Themes.GRADIENT) GradientColorRows()
|
||||
if (s.theme == Themes.TRUE_BLACK) HighlightColorRow()
|
||||
ChoiceRow(
|
||||
host, "app-scale", stringResource(R.string.setup_app_scale), stringResource(R.string.setup_app_scale_hint),
|
||||
com.droiddeck.launcher.core.AppUiPrefs.scales.map { percent ->
|
||||
@@ -1177,6 +1178,16 @@ private fun RgbSpeedRow() {
|
||||
SliderRow(stringResource(R.string.theme_rgb_speed), stringResource(R.string.theme_rgb_speed_hint), Themes.rgbSpeed, 1..Themes.RGB_SPEEDS) { Themes.setRgbSpeed(ctx, it) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun HighlightColorRow() {
|
||||
val ctx = androidx.compose.ui.platform.LocalContext.current.applicationContext
|
||||
val highlight = Themes.trueBlackHighlight
|
||||
var picking by remember { mutableStateOf(false) }
|
||||
val label = stringResource(R.string.theme_true_black_highlight)
|
||||
SettingsRow(label, stringResource(R.string.theme_true_black_highlight_hint)) { ColorCube(androidx.compose.ui.graphics.Color(highlight), label) { picking = true } }
|
||||
if (picking) ColorPickerDialog(label, highlight, onDismiss = { picking = false }) { argb -> Themes.setTrueBlackHighlight(ctx, argb) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun GradientColorRows() {
|
||||
val ctx = androidx.compose.ui.platform.LocalContext.current.applicationContext
|
||||
|
||||
@@ -1,17 +1,39 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.foundation.ScrollState
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.AlertDialogDefaults
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.LocalContentColor
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.ProvideTextStyle
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.staticCompositionLocalOf
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Shape
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.DpOffset
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.IntRect
|
||||
import androidx.compose.ui.unit.IntSize
|
||||
import androidx.compose.ui.unit.LayoutDirection
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import androidx.compose.ui.window.Popup
|
||||
@@ -41,13 +63,82 @@ internal fun TrackKeyWindow() {
|
||||
}
|
||||
}
|
||||
|
||||
internal val LocalPresentationWindow = staticCompositionLocalOf { false }
|
||||
|
||||
private val OriginPosition = object : PopupPositionProvider {
|
||||
override fun calculatePosition(anchorBounds: IntRect, windowSize: IntSize, layoutDirection: LayoutDirection, popupContentSize: IntSize) = IntOffset.Zero
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun WindowDialog(
|
||||
onDismissRequest: () -> Unit,
|
||||
properties: DialogProperties = DialogProperties(),
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
if (!LocalPresentationWindow.current) {
|
||||
Dialog(onDismissRequest, properties, content)
|
||||
return
|
||||
}
|
||||
Popup(
|
||||
OriginPosition, onDismissRequest,
|
||||
PopupProperties(focusable = true, dismissOnBackPress = properties.dismissOnBackPress, dismissOnClickOutside = false, clippingEnabled = false),
|
||||
) {
|
||||
Box(
|
||||
Modifier.fillMaxSize().background(androidx.compose.ui.graphics.Color.Black.copy(alpha = 0.6f))
|
||||
.tapOutside { if (properties.dismissOnClickOutside) onDismissRequest() },
|
||||
contentAlignment = Alignment.Center,
|
||||
) { content() }
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun GlideDialog(
|
||||
onDismissRequest: () -> Unit,
|
||||
properties: DialogProperties = DialogProperties(),
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
Dialog(onDismissRequest, properties) { TrackKeyWindow(); FocusGlideHost(content = content) }
|
||||
WindowDialog(onDismissRequest, properties) { TrackKeyWindow(); FocusGlideHost(content = content) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun PresentationAlert(
|
||||
confirmButton: @Composable () -> Unit,
|
||||
modifier: Modifier,
|
||||
dismissButton: (@Composable () -> Unit)?,
|
||||
icon: (@Composable () -> Unit)?,
|
||||
title: (@Composable () -> Unit)?,
|
||||
text: (@Composable () -> Unit)?,
|
||||
shape: Shape,
|
||||
containerColor: Color,
|
||||
iconContentColor: Color,
|
||||
titleContentColor: Color,
|
||||
textContentColor: Color,
|
||||
tonalElevation: Dp,
|
||||
) {
|
||||
Surface(modifier.blockTouches().padding(24.dp).widthIn(min = 280.dp, max = 560.dp), shape, containerColor, tonalElevation = tonalElevation) {
|
||||
Column(Modifier.padding(24.dp)) {
|
||||
icon?.let {
|
||||
Box(Modifier.align(Alignment.CenterHorizontally)) { CompositionLocalProvider(LocalContentColor provides iconContentColor, content = it) }
|
||||
Spacer(Modifier.height(16.dp))
|
||||
}
|
||||
title?.let {
|
||||
ProvideTextStyle(MaterialTheme.typography.headlineSmall) {
|
||||
CompositionLocalProvider(LocalContentColor provides titleContentColor, content = it)
|
||||
}
|
||||
Spacer(Modifier.height(16.dp))
|
||||
}
|
||||
text?.let {
|
||||
ProvideTextStyle(MaterialTheme.typography.bodyMedium) {
|
||||
CompositionLocalProvider(LocalContentColor provides textContentColor, content = it)
|
||||
}
|
||||
Spacer(Modifier.height(24.dp))
|
||||
}
|
||||
Row(Modifier.align(Alignment.End), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
dismissButton?.invoke()
|
||||
confirmButton()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -81,7 +172,13 @@ internal fun GlideAlertDialog(
|
||||
properties: DialogProperties = DialogProperties(),
|
||||
) {
|
||||
FocusGlideWindow { overlay ->
|
||||
AlertDialog(
|
||||
if (LocalPresentationWindow.current) WindowDialog(onDismissRequest, properties) {
|
||||
TrackKeyWindow()
|
||||
PresentationAlert(
|
||||
confirmButton, modifier.then(overlay), dismissButton, icon, title, text,
|
||||
shape, containerColor, iconContentColor, titleContentColor, textContentColor, tonalElevation,
|
||||
)
|
||||
} else AlertDialog(
|
||||
onDismissRequest, confirmButton, modifier.then(overlay), dismissButton, icon, title, text,
|
||||
shape, containerColor, iconContentColor, titleContentColor, textContentColor, tonalElevation, properties,
|
||||
)
|
||||
|
||||
@@ -63,6 +63,7 @@ class ModeSettings(
|
||||
val upscaler: Int = 0,
|
||||
val upscaleSharpness: Int = 75,
|
||||
val touchMode: String,
|
||||
val pen: SessionPrefs.Pen? = null,
|
||||
val suspendPolicy: String,
|
||||
val steamDownloadsInBackground: Boolean = false,
|
||||
val pipSupported: Boolean = false,
|
||||
@@ -116,6 +117,7 @@ class ModeSettingsActions(
|
||||
val onUpscaler: (Int) -> Unit = {},
|
||||
val onUpscaleSharpness: (Int) -> Unit = {},
|
||||
val onTouch: (String) -> Unit,
|
||||
val onPen: (key: String, value: String) -> Unit = { _, _ -> },
|
||||
val onSuspendPolicy: (String) -> Unit,
|
||||
val onSteamDownloadsInBackground: (Boolean) -> Unit = {},
|
||||
val onPipAutoEnter: (Boolean) -> Unit = {},
|
||||
@@ -321,6 +323,7 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras:
|
||||
}
|
||||
PhysicalShortcutRows()
|
||||
}
|
||||
s.pen?.let { PenSettingsGroup(host, it, onPick = a.onPen) }
|
||||
}
|
||||
if (tab == SheetTab.AUDIO && steam) {
|
||||
if (s.directAudio != null && s.mic != null) SettingsGroup(stringResource(R.string.mode_audio)) {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
|
||||
@Composable
|
||||
internal fun PenSettingsGroup(
|
||||
host: MenuHost, pen: SessionPrefs.Pen, track: (String) -> Modifier = { Modifier },
|
||||
onPick: (key: String, value: String) -> Unit,
|
||||
) {
|
||||
SettingsGroup(stringResource(R.string.mode_pen)) {
|
||||
ChoiceRow(host, "pen", stringResource(R.string.mode_pen), null,
|
||||
listOf(SessionPrefs.PEN_MOUSE to stringResource(R.string.mode_pen_mouse),
|
||||
SessionPrefs.PEN_TOUCH to stringResource(R.string.mode_pen_touch)),
|
||||
pen.mode, chipModifier = track("pen")) { onPick("pen", it) }
|
||||
if (pen.mode != SessionPrefs.PEN_TOUCH) ChoiceRow(host, "pen-button", stringResource(R.string.mode_pen_button), null,
|
||||
listOf(SessionPrefs.PEN_BUTTON_RIGHT to stringResource(R.string.gesture_right_click),
|
||||
SessionPrefs.PEN_BUTTON_MIDDLE to stringResource(R.string.gesture_middle_click),
|
||||
SessionPrefs.PEN_BUTTON_OFF to stringResource(R.string.widgets_off)),
|
||||
pen.button, chipModifier = track("pen-button")) { onPick("penButton", it) }
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,7 @@ fun PerformancePage(
|
||||
gpuClockPin: Boolean,
|
||||
ramCapMb: Int,
|
||||
zramClient: Boolean,
|
||||
zramIdle: Boolean,
|
||||
vramCapMb: Int,
|
||||
deviceRamMb: Int,
|
||||
ramCapAvailable: Boolean,
|
||||
@@ -72,6 +73,7 @@ fun PerformancePage(
|
||||
onGpuClockPin: (Boolean) -> Unit,
|
||||
onRamCapMb: (Int) -> Unit,
|
||||
onZramClient: (Boolean) -> Unit,
|
||||
onZramIdle: (Boolean) -> Unit,
|
||||
onVramCapMb: (Int) -> Unit,
|
||||
onProotNoSeccomp: (Boolean) -> Unit,
|
||||
onProotFastPath: (Boolean) -> Unit,
|
||||
@@ -146,6 +148,11 @@ fun PerformancePage(
|
||||
val top = (deviceRamMb / MEMORY_CAP_STEP_MB * MEMORY_CAP_STEP_MB).coerceAtLeast(MEMORY_CAP_STEP_MB)
|
||||
val off = stringResource(R.string.perf_cap_off)
|
||||
val auto = stringResource(R.string.perf_cap_auto)
|
||||
ToggleRow(
|
||||
host, "zramidle", stringResource(R.string.perf_zram_idle),
|
||||
if (ramCapAvailable) stringResource(R.string.perf_zram_idle_hint) else stringResource(R.string.perf_ram_cap_unavailable),
|
||||
zramIdle && ramCapAvailable, enabled = ramCapAvailable, onChange = onZramIdle,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "zramclient", stringResource(R.string.perf_zram_client),
|
||||
if (ramCapAvailable) stringResource(R.string.perf_zram_client_hint) else stringResource(R.string.perf_ram_cap_unavailable),
|
||||
|
||||
@@ -143,7 +143,7 @@ class SecondScreenPresentation(
|
||||
val view = androidx.compose.ui.platform.ComposeView(context).apply {
|
||||
isFocusable = true
|
||||
isFocusableInTouchMode = true
|
||||
setContent { content() }
|
||||
setContent { PresentationWindows(content) }
|
||||
}
|
||||
chatView = view
|
||||
root.addView(view, 1.coerceAtMost(root.childCount), LinearLayout.LayoutParams(-1, -2))
|
||||
@@ -179,7 +179,7 @@ class SecondScreenPresentation(
|
||||
isFocusable = true
|
||||
isFocusableInTouchMode = true
|
||||
defaultFocusHighlightEnabled = false
|
||||
setContent { content() }
|
||||
setContent { PresentationWindows(content) }
|
||||
frame.addView(this, FrameLayout.LayoutParams(-1, -1))
|
||||
menuView = this
|
||||
}
|
||||
@@ -340,7 +340,7 @@ class SecondScreenPresentation(
|
||||
private fun renderDashboard() {
|
||||
val content = dashboard ?: return
|
||||
bar(SecondScreenMode.DASHBOARD)
|
||||
val view = androidx.compose.ui.platform.ComposeView(context).apply { setContent { content() } }
|
||||
val view = androidx.compose.ui.platform.ComposeView(context).apply { setContent { PresentationWindows(content) } }
|
||||
dashboardView = view
|
||||
root.addView(view, weightParams())
|
||||
}
|
||||
@@ -364,7 +364,7 @@ class SecondScreenPresentation(
|
||||
|
||||
private fun renderTerminal() {
|
||||
bar(SecondScreenMode.TERMINAL)
|
||||
val panel = SessionTerminalPanel(context)
|
||||
val panel = SessionTerminalPanel(context, keepShell = true)
|
||||
terminalPanel = panel
|
||||
root.addView(panel, weightParams())
|
||||
}
|
||||
@@ -388,3 +388,8 @@ class SecondScreenPresentation(
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
|
||||
}
|
||||
}
|
||||
|
||||
@androidx.compose.runtime.Composable
|
||||
private fun PresentationWindows(content: @androidx.compose.runtime.Composable () -> Unit) {
|
||||
androidx.compose.runtime.CompositionLocalProvider(LocalPresentationWindow provides true) { content() }
|
||||
}
|
||||
@@ -239,10 +239,15 @@ class DrawerActions(
|
||||
val onPadType: (String) -> Unit = {},
|
||||
val touchMode: String,
|
||||
val touchAuto: String,
|
||||
val pen: SessionPrefs.Pen? = null,
|
||||
val onPen: (key: String, value: String) -> Unit = { _, _ -> },
|
||||
val fexPreset: String,
|
||||
val upscaler: Int = 0,
|
||||
val upscaleSharpness: Int = 75,
|
||||
val effects: ScreenEffects = ScreenEffects.OFF,
|
||||
val screenEffectsTarget: String = "auto",
|
||||
val screenEffectsTargets: List<Pair<String, String>> = emptyList(),
|
||||
val screenEffectsCanDelete: Boolean = false,
|
||||
val cardboard: Cardboard = Cardboard.OFF,
|
||||
val cardboardSensor: Boolean = false,
|
||||
val steamVr: SteamVr.Status? = null,
|
||||
@@ -304,8 +309,13 @@ class DrawerActions(
|
||||
val onDirectHoldBehavior: (String) -> Unit = {},
|
||||
val onFexPreset: (String) -> Unit,
|
||||
val onUpscaler: (Int) -> Unit = {},
|
||||
val onPresetUpscaler: (Int) -> Unit = onUpscaler,
|
||||
val onUpscaleSharpness: (Int) -> Unit = {},
|
||||
val onEffects: (ScreenEffects) -> Unit = {},
|
||||
val onScreenEffectsTarget: (String) -> Unit = {},
|
||||
val onScreenEffectsReset: () -> Unit = {},
|
||||
val onScreenEffectsDelete: () -> Unit = {},
|
||||
val onScreenEffectsProfilesRefresh: () -> Unit = {},
|
||||
val onCardboard: (Cardboard) -> Unit = {},
|
||||
val onCardboardRecenter: () -> Unit = {},
|
||||
val onGlassesRecenter: () -> Unit = {},
|
||||
@@ -422,6 +432,9 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
}
|
||||
}
|
||||
}
|
||||
LaunchedEffect(open, page) {
|
||||
if (open && page == SessionDrawerPage.EFFECTS) a.onScreenEffectsProfilesRefresh()
|
||||
}
|
||||
LaunchedEffect(open, controllerActive) {
|
||||
if (open && !controllerActive) focusManager.clearFocus(force = true)
|
||||
}
|
||||
@@ -661,6 +674,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
onPick = a.onDirectHoldBehavior)
|
||||
}
|
||||
}
|
||||
a.pen?.let { PenSettingsGroup(host, it, track = { key -> focus.track(page, key) }, onPick = a.onPen) }
|
||||
SettingsGroup(stringResource(R.string.input_screen_visibility)) {
|
||||
ChoiceRow(host, "osc", stringResource(R.string.mode_osc), null,
|
||||
if (a.steam) listOf(SessionPrefs.OSC_AUTO to stringResource(R.string.common_auto), SessionPrefs.OSC_ALWAYS to stringResource(R.string.common_always), SessionPrefs.OSC_STEAM_TOUCH to stringResource(R.string.osc_steam_touch), SessionPrefs.OSC_STEAM_QAM to stringResource(R.string.mode_osc_qam), SessionPrefs.OSC_NEVER to stringResource(R.string.common_never))
|
||||
@@ -1064,12 +1078,32 @@ private fun ScreenEffectsGroup(
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
SettingsGroup(stringResource(R.string.drawer_effects)) {
|
||||
ChoiceRow(
|
||||
host, "effects-profile", stringResource(R.string.screen_effects_target),
|
||||
stringResource(R.string.screen_effects_target_hint), a.screenEffectsTargets,
|
||||
a.screenEffectsTarget, chipModifier = track("effects-profile"),
|
||||
onPick = a.onScreenEffectsTarget,
|
||||
)
|
||||
ActionRow(
|
||||
stringResource(R.string.screen_effects_reset),
|
||||
stringResource(R.string.screen_effects_reset_hint),
|
||||
stringResource(R.string.hud_reset_button),
|
||||
a.onScreenEffectsReset,
|
||||
modifier = track("effects-reset"),
|
||||
)
|
||||
if (a.screenEffectsCanDelete) ActionRow(
|
||||
stringResource(R.string.screen_effects_delete),
|
||||
stringResource(R.string.screen_effects_delete_hint),
|
||||
stringResource(R.string.common_delete),
|
||||
a.onScreenEffectsDelete,
|
||||
modifier = track("effects-delete"),
|
||||
)
|
||||
val presets = ScreenEffectLooks.LOOKS.map { it.name to stringResource(it.label) }
|
||||
ChoiceRow(host, "look", stringResource(R.string.drawer_look), null,
|
||||
if (preset == null) listOf(LOOK_CUSTOM to stringResource(R.string.drawer_look_custom)) + presets else presets,
|
||||
preset?.name ?: LOOK_CUSTOM, chipModifier = track("look")) { name ->
|
||||
ScreenEffectLooks.LOOKS.firstOrNull { it.name == name }?.let { picked ->
|
||||
picked.scalingMode?.let(a.onUpscaler)
|
||||
picked.scalingMode?.let(a.onPresetUpscaler)
|
||||
a.onEffects(picked.effects)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.termux.terminal.TerminalSessionClient
|
||||
import com.termux.view.TerminalView
|
||||
import com.termux.view.TerminalViewClient
|
||||
|
||||
class SessionTerminalPanel(context: Context) : LinearLayout(context) {
|
||||
class SessionTerminalPanel(context: Context, private val keepShell: Boolean = false) : LinearLayout(context) {
|
||||
private var terminalSession: TerminalSession? = null
|
||||
private var terminalView: TerminalView? = null
|
||||
private var terminalPid = -1
|
||||
@@ -45,7 +45,8 @@ class SessionTerminalPanel(context: Context) : LinearLayout(context) {
|
||||
isFocusableInTouchMode = true
|
||||
}
|
||||
terminalView = view
|
||||
val session = SessionTerminal.create(terminalClient)
|
||||
val session = (if (keepShell) SessionTerminal.reuse(terminalClient) else null)
|
||||
?: SessionTerminal.create(terminalClient)?.also { if (keepShell) SessionTerminal.keep(it) }
|
||||
if (session == null) {
|
||||
addView(TextView(context).apply {
|
||||
text = context.getString(R.string.second_terminal_not_ready)
|
||||
@@ -82,6 +83,7 @@ class SessionTerminalPanel(context: Context) : LinearLayout(context) {
|
||||
key("→", "\u001b[C")
|
||||
key(context.getString(R.string.second_key_ctrl_c), "\u0003")
|
||||
key(context.getString(R.string.second_key_ctrl_d), "\u0004")
|
||||
key(context.getString(R.string.second_key_clear), "\u000c")
|
||||
keyStrip.addView(keys)
|
||||
addView(keyStrip, LayoutParams(-1, -2))
|
||||
|
||||
@@ -121,8 +123,12 @@ class SessionTerminalPanel(context: Context) : LinearLayout(context) {
|
||||
(context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager)
|
||||
.hideSoftInputFromWindow(view.windowToken, 0)
|
||||
}
|
||||
val pid = terminalPid.takeIf { it > 1 } ?: (terminalSession?.pid ?: -1)
|
||||
if (pid > 1) SessionService.stopTerminalProcess(context, pid)
|
||||
val session = terminalSession
|
||||
if (!keepShell || session?.isRunning != true) {
|
||||
val pid = terminalPid.takeIf { it > 1 } ?: (session?.pid ?: -1)
|
||||
if (pid > 1) SessionService.stopTerminalProcess(context, pid)
|
||||
SessionTerminal.release(session)
|
||||
}
|
||||
terminalPid = -1
|
||||
terminalSession = null
|
||||
terminalView = null
|
||||
@@ -140,6 +146,7 @@ class SessionTerminalPanel(context: Context) : LinearLayout(context) {
|
||||
override fun onSessionFinished(finishedSession: TerminalSession) {
|
||||
val pid = terminalPid.takeIf { it > 1 } ?: finishedSession.pid
|
||||
if (pid > 1) SessionService.terminalProcessExited(context, pid)
|
||||
SessionTerminal.release(finishedSession)
|
||||
terminalPid = -1
|
||||
terminalView?.onScreenUpdated()
|
||||
}
|
||||
|
||||
@@ -59,6 +59,11 @@ object Themes {
|
||||
const val DEFAULT_RGB_SPEED = 3
|
||||
const val RGB_HUE_STEP = 3f
|
||||
const val WHITE_RED = "white_red"
|
||||
const val TRUE_BLACK = "true_black"
|
||||
const val DEFAULT_HIGHLIGHT = 0xFF1A9FFF.toInt()
|
||||
|
||||
var trueBlackHighlight by mutableStateOf(DEFAULT_HIGHLIGHT)
|
||||
private set
|
||||
|
||||
var rgbSpeed by mutableStateOf(DEFAULT_RGB_SPEED)
|
||||
private set
|
||||
@@ -81,6 +86,12 @@ object Themes {
|
||||
fun loadGradient(context: Context) {
|
||||
gradientColors = SessionPrefs.gradientColors(context)
|
||||
rgbSpeed = SessionPrefs.rgbSpeed(context)
|
||||
trueBlackHighlight = SessionPrefs.trueBlackHighlight(context)
|
||||
}
|
||||
|
||||
fun setTrueBlackHighlight(context: Context, highlight: Int) {
|
||||
SessionPrefs.setTrueBlackHighlight(context, highlight)
|
||||
trueBlackHighlight = highlight
|
||||
}
|
||||
|
||||
fun innerGamer(hue: Float): Palette = ThemeColors.palette(
|
||||
@@ -95,7 +106,7 @@ object Themes {
|
||||
|
||||
fun current(context: Context): Palette {
|
||||
val id = SessionPrefs.theme(context)
|
||||
if (id == GRADIENT || id == INNER_GAMER) loadGradient(context)
|
||||
if (id == GRADIENT || id == INNER_GAMER || id == TRUE_BLACK) loadGradient(context)
|
||||
return byId(id)
|
||||
}
|
||||
|
||||
@@ -128,6 +139,7 @@ object Themes {
|
||||
primary = Color(0xFF2E86FF), primary2 = Color(0xFF2684FF), onPrimary = Color(0xFF03111F), signal = Color(0xFF2E86FF),
|
||||
good = Color(0xFF4CD37F),
|
||||
),
|
||||
ThemeColors.trueBlack(DEFAULT_HIGHLIGHT),
|
||||
Palette(
|
||||
WHITE_RED, R.string.theme_white_red, R.string.theme_white_red_detail,
|
||||
background = Color(0xFFF8F8F8), surface = Color(0xFFFFFFFF), surfaceVariant = Color(0xFFF0F0F0), line = Color(0xFFDDDDDD), line2 = Color(0xFFC8C8C8),
|
||||
@@ -141,6 +153,7 @@ object Themes {
|
||||
|
||||
fun byId(id: String): Palette {
|
||||
if (id == INNER_GAMER) return innerGamer(rgbHue)
|
||||
if (id == TRUE_BLACK) return ThemeColors.trueBlack(trueBlackHighlight)
|
||||
if (id == GRADIENT) return ThemeColors.palette(gradientColors.first, gradientColors.second, R.string.theme_gradient, R.string.theme_gradient_detail)
|
||||
return all.firstOrNull { it.id == id } ?: all[0]
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.droiddeck.launcher.ui
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.luminance
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import com.droiddeck.launcher.R
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
import kotlin.math.roundToInt
|
||||
@@ -147,4 +148,18 @@ internal object ThemeColors {
|
||||
good = Color(0xFF4CD37F),
|
||||
)
|
||||
}
|
||||
|
||||
// Page and panels are pure black so an OLED panel leaves those pixels off; only raised cards, rules and the highlight are lit.
|
||||
fun trueBlack(highlight: Int): Palette {
|
||||
val seen = readable(highlight)
|
||||
val ink = inkFor(seen, seen)
|
||||
val accent = Color(fitTo(ink, seen))
|
||||
return Palette(
|
||||
Themes.TRUE_BLACK, R.string.theme_true_black, R.string.theme_true_black_detail,
|
||||
background = Color.Black, surface = Color.Black, surfaceVariant = Color(0xFF0C0C0D), line = Color(0xFF1C1D20), line2 = Color(0xFF2A2C30),
|
||||
onBackground = Color(0xFFF2F4F7), onSurfaceVariant = Color(0xFF8E9196),
|
||||
primary = accent, primary2 = accent, onPrimary = ink, signal = accent,
|
||||
good = Color(0xFF4CD37F),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -90,10 +90,11 @@ object SelfInstaller {
|
||||
}
|
||||
}
|
||||
|
||||
fun install(context: Context, apk: File, onSession: (Int) -> Unit = {}) {
|
||||
fun install(context: Context, apk: File, packageName: String = context.packageName, action: String = ACTION_STATUS,
|
||||
onSession: (Int) -> Unit = {}) {
|
||||
val installer = context.packageManager.packageInstaller
|
||||
val params = PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL).apply {
|
||||
setAppPackageName(context.packageName)
|
||||
setAppPackageName(packageName)
|
||||
setSize(apk.length())
|
||||
if (Build.VERSION.SDK_INT >= 31) setRequireUserAction(PackageInstaller.SessionParams.USER_ACTION_NOT_REQUIRED)
|
||||
}
|
||||
@@ -105,7 +106,7 @@ object SelfInstaller {
|
||||
session.fsync(out)
|
||||
}
|
||||
}
|
||||
val status = Intent(ACTION_STATUS).setPackage(context.packageName)
|
||||
val status = Intent(action).setPackage(context.packageName)
|
||||
val flags = PendingIntent.FLAG_UPDATE_CURRENT or (if (Build.VERSION.SDK_INT >= 31) PendingIntent.FLAG_MUTABLE else 0)
|
||||
onSession(id)
|
||||
session.commit(PendingIntent.getBroadcast(context, id, status, flags).intentSender)
|
||||
|
||||
@@ -64,6 +64,7 @@ object CompositorHost {
|
||||
com.droiddeck.launcher.gpu.TpUbwcHint.applyToProcess(context)
|
||||
WaylandCompositor.nativeStartWithSurface(
|
||||
surface, xdgRuntimeDir, driverPath, libraryName, nativeLibDir,
|
||||
SessionPrefs.androidDriver(context).isEmpty(),
|
||||
)
|
||||
attached = surface
|
||||
started = true
|
||||
|
||||
@@ -153,7 +153,7 @@ public final class WaylandCompositor {
|
||||
|
||||
public static native void nativeStartWithSurface(Surface surface, String xdgRuntimeDir,
|
||||
String driverPath, String libraryName,
|
||||
String nativeLibDir);
|
||||
String nativeLibDir, boolean allowDriverFallback);
|
||||
|
||||
public static native void nativeSetSurface(Surface surface);
|
||||
public static native boolean nativeWaitSurface(int timeoutMs);
|
||||
@@ -162,6 +162,8 @@ public final class WaylandCompositor {
|
||||
|
||||
public static native void nativeSendTouch(int action, int pointerId, int x, int y);
|
||||
|
||||
public static native void nativeSendPen(int flags, int x, int y);
|
||||
|
||||
public static native int nativeCursorSnapshot(int[] out);
|
||||
|
||||
public static native int nativeCursorSerial();
|
||||
@@ -238,6 +240,8 @@ public final class WaylandCompositor {
|
||||
|
||||
public static native boolean nativeGamePictureRect(float[] out);
|
||||
|
||||
public static native boolean nativeOutputSize(int[] out);
|
||||
|
||||
public static native void nativeResizeOutput(int width, int height);
|
||||
|
||||
public static native void nativeResetFirstFrame();
|
||||
@@ -325,6 +329,9 @@ public final class WaylandCompositor {
|
||||
|
||||
public static native void nativeSendSceneInput(int type, int a, int b);
|
||||
|
||||
public static final int SCENE_BUTTON = 3, SCENE_WHEEL = 4, SCENE_POINTER_DELTA = 6, SCENE_AXIS = 11, SCENE_AXIS_FINGER = 12;
|
||||
public static final int WHEEL_STEP_UNITS = 120, POINTER_DELTA_SCALE = 256;
|
||||
|
||||
public static final int FG_ENGINE_LSFG = 0, FG_ENGINE_DDFG = 1;
|
||||
|
||||
public static native void nativeSetFrameGenEngine(int kind);
|
||||
@@ -353,19 +360,19 @@ public final class WaylandCompositor {
|
||||
|
||||
public static void sendPointerDelta(int dx, int dy) {
|
||||
if (dx == 0 && dy == 0) return;
|
||||
nativeSendSceneInput(6, dx * 256, dy * 256);
|
||||
nativeSendSceneInput(SCENE_POINTER_DELTA, dx * POINTER_DELTA_SCALE, dy * POINTER_DELTA_SCALE);
|
||||
}
|
||||
|
||||
private static float pendingDeltaX, pendingDeltaY;
|
||||
|
||||
public static void sendPointerDelta(float dx, float dy) {
|
||||
pendingDeltaX += dx * 256f;
|
||||
pendingDeltaY += dy * 256f;
|
||||
pendingDeltaX += dx * POINTER_DELTA_SCALE;
|
||||
pendingDeltaY += dy * POINTER_DELTA_SCALE;
|
||||
int x = (int) Math.floor(pendingDeltaX);
|
||||
int y = (int) Math.floor(pendingDeltaY);
|
||||
if (x == 0 && y == 0) return;
|
||||
pendingDeltaX -= x;
|
||||
pendingDeltaY -= y;
|
||||
nativeSendSceneInput(6, x, y);
|
||||
nativeSendSceneInput(SCENE_POINTER_DELTA, x, y);
|
||||
}
|
||||
}
|
||||
@@ -9,15 +9,35 @@
|
||||
<string name="steamvr_recovery_failed">تعذّر على DroidDeck إعادة التشغيل تلقائيًا. أغلق التطبيق تمامًا، ثم أعد فتحه.</string>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>يُنزَّل Steam عند التشغيل الأول. قد يستغرق ذلك بضع دقائق.</item>
|
||||
<item>افتراضيًا، يؤدي الخروج من التطبيق إلى إيقاف Steam مؤقتًا، ويُستأنف من حيث توقف عند عودتك.</item>
|
||||
<item>تظهر وحدة التحكم لديك كوحدة تحكم Xbox 360. وإلا، فاستخدم عناصر التحكم على الشاشة.</item>
|
||||
<item>يقوم التشغيل الأول بتنزيل Steam. قد يستغرق ذلك بضع دقائق.</item>
|
||||
<item>تظهر وحدة التحكم لديك في Steam على أنها وحدة تحكم Steam Deck. بدّلها إلى Steam Controller أو DualShock 4 أو DualSense أو Xbox 360 من إعدادات الجلسة، ويُطبَّق ذلك في الجلسة التالية.</item>
|
||||
<item>اضغط مطوّلًا على الرجوع في وحدة التحكم لفتح قائمة الوصول السريع في Steam. يجب تفعيل «الضغط المطوّل على الرجوع لاختصارات Steam» في إعدادات الجلسة.</item>
|
||||
<item>يحدد «السلوك في الخلفية» ما يحدث عند مغادرة التطبيق: «أصلي» يجهّز Steam للسكون، و«تلقائي» يوقفه مؤقتًا، و«يدوي» ينتظر «استئناف»، و«أبدًا» يُبقيه قيد التشغيل.</item>
|
||||
<item>تستخدم ألعاب Steam «حد الإطارات» من Steam في الوصول السريع. تنتقل الشاشة إلى معدل تحديث يقبل الحد القسمة عليه بالتساوي إن وُجد.</item>
|
||||
<item>يرسل «وضع زمن الاستجابة المنخفض» في قائمة الجلسة إدخال وحدة التحكم بتردد 1000 هرتز بدلًا من 250 هرتز، مقابل استهلاك أكبر قليلًا للمعالج والبطارية.</item>
|
||||
<item>لكل لعبة ملفها الشخصي الخاص مع إعدادات Proton وFEX والمكوّنات والبيئة.</item>
|
||||
<item>تضم قائمة الجلسة مفتاح الميكروفون للدردشة الصوتية وزر «تعليق الآن» لتجميد الجلسة عند الطلب.</item>
|
||||
<item>اسحب DroidDeck HUD لتحريكه، واضغط بإصبعين لتغيير حجمه، وادفعه نحو حافة الشاشة لتثبيته كعلامة تبويب صغيرة لمعدل الإطارات.</item>
|
||||
<item>في الأجهزة المحمولة ذات الشاشتين، يمكن للشاشة السفلية عرض التنزيلات والإشعارات ولقطات الشاشة ودردشة Steam. يضع «تبديل الشاشات» اللعبة هناك بدلًا من ذلك.</item>
|
||||
<item>أضف مكتبات Steam من بطاقة SD أو محرك USB أو SSD، وسيجمع DroidDeck الألعاب معًا في «المكتبة».</item>
|
||||
<item>تتيح لك «المتاجر» تسجيل الدخول إلى Epic Games وGOG وXbox وEA وBattle.net وUbisoft Connect وAmazon Games وitch.io وGame Jolt، ثم تثبيت ألعابها وتحديثها من DroidDeck.</item>
|
||||
<item>تحدّث المكوّنات مثل FEX وDXVK وVKD3D-Proton نفسها تلقائيًا، ويكون Proton Experimental ARM64 هو الافتراضي، أو Proton 11.0 ARM64 بعد تثبيت هذا الإصدار.</item>
|
||||
<item>يحرر «ضغط Steam أثناء تشغيل لعبة» مساحة من الذاكرة في الأجهزة قليلة الذاكرة.</item>
|
||||
<item>اسحب من الحافة اليمنى للداخل لفتح قائمة الجلسة: وضع «لوحة اللمس» و«لوحة مفاتيح الكمبيوتر» و«وضع زمن الاستجابة المنخفض» وملف اللعبة والمزيد.</item>
|
||||
<item>اللعبة بطيئة؟ حدّد معدل الإطارات في الوصول السريع، ثم جرّب إصدار Proton آخر أو إعدادًا مسبقًا آخر لـ FEX في مكوّنات اللعبة.</item>
|
||||
<item>هل الصوت متقطع أو مفقود في اللعبة؟ جرّب مفتاح «DirectAudio للألعاب» في إعدادات Steam ضمن «الصوت».</item>
|
||||
<item>يمكن لـ«الإعداد» ثم «التخزين» مسح ذاكرات التظليل المؤقتة وبقايا البادئات من الألعاب التي أزلتها.</item>
|
||||
<item>واجهت خطأً؟ يجمع «مشاركة السجلات» في قائمة الجلسة بيانات التشخيص. انشرها في #bug-reports على Discord.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>يُعَدّ سطح المكتب عند التشغيل الأول. قد يستغرق ذلك بضع دقائق.</item>
|
||||
<item>افتراضيًا، يؤدي الخروج من التطبيق إلى إيقاف الجلسة مؤقتًا، وتُستأنف من حيث توقفت عند عودتك.</item>
|
||||
<item>يعمل اللمس كلوحة لمس: اسحب لتحريك المؤشر، وانقر لتنفيذ نقرة.</item>
|
||||
<item>تظهر وحدة التحكم لديك كوحدة تحكم Xbox 360. وإلا، فاستخدم عناصر التحكم على الشاشة.</item>
|
||||
<item>يقوم التشغيل الأول بإعداد سطح المكتب. قد يستغرق ذلك بضع دقائق.</item>
|
||||
<item>يعمل اللمس كلوحة لمس: اسحب لتحريك المؤشر، وانقر للنقر.</item>
|
||||
<item>يحدد «السلوك في الخلفية» ما يحدث عند مغادرة التطبيق: «يدوي» ينتظر «استئناف» افتراضيًا، و«تلقائي» يوقف مؤقتًا، و«أبدًا» يُبقيه قيد التشغيل.</item>
|
||||
<item>اسحب من الحافة اليمنى للداخل لفتح قائمة الجلسة، ثم اختر «لوحة مفاتيح الكمبيوتر» للكتابة في التطبيقات التي تتجاهل لوحة مفاتيح Android.</item>
|
||||
<item>تتيح «لوحة مفاتيح الكمبيوتر» في قائمة الجلسة ضبط الحجم والشفافية ومجموعات المفاتيح.</item>
|
||||
<item>تظهر وحدة التحكم لديك كوحدة تحكم Xbox 360. وإلا فاستخدم عناصر التحكم على الشاشة.</item>
|
||||
<item>تضم قائمة الجلسة مفتاح الميكروفون وزر «تعليق الآن» لتجميد الجلسة عند الطلب.</item>
|
||||
<item>واجهت خطأً؟ يجمع «مشاركة السجلات» في قائمة الجلسة بيانات التشخيص. انشرها في #bug-reports على Discord.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">الجلسة</string>
|
||||
<string name="session_channel_description">يظهر أثناء فتح جلسة Steam أو جلسة سطح المكتب</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">لوحة اللمس</string>
|
||||
<string name="mode_touch_direct">مباشر</string>
|
||||
<string name="mode_touch_note">تلقائي: لوحة لمس على سطح المكتب، ولمس مباشر في Steam.</string>
|
||||
<string name="mode_pen">القلم</string>
|
||||
<string name="mode_pen_mouse">الفأرة</string>
|
||||
<string name="mode_pen_touch">اللمس</string>
|
||||
<string name="mode_pen_button">الزر الجانبي</string>
|
||||
<string name="mode_osc">عناصر التحكم على الشاشة</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">يعرض الخيار «تلقائي» عناصر التحكم عند عدم توصيل وحدة تحكم.</string>
|
||||
@@ -612,6 +636,8 @@
|
||||
<string name="perf_cap_off">إيقاف</string>
|
||||
<string name="perf_cap_auto">افتراضي برنامج التشغيل</string>
|
||||
<string name="perf_zram_client">ضغط Steam أثناء تشغيل لعبة</string>
|
||||
<string name="perf_zram_idle">ضغط ذاكرة اللعبة الخاملة</string>
|
||||
<string name="perf_zram_idle_hint">يرحّل ذاكرة اللعبة الخاملة عند انخفاض RAM. أوقفه إذا كانت الألعاب تتجمد لبضع ثوانٍ كل نصف دقيقة تقريبًا. يُطبَّق عند بدء الجلسة التالية.</string>
|
||||
<string name="perf_zram_client_hint">بعد 20 ثانية من بدء اللعبة، يُضغط عميل Steam في zRAM لترك ذاكرة أكبر للعبة، ثم يُقرأ مجددًا عند إغلاقها. أوقف هذا الخيار إذا كانت الجلسة تُغلَق بعد بدء الألعاب بقليل. يظل حد RAM أعلاه يضغط Steam عندما تتجاوزه الجلسة.</string>
|
||||
<string name="perf_ram_cap">حد RAM</string>
|
||||
<string name="perf_ram_cap_hint">يُطبَّق أثناء تشغيل عميل Steam، في جلسة Steam أو من سطح المكتب. عندما تستخدم الجلسة أكثر من هذا الحد، يُضغط Steam ثم عمليات الجلسة المدعومة الأخرى في zRAM. حد مرن: لا يُغلَق شيء، لكن قد تتقطّع الألعاب أثناء استعادة الصفحات.</string>
|
||||
@@ -622,7 +648,7 @@
|
||||
<string name="perf_gpuclock_hint">لـ Adreno فقط. تقطّع أقل، مع استهلاك أكبر للبطارية والحرارة.</string>
|
||||
<string name="perf_fixes">إصلاحات الجلسة</string>
|
||||
<string name="perf_sysmem">Turnip: التصيير عبر sysmem</string>
|
||||
<string name="perf_sysmem_hint">أسرع لعميل Steam؛ في الألعاب يختار برنامج التشغيل بين العرض المقسّم إلى مربعات والعرض في ذاكرة النظام لكل مرحلة. مطلوب على Adreno 710/720/722.</string>
|
||||
<string name="perf_sysmem_hint">ينطبق على عميل Steam والألعاب. مطلوب على Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">تجاوز مساعد xalia في Steam</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">بديل في مساحة المستخدم لبرنامج تشغيل ntsync في Linux. أثناء تفعيله، يستخدمه Proton بدلًا من droiddeck-esync وdroiddeck-fsync. يعمل مع Proton Experimental ARM64 وGE-Proton وproton-cachyos. يُطبَّق في الجلسة التالية.</string>
|
||||
@@ -1910,6 +1936,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">مسح</string>
|
||||
<string name="game_sync_err_runtime">ثبِّت بيئة التشغيل أولاً</string>
|
||||
<string name="game_sync_err_steam_library">مكتبة Steam غير متاحة</string>
|
||||
<string name="game_sync_err_previous_sd">مكتبة SD السابقة غير متاحة</string>
|
||||
@@ -3993,8 +4020,6 @@
|
||||
<string name="integration_shortcuts_hint">يبقى Alt+Tab ومفتاح Win وزر الرئيسية داخل الجلسة</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">غير متاح في Android؟ معلومات التطبيق → ⋮ → السماح بالإعدادات المحظورة</string>
|
||||
<string name="integration_shortcuts_restricted">محظور من Android · معلومات التطبيق → ⋮ → السماح بالإعدادات المحظورة</string>
|
||||
<string name="integration_shortcuts_service">مفاتيح نظام DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">إبقاء Alt+Tab ومفتاح Win وزر الرئيسية داخل جلسة DroidDeck النشطة بدلاً من Android.</string>
|
||||
<string name="integration_brightness_needed">فعّل «السطوع» من الإعداد → تكامل Steam</string>
|
||||
<string name="setup_gpu_bridge_off">جسر Mali: متوقف</string>
|
||||
<string name="setup_gpu_bridge_unusable">لا يمكن لـ %1$s استخدام جسر Mali (يحتاج إلى معالج رسوميات Mali من دون مسار لبرنامج تشغيل النظام)، لذا ليس لهذا المفتاح أي تأثير هنا.</string>
|
||||
@@ -4159,10 +4184,11 @@
|
||||
<string name="input_reset_positions">إعادة تعيين المواضع</string>
|
||||
<string name="input_show_label">إظهار التسمية</string>
|
||||
<string name="input_layout_import_failed">تعذّر استيراد هذا التخطيط</string>
|
||||
<string name="epic_third_party_managed">يُثبّت عبر %1$s</string>
|
||||
|
||||
<string name="theme_white_red">ثلج قرمزي</string>
|
||||
<string name="theme_white_red_detail">أسطح بيضاء مع لمسات حمراء.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">الموسيقى التصويرية</string>
|
||||
<string name="rail_music">الموسيقى</string>
|
||||
<string name="soundtracks_options">خيارات التشغيل</string>
|
||||
|
||||
@@ -9,15 +9,35 @@
|
||||
<string name="steamvr_recovery_failed">DroidDeck no pudo reiniciarse automáticamente. Cierra la app por completo y vuelve a abrirla.</string>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>La primera vez se descarga Steam. Puede tardar unos minutos.</item>
|
||||
<item>De forma predeterminada, al salir de la app Steam se pausa y continúa donde lo dejaste cuando vuelves.</item>
|
||||
<item>Tu control aparece como un control de Xbox 360. Si no, usa los controles en pantalla.</item>
|
||||
<item>La primera ejecución descarga Steam. Puede tardar unos minutos.</item>
|
||||
<item>Tu control aparece en Steam como un control de Steam Deck. Cámbialo a Steam Controller, DualShock 4, DualSense o Xbox 360 en los ajustes de la sesión; se aplica en la próxima sesión.</item>
|
||||
<item>Mantén Atrás en tu control para abrir el menú Quick Access de Steam. «Mantener Atrás para atajos de Steam» debe estar activado en los ajustes de la sesión.</item>
|
||||
<item>Comportamiento en segundo plano decide qué pasa al salir de la app: Nativo prepara Steam para suspenderse, Auto lo pausa, Manual espera a Reanudar y Nunca lo mantiene en ejecución.</item>
|
||||
<item>Los juegos de Steam usan el Límite de fotogramas de Steam en Quick Access. La pantalla cambia a una frecuencia de actualización que el límite divida exactamente, si existe.</item>
|
||||
<item>El Modo de baja latencia del menú de sesión envía la entrada del control a 1000 Hz en lugar de 250 Hz, a cambio de un poco más de CPU y batería.</item>
|
||||
<item>Cada juego tiene su propio perfil con Proton, FEX, componentes y ajustes de entorno.</item>
|
||||
<item>El menú de sesión tiene un interruptor de micrófono para el chat de voz y un botón Suspender ahora para congelar la sesión cuando quieras.</item>
|
||||
<item>Arrastra el HUD de DroidDeck para moverlo, pellizca para cambiar su tamaño y empújalo contra un borde para acoplarlo como una pequeña pestaña de FPS.</item>
|
||||
<item>En consolas portátiles de doble pantalla, la pantalla inferior puede mostrar descargas, notificaciones, capturas de pantalla y el chat de Steam. Intercambiar pantallas pone el juego allí.</item>
|
||||
<item>Añade bibliotecas de Steam desde una tarjeta SD, una unidad USB o un SSD, y DroidDeck mantiene los juegos juntos en tu Biblioteca.</item>
|
||||
<item>Tiendas te permite iniciar sesión en Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io y Game Jolt, y luego instalar y actualizar sus juegos desde DroidDeck.</item>
|
||||
<item>Componentes como FEX, DXVK y VKD3D-Proton se actualizan solos, y Proton Experimental ARM64 es el predeterminado, o Proton 11.0 ARM64 una vez instalada esa versión.</item>
|
||||
<item>Comprimir Steam mientras se ejecuta un juego libera RAM en dispositivos con poca memoria.</item>
|
||||
<item>Desliza desde el borde derecho para abrir el menú de sesión: modo touchpad, Teclado de PC, Modo de baja latencia, perfil del juego y más.</item>
|
||||
<item>¿El juego va lento? Limita la tasa de fotogramas en Quick Access y prueba otra versión de Proton o un ajuste preestablecido de FEX en los componentes del juego.</item>
|
||||
<item>¿Audio del juego entrecortado o ausente? Prueba el interruptor DirectAudio para juegos en los ajustes de Steam, en Audio.</item>
|
||||
<item>Configuración, y luego Almacenamiento, puede borrar cachés de shaders y prefijos sobrantes de juegos que quitaste.</item>
|
||||
<item>¿Encontraste un error? Compartir registros en el menú de sesión reúne los datos de diagnóstico. Publícalos en #bug-reports en Discord.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>La primera vez se prepara el escritorio. Puede tardar unos minutos.</item>
|
||||
<item>De forma predeterminada, al salir de la app la sesión se pausa y continúa donde la dejaste cuando vuelves.</item>
|
||||
<item>La primera ejecución configura el escritorio. Puede tardar unos minutos.</item>
|
||||
<item>El tacto funciona como un touchpad: arrastra para mover el puntero y toca para hacer clic.</item>
|
||||
<item>Tu control aparece como un control de Xbox 360. Si no, usa los controles en pantalla.</item>
|
||||
<item>Comportamiento en segundo plano decide qué pasa al salir de la app: Manual espera a Reanudar de forma predeterminada, Auto pausa y Nunca lo mantiene en ejecución.</item>
|
||||
<item>Desliza desde el borde derecho para abrir el menú de sesión y elige Teclado de PC para escribir en apps que ignoran el teclado de Android.</item>
|
||||
<item>El Teclado de PC del menú de sesión tiene tamaño, opacidad y grupos de teclas ajustables.</item>
|
||||
<item>Tu control aparece como un control Xbox 360. Si no, usa los controles en pantalla.</item>
|
||||
<item>El menú de sesión tiene un interruptor de micrófono y un botón Suspender ahora para congelar la sesión cuando quieras.</item>
|
||||
<item>¿Encontraste un error? Compartir registros en el menú de sesión reúne los datos de diagnóstico. Publícalos en #bug-reports en Discord.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Sesión</string>
|
||||
<string name="session_channel_description">Se muestra mientras hay una sesión de Steam o de escritorio abierta</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Touchpad</string>
|
||||
<string name="mode_touch_direct">Directo</string>
|
||||
<string name="mode_touch_note">Auto: touchpad en Escritorio, directo en Steam.</string>
|
||||
<string name="mode_pen">Lápiz</string>
|
||||
<string name="mode_pen_mouse">Ratón</string>
|
||||
<string name="mode_pen_touch">Táctil</string>
|
||||
<string name="mode_pen_button">Botón lateral</string>
|
||||
<string name="mode_osc">Controles en pantalla</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Auto muestra los controles en pantalla cuando no hay ningún control conectado.</string>
|
||||
@@ -606,6 +630,8 @@
|
||||
<string name="perf_cap_off">Desactivado</string>
|
||||
<string name="perf_cap_auto">Predeterminado del controlador</string>
|
||||
<string name="perf_zram_client">Comprimir Steam mientras se ejecuta un juego</string>
|
||||
<string name="perf_zram_idle">Comprimir memoria inactiva del juego</string>
|
||||
<string name="perf_zram_idle_hint">Comprime la memoria inactiva del juego cuando queda poca RAM. Desactívalo si los juegos se congelan unos segundos cada medio minuto aproximadamente. Se aplica la próxima vez que se inicie la sesión.</string>
|
||||
<string name="perf_zram_client_hint">20 s después de que empiece un juego, el cliente de Steam se comprime en zRAM para dejarle más memoria al juego, y se vuelve a leer cuando el juego se cierra. Desactívalo si la sesión se cierra poco después de iniciar los juegos. Un límite de RAM definido arriba sigue comprimiendo Steam cuando la sesión lo supera.</string>
|
||||
<string name="perf_ram_cap">Límite de RAM</string>
|
||||
<string name="perf_ram_cap_hint">Se aplica mientras se ejecuta el cliente de Steam, en modo Steam o desde el escritorio. Cuando la sesión usa más de esto, Steam y luego los demás procesos compatibles de la sesión se comprimen en zRAM. Es un límite flexible: no se cierra nada, pero los juegos pueden tener microcortes mientras se recuperan las páginas.</string>
|
||||
@@ -616,7 +642,7 @@
|
||||
<string name="perf_gpuclock_hint">Solo Adreno. Menos microcortes, más consumo de batería y calor.</string>
|
||||
<string name="perf_fixes">Correcciones de sesión</string>
|
||||
<string name="perf_sysmem">Turnip: renderizado sysmem</string>
|
||||
<string name="perf_sysmem_hint">Más rápido para el cliente de Steam; en los juegos, el controlador elige entre renderizado por mosaicos o en memoria del sistema en cada pasada. Obligatorio en Adreno 710/720/722.</string>
|
||||
<string name="perf_sysmem_hint">Se aplica al cliente de Steam y a los juegos. Obligatorio en Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Omitir el asistente xalia de Steam</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">Un sustituto en espacio de usuario del controlador ntsync de Linux. Mientras está activado, Proton lo usa en lugar de droiddeck-esync y droiddeck-fsync. Funciona con Proton Experimental ARM64, GE-Proton y proton-cachyos. Se aplica en la próxima sesión.</string>
|
||||
@@ -1917,6 +1943,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">Borrar</string>
|
||||
<string name="game_sync_err_runtime">Instala primero el runtime</string>
|
||||
<string name="game_sync_err_steam_library">La biblioteca de Steam no está disponible</string>
|
||||
<string name="game_sync_err_previous_sd">La biblioteca anterior de la SD no está disponible</string>
|
||||
@@ -3849,8 +3876,6 @@
|
||||
<string name="integration_shortcuts_hint">Alt+Tab, la tecla Win y el botón Inicio se quedan en la sesión</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">¿Aparece en gris en Android? Información de la app → ⋮ → Permitir configuración restringida</string>
|
||||
<string name="integration_shortcuts_restricted">Bloqueado por Android · Información de la app → ⋮ → Permitir configuración restringida</string>
|
||||
<string name="integration_shortcuts_service">Teclas del sistema de DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Mantiene Alt+Tab, la tecla Win y el botón Inicio dentro de una sesión activa de DroidDeck en lugar de Android.</string>
|
||||
<string name="integration_brightness_needed">Activa Brillo en Configuración → Integración con Steam</string>
|
||||
<string name="setup_gpu_bridge_off">Puente Mali: desactivado</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s no puede usar el puente Mali (necesita una GPU Mali sin ruta de controlador del sistema), así que esta opción no tiene efecto aquí.</string>
|
||||
@@ -4012,6 +4037,7 @@
|
||||
<string name="input_reset_positions">Restablecer posiciones</string>
|
||||
<string name="input_show_label">Mostrar etiqueta</string>
|
||||
<string name="input_layout_import_failed">No se pudo importar esta disposición</string>
|
||||
<string name="epic_third_party_managed">Se instala mediante %1$s</string>
|
||||
<string name="theme_white_red">Nieve escarlata</string>
|
||||
<string name="theme_white_red_detail">Superficies blancas con acentos rojos.</string>
|
||||
<string name="rail_soundtracks">Bandas sonoras</string>
|
||||
|
||||
@@ -9,15 +9,35 @@
|
||||
<string name="steamvr_recovery_failed">DroidDeck не успя да се рестартира автоматично. Затворете приложението напълно и след това го отворете отново.</string>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>Първото стартиране изтегля Steam. Това може да отнеме няколко минути.</item>
|
||||
<item>По подразбиране излизането от приложението поставя Steam на пауза; при връщане продължава от същото място.</item>
|
||||
<item>Контролерът ви се разпознава като контролер Xbox 360. В противен случай използвайте екранните контроли.</item>
|
||||
<item>При първото стартиране се изтегля Steam. Това може да отнеме няколко минути.</item>
|
||||
<item>Контролерът ви се представя на Steam като контролер на Steam Deck. Сменете го със Steam Controller, DualShock 4, DualSense или Xbox 360 в настройките на сесията; прилага се от следващата сесия.</item>
|
||||
<item>Задръжте Назад на контролера, за да отворите менюто Quick Access на Steam. «Задържане на Назад за преки пътища в Steam» трябва да е включено в настройките на сесията.</item>
|
||||
<item>Поведение във фонов режим определя какво става, когато излезете от приложението: Системно подготвя Steam за заспиване, Автоматично го паузира, Ръчно чака Продължи, Никога го оставя да работи.</item>
|
||||
<item>Игрите в Steam ползват Frame Limit на Steam в Quick Access. Екранът превключва към честота на опресняване, на която ограничението се дели точно, ако има такава.</item>
|
||||
<item>Режим на ниска латентност в менюто на сесията изпраща входа от контролера с 1000 Hz вместо 250 Hz, срещу малко повече процесор и батерия.</item>
|
||||
<item>Всяка игра има собствен профил с Proton, FEX, компоненти и настройки на средата.</item>
|
||||
<item>Менюто на сесията има превключвател за микрофон за гласов чат и бутон Приспи сега, който замразява сесията при нужда.</item>
|
||||
<item>Плъзнете HUD на DroidDeck, за да го преместите, ощипете, за да го преоразмерите, и го избутайте към ръба, за да се закачи като малък раздел с FPS.</item>
|
||||
<item>На преносими конзоли с два екрана долният екран може да показва изтегляния, известия, снимки на екрана и чата на Steam. Размяна на екраните поставя играта там.</item>
|
||||
<item>Добавяйте библиотеки на Steam от SD карта, USB устройство или SSD, а DroidDeck държи игрите заедно в Библиотека.</item>
|
||||
<item>Магазини ви позволява да влезете в Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io и Game Jolt, а после да инсталирате и обновявате техните игри от DroidDeck.</item>
|
||||
<item>Компоненти като FEX, DXVK и VKD3D-Proton се обновяват сами, а Proton Experimental ARM64 е по подразбиране, или Proton 11.0 ARM64, щом тази версия е инсталирана.</item>
|
||||
<item>Компресиране на Steam, докато върви игра освобождава RAM на устройства с малко памет.</item>
|
||||
<item>Плъзнете навътре от десния ръб, за да отворите менюто на сесията: режим на тъчпад, Клавиатура за компютър, Режим на ниска латентност, профил на играта и други.</item>
|
||||
<item>Играта е бавна? Ограничете кадрите в Quick Access, после опитайте друга версия на Proton или друга предварителна настройка на FEX в компонентите на играта.</item>
|
||||
<item>Пращене или липсващ звук в играта? Опитайте превключвателя DirectAudio за игри в настройките на Steam, под Звук.</item>
|
||||
<item>Настройка, после Съхранение, може да изчисти кешовете за шейдъри и остатъчните префикси от игри, които сте премахнали.</item>
|
||||
<item>Попаднахте на грешка? Споделяне на дневници в менюто на сесията събира диагностични данни. Публикувайте ги в #bug-reports в Discord.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>Първото стартиране подготвя работния плот. Това може да отнеме няколко минути.</item>
|
||||
<item>По подразбиране излизането от приложението поставя сесията на пауза; при връщане тя продължава от същото място.</item>
|
||||
<item>Докосването действа като тъчпад: плъзгане премества показалеца, докосване щраква.</item>
|
||||
<item>Контролерът ви се разпознава като контролер Xbox 360. В противен случай използвайте екранните контроли.</item>
|
||||
<item>При първото стартиране се настройва работният плот. Това може да отнеме няколко минути.</item>
|
||||
<item>Докосването работи като тъчпад: плъзнете, за да местите показалеца, и докоснете, за да кликнете.</item>
|
||||
<item>Поведение във фонов режим определя какво става, когато излезете от приложението: Ръчно по подразбиране чака Продължи, Автоматично паузира, Никога го оставя да работи.</item>
|
||||
<item>Плъзнете навътре от десния ръб, за да отворите менюто на сесията, после изберете Клавиатура за компютър, за да пишете в приложения, които игнорират клавиатурата на Android.</item>
|
||||
<item>Клавиатурата за компютър в менюто на сесията има регулируеми размер, прозрачност и групи клавиши.</item>
|
||||
<item>Контролерът ви се представя като контролер Xbox 360. Иначе използвайте контролите на екрана.</item>
|
||||
<item>Менюто на сесията има превключвател за микрофон и бутон Приспи сега, който замразява сесията при нужда.</item>
|
||||
<item>Попаднахте на грешка? Споделяне на дневници в менюто на сесията събира диагностични данни. Публикувайте ги в #bug-reports в Discord.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Сесия</string>
|
||||
<string name="session_channel_description">Показва се, докато има отворена сесия на Steam или работния плот</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Тъчпад</string>
|
||||
<string name="mode_touch_direct">Директно</string>
|
||||
<string name="mode_touch_note">Автоматично: тъчпад на работния плот, директно в Steam.</string>
|
||||
<string name="mode_pen">Писалка</string>
|
||||
<string name="mode_pen_mouse">Мишка</string>
|
||||
<string name="mode_pen_touch">Докосване</string>
|
||||
<string name="mode_pen_button">Страничен бутон</string>
|
||||
<string name="mode_osc">Екранни контроли</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Автоматично показва контролите, когато няма свързан контролер.</string>
|
||||
@@ -604,6 +628,8 @@
|
||||
<string name="perf_cap_off">Изкл.</string>
|
||||
<string name="perf_cap_auto">По подразбиране за драйвера</string>
|
||||
<string name="perf_zram_client">Компресиране на Steam, докато върви игра</string>
|
||||
<string name="perf_zram_idle">Компресиране на неактивната памет на играта</string>
|
||||
<string name="perf_zram_idle_hint">Компресира неактивната памет на играта при малко RAM. Изключете го, ако игрите замръзват за няколко секунди приблизително на всеки половин минута. Прилага се при следващото стартиране на сесията.</string>
|
||||
<string name="perf_zram_client_hint">20 s след стартиране на игра клиентът на Steam се компресира в zRAM, за да остави повече памет на играта, и се прочита обратно, когато играта се затвори. Изключете, ако сесията се затваря малко след стартиране на игри. Ограничение на RAM по-горе пак компресира Steam, когато сесията го надхвърли.</string>
|
||||
<string name="perf_ram_cap">Ограничение на RAM</string>
|
||||
<string name="perf_ram_cap_hint">Прилага се, докато клиентът на Steam работи, в режим Steam или от работния плот. Когато сесията използва повече от това, Steam и след това другите поддържани процеси на сесията се компресират в zRAM. Меко ограничение: нищо не се затваря, но игрите може да засичат, докато страниците се връщат.</string>
|
||||
@@ -614,7 +640,7 @@
|
||||
<string name="perf_gpuclock_hint">Само за Adreno. По-малко засечки, по-голямо използване на батерията и повече топлина.</string>
|
||||
<string name="perf_fixes">Корекции на сесията</string>
|
||||
<string name="perf_sysmem">Turnip: рендиране sysmem</string>
|
||||
<string name="perf_sysmem_hint">По-бързо за клиента на Steam; в игрите драйверът избира за всеки проход между рендериране на плочки и в системната памет. Задължително на Adreno 710/720/722.</string>
|
||||
<string name="perf_sysmem_hint">Прилага се за клиента на Steam и игрите. Изисква се при Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Пропускане на помощника xalia на Steam</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">Заместител на потребителско ниво за драйвера ntsync на Linux. Докато е включен, Proton го използва вместо droiddeck-esync и droiddeck-fsync. Работи с Proton Experimental ARM64, GE-Proton и proton-cachyos. Прилага се от следващата сесия.</string>
|
||||
@@ -1834,6 +1860,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">Изчисти</string>
|
||||
<string name="game_sync_err_runtime">Инсталирай средата първо</string>
|
||||
<string name="game_sync_err_steam_library">Библиотеката на Steam не е достъпна</string>
|
||||
<string name="game_sync_err_previous_sd">Предишната SD библиотека не е достъпна</string>
|
||||
@@ -3837,8 +3864,6 @@
|
||||
<string name="integration_shortcuts_hint">Alt+Tab, клавишът Win и бутонът Начало остават в сесията</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">Неактивно в Android? Информация за приложението → ⋮ → Разрешаване на ограничените настройки</string>
|
||||
<string name="integration_shortcuts_restricted">Блокирано от Android · Информация за приложението → ⋮ → Разрешаване на ограничените настройки</string>
|
||||
<string name="integration_shortcuts_service">Системни клавиши на DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Задържа Alt+Tab, клавиша Win и бутона Начало в активната сесия на DroidDeck вместо в Android.</string>
|
||||
<string name="integration_brightness_needed">Включете „Яркост“ в Настройка → Интеграция със Steam</string>
|
||||
<string name="setup_gpu_bridge_off">Mali мост: изкл.</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s не може да използва моста Mali (нужен е графичен процесор Mali без маршрут през системен драйвер), затова този превключвател няма ефект тук.</string>
|
||||
@@ -3999,10 +4024,11 @@
|
||||
<string name="input_reset_positions">Нулиране на позициите</string>
|
||||
<string name="input_show_label">Показване на етикета</string>
|
||||
<string name="input_layout_import_failed">Това разположение не можа да бъде импортирано</string>
|
||||
<string name="epic_third_party_managed">Инсталира се чрез %1$s</string>
|
||||
|
||||
<string name="theme_white_red">Ален сняг</string>
|
||||
<string name="theme_white_red_detail">Бели повърхности с червени акценти.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">Саундтраци</string>
|
||||
<string name="rail_music">Музика</string>
|
||||
<string name="soundtracks_options">Опции за възпроизвеждане</string>
|
||||
|
||||
@@ -10,14 +10,34 @@
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>První spuštění stáhne Steam. Může to trvat několik minut.</item>
|
||||
<item>Ve výchozím nastavení se po opuštění aplikace Steam pozastaví; po návratu pokračuje, kde skončil.</item>
|
||||
<item>Váš ovladač se zobrazí jako ovladač Xbox 360. Jinak použijte ovládání na obrazovce.</item>
|
||||
<item>Váš ovladač se Steamu hlásí jako ovladač Steam Deck. V nastavení relace ho přepněte na Steam Controller, DualShock 4, DualSense nebo Xbox 360; použije se od příští relace.</item>
|
||||
<item>Podržením Zpět na ovladači otevřete nabídku Quick Access ve Steamu. V nastavení relace musí být zapnuté Podržení Zpět pro zkratky Steam.</item>
|
||||
<item>Chování na pozadí určuje, co se stane po opuštění aplikace: Nativní připraví Steam na uspání, Automaticky ho pozastaví, Manuální čeká na Obnovit, Nikdy ho nechá běžet.</item>
|
||||
<item>Hry ze Steamu používají Frame Limit ze Steamu v Quick Access. Displej se přepne na obnovovací frekvenci, kterou limit dělí beze zbytku, pokud nějaká existuje.</item>
|
||||
<item>Režim nízkého zpoždění v nabídce relace posílá vstup z ovladače rychlostí 1000 Hz místo 250 Hz za cenu o něco vyššího zatížení procesoru a baterie.</item>
|
||||
<item>Každá hra má vlastní profil s nastavením Proton, FEX, komponent a prostředí.</item>
|
||||
<item>Nabídka relace obsahuje přepínač mikrofonu pro hlasový chat a tlačítko Pozastavit teď, které relaci na požádání zmrazí.</item>
|
||||
<item>HUD DroidDeck přesunete přetažením, velikost změníte roztažením prsty a když ho odsunete k okraji, připne se jako malá karta s FPS.</item>
|
||||
<item>U kapesních konzolí se dvěma displeji může spodní displej zobrazovat stahování, oznámení, snímky obrazovky a chat Steamu. Prohodit obrazovky tam místo toho přesune hru.</item>
|
||||
<item>Přidejte knihovny Steamu z SD karty, USB disku nebo SSD a DroidDeck udrží hry pohromadě v Knihovně.</item>
|
||||
<item>Obchody vám umožní přihlásit se do Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io a Game Jolt a pak instalovat a aktualizovat jejich hry přímo z DroidDeck.</item>
|
||||
<item>Komponenty jako FEX, DXVK a VKD3D-Proton se aktualizují samy a výchozí je Proton Experimental ARM64, případně Proton 11.0 ARM64, jakmile je tato verze nainstalovaná.</item>
|
||||
<item>Komprimovat Steam během hry uvolní RAM na zařízeních s nedostatkem paměti.</item>
|
||||
<item>Přejetím od pravého okraje otevřete nabídku relace: režim touchpadu, Klávesnice PC, Režim nízkého zpoždění, profil hry a další.</item>
|
||||
<item>Hra běží pomalu? Omezte snímkovou frekvenci v Quick Access a zkuste jinou verzi Proton nebo jinou předvolbu FEX v komponentách hry.</item>
|
||||
<item>Praskání nebo chybějící zvuk ve hře? Zkuste přepínač DirectAudio pro hry v nastavení Steamu v části Zvuk.</item>
|
||||
<item>Příprava a potom Úložiště umí vymazat mezipaměti shaderů a zbylé prefixy po odstraněných hrách.</item>
|
||||
<item>Narazili jste na chybu? Sdílet protokoly v nabídce relace sbalí diagnostiku. Pošlete ji do #bug-reports na Discordu.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>První spuštění připraví Plochu. Může to trvat několik minut.</item>
|
||||
<item>Ve výchozím nastavení se po opuštění aplikace relace pozastaví; po návratu pokračuje, kde skončila.</item>
|
||||
<item>Dotyk funguje jako touchpad: tažením posouváte kurzor, dotykem klikáte.</item>
|
||||
<item>Váš ovladač se zobrazí jako ovladač Xbox 360. Jinak použijte ovládání na obrazovce.</item>
|
||||
<item>První spuštění připraví plochu. Může to trvat několik minut.</item>
|
||||
<item>Dotyk funguje jako touchpad: tažením pohybujete ukazatelem, klepnutím klikáte.</item>
|
||||
<item>Chování na pozadí určuje, co se stane po opuštění aplikace: Manuální ve výchozím stavu čeká na Obnovit, Automaticky pozastaví, Nikdy nechá běžet.</item>
|
||||
<item>Přejetím od pravého okraje otevřete nabídku relace a poté zvolte Klávesnice PC, abyste mohli psát v aplikacích, které ignorují klávesnici Androidu.</item>
|
||||
<item>Klávesnice PC v nabídce relace má nastavitelnou velikost, průhlednost a skupiny kláves.</item>
|
||||
<item>Váš ovladač se hlásí jako ovladač Xbox 360. Jinak použijte ovládací prvky na obrazovce.</item>
|
||||
<item>Nabídka relace obsahuje přepínač mikrofonu a tlačítko Pozastavit teď, které relaci na požádání zmrazí.</item>
|
||||
<item>Narazili jste na chybu? Sdílet protokoly v nabídce relace sbalí diagnostiku. Pošlete ji do #bug-reports na Discordu.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Relace</string>
|
||||
<string name="session_channel_description">Zobrazuje se, když je otevřená relace Steamu nebo Plochy</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Touchpad</string>
|
||||
<string name="mode_touch_direct">Přímé</string>
|
||||
<string name="mode_touch_note">Automaticky: touchpad na Ploše, přímo ve Steamu.</string>
|
||||
<string name="mode_pen">Pero</string>
|
||||
<string name="mode_pen_mouse">Myš</string>
|
||||
<string name="mode_pen_touch">Dotyk</string>
|
||||
<string name="mode_pen_button">Boční tlačítko</string>
|
||||
<string name="mode_osc">Ovládání na obrazovce</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Automaticky zobrazí ovládání, pokud není připojen žádný ovladač.</string>
|
||||
@@ -608,6 +632,8 @@
|
||||
<string name="perf_cap_off">Vypnuto</string>
|
||||
<string name="perf_cap_auto">Výchozí ovladače</string>
|
||||
<string name="perf_zram_client">Komprimovat Steam během hry</string>
|
||||
<string name="perf_zram_idle">Komprimovat neaktivní paměť hry</string>
|
||||
<string name="perf_zram_idle_hint">Při nedostatku RAM stránkuje neaktivní paměť hry. Vypněte to, pokud hry zhruba každou půlminutu na několik sekund zamrznou. Projeví se při příštím spuštění relace.</string>
|
||||
<string name="perf_zram_client_hint">20 s po spuštění hry se klient Steam zkomprimuje do zRAM, aby hře zbylo více paměti, a po zavření hry se načte zpět. Vypněte, pokud se relace krátce po spuštění her zavírá. Limit RAM výše stále komprimuje Steam, když ho relace překročí.</string>
|
||||
<string name="perf_ram_cap">Limit RAM</string>
|
||||
<string name="perf_ram_cap_hint">Platí, když běží klient Steam, v režimu Steam nebo z Plochy. Když relace použije víc, zkomprimuje se do zRAM Steam a poté další podporované procesy relace. Měkký limit: nic se nezavře, ale hry mohou trhat, než se stránky načtou zpět.</string>
|
||||
@@ -618,7 +644,7 @@
|
||||
<string name="perf_gpuclock_hint">Jen Adreno. Méně zadrhávání, více spotřeby baterie a tepla.</string>
|
||||
<string name="perf_fixes">Opravy relace</string>
|
||||
<string name="perf_sysmem">Turnip: vykreslování sysmem</string>
|
||||
<string name="perf_sysmem_hint">Rychlejší pro klienta Steam; ve hrách ovladač pro každý průchod volí dlaždicové vykreslování, nebo vykreslování v systémové paměti. Vyžadováno na Adreno 710/720/722.</string>
|
||||
<string name="perf_sysmem_hint">Platí pro klienta Steam i hry. Vyžadováno na Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Vynechat Steamova pomocníka xalia</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">Uživatelská náhrada linuxového ovladače ntsync. Když je zapnuto, Proton ho používá místo droiddeck-esync a droiddeck-fsync. Funguje s Proton Experimental ARM64, GE-Proton a proton-cachyos. Použije se od příští relace.</string>
|
||||
@@ -1872,6 +1898,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">Vymazat</string>
|
||||
<string name="game_sync_err_runtime">Nejprve nainstalujte runtime</string>
|
||||
<string name="game_sync_err_steam_library">Knihovna Steamu není dostupná</string>
|
||||
<string name="game_sync_err_previous_sd">Předchozí knihovna na SD kartě není dostupná</string>
|
||||
@@ -3915,8 +3942,6 @@
|
||||
<string name="integration_shortcuts_hint">Alt+Tab, klávesa Win a tlačítko Domů zůstanou v relaci</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">V Androidu zašedlé? Informace o aplikaci → ⋮ → Povolit omezená nastavení</string>
|
||||
<string name="integration_shortcuts_restricted">Blokováno Androidem · Informace o aplikaci → ⋮ → Povolit omezená nastavení</string>
|
||||
<string name="integration_shortcuts_service">Systémové klávesy DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Ponechá Alt+Tab, klávesu Win a tlačítko Domů v aktivní relaci DroidDeck místo Androidu.</string>
|
||||
<string name="integration_brightness_needed">Zapněte Jas v Příprava → Integrace se Steamem</string>
|
||||
<string name="setup_gpu_bridge_off">Most Mali: vypnuto</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s nemůže použít most Mali (potřebuje GPU Mali bez trasy přes systémový ovladač), takže tento přepínač tady nemá žádný účinek.</string>
|
||||
@@ -4079,10 +4104,11 @@
|
||||
<string name="input_reset_positions">Obnovit pozice</string>
|
||||
<string name="input_show_label">Zobrazit popisek</string>
|
||||
<string name="input_layout_import_failed">Toto rozložení nelze importovat</string>
|
||||
<string name="epic_third_party_managed">Instaluje se přes %1$s</string>
|
||||
|
||||
<string name="theme_white_red">Šarlatový sníh</string>
|
||||
<string name="theme_white_red_detail">Bílé povrchy s červenými akcenty.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">Soundtracky</string>
|
||||
<string name="rail_music">Hudba</string>
|
||||
<string name="soundtracks_options">Možnosti přehrávání</string>
|
||||
|
||||
@@ -9,15 +9,35 @@
|
||||
<string name="steamvr_recovery_failed">DroidDeck kunne ikke genstarte automatisk. Luk appen helt, og åbn den så igen.</string>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>Den første start downloader Steam. Det kan tage nogle minutter.</item>
|
||||
<item>Som standard sætter Steam på pause, når du forlader appen, og fortsætter, hvor du slap, når du kommer tilbage.</item>
|
||||
<item>Din controller vises som en Xbox 360-controller. Brug ellers kontrollerne på skærmen.</item>
|
||||
<item>Første kørsel downloader Steam. Det kan tage et par minutter.</item>
|
||||
<item>Din controller vises i Steam som en Steam Deck-controller. Skift den til Steam Controller, DualShock 4, DualSense eller Xbox 360 i sessionsindstillingerne. Det gælder fra næste session.</item>
|
||||
<item>Hold Tilbage nede på din controller for at åbne Steams Hurtig adgang-menu. Hold Tilbage for Steam-genveje skal være slået til i sessionsindstillingerne.</item>
|
||||
<item>Baggrundsopførsel bestemmer, hvad der sker, når du forlader appen: Native gør Steam klar til dvale, Auto sætter det på pause, Manuel venter på Genoptag, Aldrig lader det køre.</item>
|
||||
<item>Steam-spil bruger Steams Frame Limit i Hurtig adgang. Skærmen skifter til en opdateringsfrekvens, som grænsen går op i, hvis der findes en.</item>
|
||||
<item>Lav forsinkelse i sessionsmenuen sender controllerinput med 1000 Hz i stedet for 250 Hz, til gengæld for lidt mere CPU og batteri.</item>
|
||||
<item>Hvert spil har sin egen profil med Proton, FEX, komponenter og miljøindstillinger.</item>
|
||||
<item>Sessionsmenuen har en mikrofonknap til stemmechat og en Sæt på pause nu-knap, der fryser sessionen efter behov.</item>
|
||||
<item>Træk DroidDeck HUD for at flytte det, knib for at ændre størrelsen, og skub det ud mod en kant for at fæstne det som en lille FPS-fane.</item>
|
||||
<item>På håndholdte med to skærme kan den nederste skærm vise downloads, notifikationer, skærmbilleder og Steam-chat. Byt skærme lægger i stedet spillet dernede.</item>
|
||||
<item>Tilføj Steam-biblioteker fra et SD-kort, et USB-drev eller en SSD, så samler DroidDeck spillene i dit Bibliotek.</item>
|
||||
<item>Butikker lader dig logge ind på Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io og Game Jolt og derefter installere og opdatere deres spil fra DroidDeck.</item>
|
||||
<item>Komponenter som FEX, DXVK og VKD3D-Proton opdaterer sig selv, og Proton Experimental ARM64 er standard, eller Proton 11.0 ARM64, når den version er installeret.</item>
|
||||
<item>Komprimer Steam, mens et spil kører frigør RAM på enheder med lidt hukommelse.</item>
|
||||
<item>Stryg ind fra højre kant for at åbne sessionsmenuen: touchpad-tilstand, PC-tastatur, Lav forsinkelse, spilprofil og mere.</item>
|
||||
<item>Kører spillet langsomt? Begræns billedfrekvensen i Hurtig adgang, og prøv så en anden Proton-version eller FEX-forudindstilling i spillets komponenter.</item>
|
||||
<item>Knitrende eller manglende lyd i spillet? Prøv kontakten DirectAudio til spil i Steam-indstillingerne under Lyd.</item>
|
||||
<item>Opsætning og så Lager kan rydde shader-caches og overskydende præfikser fra spil, du har fjernet.</item>
|
||||
<item>Har du ramt en fejl? Del logs i sessionsmenuen samler diagnostik. Send dem i #bug-reports på Discord.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>Den første start sætter skrivebordet op. Det kan tage nogle minutter.</item>
|
||||
<item>Som standard sætter sessionen på pause, når du forlader appen, og fortsætter, hvor du slap, når du kommer tilbage.</item>
|
||||
<item>Berøring fungerer som et touchpad: Træk for at flytte markøren, tryk for at klikke.</item>
|
||||
<item>Din controller vises som en Xbox 360-controller. Brug ellers kontrollerne på skærmen.</item>
|
||||
<item>Første kørsel sætter skrivebordet op. Det kan tage et par minutter.</item>
|
||||
<item>Touch fungerer som et touchpad: træk for at flytte markøren, tryk for at klikke.</item>
|
||||
<item>Baggrundsopførsel bestemmer, hvad der sker, når du forlader appen: Manuel venter som standard på Genoptag, Auto sætter på pause, Aldrig lader det køre.</item>
|
||||
<item>Stryg ind fra højre kant for at åbne sessionsmenuen, og vælg så PC-tastatur for at skrive i apps, der ignorerer Android-tastaturet.</item>
|
||||
<item>PC-tastaturet i sessionsmenuen har justerbar størrelse, gennemsigtighed og tastgrupper.</item>
|
||||
<item>Din controller vises som en Xbox 360-controller. Ellers kan du bruge betjeningen på skærmen.</item>
|
||||
<item>Sessionsmenuen har en mikrofonknap og en Sæt på pause nu-knap, der fryser sessionen efter behov.</item>
|
||||
<item>Har du ramt en fejl? Del logs i sessionsmenuen samler diagnostik. Send dem i #bug-reports på Discord.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Session</string>
|
||||
<string name="session_channel_description">Vises, når en Steam- eller skrivebordssession er åben</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Touchpad</string>
|
||||
<string name="mode_touch_direct">Direkte</string>
|
||||
<string name="mode_touch_note">Auto: touchpad på Skrivebord, direkte i Steam.</string>
|
||||
<string name="mode_pen">Pen</string>
|
||||
<string name="mode_pen_mouse">Mus</string>
|
||||
<string name="mode_pen_touch">Berøring</string>
|
||||
<string name="mode_pen_button">Sideknap</string>
|
||||
<string name="mode_osc">Kontroller på skærmen</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Auto viser kontrollerne, når ingen controller er tilsluttet.</string>
|
||||
@@ -604,6 +628,8 @@
|
||||
<string name="perf_cap_off">Fra</string>
|
||||
<string name="perf_cap_auto">Driverstandard</string>
|
||||
<string name="perf_zram_client">Komprimer Steam, mens et spil kører</string>
|
||||
<string name="perf_zram_idle">Komprimer spillets inaktive hukommelse</string>
|
||||
<string name="perf_zram_idle_hint">Pager spillets inaktive hukommelse ud, når RAM er lav. Slå det fra, hvis spil fryser i et par sekunder cirka hvert halve minut. Træder i kraft, næste gang sessionen starter.</string>
|
||||
<string name="perf_zram_client_hint">20 s efter et spil starter, komprimeres Steam-klienten i zRAM for at give spillet mere hukommelse, og læses tilbage, når spillet lukkes. Slå fra, hvis sessionen lukker kort efter, at spil starter. En RAM-grænse ovenfor komprimerer stadig Steam, når sessionen overskrider den.</string>
|
||||
<string name="perf_ram_cap">RAM-grænse</string>
|
||||
<string name="perf_ram_cap_hint">Gælder, mens Steam-klienten kører, i Steam-tilstand eller fra skrivebordet. Når sessionen bruger mere end dette, komprimeres Steam og derefter sessionens andre understøttede processer i zRAM. En blød grænse: intet lukkes, men spil kan hakke, mens sider hentes tilbage.</string>
|
||||
@@ -614,7 +640,7 @@
|
||||
<string name="perf_gpuclock_hint">Kun Adreno. Færre hak, mere batteribrug og varme.</string>
|
||||
<string name="perf_fixes">Sessionsrettelser</string>
|
||||
<string name="perf_sysmem">Turnip: sysmem-rendering</string>
|
||||
<string name="perf_sysmem_hint">Hurtigere til Steam-klienten; i spil vælger driveren flise- eller systemhukommelses-rendering for hvert pass. Påkrævet på Adreno 710/720/722.</string>
|
||||
<string name="perf_sysmem_hint">Gælder Steam-klienten og spil. Påkrævet på Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Spring Steams xalia-hjælper over</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">En stand-in til ntsync-driveren i Linux-kernen, i brugerrum. Mens den er til, bruger Proton den i stedet for droiddeck-esync og droiddeck-fsync. Fungerer med Proton Experimental ARM64, GE-Proton og proton-cachyos. Gælder fra næste session.</string>
|
||||
@@ -1834,6 +1860,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">Ryd</string>
|
||||
<string name="game_sync_err_runtime">Installer runtime først</string>
|
||||
<string name="game_sync_err_steam_library">Steam-biblioteket er ikke tilgængeligt</string>
|
||||
<string name="game_sync_err_previous_sd">Det tidligere SD-bibliotek er ikke tilgængeligt</string>
|
||||
@@ -3837,8 +3864,6 @@
|
||||
<string name="integration_shortcuts_hint">Alt+Tab, Win-tasten og Hjem-knappen bliver i sessionen</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">Nedtonet i Android? Appinfo → ⋮ → Tillad begrænsede indstillinger</string>
|
||||
<string name="integration_shortcuts_restricted">Blokeret af Android · Appinfo → ⋮ → Tillad begrænsede indstillinger</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck-systemtaster</string>
|
||||
<string name="integration_shortcuts_service_description">Holder Alt+Tab, Win-tasten og Hjem-knappen i en aktiv DroidDeck-session i stedet for Android.</string>
|
||||
<string name="integration_brightness_needed">Slå Lysstyrke til under Opsætning → Steam-integration</string>
|
||||
<string name="setup_gpu_bridge_off">Mali-bro: fra</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s kan ikke bruge Mali-broen (den kræver en Mali-GPU uden en rute gennem systemdriveren), så denne kontakt har ingen virkning her.</string>
|
||||
@@ -3999,10 +4024,11 @@
|
||||
<string name="input_reset_positions">Nulstil placeringer</string>
|
||||
<string name="input_show_label">Vis etiket</string>
|
||||
<string name="input_layout_import_failed">Dette layout kunne ikke importeres</string>
|
||||
<string name="epic_third_party_managed">Installeres via %1$s</string>
|
||||
|
||||
<string name="theme_white_red">Skarlagensne</string>
|
||||
<string name="theme_white_red_detail">Hvide overflader med røde accenter.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">Soundtracks</string>
|
||||
<string name="rail_music">Musik</string>
|
||||
<string name="soundtracks_options">Afspilningsindstillinger</string>
|
||||
|
||||
@@ -9,15 +9,35 @@
|
||||
<string name="steamvr_recovery_failed">DroidDeck konnte nicht automatisch neu starten. Schließe die App vollständig und öffne sie dann erneut.</string>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>Beim ersten Start wird Steam heruntergeladen. Das kann ein paar Minuten dauern.</item>
|
||||
<item>Standardmäßig pausiert Steam, wenn du die App verlässt, und macht bei deiner Rückkehr dort weiter, wo es aufgehört hat.</item>
|
||||
<item>Dein Controller erscheint als Xbox-360-Pad. Ansonsten nutze die Bildschirmsteuerung.</item>
|
||||
<item>Beim ersten Start wird Steam heruntergeladen. Das kann einige Minuten dauern.</item>
|
||||
<item>Dein Controller erscheint in Steam als Steam-Deck-Controller. Stelle ihn in den Sitzungseinstellungen auf Steam Controller, DualShock 4, DualSense oder Xbox 360 um; das gilt ab der nächsten Sitzung.</item>
|
||||
<item>Halte Zurück auf deinem Controller gedrückt, um das Schnellzugriffsmenü von Steam zu öffnen. Zurück halten für Steam-Kürzel muss in den Sitzungseinstellungen aktiviert sein.</item>
|
||||
<item>Verhalten im Hintergrund legt fest, was beim Verlassen der App passiert: Nativ bereitet Steam auf den Ruhezustand vor, Auto pausiert es, Manuell wartet auf Fortsetzen, Nie lässt es weiterlaufen.</item>
|
||||
<item>Steam-Spiele nutzen das Frame Limit von Steam im Schnellzugriff. Das Display wechselt auf eine Bildwiederholrate, durch die sich das Limit teilen lässt, sofern es eine gibt.</item>
|
||||
<item>Modus mit geringer Latenz im Sitzungsmenü sendet Controller-Eingaben mit 1000 Hz statt 250 Hz, auf Kosten von etwas mehr CPU-Last und Akkuverbrauch.</item>
|
||||
<item>Jedes Spiel hat ein eigenes Profil mit Proton, FEX, Komponenten und Umgebungseinstellungen.</item>
|
||||
<item>Das Sitzungsmenü hat einen Mikrofonschalter für den Sprachchat und eine Schaltfläche Jetzt anhalten, mit der du die Sitzung nach Bedarf einfrierst.</item>
|
||||
<item>Ziehe das DroidDeck-HUD, um es zu verschieben, zoome mit zwei Fingern, um die Größe zu ändern, und schiebe es an einen Rand, um es als kleinen FPS-Tab anzudocken.</item>
|
||||
<item>Bei Handhelds mit zwei Bildschirmen kann der untere Bildschirm Downloads, Benachrichtigungen, Screenshots und den Steam-Chat anzeigen. Bildschirme tauschen legt stattdessen das Spiel dorthin.</item>
|
||||
<item>Füge Steam-Bibliotheken von einer SD-Karte, einem USB-Laufwerk oder einer SSD hinzu, und DroidDeck hält die Spiele in deiner Bibliothek zusammen.</item>
|
||||
<item>Mit Stores meldest du dich bei Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io und Game Jolt an und installierst und aktualisierst deren Spiele direkt in DroidDeck.</item>
|
||||
<item>Komponenten wie FEX, DXVK und VKD3D-Proton aktualisieren sich selbst, und Proton Experimental ARM64 ist der Standard, oder Proton 11.0 ARM64, sobald diese Version installiert ist.</item>
|
||||
<item>Steam komprimieren, während ein Spiel läuft gibt auf Geräten mit knappem Arbeitsspeicher RAM frei.</item>
|
||||
<item>Wische vom rechten Rand nach innen, um das Sitzungsmenü zu öffnen: Touchpad-Modus, PC-Tastatur, Modus mit geringer Latenz, Spielprofil und mehr.</item>
|
||||
<item>Das Spiel läuft langsam? Begrenze die Bildrate im Schnellzugriff und probiere dann eine andere Proton-Version oder ein anderes FEX-Preset in den Komponenten des Spiels.</item>
|
||||
<item>Knacken oder fehlender Spielton? Probiere den Schalter DirectAudio für Spiele in den Steam-Einstellungen unter Audio.</item>
|
||||
<item>Einrichtung und dann Speicher kann Shader-Caches und übrig gebliebene Präfixe von entfernten Spielen löschen.</item>
|
||||
<item>Auf einen Fehler gestoßen? Logs teilen im Sitzungsmenü bündelt Diagnosedaten. Poste sie in #bug-reports auf Discord.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>Beim ersten Start wird der Desktop eingerichtet. Das kann ein paar Minuten dauern.</item>
|
||||
<item>Standardmäßig wird die Sitzung pausiert, wenn du die App verlässt, und macht bei deiner Rückkehr dort weiter, wo sie aufgehört hat.</item>
|
||||
<item>Beim ersten Start wird der Desktop eingerichtet. Das kann einige Minuten dauern.</item>
|
||||
<item>Touch funktioniert wie ein Touchpad: Ziehen bewegt den Zeiger, Tippen klickt.</item>
|
||||
<item>Dein Controller erscheint als Xbox-360-Pad. Ansonsten nutze die Bildschirmsteuerung.</item>
|
||||
<item>Verhalten im Hintergrund legt fest, was beim Verlassen der App passiert: Manuell wartet standardmäßig auf Fortsetzen, Auto pausiert, Nie lässt es weiterlaufen.</item>
|
||||
<item>Wische vom rechten Rand nach innen, um das Sitzungsmenü zu öffnen, und wähle dann PC-Tastatur, um in Apps zu tippen, die die Android-Tastatur ignorieren.</item>
|
||||
<item>Die PC-Tastatur im Sitzungsmenü hat einstellbare Größe, Deckkraft und Tastengruppen.</item>
|
||||
<item>Dein Controller erscheint als Xbox-360-Controller. Andernfalls nutze die Bedienelemente auf dem Bildschirm.</item>
|
||||
<item>Das Sitzungsmenü hat einen Mikrofonschalter und eine Schaltfläche Jetzt anhalten, mit der du die Sitzung nach Bedarf einfrierst.</item>
|
||||
<item>Auf einen Fehler gestoßen? Logs teilen im Sitzungsmenü bündelt Diagnosedaten. Poste sie in #bug-reports auf Discord.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Sitzung</string>
|
||||
<string name="session_channel_description">Wird angezeigt, solange eine Steam- oder Desktop-Sitzung geöffnet ist</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Touchpad</string>
|
||||
<string name="mode_touch_direct">Direkt</string>
|
||||
<string name="mode_touch_note">Auto: Touchpad auf dem Desktop, direkt in Steam.</string>
|
||||
<string name="mode_pen">Stift</string>
|
||||
<string name="mode_pen_mouse">Maus</string>
|
||||
<string name="mode_pen_touch">Touch</string>
|
||||
<string name="mode_pen_button">Seitentaste</string>
|
||||
<string name="mode_osc">Bildschirmsteuerung</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Auto zeigt die Steuerung an, wenn kein Controller verbunden ist.</string>
|
||||
@@ -604,6 +628,8 @@
|
||||
<string name="perf_cap_off">Aus</string>
|
||||
<string name="perf_cap_auto">Treiberstandard</string>
|
||||
<string name="perf_zram_client">Steam komprimieren, während ein Spiel läuft</string>
|
||||
<string name="perf_zram_idle">Inaktiven Spielspeicher komprimieren</string>
|
||||
<string name="perf_zram_idle_hint">Lagert inaktiven Spielspeicher bei knappem RAM aus. Schalte dies aus, wenn Spiele etwa jede halbe Minute für einige Sekunden einfrieren. Gilt ab dem nächsten Start der Sitzung.</string>
|
||||
<string name="perf_zram_client_hint">20 s nach dem Spielstart wird der Steam-Client in zRAM komprimiert, um dem Spiel mehr Speicher zu lassen, und beim Beenden des Spiels zurückgelesen. Schalte dies aus, wenn sich die Sitzung kurz nach dem Spielstart schließt. Ein RAM-Limit oben komprimiert Steam weiterhin, wenn die Sitzung es überschreitet.</string>
|
||||
<string name="perf_ram_cap">RAM-Limit</string>
|
||||
<string name="perf_ram_cap_hint">Gilt, solange der Steam-Client läuft, im Steam-Modus oder vom Desktop aus. Verbraucht die Sitzung mehr als diesen Wert, werden Steam und danach die übrigen unterstützten Prozesse der Sitzung in zRAM komprimiert. Ein weiches Limit: Nichts wird geschlossen, aber Spiele können ruckeln, während Seiten zurückgeladen werden.</string>
|
||||
@@ -614,7 +640,7 @@
|
||||
<string name="perf_gpuclock_hint">Nur Adreno. Weniger Ruckler, mehr Akkuverbrauch und Wärme.</string>
|
||||
<string name="perf_fixes">Sitzungskorrekturen</string>
|
||||
<string name="perf_sysmem">Turnip: Sysmem-Rendering</string>
|
||||
<string name="perf_sysmem_hint">Schneller für den Steam-Client; in Spielen wählt der Treiber pro Durchgang zwischen Kachel- und Systemspeicher-Rendering. Erforderlich bei Adreno 710/720/722.</string>
|
||||
<string name="perf_sysmem_hint">Gilt für den Steam-Client und Spiele. Erforderlich bei Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Steams xalia-Helfer überspringen</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">Ein Userspace-Ersatz für den Linux-Treiber ntsync. Solange er aktiv ist, nutzt Proton ihn statt droiddeck-esync und droiddeck-fsync. Funktioniert mit Proton Experimental ARM64, GE-Proton und proton-cachyos. Gilt ab der nächsten Sitzung.</string>
|
||||
@@ -1826,6 +1852,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Strg+C</string>
|
||||
<string name="second_key_ctrl_d">Strg+D</string>
|
||||
<string name="second_key_clear">Leeren</string>
|
||||
<string name="game_sync_err_runtime">Installiere zuerst die Laufzeit</string>
|
||||
<string name="game_sync_err_steam_library">Steam-Bibliothek ist nicht verfügbar</string>
|
||||
<string name="game_sync_err_previous_sd">Vorherige SD-Bibliothek ist nicht verfügbar</string>
|
||||
@@ -3837,8 +3864,6 @@
|
||||
<string name="integration_shortcuts_hint">Alt+Tab, Win-Taste und Home-Taste bleiben in der Sitzung</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">In Android ausgegraut? App-Info → ⋮ → Eingeschränkte Einstellungen zulassen</string>
|
||||
<string name="integration_shortcuts_restricted">Von Android blockiert · App-Info → ⋮ → Eingeschränkte Einstellungen zulassen</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck-Systemtasten</string>
|
||||
<string name="integration_shortcuts_service_description">Hält Alt+Tab, die Win-Taste und die Home-Taste in einer aktiven DroidDeck-Sitzung statt bei Android.</string>
|
||||
<string name="integration_brightness_needed">Aktiviere Helligkeit unter Einrichtung → Steam-Integration</string>
|
||||
<string name="setup_gpu_bridge_off">Mali-Brücke: aus</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s kann die Mali-Brücke nicht nutzen (sie benötigt eine Mali-GPU ohne Systemtreiber-Route), daher hat dieser Schalter hier keine Wirkung.</string>
|
||||
@@ -3999,10 +4024,11 @@
|
||||
<string name="input_reset_positions">Positionen zurücksetzen</string>
|
||||
<string name="input_show_label">Beschriftung anzeigen</string>
|
||||
<string name="input_layout_import_failed">Dieses Layout konnte nicht importiert werden</string>
|
||||
<string name="epic_third_party_managed">Wird über %1$s installiert</string>
|
||||
|
||||
<string name="theme_white_red">Scharlachroter Schnee</string>
|
||||
<string name="theme_white_red_detail">Weiße Oberflächen mit roten Akzenten.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">Soundtracks</string>
|
||||
<string name="rail_music">Musik</string>
|
||||
<string name="soundtracks_options">Wiedergabeoptionen</string>
|
||||
|
||||
@@ -9,15 +9,35 @@
|
||||
<string name="steamvr_recovery_failed">Το DroidDeck δεν μπόρεσε να κάνει αυτόματη επανεκκίνηση. Κλείστε εντελώς την εφαρμογή και ανοίξτε την ξανά.</string>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>Η πρώτη εκτέλεση κάνει λήψη του Steam. Αυτό μπορεί να διαρκέσει μερικά λεπτά.</item>
|
||||
<item>Από προεπιλογή, η έξοδος από την εφαρμογή θέτει το Steam σε παύση· συνεχίζει από εκεί που είχε μείνει όταν επιστρέψετε.</item>
|
||||
<item>Το χειριστήριό σας εμφανίζεται ως χειριστήριο Xbox 360. Διαφορετικά, χρησιμοποιήστε τα χειριστήρια στην οθόνη.</item>
|
||||
<item>Η πρώτη εκτέλεση κατεβάζει το Steam. Μπορεί να διαρκέσει μερικά λεπτά.</item>
|
||||
<item>Το χειριστήριό σας εμφανίζεται στο Steam ως χειριστήριο Steam Deck. Αλλάξτε το σε Steam Controller, DualShock 4, DualSense ή Xbox 360 στις ρυθμίσεις συνεδρίας· εφαρμόζεται στην επόμενη συνεδρία.</item>
|
||||
<item>Κρατήστε πατημένο το Πίσω στο χειριστήριό σας για να ανοίξετε το μενού Quick Access του Steam. Η επιλογή «Παρατεταμένο Πίσω για συντομεύσεις Steam» πρέπει να είναι ενεργή στις ρυθμίσεις συνεδρίας.</item>
|
||||
<item>Η Συμπεριφορά παρασκηνίου καθορίζει τι γίνεται όταν φεύγετε από την εφαρμογή: το Εγγενής ετοιμάζει το Steam για αναστολή λειτουργίας, το Αυτόματο το θέτει σε παύση, το Μη αυτόματο περιμένει τη Συνέχιση, το Ποτέ το αφήνει να τρέχει.</item>
|
||||
<item>Τα παιχνίδια Steam χρησιμοποιούν το Frame Limit του Steam στο Quick Access. Η οθόνη αλλάζει σε ρυθμό ανανέωσης που διαιρείται ακριβώς με το όριο, όταν υπάρχει τέτοιος.</item>
|
||||
<item>Η Λειτουργία χαμηλής καθυστέρησης στο μενού συνεδρίας στέλνει την είσοδο του χειριστηρίου στα 1000 Hz αντί για 250 Hz, με λίγο μεγαλύτερη χρήση CPU και μπαταρίας.</item>
|
||||
<item>Κάθε παιχνίδι έχει το δικό του προφίλ με Proton, FEX, στοιχεία και ρυθμίσεις περιβάλλοντος.</item>
|
||||
<item>Το μενού συνεδρίας έχει διακόπτη μικροφώνου για φωνητική συνομιλία και κουμπί Αναστολή τώρα για να παγώνετε τη συνεδρία όποτε θέλετε.</item>
|
||||
<item>Σύρετε το HUD του DroidDeck για να το μετακινήσετε, τσιμπήστε για να αλλάξετε μέγεθος και σπρώξτε το προς μια άκρη για να καρφιτσωθεί ως μικρή καρτέλα FPS.</item>
|
||||
<item>Σε φορητές κονσόλες με δύο οθόνες, η κάτω οθόνη μπορεί να δείχνει λήψεις, ειδοποιήσεις, στιγμιότυπα οθόνης και τη συνομιλία του Steam. Η Εναλλαγή οθονών βάζει εκεί το παιχνίδι.</item>
|
||||
<item>Προσθέστε βιβλιοθήκες Steam από κάρτα SD, μονάδα USB ή SSD, και το DroidDeck κρατά τα παιχνίδια μαζί στη Βιβλιοθήκη σας.</item>
|
||||
<item>Τα Καταστήματα σάς επιτρέπουν να συνδεθείτε σε Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io και Game Jolt και μετά να εγκαθιστάτε και να ενημερώνετε τα παιχνίδια τους από το DroidDeck.</item>
|
||||
<item>Στοιχεία όπως τα FEX, DXVK και VKD3D-Proton ενημερώνονται μόνα τους, και το Proton Experimental ARM64 είναι το προεπιλεγμένο, ή το Proton 11.0 ARM64 μόλις εγκατασταθεί αυτή η έκδοση.</item>
|
||||
<item>Η επιλογή Συμπίεση του Steam όσο τρέχει παιχνίδι ελευθερώνει RAM σε συσκευές με λίγη μνήμη.</item>
|
||||
<item>Σύρετε προς τα μέσα από τη δεξιά άκρη για να ανοίξετε το μενού συνεδρίας: λειτουργία πινακίδας αφής, Πληκτρολόγιο PC, Λειτουργία χαμηλής καθυστέρησης, προφίλ παιχνιδιού και άλλα.</item>
|
||||
<item>Το παιχνίδι τρέχει αργά; Περιορίστε τον ρυθμό καρέ στο Quick Access και δοκιμάστε άλλη έκδοση Proton ή άλλη προεπιλογή FEX στα στοιχεία του παιχνιδιού.</item>
|
||||
<item>Κροταλίσματα ή απουσία ήχου στο παιχνίδι; Δοκιμάστε τον διακόπτη DirectAudio για παιχνίδια στις ρυθμίσεις του Steam, στην ενότητα Ήχος.</item>
|
||||
<item>Η Ρύθμιση και μετά η Αποθήκευση μπορεί να καθαρίσει τις κρυφές μνήμες shader και τα υπολειπόμενα prefix από παιχνίδια που αφαιρέσατε.</item>
|
||||
<item>Αντιμετωπίσατε σφάλμα; Η Κοινή χρήση αρχείων καταγραφής στο μενού συνεδρίας συγκεντρώνει διαγνωστικά. Αναρτήστε τα στο #bug-reports στο Discord.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>Η πρώτη εκτέλεση ρυθμίζει την επιφάνεια εργασίας. Αυτό μπορεί να διαρκέσει μερικά λεπτά.</item>
|
||||
<item>Από προεπιλογή, η έξοδος από την εφαρμογή θέτει τη συνεδρία σε παύση· συνεχίζει από εκεί που είχε μείνει όταν επιστρέψετε.</item>
|
||||
<item>Το άγγιγμα λειτουργεί ως πινακίδα αφής: σύρετε για να μετακινήσετε τον δείκτη, πατήστε για κλικ.</item>
|
||||
<item>Το χειριστήριό σας εμφανίζεται ως χειριστήριο Xbox 360. Διαφορετικά, χρησιμοποιήστε τα χειριστήρια στην οθόνη.</item>
|
||||
<item>Η πρώτη εκτέλεση ρυθμίζει την επιφάνεια εργασίας. Μπορεί να διαρκέσει μερικά λεπτά.</item>
|
||||
<item>Η αφή λειτουργεί ως πινακίδα αφής: σύρετε για να μετακινήσετε τον δείκτη, πατήστε για κλικ.</item>
|
||||
<item>Η Συμπεριφορά παρασκηνίου καθορίζει τι γίνεται όταν φεύγετε από την εφαρμογή: το Μη αυτόματο περιμένει από προεπιλογή τη Συνέχιση, το Αυτόματο θέτει σε παύση, το Ποτέ το αφήνει να τρέχει.</item>
|
||||
<item>Σύρετε προς τα μέσα από τη δεξιά άκρη για να ανοίξετε το μενού συνεδρίας και επιλέξτε Πληκτρολόγιο PC για να πληκτρολογείτε σε εφαρμογές που αγνοούν το πληκτρολόγιο του Android.</item>
|
||||
<item>Το Πληκτρολόγιο PC στο μενού συνεδρίας έχει ρυθμιζόμενο μέγεθος, αδιαφάνεια και ομάδες πλήκτρων.</item>
|
||||
<item>Το χειριστήριό σας εμφανίζεται ως χειριστήριο Xbox 360. Διαφορετικά, χρησιμοποιήστε τα χειριστήρια οθόνης.</item>
|
||||
<item>Το μενού συνεδρίας έχει διακόπτη μικροφώνου και κουμπί Αναστολή τώρα για να παγώνετε τη συνεδρία όποτε θέλετε.</item>
|
||||
<item>Αντιμετωπίσατε σφάλμα; Η Κοινή χρήση αρχείων καταγραφής στο μενού συνεδρίας συγκεντρώνει διαγνωστικά. Αναρτήστε τα στο #bug-reports στο Discord.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Συνεδρία</string>
|
||||
<string name="session_channel_description">Εμφανίζεται όσο μια συνεδρία Steam ή επιφάνειας εργασίας είναι ανοιχτή</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Πινακίδα αφής</string>
|
||||
<string name="mode_touch_direct">Απευθείας</string>
|
||||
<string name="mode_touch_note">Αυτόματο: πινακίδα αφής στην Επιφάνεια εργασίας, απευθείας στο Steam.</string>
|
||||
<string name="mode_pen">Γραφίδα</string>
|
||||
<string name="mode_pen_mouse">Ποντίκι</string>
|
||||
<string name="mode_pen_touch">Αφή</string>
|
||||
<string name="mode_pen_button">Πλαϊνό κουμπί</string>
|
||||
<string name="mode_osc">Χειριστήρια στην οθόνη</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Το Αυτόματο εμφανίζει τα χειριστήρια όταν δεν είναι συνδεδεμένο χειριστήριο.</string>
|
||||
@@ -604,6 +628,8 @@
|
||||
<string name="perf_cap_off">Ανενεργό</string>
|
||||
<string name="perf_cap_auto">Προεπιλογή προγράμματος οδήγησης</string>
|
||||
<string name="perf_zram_client">Συμπίεση του Steam όσο τρέχει παιχνίδι</string>
|
||||
<string name="perf_zram_idle">Συμπίεση ανενεργής μνήμης παιχνιδιού</string>
|
||||
<string name="perf_zram_idle_hint">Σελιδοποιεί την ανενεργή μνήμη του παιχνιδιού όταν η RAM είναι χαμηλή. Απενεργοποιήστε το αν τα παιχνίδια παγώνουν για λίγα δευτερόλεπτα περίπου κάθε μισό λεπτό. Ισχύει από την επόμενη έναρξη της συνεδρίας.</string>
|
||||
<string name="perf_zram_client_hint">20 s μετά την εκκίνηση ενός παιχνιδιού, ο πελάτης Steam συμπιέζεται στη zRAM για να μείνει περισσότερη μνήμη στο παιχνίδι, και διαβάζεται πίσω όταν το παιχνίδι κλείσει. Απενεργοποιήστε το αν η συνεδρία κλείνει λίγο μετά την εκκίνηση παιχνιδιών. Ένα όριο RAM παραπάνω εξακολουθεί να συμπιέζει το Steam όταν η συνεδρία το ξεπεράσει.</string>
|
||||
<string name="perf_ram_cap">Όριο RAM</string>
|
||||
<string name="perf_ram_cap_hint">Ισχύει όσο τρέχει ο πελάτης Steam, σε λειτουργία Steam ή από την επιφάνεια εργασίας. Όταν η συνεδρία χρησιμοποιεί περισσότερη, το Steam και έπειτα οι άλλες υποστηριζόμενες διεργασίες της συνεδρίας συμπιέζονται στη zRAM. Ήπιο όριο: τίποτα δεν κλείνει, αλλά τα παιχνίδια μπορεί να κολλάνε όσο επιστρέφουν οι σελίδες.</string>
|
||||
@@ -614,7 +640,7 @@
|
||||
<string name="perf_gpuclock_hint">Μόνο Adreno. Λιγότερα κολλήματα, μεγαλύτερη χρήση μπαταρίας και θερμότητα.</string>
|
||||
<string name="perf_fixes">Διορθώσεις συνεδρίας</string>
|
||||
<string name="perf_sysmem">Turnip: απόδοση sysmem</string>
|
||||
<string name="perf_sysmem_hint">Ταχύτερο για το πρόγραμμα-πελάτη Steam· στα παιχνίδια ο οδηγός επιλέγει σε κάθε πέρασμα απόδοση με πλακίδια ή στη μνήμη συστήματος. Απαιτείται σε Adreno 710/720/722.</string>
|
||||
<string name="perf_sysmem_hint">Ισχύει για το πρόγραμμα-πελάτη Steam και τα παιχνίδια. Απαιτείται σε Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Παράβλεψη του βοηθού xalia του Steam</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">Ένα υποκατάστατο σε επίπεδο χρήστη για το πρόγραμμα οδήγησης ntsync του Linux. Όσο είναι ενεργό, το Proton το χρησιμοποιεί αντί για το droiddeck-esync και το droiddeck-fsync. Λειτουργεί με Proton Experimental ARM64, GE-Proton και proton-cachyos. Εφαρμόζεται στην επόμενη συνεδρία.</string>
|
||||
@@ -1834,6 +1860,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">Καθαρισμός</string>
|
||||
<string name="game_sync_err_runtime">Εγκαταστήστε πρώτα το runtime</string>
|
||||
<string name="game_sync_err_steam_library">Η βιβλιοθήκη Steam δεν είναι διαθέσιμη</string>
|
||||
<string name="game_sync_err_previous_sd">Η προηγούμενη βιβλιοθήκη SD δεν είναι διαθέσιμη</string>
|
||||
@@ -3837,8 +3864,6 @@
|
||||
<string name="integration_shortcuts_hint">Τα Alt+Tab, Win και Αρχική μένουν στη συνεδρία</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">Γκρίζο στο Android; Πληροφορίες εφαρμογής → ⋮ → Να επιτρέπονται οι περιορισμένες ρυθμίσεις</string>
|
||||
<string name="integration_shortcuts_restricted">Αποκλείεται από το Android · Πληροφορίες εφαρμογής → ⋮ → Να επιτρέπονται οι περιορισμένες ρυθμίσεις</string>
|
||||
<string name="integration_shortcuts_service">Πλήκτρα συστήματος DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Διατηρεί τα Alt+Tab, το πλήκτρο Win και το κουμπί Αρχικής στην ενεργή συνεδρία DroidDeck αντί για το Android.</string>
|
||||
<string name="integration_brightness_needed">Ενεργοποιήστε τη Φωτεινότητα στη Ρύθμιση → Ενσωμάτωση Steam</string>
|
||||
<string name="setup_gpu_bridge_off">Γέφυρα Mali: ανενεργή</string>
|
||||
<string name="setup_gpu_bridge_unusable">Το %1$s δεν μπορεί να χρησιμοποιήσει τη γέφυρα Mali (χρειάζεται GPU Mali χωρίς διαδρομή οδηγού συστήματος), επομένως αυτός ο διακόπτης δεν έχει καμία επίδραση εδώ.</string>
|
||||
@@ -3999,10 +4024,11 @@
|
||||
<string name="input_reset_positions">Επαναφορά θέσεων</string>
|
||||
<string name="input_show_label">Εμφάνιση ετικέτας</string>
|
||||
<string name="input_layout_import_failed">Δεν ήταν δυνατή η εισαγωγή αυτής της διάταξης</string>
|
||||
<string name="epic_third_party_managed">Εγκαθίσταται μέσω %1$s</string>
|
||||
|
||||
<string name="theme_white_red">Κατακόκκινο χιόνι</string>
|
||||
<string name="theme_white_red_detail">Λευκές επιφάνειες με κόκκινες λεπτομέρειες.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">Soundtrack</string>
|
||||
<string name="rail_music">Μουσική</string>
|
||||
<string name="soundtracks_options">Επιλογές αναπαραγωγής</string>
|
||||
|
||||
@@ -9,15 +9,35 @@
|
||||
<string name="steamvr_recovery_failed">DroidDeck no pudo reiniciarse automáticamente. Cierra la app por completo y vuelve a abrirla.</string>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>La primera vez se descarga Steam. Puede tardar unos minutos.</item>
|
||||
<item>De forma predeterminada, al salir de la app Steam se pausa y continúa donde lo dejaste cuando vuelves.</item>
|
||||
<item>Tu mando aparece como un mando Xbox 360. Si no, usa los controles en pantalla.</item>
|
||||
<item>La primera ejecución descarga Steam. Puede tardar unos minutos.</item>
|
||||
<item>Tu control aparece en Steam como un control de Steam Deck. Cámbialo a Steam Controller, DualShock 4, DualSense o Xbox 360 en los ajustes de la sesión; se aplica en la próxima sesión.</item>
|
||||
<item>Mantén Atrás en tu control para abrir el menú Quick Access de Steam. «Mantener Atrás para atajos de Steam» debe estar activado en los ajustes de la sesión.</item>
|
||||
<item>Comportamiento en segundo plano decide qué pasa al salir de la app: Nativo prepara Steam para suspenderse, Auto lo pausa, Manual espera a Reanudar y Nunca lo mantiene en ejecución.</item>
|
||||
<item>Los juegos de Steam usan el Límite de fotogramas de Steam en Quick Access. La pantalla cambia a una frecuencia de actualización que el límite divida exactamente, si existe.</item>
|
||||
<item>El Modo de baja latencia del menú de sesión envía la entrada del control a 1000 Hz en lugar de 250 Hz, a cambio de un poco más de CPU y batería.</item>
|
||||
<item>Cada juego tiene su propio perfil con Proton, FEX, componentes y ajustes de entorno.</item>
|
||||
<item>El menú de sesión tiene un interruptor de micrófono para el chat de voz y un botón Suspender ahora para congelar la sesión cuando quieras.</item>
|
||||
<item>Arrastra el HUD de DroidDeck para moverlo, pellizca para cambiar su tamaño y empújalo contra un borde para acoplarlo como una pequeña pestaña de FPS.</item>
|
||||
<item>En consolas portátiles de doble pantalla, la pantalla inferior puede mostrar descargas, notificaciones, capturas de pantalla y el chat de Steam. Intercambiar pantallas pone el juego allí.</item>
|
||||
<item>Añade bibliotecas de Steam desde una tarjeta SD, una unidad USB o un SSD, y DroidDeck mantiene los juegos juntos en tu Biblioteca.</item>
|
||||
<item>Tiendas te permite iniciar sesión en Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io y Game Jolt, y luego instalar y actualizar sus juegos desde DroidDeck.</item>
|
||||
<item>Componentes como FEX, DXVK y VKD3D-Proton se actualizan solos, y Proton Experimental ARM64 es el predeterminado, o Proton 11.0 ARM64 una vez instalada esa versión.</item>
|
||||
<item>Comprimir Steam mientras se ejecuta un juego libera RAM en dispositivos con poca memoria.</item>
|
||||
<item>Desliza desde el borde derecho para abrir el menú de sesión: modo touchpad, Teclado de PC, Modo de baja latencia, perfil del juego y más.</item>
|
||||
<item>¿El juego va lento? Limita la tasa de fotogramas en Quick Access y prueba otra versión de Proton o un ajuste preestablecido de FEX en los componentes del juego.</item>
|
||||
<item>¿Audio del juego entrecortado o ausente? Prueba el interruptor DirectAudio para juegos en los ajustes de Steam, en Audio.</item>
|
||||
<item>Configuración, y luego Almacenamiento, puede borrar cachés de shaders y prefijos sobrantes de juegos que quitaste.</item>
|
||||
<item>¿Encontraste un error? Compartir registros en el menú de sesión reúne los datos de diagnóstico. Publícalos en #bug-reports en Discord.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>La primera vez se prepara el escritorio. Puede tardar unos minutos.</item>
|
||||
<item>De forma predeterminada, al salir de la app la sesión se pausa y continúa donde la dejaste cuando vuelves.</item>
|
||||
<item>La primera ejecución configura el escritorio. Puede tardar unos minutos.</item>
|
||||
<item>El tacto funciona como un touchpad: arrastra para mover el puntero y toca para hacer clic.</item>
|
||||
<item>Tu mando aparece como un mando Xbox 360. Si no, usa los controles en pantalla.</item>
|
||||
<item>Comportamiento en segundo plano decide qué pasa al salir de la app: Manual espera a Reanudar de forma predeterminada, Auto pausa y Nunca lo mantiene en ejecución.</item>
|
||||
<item>Desliza desde el borde derecho para abrir el menú de sesión y elige Teclado de PC para escribir en apps que ignoran el teclado de Android.</item>
|
||||
<item>El Teclado de PC del menú de sesión tiene tamaño, opacidad y grupos de teclas ajustables.</item>
|
||||
<item>Tu control aparece como un control Xbox 360. Si no, usa los controles en pantalla.</item>
|
||||
<item>El menú de sesión tiene un interruptor de micrófono y un botón Suspender ahora para congelar la sesión cuando quieras.</item>
|
||||
<item>¿Encontraste un error? Compartir registros en el menú de sesión reúne los datos de diagnóstico. Publícalos en #bug-reports en Discord.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Sesión</string>
|
||||
<string name="session_channel_description">Se muestra mientras hay una sesión de Steam o de escritorio abierta</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Touchpad</string>
|
||||
<string name="mode_touch_direct">Directo</string>
|
||||
<string name="mode_touch_note">Auto: touchpad en Escritorio, directo en Steam.</string>
|
||||
<string name="mode_pen">Lápiz</string>
|
||||
<string name="mode_pen_mouse">Ratón</string>
|
||||
<string name="mode_pen_touch">Táctil</string>
|
||||
<string name="mode_pen_button">Botón lateral</string>
|
||||
<string name="mode_osc">Controles en pantalla</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Auto muestra los controles cuando no hay ningún mando conectado.</string>
|
||||
@@ -606,6 +630,8 @@
|
||||
<string name="perf_cap_off">Desactivado</string>
|
||||
<string name="perf_cap_auto">Predeterminado del controlador</string>
|
||||
<string name="perf_zram_client">Comprimir Steam mientras se ejecuta un juego</string>
|
||||
<string name="perf_zram_idle">Comprimir memoria inactiva del juego</string>
|
||||
<string name="perf_zram_idle_hint">Comprime la memoria inactiva del juego cuando queda poca RAM. Desactívalo si los juegos se congelan unos segundos cada medio minuto aproximadamente. Se aplica la próxima vez que se inicie la sesión.</string>
|
||||
<string name="perf_zram_client_hint">20 s después de que empiece un juego, el cliente de Steam se comprime en zRAM para dejarle más memoria al juego, y se vuelve a leer cuando el juego se cierra. Desactívalo si la sesión se cierra poco después de iniciar los juegos. Un límite de RAM definido arriba sigue comprimiendo Steam cuando la sesión lo supera.</string>
|
||||
<string name="perf_ram_cap">Límite de RAM</string>
|
||||
<string name="perf_ram_cap_hint">Se aplica mientras se ejecuta el cliente de Steam, en modo Steam o desde el escritorio. Cuando la sesión usa más de esto, Steam y luego los demás procesos compatibles de la sesión se comprimen en zRAM. Es un límite flexible: no se cierra nada, pero los juegos pueden tener tirones mientras se recuperan las páginas.</string>
|
||||
@@ -616,7 +642,7 @@
|
||||
<string name="perf_gpuclock_hint">Solo Adreno. Menos tirones, más consumo de batería y calor.</string>
|
||||
<string name="perf_fixes">Correcciones de sesión</string>
|
||||
<string name="perf_sysmem">Turnip: renderizado sysmem</string>
|
||||
<string name="perf_sysmem_hint">Más rápido para el cliente de Steam; en los juegos, el controlador elige entre renderizado por mosaicos o en memoria del sistema en cada pasada. Obligatorio en Adreno 710/720/722.</string>
|
||||
<string name="perf_sysmem_hint">Se aplica al cliente de Steam y a los juegos. Obligatorio en Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Omitir el asistente xalia de Steam</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">Un sustituto en espacio de usuario del controlador ntsync de Linux. Mientras está activado, Proton lo usa en lugar de droiddeck-esync y droiddeck-fsync. Funciona con Proton Experimental ARM64, GE-Proton y proton-cachyos. Se aplica en la próxima sesión.</string>
|
||||
@@ -1853,6 +1879,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">Borrar</string>
|
||||
<string name="game_sync_err_runtime">Instala primero el runtime</string>
|
||||
<string name="game_sync_err_steam_library">La biblioteca de Steam no está disponible</string>
|
||||
<string name="game_sync_err_previous_sd">La biblioteca anterior de la SD no está disponible</string>
|
||||
@@ -3876,8 +3903,6 @@
|
||||
<string name="integration_shortcuts_hint">Alt+Tab, la tecla Win y el botón Inicio se quedan en la sesión</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">¿Aparece en gris en Android? Información de la aplicación → ⋮ → Permitir ajustes restringidos</string>
|
||||
<string name="integration_shortcuts_restricted">Bloqueado por Android · Información de la aplicación → ⋮ → Permitir ajustes restringidos</string>
|
||||
<string name="integration_shortcuts_service">Teclas del sistema de DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Mantiene Alt+Tab, la tecla Win y el botón Inicio en una sesión activa de DroidDeck en lugar de Android.</string>
|
||||
<string name="integration_brightness_needed">Activa Brillo en Configuración → Integración con Steam</string>
|
||||
<string name="setup_gpu_bridge_off">Puente Mali: desactivado</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s no puede usar el puente Mali (necesita una GPU Mali sin ruta de controlador del sistema), así que este interruptor no tiene efecto aquí.</string>
|
||||
@@ -4039,10 +4064,11 @@
|
||||
<string name="input_reset_positions">Restablecer posiciones</string>
|
||||
<string name="input_show_label">Mostrar etiqueta</string>
|
||||
<string name="input_layout_import_failed">No se ha podido importar esta disposición</string>
|
||||
<string name="epic_third_party_managed">Se instala mediante %1$s</string>
|
||||
|
||||
<string name="theme_white_red">Nieve escarlata</string>
|
||||
<string name="theme_white_red_detail">Superficies blancas con acentos rojos.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">Bandas sonoras</string>
|
||||
<string name="rail_music">Música</string>
|
||||
<string name="soundtracks_options">Opciones de reproducción</string>
|
||||
|
||||
@@ -10,14 +10,34 @@
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>Ensimmäinen käynnistys lataa Steamin. Tämä voi kestää muutaman minuutin.</item>
|
||||
<item>Oletuksena sovelluksesta poistuminen keskeyttää Steamin; se jatkuu siitä mihin jäit, kun palaat takaisin.</item>
|
||||
<item>Ohjaimesi näkyy Xbox 360 -ohjaimena. Muussa tapauksessa käytä näytön ohjaimia.</item>
|
||||
<item>Ohjaimesi näkyy Steamille Steam Deck -ohjaimena. Vaihda se Steam Controller-, DualShock 4-, DualSense- tai Xbox 360 -ohjaimeksi istunnon asetuksissa; muutos tulee voimaan seuraavassa istunnossa.</item>
|
||||
<item>Pidä ohjaimen Takaisin-painiketta pohjassa avataksesi Steamin Pikavalikon. Asetuksen Pidä Takaisin pohjassa Steam-pikanäppäimille on oltava päällä istunnon asetuksissa.</item>
|
||||
<item>Taustatoiminta määrää, mitä tapahtuu, kun poistut sovelluksesta: Natiivi valmistelee Steamin lepotilaan, Automaattinen keskeyttää sen, Manuaalinen odottaa Jatka-painiketta, Ei koskaan pitää sen käynnissä.</item>
|
||||
<item>Steam-pelit käyttävät Steamin Kuvanopeusrajaa Pikavalikossa. Näyttö vaihtaa virkistystaajuuteen, jolla raja jakautuu tasan, jos sellainen on.</item>
|
||||
<item>Matalan viiveen tila istuntovalikossa lähettää ohjaimen syötteen 1000 Hz:n taajuudella 250 Hz:n sijaan, hieman suuremmalla suoritin- ja akunkulutuksella.</item>
|
||||
<item>Jokaisella pelillä on oma profiilinsa, jossa on Proton-, FEX-, komponentti- ja ympäristöasetukset.</item>
|
||||
<item>Istuntovalikossa on mikrofonin kytkin puhekeskustelua varten ja Keskeytä nyt -painike istunnon jäädyttämiseen tarvittaessa.</item>
|
||||
<item>Siirrä DroidDeckin HUD vetämällä, muuta sen kokoa nipistämällä ja telakoi se pieneksi FPS-välilehdeksi työntämällä se reunan yli.</item>
|
||||
<item>Kaksinäyttöisissä käsikonsoleissa alanäyttö voi näyttää lataukset, ilmoitukset, kuvakaappaukset ja Steam-chatin. Vaihda näytöt siirtää pelin sinne.</item>
|
||||
<item>Lisää Steam-kirjastoja SD-kortilta, USB-asemalta tai SSD-levyltä, ja DroidDeck pitää pelit yhdessä Kirjastossasi.</item>
|
||||
<item>Kaupat-osiossa voit kirjautua sisään palveluihin Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io ja Game Jolt sekä asentaa ja päivittää niiden pelejä DroidDeckistä.</item>
|
||||
<item>Komponentit, kuten FEX, DXVK ja VKD3D-Proton, päivittyvät itsestään, ja oletuksena on Proton Experimental ARM64 tai Proton 11.0 ARM64, kun kyseinen versio on asennettu.</item>
|
||||
<item>Pakkaa Steam pelin ollessa käynnissä vapauttaa RAM-muistia laitteilla, joilla muisti on vähissä.</item>
|
||||
<item>Pyyhkäise oikeasta reunasta sisäänpäin avataksesi istuntovalikon: kosketuslevytila, PC-näppäimistö, matalan viiveen tila, pelin profiili ja muuta.</item>
|
||||
<item>Peli pyörii hitaasti? Rajoita kuvanopeutta Pikavalikossa ja kokeile sitten toista Proton-versiota tai FEX-esiasetusta pelin komponenteissa.</item>
|
||||
<item>Rätisevä tai puuttuva pelin ääni? Kokeile Steamin asetuksissa kohdassa Ääni asetusta DirectAudio peleille.</item>
|
||||
<item>Asetukset ja sen alla Tallennustila voi tyhjentää shader-välimuistit ja poistettujen pelien jäljelle jääneet prefixit.</item>
|
||||
<item>Osuitko virheeseen? Jaa lokit istuntovalikossa kokoaa diagnostiikkatiedot. Julkaise ne kanavalla #bug-reports Discordissa.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>Ensimmäinen käynnistys määrittää työpöydän. Tämä voi kestää muutaman minuutin.</item>
|
||||
<item>Oletuksena sovelluksesta poistuminen keskeyttää istunnon; se jatkuu siitä mihin jäit, kun palaat takaisin.</item>
|
||||
<item>Kosketus toimii kosketuslevynä: vedä liikuttaaksesi osoitinta, napauta napsauttaaksesi.</item>
|
||||
<item>Ohjaimesi näkyy Xbox 360 -ohjaimena. Muussa tapauksessa käytä näytön ohjaimia.</item>
|
||||
<item>Ensimmäinen käynnistys valmistelee työpöydän. Tämä voi kestää muutaman minuutin.</item>
|
||||
<item>Kosketus toimii kosketuslevynä: siirrä osoitinta vetämällä, napsauta napauttamalla.</item>
|
||||
<item>Taustatoiminta määrää, mitä tapahtuu, kun poistut sovelluksesta: Manuaalinen odottaa oletuksena Jatka-painiketta, Automaattinen keskeyttää, Ei koskaan pitää käynnissä.</item>
|
||||
<item>Pyyhkäise oikeasta reunasta sisäänpäin avataksesi istuntovalikon ja valitse PC-näppäimistö kirjoittaaksesi sovelluksissa, jotka ohittavat Androidin näppäimistön.</item>
|
||||
<item>Istuntovalikon PC-näppäimistön koko, peittävyys ja näppäinryhmät ovat säädettävissä.</item>
|
||||
<item>Ohjaimesi näkyy Xbox 360 -ohjaimena. Muuten käytä näytön ohjaimia.</item>
|
||||
<item>Istuntovalikossa on mikrofonin kytkin ja Keskeytä nyt -painike istunnon jäädyttämiseen tarvittaessa.</item>
|
||||
<item>Osuitko virheeseen? Jaa lokit istuntovalikossa kokoaa diagnostiikkatiedot. Julkaise ne kanavalla #bug-reports Discordissa.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Istunto</string>
|
||||
<string name="session_channel_description">Näkyy, kun Steam- tai työpöytäistunto on käynnissä</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Kosketuslevy</string>
|
||||
<string name="mode_touch_direct">Suora</string>
|
||||
<string name="mode_touch_note">Automaattinen: kosketuslevy Työpöydällä, suora Steamissa.</string>
|
||||
<string name="mode_pen">Kynä</string>
|
||||
<string name="mode_pen_mouse">Hiiri</string>
|
||||
<string name="mode_pen_touch">Kosketus</string>
|
||||
<string name="mode_pen_button">Sivupainike</string>
|
||||
<string name="mode_osc">Näytön ohjaimet</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Automaattinen näyttää ohjaimet, kun yhtään ohjainta ei ole kytketty.</string>
|
||||
@@ -604,6 +628,8 @@
|
||||
<string name="perf_cap_off">Pois</string>
|
||||
<string name="perf_cap_auto">Ajurin oletus</string>
|
||||
<string name="perf_zram_client">Pakkaa Steam pelin ollessa käynnissä</string>
|
||||
<string name="perf_zram_idle">Pakkaa pelin käyttämätöntä muistia</string>
|
||||
<string name="perf_zram_idle_hint">Siirtää pelin käyttämätöntä muistia zRAMiin, kun RAM-muisti vähenee. Poista tämä käytöstä, jos pelit jäätyvät muutamaksi sekunniksi noin puolen minuutin välein. Tulee voimaan, kun istunto käynnistyy seuraavan kerran.</string>
|
||||
<string name="perf_zram_client_hint">20 s pelin käynnistymisen jälkeen Steam-asiakasohjelma pakataan zRAMiin, jotta pelille jää enemmän muistia, ja luetaan takaisin, kun peli sulkeutuu. Poista tämä käytöstä, jos istunto sulkeutuu pian pelien käynnistymisen jälkeen. Yllä oleva RAM-raja pakkaa silti Steamin, kun istunto ylittää sen.</string>
|
||||
<string name="perf_ram_cap">RAM-raja</string>
|
||||
<string name="perf_ram_cap_hint">Koskee aikaa, jolloin Steam-asiakasohjelma on käynnissä, Steam-tilassa tai työpöydältä. Kun istunto käyttää tätä enemmän, Steam ja sen jälkeen istunnon muut tuetut prosessit pakataan zRAMiin. Pehmeä raja: mitään ei suljeta, mutta pelit voivat nykiä, kun sivuja luetaan takaisin.</string>
|
||||
@@ -614,7 +640,7 @@
|
||||
<string name="perf_gpuclock_hint">Vain Adreno. Vähemmän nykäyksiä, enemmän akun kulutusta ja lämpöä.</string>
|
||||
<string name="perf_fixes">Istunnon korjaukset</string>
|
||||
<string name="perf_sysmem">Turnip: sysmem-renderöinti</string>
|
||||
<string name="perf_sysmem_hint">Nopeampi Steam-asiakasohjelmalle; peleissä ajuri valitsee jokaiselle vaiheelle ruuduittaisen tai järjestelmämuistiin tehtävän renderöinnin. Pakollinen Adreno 710/720/722:lla.</string>
|
||||
<string name="perf_sysmem_hint">Koskee Steam-asiakasohjelmaa ja pelejä. Pakollinen Adreno 710/720/722:lla.</string>
|
||||
<string name="perf_xalia">Ohita Steamin xalia-avustaja</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">Käyttäjätilainen korvike Linuxin ntsync-ajurille. Kun se on päällä, Proton käyttää sitä droiddeck-esyncin ja droiddeck-fsyncin sijaan. Toimii Proton Experimental ARM64:n, GE-Protonin ja proton-cachyosin kanssa. Tulee voimaan seuraavassa istunnossa.</string>
|
||||
@@ -1834,6 +1860,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">Tyhjennä</string>
|
||||
<string name="game_sync_err_runtime">Asenna ajoympäristö ensin</string>
|
||||
<string name="game_sync_err_steam_library">Steam-kirjasto ei ole käytettävissä</string>
|
||||
<string name="game_sync_err_previous_sd">Aiempi SD-kirjasto ei ole käytettävissä</string>
|
||||
@@ -3837,8 +3864,6 @@
|
||||
<string name="integration_shortcuts_hint">Alt+Tab, Win-näppäin ja Koti-painike pysyvät istunnossa</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">Harmaana Androidissa? Sovelluksen tiedot → ⋮ → Salli rajoitetut asetukset</string>
|
||||
<string name="integration_shortcuts_restricted">Androidin estämä · Sovelluksen tiedot → ⋮ → Salli rajoitetut asetukset</string>
|
||||
<string name="integration_shortcuts_service">DroidDeckin järjestelmänäppäimet</string>
|
||||
<string name="integration_shortcuts_service_description">Pitää Alt+Tabin, Win-näppäimen ja Koti-painikkeen aktiivisessa DroidDeck-istunnossa Androidin sijaan.</string>
|
||||
<string name="integration_brightness_needed">Ota Kirkkaus käyttöön kohdassa Käyttöönotto → Steam-integraatio</string>
|
||||
<string name="setup_gpu_bridge_off">Mali-silta: pois</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s ei voi käyttää Mali-siltaa (se vaatii Mali-GPU:n, jolla ei ole järjestelmäajurireittiä), joten tällä kytkimellä ei ole vaikutusta tässä.</string>
|
||||
@@ -3999,10 +4024,11 @@
|
||||
<string name="input_reset_positions">Palauta sijainnit</string>
|
||||
<string name="input_show_label">Näytä nimi</string>
|
||||
<string name="input_layout_import_failed">Tätä asettelua ei voitu tuoda</string>
|
||||
<string name="epic_third_party_managed">Asennetaan sovelluksen %1$s kautta</string>
|
||||
|
||||
<string name="theme_white_red">Helakanpunainen lumi</string>
|
||||
<string name="theme_white_red_detail">Valkoiset pinnat punaisin korostuksin.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">Soundtrackit</string>
|
||||
<string name="rail_music">Musiikki</string>
|
||||
<string name="soundtracks_options">Toistoasetukset</string>
|
||||
|
||||
@@ -10,14 +10,34 @@
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>Le premier lancement télécharge Steam. Cela peut prendre quelques minutes.</item>
|
||||
<item>Par défaut, quitter l\'application met Steam en pause ; y revenir reprend là où vous vous étiez arrêté.</item>
|
||||
<item>Votre manette apparaîtra comme une manette Xbox 360. Sinon, utilisez les commandes à l\'écran.</item>
|
||||
<item>Votre manette apparaît dans Steam comme une manette Steam Deck. Passez à une manette Steam Controller, DualShock 4, DualSense ou Xbox 360 dans les paramètres de session ; le changement s\'applique à la session suivante.</item>
|
||||
<item>Maintenez Retour sur votre manette pour ouvrir le menu Accès rapide de Steam. L\'option Maintenir Retour pour les raccourcis Steam doit être activée dans les paramètres de session.</item>
|
||||
<item>Comportement en arrière-plan détermine ce qui se passe quand vous quittez l\'application : Natif prépare Steam à la mise en veille, Auto le met en pause, Manuel attend Reprendre, Jamais le laisse tourner.</item>
|
||||
<item>Les jeux Steam utilisent la Limite d\'images de Steam dans Accès rapide. L\'écran passe à une fréquence de rafraîchissement que la limite divise exactement, s\'il en existe une.</item>
|
||||
<item>Le Mode faible latence du menu de session envoie les commandes de la manette à 1000 Hz au lieu de 250 Hz, pour un peu plus de CPU et de batterie.</item>
|
||||
<item>Chaque jeu a son propre profil avec Proton, FEX, composants et paramètres d\'environnement.</item>
|
||||
<item>Le menu de session propose un bouton micro pour le chat vocal et un bouton Mettre en pause maintenant pour figer la session à la demande.</item>
|
||||
<item>Faites glisser le HUD DroidDeck pour le déplacer, pincez pour le redimensionner, et poussez-le hors d\'un bord pour l\'ancrer en petit onglet FPS.</item>
|
||||
<item>Sur les consoles portables à double écran, l\'écran du bas peut afficher les téléchargements, les notifications, les captures d\'écran et le chat Steam. Inverser les écrans y place le jeu à la place.</item>
|
||||
<item>Ajoutez des bibliothèques Steam depuis une carte SD, une clé USB ou un SSD, et DroidDeck réunit les jeux dans votre Bibliothèque.</item>
|
||||
<item>Boutiques vous permet de vous connecter à Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io et Game Jolt, puis d\'installer et de mettre à jour leurs jeux depuis DroidDeck.</item>
|
||||
<item>Les composants comme FEX, DXVK et VKD3D-Proton se mettent à jour seuls, et Proton Experimental ARM64 est la valeur par défaut, ou Proton 11.0 ARM64 une fois cette version installée.</item>
|
||||
<item>Compresser Steam pendant un jeu libère de la RAM sur les appareils qui en manquent.</item>
|
||||
<item>Balayez depuis le bord droit pour ouvrir le menu de session : mode pavé tactile, Clavier PC, Mode faible latence, Profil du jeu et plus encore.</item>
|
||||
<item>Jeu lent ? Limitez la fréquence d\'images dans Accès rapide, puis essayez une autre version de Proton ou un autre préréglage FEX dans les composants du jeu.</item>
|
||||
<item>Audio du jeu qui grésille ou absent ? Essayez l\'option Utiliser DirectAudio pour le jeu dans les paramètres Steam, sous Audio.</item>
|
||||
<item>Configuration, puis Stockage, peut effacer les caches de shaders et les préfixes restants des jeux supprimés.</item>
|
||||
<item>Un bug ? Partager les journaux dans le menu de session regroupe les diagnostics. Publiez-les dans #bug-reports sur Discord.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>Le premier lancement configure le bureau. Cela peut prendre quelques minutes.</item>
|
||||
<item>Par défaut, quitter l\'application met la session en pause ; y revenir reprend là où vous vous étiez arrêté.</item>
|
||||
<item>Le tactile fonctionne comme un pavé tactile : faites glisser pour déplacer le pointeur, tapotez pour cliquer.</item>
|
||||
<item>Votre manette apparaîtra comme une manette Xbox 360. Sinon, utilisez les commandes à l\'écran.</item>
|
||||
<item>Le tactile fonctionne comme un pavé tactile : faites glisser pour déplacer le pointeur, touchez pour cliquer.</item>
|
||||
<item>Comportement en arrière-plan détermine ce qui se passe quand vous quittez l\'application : Manuel attend Reprendre par défaut, Auto met en pause, Jamais laisse tourner.</item>
|
||||
<item>Balayez depuis le bord droit pour ouvrir le menu de session, puis choisissez Clavier PC pour saisir du texte dans les applis qui ignorent le clavier Android.</item>
|
||||
<item>Le Clavier PC du menu de session a une taille, une opacité et des groupes de touches réglables.</item>
|
||||
<item>Votre manette apparaît comme une manette Xbox 360. Sinon, utilisez les commandes à l\'écran.</item>
|
||||
<item>Le menu de session propose un bouton micro et un bouton Mettre en pause maintenant pour figer la session à la demande.</item>
|
||||
<item>Un bug ? Partager les journaux dans le menu de session regroupe les diagnostics. Publiez-les dans #bug-reports sur Discord.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Session</string>
|
||||
<string name="session_channel_description">Affiché lorsqu\'une session Steam ou Bureau est ouverte</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Pavé tactile</string>
|
||||
<string name="mode_touch_direct">Direct</string>
|
||||
<string name="mode_touch_note">Auto : pavé tactile pour le bureau, tactile direct pour Steam.</string>
|
||||
<string name="mode_pen">Stylet</string>
|
||||
<string name="mode_pen_mouse">Souris</string>
|
||||
<string name="mode_pen_touch">Tactile</string>
|
||||
<string name="mode_pen_button">Bouton latéral</string>
|
||||
<string name="mode_osc">Commandes à l\'écran</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Le mode automatique affiche les commandes à l\'écran lorsqu\'aucune manette n\'est connectée.</string>
|
||||
@@ -606,6 +630,8 @@
|
||||
<string name="perf_cap_off">Désactivé</string>
|
||||
<string name="perf_cap_auto">Valeur par défaut du pilote</string>
|
||||
<string name="perf_zram_client">Compresser Steam pendant un jeu</string>
|
||||
<string name="perf_zram_idle">Compresser la mémoire inactive du jeu</string>
|
||||
<string name="perf_zram_idle_hint">Compresse la mémoire inactive du jeu quand la RAM manque. Désactivez-le si les jeux se figent quelques secondes environ toutes les trente secondes. S\'applique au prochain démarrage de la session.</string>
|
||||
<string name="perf_zram_client_hint">20 s après le démarrage d\'un jeu, le client Steam est compressé dans zRAM pour laisser plus de mémoire au jeu, puis relu à la fermeture du jeu. Désactivez cette option si la session se ferme peu après le démarrage des jeux. Une limite de RAM ci-dessus compresse toujours Steam lorsque la session la dépasse.</string>
|
||||
<string name="perf_ram_cap">Limite de RAM</string>
|
||||
<string name="perf_ram_cap_hint">S\'applique tant que le client Steam fonctionne, en mode Steam ou depuis le bureau. Lorsque la session dépasse cette valeur, Steam puis les autres processus pris en charge de la session sont compressés dans zRAM. Limite souple : rien n\'est fermé, mais les jeux peuvent saccader pendant le rechargement des pages.</string>
|
||||
@@ -616,7 +642,7 @@
|
||||
<string name="perf_gpuclock_hint">Uniquement pour Adreno. Moins de saccades, mais plus de consommation d\'énergie et de chaleur.</string>
|
||||
<string name="perf_fixes">Correctifs de session</string>
|
||||
<string name="perf_sysmem">Turnip : rendu sysmem</string>
|
||||
<string name="perf_sysmem_hint">Le client Steam sera plus rapide ; en jeu, le pilote choisit à chaque passe entre rendu par tuiles et rendu en mémoire système. Requis pour Adreno 710/720/722.</string>
|
||||
<string name="perf_sysmem_hint">S’applique au client Steam et aux jeux. Requis sur Adreno 710/720/722.</string>
|
||||
<string name="perf_xalia">Ignorer l\'assistant xalia de Steam</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">Un substitut en espace utilisateur du pilote Linux ntsync. Lorsqu\'il est activé, Proton l\'utilise à la place de droiddeck-esync et de droiddeck-fsync. Fonctionne avec Proton Experimental ARM64, GE-Proton et proton-cachyos. Prendra effet à la prochaine session.</string>
|
||||
@@ -1852,6 +1878,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">Effacer</string>
|
||||
<string name="game_sync_err_runtime">Installez d\'abord l\'environnement d\'exécution</string>
|
||||
<string name="game_sync_err_steam_library">La bibliothèque Steam n\'est pas disponible</string>
|
||||
<string name="game_sync_err_previous_sd">L\'ancienne bibliothèque SD n\'est pas disponible</string>
|
||||
@@ -3875,8 +3902,6 @@
|
||||
<string name="integration_shortcuts_hint">Alt+Tab, la touche Win et le bouton Accueil restent dans la session</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">Grisé dans Android ? Infos sur l\'appli → ⋮ → Autoriser les paramètres restreints</string>
|
||||
<string name="integration_shortcuts_restricted">Bloqué par Android · Infos sur l\'appli → ⋮ → Autoriser les paramètres restreints</string>
|
||||
<string name="integration_shortcuts_service">Touches système DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Garde Alt+Tab, la touche Win et le bouton Accueil dans une session DroidDeck active plutôt que dans Android.</string>
|
||||
<string name="integration_brightness_needed">Activez Luminosité dans Paramètres → Intégration Steam</string>
|
||||
<string name="setup_gpu_bridge_off">Pont Mali : désactivé</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s ne peut pas utiliser le pont Mali (il faut un GPU Mali sans route de pilote système) ; ce commutateur n\'a donc aucun effet ici.</string>
|
||||
@@ -4038,10 +4063,11 @@
|
||||
<string name="input_reset_positions">Réinitialiser les positions</string>
|
||||
<string name="input_show_label">Afficher le libellé</string>
|
||||
<string name="input_layout_import_failed">Impossible d’importer cette disposition</string>
|
||||
<string name="epic_third_party_managed">S’installe via %1$s</string>
|
||||
|
||||
<string name="theme_white_red">Neige écarlate</string>
|
||||
<string name="theme_white_red_detail">Surfaces blanches avec des accents rouges.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">Bandes originales</string>
|
||||
<string name="rail_music">Musique</string>
|
||||
<string name="soundtracks_options">Options de lecture</string>
|
||||
|
||||
@@ -10,14 +10,34 @@
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>पहली बार चलाने पर Steam डाउनलोड होता है। इसमें कुछ मिनट लग सकते हैं।</item>
|
||||
<item>डिफ़ॉल्ट रूप से, ऐप से बाहर जाने पर Steam रुक जाता है; वापस आने पर यह वहीं से शुरू होता है जहां छोड़ा था।</item>
|
||||
<item>आपका कंट्रोलर Xbox 360 पैड के रूप में दिखाई देता है। नहीं तो, ऑन-स्क्रीन कंट्रोल का उपयोग करें।</item>
|
||||
<item>आपका कंट्रोलर Steam को Steam Deck कंट्रोलर के रूप में दिखता है। सत्र सेटिंग में इसे Steam Controller, DualShock 4, DualSense या Xbox 360 पैड पर बदलें; यह अगले सत्र से लागू होता है।</item>
|
||||
<item>Steam का Quick Access मेनू खोलने के लिए अपने कंट्रोलर पर बैक दबाकर रखें। सत्र सेटिंग में Steam शॉर्टकट के लिए बैक दबाकर रखें चालू होना चाहिए।</item>
|
||||
<item>बैकग्राउंड व्यवहार तय करता है कि ऐप छोड़ने पर क्या होता है: नेटिव Steam को स्लीप के लिए तैयार करता है, ऑटो उसे रोक देता है, मैनुअल फिर से शुरू करें का इंतज़ार करता है, कभी नहीं उसे चलता रखता है।</item>
|
||||
<item>Steam गेम Quick Access में Steam की फ़्रेम सीमा का उपयोग करते हैं। अगर कोई ऐसा रिफ्रेश रेट हो जिससे सीमा बराबर बँट जाए, तो डिस्प्ले उसी पर चला जाता है।</item>
|
||||
<item>सत्र मेनू में लो लेटेंसी मोड कंट्रोलर इनपुट को 250 Hz की जगह 1000 Hz पर भेजता है, जिसके लिए थोड़ा ज़्यादा CPU और बैटरी लगती है।</item>
|
||||
<item>हर गेम की अपनी प्रोफ़ाइल होती है, जिसमें Proton, FEX, कॉम्पोनेंट और एनवायरनमेंट सेटिंग शामिल हैं।</item>
|
||||
<item>सत्र मेनू में वॉइस चैट के लिए माइक्रोफ़ोन टॉगल और ज़रूरत पर सत्र को फ़्रीज़ करने के लिए अभी सस्पेंड करें बटन है।</item>
|
||||
<item>DroidDeck HUD को हिलाने के लिए खींचें, आकार बदलने के लिए पिंच करें, और छोटे FPS टैब के रूप में डॉक करने के लिए उसे किनारे से बाहर धकेलें।</item>
|
||||
<item>दो स्क्रीन वाले हैंडहेल्ड पर निचली स्क्रीन डाउनलोड, नोटिफ़िकेशन, स्क्रीनशॉट और Steam चैट दिखा सकती है। स्क्रीन बदलें गेम को वहाँ रख देता है।</item>
|
||||
<item>SD कार्ड, USB ड्राइव या SSD से Steam लाइब्रेरी जोड़ें, और DroidDeck गेम को आपकी लाइब्रेरी में एक साथ रखता है।</item>
|
||||
<item>स्टोर से आप Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io और Game Jolt में साइन इन कर सकते हैं, फिर DroidDeck से उनके गेम इंस्टॉल और अपडेट कर सकते हैं।</item>
|
||||
<item>FEX, DXVK और VKD3D-Proton जैसे कॉम्पोनेंट खुद अपडेट होते हैं, और डिफ़ॉल्ट Proton Experimental ARM64 है, या वह बिल्ड इंस्टॉल होने पर Proton 11.0 ARM64।</item>
|
||||
<item>गेम चलते समय Steam को कंप्रेस करें कम RAM वाले डिवाइस पर RAM खाली करता है।</item>
|
||||
<item>सत्र मेनू खोलने के लिए दाएँ किनारे से अंदर की ओर स्वाइप करें: टचपैड मोड, पीसी कीबोर्ड, लो लेटेंसी मोड, गेम प्रोफ़ाइल और बहुत कुछ।</item>
|
||||
<item>गेम धीमा चल रहा है? Quick Access में फ़्रेम रेट सीमित करें, फिर गेम के कॉम्पोनेंट में कोई दूसरा Proton वर्शन या FEX प्रीसेट आज़माएँ।</item>
|
||||
<item>गेम की आवाज़ में खरखराहट है या आवाज़ नहीं आ रही? Steam सेटिंग में ऑडियो के अंतर्गत गेम के लिए DirectAudio टॉगल आज़माएँ।</item>
|
||||
<item>सेटअप में स्टोरेज से शेडर कैश और हटाए गए गेम के बचे हुए प्रीफ़िक्स साफ़ किए जा सकते हैं।</item>
|
||||
<item>कोई बग मिला? सत्र मेनू में लॉग शेयर करें डायग्नोस्टिक्स का बंडल बनाता है। उन्हें Discord पर #bug-reports में पोस्ट करें।</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>पहली बार चलाने पर डेस्कटॉप सेट हो जाता है। इसमें कुछ मिनट लग सकते हैं।</item>
|
||||
<item>डिफ़ॉल्ट रूप से, ऐप से बाहर जाने पर सेशन रुक जाता है; वापस आने पर यह वहीं से शुरू होता है जहां छोड़ा था।</item>
|
||||
<item>टच टचपैड की तरह काम करता है: पॉइंटर घुमाने के लिए ड्रैग करें, क्लिक के लिए टैप करें।</item>
|
||||
<item>आपका कंट्रोलर Xbox 360 पैड के रूप में दिखाई देता है। नहीं तो, ऑन-स्क्रीन कंट्रोल का उपयोग करें।</item>
|
||||
<item>पहली बार चलाने पर डेस्कटॉप सेट अप होता है। इसमें कुछ मिनट लग सकते हैं।</item>
|
||||
<item>टच टचपैड की तरह काम करता है: पॉइंटर हिलाने के लिए खींचें, क्लिक करने के लिए टैप करें।</item>
|
||||
<item>बैकग्राउंड व्यवहार तय करता है कि ऐप छोड़ने पर क्या होता है: मैनुअल डिफ़ॉल्ट रूप से फिर से शुरू करें का इंतज़ार करता है, ऑटो रोक देता है, कभी नहीं चलता रखता है।</item>
|
||||
<item>सत्र मेनू खोलने के लिए दाएँ किनारे से अंदर की ओर स्वाइप करें, फिर उन ऐप में टाइप करने के लिए पीसी कीबोर्ड चुनें जो Android कीबोर्ड को अनदेखा करते हैं।</item>
|
||||
<item>सत्र मेनू के पीसी कीबोर्ड का आकार, अपारदर्शिता और कुंजी समूह बदले जा सकते हैं।</item>
|
||||
<item>आपका कंट्रोलर Xbox 360 पैड के रूप में दिखता है। नहीं तो ऑन-स्क्रीन कंट्रोल का उपयोग करें।</item>
|
||||
<item>सत्र मेनू में माइक्रोफ़ोन टॉगल और ज़रूरत पर सत्र को फ़्रीज़ करने के लिए अभी सस्पेंड करें बटन है।</item>
|
||||
<item>कोई बग मिला? सत्र मेनू में लॉग शेयर करें डायग्नोस्टिक्स का बंडल बनाता है। उन्हें Discord पर #bug-reports में पोस्ट करें।</item>
|
||||
</string-array>
|
||||
<string name="session_channel">सेशन</string>
|
||||
<string name="session_channel_description">Steam या डेस्कटॉप सेशन खुला होने पर दिखता है</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">टचपैड</string>
|
||||
<string name="mode_touch_direct">डायरेक्ट</string>
|
||||
<string name="mode_touch_note">ऑटो: डेस्कटॉप पर टचपैड, Steam में डायरेक्ट।</string>
|
||||
<string name="mode_pen">पेन</string>
|
||||
<string name="mode_pen_mouse">माउस</string>
|
||||
<string name="mode_pen_touch">टच</string>
|
||||
<string name="mode_pen_button">साइड बटन</string>
|
||||
<string name="mode_osc">ऑन-स्क्रीन कंट्रोल</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">कोई कंट्रोलर कनेक्ट न होने पर ऑटो कंट्रोल दिखाता है।</string>
|
||||
@@ -604,6 +628,8 @@
|
||||
<string name="perf_cap_off">बंद</string>
|
||||
<string name="perf_cap_auto">ड्राइवर डिफ़ॉल्ट</string>
|
||||
<string name="perf_zram_client">गेम चलते समय Steam को कंप्रेस करें</string>
|
||||
<string name="perf_zram_idle">गेम की निष्क्रिय मेमोरी को संपीड़ित करें</string>
|
||||
<string name="perf_zram_idle_hint">RAM कम होने पर गेम की निष्क्रिय मेमोरी को पेज करता है। अगर गेम लगभग हर आधे मिनट में कुछ सेकंड के लिए रुकते हैं, तो इसे बंद करें। अगली बार सत्र शुरू होने पर लागू होता है।</string>
|
||||
<string name="perf_zram_client_hint">गेम शुरू होने के 20 s बाद, Steam क्लाइंट को zRAM में कंप्रेस किया जाता है ताकि गेम को ज़्यादा मेमोरी मिले, और गेम बंद होने पर वापस पढ़ा जाता है। अगर गेम शुरू होने के कुछ देर बाद सेशन बंद हो जाता है तो इसे बंद करें। ऊपर दी गई RAM सीमा पार होने पर भी Steam कंप्रेस होता है।</string>
|
||||
<string name="perf_ram_cap">RAM सीमा</string>
|
||||
<string name="perf_ram_cap_hint">Steam क्लाइंट चलते समय लागू होती है, Steam मोड में या डेस्कटॉप से। जब सेशन इससे ज़्यादा इस्तेमाल करता है, तो Steam और फिर सेशन की दूसरी समर्थित प्रोसेस zRAM में कंप्रेस होती हैं। यह सॉफ़्ट सीमा है: कुछ बंद नहीं होता, लेकिन पेज वापस आते समय गेम अटक सकते हैं।</string>
|
||||
@@ -614,7 +640,7 @@
|
||||
<string name="perf_gpuclock_hint">सिर्फ़ Adreno के लिए। कम हिचकोले, लेकिन ज़्यादा बैटरी खर्च और गर्मी।</string>
|
||||
<string name="perf_fixes">सेशन फ़िक्स</string>
|
||||
<string name="perf_sysmem">Turnip: sysmem रेंडरिंग</string>
|
||||
<string name="perf_sysmem_hint">Steam क्लाइंट के लिए तेज़; गेम में ड्राइवर हर पास के लिए टाइल या सिस्टम मेमोरी रेंडरिंग चुनता है। Adreno 710/720/722 पर ज़रूरी।</string>
|
||||
<string name="perf_sysmem_hint">Steam क्लाइंट और गेम पर लागू। Adreno 710/720/722 पर ज़रूरी।</string>
|
||||
<string name="perf_xalia">Steam के xalia हेल्पर को छोड़ें</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">Linux ntsync ड्राइवर की यूज़रस्पेस जगह लेने वाली चीज़। चालू रहते हुए, Proton इसे droiddeck-esync और droiddeck-fsync के बदले इस्तेमाल करता है। यह Proton Experimental ARM64, GE-Proton और proton-cachyos के साथ काम करता है। अगले सेशन से लागू होता है।</string>
|
||||
@@ -1834,6 +1860,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">साफ़ करें</string>
|
||||
<string name="game_sync_err_runtime">पहले रनटाइम इंस्टॉल करें</string>
|
||||
<string name="game_sync_err_steam_library">Steam लाइब्रेरी उपलब्ध नहीं है</string>
|
||||
<string name="game_sync_err_previous_sd">पिछली SD लाइब्रेरी उपलब्ध नहीं है</string>
|
||||
@@ -3837,8 +3864,6 @@
|
||||
<string name="integration_shortcuts_hint">Alt+Tab, Win कुंजी और होम बटन सत्र में ही रहते हैं</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">Android में धूसर है? ऐप्लिकेशन की जानकारी → ⋮ → प्रतिबंधित सेटिंग की अनुमति दें</string>
|
||||
<string name="integration_shortcuts_restricted">Android ने ब्लॉक किया · ऐप्लिकेशन की जानकारी → ⋮ → प्रतिबंधित सेटिंग की अनुमति दें</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck सिस्टम कुंजियाँ</string>
|
||||
<string name="integration_shortcuts_service_description">Alt+Tab, Win कुंजी और होम बटन को Android के बजाय सक्रिय DroidDeck सत्र में रखता है।</string>
|
||||
<string name="integration_brightness_needed">Setup → Steam इंटीग्रेशन में ब्राइटनेस चालू करें</string>
|
||||
<string name="setup_gpu_bridge_off">Mali ब्रिज: बंद</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s Mali ब्रिज इस्तेमाल नहीं कर सकता (इसे ऐसा Mali GPU चाहिए जिसके पास सिस्टम ड्राइवर का रास्ता न हो), इसलिए यहाँ इस स्विच का कोई असर नहीं है।</string>
|
||||
@@ -3999,10 +4024,11 @@
|
||||
<string name="input_reset_positions">स्थितियाँ रीसेट करें</string>
|
||||
<string name="input_show_label">लेबल दिखाएँ</string>
|
||||
<string name="input_layout_import_failed">यह लेआउट इम्पोर्ट नहीं किया जा सका</string>
|
||||
<string name="epic_third_party_managed">%1$s के ज़रिए इंस्टॉल होता है</string>
|
||||
|
||||
<string name="theme_white_red">किरमिज़ी बर्फ</string>
|
||||
<string name="theme_white_red_detail">लाल रंग की झलकियों वाली सफ़ेद सतहें।</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">साउंडट्रैक</string>
|
||||
<string name="rail_music">संगीत</string>
|
||||
<string name="soundtracks_options">प्लेबैक विकल्प</string>
|
||||
|
||||
@@ -9,15 +9,35 @@
|
||||
<string name="steamvr_recovery_failed">A DroidDeck nem tudott automatikusan újraindulni. Zárja be teljesen az alkalmazást, majd nyissa meg újra.</string>
|
||||
<string name="app_name">DroidDeck</string>
|
||||
<string-array name="loading_hints">
|
||||
<item>Az első indítás letölti a Steamet. Ez néhány percet vehet igénybe.</item>
|
||||
<item>Alapértelmezés szerint az alkalmazás elhagyása szünetelteti a Steamet; visszatéréskor ott folytatja, ahol abbahagyta.</item>
|
||||
<item>A kontroller Xbox 360 kontrollerként jelenik meg. Egyébként használja a képernyőn lévő vezérlőket.</item>
|
||||
<item>Az első indításkor letöltődik a Steam. Ez eltarthat néhány percig.</item>
|
||||
<item>A kontrollered Steam Deck kontrollerként jelenik meg a Steam számára. A munkamenet beállításaiban átállíthatod Steam Controller, DualShock 4, DualSense vagy Xbox 360 kontrollerre; a változás a következő munkamenettől él.</item>
|
||||
<item>Tartsd nyomva a kontrolleren a Vissza gombot a Steam Gyors hozzáférés menüjének megnyitásához. A Vissza nyomva tartása Steam parancsokhoz beállításnak bekapcsolva kell lennie a munkamenet beállításaiban.</item>
|
||||
<item>A Háttérbeli viselkedés dönti el, mi történik, ha elhagyod az alkalmazást: a Natív felkészíti a Steamet az altatásra, az Automatikus szüneteltet, a Manuális megvárja a Folytatást, a Soha futva tartja.</item>
|
||||
<item>A Steam-játékok a Steam Képkockakorlátját használják a Gyors hozzáférésben. A kijelző olyan frissítési gyakoriságra vált, amellyel a korlát egyenletesen osztható, ha van ilyen.</item>
|
||||
<item>A munkamenet menü Alacsony késleltetésű módja 250 Hz helyett 1000 Hz-cel küldi a kontroller bemenetét, kicsit több CPU- és akkumulátorhasználat árán.</item>
|
||||
<item>Minden játéknak saját profilja van a Proton, FEX, összetevők és környezeti beállítások számára.</item>
|
||||
<item>A munkamenet menüben van egy mikrofonkapcsoló a hangchathez, és egy Felfüggesztés most gomb a munkamenet igény szerinti befagyasztásához.</item>
|
||||
<item>Húzd odébb a DroidDeck HUD-ot a mozgatáshoz, csípéssel méretezd át, és told ki a szélén túlra, hogy kis FPS-fülként rögzüljön.</item>
|
||||
<item>Dupla kijelzős kézikonzolokon az alsó kijelző letöltéseket, értesítéseket, képernyőképeket és Steam-csevegést mutathat. A kijelzők cseréje oda teszi át a játékot.</item>
|
||||
<item>Adj hozzá Steam-könyvtárakat SD-kártyáról, USB-meghajtóról vagy SSD-ről, és a DroidDeck egy helyen tartja a játékokat a Könyvtárban.</item>
|
||||
<item>Az Áruházak lehetővé teszi, hogy bejelentkezz a Epic Games, GOG, Xbox, EA, Battle.net, Ubisoft Connect, Amazon Games, itch.io és Game Jolt szolgáltatásokba, majd telepítsd és frissítsd a játékaikat a DroidDeckből.</item>
|
||||
<item>Az olyan összetevők, mint a FEX, a DXVK és a VKD3D-Proton, maguktól frissülnek, az alapértelmezett pedig a Proton Experimental ARM64, vagy a Proton 11.0 ARM64, ha az a build telepítve van.</item>
|
||||
<item>A Steam tömörítése játék közben RAM-ot szabadít fel a kevés memóriával rendelkező eszközökön.</item>
|
||||
<item>Húzd be az ujjad a jobb szélről a munkamenet menü megnyitásához: érintőpad mód, PC-billentyűzet, alacsony késleltetésű mód, játékprofil és más.</item>
|
||||
<item>Lassan fut a játék? Korlátozd a képkockasebességet a Gyors hozzáférésben, majd próbálj ki másik Proton-verziót vagy FEX-előbeállítást a játék összetevőiben.</item>
|
||||
<item>Ropog vagy hiányzik a játék hangja? Próbáld ki a DirectAudio a játékokhoz kapcsolót a Steam beállításaiban a Hang alatt.</item>
|
||||
<item>A Beállítás, azon belül a Tárhely törölheti a shader-gyorsítótárakat és az eltávolított játékok megmaradt prefixeit.</item>
|
||||
<item>Hibába futottál? A munkamenet menü Naplók megosztása pontja összegyűjti a diagnosztikát. Tedd közzé a Discord #bug-reports csatornáján.</item>
|
||||
</string-array>
|
||||
<string-array name="loading_hints_desktop">
|
||||
<item>Az első indítás beállítja az asztalt. Ez néhány percet vehet igénybe.</item>
|
||||
<item>Alapértelmezés szerint az alkalmazás elhagyása szünetelteti a munkamenetet; visszatéréskor ott folytatja, ahol abbahagyta.</item>
|
||||
<item>Az érintés érintőpadként működik: húzással mozgathatja a kurzort, koppintással kattinthat.</item>
|
||||
<item>A kontroller Xbox 360 kontrollerként jelenik meg. Egyébként használja a képernyőn lévő vezérlőket.</item>
|
||||
<item>Az első indításkor beállítódik az asztal. Ez eltarthat néhány percig.</item>
|
||||
<item>Az érintés érintőpadként működik: húzással mozgathatod a mutatót, koppintással kattinthatsz.</item>
|
||||
<item>A Háttérbeli viselkedés dönti el, mi történik, ha elhagyod az alkalmazást: a Manuális alapból megvárja a Folytatást, az Automatikus szüneteltet, a Soha futva tartja.</item>
|
||||
<item>Húzd be az ujjad a jobb szélről a munkamenet menü megnyitásához, majd válaszd a PC-billentyűzet pontot az Android billentyűzetet figyelmen kívül hagyó alkalmazásokban való gépeléshez.</item>
|
||||
<item>A munkamenet menü PC-billentyűzetének mérete, átlátszatlansága és billentyűcsoportjai állíthatók.</item>
|
||||
<item>A kontrollered Xbox 360 kontrollerként jelenik meg. Ha nem, használd a képernyőn lévő vezérlőket.</item>
|
||||
<item>A munkamenet menüben van egy mikrofonkapcsoló és egy Felfüggesztés most gomb a munkamenet igény szerinti befagyasztásához.</item>
|
||||
<item>Hibába futottál? A munkamenet menü Naplók megosztása pontja összegyűjti a diagnosztikát. Tedd közzé a Discord #bug-reports csatornáján.</item>
|
||||
</string-array>
|
||||
<string name="session_channel">Munkamenet</string>
|
||||
<string name="session_channel_description">Megjelenik, amíg egy Steam- vagy asztali munkamenet aktív</string>
|
||||
@@ -269,6 +289,10 @@
|
||||
<string name="mode_touch_touchpad">Érintőpad</string>
|
||||
<string name="mode_touch_direct">Közvetlen</string>
|
||||
<string name="mode_touch_note">Automatikus: érintőpad az Asztalon, közvetlen a Steamben.</string>
|
||||
<string name="mode_pen">Toll</string>
|
||||
<string name="mode_pen_mouse">Egér</string>
|
||||
<string name="mode_pen_touch">Érintés</string>
|
||||
<string name="mode_pen_button">Oldalsó gomb</string>
|
||||
<string name="mode_osc">Képernyőn megjelenő vezérlők</string>
|
||||
<string name="mode_osc_qam">Steam + QAM</string>
|
||||
<string name="mode_osc_note">Az Automatikus megjeleníti a vezérlőket, ha nincs csatlakoztatott kontroller.</string>
|
||||
@@ -604,6 +628,8 @@
|
||||
<string name="perf_cap_off">Ki</string>
|
||||
<string name="perf_cap_auto">Illesztőprogram alapértéke</string>
|
||||
<string name="perf_zram_client">A Steam tömörítése játék közben</string>
|
||||
<string name="perf_zram_idle">Játék inaktív memóriájának tömörítése</string>
|
||||
<string name="perf_zram_idle_hint">Kevés RAM esetén tömöríti a játék inaktív memóriáját. Kapcsold ki, ha a játékok nagyjából félpercenként néhány másodpercre lefagynak. A munkamenet következő indításakor lép érvénybe.</string>
|
||||
<string name="perf_zram_client_hint">20 mp-cel a játék indulása után a Steam-kliens a zRAM-ba tömörül, hogy több memória maradjon a játéknak, és a játék bezárásakor visszaolvasódik. Kapcsolja ki, ha a munkamenet röviddel a játékok indulása után bezárul. A fenti RAM-korlát akkor is tömöríti a Steamet, ha a munkamenet túllépi.</string>
|
||||
<string name="perf_ram_cap">RAM-korlát</string>
|
||||
<string name="perf_ram_cap_hint">Akkor érvényes, amikor a Steam-kliens fut, Steam módban vagy az asztalról. Ha a munkamenet ennél többet használ, a Steam, majd a munkamenet többi támogatott folyamata a zRAM-ba tömörül. Puha korlát: semmi sem zárul be, de a játékok akadhatnak, amíg a lapok visszatöltődnek.</string>
|
||||
@@ -614,7 +640,7 @@
|
||||
<string name="perf_gpuclock_hint">Csak Adreno. Kevesebb akadás, nagyobb akkumulátorhasználat és hőtermelés.</string>
|
||||
<string name="perf_fixes">Munkamenet-javítások</string>
|
||||
<string name="perf_sysmem">Turnip: sysmem renderelés</string>
|
||||
<string name="perf_sysmem_hint">Gyorsabb a Steam kliensnek; játékokban a meghajtó menetenként választ a csempés és a rendszermemóriás renderelés között. Adreno 710/720/722-n szükséges.</string>
|
||||
<string name="perf_sysmem_hint">A Steam kliensre és a játékokra vonatkozik. Adreno 710/720/722-n szükséges.</string>
|
||||
<string name="perf_xalia">A Steam xalia segítőjének kihagyása</string>
|
||||
<string name="perf_fastsync">droiddeck-ntsync</string>
|
||||
<string name="perf_fastsync_hint">A Linux ntsync illesztőprogram felhasználói szintű helyettesítője. Amíg be van kapcsolva, a Proton ezt használja a droiddeck-esync és a droiddeck-fsync helyett. A Proton Experimental ARM64-gyel, a GE-Protonnal és a proton-cachyosszal működik. A következő munkamenettől érvényes.</string>
|
||||
@@ -1834,6 +1860,7 @@
|
||||
<string name="second_key_on">%1$s ✓</string>
|
||||
<string name="second_key_ctrl_c">Ctrl+C</string>
|
||||
<string name="second_key_ctrl_d">Ctrl+D</string>
|
||||
<string name="second_key_clear">Törlés</string>
|
||||
<string name="game_sync_err_runtime">Előbb telepítse a futtatókörnyezetet</string>
|
||||
<string name="game_sync_err_steam_library">A Steam-könyvtár nem elérhető</string>
|
||||
<string name="game_sync_err_previous_sd">A korábbi SD-könyvtár nem elérhető</string>
|
||||
@@ -3837,8 +3864,6 @@
|
||||
<string name="integration_shortcuts_hint">Az Alt+Tab, a Win billentyű és a Kezdőlap gomb a munkamenetben marad</string>
|
||||
<string name="integration_shortcuts_maybe_restricted">Szürke az Androidban? Alkalmazásinformáció → ⋮ → Korlátozott beállítások engedélyezése</string>
|
||||
<string name="integration_shortcuts_restricted">Az Android letiltotta · Alkalmazásinformáció → ⋮ → Korlátozott beállítások engedélyezése</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck rendszerbillentyűk</string>
|
||||
<string name="integration_shortcuts_service_description">Az Alt+Tab, a Win billentyű és a Kezdőlap gomb az aktív DroidDeck-munkamenetben marad az Android helyett.</string>
|
||||
<string name="integration_brightness_needed">Kapcsolja be a Fényerőt itt: Beállítás → Steam-integráció</string>
|
||||
<string name="setup_gpu_bridge_off">Mali híd: ki</string>
|
||||
<string name="setup_gpu_bridge_unusable">%1$s nem használhatja a Mali hidat (ehhez olyan Mali GPU kell, amelyhez nincs rendszer-illesztőprogramos útvonal), ezért ennek a kapcsolónak itt nincs hatása.</string>
|
||||
@@ -3999,10 +4024,11 @@
|
||||
<string name="input_reset_positions">Pozíciók visszaállítása</string>
|
||||
<string name="input_show_label">Címke megjelenítése</string>
|
||||
<string name="input_layout_import_failed">Ez az elrendezés nem importálható</string>
|
||||
<string name="epic_third_party_managed">A telepítés itt történik: %1$s</string>
|
||||
|
||||
<string name="theme_white_red">Skarlátvörös hó</string>
|
||||
<string name="theme_white_red_detail">Fehér felületek piros kiemelésekkel.</string>
|
||||
|
||||
|
||||
<string name="rail_soundtracks">Soundtrackek</string>
|
||||
<string name="rail_music">Zene</string>
|
||||
<string name="soundtracks_options">Lejátszási beállítások</string>
|
||||
|
||||
Loaded 100 of 227 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user