Compare commits

..
Author SHA1 Message Date
dependabot[bot] b9984c2b62 Bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-06-22 14:33:53 +00:00
14 changed files with 69 additions and 146 deletions

No files matched your search

+7 -7
View File
@@ -40,7 +40,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
submodules: recursive
- if: matrix.platform == 'linux'
@@ -69,7 +69,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
submodules: recursive
- name: Get tags
@@ -89,7 +89,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
submodules: recursive
- name: Set up JDK 17
@@ -108,7 +108,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
submodules: recursive
- name: Get tags
@@ -137,7 +137,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
submodules: recursive
- name: Get tags
@@ -170,7 +170,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
submodules: recursive
- name: Get tags
@@ -255,7 +255,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
submodules: recursive
- name: Get tags
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
submodules: recursive
- name: pull-request
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
ref: pontoon
submodules: recursive
-3
View File
@@ -34,9 +34,6 @@
# ignore gradle build folder
build/
# created by clangd for index cache
.cache/
# direnv has been claimed for Nix usage
.direnv/
.devenv
-2
View File
@@ -1,7 +1,5 @@
# Contributing to SlimeVR
Please follow general contribution guidelines: [CONTRIBUTING.md](https://github.com/SlimeVR/.github/blob/main/profile/CONTRIBUTING.md).
This document describes essential knowledge required to contribute to the SlimeVR Server.
### Prerequisites
-12
View File
@@ -1,12 +0,0 @@
$ErrorActionPreference = "Stop"
if ((Get-Command "clang-format" -ErrorAction SilentlyContinue) -eq $null) {
$errorObj = New-Object System.IO.FileNotFoundException("clang-format is not installed, please install clang-format via your package manager (e.g. winget/chocolatey/scoop) and re-run the script")
throw $errorObj
}
$SourceFiles = Get-ChildItem -Path '.\src\' -Recurse -Include "*.cpp","*.hpp"
foreach ($file in $SourceFiles) {
Write-Output "Formatting $(Resolve-Path -Relative $file.FullName)"
clang-format -i "$($file.FullName)"
}
-12
View File
@@ -1,12 +0,0 @@
#!/bin/bash
if ! command -v clang-format >/dev/null 2>&1; then
echo "clang-format is not installed, please install clang-format via your package manager (e.g. pacman/apt/dnf/winget) and re-run the script" >&2
exit 1
fi
find src/ \( \
-iname '*.cpp' \
-or -iname '*.hpp' \
\) \
-exec echo Formatting {} \; \
-exec clang-format -i {} \;
+11 -26
View File
@@ -102,34 +102,19 @@ static void signal_handler(int signal) {
int main() {
auto &logger = Logger::get();
// Steam and SteamVR respectively set these environment variables on applications that
// they spawn, which the SteamVR client library (vrclient) will then use as the
// application key when initiating the connection with vrserver. This may not
// be ideal if we are launched by another Steam or OpenVR application, as we will inherit
// their app key through the environment, which means SteamVR will load the wrong bindings.
// A real-world example of this is if someone uses an application such as OpenVR-Autostarter
// to start the SlimeVR Server. OpenVR-Autostarter installs an application manifest with the
// app key "dreiekk.openvr-autostarter", so when it starts SlimeVR Server, which then starts us,
// the STEAMVR_APPKEY="dreiekk.openvr-autostarter" environment variable will be set.
//
// We want SteamVR to use the appkey of the Steam version of our application if possible.
// Unfortunately, we cannot install an application vrmanifest to force the app key,
// as SteamVR requires a binary path in the manifest to consider it valid. We do not want to install
// a manifest with a binary path because we want the SlimeVR Server to start us when the
// driver initiates a connection, rather than getting auto-started by SteamVR.
//
// This is not documented anywhere publicly, see CVRClient::SendConnectMessage in vrclient instead.
constexpr const char *STEAM_APPID = "3245490";
constexpr const char *STEAMVR_APPKEY = "steam.overlay.3245490";
// Steam and SteamVR sets these environment variables on applications that it
// spawns, but if an app spawned by Steam then spawns a child that initialises
// OpenVR, SteamVR will give the child the appkey of the root application it
// is a descendant of, e.g. if SteamVR launches SlimeVR as an overlay,
// it will set SteamAppId="3245490" and STEAMVR_APPKEY="steam.overlay.3245490"
// which breaks our bindings. We want SteamVR to use a generated appkey if
// possible.
#ifdef _WIN32
SetEnvironmentVariableA("SteamAppId", STEAM_APPID);
SetEnvironmentVariableA("STEAMVR_APPKEY", STEAMVR_APPKEY);
SetEnvironmentVariableA("SteamAppId", nullptr);
SetEnvironmentVariableA("STEAMVR_APPKEY", nullptr);
#else
setenv("SteamAppId", STEAM_APPID, 1);
setenv("STEAMVR_APPKEY", STEAMVR_APPKEY, 1);
unsetenv("SteamAppId");
unsetenv("STEAMVR_APPKEY");
#endif
try {
+6 -17
View File
@@ -1,9 +1,7 @@
#include "solarxr.hpp"
#include "logger.hpp"
#include "paths.hpp"
#include <stdexcept>
#include <string>
#if defined(__linux__)
#include <sys/socket.h>
@@ -16,24 +14,15 @@
namespace fs = std::filesystem;
static std::string getenvSafe(const char *env) {
char *v = getenv(env);
if (v == nullptr)
return {};
return v;
}
fs::path SolarXRConnection::getSocketPath() {
using namespace std::string_view_literals;
#if defined(__linux__)
#define MAKE_SOCKET_PATH(PATH) \
std::make_pair(PATH##sv, getenvSafe(PATH))
std::make_pair(PATH##sv, static_cast<const char *>(getenv(PATH)))
constexpr std::string_view socketName = "SlimeVRRpc";
std::array<std::pair<std::string_view, fs::path>, 5> socketPaths{
std::array<std::pair<std::string_view, const char *>, 4> socketPaths{
MAKE_SOCKET_PATH("SLIMEVR_SOCKET_DIR"),
{ "Steam socket path", Paths::getDataPath() },
MAKE_SOCKET_PATH("XDG_RUNTIME_DIR"),
MAKE_SOCKET_PATH("TMPDIR"),
{ "/tmp", "/tmp" }
@@ -42,17 +31,17 @@ fs::path SolarXRConnection::getSocketPath() {
#undef MAKE_SOCKET_PATH
for (auto [name, path] : socketPaths) {
if (path.empty()) {
if (path == nullptr) {
Logger::get().info(
"Skipping socket directory '{}' because it doesn't exist", name);
"Skipping socket directory {} because it doesn't exist", name);
continue;
}
fs::path socketPath = path / socketName;
fs::path socketPath = fs::path(path) / socketName;
if (fs::exists(socketPath))
return socketPath;
Logger::get().info(
"Skipping socket directory '{}' because socket does not exist", name);
"Skipping socket directory {} because socket does not exist", name);
}
#elif defined(_WIN32)
throw std::logic_error(
+5 -3
View File
@@ -690,15 +690,17 @@ settings-general-gesture_control-trackers = { $amount ->
settings-general-gesture_control-yawResetEnabled = Enable tap to yaw reset
settings-general-gesture_control-yawResetDelay = Yaw reset delay
settings-general-gesture_control-yawResetTaps = Taps for yaw reset
settings-general-gesture_control-yawResetTracker = Yaw reset tracker
settings-general-gesture_control-yawResetTracker = Yaw Reset Tracker
settings-general-gesture_control-fullResetEnabled = Enable tap to full reset
settings-general-gesture_control-fullResetDelay = Full reset delay
settings-general-gesture_control-fullResetTaps = Taps for full reset
settings-general-gesture_control-fullResetTracker = Full reset tracker
settings-general-gesture_control-fullResetTracker = Full Reset Tracker
settings-general-gesture_control-mountingResetEnabled = Enable tap to perform mounting calibration
settings-general-gesture_control-mountingResetDelay = Mounting calibration delay
settings-general-gesture_control-mountingResetTaps = Taps for mounting calibration
settings-general-gesture_control-mountingResetTracker = Mounting reset tracker
settings-general-gesture_control-mountingResetTracker = Mounting Reset Tracker
settings-general-gesture_control-yawResetTracker-title = Yaw Reset Tracker
settings-general-gesture_control-fullResetTracker-title = Full Reset Tracker
# The number of trackers that can have higher acceleration before a tap is rejected
settings-general-gesture_control-numberTrackersOverThreshold = Trackers over threshold
settings-general-gesture_control-numberTrackersOverThreshold-description = Increase this value if tap detection is not working. Do not increase it above what is needed to make tap detection work as it would cause more false positives.
@@ -1317,7 +1317,7 @@ export function GeneralSettings() {
</div>
<div className="grid sm:grid-cols-3 gap-5 pb-2">
<div>
<Typography bold>
<Typography variant="section-title">
{l10n.getString(
'settings-general-gesture_control-yawResetTracker'
)}
@@ -1331,21 +1331,7 @@ export function GeneralSettings() {
/>
</div>
<div>
<Typography bold>
{l10n.getString(
'settings-general-gesture_control-fullResetTracker'
)}
</Typography>
<Dropdown
display="block"
control={control}
placeholder={''}
name="tapDetection.fullResetTracker"
items={bodyParts}
/>
</div>
<div>
<Typography bold>
<Typography variant="section-title">
{l10n.getString(
'settings-general-gesture_control-mountingResetTracker'
)}
@@ -1358,6 +1344,20 @@ export function GeneralSettings() {
items={bodyParts}
/>
</div>
<div>
<Typography variant="section-title">
{l10n.getString(
'settings-general-gesture_control-fullResetTracker'
)}
</Typography>
<Dropdown
display="block"
control={control}
placeholder={''}
name="tapDetection.fullResetTracker"
items={bodyParts}
/>
</div>
</div>
</div>
<div className="grid sm:grid-cols-3 gap-5 pb-2">
@@ -71,7 +71,6 @@ class AndroidHIDManager(
val serial = hidDevice.serialNumber ?: "Unknown USB Device ${hidDevice.deviceId}"
this.devicesBySerial[serial]?.let {
this.devicesByHID[hidDevice] = it
this.lastDataByHID[hidDevice] = 0
synchronized(this.devices) {
for (id in it) {
val device = this.devices[id]
@@ -188,7 +187,7 @@ class AndroidHIDManager(
}
// LogManager.info("[TrackerServer] HID received $packetCount tracker packets")
} else {
lastDataByHID[hidDevice] = lastDataByHID.getOrDefault(hidDevice, 0) + 1 // increment last data received
lastDataByHID[hidDevice] = lastDataByHID[hidDevice]!! + 1 // increment last data received
}
}
if (!devicesPresent) {
@@ -58,6 +58,11 @@ class BindingsProviderManager : Runnable {
"BindingsProviderManager already running"
}
val binaryPath = getBinaryPath() ?: throw RuntimeException("Unable to find bindings provider binary")
process = ProcessBuilder(binaryPath.toString())
.redirectErrorStream(true)
.start()
LogManager.info("[BindingsProviderManager] Started process")
watcherThread = Thread(this, "Bindings provider watcher")
watcherThread!!.start()
}
@@ -72,17 +77,6 @@ class BindingsProviderManager : Runnable {
override fun run() {
try {
// Give SteamVR a bit more time to initialise everything
// For some users, starting the executable immediately may cause startup failures
// This feels like a bit of a hack, but whatever
Thread.sleep(3000L)
val binaryPath = getBinaryPath() ?: throw RuntimeException("Unable to find bindings provider binary")
process = ProcessBuilder(binaryPath.toString())
.redirectErrorStream(true)
.start()
LogManager.info("[BindingsProviderManager] Started process")
val interval = 1000L / 30L
while (process?.isAlive == true) {
Thread.sleep(interval)
@@ -54,23 +54,6 @@ class DesktopHIDManager(name: String, private val trackersConsumer: Consumer<Tra
}
}
private fun onHidDeviceReattached(hidDevice: HidDevice, deviceList: MutableList<Int>, serial: String) {
this.devicesByHID[hidDevice] = deviceList
this.lastDataByHID[hidDevice] = 0
synchronized(this.devices) {
for (id in deviceList) {
val device = this.devices[id]
for (value in device.trackers.values) {
if (value.status == TrackerStatus.DISCONNECTED) {
value.status = TrackerStatus.OK
}
value.heartbeat()
}
}
}
LogManager.info("[TrackerServer] Linked HID device reattached: $serial")
}
private fun checkConfigureDevice(hidDevice: HidDevice) {
if (HIDCommon.matchesAny(hidDevice.vendorId, hidDevice.productId)) {
val serial = hidDevice.serialNumber ?: "Unknown HID Device"
@@ -84,7 +67,16 @@ class DesktopHIDManager(name: String, private val trackersConsumer: Consumer<Tra
// val product = hidDevice.product
// val manufacturer = hidDevice.manufacturer
this.devicesBySerial[serial]?.let {
onHidDeviceReattached(hidDevice, it, serial)
this.devicesByHID[hidDevice] = it
synchronized(this.devices) {
for (id in it) {
val device = this.devices[id]
for (value in device.trackers.values) {
if (value.status == TrackerStatus.DISCONNECTED) value.status = TrackerStatus.OK
}
}
}
LogManager.info("[TrackerServer] Linked HID device reattached: $serial")
return
}
@@ -126,11 +118,7 @@ class DesktopHIDManager(name: String, private val trackersConsumer: Consumer<Tra
currentThread().interrupt()
break
}
try {
dataRead()
} catch (e: Exception) {
LogManager.severe("[TrackerServer] HID data read failed: ${e.message}", e)
}
dataRead() // not in try catch?
}
}
@@ -150,11 +138,7 @@ class DesktopHIDManager(name: String, private val trackersConsumer: Consumer<Tra
currentThread().interrupt()
break
}
try {
deviceEnumerate()
} catch (e: Exception) {
LogManager.severe("[TrackerServer] HID device enumerate failed: ${e.message}", e)
}
deviceEnumerate() // not in try catch?
}
}
@@ -214,7 +198,7 @@ class DesktopHIDManager(name: String, private val trackersConsumer: Consumer<Tra
}
// LogManager.info("[TrackerServer] HID received $packetCount tracker packets")
} else {
lastDataByHID[hidDevice] = lastDataByHID.getOrDefault(hidDevice, 0) + 1
lastDataByHID[hidDevice] = lastDataByHID[hidDevice]!! + 1 // increment last data received
}
}
if (!devicesPresent) {
@@ -258,13 +242,12 @@ class DesktopHIDManager(name: String, private val trackersConsumer: Consumer<Tra
}
// Quickly reattaching a device may not be detected, so always try to open existing devices
for (device in devicesByHID.keys) {
val lastData = lastDataByHID.getOrDefault(device, 0)
// a receiver sends keep-alive data at 10 packets/s
if (lastData > 100) { // try to reopen device if no data was received recently (about >100ms)
if (lastData < 10000) {
if (lastDataByHID[device]!! > 100) { // try to reopen device if no data was received recently (about >100ms)
if (lastDataByHID[device]!! < 10000) {
LogManager.info("[TrackerServer] Reopening device ${device.serialNumber} after no data received")
lastDataByHID[device] = 10000 // flag once
} else if (lastData < 20000) {
} else if (lastDataByHID[device]!! < 20000) {
LogManager.info("[TrackerServer] Repeatedly reopening device ${device.serialNumber}")
lastDataByHID[device] = 20000 // flag twice
}