Player APIs (BrightScript & Ja...
...
Object Reference
Networking Objects

roSyncManager

8min
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 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 regsec = createobject("roregistrysection", "networking") regsec write("ptp domain", "0") regsec flush() rebootsystem() the javascript equivalent is bssyncmanager docid\ dqnx2ot2tdkxynmrglncp object creation the rosyncmanager object is created with an associative array representing a set of parameters createobject("rosyncmanager", parameters as roassociativearray) the associative array can have the following parameters domain string string an identifier that is used to distinguish among different rosyncmanager instances within the same synchronization group (i e ptp domain) the default string is "brightsign" this parameter allows multiple rosyncmanager instances to operate at the same time multicastaddress string string the multicast address to which synchronization messages are communicated the default address is "224 0 126 10" multicastport string string 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 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 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 messages over the network this method returns true on success and false on failure the key may be specified as a string or robytearray object 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 messages 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 instance leader int int a flag indicating whether the unit is in leader mode (1) or not (0) ip string string the multicast address to which synchronization messages are communicated port int int the multicast port to which synchronization messages are communicated domain int int the domain identifier used to distinguish among different rosyncmanager instances example the following script synchronizes video playback on the leader and follower units ' 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)