Log In  

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:

[1] https://www.lazada.sg/products/ministar-24ghz-wireless-dual-joystick-control-game-controller-gamepad-for-ps3-pc-tv-box-i661884890.html

[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

P#76686 2020-05-16 06:51

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

P#77093 2020-05-23 23:32 ( Edited 2020-05-23 23:32)

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!

P#77099 2020-05-24 02:18

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"

P#77104 2020-05-24 04:16 ( Edited 2020-05-24 04:18)

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

[7] https://packages.debian.org/stable/evtest

P#77116 2020-05-24 07:59
1

@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

P#79402 2020-07-16 04:59 ( Edited 2020-07-16 05:09)

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 :

[000000] codo_init
[000000]   platform: Linux
[000004]   Found config.txt
[000004]   
[000005]     01 window_size 0 0 // window width, height
[000005]     02 screen_size 0 0 // screen width, height (stretched to window) 
[000005]     03 show_fps 0 // Draw frames per second in the corner
[000005]     04 windowed 0 // 1 to start up in windowed mode
[000005]     05 window_position -1 -1 // x and y position of window (-1, -1 to let the window manager decide)
[000005]     new window position: -1, -1
[000006]     06 frameless 0 // 1 to use a window with no frame
[000006]     07 fullscreen_method 1 // 0 maximized window (linux)  1 borderless desktop-sized window  2 fullscreen
[000006]     08 foreground_sleep_ms 1 // number of milliseconds to sleep each frame. Try 10 to conserve battery power
[000006]     09 background_sleep_ms 10 // number of milliseconds to sleep each frame when running in the background
[000006]     10 sessions 2 // number of times program has been run
[000006]     11 rmb_key 0 // 0 for none  226 for LALT
[000006]     12 desktop_path 
[000006]     13 sound_volume 256 // 0..256
[000006]     14 music_volume 256 // 0..256
[000006]     15 mix_buffer_size 1024
[000006]     16 version 0.2.2c
[000006]     17 volume 256
[000006]     18 root_path /home/pi/.lexaloffle/pico-8/carts/
[000006]     19 cdata_path /home/pi/.lexaloffle/pico-8/cdata/
[000006]     20 joystick_index 0
[000006]     21 button_keys 0 0 0 0 0 0 0 0 0 0 0 0 0 
[000006]     22 live_notes 0
[000006]     23 cursor_snap 0
[000006]     24 gui_theme 0
[000006]     25 screenshot_scale 3
[000006]     26 gif_scale 3
[000006]     27 gif_len 8
[000006]     28 gif_reset_mode 0
[000006]     29 host_framerate_control 1
[000006]     30 splore_filter 0
[000006]     31 tab_width 1
[000006]     32 draw_tabs 0
[000006]     33 record_activity_log 1
[000006]     34 allow_function_keys 1
[000006]     35 check_for_cart_updates 1
[000006]     36 enable_gpio 1
[000006]   
[000006]   codo_system_init
[002412]   Compiled against SDL version: 2.0.14
[002412]   Linked against SDL version:   2.0.14
[002412]   Current video driver: x11
[002413]   codo_reset_timer
[002413]   codo_gui_init
[002413]   codo_keys_init
[002413]   codo_text_init
[002415]   codo_video_init
[002416]   codo_mouse_init
[002416]   codo_joystick_init
[002424]   Reading controller mappings: /home/pi/.lexaloffle/pico-8/sdl_controllers.txt
[002425]    updated controller mapping: 03000000c0160000e105000001010000,Xin-Mo Xin-Mo Controller,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,
[002425]   searching for joysticks
[002425]     found 1 joysticks
[002426]     connecting joystick 0
[002426]     Controller 0: Xin-Mo Xin-Mo Controller
[002426]      Number of Axes: 4
[002426]      Number of Buttons: 12
[002426]      Number of Balls: 0
[002426]      Mapping: 03000000c0160000e105000001010000,Xin-Mo Xin-Mo Controller,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,
[002426]   ok
[002429] ok
[002907] codo_load_pod: /home/pi/workspace/pico-8/pico8.dat ok 
[002927] codo_set_screen 128 128 8 100
[002927]  window size: 640 540
[002927]  codo_set_screen_software() window size: 640 540
[002927] setting fullscreen window size to 1680 1050
[002932]  desktop size: 1680 1050
[002932] ok
[002952] codo_sound_init mix_buffer_size: 1024
[002952] codo_sound_init
[002952] SDL_INIT_AUDIO ok
[002963] SDL_OpenAudio ok
[002963]  freq:22050
 channels:1
[002963] Built-in audio drivers: 0 pulseaudio 1 alsa 2 dsp 3 nas 4 disk 5 dummy
[002963] Current audio driver: alsa
[002963] splore_init
[002963] could not load favourites file: /home/pi/.lexaloffle/pico-8/favourites.txt
[002989] connecting joystick 0
[002989] Controller 0: Xin-Mo Xin-Mo Controller
[002989]  Number of Axes: 4
[002989]  Number of Buttons: 12
[002989]  Number of Balls: 0
[002989]  Mapping: 03000000c0160000e105000001010000,Xin-Mo Xin-Mo Controller,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,
[004697] loading /home/pi/just-one-boss.p8
[006390] run_cart current_filename: /home/pi/test.p8 running_filename: /home/pi/test.p8 running_cart_lid: 
[010959] codo_exit
[010959]   cmusic_stop
[010959]   codo_main_exit
[010971]   codo_config_save
[010972]   codo_sound_exit
[010972]   codo_video_exit
[010994]   codo_joystick_exit
[010994]   codo_system_exit
[010999]   codo_items_created: 1046
[010999] ok

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.

P#96184 2021-08-18 15:20

[Please log in to post a comment]