20f0d2802f
Three levers to lower and steady decode latency on Snapdragon (Adreno) devices:
- ADPF (Adaptive Performance Framework): a new dlsym-resolved hint session
(native/src/adpf.rs; API-33+, resolved at runtime so there's no build-time
link dependency and libpunktfunk_android.so still loads on API 31/32) tells
the CPU governor the video pipeline runs a per-frame real-time workload, so it
keeps those threads on fast cores at high clocks. It now covers all three
latency-critical threads — the pf-decode feed/drain/present loop, the core
data-plane pump (UDP receive + FEC reassembly), and the audio thread — via a
new generic hot-thread registry on NativeClient (register_hot_thread /
hot_thread_ids; the pump self-registers). The session is built lazily on the
first presented frame, since ADPF createSession rejects a set containing any
not-yet-live tid.
- operating-rate -> Short.MAX ("as fast as possible"): pushes the Qualcomm
decoder to run each frame at max clocks instead of merely sustaining the
display rate at a power-saving clock that adds per-frame decode latency.
- appCategory="game": makes the app eligible for OEM Game Mode / Game Dashboard
performance profiles.
The core registry is cross-platform (gettid on Linux/Android, a no-op
elsewhere) — no Android-specific pollution of the shared core. Host workspace +
64 core tests green; Android arm64-v8a + x86_64 (platform 31) build + clippy
clean. On-device Snapdragon validation pending.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
59 lines
3.3 KiB
XML
59 lines
3.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
|
|
<!-- punktfunk/1 QUIC/UDP data plane. -->
|
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
<!-- mDNS discovery of _punktfunk._udp on the LAN (native mdns-sd browse). Requested
|
|
opportunistically — raw multicast reception needs only the MulticastLock, not this. -->
|
|
<uses-permission
|
|
android:name="android.permission.NEARBY_WIFI_DEVICES"
|
|
android:usesPermissionFlags="neverForLocation" />
|
|
<!-- HostDiscovery holds a MulticastLock while the native mDNS browse runs — raw multicast
|
|
reception needs it (also an OEM Wi-Fi power-save hedge). -->
|
|
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
|
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
|
<!-- Enforced from Android 17 (SDK 37) for ALL local-network traffic incl. the QUIC socket.
|
|
Harmless to declare on earlier releases. -->
|
|
<uses-permission android:name="android.permission.ACCESS_LOCAL_NETWORK" />
|
|
<!-- Mic uplink to the host's virtual microphone (requested at runtime). -->
|
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
<!-- Gamepad rumble feedback. -->
|
|
<uses-permission android:name="android.permission.VIBRATE" />
|
|
|
|
<!-- We target phone + TV from day one: keep the app installable on TV (no touchscreen) and on
|
|
devices without a gamepad. -->
|
|
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
|
<uses-feature android:name="android.software.leanback" android:required="false" />
|
|
<uses-feature android:name="android.hardware.gamepad" android:required="false" />
|
|
|
|
<!-- appCategory="game": a game-streaming client IS a game as far as the SoC is concerned.
|
|
On Snapdragon devices (and other OEMs with a Game Mode / Game Dashboard) this makes the app
|
|
eligible for the vendor's game performance profile — the aggressive CPU/GPU governor and
|
|
scheduler treatment games get — which, together with the ADPF hints in the native decode
|
|
path, is what keeps clocks up for low, consistent decode latency. Also groups it correctly
|
|
under Games in battery/data usage. Advisory: devices without Game Mode ignore it. -->
|
|
<application
|
|
android:allowBackup="false"
|
|
android:appCategory="game"
|
|
android:icon="@mipmap/ic_launcher"
|
|
android:roundIcon="@mipmap/ic_launcher_round"
|
|
android:label="@string/app_name"
|
|
android:supportsRtl="true"
|
|
android:theme="@style/Theme.PunktfunkAndroid">
|
|
|
|
<activity
|
|
android:name=".MainActivity"
|
|
android:exported="true"
|
|
android:configChanges="orientation|screenSize|keyboardHidden|screenLayout|density|navigation"
|
|
android:theme="@style/Theme.PunktfunkAndroid">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MAIN" />
|
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
<!-- TV launcher entry. -->
|
|
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
|
|
</intent-filter>
|
|
</activity>
|
|
</application>
|
|
</manifest>
|