Chapter 25. Configuring Frame Lock and Genlock
Prev | Part I. Installation and Configuration Instructions | Next

## Chapter 25. Configuring Frame Lock and Genlock

NOTE: Frame Lock and Genlock features are supported only on specific hardware, as noted below.

Visual computing applications that involve multiple displays, or even multiple windows within a display, can require special signal processing and application controls in order to function properly. For example, in order to produce quality video recording of animated graphics, the graphics display must be synchronized with the video camera. As another example, applications presented on multiple displays must be synchronized in order to complete the illusion of a larger, virtual canvas.

This synchronization is enabled through the frame lock and genlock capabilities of the NVIDIA driver. This section describes the setup and use of frame lock and genlock.

### Definition of Terms

GENLOCK: Genlock refers to the process of synchronizing the pixel scanning of one or more displays to an external synchronization source. NVIDIA Genlock requires the external signal to be either TTL or composite, such as used for NTSC, PAL, or HDTV. It should be noted that the NVIDIA Genlock implementation is guaranteed only to be frame-synchronized, and not necessarily pixel-synchronized.

FRAME LOCK: Frame Lock involves the use of hardware to synchronize the frames on each display in a connected system. When graphics and video are displayed across multiple monitors, frame locked systems help maintain image continuity to create a virtual canvas. Frame lock is especially critical for stereo viewing, where the left and right fields must be in sync across all displays.

In short, to enable genlock means to sync to an external signal. To enable frame lock means to sync 2 or more display devices to a signal generated internally by the hardware, and to use both means to sync 2 or more display devices to an external signal.

SWAP SYNC: Swap sync refers to the synchronization of buffer swaps of multiple application windows. By means of swap sync, applications running on multiple systems can synchronize the application buffer swaps between all the systems. In order to work across multiple systems, swap sync requires that the systems are frame locked.

QUADRO SYNC DEVICE: A Quadro Sync Device refers to a device capable of Frame lock/Genlock. See "Supported Hardware" below.

### Supported Hardware

Frame lock and genlock are supported for the following hardware:

- Quadro G-Sync, used in conjunction with a Quadro FX 4400, Quadro FX 4500, or Quadro FX 5500

- Quadro G-Sync II, used in conjunction with a Quadro FX 4600, Quadro FX 5600, Quadro FX 4800, Quadro FX 5800, Quadro 5000, or Quadro 6000

- Quadro Sync, used in conjunction with a Quadro K5000

- Quadro Plex 1000 Models I, II and IV, Quadro Plex 2200 D2, or Quadro Plex 7000.

### Hardware Setup

Before you begin, you should check that your hardware has been properly installed. The following steps must be performed while the system is off.

1. On a Quadro Sync card with four Sync connectors, connect a ribbon cable to any of the four connectors, if none are already connected.

   On a Quadro G-Sync or G-Sync II card with two G-Sync connectors, locate the G-Sync connector labeled "primary". If the associated ribbon cable is not already joined to this connector, do so now. If you plan to use frame lock or genlock in conjunction with SLI FrameRendering or Multi-GPU FrameRendering (see Chapter 24, Configuring SLI and Multi-GPU FrameRendering) or other multi-GPU configurations, you should connect the G-Sync connector labeled "secondary" to the second GPU. A section at the end of this appendix describes restrictions on such setups.

2. Install the Quadro Sync card in any available slot. Note that the slot itself is only used for physical mounting, so even a known "bad" slot is acceptable. The slot must be close enough to the graphics card that the ribbon cable can reach.

3. On a Quadro Sync card with four Sync connectors, external power is required. Connect a 6-pin PCIe power cable or a SATA power cable to the card. No external power is required for Quadro G-Sync or Quadro G-Sync II cards with two framelock connectors.

4. Connect the other end of the ribbon cable to the Quadro Sync connector on the graphics card.

   On supported Quadro Kepler cards, the Quadro Sync connector is identical in appearance to the SLI connector. The ribbon cable from the Quadro Sync card should be connected to the connector labeled "SDI | SYNC". If the ribbon cable is connected to the SLI connector, the GPU will not be able to synchronize with the Quadro Sync card.

You may now boot the system and begin the software setup of genlock and/or frame lock. These instructions assume that you have already successfully installed the NVIDIA Accelerated FreeBSD Driver Set. If you have not done so, see Chapter 3, Installing the NVIDIA Driver.

### Configuration with nvidia-settings GUI

Frame lock and genlock are configured through the nvidia-settings utility. See the `nvidia-settings(1)` man page, and the nvidia-settings online help (click the "Help" button in the lower right corner of the interface for per-page help information).

From the nvidia-settings frame lock panel, you may control the addition of Quadro Sync (and display) devices to the frame lock/genlock group, monitor the status of that group, and enable/disable frame lock and genlock.

After the system has booted and X Windows has been started, run nvidia-settings as

        % nvidia-settings

You may wish to start this utility before continuing, as we refer to it frequently in the subsequent discussion.

The setup of genlock and frame lock are described separately. We then describe the use of genlock and frame lock together.

### Genlock Setup

After the system has been booted, connect the external signal to the house sync connector (the BNC connector) on either the graphics card or the Quadro Sync card. There is a status LED next to the connector. A solid red or unlit LED indicates that the hardware cannot detect the timing signal. A green LED indicates that the hardware is detecting a timing signal. An occasional red flash is okay. On a Quadro Sync card with four Sync connectors, a blinking green LED indicates that the server is locked to the house sync. The Quadro Sync device (graphics card or Quadro Sync card) will need to be configured correctly for the signal to be detected.

In the frame lock panel of the nvidia-settings interface, add the X Server that contains the display and Quadro Sync devices that you would like to sync to this external source by clicking the "Add Devices..." button. An X Server is typically specified in the format `system:m`, e.g.:

        mycomputer.domain.com:0

or

        localhost:0

After adding an X Server, rows will appear in the "Quadro Sync Devices" section on the frame lock panel that displays relevant status information about the Quadro Sync devices, GPUs attached to those Quadro Sync devices and the display devices driven by those GPUs. In particular, the Quadro Sync rows will display the server name and Quadro Sync device number along with "Receiving" LED, "Rate", "House" LED, "Port 0"/"Port 1" Images, and "Delay" information. The GPU rows will display the GPU product name information along with the GPU ID for the server. The Display Device rows will show the display device name and device type along with server/client check boxes, refresh rate, "Timing" LED and "Stereo" LED.

Once the Quadro Sync and display devices have been added to the frame lock/genlock group, a Server display device will need to be selected. This is done by selecting the "Server" check box of the desired display device.

If you are using a Quadro Sync card, you must also click the "Use House Sync if Present" check box. To enable synchronization of this Quadro Sync device to the external source, click the "Enable Frame Lock" button. The display device(s) may take a moment to stabilize. If it does not stabilize, you may have selected a synchronization signal that the system cannot support. You should disable synchronization by clicking the "Disable Frame Lock" button and check the external sync signal.

Modifications to genlock settings (e.g., "Use House Sync if Present", "Add Devices...") must be done while synchronization is disabled.

### Frame Lock Setup

Frame Lock is supported across an arbitrary number of Quadro Sync systems, although mixing different generations of Quadro Sync products in the same frame lock group is not supported. Additionally, each system to be included in the frame lock group must be configured with identical mode timings. See Chapter 18, Programming Modes for information on mode timings.

Connect the systems through their RJ45 ports using standard CAT5 patch cables. These ports are located on the frame lock card. Do not connect a frame lock port to an ethernet card or hub. Doing so may permanently damage the hardware. The connections should be made in a daisy-chain fashion: each card has two RJ45 ports, call them 1 and 2. Connect port 1 of system A to port 2 of system B, connect port 1 of system B to port 2 of system C, etc. Note that you will always have two empty ports in your frame lock group.

The ports self-configure as inputs or outputs once frame lock is enabled. Each port has a yellow and a green LED that reflect this state. A flashing yellow LED indicates an output and a flashing green LED indicates an input. On a Quadro G-Sync or Quadro G-Sync II card with two G-Sync connectors, a solid green LED indicates that the port has not yet been configured; on a Quadro Sync card with four Sync connectors, a solid green LED indicates that the port has been configured as an input, but no sync pulse is detected, and a solid yellow LED means the card is configured as an output, but no sync is being transmitted.

