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

Input doesn't work anymore #22

Closed
1 of 7 tasks
KOPRajs opened this issue Jun 23, 2021 · 16 comments
Closed
1 of 7 tasks

Input doesn't work anymore #22

KOPRajs opened this issue Jun 23, 2021 · 16 comments

Comments

@KOPRajs
Copy link

KOPRajs commented Jun 23, 2021

It seems that the input is broken in the current Matrix version (22.0.0.19). Manually downgrading the add-on to the previous version from Leia repository (22.0.0.9) makes it work again (even on Matrix 19.1). Other emulators work as usual.

Quick search through the latest changes reveals this suspicious commit:
libretro/pcsx_rearmed@3113123

Also please note that the related pad1type, pad2type etc. were removed from settings in this PR.

Related upstream PRs:
libretro/pcsx_rearmed#472
libretro/pcsx_rearmed#475

These were applied to a version 22.0.0.16, so it probably doesn't work from that version on.

No input means no fun so the emulator is useless now.

EDIT: It looks like in Retroarch there is now some kind of common menu for controller type settings which we are missing in Retroplayer. This issue actually seems related as there is also controller type missing in the core options and it is now being set by the frontend instead: kodi-game/game.libretro.genplus#11

To Reproduce

Steps to reproduce the behavior:

  1. Load any game
  2. Press any button
  3. Nothing happens

Debuglog

The debuglog can be found here:

Screenshots

Here are some links or screenshots to help explain the problem:

Your Environment

Used Operating system:

  • Android
  • iOS
  • Linux
  • OSX
  • Raspberri-Pi
  • Windows
  • Windows UWP

Operating system version/name:

Kodi version: 19.1 (LibreELEC running on Rockchip RK3399)

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@KOPRajs KOPRajs changed the title [regression] Input doesn't work anymore Input doesn't work anymore Jun 23, 2021
@garbear
Copy link
Member

garbear commented Jun 23, 2021

Sounds like there's work to do now. Unfortunately I'm busy with work atm. Do you know anyone who could update our input handling? It might be a while before I'm able to sink time into Kodi.

@KOPRajs
Copy link
Author

KOPRajs commented Jun 25, 2021

Sorry I don't, but first lets elaborate a bit on how it works and what exactly should be done.

Here is what I've found so far, but I'm not sure if everything is correct. Please correct any bad assumptions:

Basic information:

  1. There are generic device classes defined by libretro.h, e.g. RETRO_DEVICE_NONE, RETRO_DEVICE_JOYPAD, RETRO_DEVICE_ANALOG etc.
  2. And there can be some kind of sub-classes defined by the core itself, e.g. RETRO_DEVICE_MDPAD_6B_TEAMPLAYER in https://github.com/libretro/Genesis-Plus-GX/blob/master/libretro/libretro.c.

How it works in the current version of Retroplayer:

  1. Currently the game.libretro add-on tries to set the device class based on the connected controller somehow. I have yet to find where and how exactly this happens, but it seems to fallback to RETRO_DEVICE_NONE if the class can not be fetched from the controller. The function is called from here: https://github.com/kodi-game/game.libretro/blob/2845516eecd07b4480d557d582a5377f33e1069a/src/client.cpp#L400
  2. We currently probably don't even query the core for a supported classes and sub-classes. Also we currently don't take the loaded ROM into account.
  3. Every core handles the device class differently. Some cores ignores the libretro frontend and set the class themselves in core options (like the PCSX ReARMed did until recently, the pad1type option etc.). Some cores might simply ignore it completely. And some may have their own default fallback if it is not set by the frontend correctly.

