Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dualsense 5 only partially working (pre-release v2024.1218.135629) #3468

Open
2 tasks done
micoro opened this issue Dec 20, 2024 · 10 comments
Open
2 tasks done

Dualsense 5 only partially working (pre-release v2024.1218.135629) #3468

micoro opened this issue Dec 20, 2024 · 10 comments

Comments

@micoro
Copy link

micoro commented Dec 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

Without STEAM (steam was closed and not running in background)
With dualsense5 plugged in the client (and recognized by sunshine in the logs).
option 1) go to: https://hardwaretester.com/gamepad. The vendor and the product written are correct, but the button pressed on the gamepad do not correspond to those received by the tester. For example: the triggers are recognized as x axis and y axis of the right stick.
option 2) go to the settings of KDE, gamepad section. There you can see the input pressed on the pad. There is not a visual help in this case, but the behavior is different then when the controller is directly plugged into the "server".
In summary: if I open heroic or a game the gamepad does not behave as expected.

Inside STEAM
In steam: if i open steam and go to the controller section, the gamepad is correctly recognized. If I use the tester inside steam the input are correctly recognized (even the gyro when trying the calibration). If I play a game in steam the gamepad works as inteded.

If i use the desktop override offered by steam in the background the issues outside of steam continue to be present.

Final result: steam recognize the gamepad correctly, but KDE and other apps don't.

Expected Behavior

The correct inputs should be recognized in KDE too, not just steam.

Additional Context

Tested from two different clients: moonlight on my laptop and moonlight on my LG TV.

I don't know if this is problem of ManjaroKDE or sunshine. In theory manjaro kde is perfectly able to recognize the ds5 (it is recognized when direclty plugged in).
My guess is that the approach used to pass the inputs from client to server is not digested by KDE.

Host Operating System

Linux

Operating System Version

Manjaro - KDE v6.2.4 - Kernel v6.6.65

Architecture

amd64/x86_64

Sunshine commit or version

v2024.1218.135629

Package

Linux - AUR (Third Party)

GPU Type

NVIDIA

GPU Model

3070Ti

GPU Driver/Mesa Version

550.135

Capture Method

NvFBC (Linux)

Config

encoder = nvenc
gamepad = ds5
audio_sink = sink-sunshine-stereo
capture = nvfbc

Apps

Relevant log output

[2024-12-20 14:07:02.210]: Info: Gamepad 0 will be DualSense 5 controller (manual selection)
@ReenigneArcher
Copy link
Member

@ABeltramo

@ReenigneArcher
Copy link
Member

To clarify which AUR package are you using?

Do you have the same issue if you use https://github.com/LizardByte/pacman-repo (beta)?

@micoro
Copy link
Author

micoro commented Dec 20, 2024

I was using this one: https://aur.archlinux.org/packages/sunshine-beta-bin.

I didn't know about the official one. Now I have installed the one you linked (and uninstalled the previous one).

The problem persist with this package too.

Btw since I have opened the online tester again I have gathered some additional info: most of the buttons are correctly recognized. Those that behave incorrectly are:

Triggers (L2/R2) - Right Stick.: these two are inverted: the triggers are recognized as the X and Y axis for the Right Stick and the Right Stick X and Y movement are recognized as L2/R2. To be more precise: L2 <--> Xaxis and R2<-->Yaxis.

XOTriangleSquare: these are rotated by one position. Example: if I press Square it is recognized as X.

Can't say anything about the buttons: L3, R3 and playstation logo. The keypress signal is there but I don't know if they are correctly recognized (no visual feedback).

Mousepad and microphone have no feedback at all in the tester on the tester but the mousepad is working without problems in the OS.

@micoro
Copy link
Author

micoro commented Dec 20, 2024

Sorry for the multiple posts.

I am doing some other tests and I have found this site: https://ds.daidr.me/ (it has a git here: https://github.com/daidr/dualsense-tester)
This site recognize the all inputs correctly.

Currently we have:
FAIL: KDE and gamepad tester
OK: steam and https://ds.daidr.me/

@ABeltramo
Copy link
Collaborator

ABeltramo commented Dec 20, 2024

Thanks for all the info, I'm afraid I'll need some more 😅

To give you a bit more context, the Desktop environment (KDE) doesn't deal with joypads because compositors in Linux (X11/Wayland) don't recognise them. So, what every app/game does is to access the gamepads as USB devices directly via /dev/input and/or /dev/hidraw.

There are a few high-level libraries to do that, and the most common is SDL, which is used by Steam, Moonlight, and Proton for example. Steam famously packages its own libraries instead of using the system provided ones, so it makes sense that you see different results compared to other apps like the web browser. To make things more complicated, some apps access a lower-level API when dealing with DualSense in order to properly support gyro, acceleration, and force feedback (which is why gamepad tester behave differently than the other website which uses hid)

