SteamVR requires the serial number to be set. Otherwise after creating
the controller it will fail to activate it.
Before:
...
monado: Creating Controller WMR Left Controller
monado: Using Monado Controller profile
monado: Render model based on Monado: locator_one_sided
monado: get controller serial number:
Driver 'monado' attempted to add tracked device with no serial number
monado: Added left Controller: WMR Left Controller
monado: Creating Controller WMR Right Controller
monado: Using Monado Controller profile
monado: Render model based on Monado: locator_one_sided
monado: get controller serial number:
Driver 'monado' attempted to add tracked device with no serial number
monado: Added right Controller: WMR Right Controller
...
After:
monado: Creating Controller WMR Left Controller
monado: Using Monado Controller profile
monado: Render model based on Monado: locator_one_sided
monado: get controller serial number: Left Controller
Driver 'monado' started activation of tracked device with serial number 'Left Controller'
monado: Added left Controller: WMR Left Controller
monado: Creating Controller WMR Right Controller
monado: Using Monado Controller profile
monado: Render model based on Monado: locator_one_sided
monado: get controller serial number: Right Controller
Driver 'monado' started activation of tracked device with serial number 'Right Controller'
monado: Added right Controller: WMR Right Controller
With this change the HP Reverb G2 controller is recognized and activated
fine in SteamVR for me. "Active Controller" nows says:
"monado_hp_mixed_reality_controller". The SteamVR controller test page
now works and recognizes button presses. The controllers can also
(kind of) be used in the home environment.
Several issues still exist to be fully useable:
* middle finger button not recognized in the SteamVR test page
(all other buttons seem to work)
* high gyro drift
* no positional tracking
The serial is set to "Left Controller" and "Right Controller" for now,
just like for the Rift S controller. This should probably be updated to
a proper serial number once read_controller_config() can parse it from
the firmware.
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Store controller calibration block into a cache file and
use that if available, to save time on subsequent startups
Re-disable reading of extra firmware blocks, accidentally
left enabled during recent controller/connection splitup
With the Reverb G2 controllers connected to the Linux host system via
Bluetooth the following segmentation fault occurs for me when starting
SteamVR with the SteamVR-Monado plugin installed:
```
$ gdb ...
...
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007f82de21bac7 in CDeviceDriver_Monado_Controller::RunFrame (this=0x7f82bc610e40)
at /home/linus/dev-priv/vr/monado/src/xrt/state_trackers/steamvr_drv/ovrd_driver.cpp:966
#2 0x00007f82de218b5d in CServerDriver_Monado::RunFrame (this=0x7f82de7c6ca0 <g_serverDriverMonado>)
at /home/linus/dev-priv/vr/monado/src/xrt/state_trackers/steamvr_drv/ovrd_driver.cpp:1574
#3 0x00000000004b7a77 in ?? ()
#4 0x0000000000000000 in ?? ()
(gdb) l /home/linus/dev-priv/vr/monado/src/xrt/state_trackers/steamvr_drv/ovrd_driver.cpp:966
959 if (m_xdev->hand_tracking_supported && m_skeletal_input_control.control_handle) {
960 vr::VRBoneTransform_t bone_transforms[OPENVR_BONE_COUNT];
961
962 timepoint_ns now_ns = os_monotonic_get_ns();
963 struct xrt_hand_joint_set out_joint_set_value;
964 uint64_t out_timestamp_ns;
965
966 m_xdev->get_hand_tracking(m_xdev,
967 m_hand == XRT_HAND_LEFT ? XRT_INPUT_GENERIC_HAND_TRACKING_LEFT
968 : XRT_INPUT_GENERIC_HAND_TRACKING_RIGHT,
969 now_ns, &out_joint_set_value, &out_timestamp_ns);
```
This happens because the "m_xdev->hand_tracking_supported" flag is set
but m_xdev->get_hand_tracking() is not implemented for WMR controllers.
Fixing this crash by setting hand_tracking_supported to false for
WMR controllers for now until get_hand_tracking() is implemented.
Link: https://gitlab.freedesktop.org/monado/monado/-/issues/251
Fixes: c4db3dfccc ("d/wmr: Add basic Reverb (G1, Bluetooth) motion controller support.")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
The swapchain code was creating a whole bunch of samplers, two for each image.
The thought was that samplers might depend on format, but this was not the
case. So just add a few common ones on the render_resources structs and use
them everywhere. Also fixes the bleeding distortion problem.