ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.09k stars 1.28k forks source link

Device Class overwrite #1213

Open mmorselli opened 5 years ago

mmorselli commented 5 years ago

I changed the role of a Vive Tracker in order to be detected as a controller. While the properties mimic those of a controller, the device class is still read as a tracker

vr::VRSystem()->GetTrackedDeviceClass(id)

returns _TrackedDeviceClassGenericTracker

this causes issues with some applications (e.g. Beat Saber)

so, my question is:

is there a way to programmatically override the device class with _TrackedDeviceClassController ?

or, alternatively, what could be wrong with the device properties?

1000    string  aapvr
1001    string
1002    string  LHR-0DC0C547
1003    string  vr_controller_vive_1_5
1004    bool    0
1005    string  HTC
1006    string  1498808359 htcvrsoftware@firmware-win32 2017-06-30 FPGA 262(1.6/0/0) BL 0 VRC 1498808359 Radio 1466630404
1007    string  product 132 rev 1.0.4 lot 2000/0/0 0
1009    string  DBD45A15BF
1014    bool    0
1015    bool    0
1016    string  https://developer.valvesoftware.com/wiki/SteamVR/HowTo_Update_Firmware
1017    uint64  2214658052
1018    uint64  1498808359
1019    uint64  262
1020    uint64  1498808359
1021    uint64  1466630404
1022    uint64  1461100729
1028    string  LHR-0DC0C547
1029    int32   3
1032    bool    0
1033    bool    1
1034    uint64  8589934594
1035    string  htc
1036    string  htc/vive_controllerLHR-0DC0C547
1037    string  {htc}/input/vive_controller_profile.json
1043    bool    1
3001    uint64  12884901895
3002    int32   1
3003    int32   3
3007    int32   0
5001    string  {htc}/icons/tracker_status_off.png
5002    string  {htc}/icons/tracker_status_searching.gif
5003    string  {htc}/icons/tracker_status_searching_alert.gif
5004    string  {htc}/icons/tracker_status_ready.png
5005    string  {htc}/icons/tracker_status_ready_alert.png
5006    string  {htc}/icons/tracker_status_error.png
5007    string  {htc}/icons/tracker_status_standby.png
5008    string  {htc}/icons/tracker_status_ready_low.png
6002    bool    0
6004    bool    0
6005    bool    0
6006    bool    0
7000    string  vive_controller
7002    int32   0
TheDeveloperGuy commented 5 years ago

The easiest (perhaps only) way to achieve this, is via a "hook" driver that hooks TrackedDeviceAdded and changes the the device type before calling the original TrackedDeviceAdded.

mmorselli commented 5 years ago

Thank you. I was hoping for a more straightforward path, but I will take a look.

Do you know which properties SteamVR checks to decide it is a GenericTracker?

TheDeveloperGuy commented 5 years ago

AFAIK, the decision is made when TrackedDeviceAdded is called by the driver.

TheDeveloperGuy commented 5 years ago

Doing the same kind of thing:

https://github.com/ValveSoftware/openvr/issues/1211

TheDeveloperGuy commented 4 years ago

@mmorselli There is a more simple way, there is an HTC utility called "ViveTrackerRoleChanger", that will change the firmware(?) of the tracker to make it report itself as a controller. It seems you need the 1.0 version for the older trackers and the 2.0 version for the newer trackers, both of which are very hard to find. It also seems that there may be some difficulty in doing the reverse (change tracker back to tracker), so do some research first.

For my UC, the hook works perfectly, and the utility wouldn't help me as I need to change the type to 'base station'.