Closed Windfisch closed 10 months ago
Hi Florian,
Can you run 'ldd' on your input plugin file? Like this:
ldd ./mupen64plus-input-sdl.so
See what version of SDL2 it's linking against. On my machine (also Gentoo) the joysticks are correctly detected, and here are the version of SDL2 that I have:
libSDL2-2.0.so.0 => /usr/lib64/libSDL2-2.0.so.0 (0x00007f3036bcd000)
Richard
On 11/21/2015 10:00 AM, Florian Jung wrote:
Mupen64plus version 2.5, as compiled under Gentoo Linux does not detect my USB gamepad. Instead, it reports |Input: 0 SDL joysticks were found.|
This is a regression in version 2.5: Mupen64plus version 2.0 (input-sdl-2.0-r1), the |jstest| program and other programs can successfully detect and use the joystick.
(Actually, I additionally tried this while emerge was upgrading from mupen64plus 2.0 to 2.5. It seems like it broke the very moment when the input-sdl-2.5 plugin was installed (and thus, the 2.0-r1 version was uninstalled).
The full output is attached below:
+1 also have this problem. In my case it's a Wii classic controller that jtest-gtk detects just fine.
I can confirm that it's linked the same:
libSDL2-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (0x00007f4e4521a000)
Hi kat-co,
I have compiled and uploaded an SDL2 joystick test program for 64-bit Linux. You can use this to determine how many joystick devices are visible to SDL2, and how they are configured. You can download this program from here: http://mupen64plus.org/old-releases/SDL2JoyTest-linux64.tar.gz If you run it with no arguments, it will report the number of joysticks detected. If you run it with a single argument, a number starting from 0, it will test the operation of that joystick number.
Sure enough, it reports 0! However, this project reports everything available. I'm not very well versed in this area, but any pointers on why that project would find it, but your test program will not?
Thanks very much for not only the response but the test binary.
I should also mention that I compiled the 2.0 tag and unlike the original reporter, this didn't seem to improve the situation -- likely because SDL isn't finding the joysticks in the first place.
So it's probably some kind of SDL problem. On that same old-releases page of our mupen64plus.org site, there is an SDLJoyTest archive which links against SDL1.2 instead of SDL2.. It's possible that the problem is with SDL2, and your joysticks may work with the older SDL1.2. You can test with the other SDLJoyTest program. If it does work, you can compile Mupen64Plus (either 2.0 or 2.5) to build against SDL1.2 instead of SDL2. To do this, each module should be compiled with:
make all SDL_CONFIG=sdl-config
Also note that all of the modules must be compiled against the same version of SDL, or else it will definitely not work right.
Hello @richard42 . I'm running into this problem using a ShenZhen ShanWan Technology Co., Ltd. ZD-V+ Wired Gaming Controller
. The controller is detected by jstest-gtk
, but not by mupen64plus, nor by the test program you linked. I tried looking for the SDLTester program you referenced that is compiled against SDL1.2 but I can only see a windows version of SDLJoyTest-1.2.14-win32.zip
:
█[asrock][src][0]$ ldd /usr/lib/x86_64-linux-gnu/mupen64plus/mupen64plus-input-sdl.so | grep -i sdl
libSDL2-2.0.so.0 => /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (0x00007f8330efd000)
█[asrock][src][0]$
SDL2JoyTest says there are 0 joysticks:
█[asrock][src][130]$ ./SDL2JoyTest
There are 0 joysticks attached
█[asrock][src][0]$
But jstest detects it:
█[asrock][src][0]$ jstest /dev/input/js0 | head -c500
Driver version is 2.1.0.
Joystick (SWITCH CO.,LTD. Controller (Dinput)) has 6 axes (X, Y, Z, Rz, Hat0X, Hat0Y)
and 13 buttons (BtnA, BtnB, BtnC, BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, BtnStart, BtnMode).
Testing ... (interrupt to exit)
Axes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:off 7:off 8:off 9:off 10:ofAxes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 Buttons: ^C
█[asrock][src][0]$
Yeah SDL 1.2 is really dead by now, so I don't think that's going to help you.
The core problem for you is that SDL2 doesn't recognize or support your joystick. There's nothing that mupen64plus can do to fix that, because it only uses SDL for joystick interfacing. Once you solve the problem with SDL2 then mupen64plus will be able to see and use your joystick.
Here is a stack overflow article which talks about this issue; I'm sure you can search and find others as well:
https://stackoverflow.com/questions/61603693/sdl2-does-not-see-joystick-but-os-does
It suggests checking the permissions on the /dev/input/event* files, and there is also a comment about running "strace -e" on the program to dump all the system calls to help diagnose. I think this could definitely point you to the source of the problem, though there will be lots and lots of logging information to dig through and that could be a bit of a job.
I ran mupen64plus with sudo and the joystick was detected successfully:
sudo $(which mupen64plus) ~/Downloads/n64/Legend\ of\ Zelda,\ The\ -\ Ocarina\ of\ Time\ \(USA\)\ \(Rev\ 2\).z64
So it was indeed a permissions issue, thanks for the pointer.
I do think that something is broken somewhere: why should debian-packaged jstest-gtk
work with the joystick out-of-the-box but debian-packaged SDL/mupen64plus fail? I believe the answer is that jstest
uses /dev/input/js*
directly, which on my system has more open permissions than the /dev/input/event*
files that SDL tries to read.
One possible workaround is to grant the mupen64plus
executable input
group permissions:
sudo chgrp input $(which mupen64plus)
sudo chmod g+s $(which mupen64plus)
However, I don't really like the idea of granting any executable keylogger-level, password-sniffing permissions. Perhaps a better approach would be to package and install the appropriate udev rules to automatically grant more open permissions to joysticks only.
Mupen64plus version 2.5, as compiled under Gentoo Linux does not detect my USB gamepad. Instead, it reports
Input: 0 SDL joysticks were found.
This is a regression in version 2.5: Mupen64plus version 2.0 (input-sdl-2.0-r1), the
jstest
program and other programs can successfully detect and use the joystick.(Actually, I additionally tried this while emerge was upgrading from mupen64plus 2.0 to 2.5. It seems like it broke the very moment when the input-sdl-2.5 plugin was installed (and thus, the 2.0-r1 version was uninstalled).
The full output is attached below: