Vr not working correctly, drm leasing issue

for the past 2 days i’ve been trying to get vr working on nixos using alvr and also tried wivrn

i spent more time configuring alvr so i’ll explain that first.

i installed the alvr package in home manager from the unstable branch. i also installed sidequest and android device debugger (adb) with the required udev rules and successfully installed the app to the headset.

i could connect just find to alvr and it said it was streaming. but i get “Failed to connect to headset (496)”

there is that issue regarding the error but im not sure how relevant this is to me but im putting it here anyway.

but it suggests something about the compositor. i know valve says that most wlroots compositors work so i tried:

  • hyprland from 24.11 and from the hyprland git repo (which i know isnt wlroots based but should work)
  • sway, 24.11
  • river, which is less mature but is wlroots based, also from 24.11 because unstable wouldnt open steam for some reason

all got the same error and all got the same error regarding drm in vrcompositor.txt (~/.local/share/Steam/logs/vrcompositor.txt) with the last 6 - 7 lines stating that it can’t initialise drm. i cant get my exact logs rn but from this issue from hyprland (SteamVR fails to DRM lease display · Issue #7776 · hyprwm/Hyprland · GitHub)
i get the same error.
for them it worked on sway but i get the same error on sway and river.

Fri Sep 13 2024 16:38:58.920031 [Info] - HMD deviceUUID is b00000000
Fri Sep 13 2024 16:38:58.920056 [Info] - Tried to find direct display through Wayland: (nil)
Fri Sep 13 2024 16:38:58.920085 [Error] - CHmdWindowSDL: Failed to create direct mode surface
Fri Sep 13 2024 16:38:58.920145 [Error] - CHmdWindowSDL: VR requires direct mode.
Fri Sep 13 2024 16:38:58.920228 [Error] - Error making window!
Fri Sep 13 2024 16:38:58.945028 [Info] - Failed to kill gpu-trace
Fri Sep 13 2024 16:38:58.945125 [Info] - Failed to initialize compositor
Fri Sep 13 2024 16:38:58.945151 [Info] - Failed to start compositor: VRInitError_Compositor_CannotDRMLeaseDisplay

when i try wivrn properly that might work, i know wivrn doesnt use steamvr at all but maybe thats how i can get it to work. apparently i have to configure opencomposite, so far all i have done is taken the config for wivrn from the nixos vr wiki

So wich vr Headset are you using?
And are you using it wireless of connecting with cable (probably cable when you use adb)
If you use the quest 3 try following in your configuration:

  services.udev.packages = [
      (pkgs.writeTextFile {
        name = "50-oculus.rules";
        text = ''
          SUBSYSTEM="usb", ATTR{idVendor}=="2833", ATTR{idProduct}=="0186", MODE="0660" group="plugdev", symlink+="ocuquest%n"
        '';
        destination = "/etc/udev/rules.d/50-oculus.rules";
      } )
      (pkgs.writeTextFile {
        name = "52-android.rules";
        text = ''
          SUBSYSTEM=="usb", ATTR{idVendor}=="2833", ATTR{idProduct}=="0186", MODE="0666", OWNER=matt;
        '';
        destination = "/etc/udev/rules.d/52-android.rules";
      })
    ];  

You actually don’t need the adb debugger.
In alvr:
Switch the connection streaming protocol to TCP in Settings > Connection.
If your headset is detected, click “Trust.” Click “Edit”, “Add new” and change the IP address to 127.0.0.1.
If your headset is not detected, click “Add device manually” and use the IP address 127.0.0.1. Use the hostname displayed on your headset screen.

Then in sidequest:

Ensure SideQuest is running, and the headset has authorized the USB connection to the PC
Open the 'Run ADB Commands' menu in SideQuest (top-right, box with an arrow inside it)
Click 'Custom Command' and run these adb commands:
    adb forward tcp:9943 tcp:9943
    adb forward tcp:9944 tcp:9944
    These commands will need to be run every time you (re)connect your headset.
Keep SideQuest opened until you want to close the connection.

In your quest you then need to go to your notification and click on the thing that pops up when connecting to your PC per cable (forgot the name of the option)

1 Like

im using it wirelessly with the quest 3 but i could try the cable

when you are in the alvr app on the quest you can see a ip. Try to put it in manually.
also have you set the openfirewall?

programs.alvr.openFirewall = true;
1 Like

my config is

programs.alvr = {
  enable = true;
  package = unstable.alvr;
  openFirewall = true;
};

its in configuration.nix and not home.nix

could you try the stable version?
so just

programs.alvr = {
  enable = true;
  openFirewall = true;
};

when i do that it doesn’t even show up in steamvr and the client won’t connect to the server (alvr stable)

In wich order are you starting it.
First start alvr and then start steamvr from alvr.

thats how im running it
according to ALVR: Steam crash or pitch black view in headset · Issue #359680 · NixOS/nixpkgs · GitHub, it should be working for me

CPU: AMD Ryzen 9 9900X
GPU: 7900XTX

also the alvr needs to be enabled in configuration.nix and not in home.nix right? because for me its configuration.nix, im just making sure

yeah alvr in the configuration not in homemanager.
also have you tried it with cable?
also have you set following lauch option in steam for steamvr:

WAYLAND_DISPLAY='' QT_QPA_PLATFORM=xcb ~/.local/share/Steam/steamapps/common/SteamVR/bin/vrmonitor.sh %command%
1 Like

not with the WAYLAND_DISPLAY='', i’ll try that now
if that doesnt work then i’ll try a cable

yeah im still getting Failed to connect to headset display (496)
i’ll try with a cable now

so i just tried it with my quest 3 wireless and got the same issue with same error code.
However i got it resolved by going into the settings of alvr
Over to the connection tab and setting the streamprotocal to udp and restarting Steamvr.

1 Like

mine was on udp though and it wasn’t working, what is your alvr version?

ALVR streamer v20.11.1

1 Like

mine is the same
whats your cpu and gpu then? also both amd?

cpu: Intel Core i5 14600 KF
GPU: Nvidia 4060 TI 16gb
I am on nixos unstable.
Have you tried connecting your quest 3 manually in alvr?
Wich steamvr version are you using?

1 Like

steamvr 2.8.8 and yeah i’ve tried connecting manually but that gives the same result

i just checked the logs and it says it cant find a direct display through RandR or Vulkan WSI

in the list of monitors supposedly attached, they are also 1080p which are my displays

could you try to reinstall Steamvr changing its Version to Steamvr Beta

1 Like

doesnt work sadly
its frustrating since pressing identify controller on each one literally makes the haptics buzz how they’re supposed to, its literally just the display

edit: just tried using a cable and that doesnt work either sadly