Closed alx242 closed 6 years ago
Thanks !
AFAIK, the DS4 controller behaves the same (= listed in IOHID list calls, etc) if paired via BT, it should be seen as an HID by OSX like when plugged via USB.
You probably don't need to spoof DeviceID and ProductId since it should be the same as a USB plugged DS4, but you might want to try spoofing the COMMON_DEVICE_TRANSPORT
to return USB
instead of whatever that value is when paired via BT ("BT" maybe?, that should be somewhere on apple docs).
That would mean adding "BT DS4" in the filters set by IOHIDManagerSetDeviceMatchingMultiple
so that when remoteplay calls list HID, BT DS4 are also returned.
Then make IOHIDDeviceGetProperty
always return USB
when asking for COMMON_DEVICE_TRANSPORT
Thank you for this project! I am trying to understand your instructions to make the DS4 work connected via Bluetooth, but I am having trouble finding information to complete the change. Can you provide any further help regarding this? I have tried updating the COMMON_DEVICE_TRANSPORT
and the SPOOF
values, but I am not sure how to troubleshoot.
I'm not sure, I feel like i'd just repeat what i just told above at the time, instead of spoofing a device to be another, you want to make the device be reported as USB instead of bluetooth (and it may very well not work as i never tested it)
Ok. Thank you for your response.
I got it to a point where it spoofs values, using a combination of this project and shockemu, but PS Remote Play doesn't acknowledge the controller.
Here is the output when I run the run script:
== IOHIDManagerSetDeviceMatchingMultiple (3) ==
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>DeviceUsage</key>
<integer>5</integer>
<key>DeviceUsagePage</key>
<integer>1</integer>
<key>ProductID</key>
<integer>1476</integer>
<key>Transport</key>
<string>USB</string>
<key>VendorID</key>
<integer>1356</integer>
</dict>
<dict>
<key>DeviceUsage</key>
<integer>5</integer>
<key>DeviceUsagePage</key>
<integer>1</integer>
<key>ProductID</key>
<integer>2508</integer>
<key>Transport</key>
<string>USB</string>
<key>VendorID</key>
<integer>1356</integer>
</dict>
<dict>
<key>DeviceUsage</key>
<integer>5</integer>
<key>DeviceUsagePage</key>
<integer>1</integer>
<key>ProductID</key>
<integer>2976</integer>
<key>Transport</key>
<string>USB</string>
<key>VendorID</key>
<integer>1356</integer>
</dict>
<dict>
<key>DeviceUsage</key>
<integer>5</integer>
<key>DeviceUsagePage</key>
<integer>1</integer>
<key>ProductID</key>
<integer>2508</integer>
<key>Transport</key>
<string>Bluetooth</string>
<key>VendorID</key>
<integer>1356</integer>
</dict>
</array>
</plist>
== IOHIDDeviceGetProperty: {VendorID} ==
<CFNumber 0x54c27 [0x7fffab9a08e0]>{value = +1356, type = kCFNumberSInt32Type}
spoofing to 54c
== IOHIDDeviceGetProperty: {ProductID} ==
<CFNumber 0x9cc27 [0x7fffab9a08e0]>{value = +2508, type = kCFNumberSInt32Type}
spoofing to 9cc
== IOHIDDeviceGetProperty: {Transport} ==
Bluetooth
spoofing to USB
== IOHIDDeviceGetProperty: {VersionNumber} ==
<CFNumber 0x10027 [0x7fffab9a08e0]>{value = +256, type = kCFNumberSInt32Type}
spoofing to 100
== IOHIDDeviceGetProperty: {VendorID} ==
<CFNumber 0x54c27 [0x7fffab9a08e0]>{value = +1356, type = kCFNumberSInt32Type}
spoofing to 54c
== IOHIDDeviceGetProperty: {ProductID} ==
<CFNumber 0x9cc27 [0x7fffab9a08e0]>{value = +2508, type = kCFNumberSInt32Type}
spoofing to 9cc
== IOHIDDeviceGetProperty: {Transport} ==
Bluetooth
spoofing to USB
== IOHIDDeviceGetProperty: {VersionNumber} ==
<CFNumber 0x10027 [0x7fffab9a08e0]>{value = +256, type = kCFNumberSInt32Type}
spoofing to 100
== IOHIDDeviceGetReport(0x12, 16)
spoofing report
== IOHIDDeviceGetProperty: {VendorID} ==
<CFNumber 0x54c27 [0x7fffab9a08e0]>{value = +1356, type = kCFNumberSInt32Type}
spoofing to 54c
== IOHIDDeviceGetProperty: {ProductID} ==
<CFNumber 0x9cc27 [0x7fffab9a08e0]>{value = +2508, type = kCFNumberSInt32Type}
spoofing to 9cc
== IOHIDDeviceGetProperty: {Transport} ==
Bluetooth
spoofing to USB
== IOHIDDeviceGetProperty: {VersionNumber} ==
<CFNumber 0x10027 [0x7fffab9a08e0]>{value = +256, type = kCFNumberSInt32Type}
spoofing to 100
== IOHIDDeviceGetReport(0x12, 16)
spoofing report
== IOHIDDeviceGetReport(0xa3, 49)
spoofing report
== IOHIDDeviceGetReport(0x2, 37)
spoofing report
I'll keep tinkering with it. Thanks again.
I have gotten to the point where PS Remote Play recognizes that a "valid" controller is connected, but I think I'm not any closer to solving the problem. I think it should have been unnecessary to actually spoof IOHIDDeviceGetReport
, but it fails to get a response from the controller. In my research, it appears that Bluetooth HID devices require the asynchronous version of IOHIDDeviceGetReport
and IOHIDDeviceSetReport
(IOHIDDeviceRegisterInputReportCallback
and IOHIDDeviceSetReportWithCallback
). This is a bit outside of my capability at the moment, so I am going to give it a rest until I have more time and experience.
Looked at the code and love that it works so good (as it does).
One thing I have wanted is to get to use the regular DS4 controller hooked up using regular Bluetooth to the Mac and use it wirelessly. I assume that would be possible with your code but it of course needs to be adapted (to hook into Bluetooth events instead). I didn't feel comfortable doing it on my own and haven't gotten the time to dig into the details.
Feels like this is out of the scope for this project but wanted to see what your thoughts are surrounding this and perhaps you could point me in the right direction so I could fix this on my own (feeling a bit noobish towards this code).
Regards, /Alex