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

Linux Wireless Joysticks not detected. #1602

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Linux Wireless Joysticks not detected. #1602

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Labels
abandoned Bug has been abandoned for various reasons

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.3
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2014-08-12 05:54:30 +0000, wrote:

Wireless controllers (Bluetooth paired) Seem to be ignored.

Tested wireless controllers with evtest and the following website:
http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad-tester/tester.html

The website works with both USB and BT paired controllers. SDL only fires controller events when controller is connected through USB.

On 2014-08-14 02:31:10 +0000, wrote:

So I decided to test against SDL1.2 using the testjoystick included in both SDL2 and SDL1.2 test.
For my test I used a bluetooth paired DS4 (Playstation 4) Controller.

SDL-1.2.15/test$ ./testjoystick
There are 1 joysticks attached
Joystick 0: Wireless Controller
axes: 8
balls: 0
hats: 0
buttons:14

SDL2-2.0.3/test$ ./testjoystick
INFO: There are 0 joysticks attached

On 2014-08-17 06:31:52 +0000, Sam Lantinga wrote:

Ryan, can you look at this for the 2.0.4 release?

Thanks!

On 2014-10-16 12:11:44 +0000, Gabriel Jacobo wrote:

Can you paste the output of: udevadm info --query=all /dev/input/eventXX

where eventXX is the event device you get when running evtest with the joystick connected via BT (if you want, throw in the USB connected information too).

Which Linux distro?

On 2015-01-17 01:59:25 +0000, Mike Kasprzak wrote:

Ah, this sounds like a bug I was about to report.

I had been going through my exotic collection of gamepads and adapters, creating controller mappings, and discovered that my Bluetooth Android compatible ones are not working with SDL2. To be fair, some are being reported as Keyboards, but the ones that that are reported as Joypads aren't visible to SDL on Linux. qjoypad sees them just fine.

Here's a snapshot of what Gabriel asked for. I'm on Ubuntu 14.10 (so yes, that means Bluez is too old to pair with a PS4 controllers w/o ds4drv).

Here's a NES30: http://www.nes30.com/

