ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.11k stars 1.28k forks source link

Prevent VRApplication_Background init from launching VRCompositor #1459

Open Virgile-Dauge opened 4 years ago

Virgile-Dauge commented 4 years ago

Hi,

I'm currently using SteamVR's impressive tracking capacities for scientific purposes (see the paper for further details). Can you give me some insights about the minimal config to use SteamVR (1.14.16) and openvr for tracking only (possibly without UI) ?

Hardware setup

Almost working solution

I used to be able to run it without HMD, or compositor in the past, simply by changing few settings files and launching vrmonitor process in a python program with Popen on ubuntu 18.04. But since I upgraded to 20.04, VRCompositor is also launched, asking my gpuless station to render a 3D scene.

  1. Changed the following entries in $STEAM_DIR/config/steamvr.vrsettings
{
"steamvr" : {
      "activateMultipleDrivers" : true,
      "forcedDriver" : "null",
      "requireHmd" : false,
   },
}
  1. Changed this entry in $STEAM_DIR/steamapps/common/SteamVRdrivers/null/resources/settings/default.vrsettings

    {
    "driver_null": {
        "enable": true,
    },
    }
  2. Launch Steamvr with runtime in a python script

    steam_runtime = os.path.expanduser('~/.steam/steam/ubuntu12_32/steam-runtime/run.sh')
    vr_monitor = os.path.expanduser('~/.steam/steam/steamapps/common/SteamVR/bin/vrmonitor.sh')
    proc = subprocess.Popen([steam_runtime, vr_monitor])
  3. initializing openvr with VRApplication_Utility

  4. Getting poses with IRVSystem::getDeviceToAbsoluteTrackingPose

Issue with the almost working solution

Step 3 is launching monitor, room setup and Vrcompositor, beahavior which I want to prevent. I don't care about the UI, I just want steamVR to be able to compute tracker poses.

What I tested to avoid this

I tried launching only vrserver:

LD_LIBRARY_PATH=$HOME/.steam/steam/steamapps/common/SteamVR/bin/linux64 ~/.steam/steam/steamapps/common/SteamVR/bin/linux64/vrserver -keepalive

But VRcompositor is launched when i initialize openvr with different options :

And i did not succeed to get poses with this VRApplication_utility initialization.

TL;DR

What bin/script must i run to have only the pose computation functionality I get with the way I run stuff in step3 but without UI ?

Thanks for opening the nice tool you are supporting :+1: and maybe for your help too :)

Virgile-Dauge commented 4 years ago

Launching the server only works :

LD_LIBRARY_PATH=$HOME/.steam/steam/steamapps/common/SteamVR/bin/linux64 bash ~/.steam/steam/ubuntu12_32/steam-runtime/run.sh ~/.steam/steam/steamapps/common/SteamVR/bin/linux64/vrserver

Then initializing openvr with VRApplication_Background launches VRCompositor, which should not be the case for a background app ? The IVRSytem still works after killing (killall -s 9 vrcompositor) VRCompositor so it's not required for the tracking system to work.

How to prevent vrcompositor launch instead of brutally killing it ?