SMPTE LTC (Linear Time Code) on Linux and MacOS with ltc-tools and Jack Audio Connection Kit

The following time code generation is based on real time clocks synced with ntp on mac or linux computers using UTC time. Make sure your machine has an internal clock source otherwise the time drift will be too big.

This approach is a very cheap way to get proper time code into cameras. If your device – like my notebook – has a built in microphone you could for example do the same as tentacle sync e and record time code on one and micro input on the other stereo channel of your for example digital camera. Of course syncing devices via ntp isn’t as accurate as syncing explicitly and having extra hardware for time code generation but this way I can use existing hardware instead of buying devices for hundreds of euros that aren’t shippable for weeks or months, cost a fortune and I don’t use very often.

In the following my notes about how to use ltc-tools and jack for time code generation.

First you need to install the dependencies:

brew install jack
brew install ltc-tools

With these in place you first have to start the jack daemon:

jackd --realtime -dcoreaudio

Then connect the time code generator with your desired frame rate

jltcgen -f 25

This now sends time code to jack input. On my system this input is named genltc:ltc. You can display all ports usable in jack via

jack_lsp

On my machine this gives the following output:

system:capture_1
system:playback_1
system:playback_2
genltc:ltc

capture_1 is my mic, playback_1 the left and playback_2 the right speaker.

To connect the time code generator with my left speaker (and immediately disconnect it again because of the annoying sound) the commands are:

# output time code on left and mic on right channel
jack_connect genltc:ltc system:playback_1
jack_connect system:capture_1 system:playback_2

# disconnect it again
jack_disconnect genltc:ltc system:playback_1
jack_disconnect system:capture_1 system:playback_2

If you don’t disconnect it your device should make some weird sound which is the time code. In case you connect the mic like in my sample make sure to use headphones otherwise you will create a feedback loop.