• Home
Name Date Size #Lines LOC

..--

AudioClock.hD03-May-20242.4 KiB7634

AudioSourceCaller.cppD03-May-20241.5 KiB3919

AudioSourceCaller.hD03-May-20242.3 KiB8436

AudioStream.cppD03-May-20246.8 KiB212161

AudioStreamBuilder.cppD03-May-20248.7 KiB232164

DataConversionFlowGraph.cppD03-May-202410.5 KiB244175

DataConversionFlowGraph.hD03-May-20242.9 KiB8743

FilterAudioStream.cppD03-May-20244.2 KiB10757

FilterAudioStream.hD03-May-20247.3 KiB226133

FixedBlockAdapter.cppD03-May-20241 KiB3918

FixedBlockAdapter.hD03-May-20242 KiB6825

FixedBlockReader.cppD03-May-20242.4 KiB7447

FixedBlockReader.hD03-May-20241.9 KiB6116

FixedBlockWriter.cppD03-May-20242.4 KiB7443

FixedBlockWriter.hD03-May-20241.7 KiB5514

LatencyTuner.cppD03-May-20243.6 KiB10967

MonotonicCounter.hD03-May-20243.1 KiB11341

OboeDebug.hD03-May-20241.3 KiB4218

QuirksManager.cppD03-May-20249 KiB223150

QuirksManager.hD03-May-20244.1 KiB13260

README.mdD03-May-20241.3 KiB3425

SourceFloatCaller.cppD03-May-20241 KiB3112

SourceFloatCaller.hD03-May-20241.3 KiB4519

SourceI16Caller.cppD03-May-20241.5 KiB4825

SourceI16Caller.hD03-May-20241.4 KiB4923

StabilizedCallback.cppD03-May-20244.4 KiB11253

Trace.cppD03-May-20242.2 KiB7543

Trace.hD03-May-2024870 3111

Utilities.cppD03-May-202411.2 KiB306254

Version.cppD03-May-20241,014 297

README.md

1# Notes on Implementation
2
3## Latency from Resampling
4
5There are two components of the latency. The resampler itself, and a buffer that
6is used to adapt the block sizes.
7
81) The resampler is an FIR running at the target sample rate. So its latency is the number of taps.
9From MultiChannelResampler.cpp, numTaps is
10
11    Fastest: 2
12    Low: 4
13    Medium: 8
14    High: 16
15    Best: 32
16
17For output, the device sampling rate is used, which is typically 48000.For input, the app sampling rate is used.
18
192) There is a block size adapter that collects odd sized blocks into larger blocks of the correct size.
20
21The adapter contains one burst of frames, from getFramesPerBurst(). But if the app specifies a
22particular size using setFramesPerCallback() then that size will be used.
23Here is some pseudo-code to calculate the latency.
24
25    latencyMillis = 0
26    targetRate = isOutput ? deviceRate : applicationRate
27    // Add latency from FIR
28    latencyMillis += numTaps * 1000.0 / targetRate
29    // Add latency from block size adaptation
30    adapterSize = (callbackSize > 0) ? callbackSize : burstSize
31    if (isOutput && isCallbackUsed) latencyMillis += adapterSize * 1000.0 / deviceRate
32    else if (isInput && isCallbackUsed) latencyMillis += adapterSize * 1000.0 / applicationRate
33    else if (isInput && !isCallbackUsed) latencyMillis += adapterSize * 1000.0 / deviceRate
34