PS4 Controller not working on external menus
-
Pi Model: N/A, x86 running on Optiplex 5080 Ubuntu 18.04.6 LTS
Power Supply used: N/A
RetroPie Version Used: 4.7.19
Built From: Source
USB Devices connected: BCM20702A0 Bluetooth 4.0
Controller used: PS4 (Genuine)
Error messages received: None
Verbose log (if relevant):
Guide used: Official Docs
File: N/A
Emulator: N/A
Attachment of config files: Don't know which files to target
How to replicate the problem: Pair PS4 controller, map keys using RP menu, using PS4 controller scroll over to 'RetroPie', select RetroPie Setup, Controller is unable to control setup window, cannot scroll or make any selections. Have to use the keyboard on the setup. Also unable to change ROM settings (Press "a" during game launch).I have installed RT on an x86 MicroDesktop and running Ubuntu 18.04 LTS. Previously I was running on a Pi4 but quickly outgrew the performance on that so I switched over to something more powerful.
I got RT installed, configured some OS settings like audio, auto signing, sudoer access, etc. Then came time to add controllers.My previous PS3 controller which worked without issues on the Pi4 didn't work at all on either driver so I said screw it, unplugged my PS4 from power, and paired a PS4 controller via Bluetooth (no dsrv4, native BT). After pairing it I mapped the keys in RP and I'm able to scroll through the GUI, select and start a game, even play games and enter the retroarch in-game menu.
The issue comes in when I want to change a core right after starting a game by pressing a or make any changes in RetroPie-Setup. The PS4 controller won't control any of the "shell" based menus. Things like adding driver packages, pairing Bluetooth, exiting the show IP window, none of those work.
I feel like this may be caused by a mapping on the underlying OS but I'm not sure where to start looking.
-
@lpg said in PS4 Controller not working on external menus:
How to replicate the problem: Pair PS4 controller, map keys using RP menu, using PS4 controller scroll over to 'RetroPie', select RetroPie Setup, Controller is unable to control setup window, cannot scroll or make any selections. Have to use the keyboard on the setup. Also unable to change ROM settings (Press "a" during game launch).
Can you check if you have installed the
joy2key
package under the Core packages' section ? -
@mitu it looks like it is installed.
-
If it's installed, then try running the following command, from the terminal, after exiting EmulationStation:
python3 /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
Try pressing the buttons/d-pad/joystick on the gamepad and see if they get recognized by the
joy2key
script. If you get any errors during the script execution, then post them here. -
@mitu Just gave that command a try both on SSH and in the desktop just in case. Both time I got no output when pressing the buttons.
I did get a message that no joystick devices were found, even though the controller still works fine in games and the RP GUI.
-
@mitu What's also interesting is that I can see the PS4 controller connected and paired on the Ubuntu BT menu.
-
@lpg said in PS4 Controller not working on external menus:
@mitu What's also interesting is that I can see the PS4 controller connected and paired on the Ubuntu BT menu.
That should be normal, the PS4 controller is a regular bluetooth device.
I did get a message that no joystick devices were found, even though the controller still works fine in games and the RP GUI.
That's the issue I think, though it's weird the controller is not detected by SDL2 (via Python) when it's working in EmulationStation.
-
@mitu I had a chance to play around with this some more tonight. I paired my PS3 controller and tried running joy2key_sdl.py with the PS3 controller both wired and using BT.
Both yielded the same results or lack of results I should say. I'm digging into the joy2key docs as I'm pretty new to this to see if I can find anything that jumps out at me.
-
@lpg After doing some digging I got the controller to work as a keyboard using qjoypad. However, since both qjoypad and RetroPie now have bindings pressing one button is seen as a double press so pressing right once becomes press right twice.
I guess that's at least some progress.
-
@lpg
joy2key
functions just likeqjoypad
. I still can't figure out why it won't work with your setup, but you can use startqjoypad
just during the runcommand start screen (and stop it afterwards). See the runcommand scripting support doc page. -
@mitu That seems pretty straightforward. However, how do I get around the issue where both qjoypad and retropie detect the button press so the game thinks the button is being pressed twice?
Is it just a matter of not configuring the controller on retropie and only adding it to qjoypad?
On a side note, are there any logs I can dig through to try and figure out the original joy2key issue?
-
@mitu That seems pretty straightforward. However, how do I get around the issue where both qjoypad and retropie detect the button press so the game thinks the button is being pressed twice?
The idea was that you can start
qjoypad
just during theruncommand
launch and then stop it before the game starts from the scripts mentioned on the page I linked, soqjoypad
would not active during gameplay.Is it just a matter of not configuring the controller on retropie and only adding it to qjoypad?
That's one possibility, but I wouldn't recommend it.
On a side note, are there any logs I can dig through to try and figure out the original joy2key issue?
The command I've posted in the beginning should log something when the gamepad is detected and active (inputs pressed) or log any errors, other than that there's no other logging involved.
Since it seems there's an issue with thepysdl2
module, I'd rather try to upgrade to the latest LTS (20.04) and see if the problem still appears there. -
@mitu I'll swap the HD on my pc and try out 20.04. I didn't know RT would work on it, I was going strictly by what was on the wiki.
I'll report back any findings.
-
@lpg said in PS4 Controller not working on external menus:
I was going strictly by what was on the wiki.
The wiki says 18.04 LTS or later in order to emphasise the minimum requirement. You can use a more recent Ubuntu LTS.
-
@mitu Welp, that's totally on me. I didn't catch that. That's what I get for skimming for the main things I was looking for.
-
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.