Closed ee5cd7d5d closed 3 years ago
Current implementation of UDP server only supports one controller at a time. The driver, in theory, does support multiple controllers, but I do not have the second one to test this.
I could actually try to implement it myself when I have time :) could you give me a rough idea of what I would need to do in order to achieve that? Like how would I need to change the UDP packet...
__main__.py
instead of doing it in input.py
;UDPServer._req_ports
. This part is almost ready, we just need to keep count of active controllers and populate responses with real data (MAC address);UDPServer.report
"pad id" field will depend on the source of the report. Right now it is hard coded to 0 (first controller);DS4Controller.loop.register_event("device-report", callback)
instead of modifying ReportActionInput.handle_report
.I will try to make it work with a single controller. Probably it will then start working with multiple controllers as well :)
I've created a separate branch for this feature. Could you please test it?
pip3 install git+https://github.com/TheDrHax/ds4drv-cemuhook.git@multiple-controllers
ds4drv --hidraw --udp --next-controller
Hi! It's working better now, at least there is data from both controllers, but it seems to be mixing up the packets. Now Dolphin is detecting both controllers but it's showing the sensors from both in both, switching very rapidly between the values of each controller (like several times per second)
Padtest + wine seems to not have the problem, but I think it is filtering the packets clientside using the MAC Address
I was able to reproduce this issue with a single controller by copying reports to another slot and changing them slightly.
Apparently, Dolphin creates a separate connection for each controller, ignores pad id
byte and expects only updates for a single controller per connection. So the server needs to keep track of each client's requests.
Oh, this TODO is exactly what we need:
The protocol supports two different modes for registration: slot-based and MAC-based.
I checked with a newer build of dolphin to see if it improved, but the problem remains. I will not get to look into it right away, but let me know if I can do anything to help 😊
I pushed another change to the same branch. It works with Dolphin now (at least on my side) :)
Yes! It works! Thank you so much!
Nice! I will merge it with master now :+1:
This seems to not have fixed on cemu's side.. I can only get one game pad motion source (DSU1) listed in options, all others show as disconnected, despite the ds4drv logs showing two controllers got connected.
What's the problem? Describe what went wrong.
I tried connecting two DualsShocks 4 via DSU Client to the Dolphin emulator as described here: https://wiki.dolphin-emu.org/index.php?title=DSU_Client but only one is recognized (DSUClient/0/xxx, DSUClient/1/xxx is missing). I tried testing with the DSU Pad Test application over wine, same thing only one DS4 is recognized.
What steps will reproduce the problem?
Connect two DS4 via Bluetooth, open devices configuration on Dolphin, add DSU source.
What is the system information?
Dolphin Version: 5.0-14002
Tested with ds4drv 0.5.1