Batocera.linux - Wiki

Only Cores That Matter

User Tools

Site Tools


diagnose_joysticks_issues

Input problems

ROMs took time to load

This is caused by the X-Input settings due XBOX ONE and some 8bitdo Pads. It took 30-45s to load a ROM, this is independent from core. To fix this 8bitdo should be setted to Android Mode. You can read more about here.

Bluetooth Connection

This is a phenomen causes with some issues and like input lags (especially if you connect more than one BT controller)

  1. Try reducing distance from your controller to Raspberry (helps sometimes)
  2. Try to disable internal WiFi - this helps to extent signal strength, you can use rfkill wifi to disable/enable Wifi (several users report PS3 controller connections problems are vanished since)
  3. Try forcing a lower baud rate in /etc/init.d/S31emulationstation or /etc/init.d/S32bluetooth. Smaller values of 115200 or 230400 have been known to alleviate input lag on a Pi 3B.
  4. Buy a new BT adapter and put it to your Raspberry. Add dtoverlay=pi3-disable-bt in /boot/config.txt to disable internal BT module (ultima ratio, speeds up communication, extents range and speed depending on your BT adapter model)

Diagnose Joysticks Issues

Physical joystick ←→ linux driver ←→ linux events stack ←A→ SDL2 library ←B→ EmulationStation

From your joystick to the batocera interface (EmulationStation), there are several technical steps. In case of issues, there are 2 mains tools, evtest and sdl2-jstest

evtest acts on point A to analyse linux events while sdl2-jstest acts on point B to analyse events going to EmulationStation.

evtests

events in the linux kernel are the way to handle mouses, keyboards, joysticks, etc… sdl2 is a library to help to code program compatible with linux, windows, mac os x, … it converts linux events to a common way to define events. On linux, events are define in /usr/include/linux/input-event-codes.h. For example, the button “yellow” if your joystick has one is :

#define KEY_YELLOW		0x190 (1*16*16 + 9*16 + 0 = 400)

On Windows, possibly that this button is not defined, or at least, for sure, with an other value, while on Linux, the value is arbitrary. Thus, SDL doesn't use the code. Instead, SDL uses button numbers, thus, this button may be “BUTTON 1”.

Let's see an example :

  1. Connect via ssh to batocera
  2. run evtest to check that linux sees your joysticks :

In my case, i've only 1 joystick plugged, it displays :

# evtest 
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:	Bigben Interactive Bigben Game Pad
Select the device event number [0-0]: 

Press 0 to see linux events on this joystick. In my case, when i press one button (button BTN_C), it displays :

Event: time 1492442283.255053, type 1 (EV_KEY), code 306 (BTN_C), value 1
Event: time 1492442283.255053, type 1 (EV_KEY), code 306 (BTN_C), value 0

value 1 is when the button is pressed. value 0 is when the buton is released.

Some general information, like the list of buttons available are provided by :

evtest --info /dev/input/event0
udevadm info -q all -n /dev/input/event0

sdl2-jstest

  1. run sdl2-jstest –list to check what emulationstation sees when you press buttons

In my case, it displays :

# export DISPLAY=:0.0
# sdl2-jstest --list
Found 1 joystick(s)

Joystick Name:     'Bigben Interactive Bigben Game Pad'
Joystick Path:     '/dev/input/event0'
Joystick GUID:     030000006b1400000209000011010000
Joystick Number:    0
Number of Axes:     4
Number of Buttons: 13
Number of Hats:     1
...
Button code  0:   304
Button code  1:   305
Button code  2:   306
...

To see the events, run sdl2-jstest -e 0 (0 is the joystick number) When I press C, it displays :

...
SDL_JOYBUTTONDOWN: joystick: 0 button: 2 state: 1 code:306
SDL_JOYBUTTONUP: joystick: 0 button: 2 state: 0 code:306
...
diagnose_joysticks_issues.txt · Last modified: 2020/06/14 21:58 by lala