CertainLach/VivePro2-Linux-Driver

Does not build due stdio_locked

andrey-zakharov opened this issue · 27 comments

At first, thanx for such work

with fresh installed rust it gives

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> crates/lens-protocol/src/lib.rs:1:12
  |
1 | #![feature(stdio_locked)]
  |            ^^^^^^^^^^^^

with nightly rust

# rustc 1.59.0 (9d1b2106e 2022-02-23)

it gives errors due
rust-lang/rust@398cccd

i think

Yep, fixed in 35f3656

Wow, it was super fast! :)
but cargo build gives

$ cargo build
   Compiling cmake v0.1.48
   Compiling lens-protocol v0.1.0 (/home/az/src/VivePro2-Linux-Driver/crates/lens-protocol)
error[E0716]: temporary value dropped while borrowed
   --> crates/lens-protocol/src/lib.rs:157:15
    |
157 |         let stdin = io::stdin().lock();
    |                     ^^^^^^^^^^^-------- temporary value is freed at the end of this statement
    |                     |
    |                     creates a temporary which is freed while still in use
    |                     argument requires that borrow lasts for `'static`

error[E0716]: temporary value dropped while borrowed
   --> crates/lens-protocol/src/lib.rs:158:16
    |
158 |         let stdout = io::stdout().lock();
    |                      ^^^^^^^^^^^^-------- temporary value is freed at the end of this statement
    |                      |
    |                      creates a temporary which is freed while still in use
    |                      argument requires that borrow lasts for `'static`

For more information about this error, try `rustc --explain E0716`.

$ cargo +nightly build gives

$ cargo +nightly build
   Compiling driver_lighthouse v0.1.0 (/home/az/src/VivePro2-Linux-Driver)
error[E0432]: unresolved import `crate::openvr::IVRServerDriverHostVtable`
 --> src/driver_context.rs:8:32
  |
8 |     driver_host::get_driver_host, openvr::IVRServerDriverHostVtable, try_vr, vr_result, Error,
  |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `IVRServerDriverHostVtable` in `openvr`

error[E0432]: unresolved imports `crate::openvr::DriverHandle_t`, `crate::openvr::EVRInitError`, `crate::openvr::IVRDriverContext`, `crate::openvr::IVRDriverContextVtable`, `crate::openvr::IVRServerDriverHost_Version`
  --> src/driver_context.rs:16:2
   |
16 |     DriverHandle_t, EVRInitError, IVRDriverContext, IVRDriverContextVtable,
   |     ^^^^^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^ no `IVRDriverContextVtable` in `openvr`
   |     |               |             |
   |     |               |             no `IVRDriverContext` in `openvr`
   |     |               no `EVRInitError` in `openvr`
   |     no `DriverHandle_t` in `openvr`
17 |     IVRServerDriverHost_Version,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `IVRServerDriverHost_Version` in `openvr`

error[E0432]: unresolved imports `crate::openvr::Compositor_FrameTiming`, `crate::openvr::DriverPose_t`, `crate::openvr::ETrackedDeviceClass`, `crate::openvr::EVREventType`, `crate::openvr::HmdMatrix34_t`, `crate::openvr::HmdRect2_t`, `crate::openvr::ITrackedDeviceServerDriverVtable`, `crate::openvr::IVRServerDriverHost_Version`, `crate::openvr::TrackedDevicePose_t`, `crate::openvr::VREvent_t`
  --> src/driver_host.rs:14:2
   |
14 |     Compositor_FrameTiming, DriverPose_t, ETrackedDeviceClass, EVREventType, HmdMatrix34_t,
   |     ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^^ no `HmdMatrix34_t` in `openvr`
   |     |                       |             |                    |
   |     |                       |             |                    no `EVREventType` in `openvr`
   |     |                       |             no `ETrackedDeviceClass` in `openvr`
   |     |                       no `DriverPose_t` in `openvr`
   |     no `Compositor_FrameTiming` in `openvr`
