xbmc / peripheral.joystick

Kodi joystick support (drivers and button maps)
GNU General Public License v2.0
24 stars 46 forks source link

8BitDo SN30 Pro+ not working via Bluetooth #182

Open alk3mist opened 4 years ago

alk3mist commented 4 years ago

Hi, I tried to use the gamepad via Bluetooth. But it seems that the buttons are not recognized. When connected

2020-05-30 17:10:45.180 T:1881141984   DEBUG: CLibInputHandler::DeviceAdded - keyboard type device added: 8BitDo SN30 Pro+ (event3)
2020-05-30 17:10:45.180 T:1881141984   DEBUG: CLibInputKeyboard::GetRepeat - could not get key repeat for event3 (Function not implemented)
2020-05-30 17:10:45.180 T:1881141984   DEBUG: CLibInputKeyboard::GetRepeat - delay: 400ms repeat: 80ms for 8BitDo SN30 Pro+ (event3)
2020-05-30 17:11:15.056 T:1665106656    INFO: AddOnLog: Joystick Support: Initialized joystick 1: "8BitDo SN30 Pro+", axes: 8, hats: 0, buttons: 10
2020-05-30 17:11:15.112 T:1665106656   DEBUG: GetMappingForDevice - device (0000:0000) mapped to  (type = joystick)
2020-05-30 17:11:15.211 T:1665106656   DEBUG: Initialise - initialised peripheral on 'peripheral.joystick/1' with 1 features and 0 sub devices
2020-05-30 17:11:15.211 T:1665106656  NOTICE: Register - new joystick device registered on addon->peripheral.joystick/1: 8BitDo SN30 Pro+

nothing happens when I press buttons. The only button is shown in log is home(or guide) button

2020-05-30 17:27:39.012 T:1881141984   DEBUG: CLibInputKeyboard::ProcessKey - using delay: 400ms repeat: 80ms
2020-05-30 17:27:39.013 T:1247056608   DEBUG: Thread Timer start, auto delete: false
2020-05-30 17:27:39.014 T:1901679456   DEBUG: Keyboard: scancode: 0x8b, sym: 0x0000, unicode: 0x0000, modifier: 0x0
2020-05-30 17:27:39.014 T:1901679456   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-05-30 17:27:39.015 T:1901679456   DEBUG: Previous line repeats 3 times.
2020-05-30 17:27:39.015 T:1901679456   DEBUG: HandleKey: 0 (0xf200, obc-61697) pressed, action is
2020-05-30 17:27:39.436 T:1901679456   DEBUG: Keyboard: scancode: 0x8b, sym: 0x0000, unicode: 0x0000, modifier: 0x0
2020-05-30 17:27:39.436 T:1901679456   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-05-30 17:27:39.436 T:1901679456   DEBUG: Previous line repeats 3 times.
2020-05-30 17:27:39.436 T:1901679456   DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is
2020-05-30 17:27:39.524 T:1901679456   DEBUG: Keyboard: scancode: 0x8b, sym: 0x0000, unicode: 0x0000, modifier: 0x0
2020-05-30 17:27:39.524 T:1901679456   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-05-30 17:27:39.524 T:1901679456   DEBUG: Previous line repeats 3 times.
2020-05-30 17:27:39.524 T:1901679456   DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is
2020-05-30 17:27:39.585 T:1247056608   DEBUG: Thread Timer 1247056608 terminating
2020-05-30 17:27:39.614 T:1901679456   DEBUG: Keyboard: scancode: 0x8b, sym: 0x0000, unicode: 0x0000, modifier: 0x0
2020-05-30 17:27:39.614 T:1901679456   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-05-30 17:27:39.614 T:1901679456   DEBUG: Previous line repeats 3 times.
2020-05-30 17:27:39.614 T:1901679456   DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is
2020-05-30 17:27:39.614 T:1901679456   DEBUG: Keyboard: scancode: 0x8b, sym: 0x0000, unicode: 0x0000, modifier: 0x0

and when I turned the gamepad off:

2020-05-29 22:02:38.902 T:1665106656  NOTICE: UnregisterRemovedDevices - device removed from joystick/peripheral.joystick/0: 8BitDo SN30 Pro+ (0000:0000)

my setup is

garbear commented 4 years ago

Can you try the steps at https://kodi.wiki/view/HOW-TO:Configure_controllers?

alk3mist commented 4 years ago

Yes, I tried to do this, but when I try to assign a key, nothing happens, the countdown is just displayed. I should note that the gamepad has several modes, I managed to connect the gamepad in the "Switch" mode, but not in X-input mode (Xbox 360 mode). Thus, the problem remains only for the X-input mode. However, in Retroarch and Steamlink, both modes work fine.

garbear commented 4 years ago

Your controller is behaving as a keyboard, sending key presses. Does it have a mode that sends button presses?

I'm not fully up-to-date with the libinput work, but I think libinput looks for the LIBINPUT_DEVICE_CAP_KEYBOARD capability, and grabs the device, preventing joystick functionality. However, the Peripheral add-on sees a controller, so I doubt this is the case.

One solution may be configuring libinput capabilities of the controller.