Repository navigation
FrameTune Suite v1.2.0
FrameTune Suite v1.2.0
Official release of FrameTune TV and FrameTune Remote companion.
✨ What's Added in this Release (Latest Commit Details)
- 📱 FrameTune Remote: Align app version to 1.1.100 and support Wi-Fi ADB APK sideloading (
23bb8a5)- Key components updated:
PairingActivity.kt,AdbManager.kt
- Key components updated:
📦 Included APKs
FrameTune-TV.apk— Install on Android TV, Google TV, and Fire TV devices.FrameTune-Remote.apk— Install on Android smartphones and tablets.
📋 Detailed Architecture & Phase Notes
[Phase 122] - 2026-10-18
- Zero-Lag Media Engine: Tun Loop IPC & Disk I/O Elimination, Debounced SharedPreferences, and State-Gated Accessibility Traversal (
:app& Docs):- The Requirement & Issue Solved:
- Following the update to
v1.1.88, severe system-wide stutter and frame drops occurred during video playback across streaming apps (reproduced on Hotstar and YouTube), accompanied by Choreographer logcat warnings (Skipped 312 frames! The application may be doing too much work on its main thread). - Root Causes Discovered via SysTrace & Kernel Profiling:
- Per-Packet Disk I/O & JSON Parsing in Tun Loop: In
FrameTuneDnsVpnService.kt,processDnsPacket()was creating a freshDnsSettings(this)instance on every single incoming UDP DNS packet, synchronously readingdns_rules_persistent.jsonfrom flash storage and parsing JSON withJSONObjecton the high-frequency TUN socket worker thread. - Blocking Binder IPC in Packet Loop:
processDnsPacket()calledam?.getRunningTasks(1)over synchronous Binder IPC whenever Hotstar was not detected (i.e. on 100% of YouTube packets and generic queries), lockingActivityTaskManagerServiceinsidesystem_serverand causing device-wide Choreographer thread starvation. - SharedPreferences & Memory Churn in Domain Logging: In
DnsPacketFilter.kt, every blocked query calledStandbyAuditStore.incrementLifetimeBlockedCount(), triggering immediateprefs.edit().apply()disk writes. Additionally, trimmingtargetSession.networkEventsviaremoveAt(0)performed O(N)System.arraycopyoperations shifting 250 objects per query, causing continuous GC pauses (GC freed 167123(11MB)). - Unbounded Main-Thread Accessibility Tree Traversal:
FrameTuneAccessibilityService.ktpolledrootInActiveWindowevery 500ms. InYouTubeHandler.kt,findSkipAdNode()fell back to a depth-12 BFS tree search with depth-6 DFS text extraction across all nodes whenever no skip button was visible (which is 100% of the time during smooth playback), whilefindFirstProgressNode()traversed down to depth 25. - Background Tooling Daemon: An Android Studio Device Mirroring agent (
com.android.tools.screensharing.Main) was executing via ADB, utilizing software VPX encoding (C2SoftVpxEnc) consuming ~60% TV CPU.
- Per-Packet Disk I/O & JSON Parsing in Tun Loop: In
- Following the update to
- Implementation Details:
- Zero-Copy In-Memory DNS Caching (
FrameTuneDnsVpnService.kt&DnsSettings.kt):- Added volatile cached collections:
isCachedDnsFilterEnabled,activeBlockedDomains, andactiveAllowedDomainsinFrameTuneDnsVpnService. - Completely eliminated
DnsSettings(this)object allocations and disk reads fromprocessDnsPacket(). - Added
FrameTuneDnsVpnService.refreshCachedRules()callbacks triggered immediately when rules, blocked lists, or filter toggles are updated. - Completely removed
am?.getRunningTasks(1)Binder IPC call, relying strictly on cached reactive state fromcore.appDetector.activeTargetApp.valueandcore.appDetector.foregroundPackage.value.
- Added volatile cached collections:
- Debounced Telemetry Counter & O(1) Sliding Window (
StandbyAuditStore.kt&StandbyAuditModels.kt):- Replaced immediate
prefs.edit().apply()on packet arrival with an in-memoryAtomicLongand a 15-second debounced background disk flush. - Switched
networkEventsfromArrayListtoLinkedListto achieve O(1) node unlinking for sliding event logs. - Added
ConcurrentHashMapmemoization inSmartTvTelemetryCatalog.ktfor rapid domain classification without regular expression re-evaluations.
- Replaced immediate
- Adaptive Accessibility Polling & State-Gated Traversal (
FrameTuneAccessibilityService.kt&YouTubeHandler.kt):- Relaxed YouTube background evaluation poll interval from 500ms to 3000ms during normal video playback; poll interval dynamically drops to 500ms only when commercial ads, muting, or skip buttons are actively detected.
- Gated
findSkipAdNode()fallback BFS tree search to run strictly whenisAdCurrentlyPlaying == trueand capped depth to 6. - Bounded
findFirstProgressNode()to depth 8. - Throttled
YouTubeSponsorBlockManagermetadata lookups to once every 3000ms whencurrentVideoIdis already resolved.
- Version Bump:
- Updated
versionCode 10189,versionName "1.1.89".
- Updated
- Zero-Copy In-Memory DNS Caching (
- Verification:
- Full unit test suite passed (
./gradlew testDebugUnitTest- 54/54 passed). - Deployed
v1.1.89to living room TV (192.168.0.102:5555). - Verified smooth 100% full-framerate playback on Hotstar (Avengers: Endgame) and YouTube (Global Finance Awards) with Network Shield ON and Display-On Radar ON.
- CPU idle increased from 0-25% to 241%-263% idle (out of 400%);
com.frametune.tvCPU consumption dropped to 0.0%; 0 dropped frames recorded in Choreographer logcat.
- Full unit test suite passed (
- The Requirement & Issue Solved:
🔨 Full Commit Log
23bb8a5— fix(remote): align app version to 1.1.100 and support Wi-Fi ADB APK sideloading (Spec-Pilot, 2026-10-24)