15 |     HmdRect2_t, ITrackedDeviceServerDriverVtable, IVRServerDriverHost_Version, TrackedDevicePose_t,
   |     ^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^ no `TrackedDevicePose_t` in `openvr`
   |     |           |                                 |
   |     |           |                                 no `IVRServerDriverHost_Version` in `openvr`
   |     |           no `ITrackedDeviceServerDriverVtable` in `openvr`
   |     no `HmdRect2_t` in `openvr`
16 |     VREvent_t,
   |     ^^^^^^^^^ no `VREvent_t` in `openvr`

and 30 more same openvr related.

$ cargo install openvr
    Updating crates.io index
error: there is nothing to install in `openvr v0.6.0`, because it has no binaries
`cargo install` is only for installing programs, and can't be used with libraries.
To use a library crate, add it as a dependency in a Cargo project instead.
$ sudo aptitude install libopenvr-dev
libopenvr-dev уже установлен в запрошенной версии (1.8.19~ds1-3build1)
libopenvr-dev уже установлен в запрошенной версии (1.8.19~ds1-3build1)

i do not know how to build it :)

Nightly rust is still required, so build with stable fails due to same commit missing
As for openvr error - no external dependency installation is required, but there is something missing due to proc macro error?

Can you share all errors, or try with nightly 2022-03-14?

Awesome! cargo +nightly-2022-03-14 build --release did the trick! I've got artifacts in target dir. but it looks like they need in dist dir? I'm still missing the path :)

Ufff
I've copied libdriver_lighthouse.so from target to dist.

dist/install gives

sync: link_stat "/home/az/src/VivePro2-Linux-Driver/dist/driver_lighthouse.so" failed: No such file or directory (2)

It looking for driver_lighthouse.so but on debian (ubuntu, mint) it makes libdriver_lighthouse.so

After renaming and running install.sh, restarted steam and steamvr gives

ERROR driver_lighthouse::driver_host: failed to wrap hmd: lens client error: expected server exe at /home/az/.steam/debian-installation/steamapps/common/SteamVR/drivers/lighthouse/bin/linux64/lens-server/lens-server.exe, but it is not found

You should build package in bin/lens-server for windows target (via mingw, --target=x86_64-pc-windows-gnu) and then copy it to dist/lens-server/lens-server.exe

so the commands should be something like this?

$ sudo aptitude install mingw-w64-x86-64-dev
$ rustup +nightly target add x86_64-pc-windows-gnu
$ cd bin/lens-server/
$ cargo +nightly-2022-03-14 build --release --target x86_64-pc-windows-gnu --all-features --verbose -Z build-std=core

it gives a lot of errors, looks like something missing

   Compiling thiserror v1.0.30
     Running `rustc --crate-name serde /home/az/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="serde_derive"' --cfg 'feature="std"' -C metadata=2df245cea4c74c7c-C extra-filename=-2df245cea4c74c7c --out-dir /home/az/src/VivePro2-Linux-Driver/target/x86_64-pc-windows-gnu/release/deps --target x86_64-pc-windows-gnu -C linker=x86_64-w64-mingw32-cc -L dependency=/home/az/src/VivePro2-Linux-Driver/target/x86_64-pc-windows-gnu/release/deps -L dependency=/home/az/src/VivePro2-Linux-Driver/target/release/deps --extern 'noprelude:compiler_builtins=/home/az/src/VivePro2-Linux-Driver/target/x86_64-pc-windows-gnu/release/deps/libcompiler_builtins-96590dddbf2b8c06.rmeta' --extern 'noprelude:core=/home/az/src/VivePro2-Linux-Driver/target/x86_64-pc-windows-gnu/release/deps/libcore-e9250a26e97eb3ce.rmeta' --extern serde_derive=/home/az/src/VivePro2-Linux-Driver/target/release/deps/libserde_derive-df166fc83018a953.so -Z unstable-options --cap-lints allow`
     Running `rustc --crate-name thiserror --edition=2018 /home/az/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-1.0.30/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=9778dc3979828339 -C extra-filename=-9778dc3979828339 --out-dir /home/az/src/VivePro2-Linux-Driver/target/x86_64-pc-windows-gnu/release/deps --target x86_64-pc-windows-gnu -C linker=x86_64-w64-mingw32-cc -L dependency=/home/az/src/VivePro2-Linux-Driver/target/x86_64-pc-windows-gnu/release/deps -L dependency=/home/az/src/VivePro2-Linux-Driver/target/release/deps --extern 'noprelude:compiler_builtins=/home/az/src/VivePro2-Linux-Driver/target/x86_64-pc-windows-gnu/release/deps/libcompiler_builtins-96590dddbf2b8c06.rmeta' --extern 'noprelude:core=/home/az/src/VivePro2-Linux-Driver/target/x86_64-pc-windows-gnu/release/deps/libcore-e9250a26e97eb3ce.rmeta' --extern thiserror_impl=/home/az/src/VivePro2-Linux-Driver/target/release/deps/libthiserror_impl-baac9ca2435fe0d8.so -Z unstable-options --cap-lints allow`
