iCode
Creatures
Posts: 18
|
Post by iCode on Jan 4, 2021 7:32:42 GMT
Hello everyone. I am new to this forum and look forward to contributing. I've been hacking and designing gadgets for retro systems for last year or so and recently had many people ask me if some of my USB devices are compatible with the mini or maxi. As a kid, I had a VIC 20 but to be honest I spent most of my time on Atari 8bit computers. Always wanted a C64 but could not afford it as a kid and Atari was gifted to me. Anyways, with so many people asking me recently about maxi/mini compatibility, I got my self a c64 Mini so I try our some of my controllers. I have 2 port, 4 port, and even Wireless Bluetooth models that work great with RetroPi and Windows. You can see the different models here: www.icode.com So I gave it a shot today and being new to the C64 mini, I was a bit disappointed because the units did not work with the mini at first. Then I learned about carousel and gamecontrollerdb.txt files and I was partially able to succeed but its still a mystery and this is where I I am hoping to get some help form any expert in the community. It turns out that I could get 1 port working if I used VID/PID combination of "0x22BA", "0x1020" respectively in my code. this works even without editing any gbd text files. Problem comes with multiple controllers. Linux only supports multiple HIDs on a single usb via a quirk flag HID_QUIRK_MULTI_INPUT set in its hid-ids list. By looking at github.com/.../blob/master/drivers/hid/hid-quirks.c I was able to identify all the VID/PID combinations that have the flag set. I typically use "0x8282","0x3201" combinations but mini would not see it out of the box. I know this combination works in Linux because in RetroPi, dev/input directory shows all 4 js0-js3 listed and jstest on each work perfectly. In reviewing the c64 mini/maxi gamecontrollersdb.txt file on Carousel, none of them are preset in the file match ones that support multi-hids. So It looks like no out of box solution without editing the gamecontrollersdb.txt file and using Carousel. So I added my combinations to the file as: 03000000828200000132000001010000,Retro Joystick Adapter,a:b3,b:b4,x:b5,y:b6,back:b2,righttrigger:b1,lefttrigger:b0,leftx:a0,lefty:a1,platform:Linux, And sure enough, the mini saw my device but unfortunately it only seems to see js3 and the buttons are not mapped correctly and axis don't work, even though i know they are set correctly. I even checked in SDL2 tool. So not sure what to do next other than running xvm which i was hoping not to have to learn yet. I bet it will still show jstest working. Any ideas anyone would be helpful. Any experts out there? I can send you a free 4 port adapter if you can help me figure this thing out. Thanks in advance. Looks like a great community!
|
|
|
Post by jj0 on Jan 4, 2021 10:19:11 GMT
Hello everyone. I am new to this forum and look forward to contributing. I've been hacking and designing gadgets for retro systems for last year or so and recently had many people ask me if some of my USB devices are compatible with the mini or maxi. As a kid, I had a VIC 20 but to be honest I spent most of my time on Atari 8bit computers. Always wanted a C64 but could not afford it as a kid and Atari was gifted to me. Anyways, with so many people asking me recently about maxi/mini compatibility, I got my self a c64 Mini so I try our some of my controllers. I have 2 port, 4 port, and even Wireless Bluetooth models that work great with RetroPi and Windows. You can see the different models here: www.icode.com So I gave it a shot today and being new to the C64 mini, I was a bit disappointed because the units did not work with the mini at first. Then I learned about carousel and gamecontrollerdb.txt files and I was partially able to succeed but its still a mystery and this is where I I am hoping to get some help form any expert in the community. It turns out that I could get 1 port working if I used VID/PID combination of "0x22BA", "0x1020" respectively in my code. this works even without editing any gbd text files. Problem comes with multiple controllers. Linux only supports multiple HIDs on a single usb via a quirk flag HID_QUIRK_MULTI_INPUT set in its hid-ids list. By looking at github.com/.../blob/master/drivers/hid/hid-quirks.c I was able to identify all the VID/PID combinations that have the flag set. I typically use "0x8282","0x3201" combinations but mini would not see it out of the box. I know this combination works in Linux because in RetroPi, dev/input directory shows all 4 js0-js3 listed and jstest on each work perfectly. In reviewing the c64 mini/maxi gamecontrollersdb.txt file on Carousel, none of them are preset in the file match ones that support multi-hids. So It looks like no out of box solution without editing the gamecontrollersdb.txt file and using Carousel. So I added my combinations to the file as: 03000000828200000132000001010000,Retro Joystick Adapter,a:b3,b:b4,x:b5,y:b6,back:b2,righttrigger:b1,lefttrigger:b0,leftx:a0,lefty:a1,platform:Linux, And sure enough, the mini saw my device but unfortunately it only seems to see js3 and the buttons are not mapped correctly and axis don't work, even though i know they are set correctly. I even checked in SDL2 tool. So not sure what to do next other than running xvm which i was hoping not to have to learn yet. I bet it will still show jstest working. Any ideas anyone would be helpful. Any experts out there? I can send you a free 4 port adapter if you can help me figure this thing out. Thanks in advance. Looks like a great community! It looks to me you need to see what the Mini is doing. With XWM (really, it's the easiest way to access a Mini command shell, and there's an evtest GUI joystick test program as well) you can verify what/which input devices the Mini is creating. Or if you're more comfortable with connecting the Mini's UART (with either a USB2Serial converter or to the serial port pins on the Pi GPIO) you can access it that way as well. But if you consider me enough of an expert I'd be happy to help you out and try your adapter. (edit) I checked the USB devices with HID_QUIRK_MULTI_INPUT in the kernel source of the Mini and searched for the associated VID's and PID's: jeroen@LT-JEROEN:~/Downloads/C64/THEC64_Mini/SDK/A20/C64OSS/linux-3.4/drivers/hid/usbhid$ grep -r "HID_QUIRK_MULTI_INPUT" hid-quirks.c: { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET }, hid-quirks.c: { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_NEXTWINDOW, USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN, HID_QUIRK_MULTI_INPUT}, hid-quirks.c: { USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_ETURBOTOUCH, USB_DEVICE_ID_ETURBOTOUCH, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_GREENASIA, USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, hid-quirks.c: { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_TOUCHPACK, USB_DEVICE_ID_TOUCHPACK_RTS, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWA60, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT }, hid-quirks.c: { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT }, jeroen@LT-JEROEN:~/Downloads/C64/THEC64_Mini/SDK/A20/C64OSS/linux-3.4/drivers/hid/usbhid$ grep -e USB_VENDOR_ID_DWAV -e USB_VENDOR_ID_MOJO -e USB_VENDOR_ID_HAPP -e USB_VENDOR_ID_NEXTWINDOW -e USB_VENDOR_ID_EMS -e USB_VENDOR_ID_ETURBOTOUCH -e USB_VENDOR_ID_GREENASIA -e USB_VENDOR_ID_PANTHERLORD -e USB_VENDOR_ID_PLAYDOTCOM -e USB_VENDOR_ID_TOUCHPACK -e USB_VENDOR_ID_UCLOGIC -e USB_VENDOR_ID_WALTOP -e USB_VENDOR_ID_WISEGROUP -e USB_VENDOR_ID_CHICONY -e USB_VENDOR_ID_KYE ../hid-ids.h #define USB_VENDOR_ID_CHICONY 0x04f2 #define USB_VENDOR_ID_DWAV 0x0eef #define USB_VENDOR_ID_EMS 0x2006 #define USB_VENDOR_ID_ETURBOTOUCH 0x22b9 #define USB_VENDOR_ID_GREENASIA 0x0e8f #define USB_VENDOR_ID_HAPP 0x078b #define USB_VENDOR_ID_KYE 0x0458 #define USB_VENDOR_ID_MOJO 0x8282 #define USB_VENDOR_ID_NEXTWINDOW 0x1926 #define USB_VENDOR_ID_PANTHERLORD 0x0810 #define USB_VENDOR_ID_PLAYDOTCOM 0x0b43 #define USB_VENDOR_ID_TOUCHPACK 0x1bfd #define USB_VENDOR_ID_UCLOGIC 0x5543 #define USB_VENDOR_ID_WALTOP 0x172f #define USB_VENDOR_ID_WISEGROUP 0x0925 #define USB_VENDOR_ID_WISEGROUP_LTD 0x6666 #define USB_VENDOR_ID_WISEGROUP_LTD2 0x6677 jeroen@LT-JEROEN:~/Downloads/C64/THEC64_Mini/SDK/A20/C64OSS/linux-3.4/drivers/hid/usbhid$ grep -e USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER -e USB_DEVICE_ID_RETRO_ADAPTER -e USB_DEVICE_ID_UGCI_DRIVING -e USB_DEVICE_ID_UGCI_FLYING -e USB_DEVICE_ID_UGCI_FIGHTING -e USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN -e USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II -e USB_DEVICE_ID_ETURBOTOUCH -e USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD -e USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK -e USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII -e USB_DEVICE_ID_TOUCHPACK_RTS -e USB_DEVICE_ID_UCLOGIC_TABLET_PF1209 -e USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U -e USB_DEVICE_ID_UCLOGIC_TABLET_KNA5 -e USB_DEVICE_ID_UCLOGIC_TABLET_TWA60 -e USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U -e USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U -e USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH -e USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH -e USB_DEVICE_ID_QUAD_USB_JOYPAD -e USB_DEVICE_ID_SMARTJOY_DUAL_PLUS -e USB_DEVICE_ID_CHICONY_MULTI_TOUCH -e USB_DEVICE_ID_CHICONY_WIRELESS -e USB_DEVICE_ID_KYE_MOUSEPEN_I608X -e USB_DEVICE_ID_KYE_EASYPEN_M610X ../hid-ids.h #define USB_DEVICE_ID_CHICONY_MULTI_TOUCH 0xb19d #define USB_DEVICE_ID_CHICONY_WIRELESS 0x0618 #define USB_DEVICE_ID_CHICONY_WIRELESS2 0x1123 #define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER 0x0001 #define USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II 0x0118 #define USB_DEVICE_ID_ETURBOTOUCH 0x0006 #define USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD 0x3013 #define USB_DEVICE_ID_UGCI_DRIVING 0x0010 #define USB_DEVICE_ID_UGCI_FLYING 0x0020 #define USB_DEVICE_ID_UGCI_FIGHTING 0x0030 #define USB_DEVICE_ID_KYE_MOUSEPEN_I608X 0x5011 #define USB_DEVICE_ID_KYE_EASYPEN_M610X 0x5013 #define USB_DEVICE_ID_RETRO_ADAPTER 0x3201 #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003 #define USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK 0x0001 #define USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII 0x0003 #define USB_DEVICE_ID_TOUCHPACK_RTS 0x1688 #define USB_DEVICE_ID_UCLOGIC_TABLET_PF1209 0x0042 #define USB_DEVICE_ID_UCLOGIC_TABLET_KNA5 0x6001 #define USB_DEVICE_ID_UCLOGIC_TABLET_TWA60 0x0064 #define USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U 0x0003 #define USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U 0x0004 #define USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U 0x0005 #define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH 0x0501 #define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH 0x0500 #define USB_DEVICE_ID_QUAD_USB_JOYPAD 0x8800 #define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802
Which leads to the following summary table of USB devices with HID_QUIRK_MULTI_INPUT in the Mini's 3.4.39 kernel (resize zoom level in browser to fit): VID Text | PID Text | VID | PID | Quirks | USB_VENDOR_ID_DWAV | USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER | 0x0eef | 0x0001 | HID_QUIRK_MULTI_INPUT,HID_QUIRK_NOGET | USB_VENDOR_ID_MOJO | USB_DEVICE_ID_RETRO_ADAPTER | 0x8282 | 0x3201 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_HAPP | USB_DEVICE_ID_UGCI_DRIVING | 0x078b | 0x0010 | HID_QUIRK_BADPAD,HID_QUIRK_MULTI_INPUT | USB_VENDOR_ID_HAPP | USB_DEVICE_ID_UGCI_FLYING | 0x078b | 0x0020 | HID_QUIRK_BADPAD,HID_QUIRK_MULTI_INPUT | USB_VENDOR_ID_HAPP | USB_DEVICE_ID_UGCI_FIGHTING | 0x078b | 0x0030 | HID_QUIRK_BADPAD,HID_QUIRK_MULTI_INPUT | USB_VENDOR_ID_NEXTWINDOW | USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN | 0x1926 | 0x0003 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_EMS | USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II | 0x2006 | 0x0118 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_ETURBOTOUCH | USB_DEVICE_ID_ETURBOTOUCH | 0x22b9 | 0x0006 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_GREENASIA | USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD | 0x0e8f | 0x3013 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_PANTHERLORD | USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK | 0x0810 | 0x0001 | HID_QUIRK_MULTI_INPUT,HID_QUIRK_SKIP_OUTPUT_REPORTS | USB_VENDOR_ID_PLAYDOTCOM | USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII | 0x0b43 | 0x0003 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_TOUCHPACK | USB_DEVICE_ID_TOUCHPACK_RTS | 0x1bfd | 0x1688 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_UCLOGIC | USB_DEVICE_ID_UCLOGIC_TABLET_PF1209 | 0x5543 | 0x0042 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_UCLOGIC | USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U | 0x5543 | 0x0003 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_UCLOGIC | USB_DEVICE_ID_UCLOGIC_TABLET_KNA5 | 0x5543 | 0x6001 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_UCLOGIC | USB_DEVICE_ID_UCLOGIC_TABLET_TWA60 | 0x5543 | 0x0064 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_UCLOGIC | USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U | 0x5543 | 0x0004 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_UCLOGIC | USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U | 0x5543 | 0x0005 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_WALTOP | USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH | 0x172f | 0x0501 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_WALTOP | USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH | 0x172f | 0x0500 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_WISEGROUP | USB_DEVICE_ID_QUAD_USB_JOYPAD | 0x0925 | 0x8800 | HID_QUIRK_NOGET,HID_QUIRK_MULTI_INPUT | USB_VENDOR_ID_WISEGROUP_LTD2 | USB_DEVICE_ID_SMARTJOY_DUAL_PLUS | 0x6677 | 0x8802 | HID_QUIRK_NOGET,HID_QUIRK_MULTI_INPUT | USB_VENDOR_ID_CHICONY | USB_DEVICE_ID_CHICONY_MULTI_TOUCH | 0x04f2 | 0xb19d | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_CHICONY | USB_DEVICE_ID_CHICONY_WIRELESS | 0x04f2 | 0x0618 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_KYE | USB_DEVICE_ID_KYE_MOUSEPEN_I608X | 0x0458 | 0x5011 | HID_QUIRK_MULTI_INPUT, | USB_VENDOR_ID_KYE | USB_DEVICE_ID_KYE_EASYPEN_M610X | 0x0458 | 0x5013 | HID_QUIRK_MULTI_INPUT, | So 0x22ba does not appear to be in the 3.4.39 list but there are some others, especially the 'RETRO' (your 03000000828200000132000001010000 entry), 'DUAL', 'TWIN', and of course the 'QUAD' ones. Searching for the associated SDL ID's in gamecontrollerdb.txt: # grep -e ef0e00000100 -e 828200000132 -e 8b0700001000 -e 8b0700002000 -e 8b0700 003000 -e 261900000300 -e 062000001801 -e b92200000600 -e 8f0e00001330 -e 100800 000100 -e 430b00000300 -e fd1b00008816 -e 435500004200 -e 435500000300 -e 435500 000160 -e 435500006400 -e 435500000400 -e 435500000500 -e 2f1700000105 -e 2f1700 000005 -e 250900000088 -e 776600000288 -e f20400009db1 -e f20400001806 -e 580400 001150 -e 580400001350 /usr/share/the64/ui/data/gamecontrollerdb.txt 030000008f0e00001330000010010000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Linux, 03000000100800000100000010010000,Twin USB PS2 Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, #
Leaves tho following two that should be recognised in some way by the Mini: 0x0e8f 0x3013 USB_VENDOR_ID_GREENASIA USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD HID_QUIRK_MULTI_INPUT 0x0810 0x0001 USB_VENDOR_ID_PANTHERLORD USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK HID_QUIRK_MULTI_INPUT HID_QUIRK_SKIP_OUTPUT_REPORTS So I suggest you try these and see if you have any luck. (edit 2). Btw, the e4you RetroFun! Twin adapter identifies as two THEC64 joysticks without the VID/PID (1c59/0023) having the HID_QUIRK_MULTI_INPUT property in the 3.4.39 kernel: [ 1071.361480] generic-usb 0003:1C59:0023.0008: input: USB HID v1.10 Joystick [THEC64 Joystick THEC64 Joystick ] on usb-sunxi-ehci-1.2.2.4/input0 [ 1071.392784] generic-usb 0003:1C59:0023.0009: input: USB HID v1.10 Joystick [THEC64 Joystick THEC64 Joystick ] on usb-sunxi-ehci-1.2.2.4/input1
|
|
ender
Creatures
Posts: 39
|
Post by ender on Jan 5, 2021 7:14:04 GMT
In reviewing the c64 mini/maxi gamecontrollersdb.txt file on Carousel, none of them are preset in the file match ones that support multi-hids. So It looks like no out of box solution without editing the gamecontrollersdb.txt file and using Carousel. So I added my combinations to the file as: 03000000828200000132000001010000,Retro Joystick Adapter,a:b3,b:b4,x:b5,y:b6,back:b2,righttrigger:b1,lefttrigger:b0,leftx:a0,lefty:a1,platform:Linux, And sure enough, the mini saw my device but unfortunately it only seems to see js3 and the buttons are not mapped correctly and axis don't work, even though i know they are set correctly. I even checked in SDL2 tool. Could you share a report descriptor you are using? I might be able to replicate it with my Teensy and try to see what's happening. The HID_QUIRK_MULTI_INPUT really does nothing more than create one device node per report ID, so it's hard to see that as the culprit, specifically.
|
|
iCode
Creatures
Posts: 18
|
Post by iCode on Jan 9, 2021 3:04:24 GMT
Thanks for the analysis. I ran XWM and evtest and the gui version and both see both joysticks perfectly and it does not seem to matter what VID/PID I use. All of them get recognized in XWM. This includes the the two VID/PID combinations suggested: 0x0e8f 0x3013 and 0x0810 0x0001 For a while no matter what I did, the mini would not see the devices in carousel mode. I finally changed the gameconttollersdb.txt entry like below and like magic, it started working and it carousel saw both gamepads! from: 030000008f0e00001330000011010000,HuiJia SNES Controller,righttrigger:b3,start:b5,x:b2,a:b4,leftx:a0,lefty:a1,righttrigger:b0,platform:Linux, to: 030000008f0e00001330000001010000,HuiJia SNES Controller,righttrigger:b3,start:b5,x:b2,a:b4,leftx:a0,lefty:a1,righttrigger:b0,platform:Linux, As you can see the only difference is the 11010000 vs 01010000 at the end, unlike what this post says: thec64community.online/thread/640/add-edit-game-controller-joystickIs there a place where it explains what each of these last 8 characters do? I searched around a bit for the SDL2 and came up empty. Good news is, its finally working but only with change of the file. My goal is to get it to work without editing the controllersdb.txt file so I will continue to try a few things to try to mimic thec64 joystick to see. Wanted to report progress for now and see if anyone had more info on the details of the 8 characters?
|
|
ender
Creatures
Posts: 39
|
Post by ender on Jan 9, 2021 8:35:39 GMT
When I did the change, I put the version number there. Since /proc/bus/input/devices listed my device as Bus=0003 Vendor=16c0 Product=0482 Version=0111 it seemed rather obvious that the ID string in /usr/share/the64/ui/data/gamecontrollerdb.txt used the same four values, padded to 32 bit and written as little-endian. I suspect that if you check yours, it says Bus=0003 Vendor=0e8f Product=3013 version=0101
|
|
|
Post by spannernick on Jan 9, 2021 13:26:23 GMT
Did you know that VICE actually don't use a SDL gamecontollerdb.txt file, they properly added it for a way of adding THEC64 Joystick cause it don't use the VICE Menu and most of the Mini Consoles use SDL Game Controller Database.
|
|
iCode
Creatures
Posts: 18
|
Post by iCode on Jan 10, 2021 2:48:45 GMT
When I did the change, I put the version number there. Since /proc/bus/input/devices listed my device as Bus=0003 Vendor=16c0 Product=0482 Version=0111 it seemed rather obvious that the ID string in /usr/share/the64/ui/data/gamecontrollerdb.txt used the same four values, padded to 32 bit and written as little-endian. I suspect that if you check yours, it says Bus=0003 Vendor=0e8f Product=3013 version=0101 Thanks! dmesg reported HID ver 1.01 so you must be right that version=0101 must mean 1.01 and once it matched, it started working.
|
|
iCode
Creatures
Posts: 18
|
Post by iCode on Jan 10, 2021 2:53:35 GMT
In reviewing the c64 mini/maxi gamecontrollersdb.txt file on Carousel, none of them are preset in the file match ones that support multi-hids. So It looks like no out of box solution without editing the gamecontrollersdb.txt file and using Carousel. So I added my combinations to the file as: 03000000828200000132000001010000,Retro Joystick Adapter,a:b3,b:b4,x:b5,y:b6,back:b2,righttrigger:b1,lefttrigger:b0,leftx:a0,lefty:a1,platform:Linux, And sure enough, the mini saw my device but unfortunately it only seems to see js3 and the buttons are not mapped correctly and axis don't work, even though i know they are set correctly. I even checked in SDL2 tool. Could you share a report descriptor you are using? I might be able to replicate it with my Teensy and try to see what's happening. The HID_QUIRK_MULTI_INPUT really does nothing more than create one device node per report ID, so it's hard to see that as the culprit, specifically. Also I went back and reviewed the VID/PIDs once again and I can confirm only the ones with the HID_QUIRK_MULTI_INPUT flag work reporting separate controllers. My device does have multiple different report IDs; one for each port. I don't think there is a way for the system to report multiple gamepads on the same USB unless the HID descriptors has separate report IDs. Good examples here: eleccelerator.com/tutorial-about-usb-hid-report-descriptors/
|
|
ender
Creatures
Posts: 39
|
Post by ender on Jan 10, 2021 13:42:27 GMT
Could you share a report descriptor you are using? I might be able to replicate it with my Teensy and try to see what's happening. The HID_QUIRK_MULTI_INPUT really does nothing more than create one device node per report ID, so it's hard to see that as the culprit, specifically. Also I went back and reviewed the VID/PIDs once again and I can confirm only the ones with the HID_QUIRK_MULTI_INPUT flag work reporting separate controllers. My device does have multiple different report IDs; one for each port. I don't think there is a way for the system to report multiple gamepads on the same USB unless the HID descriptors has separate report IDs. Good examples here: eleccelerator.com/tutorial-about-usb-hid-report-descriptors/ I agree, it seems without multiple REPORT_ID, it will be assumed to be a single controller. I get the impression there is a lot of cut and paste going on with report descriptors, unfortunately, so it's possible that some information online is unreliable or unhelpful. I'm determined to make mine from scratch from an understanding of how it all works, once I get started properly.
|
|
iCode
Creatures
Posts: 18
|
Post by iCode on Jan 10, 2021 16:02:48 GMT
Also I went back and reviewed the VID/PIDs once again and I can confirm only the ones with the HID_QUIRK_MULTI_INPUT flag work reporting separate controllers. My device does have multiple different report IDs; one for each port. I don't think there is a way for the system to report multiple gamepads on the same USB unless the HID descriptors has separate report IDs. Good examples here: eleccelerator.com/tutorial-about-usb-hid-report-descriptors/ I agree, it seems without multiple REPORT_ID, it will be assumed to be a single controller. I get the impression there is a lot of cut and paste going on with report descriptors, unfortunately, so it's possible that some information online is unreliable or unhelpful. I'm determined to make mine from scratch from an understanding of how it all works, once I get started properly. The other solution that I am thinking might be is plausible and reliable is to introduce a built-in 4 port USB hub (using HS8836 chip). A bit more circuitry but it might be fun to do and I might give it a shot one day just to play with it.
|
|
ender
Creatures
Posts: 39
|
Post by ender on Jan 10, 2021 21:07:11 GMT
I agree, it seems without multiple REPORT_ID, it will be assumed to be a single controller. I get the impression there is a lot of cut and paste going on with report descriptors, unfortunately, so it's possible that some information online is unreliable or unhelpful. I'm determined to make mine from scratch from an understanding of how it all works, once I get started properly. The other solution that I am thinking might be is plausible and reliable is to introduce a built-in 4 port USB hub (using HS8836 chip). A bit more circuitry but it might be fun to do and I might give it a shot one day just to play with it. You'll need four microcontrollers too then, right? Still, it'd be a clean design and would work exactly like four different devices. Might be worth doing as an option even if it gets more expensive.
|
|
|
Post by jj0 on Jan 11, 2021 7:58:16 GMT
The other solution that I am thinking might be is plausible and reliable is to introduce a built-in 4 port USB hub (using HS8836 chip). A bit more circuitry but it might be fun to do and I might give it a shot one day just to play with it. You'll need four microcontrollers too then, right? Still, it'd be a clean design and would work exactly like four different devices. Might be worth doing as an option even if it gets more expensive. For my understanding, why would this be needed? As the current design works for all platforms, with only the somewhat esoteric Mini/Maxi needing a tweak?
|
|
ender
Creatures
Posts: 39
|
Post by ender on Jan 11, 2021 8:07:41 GMT
You'll need four microcontrollers too then, right? Still, it'd be a clean design and would work exactly like four different devices. Might be worth doing as an option even if it gets more expensive. For my understanding, why would this be needed? As the current design works for all platforms, with only the somewhat esoteric Mini/Maxi needing a tweak? It may not be needed, but if you really want to be sure that absolutely all systems handle the adapter as intended, it would be the way to go. Of course, the more primitive ones may not be able to handle hubs...
|
|
|
Post by jj0 on Jan 11, 2021 8:32:12 GMT
For my understanding, why would this be needed? As the current design works for all platforms, with only the somewhat esoteric Mini/Maxi needing a tweak? It may not be needed, but if you really want to be sure that absolutely all systems handle the adapter as intended, it would be the way to go. Of course, the more primitive ones may not be able to handle hubs... Yeah, there will always be exceptions I guess... iCode, would it be possible to map the additional buttons on the converter to the same functions as the standard Mini joystick?
|
|
iCode
Creatures
Posts: 18
|
Post by iCode on Jan 23, 2021 2:05:25 GMT
It may not be needed, but if you really want to be sure that absolutely all systems handle the adapter as intended, it would be the way to go. Of course, the more primitive ones may not be able to handle hubs... Yeah, there will always be exceptions I guess... iCode , would it be possible to map the additional buttons on the converter to the same functions as the standard Mini joystick? Currently, the buttons on the device can be mapped as the user wishes through the gamecontrollersdb.txt file. I have a working Alpha version of firmware that also allows the user to map them as they wish directly in the device via menu options on the screen. I might even add ability for user to define combo keys that would give you additional actions and even map them to keyboard commands. BTW, on the HUB idea, you don't need multiple micro controllers. just separate USB to serial chips like ch340c on each of the internal hub usb ports.
|
|