P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/bluetooth/hci0/hci0:11/0005:0000:0000.0005/input/input21/event16
N: input/event16
E: DEVNAME=/dev/input/event16
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/bluetooth/hci0/hci0:11/0005:0000:0000.0005/input/input21/event16
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_INPUT_MOUSE=1
E: MAJOR=13
E: MINOR=80
E: SUBSYSTEM=input
E: USEC_INITIALIZED=2625923476
E: XKBLAYOUT=us
E: XKBMODEL=pc105
E: XKBVARIANT=dvorak

Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x0 product 0x0 version 0x0
Input device name: "8Bitdo NES30 GamePad"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 1 (KEY_ESC)
Event code 2 (KEY_1)
Event code 3 (KEY_2)
Event code 4 (KEY_3)
Event code 5 (KEY_4)
Event code 6 (KEY_5)
Event code 7 (KEY_6)
Event code 8 (KEY_7)
Event code 9 (KEY_8)
Event code 10 (KEY_9)
Event code 11 (KEY_0)
Event code 12 (KEY_MINUS)
Event code 13 (KEY_EQUAL)
Event code 14 (KEY_BACKSPACE)
Event code 15 (KEY_TAB)
Event code 16 (KEY_Q)
Event code 17 (KEY_W)
Event code 18 (KEY_E)
Event code 19 (KEY_R)
Event code 20 (KEY_T)
Event code 21 (KEY_Y)
Event code 22 (KEY_U)
Event code 23 (KEY_I)
Event code 24 (KEY_O)
Event code 25 (KEY_P)
Event code 26 (KEY_LEFTBRACE)
Event code 27 (KEY_RIGHTBRACE)
Event code 28 (KEY_ENTER)
Event code 29 (KEY_LEFTCTRL)
Event code 30 (KEY_A)
Event code 31 (KEY_S)
Event code 32 (KEY_D)
Event code 33 (KEY_F)
Event code 34 (KEY_G)
Event code 35 (KEY_H)
Event code 36 (KEY_J)
Event code 37 (KEY_K)
Event code 38 (KEY_L)
Event code 39 (KEY_SEMICOLON)
Event code 40 (KEY_APOSTROPHE)
Event code 41 (KEY_GRAVE)
Event code 42 (KEY_LEFTSHIFT)
Event code 43 (KEY_BACKSLASH)
Event code 44 (KEY_Z)
Event code 45 (KEY_X)
Event code 46 (KEY_C)
Event code 47 (KEY_V)
Event code 48 (KEY_B)
Event code 49 (KEY_N)
Event code 50 (KEY_M)
Event code 51 (KEY_COMMA)
Event code 52 (KEY_DOT)
Event code 53 (KEY_SLASH)
Event code 54 (KEY_RIGHTSHIFT)
Event code 55 (KEY_KPASTERISK)
Event code 56 (KEY_LEFTALT)
Event code 57 (KEY_SPACE)
Event code 58 (KEY_CAPSLOCK)
Event code 59 (KEY_F1)
Event code 60 (KEY_F2)
Event code 61 (KEY_F3)
Event code 62 (KEY_F4)
Event code 63 (KEY_F5)
Event code 64 (KEY_F6)
Event code 65 (KEY_F7)
Event code 66 (KEY_F8)
Event code 67 (KEY_F9)
Event code 68 (KEY_F10)
Event code 69 (KEY_NUMLOCK)
Event code 70 (KEY_SCROLLLOCK)
Event code 71 (KEY_KP7)
Event code 72 (KEY_KP8)
Event code 73 (KEY_KP9)
Event code 74 (KEY_KPMINUS)
Event code 75 (KEY_KP4)
Event code 76 (KEY_KP5)
Event code 77 (KEY_KP6)
Event code 78 (KEY_KPPLUS)
Event code 79 (KEY_KP1)
Event code 80 (KEY_KP2)
Event code 81 (KEY_KP3)
Event code 82 (KEY_KP0)
Event code 83 (KEY_KPDOT)
Event code 85 (KEY_ZENKAKUHANKAKU)
Event code 86 (KEY_102ND)
Event code 87 (KEY_F11)
Event code 88 (KEY_F12)
Event code 89 (KEY_RO)
Event code 90 (KEY_KATAKANA)
Event code 91 (KEY_HIRAGANA)
Event code 92 (KEY_HENKAN)
Event code 93 (KEY_KATAKANAHIRAGANA)
Event code 94 (KEY_MUHENKAN)
Event code 95 (KEY_KPJPCOMMA)
Event code 96 (KEY_KPENTER)
Event code 97 (KEY_RIGHTCTRL)
Event code 98 (KEY_KPSLASH)
Event code 99 (KEY_SYSRQ)
Event code 100 (KEY_RIGHTALT)
Event code 102 (KEY_HOME)
Event code 103 (KEY_UP)
Event code 104 (KEY_PAGEUP)
Event code 105 (KEY_LEFT)
Event code 106 (KEY_RIGHT)
Event code 107 (KEY_END)
Event code 108 (KEY_DOWN)
Event code 109 (KEY_PAGEDOWN)
Event code 110 (KEY_INSERT)
Event code 111 (KEY_DELETE)
Event code 113 (KEY_MUTE)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 116 (KEY_POWER)
Event code 117 (KEY_KPEQUAL)
Event code 119 (KEY_PAUSE)
Event code 121 (KEY_KPCOMMA)
Event code 122 (KEY_HANGUEL)
Event code 123 (KEY_HANJA)
Event code 124 (KEY_YEN)
Event code 125 (KEY_LEFTMETA)
Event code 126 (KEY_RIGHTMETA)
Event code 127 (KEY_COMPOSE)
Event code 128 (KEY_STOP)
Event code 129 (KEY_AGAIN)
Event code 130 (KEY_PROPS)
Event code 131 (KEY_UNDO)
Event code 132 (KEY_FRONT)
Event code 133 (KEY_COPY)
Event code 134 (KEY_OPEN)
Event code 135 (KEY_PASTE)
Event code 136 (KEY_FIND)
Event code 137 (KEY_CUT)
Event code 138 (KEY_HELP)
Event code 140 (KEY_CALC)
Event code 142 (KEY_SLEEP)
Event code 150 (KEY_WWW)
Event code 152 (KEY_SCREENLOCK)
Event code 158 (KEY_BACK)
Event code 159 (KEY_FORWARD)
Event code 161 (KEY_EJECTCD)
Event code 163 (KEY_NEXTSONG)
Event code 164 (KEY_PLAYPAUSE)
Event code 165 (KEY_PREVIOUSSONG)
Event code 166 (KEY_STOPCD)
Event code 172 (KEY_HOMEPAGE)
Event code 173 (KEY_REFRESH)
Event code 176 (KEY_EDIT)
Event code 177 (KEY_SCROLLUP)
Event code 178 (KEY_SCROLLDOWN)
Event code 179 (KEY_KPLEFTPAREN)
Event code 180 (KEY_KPRIGHTPAREN)
Event code 183 (KEY_F13)
Event code 184 (KEY_F14)
Event code 185 (KEY_F15)
Event code 186 (KEY_F16)
Event code 187 (KEY_F17)
Event code 188 (KEY_F18)
Event code 189 (KEY_F19)
Event code 190 (KEY_F20)
Event code 191 (KEY_F21)
Event code 192 (KEY_F22)
Event code 193 (KEY_F23)
Event code 194 (KEY_F24)
Event code 217 (KEY_SEARCH)
Event code 240 (KEY_UNKNOWN)
Event code 272 (BTN_LEFT)
Event code 273 (BTN_RIGHT)
Event code 274 (BTN_MIDDLE)
Event code 275 (BTN_SIDE)
Event code 276 (BTN_EXTRA)
Event code 304 (BTN_A)
Event code 305 (BTN_B)
Event code 306 (BTN_C)
Event code 307 (BTN_X)
Event code 308 (BTN_Y)
Event code 309 (BTN_Z)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 312 (BTN_TL2)
Event code 313 (BTN_TR2)
Event code 314 (BTN_SELECT)
Event code 315 (BTN_START)
Event code 316 (BTN_MODE)
Event code 317 (BTN_THUMBL)
Event code 318 (BTN_THUMBR)
Event code 319 (?)
Event code 354 (KEY_GOTO)
Event type 2 (EV_REL)
Event code 0 (REL_X)
Event code 1 (REL_Y)
Event code 8 (REL_WHEEL)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 127
Min 0
Max 255
Flat 15
Event code 1 (ABS_Y)
Value 127
Min 0
Max 255
Flat 15
Event code 2 (ABS_Z)
Value 127
Min 0
Max 255
Flat 15
Event code 5 (ABS_RZ)
Value 127
Min 0
Max 255
Flat 15
Resolution 46
Event code 9 (ABS_GAS)
Value 0
Min 0
Max 255
Flat 15
Event code 10 (ABS_BRAKE)
Value 0
Min 0
Max 255
Flat 15
Event code 16 (ABS_HAT0X)
Value 0
Min -1
Max 1
Event code 17 (ABS_HAT0Y)
Value 0
Min -1
Max 1
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Event type 17 (EV_LED)
Event code 0 (LED_NUML)
Event code 1 (LED_CAPSL)
Event code 2 (LED_SCROLLL)
Event code 3 (LED_COMPOSE)
Event code 4 (LED_KANA)
Properties:
Property type 20 (EV_REP)
Property code 0 (REP_DELAY)
Value 250
Property code 1 (REP_PERIOD)
Value 33
Testing ... (interrupt to exit)
Event: time 1421454084.832463, type 3 (EV_ABS), code 1 (ABS_Y), value 0
Event: time 1421454084.832463, -------------- SYN_REPORT ------------
Event: time 1421454084.903789, type 3 (EV_ABS), code 1 (ABS_Y), value 127
Event: time 1421454084.903789, -------------- SYN_REPORT ------------
Event: time 1421454085.811216, type 3 (EV_ABS), code 1 (ABS_Y), value 255
Event: time 1421454085.811216, -------------- SYN_REPORT ------------
Event: time 1421454085.943825, type 3 (EV_ABS), code 1 (ABS_Y), value 127
Event: time 1421454085.943825, -------------- SYN_REPORT ------------
Event: time 1421454086.851118, type 3 (EV_ABS), code 0 (ABS_X), value 0
Event: time 1421454086.851118, -------------- SYN_REPORT ------------
Event: time 1421454087.008672, type 3 (EV_ABS), code 0 (ABS_X), value 127
Event: time 1421454087.008672, -------------- SYN_REPORT ------------
Event: time 1421454087.791181, type 3 (EV_ABS), code 0 (ABS_X), value 255
Event: time 1421454087.791181, -------------- SYN_REPORT ------------
Event: time 1421454087.948730, type 3 (EV_ABS), code 0 (ABS_X), value 127
Event: time 1421454087.948730, -------------- SYN_REPORT ------------
Event: time 1421454092.244384, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1421454092.244384, type 1 (EV_KEY), code 304 (BTN_A), value 1
Event: time 1421454092.244384, -------------- SYN_REPORT ------------
Event: time 1421454092.244422, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1421454092.244422, type 1 (EV_KEY), code 304 (BTN_A), value 0
Event: time 1421454092.244422, -------------- SYN_REPORT ------------
Event: time 1421454092.487692, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1421454092.487692, type 1 (EV_KEY), code 307 (BTN_X), value 1
Event: time 1421454092.487692, -------------- SYN_REPORT ------------
Event: time 1421454092.670032, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1421454092.670032, type 1 (EV_KEY), code 307 (BTN_X), value 0
Event: time 1421454092.670032, -------------- SYN_REPORT ------------
Event: time 1421454093.027685, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90003
Event: time 1421454093.027685, type 1 (EV_KEY), code 306 (BTN_C), value 1
Event: time 1421454093.027685, -------------- SYN_REPORT ------------
Event: time 1421454093.279432, type 1 (EV_KEY), code 306 (BTN_C), value 2
Event: time 1421454093.279432, -------------- SYN_REPORT ------------
Event: time 1421454093.285041, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90003
Event: time 1421454093.285041, type 1 (EV_KEY), code 306 (BTN_C), value 0
Event: time 1421454093.285041, -------------- SYN_REPORT ------------
Event: time 1421454093.592579, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1421454093.592579, type 1 (EV_KEY), code 305 (BTN_B), value 1
Event: time 1421454093.592579, -------------- SYN_REPORT ------------
Event: time 1421454093.806263, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1421454093.806263, type 1 (EV_KEY), code 305 (BTN_B), value 0
Event: time 1421454093.806263, -------------- SYN_REPORT ------------
Event: time 1421454095.538749, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1421454095.538749, type 1 (EV_KEY), code 308 (BTN_Y), value 1
Event: time 1421454095.538749, -------------- SYN_REPORT ------------
Event: time 1421454095.721378, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1421454095.721378, type 1 (EV_KEY), code 308 (BTN_Y), value 0
Event: time 1421454095.721378, -------------- SYN_REPORT ------------
Event: time 1421454096.291312, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90006
Event: time 1421454096.291312, type 1 (EV_KEY), code 309 (BTN_Z), value 1
Event: time 1421454096.291312, -------------- SYN_REPORT ------------
Event: time 1421454096.523747, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90006
Event: time 1421454096.523747, type 1 (EV_KEY), code 309 (BTN_Z), value 0
Event: time 1421454096.523747, -------------- SYN_REPORT ------------
Event: time 1421454096.932476, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90007
Event: time 1421454096.932476, type 1 (EV_KEY), code 310 (BTN_TL), value 1
Event: time 1421454096.932476, -------------- SYN_REPORT ------------
Event: time 1421454097.165240, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90007
Event: time 1421454097.165240, type 1 (EV_KEY), code 310 (BTN_TL), value 0
Event: time 1421454097.165240, -------------- SYN_REPORT ------------
Event: time 1421454097.597530, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1421454097.597530, type 1 (EV_KEY), code 311 (BTN_TR), value 1
Event: time 1421454097.597530, -------------- SYN_REPORT ------------
Event: time 1421454097.830073, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1421454097.830073, type 1 (EV_KEY), code 311 (BTN_TR), value 0
Event: time 1421454097.830073, -------------- SYN_REPORT ------------

