Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SteamVR is upsidedown #46

Open
KaziiTheAvali opened this issue Nov 25, 2024 · 14 comments
Open

SteamVR is upsidedown #46

KaziiTheAvali opened this issue Nov 25, 2024 · 14 comments

Comments

@KaziiTheAvali
Copy link

This seems to be a reoccuring issue as https://www.reddit.com/r/virtualreality_linux/comments/1foahw1/help_needed_with_vive_pro_2_steamvr_vive_pro_2/ aswell has this isue. the display and everything in it is upsidedown. making it impossible to play any games and even nausating. for me i get this error even though proton is installed in enabled
image
image
system things
image

@iondc
Copy link

iondc commented Dec 7, 2024

just made a github account to say this i did a temporary fix. go to bin/driver-proxy/src/driver/hmd.rs

go to around line 131 it should say
let inverse = self.lens.matrix_needs_inversion()?;

i commented it out and changed it to

let inverse = false;

didnt fix the lens distortion helper and things do look kinda fuzzy but they aint upside down anymore. now i just gotta figure out why it never renders the floor

@CertainLach
Copy link
Owner

You don't see the floor, because you see the wrong side of textures, because you have inverted matrix

Upside-down texture and distortions would be only fixed by having working distortion helper. I'm not sure why it doesn't find proton for some people, but you can try setting WINE=/path/to/wine %command% as SteamVR command line.

@iondc
Copy link

iondc commented Dec 10, 2024

i can say for a fact proton is working. i wrote a very barebones c program that opens a win32 message box:

#include <windows.h>
#include <winuser.h>

int main(int argc, char **argv){
    MessageBox(NULL, "my original code said something funny", "proton checks out", MB_OK | MB_ICONINFORMATION);
    return 0;
}

compiled with x86_64-w64-mingw32-gcc and replaced lens-server.exe with it. no special launch command, steamvr seems like it wanna use proton hotfix

and of course it shows the message box just fine, and when i click ok i get the same failed to fill whole buffer dialog i always got. imma play around with the starting code and the pipes, i dont know rust though so i guess now a good time to learn. or maybe im missing dlls or something like that other issue

also tried WINE=/usr/bin/wine %command% same outcome

@CertainLach
Copy link
Owner

I wonder if lens-server is not being ran as console app for you, I have seen that happen, but it didn't for me?

Does adding
#![windows_subsystem = "console"]
As the first line of https://github.com/CertainLach/VivePro2-Linux-Driver/blob/master/bin/lens-server/src/main.rs makes anything change for you?

lens-server is not supposed to be started as a dedicated window, it is a console app talking over stdio.

@iondc
Copy link

iondc commented Dec 11, 2024

i just tried that, it didnt change anything. but i saw some comments about missing dlls from #33 so i copied vkd3d-1.dll and vkd3d-shader-1.dll over from another prefix into drive_c/windows/system32 and it works now! everythings back upside down so imma undo my patch on driver-proxy/src/driver/hmd.rs, textures stopped being upside down too :)

@CertainLach
Copy link
Owner

Huh, those aren't direct dependencies of LibLensDistortion, perhaps your wine prefix was broken for some reason?

@iondc
Copy link

iondc commented Dec 11, 2024

i think opencv_world needed those. was definitely something wrong with the prefix

@KaziiTheAvali
Copy link
Author

i just tried that, it didnt change anything. but i saw some comments about missing dlls from #33 so i copied vkd3d-1.dll and vkd3d-shader-1.dll over from another prefix into drive_c/windows/system32 and it works now! everythings back upside down so imma undo my patch on driver-proxy/src/driver/hmd.rs, textures stopped being upside down too :)

are you able to give me your system32 or profile. i have done this and it is still upsidedown for me

@KaziiTheAvali
Copy link
Author

never mind. i it ended up that there was more stuff missing in my system32 and just copying the whole system32 from a nother game (i think h3) worked

@KaziiTheAvali
Copy link
Author

ofc i still struggle with updating devices. hope that doesnt come back to bite me later on.

@CertainLach
Copy link
Owner

I wonder why is yours prefixes so borked, and how can I fix this at the driver side, both proton and default nixos wine installation works just fine for me.

You can get debug logs for dll loading by setting
WINEDEBUG=+loaddll,+warn
environment variable.

@iondc
Copy link

iondc commented Dec 13, 2024

im kinda tempted to write a simple script that can tell if its missing dlls and download them, and maybe get the error handler that shows the message to run that script too.

@KaziiTheAvali btw now that you got it working, are you seeing double by any chance? i noticed my left eye was being rendered by what looked like 1ft lower than my right eye and i did another workaround somewhere to make it render the right eye 50 pixels lower than the other. i can try and find out where i put it if you want it, its not an exact fix and imma make an issue for it but everything is really comfortable now

@kboshi
Copy link

kboshi commented Jan 10, 2025

here is how you fix the problem install proton and then it updates and then just uninstall proton and for some apparent reason it fixes the issue I have no clue why just did.

@HexSegfaultCat
Copy link
Contributor

I also managed to get it working. For some reason when you run proton runinprefix start.exe ... if prefix does not exist then it doesn't create all the DLLs in system32, but when you run proton run then it properly creates the prefix and then the Lens Server works.

Here's the steps I did to create the prefix:

# Proton prefix directory
STEAMVR_COMPAT_DIR="${HOME}/.steam/steam/steamapps/compatdata/250820"

# Required environment variables for running Proton outside of Steam
export STEAM_COMPAT_CLIENT_INSTALL_PATH="${HOME}/.steam/steam"
export STEAM_COMPAT_DATA_PATH="${STEAMVR_COMPAT_DIR}"

# Remove current Proton prefix and create an empty directory (required for next step)
rm -r "${STEAMVR_COMPAT_DIR}"
mkdir -p "${STEAMVR_COMPAT_DIR}"

# Use `run` command to create prefix in `STEAMVR_COMPAT_DIR`
"${STEAM_COMPAT_CLIENT_INSTALL_PATH}/steamapps/common/Proton - Experimental/proton" run

Then, in launch options for SteamVR set PROTON_VERSION="- Experimental" %command% if you have multiple Proton versions installed to make sure the Lens Server uses proper version (I belive it chooses 9.0 instead of Experimental by default):

And also one more important thing - make sure you do not have PROTON_LOG=1 set in the launch options - the server communicates by sending data to stdout and this causes timeouts as it is redirected to a log file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants