Commit graph

2213 commits

Author SHA1 Message Date
Lubosz Sarnecki 9a9d46b85a comp/vk: Lock our only VkQueue with a mutex.
This resolved mutlithreading issues as seen in the `multithreading` test
of the OpenXR CTS.

This patch fixes the test on Vulkan Android and resolves Vulkan
validation errors when running on Linux with OpenGL.
2021-01-13 12:33:15 +01:00
Lubosz Sarnecki fd58ccecc9 drv/android: Fill in xrt_device str. 2021-01-13 12:33:15 +01:00
Moses Turner a1ed0b293c d/rs: predict pose
d/rs: predict pose
2021-01-12 17:15:40 -06:00
Moses Turner baf0e1acfb d/rs: apply offset to t265 pose, d/ns: fix up some minor things, load realsense offset from json file 2021-01-12 15:28:18 -06:00
Moses Turner fc47d0baad d/ns: fix polynomial distortion math again, document nonsensical parts of polynomial math, update config files 2021-01-12 15:28:18 -06:00
Moses Turner 684daa3293 d/ns: possibly fix mesh calculation
also fix flipped tracking tracking
2021-01-12 13:01:37 -06:00
Moses Turner 365692e9ca d/ns: Hopefully make v2 driver read ipd from baseline in v2 config files 2021-01-12 13:01:37 -06:00
Moses Turner 735d9654ec d/ns: apply right eye fov correctly 2021-01-12 13:01:37 -06:00
Christoph Haag 637b5658da d/survive: Predict poses for requested time 2021-01-11 23:50:01 +00:00
Christoph Haag e785053c0a aux/math: special case delta_s == 0 in m_predic
Rather than asserting in the underlying math functions we return the
trivial values for prediction with 0s.
2021-01-11 23:50:01 +00:00
Jakob Bornecrantz 1e4a540bb9 aux/math: Add prediction module
For the time being all angular velocities are relative to the space a xrt_space_relation is in.
2021-01-11 23:50:01 +00:00
Jakob Bornecrantz 271e2b0275 st/oxr: Remove dynamic prediction code 2021-01-11 23:50:01 +00:00
Jakob Bornecrantz 079f3769d4 st/oxr: Convert the given at_time when asking for relations from devices 2021-01-11 23:50:01 +00:00
Jakob Bornecrantz fdd87a0239 d/rs: Save a lot more data from the latest pose 2021-01-11 23:50:01 +00:00
Christoph Haag 729f726135 steamvr: Request hmd pose at current time instead of 1 2021-01-11 23:50:01 +00:00
Christoph Haag 8f3816a5fc u_time: Make time_s_to_ns take double, not floa 2021-01-11 23:50:01 +00:00
Jakob Bornecrantz eea8036e91 c/client: Ensure that EGL_ANDROID_native_fence_sync 2021-01-11 16:50:02 +00:00
Christoph Haag 7a030e36ae build/meson: Build and run tests
closes #97
2021-01-07 22:15:08 +01:00
Christoph Haag 726c752db2 comp: Add support for list of optional device extensions
If one of the supplied optional extensions is VK_GOOGLE_display_timing and it is
supported by the driver, vk_bundle::has_GOOGLE_display_timing will be set to true.
2021-01-07 19:12:41 +01:00
Christoph Haag 4d652fef5a st/oxr: Implement XR_KHR_vulkan_enable2 2021-01-06 13:40:59 +00:00
Christoph Haag 3e4f9d5b6f external: Update OpenXR includes to 1.0.13 2021-01-06 13:40:59 +00:00
Christoph Haag f8a4f35572 oxr: Add XR_KHR_vulkan_enable2 to ext generator script 2021-01-06 13:40:59 +00:00
Christoph Haag 3085e29c97 u/hand_tracking: Curl fingers based on joint, increase total curl angle
When making a fist, different joints curl at different angles, reflect
this more directly in the code.

Also increase total curl to make it easier to hold ingame objects.
2021-01-06 13:34:31 +00:00
Christoph Haag 679a1233ee d/ht: Set up tracking origin with no offset 2021-01-06 13:29:36 +00:00
Christoph Haag e2c1bc1d16 xrt: Rename hand_origin to hand_pose
hand_origin is confusing because it implies it is the origin of the coordinate system the hand is in.
It actually is the hand pose in the "global" coordinate system.
2021-01-06 13:29:36 +00:00
Christoph Haag c84dbad03e u/device: Add U_DEVICE_ALLOC_NO_FLAGS
Allows using U_DEVICE_ALLOCATE without flags without a cast.
2021-01-06 13:29:36 +00:00
Christoph Haag d85224e7c3 d/ht: Don't create hand tracking driver without successful init
Fixes a crash when no calibrated camera is found.
2021-01-06 13:29:36 +00:00
Christoph Haag 7831e38c02 u/device: Assign left/right hand trackers if no controllers are available
Previously the left/right role assignment considered only device types
* XRT_DEVICE_TYPE_LEFT_HAND_CONTROLLER
* XRT_DEVICE_TYPE_RIGHT_HAND_CONTROLLER
* XRT_DEVICE_TYPE_ANY_HAND_CONTROLLER

This adds XRT_DEVICE_TYPE_HAND_TRACKER for consideration, but only if none
of the above are present.
2021-01-06 13:29:36 +00:00
Christoph Haag 6d7dff360c d/psmv: Scale rumble value on zcm1
The motor on my psmv controller does not rumble at amplitudes < 0.25.
2021-01-06 13:23:28 +00:00
Christoph Haag 3848d2be3f st/oxr: Add env vars for global tracking origin offset
This commit is a band aid until a more proper room setup is implemented.
It allows moving the tracking offset for the device roles head, left and right by a fixed value.

A y tracking offset OXR_TRACKING_ORIGIN_OFFSET_Y=1.0 would tell monado that the current tracking
origin is 1 meter above the desired tracking origin, e.g. when the headset was calibrated to a
(0,0,0) position while sitting on table 1 meter above the floor.

This environment variable affects STAGE space, but not LOCAL space.
2021-01-06 13:03:47 +00:00
Jae Lee a71de192e0 illixr: Add initial integration. 2020-12-29 23:44:57 +00:00
Jakob Bornecrantz 15320d9ebe c/client: Insert fence and give sync handle on layer_commit (EGL for now only) 2020-12-28 15:22:46 +00:00
Jakob Bornecrantz 32c9cb1bf3 c/main: Make sure to close sync handles on layer_commit 2020-12-28 15:22:06 +00:00
Jakob Bornecrantz c191c9a466 ipc: Support sending sync handles on layer_commit 2020-12-28 15:22:06 +00:00
Jakob Bornecrantz 84d4b6aaae ipc/shared: Support sending graphics sync handles 2020-12-28 15:22:06 +00:00
Jakob Bornecrantz 1302b07d68 xrt: Add sync_handle argument to layer_commit 2020-12-28 15:22:06 +00:00
Jakob Bornecrantz 8e5f952d55 external: Update EGL bindings and more extensions 2020-12-28 15:22:06 +00:00
Jakob Bornecrantz e67ef85c0c t/ctl: Tidy printing 2020-12-28 14:21:03 +00:00
Lubosz Sarnecki 1038145ffd ipc: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 4acab28f3f c/client: Port printfs to static u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 34563276e8 targets/openxr/sdl2_hack: Port to static u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 12a3a24315 st/gui+steamvr_drv: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 521daac012 st/oxr: Port to u_logging.
Remove foo print.
Use correct ENV variable XRT_COMPOSITOR_LOG for Vulkan log.
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki a8b01a89f3 st/prober: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 55d6d57392 aux/math: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki ba1d966f9f aux/vk: Port to u_logging.
Fix log calls where no valid state struct was provided.
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 58ecf67515 aux/tracking: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki e350e42ca9 aux/os/ble_dbus: Use printf padding. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 79dde59f7e aux/os/ble_dbus: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 853458ed37 xrt: Port commented printfs to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 0302a47e6f d/realsense: Port to static u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 8ce0f73585 d/vive/conteroller: Porting to static u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 0708863e55 d/ohmd: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki e0b2c4ad2e d/ohmd: Make env variables consistent with driver name. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 2dbb6a6bb8 d/daydream: Port to u_logging.
Port static printfs to u_logging.
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 1ba7d803a0 d/hydra: Port to u_logging.
Port printfs to static u_logging.
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 00b2778504 d/arduino: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 6a2221115d d/ns: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki a9703f6b39 d/survive: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 2be5e32b67 d/v4l2: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki e6b2c1f2c7 d/vf: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 1f85d1c2ba d/hdk: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki abad99b956 service: Use new u_logging ENV variable for compositor. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki adcd0aff1a u/logging: Implement global log level.
Adds a `XRT_LOG` environemnt option.

