Trace events are used throughout the test app to measure the time it takes to read the AudioRecord data in both the VoiceInteractionService and the trusted HotwordDetectionService. This section can be used as a guide to collect and observe this trace data.
Trace events:
How to capture a trace:
Perfetto trace SQL query
WITH audio_events AS ( SELECT ts, (dur / 1000000) as dur_ms, name FROM slice WHERE (name LIKE "%AudioUtils.read%" OR name LIKE "%AudioRecord.read%" OR name LIKE "%onDetected%" OR name LIKE "%startRecording%" OR name LIKE "%createAudioRecord%") ), audio_counters AS ( SELECT ts, name, value FROM counter INNER JOIN track ON counter.track_id = track.id WHERE name LIKE "%AudioUtils.bytesRead%" ) SELECT ts, 'event' as type, name, dur_ms as value FROM audio_events UNION ALL SELECT ts, 'counter' as type, name, value FROM audio_counters ORDER BY ts