[Ardour-Users] Sync between internal and external sources

Steve Fosdick lists at pelvoux.nildram.co.uk
Wed Jan 21 14:48:18 PST 2009

OK, so you hit the play button and material from the PC is played (in
your case by hydrogen but the same applies to material that has already
been recorded) and then you play in time with it and record the new

Without compensation, there are two latencies.

The first occurs because, before you can hear the sound from the PC it
must go to jack, jack must send it to the ALSA driver which buffers it
for a short while and then loads it into the D/A in your sound card
which converts to analogue.  All this takes time and means you hear the
sound a very short while after ardour idea of when it was played.

You now play along with what you hear and the sound from the microphone
(or DI) now has to go through the reverse process, i.e. it is converted
by the A/D converter in the sound card, read and buffered by the ALSA
driver and then handed to jack and finally ardour.

Now, if ardour knew long each of the latencies was it could compensate
for them.  What it would have to do would be put the data being recorded
into the session at a time that is the sum of latencies earlier than the
time it is actually received.  That way it would line up with what you
would have heard while playing.

I have seen an option in ardour which offers to do that, i.e. line up
new material with that which heard while recording it.  To do this
ardour must somehow be able to ask what the latency is and, if the
answer is right, all should line up.

I wonder though, how many times the answer is right as it may take in to
account things known to the driver (like the buffer size it is using)
but perhaps not delays within the sound card itself.

You can probably measure how well this all works.  Play a drum beat so
you can hear it through a speaker, put a mic in front of the speaker at
about the same distance as it would be from your instrument and record
the output of the mic.

There is no human here to be behind the beat.  If the newly recorded
beat lines up with the generated one then the latency is fully
compensated for.  If not you can see how far they are apart and nudge
the new recording to line up.  Once you know how many milliseconds this
is you can nudge any real instrument recordings by the same amount.  If
it is still behind the beat it must be your playing.


More information about the Ardour-Users mailing list