From 6664588eba0601f580db894619a41d4c83ae7009 Mon Sep 17 00:00:00 2001 From: Caleb Szalacinski Date: Tue, 18 Jun 2019 20:36:43 -0500 Subject: [PATCH] Added a delay quirk to allow the Oculus Rift CV1 to initialize properly. --- src/xrt/drivers/ohmd/oh_device.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/xrt/drivers/ohmd/oh_device.c b/src/xrt/drivers/ohmd/oh_device.c index 653996bd4..8f1e8a6fe 100644 --- a/src/xrt/drivers/ohmd/oh_device.c +++ b/src/xrt/drivers/ohmd/oh_device.c @@ -213,6 +213,7 @@ struct device_info bool video_distortion_vive; bool left_center_pano_scale; bool rotate_screen_right_after; + bool delay_after_initialization; } quirks; }; @@ -265,6 +266,10 @@ get_info(struct oh_device *ohd, const char *prod) info.quirks.video_distortion_none = true; } + if (strcmp(prod, "Rift (CV1)") == 0) { + info.quirks.delay_after_initialization = true; + } + /* * Assumptions made here: @@ -526,6 +531,13 @@ oh_device_create(ohmd_context *ctx, ohd->base.hmd->views[1].rot = u_device_rotation_left; } + if (info.quirks.delay_after_initialization) { + unsigned int time_to_sleep = 1; + do { + time_to_sleep = sleep(time_to_sleep); + } while (time_to_sleep); + } + if (ohd->print_debug) { u_device_dump_config(&ohd->base, __func__, prod); }