List of JACK Frame [or Buffer] & Period settings ideal for USB interface

Since through using KXStudio's Cadence or directly in the .jackdrc file you can over-ride JACK's drop-down menu selections and type-in your own custom frames or buffer entry, you can enter the numbers below and thus achieve an even multiple of 1ms (that is, a whole-numbered latency figure) for use with USB interfaces which require that.

This follows the formula for latency from AutoStatic's post I found in the Hardware forum that I'll replicate here for you:

(Frames [or buffer]/Sample Rate) * Period = Theoretical (or Math-derived) Latency

(actual latency depends upon other factors, but USB devices want this math-derived latency - the maximum latency achievable - to be an integer multiple of 1ms)

I created this spread-sheet that produced the numbers that generated integer-multiples of 1ms for both periods (2 & 3), suggesting what may be possible ideal candidates for USB interfaces. I couldn't get the numbers to line-up under the labels, but you can figure out which are which.

NOTE: quite a few pieces of software and plug-ins expect frames that are a power of 2 (like guitarix). You might get weird errors when using frame numbers that are not a power of 2 or the plug-in/software may not even start at all. ALSO note that JACK prefers a number of frames that is a power of two anyway. From the JACK man page:

-p, –period int

  Specify the number of frames between JACK process() calls. [b]This value must be a power of 2[/b], and the
  default is 1024. If you need low latency, set -p as low as you can go without seeing xruns. A
  larger period size yields higher latency, but makes xruns less likely. The JACK capture latency in
  seconds is --period divided by --rate

[thx again to AutoStatic!]

