Sony DualShock 3 - call for testers: "sixaxis" script module
-
@psyke83 Yup that was me with the dualshock3's!
I'm trying out your latest updates to the PR now,
I just tested controllers and 7 is the limit, which is the same as an actual PS3. Sounds like that is just the bluetooth limit in general :(
I really only need 6 for xmen arcade 6player, but I had dreams of 10 player Saturn Bomberman over Steam Link lol
As far as I know Steam Link has its own limit of 4 controllers anyway.I tried connecting more dualshock3's in wired mode but it won't go past the 7 limit - may still technically count as bluetooth?
I would think the same thing would happen with PS4 controllers as well.Do you have a recommended method to turn off the controller timeouts? I just edited one of the files last time.
-
Very neat updates! I think at this point I can safely restore my SD card to pre-sixaxis state and try again from a clean state, without grabbing
custombluez
andcustomhidsony
.Again - is it going to be possible to create a gamecontrollerdb entry with pressure sensitive triggers? It'd benefit Steam Link and Moonlight streaming greatly.
-
@Silent said in Sony DualShock 3 - call for testers: "sixaxis" script module:
Very neat updates! I think at this point I can safely restore my SD card to pre-sixaxis state and try again from a clean state, without grabbing
custombluez
andcustomhidsony
.Again - is it going to be possible to create a gamecontrollerdb entry with pressure sensitive triggers? It'd benefit Steam Link and Moonlight streaming greatly.
Have you tried it yourself?
I compiled
controllertest
from: https://github.com/RetroPie/SDL-mirrorFor my official pad, the initial information presented is:
INFO: There are 1 joysticks attached INFO: Joystick 0: Sony PLAYSTATION(R)3 Controller INFO: axes: 6 INFO: balls: 0 INFO: hats: 0 INFO: buttons: 17 INFO: instance id: 0 INFO: guid: 050000004c0500006802000000810000 INFO: VID/PID: 0x054c/0x0268 INFO: Watching joystick 0: (Sony PLAYSTATION(R)3 Controller) INFO: Joystick has 6 axes, 0 hats, 0 balls, and 17 buttons INFO:
I proceeded to configure the controller according to the onscreen prompts. This is the result:
INFO: Mapping: 050000004c0500006802000000810000,Sony PLAYSTATION(R)3 Controller,platform:Linux,a:b0,b:b1,x:b3,y:b2,back:b8,guide:b10,start:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpdown:b14,dpleft:b15,dpright:b16,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,
For comparison, here's the GUID that's already compiled into our version of SDL2:
$ git grep 050000004c0500006802000000810000 src/joystick/SDL_gamecontrollerdb.h: "050000004c0500006802000000810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,",
It seems that both mappings already define the trigger buttons according to axes (
lefttrigger:a2
andrighttrigger:a5
) instead of the digital buttons. So if I understand this correctly, the mapping should already be correct? -
@edge3000 said in Sony DualShock 3 - call for testers: "sixaxis" script module:
@psyke83 Yup that was me with the dualshock3's!
I'm trying out your latest updates to the PR now,
I just tested controllers and 7 is the limit, which is the same as an actual PS3. Sounds like that is just the bluetooth limit in general :(
I really only need 6 for xmen arcade 6player, but I had dreams of 10 player Saturn Bomberman over Steam Link lol
As far as I know Steam Link has its own limit of 4 controllers anyway.I tried connecting more dualshock3's in wired mode but it won't go past the 7 limit - may still technically count as bluetooth?
I would think the same thing would happen with PS4 controllers as well.Do you have a recommended method to turn off the controller timeouts? I just edited one of the files last time.
The Bluetooth spec seems to impose that limit, yes... though I'm not sure why that would impact USB-connected devices.
As for the timeout, maybe just edit the script for now... sorry. I overlooked the issue that systemd doesn't import environment variables from traditional locations by default (such as /etc/environment). Perhaps in future I'll change the script to source the timeout value from a user-editable file, but it's a low priority :)
I'm curious why you turn off the timeouts? My controllers tend to drain battery quite quickly when I leave them paired. I suppose it depends on whether you tend to leave your Pi on for long periods or not...
-
If I'm playing 4 or 5 player games with friends, it can be a pain if the controllers turn off after a short period of time. One issue we used to have with ps3controller driver was if say 3 out of 4 players were playing a game - and 1 player was just sitting out. Their controller would turn off, and if they turned it back on the player numbers would get reordered on the Pi, but the lights on the controllers wouldn't match the actual player number. With that driver you also had to be very slow when reconnecting controllers, and only do it one at a time or it would get messed up.
If we stop playing for a long time I just shut down the Pi and they all turn off at once.
-
Take a look at the discussion regarding trigger axes here: https://github.com/libretro/RetroArch/issues/6920
The
hid-sony
driver has an unusual axis configuration for triggers, where the resting value is -32767, intermediate press is 0 and full press is 32767. So essentially the trigger spans the negative to positive of the axis, whereas most software expects a trigger to rest at zero and span along one pole only.Explicitly setting the axes to the positive pole in your gamecontrollerdb.txt may partially work around this problem (i.e. allowing pressure sensitivity between intermediate and full pressure), but I haven't tested. It seems that libretro has a hack in place to solve this (see this discussion above), and we've also applied a similar patch to EmulationStation's master branch so that controller mapping doesn't report both axes.
Not sure what's the best course of action here. Perhaps we could try patching the driver rather than relying on individual hacks.
-
@psyke83 FYI I have only verified it with pre-changes sixaxis driver, that is with
custombluez
andcustomhidsony
. While this is not (and will never be, I think) an issue in libretro emulators, in Moonlight Game Streaming it's really obvious - any racing game displaying inputs indeed shows that throttle is either 0 or 100.I'll try messing with gamecontrollerdb.txt there, just need to figure out where it is in the first place.
-
@Silent How do you find Moonlight other than this control issue? I use the physical Steam Link at the moment but some games like Pinball FX3 have too much input lag to play through it. I actually finished Dragon Quest 11 through it (wired) and it ran well except every once in awhile you might get a freeze of a couple seconds and then it returns to normal.
I heard Moonlight might be better so I plan to give it a try. I have a GTX-1060 6GB
-
@edge3000 Do try! For the most part it's really great, possibly better than Steam Link. Plus, thanks to this not-yet merged scriptmodule it integrates with EmulationStation as an "emulator":
https://retropie.org.uk/forum/topic/19872/moonlight-request-for-comments-and-testing/
-
@Silent said in Sony DualShock 3 - call for testers: "sixaxis" script module:
@psyke83 FYI I have only verified it with pre-changes sixaxis driver, that is with
custombluez
andcustomhidsony
. While this is not (and will never be, I think) an issue in libretro emulators, in Moonlight Game Streaming it's really obvious - any racing game displaying inputs indeed shows that throttle is either 0 or 100.I'll try messing with gamecontrollerdb.txt there, just need to figure out where it is in the first place.
Unfortunately I don't own a NVIDIA GPU, but I may have some racing games in my Steam library. Can you confirm that the same issues happens with triggers in the steamlink app? I'm also not certain which racing games I own would definitely show this (as I've never really played any in my backlog).
-
@psyke83 So I tested both Moonlight and Steam Link:
- Moonlight: Triggers register as 100% press upon the slightest press.
- Steam Link: Behaviour was same, but in Steam Link app I ran Setup Controller again and reconfigured the controller. After that, it works as expected!
Do you know where Moonlight and Steam Link keep their mappings? I want to try to sync them to see if I can get triggers to work in Moonlight too.
For both my test case was DiRT Rally - a XInput game, in which you can see % press of an axis in Controls screen, so it's a reliable method of checking.
-
@Silent said in Sony DualShock 3 - call for testers: "sixaxis" script module:
- Moonlight: Triggers register as 100% press upon the slightest press.
I might be wrong, but take a look at /etc/modprobe.d/xpad.conf
If "triggers_to_buttons" is set to 1, change the value to 0, reboot and see if it makes any difference in moonlight. -
@psyke83 said in Sony DualShock 3 - call for testers: "sixaxis" script module:
@lostless said in Sony DualShock 3 - call for testers: "sixaxis" script module:
how would one install said driver? I would like to test it.
You need to be relatively comfortable with using the command-line to test.
These commands will enable the PR branch:
cd RetroPie-Setup git remote add psyke83 https://github.com/psyke83/RetroPie-Setup git fetch psyke83 git checkout sixaxis
Make sure to go back to the official branch after testing the PR! Uninstall sixaxis from the menu, then:
cd RetroPie-Setup git checkout master
It's been confirmed that both official and Shanwan controllers are working. I need someone with a Gasia branded pad to test.
I had problems with the default Driver for Dualshock3. In my case, the problem was about the use of a 8bitdo controller with the dualshock. After the dualshock configuration, the 8bitdo is deconfigured, change the driver and it didn't work when the dualshock was on. This solution solved my problem.
-
@rodrigoleao said in Sony DualShock 3 - call for testers: "sixaxis" script module:
@psyke83 said in Sony DualShock 3 - call for testers: "sixaxis" script module:
@lostless said in Sony DualShock 3 - call for testers: "sixaxis" script module:
how would one install said driver? I would like to test it.
You need to be relatively comfortable with using the command-line to test.
These commands will enable the PR branch:
cd RetroPie-Setup git remote add psyke83 https://github.com/psyke83/RetroPie-Setup git fetch psyke83 git checkout sixaxis
Make sure to go back to the official branch after testing the PR! Uninstall sixaxis from the menu, then:
cd RetroPie-Setup git checkout master
It's been confirmed that both official and Shanwan controllers are working. I need someone with a Gasia branded pad to test.
I had problems with the default Driver for Dualshock3. In my case, the problem was about the use of a 8bitdo controller with the dualshock. After the dualshock configuration, the 8bitdo is deconfigured, change the driver and it didn't work when the dualshock was on. This solution solved my problem.
There was a problem with the RetroPie bluetooth menu script, but it was fixed in a commit separate from the PR. If you rebased the PR against latest master it would have been fixed.
-
@Silent said in Sony DualShock 3 - call for testers: "sixaxis" script module:
@psyke83 So I tested both Moonlight and Steam Link:
- Moonlight: Triggers register as 100% press upon the slightest press.
- Steam Link: Behaviour was same, but in Steam Link app I ran Setup Controller again and reconfigured the controller. After that, it works as expected!
Do you know where Moonlight and Steam Link keep their mappings? I want to try to sync them to see if I can get triggers to work in Moonlight too.
For both my test case was DiRT Rally - a XInput game, in which you can see % press of an axis in Controls screen, so it's a reliable method of checking.
See the readme here: https://github.com/gabomdq/SDL_GameControllerDB
Steam Link on Pi stores its bootstrapped binaries in
/home/pi/.local/share/SteamLink/
and configuration in/home/pi/.local/share/Valve Corporation/SteamLink/
, so the latter is a possible location to look for mappings. -
@psyke83 That was helpful, thank you! I fished out my configuration and applied it to Moonlight and it all works like a charm.
Update:
Mapping from @psyke83 didn't work for me, but this one did:
050000004c0500006802000000800000,PS3 Controller,platform:Linux,a:b0,b:b1,x:b3,y:b2,back:b8,guide:b10,start:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpdown:b14,dpleft:b15,dpright:b16,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,
(notice how GUIDs are slightly different)
With this, triggers are pressure sensitive without the need to change
triggers_to_buttons
.However, when playtesting I encountered a problem - I was streaming via Moonlight and around 10 minute mark my controller disconnected! Was it a coincidence or a bug in idle timeout script? I was using triggers, left analog stick and face buttons - so the possibility of idle script only reacting to eg. face buttons is out of question.
Also, does this driver allow reporting battery level somehow? One last issue I have with using DS3 on pi is that I am unable to tell when the battery is running low.
-
@Silent said in Sony DualShock 3 - call for testers: "sixaxis" script module:
Mapping from @psyke83 didn't work for me, but this one did:
Where did you find that particular mapping? Perhaps I can make the Moonlight scriptmodule to grab
gamecontrollerdb.txt
files from a more up-to-date source instead of the included one from Moonlight.Another (better) alternative would be if you can submit your updated controller entry to the upstream maintainer of
gamecontrollerdb.txt
here: https://github.com/gabomdq/SDL_GameControllerDB@Silent said in Sony DualShock 3 - call for testers: "sixaxis" script module:
Also, does this driver allow reporting battery level somehow? One last issue I have with using DS3 on pi is that I am unable to tell when the battery is running low.
I want to work on this in close future and already have some ideas drafted. I just need to find some good spare time to develop them. Also I have to finish the last details on the Moonlight scriptmodule :)
-
@hhromic That's the mapping I created from Steam Link app on rpi. Also, it looks like an identical mapping is already present in the database, so no need to submit anything new =)
Also, what file does this version of Moonlight read entries from? From the one in
/usr/local/
or the one in scriptmodule directory?If Moonlight is using an up to date sdl2, it would be very neat if your scriptmodule could grab mappings from this repository instead!
-
@Silent said in Sony DualShock 3 - call for testers: "sixaxis" script module:
Also, it looks like an identical mapping is already present in the database
The mapping in the database for your same GUID is not the same as the one you provided. from SteamLink. The differences are clearly stating the triggers being regarded as analog instead of buttons:
guide:b10 leftshoulder:b4 leftstick:b11 -lefttrigger:b6 +lefttrigger:a2 leftx:a0 lefty:a1 platform:Linux PS3 Controller rightshoulder:b5 rightstick:b12 -righttrigger:b7 +righttrigger:a5 rightx:a3 righty:a4 start:b9
Also, what file does this version of Moonlight read entries from?
I made the scriptmodule to use the database included with Moonlight, which gets installed in the scriptmodule directory (
/opt/retropie/supplementary/moonlight
).If Moonlight is using an up to date sdl2, it would be very neat if your scriptmodule could grab mappings from this repository instead!
Moonlight uses the system-instaled SDL2 lib when building and @irtimmer regularly keeps the database in sync with that repository. I will think about pulling directly instead.
Btw, more Moonlight-specific discussion should be made in its topic :)
-
@hhromic said in Sony DualShock 3 - call for testers: "sixaxis" script module:
@Silent said in Sony DualShock 3 - call for testers: "sixaxis" script module:
Also, it looks like an identical mapping is already present in the database
The mapping in the database for your same GUID is not the same as the one you provided. from SteamLink. The differences are clearly stating the triggers being regarded as analog instead of buttons:
guide:b10 leftshoulder:b4 leftstick:b11 -lefttrigger:b6 +lefttrigger:a2 leftx:a0 lefty:a1 platform:Linux PS3 Controller rightshoulder:b5 rightstick:b12 -righttrigger:b7 +righttrigger:a5 rightx:a3 righty:a4 start:b9
That's right... and my post was intended to encourage others to check their own GUID. I've checked @Silent's, and the version of the db that's compiled into the current version of SDL2 built by RetroPie does use the digital buttons for this controller, unfortunately. In fact, at a quick glance, there are at least 16 PS3 variations that use the digital button mappings:
$ git grep "lefttrigger:b6" | grep "righttrigger:b7" | grep "PS3" -c 16
It might be a good idea to submit a patch to upstream SDL2 for your own GUID so that future releases work out of the box. I'm a bit hesitant to send a patch for all 16+ en masse, considering that I can't tell which GUIDs are clones that may possibly have malfunctioning analog triggers, etc.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.