Monado OpenXR Runtime
Windows Mixed Reality driver

Windows Mixed Reality driver. More...

Collaboration diagram for Windows Mixed Reality driver:

Files

file  wmr_bt_controller.c
 Driver for Bluetooth based WMR Controller.
 
file  wmr_bt_controller.h
 Driver interface for Bluetooth based WMR motion controllers.
 
file  wmr_camera.c
 WMR camera interface.
 
file  wmr_camera.h
 Interface to read WMR cameras.
 
file  wmr_common.h
 Defines and constants related to WMR driver code.
 
file  wmr_config.c
 Driver code to read WMR config blocks.
 
file  wmr_config.h
 WMR and MS HoloLens configuration structures.
 
file  wmr_controller.c
 Driver for WMR Controllers.
 
file  wmr_controller.h
 Implementation of Original & HP WMR controllers.
 
file  wmr_controller_base.c
 Driver for WMR Controller.
 
file  wmr_controller_base.h
 Common implementation for WMR controllers, handling shared behaviour such as communication, configuration reading, IMU integration.
 
file  wmr_controller_hp.c
 Driver for WMR Controllers.
 
file  wmr_controller_og.c
 Driver for WMR Controllers.
 
file  wmr_controller_protocol.c
 WMR Motion Controller protocol helpers implementation.
 
file  wmr_controller_protocol.h
 WMR Motion Controller protocol constants, structures and helpers.
 
file  wmr_hmd.c
 Driver code for a WMR HMD.
 
file  wmr_hmd.h
 Interface to the WMR HMD driver code.
 
file  wmr_hmd_controller.c
 Implementation of tunnelled controller connection, that translates messages passing via an HP G2 or Sasmung Odyssey+ HMD.
 
file  wmr_hmd_controller.h
 Implementation of tunnelled controller connection, that translates messages passing via an HP G2 or Sasmung Odyssey+ HMD.
 
file  wmr_interface.h
 Interface to the WMR driver.
 
file  wmr_prober.c
 WMR prober code.
 
file  wmr_protocol.c
 WMR and MS HoloLens protocol helpers implementation.
 
file  wmr_protocol.h
 WMR and MS HoloLens protocol constants, structures and helpers header.
 
file  wmr_source.c
 WMR camera and IMU data source.
 
file  wmr_source.h
 Interface for WMR data sources.
 

Data Structures

struct  wmr_bt_connection
 A connection to a Bluetooth connected WMR Controller device. More...
 
struct  wmr_controller_base
 Common base for all WMR controllers. More...
 
struct  wmr_controller_fw_cmd
 
struct  wmr_controller_fw_cmd_response
 
struct  wmr_bt_controllers_search_results
 Results from searching for host attached Bluetooth controllers. More...
 
struct  wmr_companion_search_results
 Results from searching for a companion device. More...
 
struct  wmr_headset_search_results
 Results from searching for a headset. More...
 
struct  hololens_sensors_packet
 
struct  wmr_config_header
 

Macros

#define MS_HOLOLENS_MANUFACTURER_STRING   "Microsoft"
 
#define MS_HOLOLENS_PRODUCT_STRING   "HoloLens Sensors"
 
#define MICROSOFT_VID   0x045e
 
#define HOLOLENS_SENSORS_PID   0x0659
 
#define WMR_CONTROLLER_PID   0x065b
 
#define WMR_CONTROLLER_LEFT_PRODUCT_STRING   "Motion controller - Left"
 
#define WMR_CONTROLLER_RIGHT_PRODUCT_STRING   "Motion controller - Right"
 
#define HP_VID   0x03f0
 
#define VR1000_PID   0x0367
 
#define REVERB_G1_PID   0x0c6a
 
#define REVERB_G2_PID   0x0580
 
#define REVERB_G2_CONTROLLER_PID   0x066a /* On 0x045e Microsoft VID */
 
#define LENOVO_VID   0x17ef
 
#define EXPLORER_PID   0xb801
 
#define DELL_VID   0x413c
 
#define VISOR_PID   0xb0d5
 
#define SAMSUNG_VID   0x04e8
 
#define ODYSSEY_PID   0x7310
 
#define ODYSSEY_PLUS_PID   0x7312
 
#define ODYSSEY_CONTROLLER_PID   0x065d
 
#define QUANTA_VID   0x0408 /* Medion? */
 
#define MEDION_ERAZER_X1000_PID   0xb5d5
 
#define WMR_MOTION_CONTROLLER_MSG_BUFFER_SIZE   256
 
#define WMR_MOTION_CONTROLLER_NS_PER_TICK   100
 
#define WMR_MOTION_CONTROLLER_STATUS_MSG   0x01
 
#define WMR_CONTROLLER_FW_CMD_INIT(p, c, b, a)
 
#define WMR_FEATURE_BUFFER_SIZE   497
 
#define WMR_MS_HOLOLENS_NS_PER_TICK   100
 