Example:
```
XRT_LOG=debug
```
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 8bdff9a61a u/logging: Implement optional color logging.
Check if stderr is a tty.
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 9ce9fa9238 u/logging: Align log level prefixes. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki b1c700a500 d/survive: Ignore -Wignored-qualifiers in survive header. 2020-12-28 13:04:11 +00:00
Boris-Chengbiao Zhou 98ef9a8ef7 comp: Fix Wayland backend 2020-12-28 04:13:22 +01:00
Christoph Haag 31c4c14042 steamvr: Make serial unique by appending xrt_hand
Monado gives both Playstation Move controllers the same xrt device name.

fixes #109
2020-12-25 22:56:54 +01:00
Christoph Haag d5183336b3 d/ohmd: Add display left rotation for Oculus Rift DK2 2020-12-23 11:51:51 +01:00
Lubosz Sarnecki d55c2b016a d/vf: Use static logging if no object is provided.
Found by clang11 warning.
2020-12-16 15:10:10 +01:00
Lubosz Sarnecki 9351673e55 st/steamvr_drv: Silence unfixable OpenVR cpp warnings. 2020-12-16 15:10:10 +01:00
Lubosz Sarnecki d0262c8613 c/comp: Fix switch fall through warning in gcc10. 2020-12-16 15:07:28 +01:00
Lubosz Sarnecki c03decd4d9 d/ht: Remove unused variable. Fixes warning on gcc 10. 2020-12-16 15:02:46 +01:00
Jakob Bornecrantz c30c4c011d c/main: Silence warnings and make sure that layer configs are picked up 2020-12-15 14:27:31 +00:00
Lubosz Sarnecki 200fb5aeed c/layers: Don't build equirect code if not enabled. 2020-12-14 18:59:28 +00:00
Lubosz Sarnecki 4995854d06 c/layers: Implement equirect1 rendering.
Add equirect1 boilerplate, shader files, ubo and pipeline.
2020-12-14 18:59:28 +00:00
Lubosz Sarnecki dc45a201db c+ipc+st: Complete equirect1 boilerplate. 2020-12-14 18:59:28 +00:00
Lubosz Sarnecki c8bdfae83e src: Consistently append 1 to equirect1 code.
Rename XRT_FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY to XRT_FEATURE_OPENXR_LAYER_EQUIRECT1.
Use correct define in verify_equirect1_layer function.
Rename equirect to equirect1.
meson: enable equirect1 by default.
2020-12-14 18:59:28 +00:00
Lubosz Sarnecki f334b8b6c7 src: Consistently append 2 to equirect2 code.
Rename XRT_FEATURE_OPENXR_LAYER_EQUIRECT to XRT_FEATURE_OPENXR_LAYER_EQUIRECT2.
Rename equirect to equirect2.
Rename shader files.
2020-12-14 18:59:28 +00:00
Christoph Haag b2337469a4 st/prober: Make video file input work with no camera connected 2020-12-14 18:55:15 +00:00
Christoph Haag 30d7001df1 ipc: Make OXR_DEBUG_GUI=1 work with monado-service 2020-12-14 18:53:07 +00:00
Christoph Haag 49202eda87 d/psvr: Make get_tracked_pose thread safe 2020-12-14 02:00:09 +01:00
Christoph Haag ada506513f comp: Add XRT_COMPOSITOR_DEFAULT_FRAMERATE variable, default to 60
This variable only has an effect if
* The compositor is not run in direct mode (which uses the actual refresh interval of the chosen mode)
* The HMD driver does not default to a refresh ate by settting hmd->screens[0].nominal_frame_interval_ns
2020-12-10 16:36:22 +01:00
Christoph Haag 99e8416cac comp: Hook up xcb fullscreen and display settings to variables 2020-12-10 16:33:38 +01:00
Christoph Haag 199536c575 comp: Default xcb window to VK_PRESENT_MODE_IMMEDIATE_KHR
VK_PRESENT_MODE_FIFO_KHR leads to unsteady 60 fps.
2020-12-10 16:33:34 +01:00
Jakob Bornecrantz 39186a1e1e ipc/server: Rename ipc_server_client.c to ipc_server_handler.c 2020-12-09 21:03:50 +00:00
Jakob Bornecrantz 4b74d6b7eb ipc/server: Remove (f)printf usage from code 2020-12-09 21:03:50 +00:00
Jakob Bornecrantz 1154e58d06 ipc/server: Refactor out per_client_thread 2020-12-09 21:03:50 +00:00
Jakob Bornecrantz 743c289be5 xrt: Code style 2020-12-09 21:03:50 +00:00
Jakob Bornecrantz a5bf14502c t/hand: Remove per frame printing 2020-12-09 21:03:50 +00:00
Christoph Haag 7b4ac89a8f t/hand: warn when rectification matrix doesn't match image matrix 2020-12-07 12:30:26 +00:00
Christoph Haag 693cd77ca3 t/hand: Add comment that rectification is expensive 2020-12-07 12:30:26 +00:00
Christoph Haag f0d21c1dcc d/vf: Add video file playback driver 2020-12-07 12:30:26 +00:00
Christoph Haag e480352cee t/hand: Add hand tracking module 2020-12-07 12:30:26 +00:00
Christoph Haag 717d3a27ef d/ht: Add hand tracking driver code skeleton 2020-12-07 12:30:26 +00:00
Christoph Haag f7a8e8810b xrt: Split hand tracking input name into left/right
oxr_hand_tracker now stores which xdev and input name it tracks.
2020-12-07 11:43:51 +00:00
Ryan Pavlik 61c36f5a52 t/oxr: Export the right symbol on Windows. 2020-12-06 23:07:05 +00:00
Ryan Pavlik ee755961fc comp: Guard more of the caps-detector with an ifdef. 2020-12-06 23:07:05 +00:00
Ryan Pavlik 8b4e3aafa5 comp: Remove unused macro 2020-12-06 23:07:05 +00:00
Ryan Pavlik 535f20b503 inc/xrt: Reference the Vulkan extension table from related data. 2020-12-06 23:07:05 +00:00
Ryan Pavlik 5ea9fe04a3 comp: Add comments near Vulkan extension lists about updating docs. 2020-12-06 23:07:05 +00:00
Ryan Pavlik 90e307bf8a util: Port logging to OutputDebugString on Windows 2020-12-06 23:07:05 +00:00
Ryan Pavlik 0cb64ce5bd comp/main: Windows work - got a window to appear! 2020-12-06 23:07:05 +00:00
Ryan Pavlik 2743790180 comp/main: Remove *nix-only include 2020-12-06 23:07:05 +00:00
Lubosz Sarnecki 049bc385b1 xrt: Remove unused XRT_DEVICE_ANDROID. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki cf2fe0e2c3 d/android: Use XRT_DEVICE_GENERIC_HMD device name. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki a3e5daaa18 android/service_taget: Store native window pointer as global. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 5a2ff41c7a android/service_target: Init ipc server in Android service. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 1430b1b22c ipc/server: Add Android main entry point which receives fd. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki baa68fac4f ipc/server_process: Don't init listen socket and epoll on Android.
As the equivalent is already done in Java.
2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 3202922ce7 ipc/server: Factor out start_server_thread function. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki db95b34e6c android/Client: Start IPC process in thread. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 373a3096a9 c/window_android: Use cached surface from IPC.
Create window if activity is cached for in process.
2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 92dab7b75b android/Client: Create Android surface for OoP. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 37e87d1942 android/MonadoView: Make native pointer optional. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 0a6bfe6d96 aux/android_globals: Provide API to store a native window globally. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 020df327fa MonadoView: Don't be a Hilt view. Resolve exception.
Resolves:

