I'm actually very interested in the details. I have a few questions, in case you have cycles to help me understand.
# audio latency
From your comment and the original "An update on Android's audio latency" article, there seems to be 2 different ways to calculate "audio latency".
* 1. play a well-known sound (a tone), listen for it in real-time
IIUC, the exact operation of this would be something like this:
open recorder
loop:
timestamp1 <- getclock()
play audio file
keep listening to input frames until detecting audio file signature
timestamp2 <- getclock()
sample := timestamp2 - timestamp1
* 2. measure audio loopback feedback (larsen effect)
Operation should be as follows:
open recorder
play audio file
loop:
keep listening to input frames for 1-2 seconds
# analyze captured file
look for 2x consecutive appearances of the original audio file
sample := timestamp2 - timestamp1
Q1: Did I get this right? Any hunch about the pros&cons of both approaches?
# downlink/uplink latency
Many of the latency measurements break the latency down between audio downlink and uplink.
Q2: How is this measured?
The android doc discusses using a GPIO to have a zero-latency signal. You swap the signal on a well-known GPIO, and then play a well-known audio file. You then connect the GPIO to a speaker, and measure the latency between the GPIO-fed speaker, and the actual device speaker. As an optimization, you plug both the GPIO and the audio jack that feeds the actual device speaker into an oscilloscope, and get the distance there. Is this how audio downlink latency is measured?
Q3: If this is how downlink latency is measured, how do you implement it in prod devices (no access to the board)? Is this something that can be simulated using the usb-c plug?
# tools
The android doc/some googling points to several tools. I found oboetester, splatency, drrickorang, and google walt. I tested all but the walt one.
The first interesting thing is that oboetest, drrickorang, and walt seem to need an external jack-based dongle.
Q3: Why is this needed for? The audio latency approaches mentioned above should only need a speaker and a mic.
The experience has not been great for any of the tools. Operationally, I'd like to script these tests. Instead, I need to click on GUIs. Also, all the tools I tested seem to fail often, so I have to repeat the experiments multiple times. Also, I miss better documentation on exactly what they do.
Thanks for any help
edit: s/markdown/formatdoc/g