1 <?xml version="1.0" standalone="no"?>
3 <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
7 <section id="sn-synchronization_concepts">
8 <title>Synchronization Concepts</title>
10 As soon as you start handling audio on more than one device, it is
11 important to understand and to think about
12 <emphasis>synchronization</emphasis> : how to get the devices to have
13 the same sense of time and speed.
17 However, there are two fundamentally different kinds of synchronization:
20 <section id="sample-clock">
21 <title>Sample Clock</title>
23 As outlined in the <emphasis>introductory concepts</emphasis> section,
24 digital audio is created by taking a "sample" of an analog signal
25 level on a periodic basis, say 48000 times per seconds (the "sample
26 rate"). A dedicated clock (the "sample clock") ((actually, an
27 oscillating crystal, but technology people call such things clocks))
28 "ticks" at that rate, and every time it does, a new sample is
29 measured. The way the clock is used to convert digital audio back to
30 an analog signal (i.e. to be sent to some loudspeakers) is more
31 complex, but the clock is still an absolutely fundamental part of the
36 Whenever you connect two digital audio devices together in order to
37 move audio data from one to the other, you <emphasis>must ensure they
38 share the same sample clock</emphasis> . Why is this necessary? The
39 oscillating crystals used for the sample clock are generally very
40 stable (they always tick at the same speed), but there are always
41 minute differences in the speed that any two clocks tick at. When used
42 by themselves, this makes no difference, but connect two digital audio
43 devices together and these minute differences will eventually
44 accumulate over time. Eventually, one of the devices will be trying to
45 read a sample "in the middle" of the other device's tick, and the
46 result is a small click or pop in the audio stream.
50 <section id="timeline-sync">
51 <title>Timeline Sync</title>
53 The concept of a timeline comes up over and over again when working
54 with a digital audio workstation, and also with video editing systems.
55 By "timeline" we mean nothing more than some way to define a "name"
56 for the point where certain sounds (and/or visual images) occur. When
57 you work in Ardour's editor window, the rulers near the top provide
58 one or more timelines in different units. You can look at the editor
59 window and say "this sound starts at 1 minute 32 seconds" or "this
60 tracks fades out starting at bar 13 beat 22".
64 But what happens when you want to share a timeline between two
65 different devices? For example, you may want to run a hardware video
66 editor in conjunction with ardour, and always have the visual and
67 audio playback be at the same point "in time". How do they each know
68 what "in time" means? How do they know where the other one is? A
69 mechanism for answering these questions provides <emphasis>timeline
70 synchronization</emphasis> .
74 Timeline synchronization is entirely different from sample clock
75 synchronization. Two devices can share a sample clock, but never use
76 timeline information. Two devices can be sharing timeline information,
77 but run on different sample clocks - they might not even have sample
78 clocks if they are analog devices.
82 <section id="word-clock">
83 <title>Word Clock</title>
85 "Word Clock" is the name given to a signal used to distribute the
86 "ticks" of a sample clock to multiple devices. Most digital audio
87 devices that are intended for professional use have a word clock
88 connector and a way to tell the device to use either its internal
89 sample clock (for standalone use), or to use the word clock signal as
90 the sample clock. Because of the electrical characteristics of the
91 signal, it is very important that any length of cable used to
92 distribute word clock is "terminated" with a 75 ohm resistor at both
93 ends. Unfortunately, some devices include this terminator themselves,
94 some contain a switchable resistor and some do not. Worse still, the
95 user manuals for many devices do not provide any information on their
96 termination configuration. It is often necessary to ask the
97 manufacturer in cases where it is not made very obvious from marking
98 near the word clock connectors on the device.
102 <section id="timecode">
103 <title>Timecode</title>
105 "Timecode" is a signal that contains positional or "timeline"
106 information. There are several different kinds of timecode signal, but
107 by far the most important is known as SMPTE. Its name is an acronym
108 for the Society for Motion Picture T?? Engineering, and timecode is
109 just one of the standards they defined, but its the most well known.
110 Because of its origins in the film/video world, SMPTE is very centered
111 on the time units that matter to film/video editors. The base unit is
112 called a "frame" and corresponds to a single still image in a film or
113 video. There are typically on the order of 20-30 frames per second, so
114 the actual resolution of SMPTE timecode is not very good compared to
115 audio-based units where there are tens of thousands of "frames" per
123 SMPTE defines time using a combinations of hours, minutes, seconds,
124 frames and subframes, combined with the frame rate. In a film/video
125 environment, SMPTE is typically stored on the film/video media, and
126 sent from the device used to play it. There are different ways of
127 storing it on the media - you may come across terms like LTR and VTC -
128 but the crucial idea to grasp is that the film/video has a timecode
129 signal "stamped" into it, so that it is always possible to determine
130 "what time it is" when any given image is visible.
134 SMPTE timecode is sent from one system to another as an analog audio
135 signal. You could listen to it if you wanted to, though it sounds like
136 a generally screeching and unpleasant noise. What the SMPTE standard
137 defines is a way to encode and decode the
138 hrs:mins:secs:frames:subframes time into or from this audio signal.
145 The other very common form of timecode is known as "MTC" (MIDI Time
146 Code). However, MTC is actually nothing more than a different way to
147 transmit SMPTE timecode. It uses the exact same units as SMPTE
148 timecode, but rather than send the signal as audio MTC defines a
149 transmission method that uses a MIDI cabable and a data protocol. MTC
150 consumes a measurable, but small, percentage of the available
151 bandwidth on a MIDI cable (on the order of 2-3%). Most of the time, it
152 is wise to use a single cable for MTC and MMC (MIDI Machine Control)
153 and not share it with "musical" MIDI data (the kind that an instrument
154 would send while being played).
158 <section id="jack-transport">
159 <title>JACK Transport</title>
161 For Ardour and other programs that use <emphasis>JACK</emphasis>,
162 there is another method of doing timeline synchronization that is not
163 based on SMPTE or MTC.
167 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
168 href="Some_Subsection.xml" />