Closed tiagogl closed 1 year ago
Thanks for trying this repo. To be honest, I can't tell if DS5 is supported because I don't own a DS5 controller.
batocera-extra integrates TheDrHax/ds4drv-cemuhook, and it looks like this project does not support DS5 controllers (see #14). The last comment mentions another project lirannl/dsdrv-cemuhook. Maybe you can try if this one works for you?
I just created branch feature/ds5 including dsdrv-cemuhook with support for DualSense 5 controllers (in addition to ds4drv-cemuhook). If you find the time, please test if it works for you and report back.
Thanks a lot I will try and provide the details!
Didn't work. I perform same steps and have same issue, NO MOTION! https://1drv.ms/f/s!Ai2pIuArbKBg2MAY2HwjuHOzYh4g1Q?e=tuYsPz ( Evidences)
Thanks for testing. Your configuration on the screenshots looks OK.
I see 3 possibilities that prevent motion control: the cemu configuration, the dsdrv driver or the kernel module.
If you're willing to debug further: you could try to
Then load a game and check if motion works. If it works, then we should also be able to make it work from within batocera.
If it does not work, the cemu configuration should not be the cause. Next steps:
evtest
/dev/input/event20: Sony Computer Entertainment Wireless Controller
/dev/input/event21: Sony Computer Entertainment Wireless Controller Motion Sensors
/dev/input/event22: Sony Computer Entertainment Wireless Controller Touchpad
evtest
by evtest | grep ABS_X
above and try again.If the numbers change on movement and stay the same without movement, the DS5 controller can be handled by the linux kernel module. Then we can focus on dsdrv.
New evidences : DSDRVhttps://1drv.ms/a/s!Ai2pIuArbKBg2MAgdmmoFydAygCJCw Still not working. Could be something related with name of device ? Because still being recognized as new device and same name os DS4 not DS5.
Obter o Outlook para Androidhttps://aka.ms/AAb9ysg
From: Christian @.> Sent: Sunday, June 25, 2023 2:24:20 AM To: git-developer/batocera-extra @.> Cc: tiagogl @.>; Author @.> Subject: Re: [git-developer/batocera-extra] [Question] DS5 Dual Sense is supported? (Issue #3)
Thanks for testing. Your configuration on the screenshots looks OK.
I see 3 possibilities that prevent motion control: the cemu configuration, the dsdrv driver or the kernel module.
If you're willing to debug further: you could try to
Then load a game and check if motion works. If it works, then we should also be able to make it work from within batocera.
If it does not work, the cemu configuration should not be the cause. Next steps:
/dev/input/event20: Sony Computer Entertainment Wireless Controller /dev/input/event21: Sony Computer Entertainment Wireless Controller Motion Sensors /dev/input/event22: Sony Computer Entertainment Wireless Controller Touchpad
If the numbers change on movement and stay the same without movement, the DS5 controller can be handled by the linux kernel module. Then we can focus on dsdrv.
— Reply to this email directly, view it on GitHubhttps://github.com/git-developer/batocera-extra/issues/3#issuecomment-1605876756, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AITH7MYQ7ZCXYIILWSEPIGDXM7DQJANCNFSM6AAAAAAZRRW5XU. You are receiving this because you authored the thread.Message ID: @.***>
Did you run the first video (evtest) with grep (evtest | grep ABS_X
)? It looks to me like grep is missing, so that we can't see if the controller movement is recognized properly.
The second video: are you sure that dsdrv
is running?
/userdata/extra/dsdrv-cemuhook/is-up
should show a number; when it shows nothing, it is not running.cat /userdata/system/logs/dsdrv-cemuhook.log
When I connect a DS4 controller, the dsdrv log shows an error.
When connecting via USB:
[info][controller 1] Created devices /dev/input/js0 (joystick) /dev/input/event19 (evdev)
[info][hidraw] Scanning for devices
[info][hidraw] Scanning for devices
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.10/site-packages/dsdrv/__main__.py", line 222, in <module>
main()
File "/usr/lib/python3.10/site-packages/dsdrv/__main__.py", line 193, in main
for device in backend.devices:
File "/usr/lib/python3.10/site-packages/dsdrv/backends/hidraw.py", line 190, in devices
yield cls(name=device_name,
File "/usr/lib/python3.10/site-packages/dsdrv/backends/hidraw.py", line 38, in __init__
super(HidrawDSDevice, self).__init__(
File "/usr/lib/python3.10/site-packages/dsdrv/device.py", line 96, in __init__
self.set_operational()
File "/usr/lib/python3.10/site-packages/dsdrv/backends/hidraw.py", line 116, in set_operational
addr = self.read_feature_report(self.controller.value.get_bt_mac_op, 6)[1:]
AttributeError: 'NoneType' object has no attribute 'value'
When connecting via Bluetooth:
[info][controller 1] Created devices /dev/input/js0 (joystick) /dev/input/event19 (evdev)
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.10/site-packages/dsdrv/__main__.py", line 222, in <module>
main()
File "/usr/lib/python3.10/site-packages/dsdrv/__main__.py", line 193, in main
for device in backend.devices:
File "/usr/lib/python3.10/site-packages/dsdrv/backends/hidraw.py", line 190, in devices
yield cls(name=device_name,
File "/usr/lib/python3.10/site-packages/dsdrv/backends/hidraw.py", line 38, in __init__
super(HidrawDSDevice, self).__init__(
File "/usr/lib/python3.10/site-packages/dsdrv/device.py", line 96, in __init__
self.set_operational()
File "/usr/lib/python3.10/site-packages/dsdrv/backends/hidraw.py", line 106, in set_operational
self.read_feature_report(self.controller.value.set_operational_op, 37)
AttributeError: 'NoneType' object has no attribute 'value'
Looks like dsdrv doesn't work as expected, at least on my side for a PS4 controller.
The problem seems to be related to PS4 controllers. I fixed it and committed a patch upstream.
With this patch, motion works in Cemu using dsdrv and a PS4 controller.
Same issues. I'm not sure but the issue can be naming convention? As I remeber Sony entertainment controller is releted with DS4 only. https://1drv.ms/f/s!Ai2pIuArbKBg2MAY2HwjuHOzYh4g1Q
Sorry that I didn't respond earlier, @tiagogl. Unfortunately, I didn't get a notification about your last comment.
In your video it looks like that motion data is received successfully by the linux kernel module. That's good.
On my machine, after starting dsdrv-cemuhook the log /userdata/system/logs/dsdrv-cemuhook.log
contains:
$ cat /userdata/system/logs/dsdrv-cemuhook.log
[info][controller 1] Created devices /dev/input/js0 (joystick) /dev/input/event19 (evdev)
[info][hidraw] Scanning for devices
After connecting a DS4 controller via USB:
[info][controller 1] Connected to USB DualShock4 Controller (84:17:66:61:8E:E3 84:17:66:61:8E:E3 hidraw3)
[info][hidraw] Scanning for devices
[info][controller 1] Battery: 25%
[info][controller 1] Disconnected
[info][controller 1] Connected to USB DualShock4 Controller (84:17:66:61:8E:E3 84:17:66:61:8E:E3 hidraw4)
[info][hidraw] Scanning for devices
[info][controller 1] Battery: 45%
[info][controller 1] Battery: 54%
After disconnecting USB and connecting via bluetooth (by pressing the P button):
[info][controller 1] Disconnected
[info][controller 1] Connected to Bluetooth DualShock4 Controller (84:17:66:61:8E:E3 hidraw6)
[info][hidraw] Scanning for devices
[info][controller 1] Battery: 37%
I didn't see such messages in your logs.
So I suggest as next steps:
lsusb
. Example:
# lsusb | grep -i sony
Bus 001 Device 010: ID 054c:05c4 Sony Corp. DualShock 4 [CUH-ZCT1x]
Hello, I tried and got same issue :/ https://1drv.ms/f/s!Ai2pIuArbKBg2MgepnQg0DQX3qk7sg?e=1yEG2A Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 007: ID 1915:1025 Nordic Semiconductor ASA SG Control Mic Bus 001 Device 006: ID 25a7:fa70 Areson Technology Corp 2.4G Wireless Receiver Bus 001 Device 005: ID 05e3:0751 Genesys Logic, Inc. microSD Card Reader Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub Bus 001 Device 008: ID 054c:0ce6 Sony Corp. DualSense Wireless Controller Bus 001 Device 003: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP) Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[info][controller 1] Created devices /dev/input/js0 (joystick) /dev/input/event4 (evdev) [info][hidraw] Scanning for devices [info][hidraw] Scanning for devices [info][hidraw] Scanning for devices
Hm... looks like the controller is not picked up by dsdrv, although the ID 054c:0ce6 matches. I'm out of ideas then, at least we could narrow the problem down to dsdrv.
I've also run through these same steps with a DS5 (using dsdrv-cemuhook) and have had the same results as tiagogl. If I try to connect a DS4 (ds4drv-cemuhook) as the second controller, I will get an error in the ds4drv-cemuhook.log "[error][hidraw] Unable to open DS4 device: [Errno 16] Device or resource busy".
When I connect the DS4 as first player (using ds4drv-cemuhook) it will connect correctly via USB showing it in the log, but when I disconnect USB and try to use bluetooth it gives that same error as above [Errno 16]
ds4drv-cemuhook and dsdrv-cemuhook are unrelated. ds4drv is DS4 only. dsdrv is capable of both DS4 and DS5. Both were tested successfully with a DS4 controller.
Since both ds4drv and dsdrv take DS4 controllers, they should not be running at the same time when connecting a DS4 controller. I didn't test what happens when this is done. Maybe one of them binds to the controller and locks the device (just an assumption), so this could be the cause for Device or resource busy
.
Let's focus on DS5 support of dsdrv in this issue. So please make sure dsdrv is started (dsdrv-cemuhook/is-up
prints a number) and ds4drv is not running (ds4drv-cemuhook/is-up
has no output). Then connect a DS5 controller and check the output of lsusb | grep -i sony
and the content of dsdrv-cemuhook.log
.
Maybe the DS5 controllers are not picked up by dsdrv because of a missing device name in the code. I added a patch in branch feature/ds5
(file patches/patch-dsdrv-for-ps5-controller
). Could you try if applying this patch makes a difference on your system?
Alright, followed those steps, got the following info ![Uploading PXL_20230824_015720619.jpg…]() ![Uploading PXL_20230823_025157092.jpg…]()
Yet when I run the "evtest | grep ABS_X" test, it recognizes motion data and analog stick data.
The image links do not work.
Sorry, I will have to correct this tomorrow basically log isn't detecting ds5
The problem seems indeed to be missing device names.
dsdrv supports:
Sony Interactive Entertainment Wireless Controller
(USB)Sony Computer Entertainment Wireless Controller
(USB)Wireless Controller
(Bluetooth)I borrowed a DS5 controller and found out that it is detected as:
Sony Interactive Entertainment DualSense Wireless Controller
(USB)DualSense Wireless Controller
(Bluetooth)I extended the patch accordingly, and now touch and motion are working as desired.
Could you please try if the same applies to you, @tiagogl & @aspiretocode?
Just for the records: the name of a connected controller may be listed by the command
evtest </dev/null 2>&1 | grep -ioP '/dev/input/event.*:\s*\K.*controller.*$'
I thought that could of been it, although I have little experience with device driver type stuff, my controller was showing up as "Sony Corp. DualSense Wireless Controller" in one of the tests. I will try this tonight as soon as I get off work. Thanks so much for working on this!
On Fri, Aug 25, 2023, 12:02 AM Christian @.***> wrote:
The problem seems indeed to be missing device names.
dsdrv supports:
- Sony Interactive Entertainment Wireless Controller (USB)
- Sony Computer Entertainment Wireless Controller (USB)
- Wireless Controller (Bluetooth)
I borrowed a DS5 controller and found out that it is detected as:
- Sony Interactive Entertainment DualSense Wireless Controller (USB)
- DualSense Wireless Controller (Bluetooth)
I extended the patch accordingly, and now touch and motion are working as desired.
Could you please try if the same applies to you, @tiagogl https://github.com/tiagogl & @aspiretocode https://github.com/aspiretocode?
Just for the records: the name of a connected controller may be listed by the command evtest </dev/null 2>&1 | grep -ioP '/dev/input/event.:\s\K.controller.$'
— Reply to this email directly, view it on GitHub https://github.com/git-developer/batocera-extra/issues/3#issuecomment-1692761392, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZCQDANOBC4XWGPM2TKHTDXXAWVXANCNFSM6AAAAAAZRRW5XU . You are receiving this because you were mentioned.Message ID: @.***>
Problem of name being detected still persists: dsdrv-cemuhook.log cemu-log.txt
Now the problem is a little bit worse. I can't use controller inside cemu , Is not being detected. Same controller connected on bluetooth has 2 devices with different names.
I removed the patches because they are now part of dsdrv-cemuhook - thanks for merging, @lirannl!
Now let's try to solve the remaining problems.
It is OK that a controller is shown twice in Batocera. The first one is coming from the system natively. It is listed even when dsdrv-cemuhook is not running. To confirm that, make sure dsdrv is not running, so that dsdrv-cemuhook/is-up
has no output (dsdrv-cemuhook/stop
may be used to stop). You should see only one controller in Batocera and evtest. On my system, this one is called Sony Interactive Entertainment DualSense Wireless Controller
. You can control batocera with it, but unfortunately it has no motion and touch control in emulators.
When dsdrv is started (by calling dsdrv-cemuhook/start
), a second controller is registered. On my system, it is called Sony Computer Entertainment Wireless Controller
. This one is from dsdrv-cemuhook and offers motion and touch via UDP. To use it, the software has to be configured for cemuhook with the correct port (26766 by default).
The message
[error][hidraw] Unable to open DS device: [Errno 16] Device or resource busy
is shown in dsdrv-cemuhook.log
when another process has locked the controller. To find the process that is locking your controller, you can
evtest </dev/null 2>&1 | grep Controller
/dev/input/event??
event file andlsof /dev/input/event??
(e.g. lsof /dev/input/event19
)The output shows name and pid of processes that use this device. You can get more info by running ps u -p $PID
($PID
is the pid from the output).
Example:
# ./dsdrv-cemuhook/is-up
4416
root@batocera:/userdata/extra# python3 -m dsdrv --udp --udp-port 26769
[info][controller 1] Created devices /dev/input/js3 (joystick) /dev/input/event23 (evdev)
[error][hidraw] Unable to open DS device: [Errno 16] Device or resource busy
[info][hidraw] Scanning for devices
^C[info][controller 1] Cleaning up...
root@batocera:/userdata/extra# evtest </dev/null 2>&1 | grep Controller
/dev/input/event19: Sony Interactive Entertainment DualSense Wireless Controller
/dev/input/event20: Sony Interactive Entertainment DualSense Wireless Controller Motion Sensors
/dev/input/event21: Sony Interactive Entertainment DualSense Wireless Controller Touchpad
/dev/input/event22: Sony Computer Entertainment Wireless Controller
root@batocera:/userdata/extra# lsof /dev/input/event19
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
thd 1794 root 22r CHR 13,83 0t0 631 /dev/input/event19
emulation 2317 root 32u CHR 13,83 0t0 631 /dev/input/event19
joycond-c 2667 root 7u CHR 13,83 0t0 631 /dev/input/event19
python3 4416 root 15u CHR 13,83 0t0 631 /dev/input/event19
root@batocera:/userdata/extra# lsof /dev/input/event22
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
thd 1794 root 24r CHR 13,86 0t0 657 /dev/input/event22
emulation 2317 root 34u CHR 13,86 0t0 657 /dev/input/event22
joycond-c 2667 root 4u CHR 13,86 0t0 657 /dev/input/event22
python3 4416 root 13u CHR 13,86 0t0 657 /dev/input/event22
root@batocera:/userdata/extra# ps u -p 4416
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 4416 4.4 0.1 209304 22400 pts/0 Sl 07:19 0:30 python3 -m dsdrv --udp --udp-port 26766
root@batocera:/userdata/extra# ps u -p 2667
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 2667 0.2 0.1 62300 22528 ? D 06:13 0:12 /usr/bin/python /usr/bin/joycond-cemuhook --port 26761
I hope you can find out the process that locks your controller this way.
I can confirm that a DS5 controller is working with motion and touch in Citra and Cemu, both started from Batocera.
No idea . Looks the same!
Now using usb cable
This looks all good to me. You probably have /userdata/extra/dsdrv-cemuhook/install-and-start
in your custom.sh
. That means it is started automatically on boot. When you now try to start it manually by calling dsdrv
, the controller is already locked by the first instance. This is how it should be. No need to start dsdrv from the command line.
You wrote you can't control cemu anymore. Are you able to navigate through batocera with the controller? Maybe you have to check the controller/button mapping in the cemu settings (Batocera main menu / F1 / cemu).
I will do a double check! Thanks a lot
Good News. It's working ,I was able to play Breath of the Wild using the motion perfectly. The only problem that I noted the "rumble" it's not working, I don't know if it's normal or other bug.
I can't say something useful regarding rumble, just noticed that I could "feel" the background music of a game in the controller. It seems to be transferred as haptic feedback.
If I remember correctly, there a rumble slider in the cemu controller settings. Maybe it needs an adjustment?
Since dsdrv is just ds4drv with additional features, and dsdrv is now proven to work for both DS4 and DS5 controllers, I will remove ds4drv in favor of dsdrv.
[!IMPORTANT]
The default port of dsdrv is no longer 26766 but 26762 so that it may be used as drop-in replacement for ds4drv. Please update your configuration accordingly after your next update (batocera.conf
, emulator settings).
Confirmed on Cemu integrated with Batocera and Flatpak version. The rumble is not working , I tried on bluetooth and also using cable.
When connected via USB, my controller "plays" the music via rumble. Tested in Cemu started from Batocera and from Applications menu (F1). When connected via Bluetooth, this is not the case.
PS4 controller and Switch Pro controller don't have this feature.
But I think this is something different, not "rumble", because Known issues/limitations contains:
- No rumble support
So if you'd like to have rumble, it has to be implemented upstream in lirannl/dsdrv-cemuhook.
Yes. You are right, this a driver limitation. I think this topic can be closed. I really appreciate all efforts to making this work. Thans a lot again
Sorry for the delay in responding. I've run some of the tests, seems I'm connecting, somewhat but not getting the same, or as many processes picking up my controller. If you put the patches into Batocera, does that mean I need to update Batocera? Hopefully I can work around having to update, since I've got my system at a good spot for the moment. Thanks so much for all the work on this again, awesome!
The output looks good. dsdrv is running on port 26762, and the controller was detected via bluetooth.
What is the problem? Are you able to control batocera with your controller? In which emulator do you want motion control?
Alright, been testing this a bunch, as I didn't want to waste your time. I can control Batocera / ES with the ds5, and on Cemu it works too, except motion does not seem to be working. Enabled in the game's settings, but no dice. -I've got Batocera.conf as follows wiiu.cemu_controller_api=DSUController wiiu.cemu_controller_ip=localhost wiiu.cemu_controller_port=26762 -dsdrv-cemuhook/is-up returns 1925 further info in picture
This looks all correct.
Idea 1: Please check if you have /userdata/extra/patches/patch-cemu-generator-for-cemuhook
in your custom.sh
. Without this patch, cemu does not have motion when started from batocera.
Idea 2: start cemu from the applications menu (F1 from the batocera main menu) and configure your controller manually. Set API to DSUController
, port to 26762
, and set the motion
checkbox (see picture above). Start a game and test if motion works.
The property keys in your batocera.conf
are not correct, they should be (docs):
wiiu.cemu_controller_api=DSUController
wiiu.cemuhook_server_ip=127.0.0.1
wiiu.cemuhook_server_port=26762
Sorry, got that all changed (custom.sh and batocera.conf) and it still won't work through Batocera/ES, but does if I set it up manually in the emulator's settings.
What is your batocera version?
When motion works when cemu is started from the application menu, it means that dsdrv-cemuhook is setup correctly and is working. There must be a problem with the patch, then.
The patch is written for batocera 37. If you have an older version and don't want to update, you can try one of the patches for batocera-36 or batocera-35.
You can also check if the patch was applied properly by looking at /usr/lib/python*.*/site-packages/configgen/generators/cemu/
. There should be two files cemuGenerator.py
and cemuGenerator.py.backup-cemuhook
. The cemuGenerator.py
should contain cemuhook_server_port
somewhere.
After patching, cemuControllers.py
should look like in this archive.
batocera-37 does not contain the tool patch
which is required to apply patches, so your custom.sh
should also contain /userdata/extra/bin/install-from-arch patch=2.7.6-10
before the patch (see custom.sh
for an example).
I updated patch-cemu-generator-for-cemuhook
to install patch
automatically if missing.
I'm using A dev version V 38. I'll get going on testing this soon. Thought I'd go ahead and respond since I have a second.
Thanks so much for all the help!
On Tue, Aug 29, 2023, 11:02 PM Christian @.***> wrote:
What is your batocera version?
— Reply to this email directly, view it on GitHub https://github.com/git-developer/batocera-extra/issues/3#issuecomment-1698453528, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZCQDBYPO3OSCT4EIRJAODXX23MXANCNFSM6AAAAAAZRRW5XU . You are receiving this because you were mentioned.Message ID: @.***>
Awesome, it's working, sorry for all the trouble and thank you! Also using on Yuzu just configured thru the emulator menu
Nice to hear that!
Hello,
I tried all steps and I was able to start driver and patches but motion still not working. A new device was recognized on batocera as DS4, both I was able to control but no motion. I tried both devices and no motion!