Does anyone have a c code snippet I can use to demonstrate the approximate 2 msec pisound specified latency?
You can use jack_iodelay
. The latency measured will depend on Jack settings you set. There used to be a website listing measurements of many audio cards, but looks like the page is gone now.
See Latency Measurment with jack_iodelay
Here’s an example Jack backend configuration line in /etc/jackdrc
:
exec /usr/bin/jackd -S -t 2000 -R -P 95 -d alsa -d hw:pisound -r 48000 -p 64 -n 2 -X seq -s -S
Adjust -r
, -p
and -n
values to modify the buffer size. Higher -r
and lower -p
and -n
mean lower latency, however, also less processing time for software to prepare the buffer contents.
If I remember right, jack_iodelay
requires no parameters and will automatically measure latency between system:playback and system:capture Jack ports. Make sure to loopback the input with the ouptut.