How to use two XBOX Wireless Controller with Kodi Game?
#16
(2022-11-28, 07:29)garbear Wrote: Yes, Multiplayer was always supported but switching ports wasn't, so it was relatively limited. Multiplayer should work much better in the latest v20 or my v19 test builds. Let me know if you run into any more problems.

Just wanted to say thank you and that multi player is working nicely for me with some 8bitdo controllers.
Reply
#17
(2022-01-11, 20:40)garbear Wrote:
(2019-10-18, 17:03)Wintermute0110 Wrote: Using more than two controllers in Retroplayer is not implemented in Leia. Please wait until @garbear finished the Player Manager.

 The day has arrived! I've finally merged what could be called a "Player Manager". Multiple controllers are now fully supported.

Image

This feature has been fully merged into master for v20. I also backported it to my test builds based on v19. You can find my test builds at: https://github.com/garbear/xbmc/releases

How do I get to this screen? Right now I can't figure out any way to get a second controller working in NES, nor can I set up my SNES controller for the SNES games. Only the first player NES controller works, and it's the controller used by both emulators.
Reply
#18
(2023-06-20, 02:11)Taskr36 Wrote:
(2022-01-11, 20:40)garbear Wrote:
(2019-10-18, 17:03)Wintermute0110 Wrote: Using more than two controllers in Retroplayer is not implemented in Leia. Please wait until @garbear finished the Player Manager.

 The day has arrived! I've finally merged what could be called a "Player Manager". Multiple controllers are now fully supported.

Image

This feature has been fully merged into master for v20. I also backported it to my test builds based on v19. You can find my test builds at: https://github.com/garbear/xbmc/releases

How do I get to this screen? Right now I can't figure out any way to get a second controller working in NES, nor can I set up my SNES controller for the SNES games. Only the first player NES controller works, and it's the controller used by both emulators.

You access it via the in-game OSD. Press the Select + X button combo, or press and hold Start. From that menu, choose "Settings" and then "Ports" to configure different player's controllers.
Reply
#19
(2023-06-24, 23:43)garbear Wrote:
(2023-06-20, 02:11)Taskr36 Wrote:
(2022-01-11, 20:40)garbear Wrote:  The day has arrived! I've finally merged what could be called a "Player Manager". Multiple controllers are now fully supported.

Image

This feature has been fully merged into master for v20. I also backported it to my test builds based on v19. You can find my test builds at: https://github.com/garbear/xbmc/releases

How do I get to this screen? Right now I can't figure out any way to get a second controller working in NES, nor can I set up my SNES controller for the SNES games. Only the first player NES controller works, and it's the controller used by both emulators.

You access it via the in-game OSD. Press the Select + X button combo, or press and hold Start. From that menu, choose "Settings" and then "Ports" to configure different player's controllers.

Works fine in the NES emulator. Turns out the 2nd player controller was just bad. For the SNES emulator though, still nothing. I get to that screen, select the SNES controller, configure the SNES controller, and it still just doesn't work. It controls menus and Kodi in general, but does nothing in the emulator. For some reason every emulator only works with the classic NES controllers, which obviously don't have enough buttons to be effecting in an SNES emulator.
Reply
#20
(2023-06-24, 23:43)garbear Wrote:
(2023-06-20, 02:11)Taskr36 Wrote:
(2022-01-11, 20:40)garbear Wrote:  The day has arrived! I've finally merged what could be called a "Player Manager". Multiple controllers are now fully supported.

Image

This feature has been fully merged into master for v20. I also backported it to my test builds based on v19. You can find my test builds at: https://github.com/garbear/xbmc/releases

How do I get to this screen? Right now I can't figure out any way to get a second controller working in NES, nor can I set up my SNES controller for the SNES games. Only the first player NES controller works, and it's the controller used by both emulators.

You access it via the in-game OSD. Press the Select + X button combo, or press and hold Start. From that menu, choose "Settings" and then "Ports" to configure different player's controllers.

Is this implemented in Kodi 20.2 release yet?
For the life of me I can't access any in-game OSD by long pressing start.
Tried with 5 emulators so far.
Shield TV 2017 with shield controllers.
Reply
#21
(2023-11-17, 07:06)janweinreich Wrote: Is this implemented in Kodi 20.2 release yet?

Yes, though if you're testing please use v21 beta 1 because it has many additional improvements and features.

