jtube-tv/scripts/fps-check.sh
Jeena 51077b8352 player,perf: Pause info overlay, no controller flash, cheap thumbnails
Paused playback now shows a bottom panel with channel + title + views
+ upload date and position instead of the controller bar (which hid
itself while paused - it was colliding with custom info). The
controller no longer flashes 4 s at playback start: it only reveals
on UP/DOWN-style keys.

For the TV frame-rate complaint: thumbnails decode at 480x270 RGB_565
via a global Coil loader and avatars at 160px, instead of full-size
1080p+ jpegs re-composited per scroll frame. Measured on the
software-rendered emulator: stable 10% janky / p50 18ms during row
scrolling; real-hardware measurement via scripts/fps-check.sh when
the couch is free.

BACK from a Home row also refocuses the watched card now (row-local
focus requesters + restore token), fixing the 'focus lands two-three
cards left' complaint.
2026-10-10 22:53:03 +00:00

47 lines
No EOL
1.8 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# fps-check.sh — measure UI smoothness of JTube TV on a device while programmatically
# scrolling the home rows the same way a remote would move focus.
#
# Usage: fps-check.sh [serial] default serial: emulator-5554
# Prereqs: app installed + logged in, on the Home destination.
set -u
DEV="${1:-emulator-5554}"
ADB=~/Android/Sdk/platform-tools/adb
echo "device $DEV: resetting frame stats"
$ADB -s "$DEV" shell am force-stop net.jeena.jtubetv
sleep 1
$ADB -s "$DEV" shell am start -n net.jeena.jtubetv/.MainActivity >/dev/null
sleep 15 # give images time to load + settle
# from top bar (search focused) DOWN into the first row, then traverse right across
# the row: each RIGHT triggers one (animated) row scroll.
$ADB -s "$DEV" shell input keyevent KEYCODE_DPAD_DOWN; sleep 1
$ADB -s "$DEV" shell dumpsys gfxinfo net.jeena.jtubetv reset > /dev/null
for i in $(seq 1 12); do
$ADB -s "$DEV" shell input keyevent KEYCODE_DPAD_RIGHT
sleep 1.2
done
$ADB -s "$DEV" shell input keyevent KEYCODE_DPAD_DOWN; sleep 1.5
for i in $(seq 1 6); do
$ADB -s "$DEV" shell input keyevent KEYCODE_DPAD_LEFT
sleep 1.2
done
echo "--- gfxinfo (home rows scrolling, 18 focus moves) ---"
$ADB -s "$DEV" shell dumpsys gfxinfo net.jeena.jtubetv | python3 -c "
import sys, re
out = sys.stdin.read()
m = re.search(r'\*\* Graphics info\s*\n(.*)', out, re.S)
block = m.group(1) if m else out
def grab(name):
mm = re.search(name + r'[^\d]*(\S+)', block)
return mm.group(1) if mm else '?'
total = grab('Total frames rendered')
janky = grab('Janky frames')
print('Total frames rendered:', total)
print('Janky frames:', janky)
p50, p90, p95, p99 = grab('50th percentile'), grab('90th percentile'), grab('95th percentile'), grab('99th percentile')
print('frame time percentiles (ms): p50=%s p90=%s p95=%s p99=%s' % (p50, p90, p95, p99))
"