We use a modified version of libsoftwaresync to verify sync accuracy by taking pictures on two devices with minimal delay. You can learn more about phase alignment implementation, capture details in libsoftwaresync or in this paper: Wireless Software Synchronization of Multiple Distributed Cameras. Sameer Ansari, Neal Wadhwa, Rahul Garg, Jiawen Chen, ICCP 2019.
- Gyroscope-based time synchronization algorithm is now available as a standalone C++ library! Author: Arthur Chains
- Additionally, the library was integrated into the application instead of the old setup requiring PC server. Author of the integration: Pavel Mokeev
The library is publicly available on Github. This presentation contains more info on the update, as well as some performance tests and details of the implementation.
- We integrated gyroscope-based time synchronization algorithm instead of SNTP to demonstrate sync accuracy. The algoritm requires client and leader smartphone to be rigidly attached together and shaken for a few seconds. After that the recorded gyroscope data is processed and calculated offset is returned to the client smartphone. All the experiments have been carried out using two Samsung S10e smartphones.
For further reference on the twist-n-sync implementation and complete report, see our publication here:
Faizullin M, Kornilova A, Akhmetyanov A, Ferrer G. Twist-n-Sync: Software Clock Synchronization with Microseconds Accuracy Using MEMS-Gyroscopes. Sensors. 2021; 21(1):68.
@article{faizullin,
title={Twist-n-Sync: Software Clock Synchronization with Microseconds Accuracy Using MEMS-Gyroscopes},
author={Faizullin, Marsel and Kornilova, Anastasiia and Akhmetyanov, Azat and Ferrer, Gonzalo},
journal={Sensors},
volume={21},
number={1},
year={2021}
}
Demonstration of gyroscope-based sync accuracy on notebook flipping, shot by two Galaxy S10e smartphones
Experiment with snowballs, photos shot by two Samsung Galaxy S10e smartphones
Footage of experiment with snowballs
- Download Android Studio. When you install it, make sure to also install the Android SDK API 27.
- Click "Open an existing Android Studio project". Select the "CaptureSync" directory.
- There will be a pop-up with the title "Gradle Sync" complaining about a missing file called gradle-wrapper.properties. Click ok to recreate the Gradle wrapper.
- Modify the following values in
Constants.java
:PC_SERVER_IP
- IP of gyro sync server, can be obtained from the script output or with ifconfig,LEADER_IP
- IP of leader smartphone. You can also try changing gyro sampling period inGYRO_PERIOD_US
(value in microseconds) - Change
periodNs
value inres/raw/default_phaseconfig.json
to the image capturing period of your smartphone in nanoseconds. For now, this value should obtained empirically as a mean period between frames. - Plug in your smartphone. You will need to enable USB debugging. See https://developer.android.com/studio/debug/dev-options for further instructions.
- Go to the "Run" menu at the top and click "Run 'app'" to compile and install the app.
Note: By default, the app will likely start in client mode, with no UI options.
- Set up devices on the same WiFi network.
- Start app on devices, use exposure sliders, press the
Start Syncing
button on the leader device. - After that, app shows a dialog asking to rigidly connect devices and shake them during gyroscope recording (recording start and end are marked by beep sounds on leader smartphone). Sync result is displayed shortly after the signal as a Toast on the leader device.
- Then press
Phase Align
button on the leader device. - Press capture button on the leader device to collect captures.
- If JPEG is enabled (default) the user can verify captures by going to the Pictures photo directory on their phone through Google Photos or similar.
- After a capture session, the data from each phone can be pulled to the pc with
adb pull
.