#define WMR_MS_HOLOLENS_MSG_SENSORS   0x01
 
#define WMR_MS_HOLOLENS_MSG_CONTROL   0x02
 
#define WMR_MS_HOLOLENS_MSG_DEBUG   0x03
 
#define WMR_MS_HOLOLENS_MSG_BT_IFACE   0x05 /* Bluetooth interface */
 
#define WMR_MS_HOLOLENS_MSG_LEFT_CONTROLLER   0x06 /* Left controller */
 
#define WMR_MS_HOLOLENS_MSG_RIGHT_CONTROLLER   0x0E /* Right controller */
 
#define WMR_MS_HOLOLENS_MSG_BT_CONTROL   0x16 /* BT control message on Reverb G2 & Odyssey+ */
 
#define WMR_MS_HOLOLENS_MSG_CONTROLLER_STATUS   0x17
 
#define WMR_CONTROL_MSG_IPD_VALUE   0x01
 
#define WMR_CONTROL_MSG_UNKNOWN_02   0x02
 
#define WMR_CONTROL_MSG_DEVICE_STATUS   0x05
 
#define WMR_BT_IFACE_MSG_DEBUG   0x19
 
#define WMR_CONTROLLER_STATUS_UNPAIRED   0x0
 
#define WMR_CONTROLLER_STATUS_OFFLINE   0x1
 
#define WMR_CONTROLLER_STATUS_ONLINE   0x2
 
#define STR_TO_U32(s)   ((uint32_t)(((s)[0]) | ((s)[1] << 8) | ((s)[2] << 16) | ((s)[3] << 24)))
 
#define WMR_MAGIC   STR_TO_U32("Dlo+")
 
#define WMR_MIN_EXPOSURE   60
 
#define WMR_MAX_OBSERVED_EXPOSURE   6000
 
#define WMR_MAX_EXPOSURE   9000
 
#define WMR_MIN_GAIN   16
 
#define WMR_MAX_GAIN   255
 

Enumerations

enum  wmr_headset_type {
  WMR_HEADSET_GENERIC , WMR_HEADSET_HP_VR1000 , WMR_HEADSET_REVERB_G1 , WMR_HEADSET_REVERB_G2 ,
  WMR_HEADSET_SAMSUNG_XE700X3AI , WMR_HEADSET_SAMSUNG_800ZAA , WMR_HEADSET_LENOVO_EXPLORER , WMR_HEADSET_MEDION_ERAZER_X1000 ,
  WMR_HEADSET_DELL_VISOR
}
 Headset type, used to select different control and init/shutdown procedures. More...
 
enum  wmr_bt_control_msg {
  WMR_BT_CONTROL_MSG_ONLINE_STATUS = 0x04 , WMR_BT_CONTROL_MSG_PAIR = 0x05 , WMR_BT_CONTROL_MSG_UNPAIR = 0x06 , WMR_BT_CONTROL_MSG_PAIRING_STATUS = 0x08 ,
  WMR_BT_CONTROL_MSG_CMD_STATUS = 0x09
}
 

Functions

void wmr_find_bt_controller_pair (struct xrt_prober *xp, struct xrt_prober_device **xpdevs, size_t xpdev_count, enum u_logging_level log_level, struct wmr_bt_controllers_search_results *out_wbtcsr)
 Search for a left and right pair of Windows Mixed Reality controllers, groups them by type (Classic/Odyssey/G2). More...
 
void wmr_find_companion_device (struct xrt_prober *xp, struct xrt_prober_device **xpdevs, size_t xpdev_count, enum u_logging_level log_level, struct xrt_prober_device *xpdev_holo, struct wmr_companion_search_results *out_wcsr)
 Searches for the the list of xpdevs for the companion device of a holo lens device. More...
 
void wmr_find_headset (struct xrt_prober *xp, struct xrt_prober_device **xpdevs, size_t xpdev_count, enum u_logging_level log_level, struct wmr_headset_search_results *out_whsr)
 Find a headsets. More...
 
xrt_result_t wmr_create_headset (struct xrt_prober *xp, struct xrt_prober_device *xpdev_holo, struct xrt_prober_device *xpdev_companion, enum wmr_headset_type type, enum u_logging_level log_level, struct xrt_device **out_hmd, struct xrt_device **out_left, struct xrt_device **out_right, struct xrt_device **out_ht_left, struct xrt_device **out_ht_right)
 Creates a WMR headset with the given devices and of headset type. More...
 
xrt_result_t wmr_create_bt_controller (struct xrt_prober *xp, struct xrt_prober_device *xpdev, enum u_logging_level log_level, struct xrt_device **out_xdev)
 Creates a WMR BT controller device. More...
 
void vec3_from_hololens_accel (int32_t sample[3][4], int i, struct xrt_vec3 *out_vec)
 
void vec3_from_hololens_gyro (int16_t sample[3][32], int i, struct xrt_vec3 *out_vec)
 
