title: Sync playback and recording on different computers
body: <p>I would like to sync audio playback and recording on two different computers from a common trigger signal using a c/c++ script. Expected delay should not exceed 1ms.</p>
  
  <p>Retrieving a signal and then start a script is not really an issue, delay is quite insignificant (few micro seconds).</p>
  
  <p>For the moment, i'm stuck in an average delay (between the beginning of playback and beginning of the record) of about 20ms and deviation is quite important (5 to 10 ms).
  Computers are running on Linux and I'm using <em>aplay</em> and <em>arecord</em> from <em>alsa-utils</em> (started directly from code using system() command).</p>
  
  <p>Does someone has a good idea or experience to decrease or control the latency between the two audio interfaces ? </p>
  
  <p>In my opinion, there should be a way to init both interface (rate, output format, ...) and, for the playback device, preload the data into the audio buffer and then start playing when signal is received.</p>
  
  <p>Thanks</p>