Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| blocks:app-note:ltc_timecode [2025-04-25 08:40] – [Connect a Blocks timeline to sync with timecode] mattias | blocks:app-note:ltc_timecode [2026-10-06 13:55] (current) – admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ======LTC timecode as sync source====== | ======LTC timecode as sync source====== | ||
| - | This application note describes | + | This application note describes |
| {{: | {{: | ||
| - | I refer to the analog input on the Blocks server | + | A separate program is used to receive |
| - | ====Setup the timecode reader software==== | + | There are other alternative that sometimes may be more suitable, such as the one made by joananton@joananton.com you can [[https:// |
| - | Plug in the USB audio device to the blocks | + | |
| - | Use a second computer to play [[https:// | + | ====Configuring |
| - | Plug an 3.5mm audio cable between the computers | + | Connect |
| + | |||
| + | ===Find the ALSA Name of the Sound Device=== | ||
| + | You must determine the the operating system' | ||
| + | |||
| + | < | ||
| - | ===Find out the ALSA name of the sound device=== | ||
| - | To capture the desired device we must figure out the ALSA name of the usb-device. To do so we open the terminal as the pixi-server user and type: | ||
| - | < | ||
| Look for an entry like: | Look for an entry like: | ||
| - | < | + | < |
| + | plughw: | ||
| USB PnP Sound Device, USB Audio | USB PnP Sound Device, USB Audio | ||
| Hardware device with all software conversions | Hardware device with all software conversions | ||
| </ | </ | ||
| - | The ALSA name is | + | The name to use then is |
| < | < | ||
| - | If you have more than one USB audio device one can expect the next one to be named: | + | If you have more than one USB audio device one can expect the next audio device |
| < | < | ||
| and so on. | and so on. | ||
| + | ===Echo Test=== | ||
| + | To test if the signal can be received, connect some headphones to the USB card output and make an Echo test: | ||
| - | ===Echo test=== | ||
| - | To test if we get any signal one can now plug in headphones in the USB card output and make an Echo test: | ||
| < | < | ||
| - | You should hear the incoming timecode in the headphones. | + | |
| + | Make sure to use the name determined above. | ||
| Stop the echo test by hitting ctrl+c. | Stop the echo test by hitting ctrl+c. | ||
| - | ===Test | + | ===Test the LTC Timecode Reader Program=== |
| - | Now we can dryrun also the LTC reader | + | Test the timecode-reader |
| - | Change | + | First change |
| < | < | ||
| Run the program using the -d parameter to specify device and -t parameter to run in test mode. | Run the program using the -d parameter to specify device and -t parameter to run in test mode. | ||
| + | |||
| < | < | ||
| We should see the time changing as the time source progress in the console output: | We should see the time changing as the time source progress in the console output: | ||
| + | |||
| < | < | ||
| 01:57.11 signal, dbFS: -0.6 | 01:57.11 signal, dbFS: -0.6 | ||
| </ | </ | ||
| - | In test mode we may also see some error logging while reading the signal, this is normal. | + | In test mode we may also see some error logging while reading the signal. |
| < | < | ||
| Minor error ignored. 92926 contiguous with lastReceived 92925</ | Minor error ignored. 92926 contiguous with lastReceived 92925</ | ||
| - | ====Use | + | Adjust |
| - | There are a few steps to do before we can make use of the incoming analog timesource in blocks. | + | |
| + | ====Using Timecode in Blocks==== | ||
| + | A few additional steps are required to make use of the timecode in blocks. | ||
| - | ===Enable the driver=== | + | ===Enable the Driver=== |
| The driver to handle the timedata from the LTC-reader software is not enabled by default. | The driver to handle the timedata from the LTC-reader software is not enabled by default. | ||
| - | To make a driver | + | To enable the driver, first must make sure the driver files exist in the script/ |
| Change to the script directory: | Change to the script directory: | ||
| - | < | + | < |
| - | Move the driver | + | Move the following |
| - | < | + | |
| - | Restart the blocks server: | + | < |
| - | < | + | mv driver-archive/ |
| + | mv driver-archive/ | ||
| + | </ | ||
| + | |||
| + | Restart the blocks server | ||
| + | |||
| + | < | ||
| + | |||
| + | The driver is now available for use. | ||
| + | |||
| + | ===Add the Network Device=== | ||
| - | The driver is now available | + | Under the Manage/ |
| - | ===Setup | + | The port is predefined in the driver |
| - | Under the page Manage/ | ||
| - | The ports is predefined in the driver to match the default configuration to the Timecode reader on the server. | ||
| {{: | {{: | ||
| - | ===Connect a Blocks timeline to sync with timecode=== | + | ===Configure the Driver=== |
| - | Create a timeline block, it can be left empty for testing purposes. | + | Configure the driver with the expected timecode type. This can be done with either of the following methods: |
| - | Set the timeline to use External synchronization in the timeline settings. Select your LTCTimecode device as sync source property. | + | |
| - | {{:blocks: | + | |
| - | Apply any time offset as required. This timeline is now controlled by the timecode. | + | A. Set the ' |
| + | This can be done using a Task triggered on system start-up or the ' | ||
| + | {{: | ||
| + | |||
| + | B. Set options using JSON data in the " | ||
| + | {{: | ||
| - | ====Make the Timecode | + | ===Synchronize a Timeline to the Timecode=== |
| - | To make the timecode reader autostart we must perform | + | Add a Timeline block. Set it to use " |
| - | Change to the users unit files directory: | + | {{: |
| + | |||
| + | Apply a time offset, if required. This timeline is now controlled by the timecode. | ||
| + | |||
| + | ====Autostarting the Timecode Reader==== | ||
| + | |||
| + | To make the timecode reader start automatically with the computer, you must perform a few more steps. The Blocks server (based on a recent Linux server image) comes with a " | ||
| + | |||
| < | < | ||
| - | Edit the timecode-reader.service.config file. | + | Edit the timecode-reader.service.config file using the //nano// text editor: |
| < | < | ||
| + | |||
| Edit the TIMECODE_READER_OPTIONS= line to make the software use the wanted device name. | Edit the TIMECODE_READER_OPTIONS= line to make the software use the wanted device name. | ||
| In my case I set it to: | In my case I set it to: | ||
| Line 98: | Line 126: | ||
| < | < | ||
| - | Next step is to enable | + | Save the file using Ctrl-O then exit the //nano// editor using Ctrl-X. |
| - | < | + | Inform Linux that you've canged the configuration file: |
| - | ====Make multiple Timecode readers autostart==== | + | < |
| + | Finally, enable the service to start at computer startup. | ||
| - | If we want to read more than one LTC timesource we would typically need to duplicate and change the unit files in order to be able to do so. | + | < |
| - | We can rewrite the example unit file into a unit template to do this. | + | ====Using Multiple Timecode Readers on One Computer==== |
| - | Rename the unit file like this: | + | :!: **IMPORTANT: |
| - | < | + | |
| - | Edit the unit template. | + | < |
| + | To read more than one LTC timecode source you could duplicate and modify the unit file, thus creating a separate unit file for this purpose. However, a better solution is to modify the unit file to a //unit template//, as this keeps all the common stuff in one place. Follow this procudure to use that option. | ||
| + | |||
| + | **1.** Rename the unit file like this: | ||
| + | < | ||
| + | |||
| + | **2.** Edit the unit template. | ||
| < | < | ||
| - | Use this config: | + | Using this configuration: |
| < | < | ||
| [unit] | [unit] | ||
| Line 132: | Line 166: | ||
| </ | </ | ||
| - | Rename the config: | + | **3.** |
| < | < | ||
| - | Make as many copies as you want instances: | + | **4.** |
| < | < | ||
| + | **5.** Edit the config files, specifying different audio interfaces and different network ports in each instance. | ||
| + | < | ||
| - | Edit the config files as in the single instance case above. Make sure to specify a different udp port on all the subsequent instances. | + | The configuraition file will look something like this (but with your device name and desired |
| - | < | + | |
| < | < | ||
| # Options to pass to the timecode-reader program, e.g., | # Options to pass to the timecode-reader program, e.g., | ||
| - | # TIMECODE_READER_OPTIONS=-d "Alsa device name"§ -p "UDP port" | + | # TIMECODE_READER_OPTIONS=-d "Alsa device name" -p "UDP port" |
| - | TIMECODE_READER_OPTIONS=-d plughw: | + | TIMECODE_READER_OPTIONS=-d plughw: |
| </ | </ | ||
| - | Efter any unit change make sure to reinitizialize | + | **6.** Notify |
| < | < | ||
| - | systemctl --user daemon-reexec | ||
| systemctl --user daemon-reload </ | systemctl --user daemon-reload </ | ||
| - | Enable (autostart) | + | **7.** Finally, enable |
| < | < | ||
| systemctl --user enable --now timecode-reader@alpha.service | systemctl --user enable --now timecode-reader@alpha.service | ||
| systemctl --user enable --now timecode-reader@beta.service | systemctl --user enable --now timecode-reader@beta.service | ||
| </ | </ | ||