• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

AudioClock.hD23-Nov-20232.4 KiB7634

AudioSourceCaller.cppD23-Nov-20231.5 KiB3919

AudioSourceCaller.hD23-Nov-20232.3 KiB8436

AudioStream.cppD23-Nov-20236.8 KiB212161

AudioStreamBuilder.cppD23-Nov-20238.7 KiB232164

DataConversionFlowGraph.cppD23-Nov-202310.5 KiB244175

DataConversionFlowGraph.hD23-Nov-20232.9 KiB8743

FilterAudioStream.cppD23-Nov-20234.2 KiB10757

FilterAudioStream.hD23-Nov-20237.3 KiB226133

FixedBlockAdapter.cppD23-Nov-20231 KiB3918

FixedBlockAdapter.hD23-Nov-20232 KiB6825

FixedBlockReader.cppD23-Nov-20232.4 KiB7447

FixedBlockReader.hD23-Nov-20231.9 KiB6116

FixedBlockWriter.cppD23-Nov-20232.4 KiB7443

FixedBlockWriter.hD23-Nov-20231.7 KiB5514

LatencyTuner.cppD23-Nov-20233.6 KiB10967

MonotonicCounter.hD23-Nov-20233.1 KiB11341

OboeDebug.hD23-Nov-20231.3 KiB4218

QuirksManager.cppD23-Nov-20239 KiB223150

QuirksManager.hD23-Nov-20234.1 KiB13260

README.mdD23-Nov-20231.3 KiB3425

SourceFloatCaller.cppD23-Nov-20231 KiB3112

SourceFloatCaller.hD23-Nov-20231.3 KiB4519

SourceI16Caller.cppD23-Nov-20231.5 KiB4825

SourceI16Caller.hD23-Nov-20231.4 KiB4923

StabilizedCallback.cppD23-Nov-20234.4 KiB11253

Trace.cppD23-Nov-20232.2 KiB7543

Trace.hD23-Nov-2023870 3111

Utilities.cppD23-Nov-202311.2 KiB306254

Version.cppD23-Nov-20231,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