Release 0.1.2 with navigation sounds and smoother Home scrolling
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m14s
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m14s
This commit is contained in:
parent
6269425b33
commit
430616330b
21 changed files with 232 additions and 18 deletions
56
scripts/profile_home.py
Normal file
56
scripts/profile_home.py
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
"""Measure only Home hero -> Continue Watching on the authorized onn release.
|
||||
|
||||
Run without competing UI tests. Captures and traces remain private.
|
||||
"""
|
||||
import argparse,json,time
|
||||
from device import adb,OUT
|
||||
from verify_ui import launch,key,wait,focus,focused
|
||||
|
||||
def frames(raw):
|
||||
result=[]
|
||||
for block in raw.split('---PROFILEDATA---')[1::2]:
|
||||
lines=[line.strip() for line in block.splitlines() if line.strip()]
|
||||
if not lines:continue
|
||||
names=lines[0].rstrip(',').split(',')
|
||||
for line in lines[1:]:
|
||||
values=line.rstrip(',').split(',')
|
||||
if len(values)!=len(names):continue
|
||||
row=dict(zip(names,map(int,values)))
|
||||
if row['Flags']==0 and row['FrameCompleted']>row['IntendedVsync']:
|
||||
result.append((row['FrameCompleted']-row['IntendedVsync'])/1e6)
|
||||
return result
|
||||
|
||||
def percentile(values,p):return sorted(values)[min(len(values)-1,int((len(values)-1)*p))]
|
||||
|
||||
def main():
|
||||
parser=argparse.ArgumentParser();parser.add_argument('label');parser.add_argument('--cycles',type=int,default=5);parser.add_argument('--trace',action='store_true');parser.add_argument('--cold',action='store_true');args=parser.parse_args()
|
||||
assert args.cycles>0,'At least one transition is required'
|
||||
launch();key(20);wait(lambda r:focus(r) in ('Play','Resume'),'Hero action')
|
||||
# Warm the same row and artwork once, then return to the hero before timing.
|
||||
if not args.cold:
|
||||
key(20);wait(lambda r:focus(r) not in ('','Home','Play','Resume'),'Continue Watching card');time.sleep(.7)
|
||||
key(19);wait(lambda r:focus(r) in ('Play','Resume'),'Return to hero');time.sleep(.7)
|
||||
if args.trace:adb('shell','atrace','--async_start','-b','32768','-a','tv.kaleido.app','gfx','view','sched','freq')
|
||||
all_frames=[];runs=[]
|
||||
try:
|
||||
for index in range(args.cycles):
|
||||
adb('shell','dumpsys','gfxinfo','tv.kaleido.app','reset')
|
||||
adb('shell','input','keyevent','20');time.sleep(1)
|
||||
raw=adb('shell','dumpsys','gfxinfo','tv.kaleido.app','framestats').decode(errors='replace')
|
||||
(OUT/f'home-{args.label}-{index}-frames.txt').write_text(raw)
|
||||
sample=frames(raw);assert sample,'No measured frames'
|
||||
all_frames.extend(sample);runs.append({'frames':len(sample),'median':percentile(sample,.5),'p95':percentile(sample,.95),'max':max(sample)})
|
||||
print('Down transition',index+1,json.dumps(runs[-1]),flush=True)
|
||||
wait(lambda r:focus(r) not in ('','Home','Play','Resume'),'Continue Watching focus')
|
||||
key(19);wait(lambda r:focus(r) in ('Play','Resume'),'Hero focus restored');time.sleep(.7)
|
||||
finally:
|
||||
if args.trace:
|
||||
raw=adb('shell','atrace','--async_stop','-a','tv.kaleido.app','gfx','view','sched','freq')
|
||||
(OUT/f'home-{args.label}-atrace.txt').write_bytes(raw)
|
||||
result={'runs':runs,'frames':len(all_frames),'median':percentile(all_frames,.5),'p95':percentile(all_frames,.95),'over33msPercent':100*sum(x>33.34 for x in all_frames)/len(all_frames),'max':max(all_frames)}
|
||||
(OUT/f'home-{args.label}-results.json').write_text(json.dumps(result,indent=2)+'\n')
|
||||
print(json.dumps(result),flush=True)
|
||||
key(19);focused('Home')
|
||||
assert result['p95']<33.34,f"Hero-to-row p95 {result['p95']:.1f} ms exceeds two 60Hz frame intervals"
|
||||
|
||||
if __name__=='__main__':main()
|
||||
|
|
@ -31,6 +31,8 @@ def browse():
|
|||
launch();key(20)
|
||||
if focus(snapshot()) in ('Play','Resume'):key(20)
|
||||
wait(lambda r:focus(r) not in ('','Home','Play','Resume'),'Content focus')
|
||||
tracing='--trace' in sys.argv
|
||||
if tracing:adb('shell','atrace','--async_start','-b','32768','-a','tv.kaleido.app','gfx','view','sched')
|
||||
adb('shell','dumpsys','gfxinfo','tv.kaleido.app','reset')
|
||||
geometry=[]
|
||||
for _ in range(5):
|
||||
|
|
@ -40,6 +42,7 @@ def browse():
|
|||
adb('shell','input','keyevent',*(['KEYCODE_DPAD_RIGHT']*15))
|
||||
adb('shell','input','keyevent',*(['KEYCODE_DPAD_UP']*12))
|
||||
stats=adb('shell','dumpsys','gfxinfo','tv.kaleido.app','framestats').decode(errors='replace')
|
||||
if tracing:(OUT/'browse-regression-atrace.txt').write_bytes(adb('shell','atrace','--async_stop','-a','tv.kaleido.app','gfx','view','sched'))
|
||||
(OUT/'browse-framestats.txt').write_text(stats)
|
||||
(OUT/'browse-geometry.json').write_text(json.dumps(geometry,indent=2))
|
||||
print(json.dumps(geometry),flush=True)
|
||||
|
|
|
|||
48
scripts/verify_navigation_sounds.py
Normal file
48
scripts/verify_navigation_sounds.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
"""Check navigation sound persistence; audio() also compares native mixer activity.
|
||||
|
||||
The optional mixer check needs system sound effects enabled and otherwise silent
|
||||
audio output on the authorized onn. It never changes the TV's global sound setting.
|
||||
"""
|
||||
import json,time
|
||||
from verify_ui import launch,key,focused,text
|
||||
from device import adb,OUT,screenshot
|
||||
|
||||
def setting():
|
||||
launch();key(22,4);focused('Settings');key(23);focused('Sign in with Plex')
|
||||
key(20);focused('Mode: Direct stream');key(20);focused('Mark watched at 80%');key(20)
|
||||
|
||||
def persistence():
|
||||
setting();focused('Navigation sounds: On');key(23);focused('Navigation sounds: Off')
|
||||
screenshot('navigation-sounds-off')
|
||||
setting();focused('Navigation sounds: Off')
|
||||
print('PASS disabling navigation sounds persists across process restart',flush=True)
|
||||
key(23);focused('Navigation sounds: On')
|
||||
setting();focused('Navigation sounds: On')
|
||||
print('PASS enabling navigation sounds persists across process restart',flush=True)
|
||||
screenshot('navigation-sounds-on');key(4);focused('Home');text('Continue Watching')
|
||||
|
||||
def audio():
|
||||
assert adb('shell','settings','get','system','sound_effects_enabled').decode().strip()=='1','System sound effects must already be enabled for this optional check'
|
||||
def probe(label):
|
||||
time.sleep(.4)
|
||||
adb('shell','atrace','--async_start','-b','16384','audio')
|
||||
try:
|
||||
for _ in range(3):
|
||||
adb('shell','input','keyevent','20');time.sleep(.3)
|
||||
adb('shell','input','keyevent','19');time.sleep(.3)
|
||||
time.sleep(.4)
|
||||
finally:raw=adb('shell','atrace','--async_stop','audio').decode(errors='replace')
|
||||
(OUT/f'navigation-audio-{label}-atrace.txt').write_text(raw)
|
||||
focused('Navigation sounds: '+label.capitalize())
|
||||
return sum('tracing_mark_write: B|' in line and line.endswith('|write') for line in raw.splitlines())
|
||||
setting();focused('Navigation sounds: On');key(23);focused('Navigation sounds: Off')
|
||||
muted=probe('off')
|
||||
key(23);focused('Navigation sounds: On');enabled=probe('on')
|
||||
result={'mutedMixerWrites':muted,'enabledMixerWrites':enabled}
|
||||
(OUT/'navigation-audio-results.json').write_text(json.dumps(result,indent=2)+'\n')
|
||||
print('Native audio activity:',result,flush=True)
|
||||
assert muted==0 and enabled>0,'Expected silence while muted and native audio output while enabled'
|
||||
print('PASS navigation taps produce native mixer output only while enabled',flush=True)
|
||||
key(4);focused('Home')
|
||||
|
||||
if __name__=='__main__':persistence()
|
||||
Loading…
Add table
Add a link
Reference in a new issue