error[E0463]: can't find crate for `alloc`
  --> /home/az/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.8.0/src/lib.rs:87:1
   |
87 | pub extern crate alloc;
   | ^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: cannot find macro `vec` in this scope
    --> /home/az/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.8.0/src/lib.rs:1498:13
     |
1498 |             vec![elem; n].into()
     |             ^^^

error[E0433]: failed to resolve: use of undeclared type `Vec`
   --> /home/az/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.8.0/src/lib.rs:272:9
    |
272 |         Vec::extend_from_slice(self, other)
    |         ^^^ use of undeclared type `Vec`

Do not use build-std, it should work with prebuilt std from target

$ cargo +nightly-2022-03-14 check --release --target x86_64-pc-windows-gnu --all-features --verbose 2> lens-server.build.log
lens-server.build.log

its obvious that something wrong with env, but i'm not sure what exactly. I've remove and reinstall rust and rustup

I think you have multiple different nightly versions installed, and instead of

rustup +nightly target add x86_64-pc-windows-gnu

You should do

rustup +nightly-2022-03-14 target add x86_64-pc-windows-gnu

In build log i see windows target not being found

Bingo.

$ rustup +nightly-2022-03-14 target add x86_64-pc-windows-gnu
$ cargo +nightly-2022-03-14 build --release --target x86_64-pc-windows-gnu --all-features --verbose

made a magic. I've put it to dist/ and run ./install.sh. It gives:

$ bash ./install.sh 
SteamVR at /home/az/.steam/steam/steamapps/common/SteamVR/
Seems like proxy driver is already installed? Proceeding with update then
Installation finished, try to start SteamVR

but SteamVR still miss hardware
in dmesg I've got connected USB

