andrewrk / andrewrk/libsoundio
Inaccuracy when setting latency
- Vorherrschende Sprache
- C
- Sterne
- 2.1k
- Forks
- 254
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hello,
I am having an issue understanding the relation between latency and read/write counts, using OSX coreaudio, libsoundio 1.1
For example, a desired (single channel) buffer size of 1024 samples, input sample rate 16khz the "perfect" Input latency for my desired buffer is _buffer size / sample rate_, so _1024 / 16000 = 0.064_
I use the same latency for the output (48khz sample rate), meaning the output _should_ have a min/max write count of _buffer size * sample rate ratio_ samples (so 1024 * 48/16 = 3072). The amount of samples available in the buffer is infact the buffer size, 1024, which is fine because I am upsampling to the correct amount of samples.
What is happening is that the output is requesting an unexpected amount of samples, 3344 (so 1115 samples at 16khz), and quickly ends up consuming more samples than the input can provide, getting underflows.
Is there additional, uncontrollable hardware latency that makes the approach I am taking unfeasible? Or am I missing something ....
Thanks
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.