On 2015-01-17 12:28:59 +0000, Gabriel Jacobo wrote:

It seems like udev doesn't report it as a joystick...so it begs the question, should we "Won't fix" this since it's an external issue solvable via a udev rule, or should we workaround it (and possibly fall into a new rabbit hole), by inspecting the supported events and seeing if the device exhibits joystick like behavior. Sam? Ryan? What do you think?
We also talked about having the old joystick API back since it allows calibration, so that could also be a fix for this type of devices.

On 2015-01-17 12:57:53 +0000, wrote:

I think if a udev rule could fix this, it would be nice to see an example of such rule. Please share one if you can spare the time.

I just thought of an idea, to create a single udev rule file and add all supported gamepads. User read permissions could be enabled in addition to fixing joysticks that don't report correctly.

That way any controller can pair and work out of the box as long as the rule is installed. It would also maintainable outside of SDL. Simple instructions could be written to teach users how to get the controller name and add a line in the rules file to fix permissions or joystick issues.

Just my idea of a possible solution, but it does seem outside of the scope of SDL.

On 2015-01-17 13:00:23 +0000, Gabriel Jacobo wrote:

Something like this? http://hg.libsdl.org/SDL/file/tip/docs/README-linux.md :)

On 2015-01-17 13:50:39 +0000, wrote:

(In reply to Gabriel Jacobo from comment # 7)

Something like this? http://hg.libsdl.org/SDL/file/tip/docs/README-linux.md
:)

Yes exactly like that. I was unaware this documentation already existed. Thank you.

I just wish somehow all modern controllers could work by default. I feel like since /dev/JS# already add read permission It would be make sense to also default any event that has a JS# to also have read permissions and act as a joystick.

I wouldn't know who to complain to about this, I'm assuming it's the linux kernel itself at that point.

On 2015-01-17 15:40:22 +0000, Mike Kasprzak wrote:

(Bluez problems aside) I don't think telling people their PlayStation 4 controllers are not legal gamepads is going to fly. Similarly, the NES30/FC30 retro pads are popular choices for gamers looking to play games like Shovel Knight.

They all work fine under Windows, and qjoypad sees them just fine.

Also, somehow Linux still knows they are gamepads:

http://junk.mikekasprzak.com/SDL/BTPad.png

All of them are reported as Joypad's under the Bluetooth settings on Ubuntu.

On 2015-01-18 10:34:29 +0000, wrote:

I think this is due to Udev not having proper default settings for /dev/input/event# controllers. It is the newer library, but I am not sure what the advantages are.

Maybe SDL could try to use event if it can, but then also try to fallback on /dev/inpug/JS#. Since they seem to always have proper read and joystick flags.

I believe this is why qjoypad or other programs work, they use the old JS0 format. I don't think moving backwards for a quick fix is the best idea though, I would much prefer this problem be fixed properly upstream.

Does anyone have any more information on Event vs JS? Why can JS easily have the read flag set but the associated event number not? Is this a bug we could file and potentially fix for all controllers on newer systems once a new kernel is released?

On 2015-02-19 06:32:15 +0000, Ryan C. Gordon wrote:

Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry
if you got a lot of email from this. This is to help me sort through some bugs
in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4,
though!

On 2018-08-06 21:20:19 +0000, Ryan C. Gordon wrote:

Hello, and sorry if you're getting dozens of copies of this message by email.

We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc.

Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report.

So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues.

(please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!)

Thanks,
--ryan.

@SDLBugzilla SDLBugzilla added abandoned Bug has been abandoned for various reasons bug labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned Bug has been abandoned for various reasons
Projects
None yet
Development

No branches or pull requests

1 participant