Player 2 Controls show as Player 1

Discussion of keyboards, gamepads, joysticks and other input related peripherals.
User avatar
DackR
Posts: 3
Joined: Sun Sep 13, 2020 6:04 pm

Player 2 Controls show as Player 1

Unread post by DackR »

I've been trying to figure this out for a couple days now with no luck, so I thought I'd ask the question to see if anyone here has an answer.

I'm using a generic usb controller purchased from Amazon several years ago. It appears to be a Xin-Mo clone device.

The device shows up in the uart debug console as "TTT THT Arcade console 2P USB Player." The device/joystick ID is 16c0:05e1.

The problem is that it is showing up as a single joystick and all buttons are mapping to player 1.

I found some posts about this from other individuals trying to get this working in other flavors or linux including some retropie and ubuntu users. In their case, they simply added a quirk to the kernel command line.

I tried adding a u-boot.txt to the /linux/ folder on the sd card with the following line:
usbhid.quirks=0x16c0:0x05e1:0x040
I can see by watching the uart console output that this file is loaded, but it doesn't appear to affect anything. Still mapping P2 buttons as P1 and only a single device is listed by the console.

I checked for loaded quirks by running:
cat /sys/module/usbhid/parameters/quirks
This returns:
(null),(null),(null),(null)
At this point, I am not sure what steps I would need to take to figure out where the problem is. Hopefully someone here has dealt with this issue before and is kind enough to render assistance. Thanks for reading.
paulbnl
Posts: 148
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 14 times
Been thanked: 66 times

Re: Player 2 Controls show as Player 1

Unread post by paulbnl »

That quirk is already integrated into the kernel. https://github.com/MiSTer-devel/Linux-K ... rks.c#L169

Try the MiSTer.ini no_merge settings: https://github.com/MiSTer-devel/Main_Mi ... r.ini#L114
User avatar
DackR
Posts: 3
Joined: Sun Sep 13, 2020 6:04 pm

Re: Player 2 Controls show as Player 1

Unread post by DackR »

Thanks for responding paulbnl! I appreciate it. :)

I went ahead and removed my u-boot.txt file since the quirk is already integrated.

I've gone ahead and tried the no_merge settings. Still no luck. This controller seems to want to merge P1&P2 no matter what I try. (I do want to mention here that when the controller is connected to my windows machine, it functions correctly.)

Here's my current mister.ini:

Code: Select all

[MiSTer]
;VIDEO MODE
video_mode = 5
;VIDEO SETTINGS
menu_pal = 0
dvi_mode = 0
fb_terminal = 1
fb_size = 0
video_info = 0
hdmi_limited = 0
vsync_adjust = 0
;VGA SETTINGS
forced_scandoubler = 1
ypbpr = 0
composite_sync = 0
vga_scaler = 1
direct_video = 0
;VIDEO SCALING
vscale_mode = 0
vscale_border = 0
;AUDIO SETTINGS
hdmi_audio_96k = 0
volumectl = 1
;CUSTOM FONT
font = font/Misc_Chicago.pf
;MISC SETTINGS
key_menu_as_rgui = 0
rbf_hide_datecode = 1
;bootscreen = 0
recents = 1
keyrah_mode = 0x18d80002
reset_combo = 0
osd_timeout = 30
bootcore_timeout = 10
no_merge_vid=0x16c0
no_merge_pid=0x05e1
; tried with and without no_merge_pid specified. still not working for me.
;16c0:05e1
; 1-10 (seconds) to display controller's button map upon first time key press
; 0 - disable
controller_info=6
Here's the uart console output after I remove the usb device and plug it back in:

Code: Select all

Open up to 30 input devices.
opened 0( 0): /dev/input/event1 (16c0:05e1) 0 "usb-ffb40000.usb-1.3/input0/0/0" "TTT THT Arcade console 2P USB Player"
The file js0 was deleted.
Close all devices.
Open up to 30 input devices.
The file event1 was deleted.
The directory by-id was deleted.
The directory by-path was deleted.
Close all devices.
Open up to 30 input devices.
The file js0 was created.
Close all devices.
Open up to 30 input devices.
The file event1 was created.
The directory by-id was created.
The directory by-path was created.
Close all devices.
Open up to 30 input devices.
opened 0( 0): /dev/input/event1 (16c0:05e1) 0 "usb-ffb40000.usb-1.3/input0/0/0" "TTT THT Arcade console 2P USB Player"
Is there anything else that I can look at trying, or will I need to break down and buy some arduino micros?
paulbnl
Posts: 148
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 14 times
Been thanked: 66 times

Re: Player 2 Controls show as Player 1

Unread post by paulbnl »

Strange, so even with the quirk the kernel still merges it into 1 device. It seems your clone device is slightly different and not supported by the kernel.

As a last resort you can try to add the quirk to u-boot.txt again. Apparently the quirks are not added without the v=loglevel=4 part.

Code: Select all

v=loglevel=4 usbhid.quirks=0x16c0:0x05e1:0x040
cat /sys/module/usbhid/parameters/quirks should output

Code: Select all

0x16c0:0x05e1:0x040,(null),(null),(null)
User avatar
DackR
Posts: 3
Joined: Sun Sep 13, 2020 6:04 pm

Re: Player 2 Controls show as Player 1

Unread post by DackR »

paulbnl wrote: Tue Sep 15, 2020 12:56 pm Strange, so even with the quirk the kernel still merges it into 1 device. It seems your clone device is slightly different and not supported by the kernel.

As a last resort you can try to add the quirk to u-boot.txt again. Apparently the quirks are not added without the v=loglevel=4 part.

Code: Select all

v=loglevel=4 usbhid.quirks=0x16c0:0x05e1:0x040
cat /sys/module/usbhid/parameters/quirks should output

Code: Select all

0x16c0:0x05e1:0x040,(null),(null),(null)
Thanks for the extra things to try! I ended up just buying a couple arduino micros and programming them with the daemonbyte arcade encoder. Cheap, and much easier to set up. I might give this a try once I start building my second mister project.
dizzeee
Posts: 3
Joined: Sat Jul 10, 2021 8:55 am
Has thanked: 1 time

Re: Player 2 Controls show as Player 1

Unread post by dizzeee »

Hi DackR,

ive got the same problem, or at least kind of.

Ive installed, like you mentioned, two arduino micros, programmed them, and got the problem, that one player controls work fine, the other are broken and do not do what they were programmed to.

What have you done to get it working?

Regards

-----> Forget everything i wrote. Problem solved itself, when i looked at the conroller harness wiring -> problem solved
Post Reply