Hi folks,
Just bought a cheap gamepad from [1] and it works fine on PICO-8 Windows, but it doesn't seem to work on Raspberry Pi PICO-8, though.
While troubleshooting I have followed these steps:
a) Following [2] I've created an sdl_controllers.txt file and included a single mapping for my gamepad, DragonRise Inc. Generic USB Joystick, obtained from the listing in [3]
b) Tested multiple PICO-8 apps [4] and [5] unsuccessfully
c) I then went through multiple troubleshooting steps in [6] and all worked just fine, i.e.:
c.1) command line 'lsusb' listed my device correctly
c.2) command line 'evtest' also responded to gamepad keystrokes and joystick usage
c.3) command line 'cat /dev/input/by-id/*-joystick' also reacted to gamepad keystrokes and joystick usage
...so, what am I missing here? Thanks for all the help!
References:
[2] https://pico-8.fandom.com/wiki/Controllers#Configuring_controllers
[3] https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt
[4] https://pico-8.fandom.com/wiki/Controllers#Testing_controllers
[5] https://www.lexaloffle.com/bbs/?tid=3714
[6] https://wiki.archlinux.org/index.php/Gamepad#USB_joysticks



If you run 'KEYCONFIG' from PICO-8, are your button presses recognized?



Nope, afraid they don't work.
I have, in the meantime, been using QJoyPad (http://qjoypad.sourceforge.net/) as a workaround, which works fine with a single gamepad, though not 2, likely some misconfiguration I couldn't yet put to work...
But that's the strangest thing: why aren't interactions recognized in PICO-8 if they work alright during the Linux device troubleshooting (my listed c.* steps on the first post)?
Cheers and thanks for replying!



The answer would be: the OS may see the gamepad, but PICO-8 (libSDL) needs to see it too.
Maybe there is a problem with the controllers file? Please copy some info about it by running the command "ls -hla ~/.lexaloffle/pico-8/sdl_controllers.txt"



Thanks for the quick reply, merwok! Here's the result I got when running that command:
psg@raspberrypi:~ $ ls -hla ~/.lexaloffle/pico-8/sdl_controllers.txt -rw-r--r-- 1 psg psg 50 May 6 2018 /home/psg/.lexaloffle/pico-8/sdl_controllers.txt |
A further peek into the file showed me it's still the default/empty configuration:
psg@raspberrypi:~ $ cat .lexaloffle/pico-8/sdl_controllers.txt // add SDL2 game controller mappings to this file |
...I misunderstood the sdl_controllers.txt configuration file was to be put under pico-8 bin directory, as per documentation in [2], not the user's... anyway, I've now overwritten the default file found under ~/.lexaloffle/pico-8/sdl_controllers.txt with what I had brought from the available listing in [3] - here's the current result:
psg@raspberrypi:~ $ cat .lexaloffle/pico-8/sdl_controllers.txt 03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux |
...this seems to be the only correct configuration, since lsusb lists the 2 DragonRise devices I have connected to RaspPI:
psg@raspberrypi:~ $ lsusb Bus 001 Device 007: ID 1bcf:0002 Sunplus Innovation Technology Inc. Bus 001 Device 006: ID 0079:181c DragonRise Inc. Bus 001 Device 005: ID 1a2c:4094 China Resource Semico Co., Ltd Bus 001 Device 004: ID 0079:181c DragonRise Inc. Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub |
Also, I reran evtest [7] for each of the gamepads and they do seem to work fine (i.e. each keystroke/joystick interaction corresponds fine)... after I restarted PICO-8 with the new configuration however, it is still not working :( any idea what to look into, next?
References:
[2] https://pico-8.fandom.com/wiki/Controllers#Configuring_controllers
[3] https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt



@psgg1981 Are you still having this issue? It looks like your GUID is incorrect and so SDL is looking in the wrong place for the gamepad. If you used a different device to generate it, the GUID might be different on each machine, particularly if they run different OSes. I just ran into this on my Raspberry Pi and came up with the solution below to get mine up and running:
https://www.lexaloffle.com/bbs/?tid=38841



Hi, I'm experiencing the same problem as described above.
I'm trying to run pico-8 0.2.2c on a RPI4 with a Xin-Mo USB Controller. As you may see below in this log.txt extract, pico-8 seems to detect the gamepad :
As you can see, pico-8 seems to detect the gamepad and no error message is shown. However, no buttons nor axes are working. KEYCONFIG does not give any feedback when pressing controls.
The thing to note is that the same usb gamepad is perfectly detected on the PC version of pico-8 (I'm using a linux 64-bit instance). By the way, with the PC version KEYCONFIG does not give any feedback either when pressing the buttons...
The only thing I can see that differentiates both versions is that RPI's one is compiled against SDL 2.0.14 whereas PC's one is compiled against SDL 2.0.8.
I've tried to execute pico_dyn with SDL 2.0.8 on the RPI but the application won't even start.
Thanks for having read my post, any help would be appreciate.
[Please log in to post a comment]