static uint8_t read8 (const unsigned char **buffer)
 
static int16_t read16 (const unsigned char **buffer)
 
static int32_t read24 (const unsigned char **buffer)
 
static int32_t read32 (const unsigned char **buffer)
 
static uint64_t read64 (const unsigned char **buffer)
 
struct xrt_fswmr_source_create (struct xrt_frame_context *xfctx, struct xrt_prober_device *dev_holo, struct wmr_hmd_config cfg)
 Create and return the data source as a xrt_fs ready for data streaming. More...
 
void wmr_source_push_imu_packet (struct xrt_fs *xfs, timepoint_ns t, struct xrt_vec3 accel, struct xrt_vec3 gyro)
 

Variables

static const unsigned char hololens_sensors_imu_on [64] = {0x02, 0x07}
 

Detailed Description

Windows Mixed Reality driver.

WMR video/IMU data sources.

WMR and MS HoloLens Sensors protocol helpers.

WMR and MS HoloLens Sensors protocol constants and structures.

WMR Motion Controller protocol constant and structures.

Defines for the WMR driver.

Macro Definition Documentation

◆ WMR_CONTROLLER_FW_CMD_INIT

#define WMR_CONTROLLER_FW_CMD_INIT (   p,
  c,
  b,
 
)

#include <drivers/wmr/wmr_controller_protocol.h>

Value:
((struct wmr_controller_fw_cmd){ \
.cmd = {.prefix = (p), .cmd_id = (c), .block_id = (b), .addr = __cpu_to_le32((a))}})
Definition: wmr_controller_protocol.h:44

Enumeration Type Documentation

◆ wmr_headset_type

#include <drivers/wmr/wmr_common.h>

Headset type, used to select different control and init/shutdown procedures.

Function Documentation

◆ wmr_create_bt_controller()

xrt_result_t wmr_create_bt_controller ( struct xrt_prober xp,
struct xrt_prober_device xpdev,
enum u_logging_level  log_level,
struct xrt_device **  out_xdev 
)

#include <drivers/wmr/wmr_interface.h>

Creates a WMR BT controller device.

◆ wmr_create_headset()

xrt_result_t wmr_create_headset ( struct xrt_prober xp,
struct xrt_prober_device xpdev_holo,
struct xrt_prober_device xpdev_companion,
enum wmr_headset_type  type,
enum u_logging_level  log_level,
struct xrt_device **  out_hmd,
struct xrt_device **  out_left,
struct xrt_device **  out_right,
struct xrt_device **  out_ht_left,
struct xrt_device **  out_ht_right 
)

#include <drivers/wmr/wmr_interface.h>

Creates a WMR headset with the given devices and of headset type.

◆ wmr_find_bt_controller_pair()

void wmr_find_bt_controller_pair ( struct xrt_prober xp,
struct xrt_prober_device **  xpdevs,
size_t  xpdev_count,
enum u_logging_level  log_level,
struct wmr_bt_controllers_search_results out_wbtcsr 
)

#include <drivers/wmr/wmr_interface.h>

Search for a left and right pair of Windows Mixed Reality controllers, groups them by type (Classic/Odyssey/G2).

Preferring Odyssey over Classic. Will mix types in order to get a complete left and right pair if need be, but prefers matching types first. G2 currently not supported.

◆ wmr_find_companion_device()

void wmr_find_companion_device ( struct xrt_prober xp,
struct xrt_prober_device **  xpdevs,
size_t  xpdev_count,
enum u_logging_level  log_level,
struct xrt_prober_device xpdev_holo,
struct wmr_companion_search_results out_wcsr 
)

#include <drivers/wmr/wmr_interface.h>

Searches for the the list of xpdevs for the companion device of a holo lens device.

◆ wmr_find_headset()

void wmr_find_headset ( struct xrt_prober xp,
struct xrt_prober_device **  xpdevs,
size_t  xpdev_count,
enum u_logging_level  log_level,
struct wmr_headset_search_results out_whsr 
)

#include <drivers/wmr/wmr_interface.h>

Find a headsets.

◆ wmr_source_create()

struct xrt_fs* wmr_source_create ( struct xrt_frame_context xfctx,
struct xrt_prober_device dev_holo,
struct wmr_hmd_config  cfg 
)

#include <drivers/wmr/wmr_source.h>

Create and return the data source as a xrt_fs ready for data streaming.

Create and return the data source as a xrt_fs ready for data streaming.

◆ wmr_source_push_imu_packet()

void wmr_source_push_imu_packet ( struct xrt_fs xfs,
timepoint_ns  t,
struct xrt_vec3  accel,
struct xrt_vec3  gyro 
)

#include <drivers/wmr/wmr_source.h>

Todo:

IMU data should be generated from within the data source, but right now we need this function because it is being generated from wmr_hmd

Should this method receive raw or calibrated samples? Currently receiving raw because Basalt can calibrate them, but other systems can't.