Sdl2 breakage changes

SDL2 Breaking Changes
As of SDL 2.0.12, SDL introduced a new HIDAPI which can read HID devices in raw mode, bypassing the drivers. Due to the way SDL works, and because xpadneo exposes hidraw devices as user-readable, SDL may see wrong button mappings because it may make wrong assumptions about the protocol mode of Xbox and compatible controllers. If you see wrong button mappings / missing buttons in SDL applications, you may need to turn off this behavior by setting an environment variable in your profile: SDL_JOYSTICK_HIDAPI=0

what profile do i alter if i get the wrong button mapping? where is this profile?

1 Like

What desktop and shell are you running?

You probably could stick that line in /etc/environment as it is a simple pair, then reboot. Test:

echo $SDL_JOYSTICK_HIDAPI

Mate

Like this?

Perhaps try to make a file called say controlpad.sh in /etc/profile.d
with these contents:

Code: [Select]

#!/bin/sh
export SDL_JOYSTICK_HIDAPI=0

Then possibly make it executable (might not be required?)

Code: [Select]

chmod a+x /etc/profile.d/controlpad.sh

That should put it in your env, after rebooting if you try:

Code: [Select]

$ env

then hopefully you will see it somewhere.

did that but it doesnt qualify as the profile i guess?

It made no difference

sudo nano /etc/environment

Example from mine:

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
#QT_QPA_PLATFORMTHEME=qt5ct
BROWSER=firefox
EDITOR=micro
GTK2_RC_FILES=$HOME/.gtkrc-2.0
SDL_JOYSTICK_HIDAPI=0

Then reboot and test:

echo $SDL_JOYSTICK_HIDAPI

or .bashrc or .zshrc doesn’t matter.

1 Like

echo $SDL_JOYSTICK_HIDAPI=0
0=0

image

Should just be 0

1 Like

inside my file is this

QT_QPA_PLATFORMTHEME=gtk2
QT_STYLE_OVERRIDE=gtk
SDL_JOYSTICK_HIDAPI=0

output is this

echo $SDL_JOYSTICK_HIDAPI=0
0=0

This is really a problem i am having only with artix linux and they keep trying to drag me down a crazy rabbit hole of solutions that are beyond my comprehension

xpadneo wouldnt answer my question about where this profile is and refuses to speak with me further.

problem is not in manjaro, or endevour or even in vanilla arch but artix only so i really didn’t want to bring my question here.

In spite of your awesome simple and direct answer. the solution didnt resolve the problem.

Weird, that should work in any distro, no idea why in doesn’t.

1 Like

Welcome to my world

Ty for your help

Hi sorry to butt in here but the echo statement is showing that you have the correct value, see below I start without the environment variable being set…

[dmin@X502-CA ~]$ echo $SDL_JOYSTICK_HIDAPI

[dmin@X502-CA ~]$ SDL_JOYSTICK_HIDAPI=0
[dmin@X502-CA ~]$ echo $SDL_JOYSTICK_HIDAPI
0
[dmin@X502-CA ~]$ echo $SDL_JOYSTICK_HIDAPI=0
0=0
1 Like

Doh, it was an insufficient caffeine error :smiley:

1 Like

Well at any rate, the solution that should have fixed the problem didnt. i have tried a number of solutions for the sdl2 breakage bug that switches x and y buttons on my controller and i am convinced that the switching on artix linux isn’t due to sdl2 because a. the solutions didnt fix the problem and b. i have the same version of sdl2 on endeavour and arch and the buttons do not get switched there… i like endeavour and arch but i’d prefer a system without systemd. But until i can remedy this nuisance bug on artix i dont expect it to be my main driver. There’s a lot to like about artix… it uses less ram my root drive is smaller and there’s no systemd. But this bug drives me nutso… One day perhaps ill figure it out

Thanks Xircon again for that solution. clearly the problem is elsewhere…