---
title: roSyncManager
slug: develop/rosyncmanager
docTags: 
createdAt: 2025-03-26T17:27:03.001Z
---

This object provides synchronization capabilities for video walls and other deployments that require closely calibrated interaction among players. roSyncManager handles network traffic for leader/follower synchronization. When using sync manager across multiple BrightSign players, PTP must be enabled on the players via their registries which is a separate operation (see the example and corresponding text below). PTP effectively shares a common clock amongst all of the players. If only synchronizing on a single BrightSign player, then PTP isn’t required, as the local BrightSign player clock is common to the objects participating in the synchronization. Multiple synchronization groups are allowed on the same local network and even within the same video wall.

The roSyncManager object currently supports video, image, and scrolling ticker synchronization. The roVideoPlayer and roImagePlayer objects rely on values generated by the ifSyncManager and roSyncManagerEvent methods to synchronize playback, while the roTextWidget object simply requires the domain name of the roSyncManager instance.

As of firmware version 7.0, roSyncManager also supports Genlock synchronization (frame-accurate VSync) over Ethernet. To enable Genlock on an roSyncManager domain, pass the domain name to the roVideoMode.SetSyncDomain() method. Otherwise, the process for synchronizing video, image, and ticker playback is the same.

:::hint{type="info"}
The roSyncManager object supports synchronization over Ethernet networks only.
:::

Before using roSyncManager across multiple BrightSign players you will need to set all of the BrightSign players within the group to the same PTP domain value. To do this, use the roRegistrySection.Write() method to set the `ptp_domain` key of the “networking” section to a value between 0 and 127. In general, changes to the registry only take effect after a reboot, so the PTP synchronization service will start on each player after it is rebooted. Any player with the same value of `ptp_domain` will end up with the same PTP master clock.

**Example**

```none
regSec = CreateObject("roRegistrySection", "networking")
regSec.Write("ptp_domain", "0")
regSec.Flush()
 
RebootSystem()
```

The JavaScript equivalent is [BSSyncManager](docId\:DQNX2ot2TDKXYNmRGLNCP) .

Object Creation: The *roSyncManager&#x20;*&#x6F;bject is created with an associative array representing a set of parameters.

```none
CreateObject("roSyncManager", parameters as roAssociativeArray)
```

The associative array can have the following parameters:

- `Domain` <font color="#6554c0">string</font>: An identifier that is used to distinguish among differen&#x74;*&#x20;roSyncManager&#x20;*&#x69;nstances within the same synchronization group (i.e. PTP domain). The default string is "BrightSign". This parameter allows multiple *roSyncManager&#x20;*&#x69;nstances to operate at the same time.
- `MulticastAddress` <font color="#6554c0">string</font>: The multicast address to which synchronization messages are communicated. The default address is "224.0.126.10".
- `MulticastPort `<font color="#6554c0">string</font>: The multicast port to which synchronization messages are communicated. The default port is "1539". 

## ifMessagePort

**SetPort(port As roMessagePort)**

Posts messages of type *roSyncManagerEvent* to the attached message port. Use these messages to synchronize *roVideoPlayer* and *roImagePlayer* playback.

## ifSyncManager

**SetAsLeader(leader\_mode As Boolean) As Boolean&#xA0;**

Specifies whether the unit is running the leader instance of roSyncManager.

**Synchronize(identifier As String, ms\_delay As Integer) As Object**

Broadcasts a time-stamped message to other players. This method is used on the leader unit only. The message will be rebroadcasted every second to allow follower units that are powered on late to catch up. The network message contains the sync ID, as well as the domain and a timestamp. The timestamp is created at the point when this method is called; however, it can be offset by passing a non-zero ms\_delay value, allowing synchronization points to be set slightly in the future and giving the client enough time to switch video files and perform other actions. The identifier parameter allows the script on the leader unit to pass a filename, or some other useful marker, to the follower units as part of the synchronization message. This method returns the message that is sent out so that the leader can access the timestamp. 

The synchronization message is sent over all available networks (including WiFi), but follower units will use only the first message received. The PTP messages, which are used by the firmware during synchronization, are sent over Ethernet only.

