<div dir="ltr">Hi,<br>Thank you for your great support in Jack.<br>I am trying to build a real-time application on basis of Jack Server and Client architecture. But Jack capture and playback latency is failing me to make the application sample accurate.<br><br><b>My Jack server configuration (jackd -dalsa):</b><br>  <i>JACK server starting in realtime mode with priority 10<br>       self-connect-mode is "Don't restrict self connect requests"<br>     audio_reservation_init<br>        Acquire audio card Audio0<br>     creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit<br>     configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods<br>   ALSA: final selected sample format for capture: 32bit integer little-endian<br>   ALSA: use 2 periods for capture<br>       ALSA: final selected sample format for playback: 32bit integer little-endian<br>  ALSA: use 2 periods for playback</i><br><br><b>My Understanding :</b><br>   0. Realtime mode = Yes, 10 priority<br>   1. Sampling Rate = 48000Hz<br>    2. 1 Periods = 1024 frames<br>    3. Buffer Size = 2 Periods = 2048 frames<br>      4. Capture Latency = 2 periods = 1 Buffer = 21.3 x2 ms<br>        5. Playback Latency = 2 periods = 1 Buffer = 21.3 x2 ms<br>       <br><b>Apllication:</b><br>             passthru/simple_client.c of Jack2 repositry with one client for both sterio capture and mono playback<br>         <br><b>My application pipeline:</b><br>         input -----------> capture left channel (stage 1) ------------> playback left channel (stage 2) --------------> capture right channel (stage 3)<br>              <br><b>Latency calculation:</b><br>     After stage 1 --------------- 2 periods              = 42.6 ms<br> After stage 2 --------------- 2 + 2 periods        = 85.2 ms<br>      After stage 3 --------------- 2 + 2 + 2 periods   = 127.8 ms<br> <br><b>Difference between stage 3 and stage 1</b><br>   6 periods - 2 periods = 4 periods<br>     <br>Latency difference should be 4 periods but I am getting larger than 4 periods like 4 periods which also differs with different trials.<br><b><br></b><div><b>So, how can I make my application sample accurate or what is the correct procedure?</b></div><div><b><br></b></div>It will be a great help and advance thanks.<br><br>Best Regards<br>Ruhul Amin<br>       <br><br></div>