Skip to content

Instantly share code, notes, and snippets.

@WebFreak001
Last active July 11, 2023 19:09
Show Gist options
  • Save WebFreak001/f8d5852c795e3b5b1fddfc1911e6babb to your computer and use it in GitHub Desktop.
Save WebFreak001/f8d5852c795e3b5b1fddfc1911e6babb to your computer and use it in GitHub Desktop.
Getting my Valve Index to run flawlessly on ArchLinux with i3wm

Getting my Valve Index to run flawlessly on ArchLinux with i3wm

I've bought the Valve Index VR headset and wanted to play on Linux. I had done a lot of tinkering with my Linux Machine up to this point so quite a few things on the headset initially had issues working alright.

I have listed all of the problems I encountered on ArchLinux with Valve Index and Steam VR in this post and how I managed to solve nearly all of them.

When I first plugged in my headset, turned on the controllers and started SteamVR it had been doing a lot of things: it prompted me to confirm that super user / administrator is needed to complete the installation, it opened a huge window with the VR view in it and complained that direct mode wasn't enabled. In the VR setup log it also complained about not being able to run some SETCAP command. SteamVR tried to start the room setup, however the window only showed a title bar and immediately crashed without drawing anything. I have also tried a xrandr call to turn on the headset monitor and manually move the big VR display to it and fullscreen it with i3, but this was a bad solution and later on I managed to instead fix and use direct mode.

When I eventually got the VR setup working and set up my room, I put on my headset. I noticed when I move my head around that it was kind of high latency, so I would notice there was like a few frames of delay there. I tried to bump up the display frequency of the display, but I think my GPU wasn't powerful enough for it. On 120 Hz I had a weird glitched horizontal line in the middle of my screen and the bottom half was basically a frame behind. On 144 Hz the display kept turning off and on just showing gray, basically flickering a lot. For now I don't have a solution to this yet and keep playing in 90 Hz, which works fine if you change the settings as described below. UPDATE: this was most likely because my GPU wasn't powerful enough. I got a new GPU now (Radeon 5700 XT) and now both 120 Hz and 144 Hz run absolutely fine. Also if you experience issues on an AMD (CPU & GPU) system with your system freezing and crashing under high GPU load, check out the following links: 1 2 3 4

I changed the BIOS settings for C-State and IOMMU and some others mentioned in the links and added pcie_aspm=off to my GRUB cmdline. Not sure what exactly fixed the GPU freezes but at least they are gone now.

The next issue I had was that audio wasn't playing through the speakers of the Valve Index on my Linux machine. Additionally the microphone was being detected by PulseAudio but it was constantly not generating any input. I managed to fix both of these issues however as described below.

Problems & Fixes:


Problem: VR room setup doesn't launch on Linux

Solution: I had on my first try a very peculiar bug where the VR room setup window from Steam VR would not load and just crash. I tried a lot to get this working, but in the end the solution was to reinstall SteamVR. I did this after SteamVR had successfully installed new firmware on my Headset and Controllers, so this might be a neccessary step to do before too.


Problem: Sudo / Administrator prompt doesn't open for VR Setup on i3

Solution: As I was running i3 but didn't have the GUI password prompts for sudo requests configured yet, no GUI window to set this up popped up and SteamVR probably did nothing. The solution was to install polkit and also install some authentication agent, in my case I installed polkit-gnome using trizen -S polkit-gnome. Important here is that this is not a SystemD service but rather an application you will have to launch manually in order to make GUI password prompts pop up. Start the path as described on the ArchLinux wiki manually and keep it running in the background if you want to get the password prompt for this single session. If you run i3 and want to have the password prompt always work, just launch the authentication agent from your i3 launch script.

You may need to reinstall SteamVR in order to make it show the admin prompt again. After doing this direct mode should be enabled and the huge VR output window should no longer be on your desktop but rather in the VR display, hooray!


Problem: High latency in VR when moving head around

Solution: There was a setting in Video (with Show Advanced Settings) called "Advanced Supersample Filtering" enabled on my headset by default. Turning this off and (manually) restarting SteamVR had greatly reduced the latency when moving my head around, making it feasable to use for a long period of time.

I'm also running i3 with picom (previously compton), however this shouldn't make a difference if the headset runs in Direct Mode as solved in the solution above. If you want to make extra sure that it runs in direct mode, open the Developer -> Developer Settings (from the SteamVR dropdown menu, not from inside the SteamVR settings) and click on the "Enable Direct Display Mode" button.


Problem: Flickering VR display, broken VR display view, VR display artifacts

Solution: Try turning off SteamVR and plugging out and in the whole Valve Index headset. If you run on high refresh rates (>90Hz) you might want to turn them down. Also try to reduce the graphics settings inside the games you are playing.


Problem: Valve Index Audio doesn't work on Linux

Solution: as described on the SteamVR for linux page on Valve's GitHub, first make sure you've got the latest Mesa version, Linux kernel and Xorg server version. After this it should theoretically start working.

I also had another problem which caused it to not work: I had amdgpu.dc=0 in my Grub GRUB_CMDLINE_LINUX_DEFAULT value. I did this a while ago and forgot that I did that, however after removing the setting, calling grub-mkconfig and rebooting the PC the problem was gone and (both my monitor and) the Valve Index could play sound again. You can also add amdgpu.dc=1, however this has long been the default in the kernel now, so you shouldn't need to do this as long as you remove the 0 value.


Problem: Valve Index Microphone doesn't work on Linux

