### Compile and Install glslang Source: https://monado.freedesktop.org/tegra.html Instructions to build and install glslang from source using CMake and Ninja, required for environments where pre-built packages are unavailable. ```bash git clone https://github.com/KhronosGroup/glslang.git cd glslang cmake . -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -Bbuild ninja -C build install ``` -------------------------------- ### Calibrate Lighthouse Tracking Source: https://monado.freedesktop.org/valve-index-setup.html Commands to perform lighthouse calibration using libsurvive, including importing existing SteamVR calibration data. ```bash survive-cli --steamvr-calibration rm ~/.config/libsurvive/config.json survive-cli --steamvr-calibration ~/.steam/steam/config/lighthouse/lighthousedb.json ``` -------------------------------- ### Configure System Permissions and GPU Power for Monado Source: https://monado.freedesktop.org/valve-index-setup.html Sets the necessary system capabilities for the Monado service and optimizes AMD GPU power states for VR performance. ```bash sudo setcap CAP_SYS_NICE=eip /usr/bin/monado-service sudo sh -c 'echo "4" > /sys/class/drm/card0/device/pp_power_profile_mode' ``` -------------------------------- ### Compile and Install Monado Source: https://monado.freedesktop.org/getting-started.html Clones the Monado repository and performs a build using CMake and the Ninja generator. The installation prefix is set to /usr. ```bash git clone https://gitlab.freedesktop.org/monado/monado.git cmake -G Ninja -S monado -B build -DCMAKE_INSTALL_PREFIX=/usr ninja -C build install ``` -------------------------------- ### Minimal OpenXR OpenGL Application Setup (C) Source: https://monado.freedesktop.org/developing-with-monado.html This C code snippet demonstrates the basic setup for an OpenXR application using OpenGL with the xlib graphics binding on Linux. It includes necessary headers, defines platform-specific features, and initializes an OpenXR instance. Dependencies include X11, GL, and OpenXR headers. ```c // openxr_platform.h does not include all its dependencies, we have to include some headers before it #include #include #include // before including openxr_platform.h we have to define which platform specific parts we want enabled #define XR_USE_PLATFORM_XLIB #define XR_USE_GRAPHICS_API_OPENGL #include #include int main() { char *extensions[] = { XR_KHR_OPENGL_ENABLE_EXTENSION_NAME }; int extension_count = sizeof(extensions) / sizeof(extensions[0]); XrInstanceCreateInfo instanceCreateInfo = { .type = XR_TYPE_INSTANCE_CREATE_INFO, .next = NULL, .createFlags = 0, .enabledExtensionCount = extension_count, .enabledExtensionNames = (const char * const *) extensions, .enabledApiLayerCount = 0, .applicationInfo = { .applicationVersion = 1, .engineVersion = 0, .apiVersion = XR_CURRENT_API_VERSION, }, }; strncpy(instanceCreateInfo.applicationInfo.applicationName, "Example Application", XR_MAX_APPLICATION_NAME_SIZE); strncpy(instanceCreateInfo.applicationInfo.engineName, "Example Engine", XR_MAX_APPLICATION_NAME_SIZE); XrInstance instance; xrCreateInstance(&instanceCreateInfo, &instance); return 0; } ``` -------------------------------- ### Configure OpenXR Runtime Source: https://monado.freedesktop.org/valve-index-setup.html Configures the active OpenXR runtime by pointing to the Monado library path in the user configuration file. ```json { "file_format_version": "1.0.0", "runtime": { "library_path": "../../../../../usr/lib64/libopenxr_monado.so" } } ``` -------------------------------- ### Launch Offscreen X Server Source: https://monado.freedesktop.org/tegra.html Command to initialize an offscreen X server using the custom configuration file, allowing applications to run in a virtual display environment. ```bash Xorg -config ./xorg.conf.offscreen :10 ``` -------------------------------- ### Install Monado Build Dependencies Source: https://monado.freedesktop.org/getting-started.html Installs necessary build tools and development libraries required to compile Monado on Debian/Ubuntu systems. This includes compilers, build systems, and various hardware and graphics development headers. ```bash apt install cmake ninja-build apt install build-essential git wget unzip cmake ninja-build libeigen3-dev curl patch python3 pkg-config libx11-dev libx11-xcb-dev libxxf86vm-dev libxrandr-dev libxcb-randr0-dev libvulkan-dev glslang-tools libglvnd-dev libgl1-mesa-dev ca-certificates libusb-1.0-0-dev libudev-dev libhidapi-dev libwayland-dev libuvc-dev libavcodec-dev libopencv-dev libv4l-dev libcjson-dev libsdl2-dev libegl1-mesa-dev libbsd-dev ``` -------------------------------- ### Offscreen Xorg Configuration Source: https://monado.freedesktop.org/tegra.html An xorg.conf configuration file designed to run an X server without physical display devices, enabling headless rendering for XR applications. ```xorg Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "Unknown" HorizSync 28.0 - 33.0 VertRefresh 43.0 - 72.0 Option "DPMS" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" SubSection "Display" Virtual 1920 1080 EndSubSection Option "UseDisplayDevice" "none" EndSection Section "Module" Disable "dri" SubSection "extmod" Option "omit xfree86-dga" EndSubSection EndSection Section "Device" Identifier "Tegra0" Driver "nvidia" Option "AllowEmptyInitialConfiguration" "true" EndSection ``` -------------------------------- ### Install patch_edid in a Python Virtualenv Source: https://monado.freedesktop.org/patch_edid.html Installs the patch_edid tool within a dedicated Python virtual environment. This isolates dependencies and allows for easier management. The installation requires cloning the repository, creating a virtual environment, activating it, and then installing the package in editable mode with CLI support. ```bash git clone https://github.com/Joel-Valenciano/edid-json-tools.git virtualenv edid-json-tools-venv source edid-json-tools-venv/bin/activate pip install --editable 'edid-json-tools[CLI]' ``` -------------------------------- ### Enable Index Controller Emulation in Monado Source: https://monado.freedesktop.org/steamvr.html Starts SteamVR with Index Controller emulation enabled via an environment variable. This allows Monado controllers to mimic SteamVR's Index Controllers, though some input mappings might not be fully supported. ```bash STEAMVR_EMULATE_INDEX_CONTROLLER=1 ~/.steam/steam/steamapps/common/SteamVR/bin/vrstartup.sh ``` ```bash STEAMVR_EMULATE_INDEX_CONTROLLER=1 %command% ``` -------------------------------- ### Register Monado SteamVR Plugin Source: https://monado.freedesktop.org/steamvr.html Registers the Monado SteamVR plugin with SteamVR using the vrpathreg.sh tool. This command needs to be run after Monado is installed or built. It ensures SteamVR can detect and utilize Monado's drivers. ```bash ~/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh adddriver /usr/share/steamvr-monado ``` ```bash ~/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh adddriver ~/monado/build/steamvr-monado ``` ```bash ~/.local/share/Steam/steamapps/common/SteamVR/bin/vrpathreg.sh adddriver /usr/share/steamvr-monado ``` -------------------------------- ### Build OpenXR SDK from Source Source: https://monado.freedesktop.org/getting-started.html Compiles the OpenXR loader from the Khronos OpenXR-SDK repository. This is required for running OpenXR applications if pre-built packages are unavailable. ```bash git clone https://github.com/KhronosGroup/OpenXR-SDK.git cd OpenXR-SDK cmake . -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -Bbuild ninja -C build install ``` -------------------------------- ### Configure OpenXR project with Meson Source: https://monado.freedesktop.org/developing-with-monado.html Shows how to integrate OpenXR into a Meson build system using the dependency() mechanism, which relies on pkg-config. ```meson project('Example', ['c']) openxr_dep = dependency('openxr') executable('example', ['main.c'], dependencies: [openxr_dep]) ``` -------------------------------- ### Pair PS Move controllers using psmoveapi Source: https://monado.freedesktop.org/positional-tracking-psmove.html This procedure clones the psmoveapi repository, builds the pairing utility from source, and executes the pairing command. It requires a USB connection to the controller and may require restarting the system bluetooth daemon if pairing fails. ```bash git clone --recursive https://github.com/thp/psmoveapi.git cd psmoveapi cmake . make sudo ./psmove pair ``` -------------------------------- ### Download PS4 Camera Firmware and Upload Script Source: https://monado.freedesktop.org/positional-tracking-psmove.html This snippet downloads the necessary firmware and initialization script for the PS4 camera to function with Monado. It requires `wget` and saves the files to the current directory. ```shell wget https://raw.githubusercontent.com/ps4eye/ps4eye/master/python/ps4eye_init.py wget -O firmware.bin 'https://github.com/psxdev/luke_firmwares/blob/master/101_85C8E0_64036.bin?raw=true' ``` -------------------------------- ### Enable Monado debug UI Source: https://monado.freedesktop.org/positional-tracking-psmove.html Environment variable configuration to launch the Monado service with the debug UI enabled. This allows users to inspect HSV filtering and PSMV tracker windows for troubleshooting positional tracking. ```bash XRT_DEBUG_GUI=1 monado-service hello_xr -g Vulkan ``` -------------------------------- ### Configure OpenXR project with CMake Source: https://monado.freedesktop.org/developing-with-monado.html Demonstrates how to link the OpenXR loader and include headers in a CMake project using the official OpenXR package or pkg-config. ```cmake cmake_minimum_required(VERSION 3.0.0) project(Example) add_executable(example main.c) find_package(OpenXR REQUIRED) if(OpenXR_FOUND) target_include_directories(example PRIVATE OpenXR::Headers) target_link_libraries(example PRIVATE OpenXR::openxr_loader) else() MESSAGE(FATAL_ERROR "Please verify your OpenXR SDK installation") endif() ``` ```cmake cmake_minimum_required(VERSION 3.0.0) project(Example) add_executable(example main.c) INCLUDE(FindPkgConfig) PKG_SEARCH_MODULE(OpenXR REQUIRED openxr) if(OpenXR_FOUND) target_link_libraries(example PRIVATE ${OpenXR_LIBRARIES}) target_include_directories(example PRIVATE ${OpenXR_HEADERS}) else() MESSAGE(FATAL_ERROR "Please verify your OpenXR SDK installation") endif() ``` -------------------------------- ### Upload PS4 Camera Firmware Source: https://monado.freedesktop.org/positional-tracking-psmove.html This command uploads the downloaded firmware to the PS4 camera, enabling it for use with Monado. It requires `sudo` privileges and the `ps4eye_init.py` script. ```shell sudo ./ps4eye_init.py ``` -------------------------------- ### Apply EDID Overrides with patch_edid Source: https://monado.freedesktop.org/patch_edid.html Demonstrates how to use the patch_edid tool to modify EDID settings for a specific display connector. These changes are not persistent across reboots but can survive display reconnects and system suspend. The tool requires root privileges and the connector name (e.g., DP-2) as an argument. ```bash sudo patch_edid override -m -y 1 DP-2 sudo patch_edid override -d -m 1 DP-2 sudo patch_edid override --reset 1 DP-2 ``` -------------------------------- ### Monado Remote Driver Configuration (JSON) Source: https://monado.freedesktop.org/developing-with-monado.html This JSON snippet shows the configuration for Monado's remote driver, used for testing and debugging without hardware. It specifies the active configuration and the port for the remote connection. The 'version' and 'port' fields are optional. ```json { "active": "remote", "remote": { "version": 0, "port": 4242 } } ``` -------------------------------- ### PS4 Camera Udev Rule for Automatic Firmware Loading Source: https://monado.freedesktop.org/positional-tracking-psmove.html This udev rule automatically loads the PS4 camera firmware when the device is plugged in, eliminating the need for manual execution after reboots or reconnections. Ensure the script path is adjusted correctly. ```udev ACTION=="add",SUBSYSTEMS=="usb",ATTRS{idProduct}=="0580",ATTRS{idVendor}=="05a9",RUN+="/usr/local/opt/ps4eye/ps4eye_init.py" ``` -------------------------------- ### List and Unregister Monado SteamVR Plugins Source: https://monado.freedesktop.org/steamvr.html Manages the registration of Monado SteamVR plugins. 'vrpathreg.sh' without arguments lists currently registered external drivers. 'removedriver' unregisters a specific plugin. ```bash ~/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh ``` ```bash ~/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh removedriver /usr/share/steamvr-monado ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.