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

5.0 does not recognise Xbox One gamepad #183

Closed
mihawk90 opened this issue Jun 25, 2021 · 17 comments
Closed

5.0 does not recognise Xbox One gamepad #183

mihawk90 opened this issue Jun 25, 2021 · 17 comments

Comments

@mihawk90
Copy link

This is the first time I installed this plugin, so no old configuration is laying around anywhere. Also means it's not particularly urgent :)
I didn't try the older version because the required lib doesn't seem to be in the Fedora repos.

Does the new version require any libs to be installed? The .so seems to load fine in the logs and the Wiki doesn't say anything about it from what I've seen.

Describe the bug
When adding an overlay, my Xbox One Controller is not being shown in the list of available gamepads, reloading gamepads also does not help. The gamepad itself works in various games as well as Steam (Big Picture), Kodi, and AntiMicro, so I would assume it's not the pad :)

To Reproduce

  • plug in XBO controller (mine is a model 1537, the first one released)
  • start OBS
  • add Overlay
  • select imageand config
  • try selecting Gamepad id -> it's empty

Expected behavior
The gamepad to show up and show inputs ;)

Screenshots
image

Additional information:

Additional context
lsusb output in case it's relevant:

[tarulia@localhost]~% lsusb -d 045e:02d1 -v

Bus 005 Device 011: ID 045e:02d1 Microsoft Corp. Xbox One Controller
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass        71 
  bDeviceProtocol       208 
  bMaxPacketSize0        64
  idVendor           0x045e Microsoft Corp.
  idProduct          0x02d1 Xbox One Controller
  bcdDevice            1.01
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0060
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     71 
      bInterfaceProtocol    208 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               4
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               4
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     71 
      bInterfaceProtocol    208 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     71 
      bInterfaceProtocol    208 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x00e4  1x 228 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x00e4  1x 228 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     71 
      bInterfaceProtocol    208 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     71 
      bInterfaceProtocol    208 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0

What type of id does that field expect and can I fill it out manually? I tried the /dev path (shown in KDE's settings), and the Vendor/Product ID from lsubs, but no luck.

@univrsal
Copy link
Owner

Dependencies are all statically linked and since it loaded there's no issue with those. Does the gamepad show up in /dev/input? It needs to show up as a js device in there like js0 for the first gamepad, js1 etc. Alternatively it should show up in /dev/input/by-id/ as something like usb_***-event-joystick

@mihawk90
Copy link
Author

mihawk90 commented Jun 25, 2021

Should have mentioned that, yes it does show up as /dev/input/js0:

[tarulia@localhost]~% ls /dev/input | grep js
js0

Curiously, lsusb cannot open that device:

[tarulia@localhost]~% lsusb -D /dev/input/js0 -v
Cannot open /dev/input/js0

Although I am unsure how relevant that is.

As for by-id, I'm getting 2 results in there:

[tarulia@localhost]~% ls /dev/input/by-id | grep joystick 
usb-Microsoft_Controller_7EED8986CCF7-event-joystick
usb-Microsoft_Controller_7EED8986CCF7-joystick

Also it seems I'm bad at reading documentation and just now saw that there is a setting dialogue (oops). But changing the /dev method had no effect unfortunately.
edit:
After an OBS restart, the setting sets back to the default by-id even though I changed it to input/js. I'm not sure if that even applies without a restart, but if it doesn't then I can't test it as is.


I should also mention: the gamepad is connected via USB, since I don't have one of those Wireless dongles that the first gen controllers need (and I don't know if they work on Linux anyway).

@univrsal
Copy link
Owner

I can't open my gamepad with lsusb either so that shouldn't be the problem. I don't have any other gamepad to test, can you run the test program from this build https://github.com/univrsal/libgamepad/actions/runs/971981457 (should be in x86_64-linux-gnu/bin/libgamepad_tests) and see what the output is?

@mihawk90
Copy link
Author

mihawk90 commented Jun 25, 2021

[tarulia@localhost]~/Downloads/nightly-build/x86_64-linux-gnu/bin% ./libgamepad_tests
debug: Found potential gamepad at '/dev/input/js0'
debug: Initialized gamepad from '/dev/input/js0' with id '(js0) Microsoft X-Box One pad'
info: Microsoft X-Box One pad connected
info: Hook thread started
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid

Last 3 lines repeat in a second interval

It also sees both analogue sticks and the buttons when pressing them (A B X Y):

