dubpixel / ARDUINO_LTC_DECODER

SMPTE/LTC decoder for Teensy 3.2 microcontroller audio shield

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LTC decoder for Teensy

For synchronization between several devices SMPTE timecode data is often encoded into audio using LTC or linear time code.

This repository contains several LTC decoders for different purposes.

  • LTCDecoder contains a PlatformIO Teensy project for the Atom text editor. for a Teensy 3.2 microcontroller with audio shield. The audio shield takes care of the line level audio input. This audio input is then decoded. The decoding is done by libltc. The library runs as is on a Teensy, no modifications are needed. The repository is split up in three parts:
  • etc contains an LTC decoder for PC, use the makefile to build an executable. It also contains some short SMPTE test files
  • doc contains a picture of the hardware needed.
  • LTCInterruptSync contains a simplified LTC decoder for Teensy 3.2 used only to generate an accurate pulse every second at the start of the first frame. It only works for 30fps LTC. It does not decode the full LTC information but only the information needed to generate the sync pulse. It expects a LTC signal on which the Teensy “CHANGE” interrupts reacts: ideally the midpoint is 3.3V/2, the max value about 3.3V and the min value close to zero.

Testing

For testing purposes files can be generated with ltcgen from ltctools (brew install ltc-tools).

ltcgen -f 30 -t 12:13:14:00 -d 2 -s 48000 12_13_14.wav
ffmpeg -i 12_13_14.wav -ac 1 -ar 12000 -f u8 -acodec pcm_u8 12_13_14.raw @dd if=12_13_14.raw of=offset_12_13_14.raw ibs=200 skip=1
xxd -i ../test_files/offset_12_13_14.raw > test_12_13_14.h

License

Since libltc uses LGPL, LGPL is used here as well.

Credits

Developed by Joren Six at IPEM, University Ghent for the ASIL lab of de Krook.

About

SMPTE/LTC decoder for Teensy 3.2 microcontroller audio shield

License:GNU Lesser General Public License v2.1


Languages

Language:C 95.9%Language:C++ 4.0%Language:Makefile 0.1%