Comments (12)
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.
from ds4drv-cemuhook.
Oh, this TODO is exactly what we need:
ds4drv-cemuhook/ds4drv/servers/udp.py
Lines 74 to 81 in 28aa88c
The protocol supports two different modes for registration: slot-based and MAC-based.
from ds4drv-cemuhook.
I pushed another change to the same branch. It works with Dolphin now (at least on my side) :)
from ds4drv-cemuhook.
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...
from ds4drv-cemuhook.
- Right now UDP server is being started inside controller's thread, so when there are two controllers, there will be two servers. We probably need to initialize a single UDP server instance before any controllers are registered in
__main__.py
instead of doing it ininput.py
;
ds4drv-cemuhook/ds4drv/actions/input.py
Lines 100 to 104 in 28aa88c
ds4drv-cemuhook/ds4drv/__main__.py
Lines 176 to 178 in 28aa88c
- For client to be able to detect multiple controllers, we need to send multiple packets from
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);
ds4drv-cemuhook/ds4drv/servers/udp.py
Lines 64 to 72 in 28aa88c
- In
UDPServer.report
"pad id" field will depend on the source of the report. Right now it is hard coded to 0 (first controller);
ds4drv-cemuhook/ds4drv/servers/udp.py
Lines 109 to 115 in 28aa88c
- To read input events from each controller we can probably use
DS4Controller.loop.register_event("device-report", callback)
instead of modifyingReportActionInput.handle_report
.
ds4drv-cemuhook/ds4drv/actions/input.py
Lines 133 to 135 in 28aa88c
I will try to make it work with a single controller. Probably it will then start working with multiple controllers as well :)
from ds4drv-cemuhook.
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
from ds4drv-cemuhook.
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
from ds4drv-cemuhook.
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.
from ds4drv-cemuhook.
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 😊
from ds4drv-cemuhook.
Yes! It works! Thank you so much!
from ds4drv-cemuhook.
Nice! I will merge it with master now 👍
from ds4drv-cemuhook.
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.
from ds4drv-cemuhook.
Related Issues (13)
- Fork specific documentation? HOT 1
- Smoothing Gyro Data
- Sony Dualsense support? HOT 7
- DualShock 3?
- Gyro Drift HOT 1
- UI when?
- Why no rumble? HOT 14
- no attribute SafeConfigParser HOT 1
- A yaw axis multiplier is wrong (because the motion server has inconsistencies of another nature) HOT 9
- 'hcitool' could not be found, make sure you have bluez-utils installed. HOT 1
- Controller configuration impossible due to constant controller updates HOT 1
- LED color isn't changing in hidraw BT mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ds4drv-cemuhook.