[  599.072519] usb 1-7.1.4: New USB device found, idVendor=0bb4, idProduct=030a, bcdDevice=66.c0
[  599.072523] usb 1-7.1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  599.072526] usb 1-7.1.4: Product: USB2.0 Hub             
[  599.072528] usb 1-7.1.4: Manufacturer: VIA Labs, Inc.         
[  599.074059] hub 1-7.1.4:1.0: USB hub found
[  599.074258] hub 1-7.1.4:1.0: 4 ports detected
[  599.614287] usb 1-7.1.4.2: new full-speed USB device number 15 using xhci_hcd
[  599.716206] usb 1-7.1.4.2: New USB device found, idVendor=0bb4, idProduct=030b, bcdDevice= 1.25
[  599.716211] usb 1-7.1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  599.716214] usb 1-7.1.4.2: Product: VIVE Pro Mutimedia Audio
[  599.716216] usb 1-7.1.4.2: Manufacturer: HTC
[  600.069832] input: HTC VIVE Pro Mutimedia Audio as /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.4/1-7.1.4.2/1-7.1.4.2:1.3/0003:0BB4:030B.0008/input/input23
[  600.122533] hid-generic 0003:0BB4:030B.0008: input,hidraw7: USB HID v1.11 Device [HTC VIVE Pro Mutimedia Audio] on usb-0000:00:14.0-7.1.4.2/input3
[  600.219665] Bluetooth: hci0: BCM (001.001.005) build 0481
[  600.236663] Bluetooth: hci0: BCM20703A1 Generic USB 20Mhz fcbga_BU
[  600.320490] NET: Registered protocol family 38
[  600.328386] Bluetooth: RFCOMM TTY layer initialized
[  600.328390] Bluetooth: RFCOMM socket layer initialized
[  600.328392] Bluetooth: RFCOMM ver 1.11
[  601.917101] usb 1-7.1.4.1: new full-speed USB device number 16 using xhci_hcd
[  601.997232] usb 1-7.1.4.1: New USB device found, idVendor=0bb4, idProduct=0342, bcdDevice= 2.00
[  601.997236] usb 1-7.1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  601.997238] usb 1-7.1.4.1: Product: VIVE Pro
[  601.997240] usb 1-7.1.4.1: Manufacturer: HTC
[  601.997242] usb 1-7.1.4.1: SerialNumber: 207039754E30
[  602.004823] hid-generic 0003:0BB4:0342.0009: hiddev2,hidraw8: USB HID v1.11 Device [HTC VIVE Pro] on usb-0000:00:14.0-7.1.4.1/input0
[  602.183074] usb 1-7.1.4.3: new full-speed USB device number 17 using xhci_hcd
[  602.277826] usb 1-7.1.4.3: New USB device found, idVendor=28de, idProduct=2101, bcdDevice= 0.01
[  602.277831] usb 1-7.1.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  602.277834] usb 1-7.1.4.3: Product: Watchman Dongle
[  602.277836] usb 1-7.1.4.3: Manufacturer: Valve Software
[  602.277838] usb 1-7.1.4.3: SerialNumber: 1B6A83384B
[  602.287932] hid-generic 0003:28DE:2101.000A: hiddev3,hidraw9: USB HID v1.11 Device [Valve Software Watchman Dongle] on usb-0000:00:14.0-7.1.4.3/input0
[  602.339161] usb 2-6.1.1: new SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[  602.351784] usb 2-6.1.1: New USB device found, idVendor=0bb4, idProduct=030c, bcdDevice= 4.35
[  602.351787] usb 2-6.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  602.351789] usb 2-6.1.1: Product: VIVE Pro Multimedia Camera
[  602.351791] usb 2-6.1.1: Manufacturer: HTC
[  602.353638] uvcvideo: Found UVC 1.00 device VIVE Pro Multimedia Camera (0bb4:030c)
[  602.353946] uvcvideo: Failed to query (GET_INFO) UVC control 11 on unit 1: -32 (exp. 1).
[  602.354058] uvcvideo: Failed to query (GET_INFO) UVC control 13 on unit 1: -32 (exp. 1).
[  602.356015] uvcvideo: Failed to set UVC probe control : -32 (exp. 26).
[  602.359684] uvcvideo 2-6.1.1:1.0: Entity type for entity Extension 2 was not initialized!
[  602.359688] uvcvideo 2-6.1.1:1.0: Entity type for entity Extension 6 was not initialized!
[  602.359690] uvcvideo 2-6.1.1:1.0: Entity type for entity Processing 3 was not initialized!
[  602.359692] uvcvideo 2-6.1.1:1.0: Entity type for entity Camera 1 was not initialized!
[  602.359895] input: VIVE Pro Multimedia Camera as /devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6.1/2-6.1.1/2-6.1.1:1.0/input/input24
[  602.477066] usb 1-7.1.4.4: new full-speed USB device number 18 using xhci_hcd
[  602.570240] usb 1-7.1.4.4: New USB device found, idVendor=28de, idProduct=2101, bcdDevice= 0.01
[  602.570241] usb 1-7.1.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  602.570242] usb 1-7.1.4.4: Product: Watchman Dongle
[  602.570242] usb 1-7.1.4.4: Manufacturer: Valve Software
[  602.570242] usb 1-7.1.4.4: SerialNumber: 40C3CD06B6
[  602.579134] hid-generic 0003:28DE:2101.000B: hiddev4,hidraw10: USB HID v1.11 Device [Valve Software Watchman Dongle] on usb-0000:00:14.0-7.1.4.4/input0
[  604.224000] usb 1-7.1.3: new full-speed USB device number 19 using xhci_hcd
[  604.314233] usb 1-7.1.3: New USB device found, idVendor=28de, idProduct=2300, bcdDevice= 2.00
[  604.314237] usb 1-7.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  604.314239] usb 1-7.1.3: Product: LHR
[  604.314241] usb 1-7.1.3: Manufacturer: Valve
[  604.314243] usb 1-7.1.3: SerialNumber: LHR-0B403174
[  604.330767] hid-generic 0003:28DE:2300.000C: hiddev5,hidraw11: USB HID v1.11 Device [Valve LHR] on usb-0000:00:14.0-7.1.3/input0
[  604.331999] hid-generic 0003:28DE:2300.000D: hiddev6,hidraw12: USB HID v1.11 Device [Valve LHR] on usb-0000:00:14.0-7.1.3/input1
[  604.332760] hid-generic 0003:28DE:2300.000E: hiddev7,hidraw13: USB HID v1.11 Device [Valve LHR] on usb-0000:00:14.0-7.1.3/input2

