Open MonsieurLanza opened 1 year ago
So far, after some battle with kernel versions and config here and on https://github.com/santeri3700/vive-pro-2-on-linux, I was able to get a patched kernel (with the last patches which includes the cosmos ID \o/), and the vivepro2 driver.
Patches need another update, they won’t work on the latest linux-drm-misc-next
, I had to get the 2023-01-12 tag. And the provided config failed to boot on my machine.
Steam now displays the VR icon in the toolbar, and on my nvidia box with the AllowHMD
option set in xorg conf, I can see the render… on my primary display. So I now know the tracking works, and the render seems somewhat correct, I’m not sure about the dimensions. And the system freezes while exiting SteamVR.
But with or without the AllowHMD
flag, nothing renders on HMD itself. My guess because the vivepro2 driver does not set the mode properly (only vivepro2 modes seems available), but I now have to find a way to get logs.
For cosmos support, you should at least
There was a release of steamvr part with cosmos-specific fixes here: https://github.com/CertainLach/VivePro2-Linux-Driver/releases/tag/v0.3.1-cosmos However my tester reported it doesn't work, and most likely some other kernel changes are required.
Set of changes, that was applied on v0.3.1-cosmos tag: https://gist.github.com/CertainLach/888c4958678bee5f1736bc2ac3a5095d
It also disables lens distortion functionality, as I'm not sure of its protocol on cosmos either.
Thank you.
Ok, I had correct modes, and product ID. I did not remove any of the writing, though.
You should remove writings, as cosmos has slightly different protocol, which also lacks some of the vive pro 2 features (I.e mode switching)
Well, stuck on "Permission denied". Maybe stupid, but still…
[31mERROR[0m [2mdriver_proxy::server::driver_host[0m[2m:[0m failed to wrap hmd: hid error: hid error: hidapi error: Permission denied
I have to stop for tonight.
chmod a+rw /dev/hidraw* for a quick test
There is no udev rules for vive cosmos installed
Thanks again.
So it does not work out of the box. No image, and cosmos is led still red.
At least it does not seem to crash the whole system on exit. Note : stations are not going to standby mode, despite driver saying so.
To make stations sleep, you should enable power management for them, driver tells its going to put only managed ones to sleep.
Ok.
Now, for what I understand, there is probably an « usb switch » to turn on display.
OpenHMD does this by sending a magic sequence https://github.com/OpenHMD/OpenHMD/blob/master/src/drv_htc_vive/vive.c#L594 , and as the sequence is different for Vive an Vive Pro, I guess it is different for Cosmos. And I guess on Vive Pro 2 setting the display mode does turn the display on.
If I understand correctly, I just have to find that value in the middle if the flow of USB traffic I just wiresharked, write it and see if something happens.
For Vive Pro 2 nothing is required, the display just starts working as soon as it receives the DisplayPort signal. There are commands for led control, but they are not mandatory to start displaying an image.
I didn't tough about Vive Cosmos requiring it, but this may be the case
I have looked in EyesReader.dll, and seems like there is some function for managing HMD panel.
Is I can see, report should have 0x782938 as its 1-3 bytes (counting from zero) as part of HMD_SetFeatures
call, then should contain 0x80 and power state (1 byte) somewhere in data (Too lazy to count bytes, this report is created in SetPowerState
function), and rest is filled with zeros.
I think you should be able to easly recover all of the protocol messages by using api monitor (http://www.rohitab.com/apimonitor), and capturing HidD_SetFeature calls from the EyesReader.dll
library, every function there has self-explaining name
Config for the lens-server library is returned by GetInHouseDistortionJson, and then there is some other possible useful setters.
Thank you for all that, I’ll have a deeper look when I can get some free time again.
PanelOnOff \o/
So far I learned a lot, and have a better idea of what I need to do, which is basically write another ViveDevice
for cosmos, there is too much difference with the vivepro2 one for it to make sense.
I have to find larger chunks of time, as I need to (re)learn things, dust off my little rust knowledge, go deeper in HID, Windows tooling…
@CertainLach do you have the vivepro 2 hid descriptors, so that I can compare ?
I’m not getting why with the cosmos I get 2 Hid devices with the right signature, and they do have slightly different hid descriptors. HTC’s drivers seem to "talk" to the first one they find, but I’m not certain.
And did I mention that I HATE little endian ? I want my MC68000 amiga back.
I’m not getting why with the cosmos I get 2 Hid devices with the right signature, and they do have slightly different hid descriptors. HTC’s drivers seem to "talk" to the first one they find, but I’m not certain.
Its the same for Vive Pro 2, one device is for lighthouse driver, and it implements valve protocols (SteamDevice
struct in this driver), and then there is Vive device itself, which implements HTC protocols (ViveDevice
struct)
Driver only needs to talk to ViveDevice, SteamDevice is compatible with lighthouse driver, and will work by itself.
There is nothing useful in HID descriptors
Writing captured data didn't work?
I really have 2 ˋViveDeviceˋ "0x0bb4:0x0313" signature, along with 2 SteamDevice
for lighthouse tracking, when doing a device enumeration.
I reproduced the exact sequence of the hmdPanelOnOff(), but did not see a single pixel light up.
That's weird, are you sure they are both active on the same time? That may be possible with SteamDevice, as they are differentiated by serial number, but ViveDevice?..
If there is multiple ViveDevices - check their serials, and use the correct one with open
method, instead of just calling open_first
SteamDevice looks the same.
# HTC Corporation VIVE COSMOS # 0x06, 0x00, 0xff, // Usage Page (Vendor Defined Page 1) 0 # 0x09, 0x01, // Usage (Vendor Usage 1) 3 # 0xa1, 0x01, // Collection (Application) 5 # 0x15, 0x00, // Logical Minimum (0) 7 # 0x26, 0xff, 0x00, // Logical Maximum (255) 9 # 0x75, 0x08, // Report Size (8) 12 # 0x96, 0x00, 0x04, // Report Count (1024) 14 # 0x09, 0x01, // Usage (Vendor Usage 1) 17 # 0x81, 0x02, // Input (Data,Var,Abs) 19 # 0x95, 0x40, // Report Count (64) 21 # 0x09, 0x01, // Usage (Vendor Usage 1) 23 # 0xb1, 0x02, // Feature (Data,Var,Abs) 25 # 0xc0, // End Collection 27 # R: 28 06 00 ff 09 01 a1 01 15 00 26 ff 00 75 08 96 00 04 09 01 81 02 95 40 09 01 b1 02 c0 N: HTC Corporation VIVE COSMOS I: 3 0bb4 0313
Not even a feature report ID.
Both /dev/hidraw0
and /dev/hidraw1
reports the same, and usbhid-dump
reports 2 devices for
$ usbhid-dump -d 0bb4:0313
004:004:001:DESCRIPTOR 1674908243.867237 06 00 FF 09 01 A1 01 15 00 26 FF 00 75 08 96 00 04 09 01 81 02 95 40 09 01 B1 02 C0 004:004:000:DESCRIPTOR 1674908243.867394 06 00 FF 09 01 A1 01 15 00 26 FF 00 75 08 96 00 04 09 01 81 02 95 40 09 01 B1 02 C0
However lsusb
reports only one Vive cosmos, so it looks like there is 1 device with 2 hid interfaces.
There is only 1 SteamDevice
, however, but 2 watchman dongles (28de:2101). My mistake.
Ok, understood one thing. Everything go through the feature report on Cosmos, even the read_config
. They could have used http instead of hid without much difference :D
PanelOnOff \o/
The values in the report here are… pointers! Which make little sense at first sight.
There are missing memzeros/wrong array sizes used, it is possible that this is stack values leaked to a SetFeature call. Example (pseudocode):
char report[10];
int somevalue;
report[0] = 0;
...
SetFeature(&report) // where report is expected to be a char[65 - header], so value of somevalue is also included in report value
This is fairly common in Vive Pro 2 driver too
I see, this is not rust code ^^.
Thing is, the start of the report seems invariable whether it is an On or an Off call. There is something I miss here.
BTW, the config file does not fit at all inside the Vive Pro 2 struct
(ViveConfig
) : https://gist.github.com/MonsieurLanza/583613475093b716f65c32260f8c364a
I've got a regular Vive headset and a Cosmos Elite.. trying to get the Cosmos going. I've recompiled my kernel etc and followed through on CertainLatch's driver with Cosmos modifications, compiled and installed. I'm now at the same stage as @MonsieurLanza where the headset display isn't coming on.
I do get a tracked view when I turn on SteamVR's "Display VR View" which makes it look like it's sooo close to working.
My controllers won't connect/ track though - but work fine when I plug them into the computer with a usb cable.
I also noticed that the single trigger button on the headset won't work ( when trying to cancel a VR startup notification without the vr controllers).
I have already tried sudo chmod a+rw /dev/hidraw (and on /dev/usb/hiddev as well).
p.s. @MonsieurLanza - yeah! Amiga/68k !! ;)
@JJones780 I have made progress on the PR here https://github.com/CertainLach/VivePro2-Linux-Driver/pull/20 . It currently dumps the cosmos config file in the logs. I have some hid dump from windows too, and have to make this in.
It’s close but not so close. The tracking part it similar to other vive/valve lightouse products and work out of the box, but the init of the display is completely different. So the vive_hid
lib needs specific code, maybe different config struct/handling, as does the hmd init part in driver_proxy
.
I’ve been away because of work, but as I plan to use the cosmos to make things with Godot, and given the fact I cannot stand windows except to launch SteamVR from time to time, I’ll get back at it soon.
Nvidia drivers may part of the problem, I’d like to check with an AMD GPU, but I need to dig in boxes, as it is packed during house renovation.
(This little endian thing makes it stupidly complex to read/write bytes in memory. I will never understand.)
I tried accessing the display via i2c and other methods but also ran into a nvidia bug.
I don't have windows installed at all. I am happy to see I am able to switch between the Original HTC Vive and Cosmos headsets with only the driver file change ( driver_lighthouse_real.so ) which means I'll be able to keep up on the cosmos hacking.
@MonsieurLanza
RE: Linux, HTC Vive Cosmos connected and powered. note: It seems that the cameras and Bluetooth devices are visible but not enabled. Maybe there's a more general onOff type command we should be looking for; over and above the PanelOnOff?
I opened up the system.img file for the headset ( yes it's Android but I'm betting not connected to the display panels other than turning them or maybe only their backlights off and on ) . It provides ADB, HID and UVC but I don't know of any way to switch it to ADB to connect to the running headset. Looking through the system.img files to see if I can find any hints as to the hardware/startup/hid settings. If anyone has ideas to look into please let me know. The best bet is probably still the capture of USB HID traffic from a windows machine.
I am sorry I have not been around for some monthes, life has surprises… And I won’t be able to get something done until july, or august. No more room for that during house renovation.
I do not have the problems with controllers/bluetooth you mention. For me, everything works fine, except display. Tracking of the headset and the controllers works, I am able to see it by enabling SteamVR view.
I do have USB hid dumps and API calls. But to get further in, and really try to reproduce the HID exchanges (which are not really HID, but anyway), I have to get the driver to accept the cosmos configuration file, which is quite different from the vive pro 2 one.
hi, I'm very interested in getting this working (VR is the only reason I ever have to boot to windows...) so before I start hacking at it, has any progress been made here or elsewhere which hasn't been captured in this thread?
Sorry, nothing new to report from me.
Windows USB "feature report" traffic trace is needed. I was hoping @MonsieurLanza would be finished his house renovations but I know those easily go overtime ;)
Maybe I'll try digging into the Android code that runs on the headset again and hope the Monsieur appears again soon!
In the end I just bought a cheap second hand Vive Pro which isn't really any worse in terms of specs (and it has OLED!) and is supported on linux (in theory). In practice I also haven't been able to get it to work properly because of https://github.com/ValveSoftware/SteamVR-for-Linux/issues/175... so that's annoying.
I've got a vive cosmos and both a Linux and windows partition, I'd be happy to provide a feature report but I can't find good documentation on how to go about that. I've used Wireshark for stuff like that before, but I've also run into it missing critical things so I'm not sure if that would be sufficient
Anything you can dig up would be handy. I've still got the Cosmos sitting in storage and would like to mess with it... and hacking out a solution might be fun when time frees up. I've been meaning to dig through the Cosmos Elite Android ISO some more but getting numbers from the USB communication could help with that too. @MonsieurLanza - did you make those USBHid Setfeature etc log files accessable here somewhere?
Hello, this gonna be a bit off topic here (sorry about that), but im here in search of HTC vive cosmos elite config.json file contence i was modifying some stuff and messed up and don't have a back up. Could i ask for that file here?
It's getting a little bit harder to find people running windows? ;) Have you tried on the discord? https://discord.gg/viverse The community managers are welcoming - They tried to pass along my request for info to the engineering dept re: Cosmos Elite on Linux but haven't heard anything back. An old product on an unsupported platform - so not entirely unexpected.
Yeah i have tried the group ill be honest i have checked all corners of internet for this file and now im loosing hope i saw that people here have the cosmos and are not afraid of programing so feels like last dich option to recover a "working" headset with a dead config file
Config files differ between headset, as they contain lens distortion parameters, which are different from unit to unit. Those parameters are also very precise, and it might even damage your eyes if you try to use the headset with wrong config for a prolonged period of time.
It’s better to try sending it in for repair, because in this case they will be able to calculate the correct parameters for your lenses and assemble the correct config. They know how to do this because this is what happens when they replace lenses.
Found out these files are kept by steam as back ups (snapshot of configs) in a different folder managed to get it out and recover my headset. Vive support actually responded in the viverse after 5 days of silence. so if anything happens to your vr's configs you can find the org files here if OS was not reinstalled : C:\Program Files (x86)\Steam\config\lighthouse Also @CertainLach yes they differ a bit people say that its not too much i cant say for long term tho they tried it on OG htc and pro
It's getting a little bit harder to find people running windows? ;) Have you tried on the discord? https://discord.gg/viverse The community managers are welcoming - They tried to pass along my request for info to the engineering dept re: Cosmos Elite on Linux but haven't heard anything back. An old product on an unsupported platform - so not entirely unexpected.
its not too much
Well, in Vive Pro 2, they liked to experiment with the different lens configurations, and thus lens distortion driver supports lots of distortion types, and combinations of them. They can even make lens from the two different lenses glued together, and lens distortion config still fits that configuration due to its complexity.
Maybe the lens construction is more uniform for cosmos, but its config format still allows for wild configurations.
Sorry for the silence, quite a bit happened here, which kept me away from computers. I do (did) have config.json and other bits from cosmos, I’ll try to upload them somewhere when I can.Le 2 janv. 2024 à 04:37, BlueMoonShadow620 @.***> a écrit : Hello, this gonna be a bit off topic here (sorry about that), but im here in search of HTC vive cosmos elite config.json file contence i was modifying some stuff and messed up and don't have a back up. Could i ask for that file here?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Dang, I was getting really hopeful near the end of this thread. Someday I hope to be able to ditch windows, but today is not the day.
Hello, do you have an idea what amount of effort it would take to get Cosmos Elite (the one with lighthouse tracking) working, using this repo as a basis ?
Should I dig in, or ditch the idea straight away ?
I use Arch, btw. ;) Thanks.