| Both sides previous revision Previous revision | |
| diagnose_joysticks_issues [2024/08/28 11:58] – made manually configuring ES more readable atari | diagnose_joysticks_issues [2025/07/25 18:13] (current) – Precisions on evtest lbrpdx |
|---|
| ''evtest'' acts on point **A** in the above diagram, used to debug very low-level issues (like a button's state change not being registered by the controller or an incorrect amount of inputs being registered). ''sdl2-jstest'' acts on point **B** in the above diagram, used to debug high-level issues (like EmulationStation not reacting correctly when button X is pressed, certain emulator not "seeing" a controller's inputs which otherwise work fine in other programs, etc.). | ''evtest'' acts on point **A** in the above diagram, used to debug very low-level issues (like a button's state change not being registered by the controller or an incorrect amount of inputs being registered). ''sdl2-jstest'' acts on point **B** in the above diagram, used to debug high-level issues (like EmulationStation not reacting correctly when button X is pressed, certain emulator not "seeing" a controller's inputs which otherwise work fine in other programs, etc.). |
| |
| ==== evtests ==== | ==== evtest ==== |
| | |
| | The Linux kernel uses ''events'' to handle mouses, keyboards, joysticks, and other peripherals. |
| | |
| | SDL2 is a popular library used to help to code programs compatible with multiple OSs (Linux, Windows, MacOs). 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 : |
| |
| ''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) | #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". | |
| | |
| | On Windows, it is possible that this button is not defined, or at least defined with another value, while on Linux, the value is arbitrary. As a result SDL doesn't use the corresponding code but instead button numbers. For exampplem this button may be referred to as "BUTTON 1". |
| |
| Let's see an example : | Let's see an example : |
| - Connect via ssh to batocera | - Connect to Batocera through SSH |
| - run evtest to check that linux sees your joysticks : | - run ''evtest'' to check that Linux sees your controller. |
| In my case, i've only 1 joystick plugged, it displays : | |
| | |
| | In my case, with only one controller plugged, it displays: |
| |
| # evtest | # evtest |