d/rift_s: Reduce camera frame delay to 2

This commit is contained in:
Jan Schmidt 2022-08-17 03:58:52 +10:00
parent 32cc6e05da
commit 942df72c26

View file

@ -201,8 +201,7 @@ rift_s_camera_create(struct xrt_prober *xp,
cam->in_sink.push_frame = receive_cam_frame; cam->in_sink.push_frame = receive_cam_frame;
bool enable_aeg = debug_get_bool_option_rift_s_autoexposure(); bool enable_aeg = debug_get_bool_option_rift_s_autoexposure();
int frame_delay = int frame_delay = 2; // Exposure updates take effect on the 2nd frame after sending
3; // WMR takes about three frames until the cmd changes the image. TODO: Confirm this for Rift S
cam->aeg = u_autoexpgain_create(U_AEG_STRATEGY_TRACKING, enable_aeg, frame_delay); cam->aeg = u_autoexpgain_create(U_AEG_STRATEGY_TRACKING, enable_aeg, frame_delay);
u_sink_debug_init(&cam->debug_sinks[0]); u_sink_debug_init(&cam->debug_sinks[0]);
@ -475,6 +474,7 @@ rift_s_camera_update(struct rift_s_camera *cam, struct os_hid_device *hid)
os_mutex_unlock(&cam->lock); os_mutex_unlock(&cam->lock);
if (need_update) { if (need_update) {
RIFT_S_DEBUG("Updating AEG exposure to %u gain %u", cam->target_exposure, cam->target_gain);
if (rift_s_protocol_send_camera_report(hid, &cam->camera_report) < 0) { if (rift_s_protocol_send_camera_report(hid, &cam->camera_report) < 0) {
RIFT_S_WARN("Failed to update camera settings"); RIFT_S_WARN("Failed to update camera settings");
} }