(2023-11-17, 07:06)janweinreich Wrote: For the life of me I can't access any in-game OSD by long pressing start.
Tried with 5 emulators so far.
Shield TV 2017 with shield controllers.

 Please upload a debug log showing the input not working. I can usually see where the input is being dropped. Likely Android is sending a keybaord press instead of a joystick press for "compatibility", something we'd have to work around.
Reply
#22
(2023-11-17, 08:17)garbear Wrote:
(2023-11-17, 07:06)janweinreich Wrote: Is this implemented in Kodi 20.2 release yet?

Yes, though if you're testing please use v21 beta 1 because it has many additional improvements and features.
(2023-11-17, 07:06)janweinreich Wrote: For the life of me I can't access any in-game OSD by long pressing start.
Tried with 5 emulators so far.
Shield TV 2017 with shield controllers.

 Please upload a debug log showing the input not working. I can usually see where the input is being dropped. Likely Android is sending a keybaord press instead of a joystick press for "compatibility", something we'd have to work around.
Thank you. I currently can't try a Kodi build other than main release since this device is shared with the waifu.

Here's my buttonmap on peripheral.joystick:
https://pastebin.com/TeYnkqVt

settings.xml:
https://pastebin.com/hALfZSkT

Here's the peripheral_data
https://pastebin.com/Ctcd2665

And debug log (had to split in two parts due to size, sorry)
https://pastebin.com/hTBKEDkN
https://pastebin.com/NbsyJBLn

Cheers,

Edit:

Wait it seems to be a skin issue!
2023-11-17 07:51:38.134 T:8141    error <general>: Unable to load window XML: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/skin.arctic.horizon.2/1080i/GameOSD.xml. Line 0

Indeed it was:

So after setting up Estuary skin I get to the GameOSD menu, which I couldn't navigate either with the shield controller or the shield remote. I had to use the trackpad feature on the Shield TV phone app.
Once I clicked on "Settings", I could navigate with both controller and remote.

Here's the debug log of these latest efforts:
https://pastebin.com/AZEYYYGt

I'm gonna try setting up two controllers now.
Reply
#23
(2023-11-17, 13:12)janweinreich Wrote: Thank you. I currently can't try a Kodi build other than main release since this device is shared with the waifu.

Fair, avoid v21 beta then until it goes final (or even a point 1 release).

However, the latest v20.2 release is paradoxically rather far behind the latest stable version. Due to Android store issues, we probably won't release a v20.3 on the Play store, even though we continue to maintain v20 with (only safe) bugfixes for users to sideload.

One such fix is directly related to fixing joysticks on Android: https://github.com/xbmc/xbmc/pull/23482

The latest v20 version is available on our mirrors: https://mirrors.kodi.tv/nightlies/androi...v8a/Nexus/

If you're on Android it's worth using the latest v20 due to this fix.

(2023-11-17, 13:12)janweinreich Wrote: And debug log (had to split in two parts due to size, sorry)
https://pastebin.com/hTBKEDkN
https://pastebin.com/NbsyJBLn

You can see the input devices that Android sees starting at line 674 in the first log:
 
Code:
2023-11-17 07:41:03.992 T:8141     info <general>: CPeripheralBusAndroid: scanning for input devices...
2023-11-17 07:41:03.993 T:8141    debug <general>: CPeripheralBusAndroid: Device discovered:
2023-11-17 07:41:03.993 T:8141    debug <general>:   Name: "NVIDIA Virtual Mouse"
...

You can see RetroPlayer initializing at line 1326 of the second log:
 
Code:
2023-11-17 07:49:27.145 T:8141     info <general>: RetroPlayer[PROCESS]: Created process info for Android

The first button (A) is pressed on line 1683:
 
Code:
2023-11-17 07:49:29.831 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_A (96) pressed
2023-11-17 07:49:29.835 T:8230    debug <general>: BUTTON [ 0 ] on "NVIDIA Corporation NVIDIA Controller v01.04" pressed
2023-11-17 07:49:29.835 T:8230    debug <general>: FEATURE [ a ] on game.controller.default pressed (ignored)
2023-11-17 07:49:29.835 T:8230    debug <general>: FEATURE [ a ] on game.controller.genesis.6button pressed (handled)
2023-11-17 07:49:29.973 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_A (96) released
2023-11-17 07:49:29.992 T:8230    debug <general>: BUTTON [ 0 ] on "NVIDIA Corporation NVIDIA Controller v01.04" released
2023-11-17 07:49:29.993 T:8230    debug <general>: FEATURE [ a ] on game.controller.default released
2023-11-17 07:49:29.993 T:8230    debug <general>: FEATURE [ a ] on game.controller.genesis.6button released