in steam log i've

 INFO driver_lighthouse::driver_host: added tracked device: "LHR-0B403174" (TrackedDeviceClass_HMD)
 INFO lens_client: using lens server at "/home/az/.steam/debian-installation/steamapps/common/SteamVR/drivers/lighthouse/bin/linux64/lens-server/lens-server.exe"
 INFO lens_client: trying wine64 as wine

and silence. At least no errors about "lens-client" "lens-server". I'm stuck :(

SteamVR-2022-03-18-AM_03_17_16.txt

Seems like wine is not working/misbehaving?
Try to run it directly:

wine64 /home/az/.steam/debian-installation/steamapps/common/SteamVR/drivers/lighthouse/bin/linux64/lens-server/lens-server.exe

It should print something like

 INFO lens_server: hello from lens server
 INFO lens_server: dll path: "Z:\\home\\lach\\.local\\share\\Steam\\steamapps\\common\\SteamVR\\drivers\\lighthouse\\bin\\linux64\\lens-server\\LibLensDistortion.dll"

And if you try to write something to its shell, it should fail with

Error: failed to read request
$ wine64 /home/az/.steam/debian-installation/steamapps/common/SteamVR/drivers/lighthouse/bin/linux64/lens-server/lens-server.exe
 INFO lens_server: hello from lens server
 INFO lens_server: dll path: "Z:\\home\\az\\.steam\\debian-installation\\steamapps\\common\\SteamVR\\drivers\\lighthouse\\bin\\linux64\\lens-server\\LibLensDistortion.dll"
0009:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (000000000032F0D0 1 C) semi-stub
0009:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (000000000032EC60 1 C) semi-stub
0009:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (000000000032F0B0 1 C) semi-stub
0009:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (000000000032F300 1 C) semi-stub
tested
ERROR lens_server: error=failed to read request
Error: failed to read request

Caused by:
    0: bincode error: invalid value: integer `1953719668`, expected variant index 0 <= i < 5
    1: invalid value: integer `1953719668`, expected variant index 0 <= i < 5

Well, seems like it should work at this point, as after

 INFO lens_client: trying wine64 as wine

message there should be lens_server output

Was it be wineboot initialization in progress? Try to start SteamVR again

If it doesn't work - do you start Steam with customized LD_PRELOAD/LD_LIBRARY_PATH/PATH?

Running
https://gist.github.com/andrey-zakharov/1cc10c4119b77bd9d276e42129a60b09

xrandr sees my set as:
https://gist.github.com/andrey-zakharov/a9a531a2ba72e230688e85071b32f311

Steam is usual from Ubuntu packages, IRR.
LD env:

$ xargs -0 -L1 -a /proc/8738/environ | grep LD
SYSTEM_LD_LIBRARY_PATH=
LD_LIBRARY_PATH=/home/az/.steam/debian-installation/ubuntu12_32:/home/az/.steam/debian-installation/ubuntu12_32/panorama:/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/pinned_libs_32:/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/pinned_libs_64:/opt/amdgpu-pro/lib/x86_64-linux-gnu:/opt/amdgpu/lib/x86_64-linux-gnu:/opt/amdgpu/lib/i386-linux-gnu:/usr/lib/x86_64-linux-gnu/libfakeroot:/lib/i386-linux-gnu:/usr/local/lib:/lib/x86_64-linux-gnu:/lib32:/libx32:/lib:/lib/i386-linux-gnu/sse2:/lib/i386-linux-gnu/i686:/lib/i386-linux-gnu/i686/sse2:/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/lib/i386-linux-gnu:/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu:/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/lib/x86_64-linux-gnu:/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu:/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/lib:/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/usr/lib
OLDPWD=/home/az
az@az-z690:~$  

LD_LIBRARY_PATH=

/home/az/.steam/debian-installation/ubuntu12_32
/home/az/.steam/debian-installation/ubuntu12_32/panorama
/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/pinned_libs_32
/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/pinned_libs_64
/opt/amdgpu-pro/lib/x86_64-linux-gnu
/opt/amdgpu/lib/x86_64-linux-gnu
/opt/amdgpu/lib/i386-linux-gnu
/usr/lib/x86_64-linux-gnu/libfakeroot
/lib/i386-linux-gnu
/usr/local/lib
/lib/x86_64-linux-gnu
/lib32
/libx32
/lib
/lib/i386-linux-gnu/sse2
/lib/i386-linux-gnu/i686
/lib/i386-linux-gnu/i686/sse2
/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/lib/i386-linux-gnu
/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu
/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/lib/x86_64-linux-gnu
/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu
/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/lib
/home/az/.steam/debian-installation/ubuntu12_32/steam-runtime/usr/lib

nothing criminal