To try and narrow this down a little it would be very helpful if you could provide the followings:

  • exact SDL version installed in your system
  • if you could compile this little tool https://github.com/games-on-whales/sdl-jstest and report exactly what works and what doesn't that would be extremely helpful. I should probably improve the readme, feel free to ask if you get stuck.
    Once it's compiled you should be able to run it with:
sdl2-jstest --gamecontroller 0

You should get an output like the following:
Image

@micoro
Copy link
Author

micoro commented Dec 20, 2024

I have solved some of the issues, and those were my fault.

gamepad tester: working
I made a lot of tests all afternoon and in the end I tried to install sunshine on my laptop (which also runs KDE but is rarely used so is a lot less bloated of packages).
And I saw that everything was working with sunshine on the laptop. So I started to remove every package with any reference to controllers/gamepad/udev/etc... that was not also present on my laptop.

Now gamepad tester recognize all the inputs.

KDE: still strange behavior
KDE still shows strange outputs but maybe they are correct (they are harder to interpret)
When connecting ds5 directly to PC the device is: /dev/hidraw
The number of buttons is 17 (there are 17 buttons on the ds5), the axes value represent the sticks axes and the triggers.
When connecting through sunshine as you can see below the device is /dev/input/event.
This is probably normal since the signals are passed in a different way, but the number of buttons is 13 and the axis behavior does not make any sense.

This behavior is reproduced also when sunshine is running on my laptop.
Image

testing on games
I was able to test the controller on two non-steam games. Horizon forbidden west and final fantasy 7 remake. In both the ds5 works when directly connected to the PC and does not work when connected through sunshine.

sdl2-jstest
@ABeltramo thank you for the explanation (and thank you for the controller commits).
I did install the tool and everything is correctly recognized, either when directly connected to the PC/server or through sunshine.
As for the version that I am using of sdl:

local/lib32-sdl12-compat 1.2.68-2
local/lib32-sdl2 2.30.10-1
local/sdl12-compat 1.2.68-2
local/sdl2 2.30.10-1

@ABeltramo
Copy link
Collaborator

Thanks for the detailed report!

If sdl2-jstest works correctly that means that your system SDL is correctly handling everything, we can exclude a whole lot of issues this way.
I wouldn't mind too much the KDE joypad tester, I'm more curious about those non-Steam games; how are you running them? When you say they don't work do you mean that nothing works or just some buttons/features?

The only other thing I could think of is that there are some things that we don't support like the microphone (Moonlight doesn't support it) and Haptic Feedback (I've never bothered implementing it since so few titles supports it). I think both those games should have full DualSense support, so I wonder if the game fails to pick up the pad because we miss something specific that they require from a (virtual) PS5 joypad..

Do you have any other non-Steam and non ex PS exclusive game to test? 😅

@ABeltramo
Copy link
Collaborator

Also,

When connecting ds5 directly to PC the device is: /dev/hidraw
When connecting through sunshine as you can see below the device is /dev/input/event.

can you check permissions on the created/dev/hidraw when using Sunshine?
Our virtual devices should also make an entry down there just like the real PS pad, but, depending on the udev rules, that might be mounted as root (or as a different group) and, if your user is not able to open that device then you might experience these issues..

@micoro
Copy link
Author

micoro commented Dec 21, 2024

/dev/hidraw
if I connect the pad directly hidraw7 is created with owned by root group with permission
crw-rw----+ 1 root 240, 7 Dec 21 09:42 hidraw7
plus my own user is assigned rw permissions.
If I connect the pad through sunshine the hidraw created has exactly the same permissions.
Note: /dev/input/event28 has a different owner: the input group. No specific permission for my user.

Horizon Forbidden West: In general nothing happens like if no input is received at all by the game, but if I smash all the buttons randomly sometimes something happens, but it does not seems to be linked to specific buttons.
FF7 remake: when opening the main menu I received an alert, something like: unknown Dinput detected, and then the control page opens and I have to manually assign each gamepad input to the game action (attack, select, move etc...). Still it didn't seem to work.

I checked a lot of game on my library yesterday, unluckly my non-steam game catalogue has few games that are made with a gamepad in mind. Also those that have a gamepad in mind tends to be old and may not have support for ds5. Those were the two I found that had working support when directly connected. Witcher 2 recognized the input as an Xbox controller but I didn't test it throught sunshine.

I will be out for the holidays, but if you think it is worth it I can do some more tests on my return.

@ABeltramo
Copy link
Collaborator

Note: /dev/input/event28 has a different owner: the input group. No specific permission for my user.

That is tied to Sunshine's installed udev rules, what permissions do you have for the joypad when plugged in the host? Are you part of the input group?

As for the two games, could you share a bit more info on how are you installing and running them? Is it via Heroic/Lutris? Which Proton version are you using?

I will be out for the holidays, but if you think it is worth it I can do some more tests on my return.

No worries, enjoy your holidays!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants