mozilla / cubeb

Cross platform audio library
ISC License
439 stars 124 forks source link

Implement client-side clock interpolation for the AAudio backend, and accurately compute audio latencies #735

Closed padenot closed 1 year ago

padenot commented 1 year ago

I'm going to add commits for the input-only and duplex case later, since this also provides the latencies we need there, but it's going to be more or less the same.

@kinetiknz, with this, I believe we can attempt to reenable AAudio in Firefox.

I've attempted to fix the latency reporting in the OpenSL backend, without much success, but maybe it's doable as well. AAudio's API is a lot clearer.

The latency computation part is essentially what is done in Oboe, written by the Android audio people, so it should be correct.

A/V sync and clock resolution look perfect on my device, with all audio devices I checked.