-
Notifications
You must be signed in to change notification settings - Fork 12
PSVRConfigTool not discovering HMD/DS4. (Do find cameras/BlueTooth radio.) #19
Comments
The json file for all devices is created if one doesn't exist. I try to load it first and use default values if no config get's loaded. Then I save the config file back out if defaults changed. That happens here for the Morpheus:
Yeah those are the same WINUSB drivers that are generated by libusbk's "USB Inf Creator/Installer" Wizard (see https://sourceforge.net/projects/libusbk/). I'm pretty sure PSVRToolbox used them same driver creation wizard. From your logs it looks like your USBManager is using libusb API instead of the WinUSB API. I forgot that libusb was set to the default API to use: The USBManager can be set to use the WinUSB API instead if you either change that code OR set the "usb_api" to "winusb_api" in I was trying to support either USB api depending on what driver the user decided they wanted to use. Sorry for the confusion there.
I'm honestly not sure if the DS4's controller input HID report is sent when connected via USB. I think I've only tried sending the bluetooth pairing address HID packet to the DS4. I haven't done much with DS4 support initial optical tracking work back in 2016. I made some videos back then talking in detail about all the stuff I was trying at the time in case you are curious: Video 1 (8min): https://www.youtube.com/watch?v=ywxjFAQuxkQ
I think if you haven't successfully opened one of the USB interfaces on the Morpheus it will shut it self down after a few minutes? Or it might be that you have to put a post-it note over the head detection sensor in the HMD. I forget. It's been a while since I've tested this.
You should only need to run as an administrator when trying to pair a PSMove controller. That process involved poking the registry at the right time to force that controller to get through the window s bluetooth pairing process. |
This stuff absolutely must be automated. This Issue should remain open until it is. Or another Issue is filed. I'm curious what happens, or if it's possible, if drivers are a mix of Libusb and Winusb?
I'm not 100% certain, but I've never noticed DS4Windows failing to support SIXAXIS motion controls when plugged in with just USB. I've never read anything to that effect. I think there is probably a way to read its state over USB. The DirectInput device only appears to output stick/trigger axes in the Control Panel. Here is the new console output after switching to
The "is no longer connected" lines are no more. But it's still in the "Morpheus command interface is flagged as DISABLED." branch. You can see in the code link you provided that taking that branch does not save the Morpheus JSON file out to the user's settings. Off-topic: It seems like I have the good fortune of finding a partner to develop something really big. I don't know if by the time we get around to a media event that we will have OpenXR or something to support all VR, but I still want to keep working on support for Sony's VR. I think they're likely to have the best VR for the foreseeable future anyway. We are going to be bringing the King's Field franchise back from the dead. It's the original 3D video game. It's kind of the poster child for VR. It's something I could not do by myself. But I think the coast is clear. This is why I'm so eager to figure this out. Plus for my own work, I'd rather not have to think about the head set drifting away. Even if my tracker-less solution is nice, it's never going to be perfect. I think having any degree of camera based tracking should work, since it provides an absolute reference. |
Update: I haven't (yet) run this code, but it looks pretty obvious that what is keeping the HMD from being detected is the following constructor:
I assume this is by design, so to force use of a virtual HMD? But I want to explore use of the HMD's sensors, and develop a server if one is not there. I also see a comment in the translation-unit that says:
This kind of sounds like it wants "libusb" but the drivers are WinUSB. I'm just looking for (RFC) ideas about what to do with this constructor, and if there is a WinUSB conflict here. What if the "USB Manager" is set to use winusb_api? I'm going to explore these things for myself. But prefer to have advice. EDITED: It also occurs to me that this code considers the "command_interface" separate from the sensor. But the check for this state seems to preclude writing a configuration file. I don't know if "morpheus_open_usb_device" corresponds to "getIsOpen" but if so, there's no way to open the device without the command-interface request. I don't know if there is a backdoor for sensors. But it makes it so no HMD appears on the PSVRConfigTool, and prints disconcerting output. |
That comment is a bit confusing and old (This code was copied from in-progress PSVR work in PSMoveService). It is true that libusb has the threading problems mentioned, but that is handled now in the usbmanager. All usb requests are managed on single worker thread with a message queue. The intent of the disable flag is separate from any usbapi issue. It was to allow to this tool to access the sensor data interface but let another tool (PSVRToolbox) use the command interface to control the lights. I also tested with the disable flag turned off. Honestly I think this flag can be removed at this point. As for this winusb/libusb setting I just set it to match the psvr driver I was using for the headset. That said, there is no reason that there has to be only one usbapi active. In theory usbmanager could have both apis available. Libusb was just the api I got working first, then started working on winusb support. I never got to finish the cleanup work to support both at the same time. As you have noticed over the last week, there are a lot of sharp corners to get caught on right now. I had to drop work on this project 6 months ago to address a bunch of user issues with PSMoveSteamVRBridge, which left a lot of stuff unfinished. |
I will change the default to winusb_api if you haven't already/I don't forget. I have some weirdness to report about the HMD enumeration: Basically my system enumerates 3 devices for the HMD that all use 8 for their interface-number:
(EDITED: I see this GUID requests the device driver.) This the next. Everything looks the same, except col02. The third/final is col03.
Device Manager shows several devices (usually but not always marked as VR) with these IDs, but I can't find mi_08 among them. And I have no idea why hid_enumerate (hid.c) would enumerate these instead of the others. The set is on. Finger over IR sensor lights up its screen. I'm sure PSVRToolbox works. Maybe you've seen this before? EDITED: I'm not sure this is the only place that collects devices. But in |
Note, the PSVRFramework code looks like this:
It's very straightforward. I suspect hid_enumerate is not using the APIs correctly. I can't think of why it would omit matches if not. |
Man I hate to keep returning to this Issues tracker! The GUID is https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/finding-and-opening-a-hid-collection I wonder if there's something unusual about my system. As far as I know it's not like Trinus PSVR (I think it's installed) or PSVRToolbox would change things simply by being installed. P.S. I tried to use |
Oh! Sorry, I was mistaken earlier in saying that you should switch over using the WinUSB setting. I forgot that libusb can use both the libusb-0.sys and winusb.sys kernel drivers. If you set the USB manager to use the WinUSB api then only devices that have the winusb.sys kernel drivers will work. I was implementing the two APIs because only the WinUSB API supports isochronous USB transfers, but that's only needed for the microphone stream interface, and that isn't supported yet (and probably won't be anytime soon). You can verify which usb driver each usb interface has installed using usbdeview: On my machine you can see that interface 4 has Hidusb.sys (installed by windows by default) and interface 5 has WinUSB.sys installed on it (Installed by drivers\WinUSB\PS_VR_Control_Interface_5\InstallDriver.exe)
I also missed that you were only getting interface 8 back. That is also a PSVR HID interface (PS VR Control2 according to this), but not HID interface 4 (PS VR Sensor). This implies to me that you don't have HidUSB,sys installed in that interface. You can verify this with usbdeview. If some other driver is bound then hidapi won't enumerate that interface.
Thanks for that reference. I had honestly not really understood what the collection portion of the HID interface was. The HID (Human Interface Device) API is a layer on top of USB (on top of Interrupt transfers I believe), that is used to send and receive "HID Reports". The sensor data we get in interface 4 is one type of report. It's up to the hardware to decide how it wan't to group up the reports into a collection, where a collection has a CAPS structure that defines what kind of reports it has. As you noticed, the get_interface_path(MORPHEUS_SENSOR_INTERFACE) line is scanning the list of hid collections return on all interfaces of a usb device. It's lazily returning the first collection it finds for a given interface. It just so happens that the the first collection on interface 4 is the one we want. |
I will (of course) mess around with this. I'm available to work on this stuff full-time, so I hope you will also try to meet me half way and try to pull things together in the meantime. Going by your videos (above) you're clearly invested in this, so I imagine you'd like to get it off the ground too! FWIW I've, of course, tried with libusb_api also. And I've installed the 4 driver from your files. I did not install 5 because it looked identical to the one installed by PSVRFramework's files. And because 4 didn't work. I think whatever PSVRFramework is doing we should be looking at... because it works reliably. It works on my system, while PSVRTracker does not. I'm not sure what else I should have to install (HidUSB,sys?) but I will dig into it. I did look at the USB (.net) library it uses yesterday. I'm thinking of no longer throwing myself at this problem near-exclusively everyday until all of the devices are detected/figured out... so I'm not just reporting problems day-in-day-out! The last few days with it have not felt like productive ones. I'm also more than a little concerned about performance (CPU) and am beginning to wonder if a desktop PC just cannot host cameras reasonably. The code running on my PC is nowhere close to what's reasonable allotment of resources to a peripheral. My workstation has a much better CPU than I would ever require of a game to run (for building software) so it's a nonstarter if it cannot do the tracking even without a game using the CPU at the same time. |
Okay, I was actually composing a reply as you posted. I understood you, I just had to make time to look into it. My thoughts are below. Maybe there's something interesting in them, I don't know. Your plan sounds good. I can implement the same functionality as PSVRToolbox. I can implement the UDP server. And hopefully we can come up with a C++ service with the same feature set (plus more) as the dead PSVRToolbox. My only reservation is the UI using SDL versus the more user-friendly one provided by PSVRToolbox ... and the fact that this project is really just an arm of PSMoveService, and will ultimately go the way of the dodo bird itself! Maybe we can negotiate something through email. I have to develop a configurator style tool for my game-development software, that will ultimately be provided for configuring all of these peripherals. Whether it hosts the service or not. So, I don't mind if there is a need for a third, front-end, project. I need to provide one program that also includes game settings. There could be a base program that can serve as a front-end, that third-party projects can extend. That could use SDL though I have no background with it. wxWidgets maybe. Not QT. Definitely not C#. (EDITED: I'm actually more incline to use a flat interface, like RetroArch's PS3 user-interface. I actually approached them the other day to see if their UI could be made into a library. They thought it was too messy/unusable.)
This is what I would recommend, if it can have a small CPU footprint. Even one PSEye if it can be made to work reasonably. I'm personally interested in not drifting. Some head movement is okay, but I am not trying to achieve an amusement park style standing experience. I'm really interested in VR on the lowest common denominator budget. PS3Eye is the more affordable option. As long as the cameras remain available. -------COPY OF MY ORIGINAL REPLY FOLLOWS------
Okay... so it seems to me that there needs to be some work done here, since what your saying is to NOT install Maybe it doesn't, but its project also recommends installing a libusb/WinUSB driver over Interface 4. So either PSVRTracker needs to work with that driver, or it needs to provide the functionality of PSVRToolbox (I'm all for the latter, but know it will be uphill battle. I'm on board to implement it if you can get the USB channel opened up for me to program against. I have no experience there) |
Following up: The HMD situation has improved and seems resolved, however I think DS4 is not recognized over BT and should have USB support added. |
The PSVR is not appearing. It may be because there isn't the MorpheusHMDConfig.json file among the others. Neither is a connected DS4 found.
MorpheusHMD::open
is entered. I see adrivers
folder that has WinUSB drivers. I assume these are identical to the ones I've installed for using PSVRToolbox. I would like it very much if a project can be developed to supersede PSVRToolbox. It's defunct, and C++ is beats C#.open
tries to load this JSON file, that is not in the folder. I don't know if that's the only thing standing in its way.I would like to see the SIXAXIS in the DS4 work too. Can it work over USB? I tend to keep my BlueTooth receiver off unless using it. Currently it's not showing up.
These lines might refer to the PSVR going by both having "VID_054C&PID_09AF" in them:
libusb: error [init_device] device '\\.\USB#VID_054C&PID_09AF&MI_08#6&33932C53&0&0008' is no longer connected!
PSVRToolbox is working as normal. DS4 is working fine, using Sony's built-in driver.
EDITED: Maybe "no longer connected" refers to it being a secondary monitor? Does the IR sensor have to have the screen turned on? Is there a "Run as Administrator" requirement? (PSVRToolbox seems to require that for some things. I find that to be a problem; if only because things break when not done so, but it otherwise seems to work fine. I'm not sure why it needs that.)
The text was updated successfully, but these errors were encountered: