Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert Environment variables correctly? #19

Closed
MrMEEE opened this issue Feb 21, 2022 · 9 comments
Closed

Insert Environment variables correctly? #19

MrMEEE opened this issue Feb 21, 2022 · 9 comments

Comments

@MrMEEE
Copy link

MrMEEE commented Feb 21, 2022

I have earlier created issue #4 ...

I seems like there is now a fix available:
libsdl-org/SDL@02a6ff0
libsdl-org/SDL@1c78b08

I need to set the environment variable: SDL_LINUX_JOYSTICK_CLASSIC=1

Where do I set that in GrooveArcade, so that everything will read this variable?

@substring
Copy link
Owner

Edit /home/arcade/.bash_profile so it looks like;

#!/bin/bash
SDL_LINUX_JOYSTICK_CLASSIC=1
if [[ $(tty) == /dev/tty1 ]] ; then
    sudo setterm -powerdown 0 -powersave off -blank 0
    /opt/galauncher/startfe.sh
    sudo gasetup
fi

(just one line to add)
This doesn't fix your issue, it just uses a different joystick driver

@MrMEEE
Copy link
Author

MrMEEE commented Feb 22, 2022 via email

@substring
Copy link
Owner

The email reply was totally messed up ...

If it fixes your issue, fine.

@MrMEEE
Copy link
Author

MrMEEE commented Feb 22, 2022

Well.. It did something..

Seems like it has stabilized the names of the joysticks..

One weird thing, though.. they are now mapped in this way:

Real Joy1 -> Attracts Joy0
Real Joy2 -> Attracts Joy1
Real Joy3 -> Attracts Joy2
Real Joy0 -> Attracts Joy3

The /dev/input/js* are still mapped correctly..

Do you have any reason why these joysticks are remapped inside attract? (maybe it counts from 1?)

@MrMEEE
Copy link
Author

MrMEEE commented Feb 25, 2022

Hmmm.. seems like it was random...

an "export" needs to be added infront of the environment variables to make it active in .bash_profile...

Now, using "export SDL_LINUX_JOYSTICK_CLASSIC=1" just disables to joysticks..

Using the gamepad-tool utility, I have figured out that I get the correct mapping if I use: "export SDL_JOYSTICK_DISABLE_UDEV=1".. but if I add that to .bash_profile, the joysticks are also disabled??

Any clues?

@substring
Copy link
Owner

have you tried forcing the devices order ? see libsdl-org/SDL#4430 (comment). I can see you've been posting on the SDL repo for your problem. All in all it sounds related to udev. But the joystick API is supposed to be deprecated is is still here for retro compatibility purpose ...

@MrMEEE
Copy link
Author

MrMEEE commented Mar 2, 2022

libsdl-org/SDL#4688 gives me a fix for MAME.. but not for Attract Mode, as that is written in SFML and not SDL...

SFML/SFML#2033

@substring
Copy link
Owner

substring commented Mar 2, 2022

Remap all joysticks in AM

And once again, forget about /dev/input/js*. This is not used by udev, nor SFML nor SDL unless you disable UDEV (which is not recommended). I don't know how udev sorts joysticks (on their /dev/input/eventXX or on some hardware device path), but as this problem is common to both SFML and SDL2, it's because they use UDEV and may not apply some sorting functions.

@substring
Copy link
Owner

Original problem answered, the rest is specific to some libs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants