Android Problem mapping my controller on Kodi for Android
#1
Hi, I've been using Kodi for years, but this is my first post here.

I'm having a problem using a gamepad with Kodi on Android. The problem I'm having is that I can't correctly map the gamepad keys to use it on Kodi and on emulators within Kodi.

What happens is that before using the settings to configure the controller, most of the buttons on the controller seem to do the same action (not the arrow keys which don't work), to enter a section or menu. When I go to settings to configure the controller, I can't properly map all the buttons. The arrow keys work correctly, but all the other buttons don't. I press on the screen the button I want to configure, then I press it on the controller, but when it automatically goes to the next button it doesn't work. I have to configure the buttons one by one. It's strange and I think this behavior is important to understand what's going on. Then after mapping all the buttons on the controller, the behavior of all the buttons is the same as before, most of the buttons perform the same action, but now the arrow keys work correctly.

My controller is a generic one that looks like a PS2 controller, it's a wireless/USB controller connected with USB to my Android phone. There's not much to say about it, I've had it for a few years, I bought it on Aliexpress but I haven't used it much. Kodi detects it as "ShanWan USB WirelessGamepad". Since it's a USB controller, I have also used it on my PC and it works perfectly on Windows 11 and Ubuntu 22.04.3. In both cases I'm also using it with Kodi and I have no problems. The problem is only present on Android.

I also tested the controller on a clean setup (uninstalled the app and deleted all data) on my phone (Samsung Galaxy S20 FE), and also on an older setup on an older phone (Samsung Galaxy S10) that I haven't used in a while. I had the same problem in both cases. Also, I tested the same controller with other apps on my phone and it works fine, I can map all the buttons correctly. It's only with Kodi for Android this controller doesn't work correctly. Also, I have another controller (bluetooth) and works good in my phone, so the problem only happens with the one specific controller.

I'm using Kodi 20.2 for Android, installed from the Google Play Store.

Since I did everything I could think of I'm now here asking for someone's help, if anyone have any idea of what I could do I'd appreciate any help.


TL;DR: I can't setup my controller on Kodi for Android, but the controller works fine for everything else.

System information
Samsung Galaxy S20 FE
Android 13
Kodi 20.2
Controller: ShanWan USB WirelessGamepad

This is the log file from when I tried to use a clean setup. At lines 358 and after you can see what I think happened when I was trying to map the controller buttons. If there's anything else I could do to have more information that could help you help me please tell let me know.
Reply
#2
I took a look at your debug log. I see:

Code:

info <general>: Register - new joystick device registered on android->android/inputdevice/11: ShanWan USB WirelessGamepad (2563:0523)

So Kodi detects the controller correctly.

Then I see:

Code:

error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (b) conflicts with key "enter" (a)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (x) conflicts with key "enter" (b)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (y) conflicts with key "enter" (x)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (start) conflicts with key "enter" (y)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (back) conflicts with key "enter" (start)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (leftthumb) conflicts with key "enter" (back)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (rightthumb) conflicts with key "enter" (leftthumb)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (leftbumper) conflicts with key "enter" (rightthumb)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (rightbumper) conflicts with key "enter" (leftbumper)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (lefttrigger) conflicts with key "enter" (rightbumper)
error <general>: AddOnLog: peripheral.joystick: game.controller.default: key "enter" (righttrigger) conflicts with key "enter" (lefttrigger)

The "key" part means that Android is doing something weird - it's sending both keyboard and joystick button presses (or maybe only keyboard presses). This is probably to allow for games that only support keyboards or only support joysticks. However, because Kodi supports both, you get this conflict which breaks the controller.

Without a similarly misbehaving controller there's not much I can do to fix the problem, but maybe if you upload a debug log of a clean install going through the button mapper (controller configuration utility). The button mapper logs a lot of extra information and we might be able to get a better idea of how the key presses are interfering with joystick buttons.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#3
Hi, thanks for your answer. Sorry that it took me so long to write back.

The part of the log that you said it's me traying to map every key, so it seems that its detecting all of the controller's keys as "enter".

I did what you said, uninstalled kodi, installed again and enabled debug log. Then I tried to map the controller again, this is the new log file when I did that. Sorry for the long log file, I forgot where the option to map a new controller was, so a lot of the log may be me trying to find my way into the configuration menu.

Please let me know if what I did is ok, or if there is anything else I can do to have more information.

Thanks again for helping me.
Reply
#4
I created a fix for Kodi to ignore virtual controllers: https://github.com/xbmc/xbmc/pull/24382

The fix will be included in v20.3 and v21 Beta 3.

The fix is included in my latest round of test builds: https://github.com/garbear/xbmc/releases
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#5
Thank you very much for fixing this! I was resigned to the fact that I wasn't going to be able to use the controller. I'll try this when I have some time to do it and I'll let you know how it goes.
Reply
#6
(2024-01-15, 11:41)LindsayCollins Wrote: It's exactly the same problem I was having, I fixed it by downloading another version of Kodi on apkclasico
Can you download this from an android tv? Also which version did u get
Reply
#7
The fix for Android controllers has made it into the new release, v20.3. Can you give that a try?
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#8
(2024-01-16, 02:33)garbear Wrote: The fix for Android controllers has made it into the new release, v20.3. Can you give that a try?

How r u doing gar, I’m having the same issue but on a ps4 controller. I fresh installed the 20.3 nexus and am still having the same issue. Controller works in kodi fine, but on games any button I press brings up the menu. I tried directly connecting the controller and tried my other 2 DualShocks with no luck. I added pics in my previous post if that helps
Reply
#9
A debug log would help, as that contains the info I need to figure out why input isn't working.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#10
(2024-01-16, 10:39)garbear Wrote: A debug log would help, as that contains the info I need to figure out why input isn't working.

Copy. Can I use the kodi log file uploader?
Reply
#11
(2024-01-16, 10:39)garbear Wrote: A debug log would help, as that contains the info I need to figure out why input isn't working.

I just sent a direct message with the log file. Appreciate the help!
Reply
#12
Hi garbear!

I think the fix broke something. I installed the latest version of Kodi from the play store, it says it's the version 20.3 as you said. I tried mapping the controller again, but it isn't working. When I connect the controller something is working but not everything. The action of most buttons keeps being the same, but now the arrows are working (I call it progress), but now the mapping menu doesn't work at all. When I try to map a button it makes an action, it isn't recording the button.

I did a clean installation and here is the log file of what I did.

Also, I have another controller that it is connected by bluetooth, it stopped working for games after this update (I can still use the arrows, joystick, anter and go back from any menu, but any button stops the games), and the mapping isn't working either.

Thank you very much for your help!
Reply
#13
I'm bringing together all recent Android controller support threads: https://forum.kodi.tv/showthread.php?tid=376084

Please bring further help debugging these issues to that thread!
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#14
@matrix82 Can you test again with my latest 2024-01-29 build? I think I've got most Android bugs figured out, want to make sure your setup works with it. And bring results to the new thread! https://forum.kodi.tv/showthread.php?tid=376084
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#15
Hi @garbear, sorry it took me so long to answer, I've been really busy. I'll post an answer in the new thread
Reply

Logout Mark Read Team Forum Stats Members Help
Problem mapping my controller on Kodi for Android0