hardware works under Windows (I've checked).
i will try to purge steamvr and recompile from a scratch.

I've found that logs of steamvr stopped get printed.

chdir /home/az/.steam/debian-installation/steamapps/common/SteamVR
VR Server (v1647034158)

src/steamexe/main.cpp (253) : Assertion Failed: reaping pid: 19325 -- CIPCServer::Thr
VR Server (v1647034158)

Opening in existing browser session.
chdir /home/az/.steam/debian-installation/steamapps/common/SteamVR
VR Server (v1647034158)

VR Server (v1647034158)

I've saw it recently, but now its gone.

found this in steamvr logs

lighthouse: Device LHR-0B403174 requires driver viveVR, which is not present

maybe thats my case... but where to get this driver...

also

Wed Mar 23 2022 15:05:33.562209 - Loaded server driver lighthouse (IServerTrackedDeviceProvider_004) from /home/az/.steam/debian-installation/steamapps/common/SteamVR/drivers/lighthouse/bin/linux64/driver_lighthouse.so
Wed Mar 23 2022 15:05:33.563670 - Could not activate pending device LHR-0B403174: VRInitError_Driver_PeerDriverNotInstalled
Wed Mar 23 2022 15:05:33.563696 - Driver 'lighthouse' finished adding tracked device with serial number 'LHR-0B403174'
Wed Mar 23 2022 15:05:33.563710 - Driver lighthouse has no suitable devices.

@andrey-zakharov I was stuck at the missing viveVR driver part, but found out that you'll have to download the VIVE Console for SteamVR from Steam. After that I was able to do the room setup etc. The Vive Console app doesn't work for me, but Steam seems to download the proper SteamVR driver however.

Yep, VIVE Console must be installed, however it is not used in runtime, i should mention this in README.md :D

I was planning on writing a small guide on how to get the Vive Pro 2 running with your driver (awesome work btw!) and a custom kernel. I made a quick and dirty PKGBUILD file for compiling a custom Vive Pro 2 compatible Linux kernel on Arch Linux. I still need to clean it up a little though.

Thanks for answer! Reinstalling SteamVR, installing Vive Console, killing all in ps and bam. it starts to show me vrcomposer window, but on display1 and helmet is black :(. i have patched kernel... initially 5.6.0-1056-oem
vivepro2.patch.zip

I've totally forgot about subj, install it into fresh SteamVR
and it works. At least helmet is on.
Actually, experienced some glitches like video signal digital noises around the screen. Have not seen this before on same helmet under win.
And motion smoothing. Is it about lens-server topic?

@andrey-zakharov the video artifacting is caused by SteamVR's "Vulkan Async Reprojection" (try to disable it), see ValveSoftware/SteamVR-for-Linux#230
And the sluggish motion is caused by a bottle neck in the older versions of the Linux kernel's hidraw driver, see: ValveSoftware/SteamVR-for-Linux#21
You might be able to backport the hidraw fix (which is not perfect btw) to Linux 5.6.0 from here: torvalds/linux@8590222
The hidraw fix was added to Linux 5.17 and newer so you could also install Linux 5.17.3 (latest stable release as of writing this comment)

Shameless plug: I created a repository with a guide and other information on how to get the VIVE Pro 2 working on Linux: https://github.com/santeri3700/vive-pro-2-on-linux
It includes a PKGBUILD file for building and installing a patched Linux 5.17.2 kernel on Arch Linux.

I think i should shamelessly steal all of your guides to this repo, as i update those patches, and will fix some issues later :D

Regarding untested/does not work sections:

  • VIVE Console software - will not work, however it is possible to implement all required features from it. Driver already has resolution reconfiguration, and it definitely works better than original software (at least for me)
  • IPD visualization - this is part of vive vrcompositor, it is however possible to implement in this driver, i already have method to get configured IPD: https://github.com/CertainLach/VivePro2-Linux-Driver/blob/master/crates/vive-hid/src/lib.rs#L228, and steamvr has overlay support now (Probably third-party overlay may work too?)
  • Firmware updates - works
  • Microphone - works, however i should add noise cancelling configuration to new version of driver:
    fn toggle_mic_noise_cancel(device: &HidDevice, enabled: bool) -> Result<()> {
    if enabled {
    send_str_report(&device, true, b"codecreg=9c9,80")?;
    send_str_report(&device, true, b"codecreg=9c8,a5")?;
    send_str_report(&device, true, b"codecreg=9d0,a4")?;
    send_str_report(&device, true, b"codecreg=1c008f,1")?;
    send_str_report(&device, true, b"codecreg=1c0005,9")?;
    send_str_report(&device, true, b"codecreg=1c0005,8000")?;
    } else {
    send_str_report(&device, true, b"codecreg=9c9,8c")?;
    send_str_report(&device, true, b"codecreg=9c8,a4")?;
    send_str_report(&device, true, b"codecreg=9d0,0")?;
    send_str_report(&device, true, b"codecreg=1c008f,0")?;
    send_str_report(&device, true, b"codecreg=1c0005,9")?;
    send_str_report(&device, true, b"codecreg=1c0005,8000")?;
    }
    Ok(())
    }
  • Brightness should be possible to control too:
    fn set_brightness(device: &HidDevice, brightness: Brightness) -> Result<()> {
    send_str_report(
    &device,
    false,
    format!("setbrightness,{}", brightness.0).as_bytes(),
    )?;
    Ok(())
    }
  • Front facing cameras or Camera view - works, however there are noise caused by kernel driver (I have ideas, i just didn't tried it yet), and a bit of distortion (no camera distortion reconfiguration is performed in driver, but i already have all the data to do this)
  • Desktop view - works, even on wayland, you should have wlr-portal installed on sway, or corresponding portal on kde/gnome
  • VIVE Wireless Adapter - does not work, it should be possible to make it work (need to write kernel driver), however i do not have one (Someone may donate one to me, i will try my best :D)
  • VIVE Tracker - works
  • 3rd party USB peripherals/accessories - works
  • Virtual controllers and hands render behind menus and 3D models appear "inverted" - it is caused by standard lighthouse driver, and you can actually "fix" this issue by flipping this condition: https://github.com/CertainLach/VivePro2-Linux-Driver/blob/master/crates/lens-protocol/src/lib.rs#L115. This will break every other model, though

Wow. I've suspected something like that about all this story :)
Thanks guys!!! Really great help!