[tarulia@localhost]~/Downloads/nightly-build/x86_64-linux-gnu/bin% ./libgamepad_tests
debug: Found potential gamepad at '/dev/input/js0'
debug: Initialized gamepad from '/dev/input/js0' with id '(js0) Microsoft X-Box One pad'
info: Microsoft X-Box One pad connected
info: Hook thread started
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
info: Received button event: Native id: 0, Virtual id: 60416 val: 1.000000
info: Received button event: Native id: 0, Virtual id: 60416 val: 0.000000
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
info: Received button event: Native id: 1, Virtual id: 60417 val: 1.000000
info: Received button event: Native id: 1, Virtual id: 60417 val: 0.000000
info: Received button event: Native id: 2, Virtual id: 60418 val: 1.000000
info: Received button event: Native id: 2, Virtual id: 60418 val: 0.000000
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
info: Received button event: Native id: 3, Virtual id: 60419 val: 1.000000
info: Received button event: Native id: 3, Virtual id: 60419 val: 0.000000
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid

@univrsal
Copy link
Owner

huh, that's strange, I'll update the library for input overlay

@mihawk90
Copy link
Author

New build works :)

@univrsal
Copy link
Owner

nice

@mihawk90
Copy link
Author

mihawk90 commented Jun 25, 2021

Hm... maybe I was a bit fast, although it could be a separate issue.

My sticks are showing as being pressed down right when not being touched at all, KDE settings shows them fine:

image

Back and Select are swapped in the overlay, although funny enough it is correct in io-cct. Although changing that is easy in the settings, so not a big deal.

But the D-Pad isn't recognised at all when pressed. Both libgamepad_test (and also KDE settings) shows the D-Pad as axis (horizontal is native ID 6, vertical is 7), not buttons. I'm just not sure how to configure the D-Pad as axis in io-cct, since I guess the D-Pad expects button inputs (as per the keycode), but I can't find an option to make it an axis instead.

@univrsal
Copy link
Owner

do they move at all? What does the test program output when you move them?

@mihawk90
Copy link
Author

Forgot to mention, yes they do move.

What I also just realised is that they start centered when starting OBS, but after an input they snap to the bottom right, so I assume it's got something to do with the values that are sent.

Right stick is untouched after launch, left stick all the way pressed to the top left.
image

This is a full circle mid -> top -> counterclockwise

[tarulia@localhost]~/Downloads/nightly-build/x86_64-linux-gnu/bin% ./libgamepad_tests
debug: Found potential gamepad at '/dev/input/js0'
debug: Initialized gamepad from '/dev/input/js0' with id '(js0) Microsoft X-Box One pad'
info: Microsoft X-Box One pad connected
info: Hook thread started
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.508576
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.505936
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.504013
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.501511
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.496551
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.487030
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.470428
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.359159
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.346189
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.224285
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.212779
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.193309
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.073587
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.065606
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.052438
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.000008
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.528931
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.520325
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.515106
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.510086
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.504776
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.500000
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.493500
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.479995
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.465133
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.445815
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.343229
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.336500
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.326413
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.317182
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.303464
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.288769
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.270306
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.001091
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.252026
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.003136
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.234737
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.006859
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.215267
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.011604
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.195613
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.019112
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.176356
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.026421
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.156580
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.034539
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.137430
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.045891
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.120935
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.057931
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.103449
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.071450
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.086358
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.069650
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.100580
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.055428
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.115671
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.000008
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.130015
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.144404
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.160838
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.179698
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.199794
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.307767
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.313672
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.323743
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.338300
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.357527
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.477356
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.483261
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.495102
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.505631
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.523972
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.543671
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.562669
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.582277
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.690021
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.694080
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.701282
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.710636
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.726368
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.740986
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.754963
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.771778
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.020439
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.790059
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.808980
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.028511
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.827642
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.035286
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.845830
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.048470
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.864492
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.060021
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.882956
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.075021
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.899374
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.091501
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.914282
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.107721
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.928046
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.125757
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.999992
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.247662
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.257015
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.276394
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.427581
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.442885
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.575776
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.586030
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.689883
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.697681
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.711337
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.984382
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.728687
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.980262
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.832265
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.975380
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.836446
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.966041
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.843282
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.954505
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.853841
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.941077
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.869329
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.922965
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.887060
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.812154
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.906210
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.800130
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.923407
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.781102
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.999992
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.661456
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.653231
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.636172
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.531418
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.525360
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.507889
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.383345
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.372099
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.987312
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.240093
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.983696
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.230724
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.972114
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.216075
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.959922
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.199107
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.946845
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.182628
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.934256
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.166300
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.917548
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.150034
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.899786
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.133890
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.792271
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.115961
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.784566
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.097116
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.770573
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.079324
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.752964
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.000008
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.650378
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.645022
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.634478
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.622225
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.609209
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.597047
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.585283
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.574006
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.563523
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.551652
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.539216
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.525162
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.506912
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.491547
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.377363
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.373259
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.367247
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.360655
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.354322
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.347715
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.341840
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.337400
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.333875
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.331037
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.328611
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.326749
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.324857
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.321195
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.316037
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.311414
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.307248
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.303800
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.300855
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.298581
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.296658
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.295056
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.296109
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.301541
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.309186
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.317365
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.324079
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.329847
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.335157
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.339078
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.341871
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.344663
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.347196
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.349699
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.351804
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.356123
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.367765
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.027901
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.383345
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.034752
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.485611
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.047890
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.488632
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.149165
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.496582
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.159968
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.500000
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.318311
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.505356
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.497559
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.509873
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.500000
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.513581
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.501404
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.516449
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.503372
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.518723
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.504944
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.520554
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.506210
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.522141
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.507294
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.524125
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.508896
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.525711
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.510880
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.527192
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid

And just to top and back:

[tarulia@localhost]~/Downloads/nightly-build/x86_64-linux-gnu/bin% ./libgamepad_tests
debug: Found potential gamepad at '/dev/input/js0'
debug: Initialized gamepad from '/dev/input/js0' with id '(js0) Microsoft X-Box One pad'
info: Microsoft X-Box One pad connected
info: Hook thread started
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.509201
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.504288
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.500778
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.496887
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.488434
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.472519
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.360929
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.344678
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.523499
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.196178
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.515808
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.180201
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.500000
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.027016
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.482101
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.000008
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.465743
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.452331
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.441436
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.432891
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.424987
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.418212
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.412566
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.407836
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.404051
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.401137
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.398909
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.018669
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.403929
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.028771
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.418807
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.139063
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.438399
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.153559
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.458450
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.305570
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.475677
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.408827
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.488663
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.425872
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.499268
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.441100
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.503403
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.453552
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.509964
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.463516
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.515106
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.471481
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.519211
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.477844
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.522507
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.482956
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.525254
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.487030
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.527359
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.490387
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.529023
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.493057
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.495209
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.531449
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.496826
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.532898
info: Received axis event: Native id: 1, Virtual id: 60432 val: 0.499329
info: Received axis event: Native id: 0, Virtual id: 60431 val: 0.534455
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid
debug: Updating device list
debug: Found potential gamepad at '/dev/input/js0'
debug: Descriptor is still valid

@univrsal
Copy link
Owner

I seem to have the issue as well so I guess that's not related to the gamepad but rather the analog stick element miscalculating the offset

@sanyer
Copy link

sanyer commented Aug 26, 2022

Hey @univrsal , any update on this? :-)

@univrsal
Copy link
Owner

No I haven't spent much time on input overlay in general recently

@univrsal univrsal reopened this Aug 26, 2022
@sanyer
Copy link

sanyer commented Aug 26, 2022

Oh, I understand. Perhaps you can point to place in code where you think issue might be?
Maybe I can find some courage to dust off my C++ skills. Or maybe it's something else, whatever it is.

@univrsal
Copy link
Owner

univrsal commented Aug 26, 2022

This is where the analog stick gets rendered
https://github.com/univrsal/input-overlay/blob/master/src/util/element/element_analog_stick.cpp
The calculation here is most likely what's wrong. It seems that libgamepad limits the axis movements to 0.5. I intended them to be from -1 to +1 though.

And this is where the gamepad input is handled:
https://github.com/univrsal/libgamepad/blob/master/src/linux/device-linux.cpp
https://github.com/univrsal/libgamepad/blob/master/src/windows/device-xinput.cpp
https://github.com/univrsal/libgamepad/blob/master/src/windows/device-dinput.cpp

There's a bunch of things that need some work, but I haven't really gotten around to spending time on any of them.

@sanyer
Copy link

sanyer commented Aug 26, 2022

Nice, thanks!
Small note, DInput seems to be fixing the situation slightly - sticks are still misaligned, but retain the correct rotation, while XInput inverts rotation of left stick, additionally to misalignment.

@univrsal
Copy link
Owner

univrsal commented Dec 6, 2022

See #297 for further tracking

@univrsal univrsal closed this as completed Dec 6, 2022
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

3 participants