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

Rudimentary support for the Pimax 4K #350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grafdigital
Copy link

This commit merges with minimal cleanup and adjustments the branch "dev-pimax" by TheOnlyJoey. Raw USB/HID captures of a Pimax 4k were analyzed. The significant changes were that only HID responses of type "11" are relevant and can be triggered with HID request "17", and they run into a timeout after ~3 sec if no other "17" request is sent. The headset can still crash/stop sending data. Sometimes it resumes after a while. Otherwise, it needs to be replugged.

During testing, gyro drifting was noticed. So far, this was fixed with magic numbers gathered with external python scripts "grafdigital/OpenHmdPimaxTools" that may only work with the headset the data was pulled from. Should we look into setup functions or make these values configurable through files?

Lens correction needs improvement. This is the first draft to get passable graphical output. Head tracking is passable but lags a bit, but this could be due to the device.

Functionality was validated with "openglexample".

Still missing is the utilisation of magnetometer data.

This commit merges with minimal cleanup and adjustments the branch "dev-pimax" by TheOnlyJoey.
Raw USB/HID captures of a Pimax 4k were analyzed. The significant changes were that only
HID responses of type "11" are relevant and can be triggered with HID request "17", and
they run into a timeout after ~3 sec if no other "17" request is sent. The headset can still
crash/stop sending data. Sometimes it resumes after a while. Otherwise, it needs to be replugged.

During testing, gyro drifting was noticed. So far, this was fixed with magic numbers gathered
with external python scripts "grafdigital/OpenHmdPimaxTools" that may only work with the headset
the data was pulled from. Should we look into setup functions or make these values
configurable through files?

Lens correction needs improvement. This is the first draft to get passable graphical output.
Head tracking is passable but lags a bit, but this could be due to the device.

Functionality was validated with "openglexample".

Still missing is the utilisation of magnetometer data.
@grafdigital grafdigital mentioned this pull request Jan 31, 2023
@RoxyBoxxy
Copy link

Does the screen work on this branch, my pimax artisan works ish the tracking is there and i can see it move in steamvr just no picture to the screen

@grafdigital
Copy link
Author

@RoxyBoxxy
it should, but the screen is not configured automatically
after connecting the HMD, I needed to manually set it up. in my case:
xrandr --output HDMI2 --right-of HDMI1 --rotate left --mode 1080x1920

also if the HMD does not show up in xrandr with an NVIDIA card, you may need to set this X11 conf (as per the post of @bigbruno)
/usr/share/X11/xorg.conf.d/10-nvidia.conf
Option "AllowHMD" "yes"

@RoxyBoxxy
Copy link

i am using the display port how ever xrandr is not even showing the modes

Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 connected primary 1920x1080+0+0 inverted (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1440x900      59.89  
   1280x1024     60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       59.94  
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 521mm x 293mm
   1920x1080     60.00*+
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94  
DP-5 disconnected (normal left inverted right x axis y axis)

@grafdigital
Copy link
Author

does it show up when you do xrandr --verbose?
=> in reference to this reddit post

@SpookySkeletons
Copy link

@grafdigital I took a look at some other pimax pcaps and it appears this wakeup packet is found in all P2 type HMDs

This branch may yet work with many relevant pimax

@SpookySkeletons
Copy link

@grafdigital What's necessary to try to pattern match another type of pimax HMD in the packet function? Do you have any time or will to mess around with this over some IM, I have a ssh ready paravirt machine with a pimax attached if interested.

@SpookySkeletons
Copy link

Just tested your branch by changing the USB
#define DEVICE_HMD 0x0101

Got usable 3DoF on a 0483:0101 STMicroelectronics Pimax P2EA
No display initialization but 3DoF tracking OK

[II] timestamp 285977C0 [II] samples 14 [II] tick: 0 [II] accel: -508 91985 5670 [II] gyro: -107 30 -3 [II] mag: -4843 -4393 6147 [II] accel: -790 93113 6153 [II] gyro: -139 11 11 [II] mag: -4843 -4393 6147

@SpookySkeletons
Copy link

f000000d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

This packet appears to be necessary to send once every second and causes the displayport connection to come alive on my 5K plus

@SpookySkeletons
Copy link

Yep, looks like all Pimax P2 HMDs are a dual keepalive packet, noting here for anyone who would like to know
https://gitlab.freedesktop.org/haagch/monado/-/commits/5k+

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

Successfully merging this pull request may close these issues.

None yet

3 participants