Then you get your game OSD issue:
 
Code:
2023-11-17 07:51:38.133 T:8141    debug <general>: ------ Window Init (GameOSD.xml) ------
2023-11-17 07:51:38.133 T:8141     info <general>: Loading skin file: GameOSD.xml, load type: KEEP_IN_MEMORY
2023-11-17 07:51:38.134 T:8141    error <general>: Unable to load window XML: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/skin.arctic.horizon.2/1080i/GameOSD.xml. Line 0
                                                   Failed to open file
 
(2023-11-17, 13:12)janweinreich Wrote: Here's the debug log of these latest efforts:
https://pastebin.com/AZEYYYGt

It's weird that "start" sends multiple presses without releases, but the code should handle this:
 
Code:
2023-11-17 08:27:15.906 T:8141    debug <general>: ------ Window Init (GameOSD.xml) ------
2023-11-17 08:27:15.906 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_START (108) pressed
2023-11-17 08:27:15.913 T:8230    debug <general>: BUTTON [ 11 ] on "NVIDIA Corporation NVIDIA Controller v01.04" pressed
2023-11-17 08:27:15.959 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_START (108) pressed
2023-11-17 08:27:15.965 T:8230    debug <general>: BUTTON [ 11 ] on "NVIDIA Corporation NVIDIA Controller v01.04" pressed
2023-11-17 08:27:16.008 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_START (108) pressed
2023-11-17 08:27:16.031 T:8230    debug <general>: BUTTON [ 11 ] on "NVIDIA Corporation NVIDIA Controller v01.04" pressed

Maybe the problem is there.

Once you click on the settings option in the game OSD, it looks like the down button works:
 
Code:
2023-11-17 08:27:29.505 T:8141    debug <general>: ProcessMouse: trying mouse action leftclick
2023-11-17 08:27:29.505 T:8141    debug <general>: Activating window ID: 11101
2023-11-17 08:27:29.505 T:8141    debug <general>: ------ Window Init (Custom_1101_SettingsList.xml) ------
2023-11-17 08:27:29.508 T:15568   debug <general>: Thread JobWorker start, auto delete: true
2023-11-17 08:27:29.508 T:8141    debug <general>: PERIPHERALS: Event poll handle deactivated
2023-11-17 08:27:29.508 T:8161    debug <general>: void CXBMCApp::OnPlayBackPaused()
2023-11-17 08:27:30.339 T:8230    debug <general>: FEATURE [ down ] on game.controller.default pressed (ignored)
2023-11-17 08:27:30.340 T:8230    debug <general>: FEATURE [ down ] on game.controller.genesis.6button pressed (ignored)
2023-11-17 08:27:30.340 T:8230    debug <general>: FEATURE [ down ] on game.controller.default pressed (handled)
2023-11-17 08:27:30.340 T:8230    debug <general>: FEATURE [ down ] on game.controller.default pressed (ignored)
2023-11-17 08:27:30.340 T:8230    debug <general>: FEATURE [ down ] on game.controller.default pressed (handled)
2023-11-17 08:27:30.498 T:8230    debug <general>: FEATURE [ down ] on game.controller.default released
2023-11-17 08:27:30.499 T:8230    debug <general>: FEATURE [ down ] on game.controller.genesis.6button released
2023-11-17 08:27:30.499 T:8230    debug <general>: FEATURE [ down ] on game.controller.default released
2023-11-17 08:27:31.203 T:8230     info <general>: Skipped 2 duplicate messages..

You can see that there are 5 input handlers (4 use default, one uses genesis) that handle presses, then you can see the 5 input handlers handling the release.
(2023-11-17, 13:12)janweinreich Wrote: I'm gonna try setting up two controllers now.

Let me know how it goes, and if one or both work in the menu but not in the game, then definitely sideload the latest v20 with the android controller fix.
Reply
#24
Thank you.
Reply
#25
(2023-11-17, 19:23)garbear Wrote:
(2023-11-17, 13:12)janweinreich Wrote: Thank you. I currently can't try a Kodi build other than main release since this device is shared with the waifu.

Fair, avoid v21 beta then until it goes final (or even a point 1 release).

However, the latest v20.2 release is paradoxically rather far behind the latest stable version. Due to Android store issues, we probably won't release a v20.3 on the Play store, even though we continue to maintain v20 with (only safe) bugfixes for users to sideload.