:::hint{type="info"}
Because synchronization can involve follower units seeking to catch up with the playback of a leader unit, we recommend using the more efficient MOV/MP4 container format when synchronizing video files. Transport Stream files (MPEG-TS) are also supported, but they must begin with a presentation timestamp (PTS) of 0. Program Stream files (MPEG-PS) are not supported.
:::

Currently, there are two objects that can accept synchronization parameters: The roVideoPlayer.PlayFile() call accepts the parameters provided by SyncManagerEvent messages, while the roImagePlayer.DisplayFile() and roImagePlayer.PreloadFile() calls accept `SyncIsoTimestamp` in an associative array. To synchronize image playback, an roImagePlayer object will simply delay the transition thread prior to running the transition. If there is a separate call for` DisplayFile()`, then the transition will be cancelled and the image will be displayed immediately (as with non-synchronized `DisplayFile()` calls).

**SetEncryptionEnable(enable As Boolean, key As Dynamic) As Boolean**

Enables or disables encryption of *roSyncManager&#xA0;*&#x6D;essages over the network. This method returns `true` on success and `false` on failure.

The`  key  `may be specified as a string or *roByteArray&#xA0;*&#x6F;bject. Alternatively, a `key` value may not be supplied, in which case a pseudo-randomly generated key is used. Setting `enable` to `false` and supplying a `key` at the same time will cause this method to fail. 

Encryption is available (and enabled by default) in OS8 and later. Note the following behavior in mixed-version environments:

- Follower units that have encryption enabled can ingest unencrypted synchronization messages from a leader unit. Once a follower unit receives encrypted packets, it will no longer accept unencrypted packets from a leader unit, unless encryption is explicitly disabled using this method.
- Follower units that have encryption disabled (or do not support encryption) cannot ingest encrypted messages from a leader unit. Therefore, if a synchronization group includes mixed versions of OS, the leader unit should always have an older version of OS than the follower units.

**SetEncryptionEnableWithObfuscatedKey(obfuscated\_key As String) As Boolean**

Enables encryption of *roSyncManager&#xA0;*&#x6D;essages using an obfuscated key. Contact [support@brightsign.biz](mailto\:support@brightsign.biz) to learn more about generating a key for obfuscation and storing it on the player.

**GetCurrentConfig() As roAssociativeArray**

Returns the current configuration parameters for the *roSyncManager&#xA0;*&#x69;nstance:

- `leader` <font color="#6B21A8">int:</font> A flag indicating whether the unit is in leader mode (1) or not (0)
- `ip` <font color="#6B21A8">string: </font> The multicast address to which synchronization messages are communicated
- `port` <font color="#6B21A8">int: </font>The multicast port to which synchronization messages are communicated
- `domain` <font color="#6B21A8">int</font>: The domain identifier used to distinguish among differen&#x74;*&#xA0;roSyncManager&#xA0;*&#x69;nstances

## Example

The following script synchronizes video playback on the leader and follower units:

```javascript
' Create a sync manager with default address and port.
aa1=CreateObject("roAssociativeArray")
aa1.Domain = "BS1"
s=CreateObject("roSyncManager", aa1)
p=CreateObject("roMessagePort")
s.SetPort(p)

' Create a video player - we're going to play a seamlessly looped file
v=CreateObject("roVideoPlayer")
v.SetLoopMode(True)

' THIS SECTION IS ONLY DONE BY THE LEADER
' We're the leader unit - send out a synchronize event saying that we're starting.
' playback 1000ms from now
s.SetLeaderMode(True)
msg = s.Synchronize("Blah1", 1000)

' THIS SECTION IS ONLY DONE BY THE FOLLOWER
' We're a follower unit, and we're sitting waiting for a sync message.
msg=Wait(4000, p)

' EVERYONE DOES THE REST
aa=CreateObject("roAssociativeArray")
aa.Filename = "Text_1.mov"
aa.SyncDomain = msg.GetDomain()
aa.SyncId = msg.GetId()
aa.SyncIsoTimestamp = msg.GetIsoTimestamp()

v.PlayFile(aa)
```

