On 23.11.20 15:18, Will Godfrey wrote:
On Mon, 23 Nov 2020 14:55:10 +0100
David Kastrup <dak(a)gnu.org> wrote:
David Kastrup <dak(a)gnu.org> writes:
<some snippage>
Question: is there a reason that you are going
with buffer sizes of
3*2^n rather than 2^n? I've not actually tried what Jamulus does in
that situation (but will do) but it seems a bit strange to me. Does it
have some inherent advantage?
This puzzled me too. I was under the impression that the reason for using powers
of 2 was that buffering code was more efficient. Presumably that would give the
best latency figures.
Here is data for the Focusrite Scarlett solo for all period sizes P from
16 to 240 frames in steps of 16 frames:
P frames ms
16 114.847 2.393
32 176.847 3.684
48 232.847 4.851
64 294.847 6.143
80 368.847 7.684
96 424.847 8.851
112 498.847 10.393
128 566.847 11.809
144 616.847 12.851
160 684.847 14.268
176 752.847 15.684
192 802.847 16.726
208 876.847 18.268
240 1000.847 20.851
This is almost perfectly 4*P+48, for all P. I can also start it with P =
37 (an arbitrary prime number), so it looks that there is no limitation
on the period size. Also for such odd numbers it remains 4*P+48 (the
exact delay varies a bit between jack starts, which is normal for USB
devices).
This is jackd2 - I don't know if jackd1 behaves differently (although
both would use the underlying ALSA layer).
I started jack with
jackd --sync -P 90 -d alsa -d hw:$CARD -r $RATE -p $PERIODSIZE
CARD=USB
RATE=48000
At 44.1 kHz it is more like 4*P+70 samples, although there is more
fluctuation.
Best,
Giso