Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Vindicus999
2025-12-17 01:52:42 +00:00
11 changed files with 622 additions and 39 deletions
+2 -1
View File
@@ -55,7 +55,7 @@ set(OVR_COMPAT_SEARCH_PATH "/opt/xrizer:/usr/local/lib/OpenComposite:/usr/lib/Op
option(WIVRN_FEATURE_DEBUG_GUI "Enable Monado debug GUI" OFF)
option(WIVRN_FEATURE_RENDERDOC "Support renderdoc" OFF)
set(WIVRN_FEATURE_SOLARXR OFF) # Will be added back when merged in upstream Monado
option(WIVRN_FEATURE_STEAMVR_LIGHTHOUSE "Enable SteamVR Lighthouse driver" OFF)
option(WIVRN_FEATURE_STEAMVR_LIGHTHOUSE "Enable SteamVR Lighthouse driver" ON)
set(WIVRN_CSS "${CMAKE_SOURCE_DIR}/images/wivrn-local.css" CACHE STRING "Stylesheet to use to render SVGs" )
@@ -67,6 +67,7 @@ set(WIVRN_OPENXR_MANIFEST_TYPE "relative" CACHE STRING "How to reference librari
if (NOT WIVRN_OPENXR_MANIFEST_TYPE IN_LIST WIVRN_OPENXR_MANIFEST_TYPE_VALUES)
message(FATAL_ERROR "WIVRN_OPENXR_MANIFEST_TYPE must be one of ${WIVRN_OPENXR_MANIFEST_TYPE_VALUES}")
endif()
option(WIVRN_OPENXR_MANIFEST_ABI "Generate an ABI specific OpenXR manifest")
option(ENABLE_COLOURED_OUTPUT "Always produce ANSI-coloured output (GNU/Clang only)." ON)
+6 -9
View File
@@ -57,30 +57,27 @@ You can set an application to be started automatically when you connect your hea
### OpenVR and Steam games
The flatpak also includes [OpenComposite](https://gitlab.com/znixian/OpenOVR/), used to translate the OpenVR API used by SteamVR to OpenXR used by WiVRn, see [SteamVR](docs/steamvr.md) for details.
The flatpak also includes [OpenComposite](https://gitlab.com/znixian/OpenOVR/) and [xrizer](https://github.com/Supreeeme/xrizer/), used to translate the OpenVR API used by SteamVR to OpenXR used by WiVRn, see [SteamVR](docs/steamvr.md) for details.
If using Wine/Proton, it will probe for OpenVR at startup, so even for OpenXR applications, OpenComposite is required.
If using Wine/Proton, it will probe for OpenVR at startup, so even for OpenXR applications, OpenComposite or xrizer is required.
When you start the server through flatpak, it will automatically configure the current OpenVR to use OpenComposite.
When you start the server through flatpak, it will automatically configure the current OpenVR to use xrizer.
### Steam Flatpak
If you're using the Steam Flatpak, you'll need to grant read only access to the following paths:
```bash
flatpak override --user \
flatpak override \
--filesystem=xdg-run/wivrn:ro \
--filesystem=xdg-data/flatpak/app/io.github.wivrn.wivrn:ro \
--filesystem=/var/lib/flatpak/app/io.github.wivrn.wivrn:ro \
--filesystem=xdg-config/openxr:ro \
--filesystem=xdg-config/openvr:ro \
com.valvesoftware.Steam
```
Then create a symlink for the OpenXR configuration file (the directory `~/.var/app/com.valvesoftware.Steam/.config/openxr` will need to be created if it doesn't already exist):
```bash
ln -s ~/.config/openxr/1 ~/.var/app/com.valvesoftware.Steam/.config/openxr/1
```
When using a user installation of flatpak Steam, user `override --user` instead of `override`.
### Audio
When the headset is connected, WiVRn will create a virtual output device named WiVRn. It is not selected as default and you should either assign the application to the device when it is running, or mark it as default. To do so you can use `pavucontrol` or your desktop environment's configuration panel. Please note that in `pavucontrol` it will appear as a virtual device.
+2
View File
@@ -263,11 +263,13 @@ set(ASSETS_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../assets-source)
wivrn_rasterize_svg(SOURCE ${IMAGES_SRC_DIR}/wivrn.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/wivrn.png WIDTH 540 HEIGHT 540 CSS ${WIVRN_CSS_ABS})
wivrn_rasterize_svg(SOURCE ${IMAGES_SRC_DIR}/wivrn-pride.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/wivrn-pride.png WIDTH 540 HEIGHT 540 CSS ${WIVRN_CSS_ABS})
wivrn_rasterize_svg(SOURCE ${IMAGES_SRC_DIR}/wivrn-christmas.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/wivrn-christmas.png WIDTH 540 HEIGHT 540 CSS ${WIVRN_CSS_ABS})
wivrn_rasterize_svg(SOURCE ${ASSETS_SRC_DIR}/passthrough.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/passthrough.png WIDTH 256 HEIGHT 256)
wivrn_rasterize_svg(SOURCE ${ASSETS_SRC_DIR}/default-environment.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/default-environment.png WIDTH 256 HEIGHT 256)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/wivrn.png DESTINATION ${ASSETS_DIR}/wivrn.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/wivrn-pride.png DESTINATION ${ASSETS_DIR}/wivrn-pride.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/wivrn-christmas.png DESTINATION ${ASSETS_DIR}/wivrn-christmas.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${ASSETS_SRC_DIR}/default_icon.png DESTINATION ${ASSETS_DIR}/default_icon.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/passthrough.png DESTINATION ${ASSETS_DIR}/passthrough.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/default-environment.png DESTINATION ${ASSETS_DIR}/default-environment.ktx2 TARGET wivrn)
+12 -3
View File
@@ -1285,9 +1285,18 @@ void scenes::lobby::on_focused()
auto t = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
auto tm = std::localtime(&t);
std::string image = tm->tm_mon == 5 ? "wivrn-pride" : "wivrn";
about_picture = imgui_ctx->load_texture("assets://" + image + ".ktx2");
switch (tm->tm_mon)
{
case 5:
about_picture = imgui_ctx->load_texture("assets://wivrn-pride.ktx2");
break;
case 11:
about_picture = imgui_ctx->load_texture("assets://wivrn-christmas.ktx2");
break;
default:
about_picture = imgui_ctx->load_texture("assets://wivrn.ktx2");
break;
}
default_environment_screenshot = imgui_ctx->load_texture("assets://default-environment.ktx2");
+1 -1
View File
@@ -167,7 +167,7 @@ void scenes::stream::gui_performance_metrics()
ImVec2 window_size = ImGui::GetWindowSize() - ImVec2(2, 2) * style.WindowPadding;
static const std::array plots = {
const std::array plots = {
// clang-format off
plot(_("CPU time"), {{"", &global_metric::cpu_time}}, "s"),
+1 -1
View File
@@ -120,7 +120,7 @@ Kirigami.ApplicationWindow {
text: i18n("Avahi daemon is not installed")
type: Kirigami.MessageType.Warning
showCloseButton: true
visible: DashboardSettings.show_system_checks && !Avahi.installed
visible: DashboardSettings.show_system_checks && !Avahi.installed && !Avahi.running
}
Kirigami.InlineMessage {
+1 -1
View File
@@ -389,7 +389,7 @@ modules:
- -DWIVRN_USE_PIPEWIRE=ON
- -DWIVRN_USE_SYSTEM_BOOST=OFF
- -DWIVRN_WERROR=ON
- -DWIVRN_CHECK_CAPSYSNICE=OFF # Capabilities don't work inside flatpak
- -DWIVRN_FEATURE_STEAMVR_LIGHTHOUSE=OFF
- -DFETCHCONTENT_FULLY_DISCONNECTED=ON
- -DFETCHCONTENT_BASE_DIR=deps
- -DGIT_DESC=WIVRN_GIT_DESC
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 103 KiB

+11
View File
@@ -263,12 +263,23 @@ if (WIVRN_BUILD_SERVER_LIBRARY)
# Workaround as generate_openxr_runtime_manifest_at_install uses target name as library path
add_library(monado_wivrn ALIAS monado)
if (WIVRN_OPENXR_MANIFEST_ABI)
if (CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "i.86")
set(_filename openxr_wivrn.i686.json)
else()
set(_filename openxr_wivrn.${CMAKE_C_COMPILER_ARCHITECTURE_ID}.json)
endif()
else()
set(_filename openxr_wivrn.json)
endif()
generate_openxr_runtime_manifest_at_install(
${_extra_args}
RUNTIME_TARGET ${RUNTIME_TARGET}
DESTINATION share/openxr/1
RELATIVE_RUNTIME_DIR ${CMAKE_INSTALL_LIBDIR}/wivrn
LIBMONADO monado_wivrn
OUT_FILENAME ${_filename}
)
install(TARGETS ${RUNTIME_TARGET} monado
+67 -21
View File
@@ -23,29 +23,42 @@
#include "utils/overloaded.h"
#include "utils/xdg_base_directory.h"
#include "wivrn_config.h"
#include <algorithm>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <nlohmann/json.hpp>
static std::vector<std::filesystem::path> filter_files(const std::filesystem::path & directory, const std::string prefix)
{
std::vector<std::filesystem::path> result;
for (const auto & file: std::filesystem::directory_iterator{directory})
{
if (file.path().filename().native().starts_with(prefix))
result.push_back(file.path());
}
return result;
}
namespace wivrn
{
std::filesystem::path active_runtime::manifest_path()
std::vector<std::filesystem::path> active_runtime::manifest_path()
{
const std::filesystem::path install_location = "share/openxr/1/openxr_wivrn.json";
const std::filesystem::path location = "share/openxr/1";
const std::filesystem::path prefix = "openxr_wivrn";
// Check if in a flatpak
if (auto path = flatpak_key(flatpak::section::instance, "app-path"))
return *path / install_location.relative_path();
return filter_files(*path / location, prefix);
// Check if running from build directory
auto exe = std::filesystem::read_symlink("/proc/self/exe");
auto dev_manifest = exe.parent_path().parent_path() / "openxr_wivrn-dev.json";
if (std::filesystem::exists(dev_manifest))
return dev_manifest;
return {dev_manifest};
// Assume we are installed
return std::filesystem::path(WIVRN_INSTALL_PREFIX) / install_location;
return filter_files(WIVRN_INSTALL_PREFIX / location, prefix);
}
std::filesystem::path active_runtime::openvr_compat_path()
@@ -111,18 +124,51 @@ static const std::filesystem::path & backup_and_symlink(
return location;
}
static std::string get_abi(const std::filesystem::path & filename)
{
std::string abi = filename.stem().extension();
// https://registry.khronos.org/OpenXR/specs/1.0/loader.html#architecture-identifiers
if (not abi.empty() and
std::ranges::contains(std::array{
"x32",
"x86_64",
"i686",
"aarch64",
"armv7a-vfp",
"armv5te",
"mips64",
"mips",
"ppc64",
"ppc64el",
"s390x",
"hppa",
"alpha",
"ia64",
"m68k",
"m68k",
"riscv64",
"sparc64",
},
abi.substr(1)))
return abi;
return "";
}
active_runtime::active_runtime() :
pid(getpid())
{
try
for (const auto & manifest: manifest_path())
{
this->active_runtime_json = backup_and_symlink(
xdg_config_home() / "openxr/1/active_runtime.json",
manifest_path());
}
catch (std::exception & e)
{
std::cerr << "Cannot set active OpenXR runtime: " << e.what() << std::endl;
try
{
active_runtime_json.push_back(backup_and_symlink(
xdg_config_home() / ("openxr/1/active_runtime" + get_abi(manifest) + ".json"),
manifest));
}
catch (std::exception & e)
{
std::cerr << "Cannot set active OpenXR runtime: " << e.what() << std::endl;
}
}
try
@@ -153,17 +199,17 @@ active_runtime::~active_runtime()
{
if (pid != getpid())
return;
try
for (const auto & manifest: active_runtime_json)
{
if (not active_runtime_json.empty())
try
{
std::filesystem::remove(active_runtime_json);
move_file(backup_name(active_runtime_json), active_runtime_json);
std::filesystem::remove(manifest);
move_file(backup_name(manifest), manifest);
}
catch (std::exception & e)
{
std::cerr << "Cannot unset active OpenXR runtime " << manifest << ": " << e.what() << std::endl;
}
}
catch (std::exception & e)
{
std::cerr << "Cannot unset active OpenXR runtime: " << e.what() << std::endl;
}
try
+3 -2
View File
@@ -20,13 +20,14 @@
#include <filesystem>
#include <unistd.h>
#include <vector>
namespace wivrn
{
class active_runtime
{
std::filesystem::path active_runtime_json;
std::vector<std::filesystem::path> active_runtime_json;
std::filesystem::path openvr_manifest;
pid_t pid;
@@ -36,7 +37,7 @@ public:
active_runtime & operator=(const active_runtime &) = delete;
~active_runtime();
static std::filesystem::path manifest_path();
static std::vector<std::filesystem::path> manifest_path();
static std::filesystem::path openvr_compat_path();
};
} // namespace wivrn