java.lang.IllegalStateException: class org.freedesktop.monado.auxiliary.MonadoView, Hilt view must be attached to an @AndroidEntryPoint Fragment or Activity.
2020-12-01 18:05:32 +01:00
Ryan Pavlik 4101b3d92d android: IPC/service-related cleanups. 2020-12-01 18:05:32 +01:00
Ryan Pavlik 974e7bd1d5 ipc/android: Be a foreground service 2020-12-01 18:05:32 +01:00
Ryan Pavlik b92646c778 t/oxr_android: Bind ServiceNotificationImpl 2020-12-01 18:05:32 +01:00
Ryan Pavlik fe6507d64e t/android_common: Implement IServiceNotification 2020-12-01 18:05:32 +01:00
Ryan Pavlik 94d747cac9 aux/android: Create an interface for handling foreground service notification 2020-12-01 18:05:32 +01:00
Ryan Pavlik a2a61cb5cf ipc/android: Improve Client 2020-12-01 18:05:32 +01:00
Ryan Pavlik 70542fbb3b t/oxr_android: Split android UI that is not target-specific to a separate common target. 2020-12-01 18:05:32 +01:00
Ryan Pavlik 2fe699d7c1 xrt/android: Actually start using dependency injection in Java/Kotlin code. 2020-12-01 18:05:32 +01:00
Ryan Pavlik 3c3d628f0c t/oxr_android: Add resources and build code to grab the CDDL license for display.
Used by a dependency of Hilt.
2020-12-01 18:05:32 +01:00
Ryan Pavlik 885dd1d4d5 gradle: Handle kotlin in multiple parts of the build 2020-12-01 18:05:32 +01:00
Ryan Pavlik fa840e1cd8 ipc/android: Initial port of parts to Kotlin. 2020-12-01 18:05:32 +01:00
Ryan Pavlik b2f751ae99 aux/android: More null checks 2020-12-01 18:05:31 +01:00
Ryan Pavlik f6aff9196a t/oxr_android: Mention out-of-proc in app name resource 2020-12-01 18:05:31 +01:00
Ryan Pavlik 9a92b8f76c st/oxr_android: Provide a shutdown runtime button in activity. 2020-12-01 18:05:31 +01:00
Ryan Pavlik e4a346ad0b ipc/android: Clean ups and debug messages 2020-12-01 18:05:31 +01:00
Ryan Pavlik d9053e0dc5 ipc/android: Single point of truth for action name. 2020-12-01 18:05:31 +01:00
Ryan Pavlik aa222ebba1 ipc/android: Clean up, adjust action name, adjust manifest. 2020-12-01 18:05:31 +01:00
Ryan Pavlik d9453c708e ipc/android: Bump minSdkVersion 2020-12-01 18:05:31 +01:00
Ryan Pavlik d53e2dd7e2 st/oxr_android: Add icon to VR Listener service 2020-12-01 18:05:31 +01:00
Ryan Pavlik 7b5aad0be2 st/oxr_android: Declare sensor usage in manifest 2020-12-01 18:05:31 +01:00
Ryan Pavlik 635542f905 gradle: Break release build on a // STOPSHIP comment 2020-12-01 18:05:31 +01:00
Ryan Pavlik 23e01fc656 gradle: Factor out the dependency versions to a build-wide variable 2020-12-01 18:05:31 +01:00
Lubosz Sarnecki 4d45bfeb1b cmake: Fix Android linking error 2020-12-01 18:05:31 +01:00
Lubosz Sarnecki 144a5751f6 android/ipc/Client.java: call connectSync.notify(). 2020-12-01 18:05:31 +01:00
Ryan Pavlik da68bf502b ipc/client: Start using Android-specific code if needed. 2020-12-01 18:05:31 +01:00
Ryan Pavlik 9c7cfa0229 ipc/android: Add Android-specific native code library. 2020-12-01 18:05:31 +01:00
Ryan Pavlik 3011e3c9f6 ipc/android: Add a blocking connect Java method, and small clean-ups. 2020-12-01 18:05:31 +01:00
Ryan Pavlik 04318b4104 meson: Generate a mock Android config header. 2020-12-01 18:05:31 +01:00
Lubosz Sarnecki d493044e55 d/android: Use display metrics instead of hardcoded Pixel 3 values. 2020-12-01 17:36:15 +01:00
Lubosz Sarnecki c0ab34a355 aux/android: Implement display metrics acquisition. 2020-12-01 17:36:15 +01:00
Lubosz Sarnecki ae76b5037d c/renderer: Fix right eye viewport when not pre-rotating.
Scale X / Y were swapped incorrectly.
2020-12-01 15:46:21 +01:00
Jakob Bornecrantz 6fc0e1cda5 u/sink_converter: Silence warning 2020-11-30 17:52:58 +00:00