One such fix is directly related to fixing joysticks on Android: https://github.com/xbmc/xbmc/pull/23482

The latest v20 version is available on our mirrors: https://mirrors.kodi.tv/nightlies/androi...v8a/Nexus/

If you're on Android it's worth using the latest v20 due to this fix.

(2023-11-17, 13:12)janweinreich Wrote: And debug log (had to split in two parts due to size, sorry)
https://pastebin.com/hTBKEDkN
https://pastebin.com/NbsyJBLn

You can see the input devices that Android sees starting at line 674 in the first log:
 
Code:
2023-11-17 07:41:03.992 T:8141     info <general>: CPeripheralBusAndroid: scanning for input devices...
2023-11-17 07:41:03.993 T:8141    debug <general>: CPeripheralBusAndroid: Device discovered:
2023-11-17 07:41:03.993 T:8141    debug <general>:   Name: "NVIDIA Virtual Mouse"
...

You can see RetroPlayer initializing at line 1326 of the second log:
 
Code:
2023-11-17 07:49:27.145 T:8141     info <general>: RetroPlayer[PROCESS]: Created process info for Android

The first button (A) is pressed on line 1683:
 
Code:
2023-11-17 07:49:29.831 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_A (96) pressed
2023-11-17 07:49:29.835 T:8230    debug <general>: BUTTON [ 0 ] on "NVIDIA Corporation NVIDIA Controller v01.04" pressed
2023-11-17 07:49:29.835 T:8230    debug <general>: FEATURE [ a ] on game.controller.default pressed (ignored)
2023-11-17 07:49:29.835 T:8230    debug <general>: FEATURE [ a ] on game.controller.genesis.6button pressed (handled)
2023-11-17 07:49:29.973 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_A (96) released
2023-11-17 07:49:29.992 T:8230    debug <general>: BUTTON [ 0 ] on "NVIDIA Corporation NVIDIA Controller v01.04" released
2023-11-17 07:49:29.993 T:8230    debug <general>: FEATURE [ a ] on game.controller.default released
2023-11-17 07:49:29.993 T:8230    debug <general>: FEATURE [ a ] on game.controller.genesis.6button released

Then you get your game OSD issue:
 
Code:
2023-11-17 07:51:38.133 T:8141    debug <general>: ------ Window Init (GameOSD.xml) ------
2023-11-17 07:51:38.133 T:8141     info <general>: Loading skin file: GameOSD.xml, load type: KEEP_IN_MEMORY
2023-11-17 07:51:38.134 T:8141    error <general>: Unable to load window XML: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/skin.arctic.horizon.2/1080i/GameOSD.xml. Line 0
                                                   Failed to open file
 
(2023-11-17, 13:12)janweinreich Wrote: Here's the debug log of these latest efforts:
https://pastebin.com/AZEYYYGt

It's weird that "start" sends multiple presses without releases, but the code should handle this:
 
Code:
2023-11-17 08:27:15.906 T:8141    debug <general>: ------ Window Init (GameOSD.xml) ------
2023-11-17 08:27:15.906 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_START (108) pressed
2023-11-17 08:27:15.913 T:8230    debug <general>: BUTTON [ 11 ] on "NVIDIA Corporation NVIDIA Controller v01.04" pressed
2023-11-17 08:27:15.959 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_START (108) pressed
2023-11-17 08:27:15.965 T:8230    debug <general>: BUTTON [ 11 ] on "NVIDIA Corporation NVIDIA Controller v01.04" pressed
2023-11-17 08:27:16.008 T:8140    debug <general>: Android Key AKEYCODE_BUTTON_START (108) pressed
2023-11-17 08:27:16.031 T:8230    debug <general>: BUTTON [ 11 ] on "NVIDIA Corporation NVIDIA Controller v01.04" pressed

Maybe the problem is there.

Once you click on the settings option in the game OSD, it looks like the down button works:
 
Code:
2023-11-17 08:27:29.505 T:8141    debug <general>: ProcessMouse: trying mouse action leftclick
2023-11-17 08:27:29.505 T:8141    debug <general>: Activating window ID: 11101
2023-11-17 08:27:29.505 T:8141    debug <general>: ------ Window Init (Custom_1101_SettingsList.xml) ------
2023-11-17 08:27:29.508 T:15568   debug <general>: Thread JobWorker start, auto delete: true
2023-11-17 08:27:29.508 T:8141    debug <general>: PERIPHERALS: Event poll handle deactivated
2023-11-17 08:27:29.508 T:8161    debug <general>: void CXBMCApp::OnPlayBackPaused()
2023-11-17 08:27:30.339 T:8230    debug <general>: FEATURE [ down ] on game.controller.default pressed (ignored)
2023-11-17 08:27:30.340 T:8230    debug <general>: FEATURE [ down ] on game.controller.genesis.6button pressed (ignored)
2023-11-17 08:27:30.340 T:8230    debug <general>: FEATURE [ down ] on game.controller.default pressed (handled)
2023-11-17 08:27:30.340 T:8230    debug <general>: FEATURE [ down ] on game.controller.default pressed (ignored)
2023-11-17 08:27:30.340 T:8230    debug <general>: FEATURE [ down ] on game.controller.default pressed (handled)
2023-11-17 08:27:30.498 T:8230    debug <general>: FEATURE [ down ] on game.controller.default released
2023-11-17 08:27:30.499 T:8230    debug <general>: FEATURE [ down ] on game.controller.genesis.6button released
2023-11-17 08:27:30.499 T:8230    debug <general>: FEATURE [ down ] on game.controller.default released
2023-11-17 08:27:31.203 T:8230     info <general>: Skipped 2 duplicate messages..

You can see that there are 5 input handlers (4 use default, one uses genesis) that handle presses, then you can see the 5 input handlers handling the release.
(2023-11-17, 13:12)janweinreich Wrote: I'm gonna try setting up two controllers now.

Let me know how it goes, and if one or both work in the menu but not in the game, then definitely sideload the latest v20 with the android controller fix.

Ah yes! Thank you! Latest V20 nightly fixed both the menu and two controller input. It is seamless now.
I noticed that genplus won't pickup the second controller but picodrive will do it perfectly.
Gonna fiddle around some more.

I saw you were collecting controller mappings to include them into the Kodi releases. Can I help with mappings for shield tv controllers or is this not needed anymore? Or anything else I could help with for that matter?

Cheers
Reply
#26
(2023-11-18, 14:53)janweinreich Wrote: I saw you were collecting controller mappings to include them into the Kodi releases. Can I help with mappings for shield tv controllers or is this not needed anymore? Or anything else I could help with for that matter?

Yes, we collect as many controller maps as we can. The benefit of contributing yours is that you'll never have to map controllers again.

Open a PR at https://github.com/xbmc/peripheral.joystick

If you can't open a PR, then upload the XML data to a pastebin site and post the filename, and I'll create the PR for you.
Reply
#27
(2023-11-19, 01:29)garbear Wrote:
(2023-11-18, 14:53)janweinreich Wrote: I saw you were collecting controller mappings to include them into the Kodi releases. Can I help with mappings for shield tv controllers or is this not needed anymore? Or anything else I could help with for that matter?

Yes, we collect as many controller maps as we can. The benefit of contributing yours is that you'll never have to map controllers again.

Open a PR at https://github.com/xbmc/peripheral.joystick

If you can't open a PR, then upload the XML data to a pastebin site and post the filename, and I'll create the PR for you.

Here's my xml.

Although I suspect it got populated automagically.

https://pastebin.com/TeYnkqVt
Reply
#28
(2023-11-21, 02:00)janweinreich Wrote:
(2023-11-19, 01:29)garbear Wrote:
(2023-11-18, 14:53)janweinreich Wrote: I saw you were collecting controller mappings to include them into the Kodi releases. Can I help with mappings for shield tv controllers or is this not needed anymore? Or anything else I could help with for that matter?

Yes, we collect as many controller maps as we can. The benefit of contributing yours is that you'll never have to map controllers again.

Open a PR at https://github.com/xbmc/peripheral.joystick

If you can't open a PR, then upload the XML data to a pastebin site and post the filename, and I'll create the PR for you.

Here's my xml.

Although I suspect it got populated automagically.

https://pastebin.com/TeYnkqVt

Can you post the XML filename so I know what to call it?
Reply
#29
Actually, don't we already ship this button map?

https://github.com/xbmc/peripheral.joyst...23b_8a.xml
Reply
#30
(2023-11-21, 23:27)garbear Wrote: Actually, don't we already ship this button map?

https://github.com/xbmc/peripheral.joyst...23b_8a.xml

You most definitely do.

Thanks for your time and efforts!
Reply

Logout Mark Read Team Forum Stats Members Help
How to use two XBOX Wireless Controller with Kodi Game?1