How to setup a WMR headset with Monado
Channel: Mateo de Mayo
Date: 2023-08-17

For the Reverb G2 headset, this is what you need to do to get it running:
  - Have basalt installed (I updated the mateosss/basalt readme recently, check it out just in case)
  - Prepare hand tracking (optional but cool, notice hand tracking is very bad in WMR headsets but still cool):
    - Download onnxruntime from https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-linux-x64-1.15.1.tgz and put the lib/ and include/ dirs in /usr/local/
    - Run `./scripts/get-ht-models.sh` from monado source folder
  - Configure and build monado again: when doing cmake configure it should say `DRIVER_HANDTRACKING: ON` and `FEATURE_SLAM: ON`
  - For USB: Download and setup xr-hardware: https://gitlab.freedesktop.org/monado/utilities/xr-hardware#quick-start-build-and-use
  - For DisplayPort: When you connect the headset and run `xrandr` you will notice it appears listed DisplayPort-2 or DP-2 or something like that, you then need to run `xrandr --output DisplayPort-2 --prop --set non-desktop 1` to tell your machine that the headset is a "non-desktop" display and can use "direct mode". More info about that here: https://monado.freedesktop.org/direct-mode.html
  - You are done, now run `XRT_DEBUG_GUI=1 SLAM_UI=1 XRT_COMPOSITOR_COMPUTE=1 monado-service` (those options are optional but recommended)
  - And finally run an OpenXR application like the stereo-kit skdemo from here (built for Ubuntu 22.04, get other OpenXR app to test if on another system): https://drive.google.com/drive/folders/1_6z_0tX4dINjWxi6dMJbSi45rAlVInwO
  
The command I used in the end:
XRT_COMPOSITOR_FORCE_XCB=1 XRT_DEBUG_GUI=1 SLAM_UI=1 XRT_COMPOSITOR_COMPUTE=1 WMR_LOG=debug monado-service