[Items with strike-out won't work ideally with USB but were included to have the most common figures all represented in there.]

[Items in BOLD will work with any software or plugin requiring frames with powers of two. As mentioned above, JACK itself prefers these according to its man page.]

(Frames [or buffer] / Sample Rate ) * Periods = Latency in ms

( 16 / 48000 ) * 3 = 1

( 24 / 48000 ) * 3 = 1.5

( 32 / 48000 ) * 3 = 2

( 48 / 48000 ) * 3 = 3

( 64 / 48000 ) * 3 = 4

( 72 / 48000 ) * 3 = 4.5

( 80 / 48000 ) * 3 = 5

( 96 / 48000 ) * 3 = 6

( 112 / 48000 ) * 3 = 7

( 128 / 48000 ) * 3 = 8

( 144 / 48000 ) * 3 = 9

( 160 / 48000 ) * 3 = 10

( 176 / 48000 ) * 3 = 11

( 256 / 48000 ) * 3 = 16

( 512 / 48000 ) * 3 = 32

( 960 / 48000 ) * 3 = 60

( 1024 / 48000 ) * 3 = 64

( 2048 / 48000 ) * 3 = 128


( 16 / 48000 ) * 2 = 0.6666666667

( 24 / 48000 ) * 2 = 1

( 32 / 48000 ) * 2 = 1.3333333333

( 48 / 48000 ) * 2 = 2

( 64 / 48000 ) * 2 = 2.6666666667

( 72 / 48000 ) * 2 = 3

( 80 / 48000 ) * 2 = 3.3333333333

( 96 / 48000 ) * 2 = 4

( 120 / 48000 ) * 2 = 5

( 128 / 48000 ) * 2 = 5.3333333333

( 144 / 48000 ) * 2 = 6

( 168 / 48000 ) * 2 = 7

( 192 / 48000 ) * 2 = 8

( 216 / 48000 ) * 2 = 9

( 240 / 48000 ) * 2 = 10

( 256 / 48000 ) * 2 = 10.6666666667

( 512 / 48000 ) * 2 = 21.3333333333

( 1024 / 48000 ) * 2 = 42.6666666667

( 2048 / 48000 ) * 2 = 85.3333333333


( 16 / 96000 ) * 3 = 0.5

( 24 / 96000 ) * 3 = 0.75

( 32 / 96000 ) * 3 = 1

( 48 / 96000 ) * 3 = 1.5

( 64 / 96000 ) * 3 = 2

( 72 / 96000 ) * 3 = 2.25

( 80 / 96000 ) * 3 = 2.5

( 96 / 96000 ) * 3 = 3

( 128 / 96000 ) * 3 = 4

( 160 / 96000 ) * 3 = 5

( 192 / 96000 ) * 3 = 6

( 224 / 96000 ) * 3 = 7

( 256 / 96000 ) * 3 = 8

( 288 / 96000 ) * 3 = 9

( 320 / 96000 ) * 3 = 10

( 512 / 96000 ) * 3 = 16

( 1024 / 96000 ) * 3 = 32

( 2048 / 96000 ) * 3 = 64


( 16 / 96000 ) * 2 = 0.3333333333

( 24 / 96000 ) * 2 = 0.5

( 32 / 96000 ) * 2 = 0.6666666667

( 48 / 96000 ) * 2 = 1

( 64 / 96000 ) * 2 = 1.3333333333

( 72 / 96000 ) * 2 = 1.5

( 80 / 96000 ) * 2 = 1.6666666667

( 96 / 96000 ) * 2 = 2

( 128 / 96000 ) * 2 = 2.6666666667

( 144 / 96000 ) * 2 = 3

( 192 / 96000 ) * 2 = 4

( 240 / 96000 ) * 2 = 5

( 256 / 96000 ) * 2 = 5.3333333333

( 288 / 96000 ) * 2 = 6

( 336 / 96000 ) * 2 = 7

( 384 / 96000 ) * 2 = 8

( 432 / 96000 ) * 2 = 9

( 480 / 96000 ) * 2 = 10

( 512 / 96000 ) * 2 = 10.6666666667

( 1024 / 96000 ) * 2 = 21.3333333333

( 2048 / 96000 ) * 2 = 42.6666666667


( 16 / 192000 ) * 3 = 0.25

( 24 / 192000 ) * 3 = 0.375

( 32 / 192000 ) * 3 = 0.5

( 48 / 192000 ) * 3 = 0.75

( 64 / 192000 ) * 3 = 1

( 72 / 192000 ) * 3 = 1.125

( 96 / 192000 ) * 3 = 1.5

( 128 / 192000 ) * 3 = 2

( 192 / 192000 ) * 3 = 3

( 256 / 192000 ) * 3 = 4

( 512 / 192000 ) * 3 = 8

( 1024 / 192000 ) * 3 = 16

( 2048 / 192000 ) * 3 = 32


( 16 / 192000 ) * 2 = 0.1666666667

( 24 / 192000 ) * 2 = 0.25

( 32 / 192000 ) * 2 = 0.3333333333

( 48 / 192000 ) * 2 = 0.5

( 64 / 192000 ) * 2 = 0.6666666667

( 72 / 192000 ) * 2 = 0.75

( 96 / 192000 ) * 2 = 1

( 128 / 192000 ) * 2 = 1.3333333333

( 256 / 192000 ) * 2 = 2.6666666667

( 512 / 192000 ) * 2 = 5.3333333333

( 1024 / 192000 ) * 2 = 10.6666666667

( 2048 / 192000 ) * 2 = 21.3333333333

Are those “oddball” frame [or buffer] values really going to work for you? Try them and please report back!

The issue of being integer-multiples of 1ms does not matter to non-USB devices.

BTW - Though AutoStatic had declared (probably true in reality) that this integer-multiple latency was only possible with 48000, 96000 and 192000 sample rates, it seems that 44100 actually does have two frame rate [or buffer] values that come out even that might work for USB! (Not sure these would really work in practicality…)

(147 frames [or buffer] / 44100) * 3 periods = 10ms

(441 frames [or buffer] / 44100) * 2 periods = 20ms

Read more about latency here


Acknowledgments

Many thanks to Paul Davis and Stephane Letz for JACK and to AutoStatic at linuxmusicians.org for alerting me to the USB forumula used above.

This article was written by Terry Leigh Britton and may be redistributed in terms of CC by-nc-sa.

A small caveat when using Guitarix

Many of the effects and amp simulators in Guitarix depend on a library which expects your frames/period to be a power of two (16, 32, 64, 128, etc), and large parts of Guitarix fail to work properly if this is not the case. This can easily be resolved by choosing periods=3, which enables most of the “conventional” 2^n frames/period values. In fact, if you choose periods=2, it will be impossible to get Guitarix to work properly while also having a latency which is an integral number of ms.

wiki/list_of_jack_frame_period_settings_ideal_for_usb_interface.txt · Last modified: 2013/06/02 15:45 by 127.0.0.1