1 # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
3 @page dwx_devguide_rec_distrec Distributed Recording
6 This section provides guidance on synchroneously recording data on sensors
7 distributed across multiple NVIDIA DRIVE<sup>™</sup> platforms.
9 The diagram below shows two NVIDIA DRIVE platforms with the recording
10 application, each collecting their own data. For each recorder, data is stored
11 with a timestamp that records the time, in milliseconds. Data between the two
12 NVIDIA DRIVE platforms are sycnronized based on timestamps. Multiple sensors
13 allow for higher accuracy, and the exact timestamps ensure precise
14 synchronization between the devices.
16 
18 Both the @ref dwx_recorder_textui_tool and @ref dwx_gui_recording2_tool
19 can support distributed recording with systems reachable by the network.
20 The front-end instance of these tools launches multiple back-end instances on
21 connected Xaviers and synchronizes them over UNIX pipes.
23 @section dwx_devguide_rec_distrec_basic Basic Steps
25 @subsection dwx_recorder_usecase2_step_1 Step 1: Set up Xavier A & B
27 1. Verify the Sensors Are Collecting Data in @ref dwx_recording_devguide_basic_recording.
28 2. Create a DriveWorks Rig Configuration File for the sensor set.
29 3. Attach eSATA/USB storage.
31 @subsection dwx_devguide_rec_distrec_step2 Step 2: Collect Rig Files
32 On the master Xavier (either A or B), collect rig files for both Xavier A and B,
33 and arrange them in the following directory structure:
39 Where each rig file name contains the IP address of that Xavier.
41 @subsection dwx_devguide_rec_distrec_step3 Step 3: Synchronize and then run
42 1. Synchronize the Xavier clocks as described in Synchronizing system clocks in
44 2. On the master Xavier, start the recording application, specifying the rig corresponding
45 configuration file directory:
47 # tools/recorder-tui <rig_directory>
48 Recording is automatically toggled on Xavier B, when toggled on Xavier A.
50 @section dwx_devguide_rec_distrec_synch Sensor Synchronization
52 NVIDIA DRIVE platforms can record sensor data for various sensor groups on the
53 same Xavier or for various groups on different Xavier processors or NVIDIA DRIVE
54 platforms. The sensor setting in the rig configuration file effects sensor
55 timestamp synchronization. In addition, for recordings on different Xavier
56 processors, other factors affect timestamp synchronization.
58 @subsection dwx_devguide_rec_distrec_sync_same_1 Synchronizing for Distributed Recording
59 By default, the recorder tool does not provide synchronization in a distributed
60 recording setting because PTP is off. But if you synchronize the system clocks
61 with PTP or gPTP, then you can get synchronization within +/- 0.5 frames. If you
62 record when PTP is off, recording timestamps are based on the current Xavier
63 time, which might be not the real time when the recording takes place.
65 Cross-CSI sync is enabled automatically makes all cameras capture at the same time,
66 HW wise. This will enable the external FSYNC feature of the deserializer and allow
67 the Xavier PWM output to drive the camera sync for multiple camera groups
69 #### About synchronization
70 There are two types of synchronization.
71 - Synchronization of system clocks - Ensures that the timestamp from one Xavier
72 is the same time as another Xavier.
74 With PTP or gPTP, you can achieve synchronization of system clocks.
75 - Synchronization of camera frames - Ensures that the time of the capture
76 is the same among multiple cameras.
78 Synchronization of camera frames is not possible. During distributed recording,
79 the Xavier processors control separate deserializers. They are not connected by
80 the same PWM. Even though clocks are synchronized, sensor timing cannot be
81 synchronized. As a result, the actual timing of the image capture cannot be
82 synchronized, meaning that synchronization will be off by at most +/- 0.5
85 #### How gPTP and PTP affect synchronization of system clocks
87 The NVIDIA DRIVE PDK gPTP application provides the NVIDIA DRIVE platform
88 support for 802.1AS conforming time synchronization messages for hardware time
89 synchronization. gPTP is for multi-Xavier use cases (such as distributed
90 recording), which requires time scales of each Xavier to be synchronized with
91 each other. NVIDIA recommends enabling gPTP at all times.
93 #### Synchronizing System Clocks
95 Use either PTP or gPTP to synchronize between one Xavier as master and 3 other
96 Xaviers as slaves. Depending on the execution timing, you should have +/- 0.5
97 frames difference between sensor timestamps when measuring the same camera with
100 If PTP is running, have all peers start/stop recording at a predetermined
101 timestamp value. For guidance on using gPTP, search the
102 _NVIDIA DRIVE OS 5.1 Development Guide_ for `PTP`.
104 @subsection dwx_devguide_rec_distrec_testing Testing Sensor Synchronization
106 You cannot compare the timestamp of the first frame to see if PTP sync worked.
107 Recording does not start synchronously on both Xaviers. Instead, you must
108 correlate images and then compare the timestamps on those images.
110 #### To test sensor synchronization
111 1. Observe with cameras from two Xaviers that are recording the same content,
112 for example a video playing on a monitor.
113 2. Find corresponding frames in both video streams, by comparing the frame content.
114 3. Compare the timestamp of both frames.
115 4. Ensure the timestamps are within +/- 0.5 frames.