Solution: Make sure your system is up-to-date as described in the Valve README linked above. I had modified my /etc/pulse/daemon.conf before to make wine run better, however this has introduced this issue to me. To fix it add or change

default-sample-rate = 48000

in your /etc/pulse/daemon.conf and run pulseaudio -k to kill the current pulseaudio session.

I found the issue here and the solution was burried in the comments here.

A collaborator, probably Valve employee, said on 4 Sep 2019:

We are working with the graphics driver vendors to address the issue.

Note that the Index earphones are what require the 48KHz sample rate, which is currently being set to 44.1KHz. The invalid sample rate is causing audio artifacts on the Index Hummingbird headset and causing the microphone controller to constantly reset.

So this issue might be fixed soon too.

@nydn
Copy link

nydn commented Aug 26, 2020

Hey,
Thanks for sharing this. I'm also stuck on Room Setup crash and already reinstalled SteamVR a few times, but that did not help.
Are you on SteamVR beta? If yes, which one?

@nydn
Copy link

nydn commented Aug 26, 2020

Also,in Arch which repository are you using for the mesa and vulkan packages? The standard or the mesa-git?

@WebFreak001
Copy link
Author

I'm using the standard repositories, here are my software versions:

  • linux-zen 5.8.3.zen1-1
  • linux-zen-headers 5.8.3.zen1-1
  • xf86-video-amdgpu 19.1.0-2
  • mesa 20.1.6-1
  • vulkan-icd-loader 1.2.151-1
  • vulkan-radeon 20.1.6-1
  • steam 1.0.0.66-1

@nydn
Copy link

nydn commented Aug 26, 2020

Thanks for your help, I managed to find the problem, it was with AMDVLK. I'm not sure how it works internally, but it was loaded first instead of libvulkan. After deleting the AMDVLK config files ( amd_icd[32|64].json) from the loader directory "/usr/share/vulkan/icd.d" , everything works fine.

@WebFreak001
Copy link
Author

good to know! If you think this document is helpful, please consider giving it a star :)

@techy2493
Copy link

Hi There, this is a great guide and I really appreciate your developing it. The polkit thing was a real lifesaver.

I am still stuck with "Please plug in your VR headset" with the latest graphics drivers, followed this guide for steamvr, and an up to date as of this moment fresh arch install. Was wondering if you've had any more recent experiences that might help point me in the right direction? I'm not seeing anything useful if the logs I've gone through for steamvr, but I don't really know what a "good" log on arch looks like.

@WebFreak001
Copy link
Author

@techy2493 I had an issue like that before, but the headset used to work for a long while before then. In that case I wrote to steam support because the issue was a faulty cable / broke after a while of usage and also didn't work under a Windows PC.

If you have a brand new headset it should just work though. If you are on a wayland desktop, it needs to support certain extensions to support VR. I know wlroots based ones (sway and others) implement it and it's upcoming in the next KDE release.

You can also try changing the SteamVR version to an older one to see if it works with an old version (the newest ones currently have some stuttering issues on AMD cards) - Steam releases it under the "linux_v1.14" beta under the "betas" category when you right-click -> properties SteamVR in your library.

Additionally on Arch make sure you have the vulkan-icd-loader (and the 32 bit version) package installed and check that there is just two files with the same filename + i686/x86_64 in the /usr/share/vulkan/icd.d folder like mentioned above.

If nothing works, try if it actually first runs on a Windows PC instead, it should just work there and if it doesn't, you should rather contact steam support.

@techy2493
Copy link

@techy2493 I had an issue like that before, but the headset used to work for a long while before then. In that case I wrote to steam support because the issue was a faulty cable / broke after a while of usage and also didn't work under a Windows PC.

If you have a brand new headset it should just work though. If you are on a wayland desktop, it needs to support certain extensions to support VR. I know wlroots based ones (sway and others) implement it and it's upcoming in the next KDE release.

You can also try changing the SteamVR version to an older one to see if it works with an old version (the newest ones currently have some stuttering issues on AMD cards) - Steam releases it under the "linux_v1.14" beta under the "betas" category when you right-click -> properties SteamVR in your library.

Additionally on Arch make sure you have the vulkan-icd-loader (and the 32 bit version) package installed and check that there is just two files with the same filename + i686/x86_64 in the /usr/share/vulkan/icd.d folder like mentioned above.

If nothing works, try if it actually first runs on a Windows PC instead, it should just work there and if it doesn't, you should rather contact steam support.

Thanks for all the info, I'll double check all of that.

I have tried the other versions of SteamVR, and I just put an nvivia-icd loader into icd.d, but just the one for 64 bit. I'll check the 32 bit stuff as well.

One thing I've noticed is it seems to be indicating it can't connect to the usb devices, though they are listed in lsusb with the ID's its trying to communicate with. I'm looking into that right now, I've loaded a udev rules file that didn't seem to have any affect but I've read there may be a different permissions system at work that I've not used that uses some sort of ACLs I'm exploring that right now.

As for desktop I'm using a fresh Arch with X and i3wm as my only display tech.

@techy2493
Copy link

So, definitely not recommending this and I'm still looking for a solution but as a debugging step only I ran steam as root and everything work perfectly. So I'm definitely experiencing some sort of permissions related issue to connecting to the Index.

@techy2493
Copy link

So I'm not 100% certain this was a "correct" fix for minamalists but the fix I'm going with is adding myself to the group uucp with th ecommand
usermod -a -G uucp <username>

@WebFreak001
Copy link
Author

ah in that case the udev rules were probably missing for your headset - which is weird because the polkit install thing allowing steamvr to prompt the password at first time startup should have registered the udev rules I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment