Solved Games on Kodi 20.1 on Philips TV Android 10 - game controls don't work
#1
I have a Philips 65OLED706 Android (10) TV with Kodi 20.1 installed. I installed SNES emulator and connected my Xbox One controller via bluetooth to my TV. I can control Kodi interface with my controller with no problems, but in game controls don't work - only B and View button work - both of them gets you back to the Kodi interface. I cannot control the game no matter what I do.

There is another guy that reported the same issue with Kodi 20.1 and Philips 55OLED706: https://www.reddit.com/r/kodi/comments/1...ow_to_stop
Quote:I've been using Kodi for playing videos saved on my NAS and have been very happy with that. Now I'm trying to set it up so that I can emulate some older games (Gameboy Color, Advance, PS1 etc) run on my Philips OLED TV (55OLED706, Android TV 10), using a Switch Pro Controller. However, while I was able to configure the controller successfully and can navigate the Kodi menus with it, as soon as I start playing a game, none of the button inputs control the video game.

The only button that works is the B button, which stops the game and opens the Kodi menu. I've tried disabling the toggle "controller navigation" in the Kodi input configuration, but while that stops the controller from navigating the Kodi menus, if I launch a game with the TV remote or my Bluetooth keyboard, none of the controller inputs cause any in-game actions either.
Apparently he managed to get it working by downgrading Kodi:
Quote:The strange thing is, I have since uninstalled Kodi 20.1 and installed 18.9 and it works perfectly there. Still using Switch Pro controller.

Edit: to give slightly more details for other people who are affected, in 18.9, when I launch a game for the first time after setting up the controller, it will also still be bound to the Kodi menu, so all that can be done is pressing B to exit the game. From the second game launch on though, all controller buttons (except for home) control the game rather than Kodi.

I have fiddled with Kodi settings - unsuccessfully. I have also tried with Logitech F710 (with USB dongle) and the problem is exactly the same. After I read the post on Reddit, I've installed the same SNES emulator on my bedroom TV with Google Chromecast with Google TV (4K version), where I have installed the same version of Kodi, connected the Xbox controller via bluetooth to the Google TV and the in-game control work flawlessly (without any special configuration - just installed the emulator and mapped the controller keys for SNES controller).

So it's probably some specific thing with (this series of) Philips Android TVs and with this version of Kodi. I would love to get this resolved, be it with some specific config/workaround or with a fix for future versions.
Reply
#2
(2023-06-07, 18:06)c1c3r0 Wrote: So it's probably some specific thing with (this series of) Philips Android TVs and with this version of Kodi. I would love to get this resolved, be it with some specific config/workaround or with a fix for future versions.

The story of controller input in Kodi is dealing with quirks like these, something I affectionately refer to as "joystick driver fuckery".

To hunt down future joystick driver quirks I've added lots of logging to the debug log. Can you post a debug log showing the controller being connected and input not working?

I suspect the issue is because Android tries to be "helpful" and send keyboard input instead of controller input to deal with misbehaving Android apps. We'll be able to see for sure once the debug log is uploaded.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#3
Laugh
logfile: https://paste.kodi.tv/aseheniqoz

Started Kodi fresh, navigated to the game using controller, started it, pressed a couple of the buttons on the controller: Left thumbstick press brouht up Kodi preferences menu, right thumbstick brought up Power menu, B button exited the game towards the end. Other button presses didn't work. After I exited the game with button B, I navigated to logile upload with USB keyboard.

Thanks!
Reply
#4
I've found the source of the problem. Android finds the following joysticks:

Code:
debug <general>: Initialise - initialised peripheral on 'android/inputdevice/8' with 1 features and 0 sub devices
info <general>: Register - new joystick device registered on android->android/inputdevice/8: TPV_SMTRC (0000:0000)

debug <general>: Initialise - initialised peripheral on 'android/inputdevice/11' with 1 features and 0 sub devices
info <general>: Register - new joystick device registered on android->android/inputdevice/11: virtual-search (18D1:0100)

debug <general>: Initialise - initialised peripheral on 'android/inputdevice/16' with 1 features and 0 sub devices
info <general>: Register - new joystick device registered on android->android/inputdevice/16: Wireless Air mouse Keyboard (1997:1221)

debug <general>: Initialise - initialised peripheral on 'android/inputdevice/17' with 1 features and 0 sub devices
info <general>: Register - new joystick device registered on android->android/inputdevice/17: virtual-remote (18D1:0100)

debug <general>: Initialise - initialised peripheral on 'android/inputdevice/18' with 1 features and 0 sub devices
info <general>: Register - new joystick device registered on android->android/inputdevice/18: Xbox Wireless Controller (045E:0B20)

When Kodi starts the game, it chooses two of the "virtual" joysticks for ports 1 and 2:

Code:
debug <general>: Failed to load button map for "android/inputdevice/11"
debug <general>: Failed to load button map for "android/inputdevice/16"

Can you check the connected peripherals and see if these virtual joysticks appear? Settings -> System -> Input -> Peripherals

Looking closer, I found an error in the logic that selects controllers for ports. My latest builds fix the logic: https://github.com/garbear/xbmc/releases. Can you give that a try?

If the Xbox controller still isn't selected for Port 1, then I'll reinvestigate the controller selection logic and update it so that the Xbox controller is chosen for the first port.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#5
Installed provided version, but it does not work - no changes, behavior is same as before.

Logfile (if needed): https://paste.kodi.tv/wiwoxabifa

Peripherals:
- TPV_SMTRC
- virtual-search
- Wireless Air mouse Keyboard
- virtual-remote
- Xbox Wireless Controller


Thank you for your help.
Reply
#6
Thanks for confirming that the problem still exists in my test builds. That means I don't just need to tweak the logic, I need a fundamentally new approach.

The approach I took in <= v19 was to sort joysticks by the time since last (digital) button press. This ensured that the "virtual" joysticks wouldn't find their way into lower ports. However, it also means that the player assignment is unstable, because essentially whoever starts the game gets P1, with the next most-recently-active getting P2, etc, and this changes on every game launch.

Ultimately I plan to implement a "Player Manager" to assign players to ports, but this is still a work-in-progress.

I merged a portion of the Player Manager into v20, which is why the behavior changed. What if we revert to the v19 behavior in the meantime? Do you see any downsides to sorting by most-recently-used-controller?
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#7
Okay, thanks for explaining it. I did find Player Manager while searching for solution and kind of thought it's going to be solution for this my problem too when eventually released.

I don't see any downsides with this kind of sorting - speaking for the function itself and for my scenario only. I cannot speak for general public if you plan to release it as a production version ... I do not have enough overview about this to know if it'll cause any (major) issues to others. If yes, then I believe it would be best not to do that Smile
Reply
#8
I did some more digging and discovered that in v19 we sorted controllers by last activated time, but in v20 when I pulled in some Player Manager work, I accidentally overwrote this behavior with some unfinished logic.

Therefore, I'm restoring the v19 behavior, which will fix the problem in the OP: https://github.com/xbmc/xbmc/pull/23482

You can try the fix in my latest round of test builds: https://github.com/garbear/xbmc/releases

I added some logging whenever the players change:
 
Code:
debug <general>: ===== Peripheral Map =====
debug <general>: /1/game.controller.snes.mouse:
debug <general>:     peripheral.joystick/0 [Xbox 360-compatible controller]
debug <general>:
debug <general>: /2/game.controller.snes.multitap/1/game.controller.snes:
debug <general>:     peripheral.joystick/1 [Xbox 360-compatible controller]
debug <general>:
debug <general>: /2/game.controller.snes.multitap/2/game.controller.snes:
debug <general>:     peripheral.joystick/2 [Xbox 360-compatible controller]
debug <general>:
debug <general>: /2/game.controller.snes.multitap/3/game.controller.snes:
debug <general>:     peripheral.joystick/3 [Xbox 360-compatible controller]
debug <general>:
debug <general>: /2/game.controller.snes.multitap/4/game.controller.snes:
debug <general>:     peripheral.joystick/4 [Wireless Controller]
debug <general>: ==========================

In order to test, I've added a new window to my test builds based on a read-only version of the Player Manager, which I call the "View Players" window:

Image

It opens a window that shows the current player map:

Image

Selecting "Ports" opens the Port Dialog to let you configure the ports:

Image

For example, then the Multitap is replaced with a SNES controller, the "View Players" window is updated like this:

Image

Can you give the latest test build a try and see if it fixes the original problem for you?
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#9
It works perfectly.

Is this fix going to be included in next official update (just to know if I should avoid it)?

What can I say...Thank you a hundred times. Please let me know if I can help in any way - now or in the future - I'd be glad to do some testing if needed.
Reply
#10
Thread marked solved.
Reply
#11
One thing: When starting Kodi, I'm getting pop-up: Failed to install add-on: Shader preset support (Add-on couldn't be loaded. An unknown error has occurred.)
Reply
#12
Can you give my 2023-07-08 builds a try and see if it fixes the Shader preset support error? If not, can you post a debug log?
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#13
Installed provided build and the error is still there upon startup.

Logfile: https://paste.kodi.tv/utuhefojik
Reply
#14
Thanks for providing a debug log. I've discovered that the error is in the code we "repurposed" from RetroArch (using the appropriate license) for the GSoC 2017 shaders project. This is an area of the code that hasn't held up well in the 6 years since the shader add-on was written. We'll need to redo the repurposing process, or at least hack around the bug. I'll see if I can (likely) easily hack around the bug or (less likely) redo the shader preset loading code.

In the meantime, you should disable the shader preset add-on in the add-on manager to prevent the error. Can you confirm that disabling the shader preset add-on removes the error?

The log lines are:

Code:
debug <general>: CreateAddon - creating ShaderPreset add-on instance 'Shader Preset Support'
debug <general>: ADDON: Dll Initializing - Shader Preset Support
debug <general>: SECTION:LoadDLL(/data/app/~~DYoeJGX7HvutLshawLHFdQ==/org.xbmc.kodi-q3sfE2QOIhD2myKV7OcS5A==/lib/arm/libgame.shader.presets.so)
debug <general>: Loading: /data/app/~~DYoeJGX7HvutLshawLHFdQ==/org.xbmc.kodi-q3sfE2QOIhD2myKV7OcS5A==/lib/arm/libgame.shader.presets.so
error <general>: Unable to load /data/app/~~DYoeJGX7HvutLshawLHFdQ==/org.xbmc.kodi-q3sfE2QOIhD2myKV7OcS5A==/lib/arm/libgame.shader.presets.so, reason: dlopen failed: cannot locate symbol "RARCH_ERR" referenced by "/data/app/~~DYoeJGX7HvutLshawLHFdQ==/org.xbmc.kodi-q3sfE2QOIhD2myKV7OcS5A==/lib/arm/libgame.shader.presets.so"...
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#15
Yes, disabling it does remove the error on startup.

Thanks again for everything.
Reply

Logout Mark Read Team Forum Stats Members Help
Games on Kodi 20.1 on Philips TV Android 10 - game controls don't work0
This forum uses Lukasz Tkacz MyBB addons.