Xin-Mo Dual Controller not working
  • Hello everybody, i use the 0.7.5 version of pimame and i received the xin-mo controller a few days ago. i bought this set from ultracabs (http://www.ultracabs.co.uk/usb-interface--standard-joystick-set-109-p.asp) and i thought that it would be working because of this thread (http://pimame.org/forum/discussion/32/solved-usb-joystick-controller-not-working-in-0-6-beta-5#Item_5).

    I modified the .rc files under .advanced for the joystick to auto or raw, but nothing worked. under windows everything worked fine but i do not get this joystick to work. hopefully somebody of you also has this controller and knows a solution. thanks in advance.
  • I am also having this issue. The bug is a reported bug with Ubuntu based linux distros I believe. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1077359

    I would love to know of a fix as well. :/
  • this controller don't work well since 3.5 kernel, no up and left axis, I found this patch on launchpad : https://launchpadlibrarian.net/143245326/0001-UBUNTU-Upstream-hid-Add-a-driver-for-the-Xin-Mo-Dual.patch
    but I don't know how to install it, if someone can help it would be great, thanks !!!
  • I'm having the same issue with the Xin-Mo Dual as well. It's the default joystick driver causing the issue, but I don't know how to patch or rebuild Linux. I'll be spending the day researching this, but if anyone else comes up with anything new that would be great. I'll save this site and post my findings as well.
  • you have to dowload the kernel source of raspbian
    copy the file patch in the same directory and patch it
    follow those instructions to rebuild the kernel and use it : http://elinux.org/RPi_Kernel_Compilation
    good luck it's not so hard, i made it ;-)
  • Thanks that's what it looked like I was going to need. I ended up re-wiring LEFT and UP as joystick buttons 8 and 9 for now. I have Frogger working with no lag on AdvanceMAME. At least we know what the issue is. While frustrating, I'm having a lot of fun at the same time! I'm already thinking about a 2nd machine!
  • hello I contact the author of this patch and he send me a link for a how-to:
    http://ithink.ch/blog/2013/09/08/patching_the_linux_kernel_to_install_the_xin-mo_dual_arcade_driver_on_a_raspberry_pi.html
    hope it will help
  • Thanks 2redge2 I'm giving that a try.
  • it's nothing, maybe shea can add this patch to next version of pimame
  • i looked over the patch. I'm going to try implementing it.
  • Tried the patch last night with 0.7.9 works perfectly :)
  • Hi - I am having the issue with the Xin-Mo controller joystick signalling that is described in this thread. I am running PiMAME 0.7.10. Did you ever implement this patch?

    Hmm. According to your web site, 0.7.10 includes the Xin-Mo patch. Yet I am still having an issue where only two of the four joystick directions are being recognized by the controller. Is there an easy way to confirm the patch is indeed present in the kernel?
  • I am having the same problem for piplay 8.3. Please help.
  • This patch is awesome... i used it for my distribution. It works like a charm.
  • I tried the patch for 0.8.3 with no luck :-(
  • Perhaps the kernel is too recent... and the patch doesn't apply anymore. Which kernel version in 0.8.3?
  • I will have a look later when im done at work. Not sure. Wish there was an easy fix like a driver install.
  • I ran uname -a and it says pi 3.6.11.
  • Ok, that's crazy... my linux kernel on raspicade is 3.10.34 or 3.10.36+ and the patch is working. It's a previous version see http://elinux.org/RPi_Kernel_Compilation : since Jan '14 the current is rpi-3.10.y

    I think you did some thing wrong because http://ithink.ch/blog/2013/09/08/patching_the_linux_kernel_to_install_the_xin-mo_dual_arcade_driver_on_a_raspberry_pi.html uses this kernel version and it's working.
    Have you done ALL the steps described in the previous page?
  • I tried everything on the tutorial, there were a few messages at the ens about the modules. I will try it again on the weekend and hopefully I can get it sorted. Thanks for the help.
  • You can try my compiled kernel and the modules from raspicade : download http://www.morere.eu/storage/kernel-3.10.36-xinmo.tar.gz

    Put this archive in the home of pi on the raspi.

    For example from my laptop to the pi :
    [yann@archery linux]$ scp kernel-3.10.36-xinmo.tar.gz pi@192.168.1.63:
    pi@192.168.1.63's password:
    kernel-3.10.36-xinmo.tar.gz 100% 15MB 3.7MB/s 00:04
    [yann@archery linux]$

    connect to the pi with ssh (it's the simplest)

    ssh pi@192.168.1.67

    You'll need to have the right date/time on the pi, otehrwise you'll get timestamp errors

    pi@raspberrypi ~ $ sudo ntpdate "somentpserver or your gateway"
    9 Apr 07:13:50 ntpdate[2171]: step time server 193.50.119.254 offset 315265.763132 sec

    Extract the archive
    pi@raspberrypi ~ $ tar xzf kernel-3.10.36-xinmo.tar.gz
    pi@raspberrypi ~ $

    Copy the new kernel in boot directoryt :

    pi@raspberrypi ~ $ sudo cp kernel-3.10.36-xinmo /boot/

    we are going to make backup of current module directory (to get back if something goes wrong)
    pi@raspberrypi ~ $ cd /lib
    pi@raspberrypi /lib $ sudo mv firmware firmware_ximmo
    pi@raspberrypi /lib $ sudo mv modules modules_xinmo
    pi@raspberrypi ~ $ cd
    now we copy the new module directory to the right place

    pi@raspberrypi ~ $ sudo cp -R modules/lib/firmware /lib/
    pi@raspberrypi ~ $ sudo cp -R modules/lib/modules /lib/

    Finally we modify the /boot/config.txt to use the new kernel at boot:

    kernel=kernel-3.10.36-xinmo

    you can reboot now.

    $ sudo reboot


    see next post ->>>>>>>

  • A new connection to the pi to see if we are using the right kernel :

    [yann@archery ~]$ ssh pi@192.168.1.63
    pi@192.168.1.63's password:

    Welcome in your RaspberryPI (Moebius Release)
    pi@raspberrypi ~ $ uname -a
    Linux raspberrypi 3.10.36+ #1 PREEMPT Tue Apr 8 17:13:47 CEST 2014 armv6l GNU/Linux
    pi@raspberrypi ~ $

    Yes it is. Connect the xinmo module and verify it is recognized :

    [ 285.145320] usb 1-1.3.2: Product: THT Arcade console 2P USB Player
    [ 285.145336] usb 1-1.3.2: Manufacturer: THT
    [ 285.214536] input: THT THT Arcade console 2P USB Player as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.2/1-1.3.2:1.0/input/input3
    [ 285.216642] xinmo 0003:16C0:05E1.0004: input,hidraw3: USB HID v1.01 Joystick [THT THT Arcade console 2P USB Player]

    next let's see if xinmo module is loaded :

    pi@raspberrypi ~ $ lsmod
    Module Size Used by
    hid_xinmo 1108 0
    [...]
    evdev 9439 0
    joydev 9072 0

    Now, we are going to test if all is fonctionning using evtest :

    pi@raspberrypi ~ $ evtest
    No device specified, trying to scan all of /dev/input/event*
    Not running as root, no devices may be available.
    Available devices:
    [...]
    /dev/input/event3: THT THT Arcade console 2P USB Player
    Select the device event number [0-3]: 3
    Input driver version is 1.0.1
    Input device ID: bus 0x3 vendor 0x16c0 product 0x5e1 version 0x101
    Input device name: "THT THT Arcade console 2P USB Player"
    Supported events:
    [...]
    Properties:
    Testing ... (interrupt to exit)

    and now try your joysticks and buttons you should see for player 1
    Properties:
    Testing ... (interrupt to exit)
    Event: time 1396163394.891907, type 3 (EV_ABS), code 0 (ABS_X), value 1
    Event: time 1396163394.891907, -------------- SYN_REPORT ------------
    Event: time 1396163395.035925, type 3 (EV_ABS), code 0 (ABS_X), value 0
    Event: time 1396163395.035925, -------------- SYN_REPORT ------------
    Event: time 1396163401.148755, type 3 (EV_ABS), code 0 (ABS_X), value -1
    Event: time 1396163401.148755, -------------- SYN_REPORT ------------
    Event: time 1396163401.340781, type 3 (EV_ABS), code 0 (ABS_X), value 0
    Event: time 1396163401.340781, -------------- SYN_REPORT ------------
  • So, PiPlay 0.8 beta 3 does have the Xin Mo patch built in. If one buttons works, they all should. I would double check all the connections, especially if its just up and left.

    The latest Raspbian updated the kernel from 3.8 to 3.10, so the tutorial to recompile still works, just change your all the commands relating to the kernel number to the current one.
  • Thanks so much for all the help. I will try and configure it over the weekend. Gonna Try and rewire and see if it helps but there are a few people who have had the same problem. I pray this works as I am dying to use my self built arcade machine.
  • @ian57

    I know this is a massive ask but could you or anybody else please create a tutorial, maybe with the odd screenshot or two, of how to patch the kernel. I know it sounds odd but for a noob like myself, I attempt everything but I do sometimes find it difficult as I am not sure if i am working in the correct folder/directory and often this makes the process redundant. I ask only because I cant seem to patch the kernel successfully.
    Your help would be greatly appreciated by all.
  • OK let's go :

    You are going to compile a new kerlent on your pi : We are not going to use crosscompilation here, so it will take between 15 and 17 hours to compile the kernel on the pi.

    Step 1 : update and Install tools for compilation

    sudo apt-get update
    sudo apt-get -y dist-upgrade
    sudo apt-get -y install gcc make ncurses-dev bc screen

    Step 2 : get kernel sources and extract them

    pi@raspberrypi ~ $ wget https://github.com/raspberrypi/linux/archive/rpi-3.10.y.tar.gz
    --2014-03-29 10:15:47-- https://github.com/raspberrypi/linux/archive/rpi-3.10.y.tar.gz
    Resolving github.com (github.com)... 192.30.252.131
    Connecting to github.com (github.com)|192.30.252.131|:443... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: https://codeload.github.com/raspberrypi/linux/tar.gz/rpi-3.10.y [following]
    --2014-03-29 10:15:53-- https://codeload.github.com/raspberrypi/linux/tar.gz/rpi-3.10.y
    Resolving codeload.github.com (codeload.github.com)... 192.30.252.145
    Connecting to codeload.github.com (codeload.github.com)|192.30.252.145|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 113057455 (108M) [application/x-gzip]
    Saving to: `rpi-3.10.y.tar.gz'

    100%[==========================================================================================================>] 113,057,455 290K/s in 4m 48s

    2014-03-29 10:20:46 (383 KB/s) - `rpi-3.10.y.tar.gz' saved [113057455/113057455]

    pi@raspberrypi ~ $ tar xzf rpi-3.10.y.tar.gz
    pi@raspberrypi ~ $ ls
    Desktop linux-rpi-3.10.y python_games rpi-3.10.y.tar.gz
    pi@raspberrypi ~ $ cd linux-rpi-3.10.y/

    Step 3 : get the patch abec apply it to sources

    pi@raspberrypi ~/linux-rpi-3.10.y $ wget 'http://ithink.ch/blog/files/xin-mo/0001-hid-Add-new-driver-for-non-compliant-Xin-Mo-devices.patch'
    --2014-03-29 10:29:48-- http://ithink.ch/blog/files/xin-mo/0001-hid-Add-new-driver-for-non-compliant-Xin-Mo-devices.patch
    Resolving ithink.ch (ithink.ch)... 92.243.21.241
    Connecting to ithink.ch (ithink.ch)|92.243.21.241|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 5200 (5.1K) [text/x-diff]
    Saving to: `0001-hid-Add-new-driver-for-non-compliant-Xin-Mo-devices.patch'

    100%[==========================================================================================================>] 5,200 --.-K/s in 0s

    2014-03-29 10:29:48 (34.2 MB/s) - `0001-hid-Add-new-driver-for-non-compliant-Xin-Mo-devices.patch' saved [5200/5200]

    FINISHED --2014-03-29 10:29:48--
    Total wall clock time: 0.3s
    Downloaded: 1 files, 5.1K in 0s (34.2 MB/s)
    pi@raspberrypi ~/linux-rpi-3.10.y $ patch -p1 < 0001-hid-Add-new-driver-for-non-compliant-Xin-Mo-devices.patch
    patching file drivers/hid/Kconfig
    Hunk #1 succeeded at 728 with fuzz 2 (offset -15 lines).
    patching file drivers/hid/Makefile
    Hunk #1 succeeded at 111 (offset 1 line).
    patching file drivers/hid/hid-core.c
    Hunk #1 succeeded at 1817 (offset 81 lines).
    patching file drivers/hid/hid-ids.h
    Hunk #1 succeeded at 890 (offset 3 lines).
    patching file drivers/hid/hid-xinmo.c
    pi@raspberrypi ~/linux-rpi-3.10.y $
  • Step 4 : Select module to build, here our xinmo

    Before building the kernel , we ensure that all is proper in the kernel tree, and we call mr proper ;)

    make mrproper

    We copy the current kernel config to config file of our future kernel :

    zcat /proc/config.gz > .config

    Now we are going to configure it, in fact just add the xinmo module

    make oldconfig

    We answer by default at each questions, except the one concerning the xinmo module . We type m to make it generated :

    Xin-Mo non-fully compliant devices (HID_XINMO) [N/m/y/?] (NEW)

    After, answer by default to all remaining question.

    If you missed the Xin-Mo line or are not sure, you can use the menu config1 to make sure it is enabled. Type

    make menuconfig and navigate to Device Drivers → HID support → Special HID drivers → Xin-Mo non-fully compliant devices and type m to enable it as a module. An should be displayed next to the line:

    Xin-Mo


    Step 5 : compilation

    pi@raspberrypi ~/linux-rpi-3.10.y $ make ; make modules
    scripts/kconfig/conf --silentoldconfig Kconfig
    WRAP arch/arm/include/generated/asm/auxvec.h
    WRAP arch/arm/include/generated/asm/bitsperlong.h
    WRAP arch/arm/include/generated/asm/cputime.h
    WRAP arch/arm/include/generated/asm/current.h
    WRAP arch/arm/include/generated/asm/emergency-restart.h

    You have time, go to bed and have a long long night ;-) (with crosscompilation, it takes only 2 hours on an 5 year laptop!!! pi computing power is really low)

    I will post the next steps when you kernel will be compiled ;)
  • You are a legend. I am going to try and rewite my xin mo first as someone sent me an image on how to wire the usb controller for piplay 0.8.3 so will try that first and then attempt to rebuild the kernel is neccessary. Many thanks for your effort to help us noobs. It is greatly appreciated.
  • You're welcome. Tell me when you have your kernel recompiled, i'll post the next steps.
  • @ian57
    I am stuck on step 2:
    pi@raspberrypi ~ $ tar xzf rpi-3.10.y.tar.gz
    Nothing happens
    Also the next step is (|s) does this mean the Symbol (|) and a (s) or is it Ls or 1s. I'm a bit confused.
  • @ian57
    Please ignore my previous query.
    My pi is now compiling. Please send me the next steps when you are ready. Many thanks.
  • Hi i've testes the last firmware (debian) with kernel 3.12.y. The source code contains the xinmo patch, but the delivered kernel does not contain the xinmo module -> need to recompile
  • Please keep me updated if you dont mind as I have no idea what to do from this point forward.
  • Hey this is the tricky part ;)... reboot on the new kernel, i'll post the how to next.
  • Step 6 : Copy the new kernel to the right place

    We copy the new kernel (non compressed image) in the /boot directory from you linux directory. You can name it as you want. But be carreful not to overwrite the curretn kernel ! :

    sudo cp arch/arm/boot/Image /boot/kernel_raspicade.img

    Now we have to copy the modules to the /lib/ tree. We make that with 2 steps :
    - first we install the compiled modules in a directory in our home
    - second we copy the module tree to /lib/modules

    Here we go :

    mkdir ~/modules
    export MODULES_TEMP=~/modules
    make INSTALL_MOD_PATH=${MODULES_TEMP} modules_install

    Next we copy the modules at the right place. But we make a backup before. It's safer :

    cd /lib
    sudo cp -R firmware firmware_old
    sudo cp -R modules modules_old
    sudo cp -R ~/modules/lib/firmware/ .
    sudo cp -R ~/modules/lib/modules/ .

    Step 7: Using the new kernel
    To use the new kernel you need to tell the system to use it. So we modify the line kernel= in the /boot/config.txt

    kernel=kernel_raspicade.img

    To di that, use nano or vim

    Usually, it is recommanded to update firmware... but you can test without

    Step 8 : reboot and enjoy :)

    Juste need to reboot

    sudo reboot
  • Information : the last raspbian raspberry pi firmware DOES NOT INCLUDE xinmo support.

    However the xinmo patch is included in the kernel source 3.12.y (3.12.20 today), but module is not built. So need to build it.

    I've made it today. It's ok... xin-mo works :
    pi@raspberrypi ~ $ uname -a
    Linux raspberrypi 3.12.20+ #1 PREEMPT Tue May 27 16:29:25 UTC 2014 armv6l GNU/Linux
    pi@raspberrypi ~ $pi@raspberrypi ~ $ cd /lib/modules/3.12.20+/
    pi@raspberrypi /lib/modules/3.12.20+ $ find . -name "*xinmo*"
    ./kernel/drivers/hid/hid-xinmo.ko
    pi@raspberrypi /lib/modules/3.12.20+ $ lsmod
    Module Size Used by
    hid_xinmo 1123 0
    pi@raspberrypi /lib/modules/3.12.20+ $
  • Proof :
    pi@raspberrypi /lib/modules/3.12.20+ $ evtest
    No device specified, trying to scan all of /dev/input/event*
    Not running as root, no devices may be available.
    Available devices:
    /dev/input/event0: CHICONY HP Basic USB Keyboard
    /dev/input/event1: THT THT Arcade console 2P USB Player
    Select the device event number [0-1]: 1
    Input driver version is 1.0.1
    Input device ID: bus 0x3 vendor 0x16c0 product 0x5e1 version 0x101
    Input device name: "THT THT Arcade console 2P USB Player"
    Supported events:
    Event type 0 (EV_SYN)
    Event type 1 (EV_KEY)
    Event code 288 (BTN_TRIGGER)
    Event code 289 (BTN_THUMB)
    Event code 290 (BTN_THUMB2)
    Event code 291 (BTN_TOP)
    Event code 292 (BTN_TOP2)
    Event code 293 (BTN_PINKIE)
    Event code 294 (BTN_BASE)
    Event code 295 (BTN_BASE2)
    Event code 296 (BTN_BASE3)
    Event code 297 (BTN_BASE4)
    Event code 298 (BTN_BASE5)
    Event code 299 (BTN_BASE6)
    Event code 300 (?)
    Event code 301 (?)
    Event code 302 (?)
    Event code 303 (BTN_DEAD)
    Event code 304 (BTN_A)
    Event code 305 (BTN_B)
    Event code 306 (BTN_C)
    Event code 307 (BTN_X)
    Event code 308 (BTN_Y)
    Event code 309 (BTN_Z)
    Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
    Value 0
    Min -1
    Max 1
    Event code 1 (ABS_Y)
    Value 0
    Min -1
    Max 1
    Event code 2 (ABS_Z)
    Value 0
    Min -1
    Max 1
    Event code 3 (ABS_RX)
    Value 0
    Min -1
    Max 1
    Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
    Properties:
  • Proof 2 :

    Testing ... (interrupt to exit)
    Event: time 1401287234.331789, type 3 (EV_ABS), code 0 (ABS_X), value -1
    Event: time 1401287234.331789, -------------- SYN_REPORT ------------
    Event: time 1401287234.507790, type 3 (EV_ABS), code 0 (ABS_X), value 0
    Event: time 1401287234.507790, -------------- SYN_REPORT ------------
    Event: time 1401287235.419808, type 3 (EV_ABS), code 0 (ABS_X), value 1
    Event: time 1401287235.419808, -------------- SYN_REPORT ------------
    Event: time 1401287235.563775, type 3 (EV_ABS), code 0 (ABS_X), value 0
    Event: time 1401287235.563775, -------------- SYN_REPORT ------------
    Event: time 1401287237.179816, type 3 (EV_ABS), code 1 (ABS_Y), value -1
    Event: time 1401287237.179816, -------------- SYN_REPORT ------------
    Event: time 1401287237.307797, type 3 (EV_ABS), code 1 (ABS_Y), value 0
    Event: time 1401287237.307797, -------------- SYN_REPORT ------------
    Event: time 1401287238.235814, type 3 (EV_ABS), code 1 (ABS_Y), value 1
    Event: time 1401287238.235814, -------------- SYN_REPORT ------------
    Event: time 1401287238.395785, type 3 (EV_ABS), code 1 (ABS_Y), value 0
    Event: time 1401287238.395785, -------------- SYN_REPORT ------------
    Event: time 1401287240.451808, type 3 (EV_ABS), code 2 (ABS_Z), value -1
    Event: time 1401287240.451808, -------------- SYN_REPORT ------------
    Event: time 1401287240.595801, type 3 (EV_ABS), code 2 (ABS_Z), value 0
    Event: time 1401287240.595801, -------------- SYN_REPORT ------------
    Event: time 1401287241.251809, type 3 (EV_ABS), code 2 (ABS_Z), value 1
    Event: time 1401287241.251809, -------------- SYN_REPORT ------------
    Event: time 1401287241.411794, type 3 (EV_ABS), code 2 (ABS_Z), value 0
    Event: time 1401287241.411794, -------------- SYN_REPORT ------------
    Event: time 1401287241.987807, type 3 (EV_ABS), code 3 (ABS_RX), value -1
    Event: time 1401287241.987807, -------------- SYN_REPORT ------------
    Event: time 1401287242.163819, type 3 (EV_ABS), code 3 (ABS_RX), value 0
    Event: time 1401287242.163819, -------------- SYN_REPORT ------------
    Event: time 1401287242.643798, type 3 (EV_ABS), code 3 (ABS_RX), value 1
    Event: time 1401287242.643798, -------------- SYN_REPORT ------------
    Event: time 1401287242.787808, type 3 (EV_ABS), code 3 (ABS_RX), value 0
    Event: time 1401287242.787808, -------------- SYN_REPORT ------------
  • Thanks @ian57. I will try first to complete your tutorial on rebuilding the kernel for 3.10.y and if it works im not touching it for a loooong time. Kernel still building so i will let you know how it goes
  • Kernel will compile during 15-17 hours on the pi... I use cross compilation to speed up the compilation.

    For kernel 3.12.y i use the same method, except that you don't need to apply the patch. But you need to configure the module xinmo.
  • @ian57

    Quick question, do you have to do all the steps in succession or can you switch the pi off between steps? So can you simply pick up where you left off the last time?
  • So for kernel 3.12.y do you just change the input from 3.1o.y to 3.12.y in all the steps and then skip the patch part? How do you configure the xinmo module? Confused.com
  • Of course you can switch of the pi... after compilation... or even during compilation. you can stop compilation 'CTRL-C' and restart it (it will compile what remains).

    For kernel 3.12.y just skip the step 3. and continue with step 4. make mrproper make oldconfig etc... If you try to apply the patch, it complains that it is already patched.
  • Thanks @ian57

    Will have a go on the weekend again.
  • in france today is vacation ;-)... i've just put the xinmo binaries of pifab on may github
  • France, sounds nice, can we like squeeze into your carry-on or something! :)
  • @Chad : where are you from?...
  • Sitting in the middle of the US...Upper Midwest...
  • Never seen US... I wish one day ;)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!