nn::camera::CTR::SynchronizeVsyncTiming Function

Syntax

nn::Result SynchronizeVsyncTiming(
CameraSelect select1,
CameraSelect select2
);

Arguments

Name Description
in select1 Specifies the camera to synchronize.
in select2 Specifies the camera to synchronize.

Return Values

Returns the function's execution result. Returns one of the Result values listed below.
Value Description
ResultSuccess Process was successful.
ResultIsSleeping Unusable because the system is closed.
ResultFatalError There may be something physically wrong with the camera.

Description

Synchronizes the camera V-Sync signal timing. However, this can never perfectly synchronize timing so that there is absolutely no discrepancy.

Note: When the brightness of the two specified camera images differs, the first three frames of image data obtained after this function is called are sometimes extremely bright. In such cases, auto-exposure sometimes takes up to 12 frames to stabilize.

Even if the same framerate and image size are set for the CTR stereo cameras, the left and right cameras send images at slightly different times. This function attempts to synchronize the V-Sync timing between the left and right cameras.

Although this function attempts to synchronize the camera V-Sync timing when it is called, the camera V-Sync timing does not continue to stay synchronized indefinitely. When the V-Sync timing diverges, you must call this function again to reduce the discrepancy. Even after this function is run, there still exists a discrepancy on the order of several hundred microseconds.

The camera V-Sync timing diverges at the following times.

·When the left and right cameras have different image sizes or framerates, their camera V-Sync periods differ and therefore the camera V-Sync timings always diverge even after this function is called.

·When a variable framerate is set, the camera V-Sync period changes depending on the characteristics of the left and right images and therefore the camera V-Sync timings always diverge even after this function is called.

·Even when both the left and right cameras have the same image size and the same fixed framerate, if you call any of the following functions it causes the camera V-Sync timings to diverge. You can call this function again to reduce these discrepancies.

Specify one camera each for the select1 and select2 arguments. Specifically, specify SELECT_OUT1, SELECT_OUT2, or SELECT_IN1. You cannot specify the same camera for both select1 and select2. This function only performs its intended processing if the cameras specified in select1 and select2 are both active.

Note: This function may block for an extended period if a camera is restarting.

Even if you call this function, there will be rare cases where you cannot adjust the V-Sync discrepancy to anything better than several hundred microseconds. To mitigate this problem, you will need to implement a workaround such as comparing the timing of events to get V-Sync signals and the timing of the completion of image transmission, and executing retries if the difference in time is large.

Revision History

2010/12/30
Added an explanation regarding the point that sometimes V-Sync timing cannot be properly adjusted.
2010/09/24
Updated list of functions that cause discrepancies.
2010/08/06
Revised argument names.
2010/07/17
Explained operation during restart.
2010/07/11
Added description that each argument can only specify one camera. Added explanation of behavior when specified cameras are not active.
2010/06/15
Explained the conditions under which camera V-Syncs deviate from each other.
2010/04/13
Initial version.

CONFIDENTIAL