How I think it should work (needs verification). Lets look at the Genesis Plus GX for example:

  1. If the game (ROM) supports 4 players through the so called Teamplayer, we should set the device class to RETRO_DEVICE_MDPAD_6B_TEAMPLAYER.
  2. The problem is that if we set RETRO_DEVICE_MDPAD_6B_TEAMPLAYER then the games that don't support the Teamplayer (most of them) can't handle the second controller and only work with 1 player. So we need to set both ports to RETRO_DEVICE_MDPAD_6B for these games to have 2 players working. This is actually what currently happens with the Genesis Plus GX, most games can only be played in 1 player while Mega Bomberman works with 4 players (see Only 1 controller works in the game menus game.libretro.genplus#11). So I assume that somehow it currently ends up with the RETRO_DEVICE_MDPAD_6B_TEAMPLAYER class.
  3. Since it all relies on what the actual ROM supports, it needs to be configurable by the user and it seems the frontend is expected to do this by the usage of the retro_controller_info(), retro_set_controller_port_device() and the RETRO_ENVIRONMENT_SET_CONTROLLER_INFO.

@domb84
Copy link

domb84 commented Aug 28, 2021

As this still isn't working can you point me at the previous build? I can't see to find the working add on from the leia repo for RPI4. I tried the android armv7 version but it doesn't launch.

@KOPRajs
Copy link
Author

KOPRajs commented Sep 14, 2021

@notoco
Copy link

notoco commented Sep 16, 2021

With this one works.

@bondde
Copy link

bondde commented Oct 9, 2021

Hi, I was facing the same problem with my Odroid N2+ with CoreElec and Logitech cordless rumble pad. I found a workaround by fiddling with topology.xml. I removed all controllers but ps.gamepad.

<port type="controller" id="1">
  <accepts controller="game.controller.ps.gamepad"/>
</port>
<port type="controller" id="2">
  <accepts controller="game.controller.ps.gamepad"/>
</port>

@garbear
Copy link
Member

garbear commented Oct 9, 2021

@bondde Thanks for posting the workaround. The problem is that this controller exists third in topology.xml, but Kodi myopically uses the first controller listed for each port.

Fixing this was actually a big problem of mine for 2018: garbear/xbmc#87. Unfortunately I'm not done, and settled for the halfway solution of modifying topology.xml by hand.

Due to this, the current topology.xml file is equivalent to:

<?xml version="1.0" encoding="UTF-8"?>
<logicaltopology>
	<port type="controller" id="1">
		<accepts controller="game.controller.ps.dualanalog"/>
	</port>
	<port type="controller" id="2">
		<accepts controller="game.controller.ps.dualanalog"/>
	</port>
</logicaltopology>

If you want the non-analog gamepad, change topology.xml to your solution:

<?xml version="1.0" encoding="UTF-8"?>
<logicaltopology>
	<port type="controller" id="1">
		<accepts controller="game.controller.ps.gamepad"/>
	</port>
	<port type="controller" id="2">
		<accepts controller="game.controller.ps.gamepad"/>
	</port>
</logicaltopology>

@garbear
Copy link
Member

garbear commented Oct 26, 2021

I have an update. I created a "Port Setup" dialog that lets you configure the ports via GUI:

Screenshot from 2021-10-23 23-56-11

You can download test builds via https://github.com/garbear/xbmc/releases.

I also updated the PCSX topology to a flat 8 controllers:

#24

With these two changes combined, this issue should be solved.

@garbear
Copy link
Member

garbear commented Nov 12, 2021

It's done: xbmc/xbmc#20505

Test builds will be up soon.

@Killom
Copy link

Killom commented Dec 11, 2021

Any ETA on when this fix will be merged to regular Kodi/LE10 build? Also struggling here with non working input for PCSX emulator. This is driving me nuts

Possible to manually update some binaries to get this fixed? Im on LE10.0.1, RPi4

@lrusak
Copy link

lrusak commented Dec 12, 2021

Any ETA on when this fix will be merged to regular Kodi/LE10 build? Also struggling here with non working input for PCSX emulator. This is driving me nuts

Possible to manually update some binaries to get this fixed? Im on LE10.0.1, RPi4

The changes won't be backported to Kodi v19 so it will likely be a v20/LE11 thing. @garbear does manage some of his own builds but doesn't do LibreELEC.

@Killom
Copy link

Killom commented Dec 12, 2021

Any ETA on when this fix will be merged to regular Kodi/LE10 build? Also struggling here with non working input for PCSX emulator. This is driving me nuts
Possible to manually update some binaries to get this fixed? Im on LE10.0.1, RPi4

The changes won't be backported to Kodi v19 so it will likely be a v20/LE11 thing. @garbear does manage some of his own builds but doesn't do LibreELEC.

Im not really familiar with this github thing, but it looks like his fix has been merged with regular xbmc source. I've already switched to current LE11 nightly. Hopefully this will be picked up/integrated soon

@KOPRajs
Copy link
Author

KOPRajs commented Dec 13, 2021

By the time this gets matured you can still use stable LE 10 / Kodi 19 and manually install the older version of PCSX:
https://addons.coreelec.org/9.2/Amlogic/arm/game.libretro.pcsx-rearmed/game.libretro.pcsx-rearmed-22.0.0.9.2.zip

You need to disable auto-update for this add-on and install it manually from the zip.

@Killom
Copy link

Killom commented Dec 15, 2021

@KOPRajs Thanks. H264 Hardware decoding is working now with LE11 on RPi4, don't want to go back. 😄 Where / How do I see, if this fix is finally integrated into master branch?

@garbear
Copy link
Member

garbear commented Jan 17, 2022

Everything should be good-to-go in the master branch. I also updated my test builds at https://github.com/garbear/xbmc/releases. I can do LE builds if requested.

@KOPRajs
Copy link
Author

KOPRajs commented Feb 2, 2023

This can be probably also closed as fixed by the port setup in Nexus now.

@lrusak lrusak closed this as completed Feb 2, 2023
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

7 participants