In the frame lock panel of the nvidia-settings interface, add the X server that contains the display devices that you would like to include in the frame lock group by clicking the "Add Devices..." button (see the description for adding display devices in the previous section on GENLOCK SETUP. Like the genlock status indicators, the "Port 0" and "Port 1" columns in the table on the frame lock panel contain indicators whose states mirror the states of the physical LEDs on the RJ45 ports. Thus, you may monitor the status of these ports from the software interface.

Any X Server can be added to the frame lock group, provided that

1. The system supporting the X Server is configured to support frame lock and is connected via RJ45 cable to the other systems in the frame lock group.

2. The system driving nvidia-settings can communicate with the X server that is to be included for frame lock. This means that either the server must be listening over TCP and the system's firewall is permissive enough to allow remote X11 display connections, or that you've configured an alternative mechanism such as ssh(1) forwarding between the machines.

   For the case of listening over TCP, verify that the "-nolisten tcp" commandline option was not used when starting the X server. You can find the X server commandline with a command such as

           % ps ax | grep X

   If "-nolisten tcp" is on the X server commandline, consult your FreeBSD distribution documentation for details on how to properly remove this option. For example, distributions configured to use the GDM login manager may need to set "DisallowTCP=false" in the GDM configuration file (e.g., /etc/gdm/custom.conf, /etc/X11/gdm/gdm.conf, or /etc/gdb/gdb.conf; the exact configuration file name and path varies by the distribution). Or, distributions configured to use the KDM login manager may have the line

           ServerArgsLocal=-nolisten tcp

   in their kdm file (e.g., /etc/kde3/kdm/kdmrc). This line can be commented out by prepending with "#".

3. The system driving nvidia-settings can locate and has display privileges on the X server that is to be included for frame lock.

   A system can gain display privileges on a remote system by executing

           % xhost +

   on the remote system. See the xhost(1) man page for details.

Typically, frame lock is controlled through one of the systems that will be included in the frame lock group. While this is not a requirement, note that nvidia-settings will only display the frame lock panel when running on an X server that supports frame lock.

To enable synchronization on these display devices, click the "Enable Frame Lock" button. The screens may take a moment to stabilize. If they do not stabilize, you may have selected mode timings that one or more of the systems cannot support. In this case you should disable synchronization by clicking the "Disable Frame Lock" button and refer to Chapter 18, Programming Modes for information on mode timings.

Modifications to frame lock settings (e.g. "Add/Remove Devices...") must be done while synchronization is disabled.

nvidia-settings will not automatically enable Frame Lock via the nvidia-settings.rc file. To enable Frame Lock when starting the X server, a line such as the following can be added to the `~/.xinitrc` file:

        # nvidia-settings -a [gpu:0]/FrameLockEnable=1

### Frame Lock + Genlock

The use of frame lock and genlock together is a simple extension of the above instructions for using them separately. You should first follow the instructions for Frame Lock Setup, and then to one of the systems that will be included in the frame lock group, attach an external sync source. In order to sync the frame lock group to this single external source, you must select a display device driven by the GPU connected to the Quadro Sync card (On Quadro G-Sync or G-Sync II cards, this display device must be connected to the primary connector) that is connected to the external source to be the signal server for the group. This is done by selecting the check box labeled "Server" of the tree on the frame lock panel in nvidia-settings. If you are using a Quadro Sync based frame lock group, you must also select the "Use House Sync if Present" check box. Enable synchronization by clicking the "Enable Frame Lock" button. As with other frame lock/genlock controls, you must select the signal server while synchronization is disabled.

### GPU Status LEDs on the Quadro Sync Card

In addition to the graphical indicators in the control panel described in the Genlock Setup section above, the Quadro Sync card for Quadro Kepler GPUs has two status LEDs for each of the four ports:

A sync status LED indicates the sync status for each port. An unlit LED indicates that no GPU is connected to the port; a steady amber LED indicates that a GPU is connected, but not synced to any sync source; and a steady green LED indicates that a GPU is connected and in sync with an internal or external sync source. A flashing LED indicates that a connected GPU is in the process of locking to a sync source; flashing green indicates that the sync source's timings are within a reasonable range, and flashing amber indicates that the timings are out of range, and the GPU may be unable to lock to the sync source.

A stereo status LED indicates the stereo sync status for each port. The LED will be lit steady amber when the card first powers on. An unlit LED indicates that stereo is not active, or that no GPU is connected; a blinking green LED indicates that stereo is active, but not locked to the stereo master; and a steady green LED indicates that stereo is active and locked to the stereo master.

### Configuration with nvidia-settings command line

Frame Lock may also be configured through the nvidia-settings command line. This method of configuring Frame Lock may be useful in a scripted environment to automate the setup process. (Note that the examples listed below depend on the actual hardware configuration and as such may not work as-is.)

To properly configure Frame Lock, the following steps should be completed:

1. Make sure Frame Lock Sync is disabled on all GPUs.

2. Make sure all display devices that are to be frame locked have the same refresh rate.

3. Configure which (display/GPU) device should be the master.

4. Configure house sync (if applicable).

5. Configure the slave display devices.

6. Enable frame lock sync on the master GPU.

7. Enable frame lock sync on the slave GPUs.

8. Toggle the test signal on the master GPU (for testing the hardware connectivity.)

For a full list of the nvidia-settings Frame Lock attributes, please see the `nvidia-settings(1)` man page. Examples:

1. 1 System, 1 Frame Lock board, 1 GPU, and 1 display device syncing to the house signal:

         # - Make sure frame lock sync is disabled
         nvidia-settings -a [gpu:0]/FrameLockEnable=0
         nvidia-settings -q [gpu:0]/FrameLockEnable

         # - Query the enabled displays on the gpu
         nvidia-settings -q [gpu:0]/EnabledDisplays

         # - Check that the refresh rate is the one we want
         nvidia-settings -q [gpu:0]/RefreshRate

         # - Set the master display device to CRT-0.  The desired display
         #   device(s) to be set are passed in as a hexadecimal number
         #   in which specific bits denote which display devices to set.
         #   examples:
         #
         #   0x00000001 - CRT-0
         #   0x00000002 - CRT-1
         #   0x00000003 - CRT-0 and CRT-1
         #
         #   0x00000100 - TV-0
         #   0x00000200 - TV-1
         #
         #   0x00020000 - DFP-1
         #
         #   0x00010101 - CRT-0, TV-0 and DFP-0
         #
         #   0x000000FF - All CRTs
         #   0x0000FF00 - All TVs
         #   0x00FF0000 - All DFPs
         #
         #   Note that the following command:
         #
         #     nvidia-settings -q [gpu:0]/EnabledDisplays
         #
         #   will list the available displays on the given GPU.

         nvidia-settings -a [gpu:0]/FrameLockMaster=0x00000001
         nvidia-settings -q [gpu:0]/FrameLockMaster

         # - Enable use of house sync signal
         nvidia-settings -a [framelock:0]/FrameLockUseHouseSync=1

         # - Configure the house sync signal video mode
         nvidia-settings -a [framelock:0]/FrameLockVideoMode=0

         # - Set the slave display device to none (to avoid
         #   having unwanted display devices locked to the
         #   sync signal.)
         nvidia-settings -a [gpu:0]/FrameLockSlaves=0x00000000
         nvidia-settings -q [gpu:0]/FrameLockSlaves

         # - Enable frame lock
         nvidia-settings -a [gpu:0]/FrameLockEnable=1

         # - Toggle the test signal
         nvidia-settings -a [gpu:0]/FrameLockTestSignal=1
         nvidia-settings -a [gpu:0]/FrameLockTestSignal=0

2. 2 Systems, each with 2 GPUs, 1 Frame Lock board and 1 display device per GPU syncing from the first system's first display device:

         # - Make sure frame lock sync is disabled
         nvidia-settings -a myserver:0[gpu:0]/FrameLockEnable=0
         nvidia-settings -a myserver:0[gpu:1]/FrameLockEnable=0
         nvidia-settings -a myslave1:0[gpu:0]/FrameLockEnable=0
         nvidia-settings -a myslave1:0[gpu:1]/FrameLockEnable=0

         # - Query the enabled displays on the GPUs
         nvidia-settings -q myserver:0[gpu:0]/EnabledDisplays
         nvidia-settings -q myserver:0[gpu:1]/EnabledDisplays
         nvidia-settings -q myslave1:0[gpu:0]/EnabledDisplays
         nvidia-settings -q myslave1:0[gpu:1]/EnabledDisplays

         # - Check the refresh rate is the same for all displays
         nvidia-settings -q myserver:0[gpu:0]/RefreshRate
         nvidia-settings -q myserver:0[gpu:1]/RefreshRate
         nvidia-settings -q myslave1:0[gpu:0]/RefreshRate
         nvidia-settings -q myslave1:0[gpu:1]/RefreshRate

         # - Make sure the display device we want as master is masterable
         nvidia-settings -q myserver:0[gpu:0]/FrameLockMasterable

         # - Set the master display device (CRT-0)
         nvidia-settings -a myserver:0[gpu:0]/FrameLockMaster=0x00000001

         # - Disable the house sync signal on the master device
         nvidia-settings -a myserver:0[framelock:0]/FrameLockUseHouseSync=0

         # - Set the slave display devices
         nvidia-settings -a myserver:0[gpu:1]/FrameLockSlaves=0x00000001
         nvidia-settings -a myslave1:0[gpu:0]/FrameLockSlaves=0x00000001
         nvidia-settings -a myslave1:0[gpu:1]/FrameLockSlaves=0x00000001

         # - Enable frame lock on server
         nvidia-settings -a myserver:0[gpu:0]/FrameLockEnable=1

         # - Enable frame lock on slave devices
         nvidia-settings -a myserver:0[gpu:1]/FrameLockEnable=1
         nvidia-settings -a myslave1:0[gpu:0]/FrameLockEnable=1
         nvidia-settings -a myslave1:0[gpu:1]/FrameLockEnable=1

         # - Toggle the test signal
         nvidia-settings -a myserver:0[gpu:0]/FrameLockTestSignal=1
         nvidia-settings -a myserver:0[gpu:0]/FrameLockTestSignal=0

3. 1 System, 4 GPUs, 2 Frame Lock boards and 2 display devices per GPU syncing from the first GPU's display device:

         # - Make sure frame lock sync is disabled
         nvidia-settings -a [gpu:0]/FrameLockEnable=0
         nvidia-settings -a [gpu:1]/FrameLockEnable=0
         nvidia-settings -a [gpu:2]/FrameLockEnable=0
         nvidia-settings -a [gpu:3]/FrameLockEnable=0

         # - Query the enabled displays on the GPUs
         nvidia-settings -q [gpu:0]/EnabledDisplays
         nvidia-settings -q [gpu:1]/EnabledDisplays
         nvidia-settings -q [gpu:2]/EnabledDisplays
         nvidia-settings -q [gpu:3]/EnabledDisplays

         # - Check the refresh rate is the same for all displays
         nvidia-settings -q [gpu:0]/RefreshRate
         nvidia-settings -q [gpu:1]/RefreshRate
         nvidia-settings -q [gpu:2]/RefreshRate
         nvidia-settings -q [gpu:3]/RefreshRate

         # - Make sure the display device we want as master is masterable
         nvidia-settings -q myserver:0[gpu:0]/FrameLockMasterable

         # - Set the master display device (CRT-0)
         nvidia-settings -a [gpu:0]/FrameLockMaster=0x00000001

         # - Disable the house sync signal on the master device
         nvidia-settings -a [framelock:0]/FrameLockUseHouseSync=0

         # - Set the slave display devices
         nvidia-settings -a [gpu:0]/FrameLockSlaves=0x00000002 # CRT-1
         nvidia-settings -a [gpu:1]/FrameLockSlaves=0x00000003 # CRT-0 and CRT-1
         nvidia-settings -a [gpu:2]/FrameLockSlaves=0x00000003 # CRT-0 and CRT-1
         nvidia-settings -a [gpu:3]/FrameLockSlaves=0x00000003 # CRT-0 and CRT-1

         # - Enable frame lock on master GPU
         nvidia-settings -a [gpu:0]/FrameLockEnable=1

         # - Enable frame lock on slave devices
         nvidia-settings -a [gpu:1]/FrameLockEnable=1
         nvidia-settings -a [gpu:2]/FrameLockEnable=1
         nvidia-settings -a [gpu:3]/FrameLockEnable=1

         # - Toggle the test signal
         nvidia-settings -a [gpu:0]/FrameLockTestSignal=1
         nvidia-settings -a [gpu:0]/FrameLockTestSignal=0

### Leveraging Frame Lock/Genlock in OpenGL

With the GLX_NV_swap_group extension, OpenGL applications can be implemented to join a group of applications within a system for local swap sync, and bind the group to a barrier for swap sync across a frame lock group. A universal frame counter is also provided to promote synchronization across applications.

### Frame Lock Restrictions:

The following restrictions must be met for enabling frame lock:

1. All display devices set as client in a frame lock group must have the same mode timings as the server (master) display device. If a House Sync signal is used (instead of internal timings), all client display devices must be set to have the same refresh rate as the incoming house sync signal.

2. All X Screens (driving the selected client/server display devices) must have the same stereo setting. See Appendix B, X Config Options for instructions on how to set the stereo X option.

3. The frame lock server (master) display device must be on a GPU on the primary connector connected to a Quadro G-Sync or G-Sync II device. This restriction does not apply to Quadro Sync devices with four Sync connectors.

4. If connecting a single GPU to a Quadro G-Sync or G-Sync II device, the primary connector must be used. On a Quadro Sync device with four Sync connectors, any connector may be used.

5. In configurations with more than one display device per GPU, we recommend enabling frame lock on all display devices on those GPUs.

6. Virtual terminal switching or mode switching will disable frame lock on the display device. Note that the glXQueryFrameCountNV entry point (provided by the GLX_NV_swap_group extension) will only provide incrementing numbers while frame lock is enabled. Therefore, applications that use glXQueryFrameCountNV to control animation will appear to stop animating while frame lock is disabled.

### Supported Frame Lock Configurations:

The following configurations are currently supported:

1. Basic Frame Lock: Single GPU, Single X Screen, Single Display Device with or without OpenGL applications that make use of Quad-Buffered Stereo and/or the GLX_NV_swap_group extension.

2. Frame Lock + TwinView: Single GPU, Single X Screen, Multiple Display Devices with or without OpenGL applications that make use of Quad-Buffered Stereo and/or the GLX_NV_swap_group extension.

3. Frame Lock + Xinerama: 1 or more GPU(s), Multiple X Screens, Multiple Display Devices with or without OpenGL applications that make use of Quad-Buffered Stereo and/or the GLX_NV_swap_group extension.

4. Frame Lock + TwinView + Xinerama: 1 or more GPU(s), Multiple X Screens, Multiple Display Devices with or without OpenGL applications that make use of Quad-Buffered Stereo and/or the GLX_NV_swap_group extension.

5. Frame Lock + SLI SFR, AFR, or AA: 2 GPUs, Single X Screen, Single Display Device with either OpenGL applications that make use of Quad-Buffered Stereo or the GLX_NV_swap_group extension. Note that for Frame Lock + SLI Frame Rendering applications that make use of both Quad-Buffered Stereo and the GLX_NV_swap_group extension are not supported. Note that only 2-GPU SLI configurations are currently supported.

6. Frame Lock + Multi-GPU SFR, AFR, or AA: 2 GPUs, Single X Screen, Single Display Device with either OpenGL applications that make use of Quad-Buffered Stereo or the GLX_NV_swap_group extension. Note that for Frame Lock + Multi-GPU Frame Rendering applications that make use of both Quad-Buffered Stereo and the GLX_NV_swap_group extension are not supported.

Prev | Up | Next
Chapter 24. Configuring SLI and Multi-GPU FrameRendering | Home | Chapter 26. Configuring SDI Video Output