Announcement

Collapse
No announcement yet.

Adding Controller and Various HID Support to ROMS Thread.(work in progress)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding Controller and Various HID Support to ROMS Thread.(work in progress)

    The Goal of This Thread is To obtain and Publish information about adding Controller/Unsupported HID to Roms

    Adding Controller Support to a ROM
    I Think its as simple a adding them to system/usr/key layouts but i cannot confirm so im till doing a lot of research on this part
    KL Files (Some of These May not Be Controllers Be careful replacing files with the same name)

    Working on Creating a Detailed List From this Dump
    https://yadi.sk/d/W1cqzK-fmSH84 (kl files dump from a coulple roms and the github below)
    NOTE SOME OF THESE FILES CAN be Found at https://github.com/khanning/android_vendor_ideapad_k1 Credit goes to who ever made these files. I Did not Make These Key-maps (Information Copied from kl files)

    Vendor_0001_Product_0001.kl unknown
    Vendor_0079_Product_0011.kl Classic NES Controller
    Vendor_044f_Product_d007.kl Thrustmaster T Mini Wireless
    Vendor_045e_Product_028e.kl XBox 360 USB Controller and NVIDIA Normalized Gamepad are mentioned

    Vendor_045e_Product_0719.kl (# XBox 360 USB Wireless Controller Reports itself as "Xbox 360 Wireless Receiver" and # "Microsoft Corp. Xbox 360 Wireless Adapter"
    # Similar in behavior to XBox 360 USB Controller except for the d-pad, # which is digital (scan codes instead of axes) on the wireless version. # NVIDIA Normalized Gamepad)

    Vendor_046d_Product_c216.kl Logitech Dual Action Controller
    Vendor_046d_Product_c219.kl Logitech Logitech Cordless RumblePad 2
    Vendor_046d_Product_c21d.kl Logitech Gamepad F310 [USB]
    Vendor_046d_Product_c21f.kl Logitech Wireless Gamepad F710.
    Vendor_046d_Product_c294.kl Logitech G25 Racing Wheel in Compatibility Mode
    Vendor_046d_Product_c299.kl Logitech G25 Racing Wheel in Native Mode
    Vendor_046d_Product_c532.kl Logitech Revue Wireless keyboard
    Vendor_054c_Product_0268.kl Sony PlaystationR3 Controller
    Vendor_057e_Product_0306.kl NVIDIA Normalized Gamepad
    Vendor_0583_Product_2060.kl ION GO PAD
    Vendor_05ac_Product_0239.kl Apple Wireless Keyboard
    Vendor_0c45_Product_1109.kl Generic key layout file for full alphabetic US English PC style external keyboards.
    Vendor_1038_Product_1412.kl Steelseries Free
    Vendor_12bd_Product_d015.kl Hitgaming SNES Retro
    Vendor_1689_Product_fd00.kl Razer Onza Tournament Edition
    Vendor_1689_Product_fd01.kl Razer Xbox 360 Gamepad
    Vendor_1689_Product_fe00.kl Razer Sabertooth Elite
    Vendor_1b8e_Product_0cec_Version_0001.kl CEC Input key mapping from TV I dont know if you should use this or not
    Vendor_1bad_Product_f016.kl Madcatz Gamepad
    Vendor_1bad_Product_f023.kl Mad Catz MLG GamePad for Xbox 360
    Vendor_1bad_Product_f027.kl MadCatz FPS Pro
    Vendor_1bad_Product_f036.kl MadCatz Generic XBox Controller
    Vendor_1d79_Product_0009.kl Nyko Playpad / Playpad Pro
    Vendor_22b8_Product_093d.kl Motorola Bluetooth Wireless Keyboard
    Vendor_2378_Product_100a.kl OnLive, Inc. OnLive Wireless Controller
    Last edited by Nick314; 12-23-2015, 11:48.

  • #2
    how are going with this?
    I have an mx64 box, an amlogic s905 box clone which recognises my ipega blue tooth controller (able to pair) and connect usb xbox controller but the
    key detection is not possible from the firmware. The keymap files are the easy part, and can be built manually to suite the device and names via vendor id and product id.
    What I suspect is missing from these firmwares are kernel modules or integrated modules that support these devices (i.e. drivers), while other device like mice, keyboards, and 2.4g remotes are detected without issue.

    Comment


    • #3
      Compiling Arm64 Kernel Modules

      Info : http://www.cnx-software.com/2015/11/...other-drivers/
      s905 Kernel : http://openlinux.amlogic.com:8000/do...45bea41.tar.gz

      download ubuntu 14.4 version (must be same version which was used to build original kernel, otherwise it wont build correctly (i.e ubuntu 15 == badness)

      Run/Build ubuntu in virtual machine (ie virtual box)

      Install Dev env on ubuntu 14.4
      sudo apt-get install gcc-aarch64-linux-gnu

      sudo apt-get install libc6-dev

      sudo apt-get install gcc

      sudo apt-get install g++

      sudo apt-get install make

      sudo apt-get install dpkg-dev

      sudo apt-get install ncurses-dev

      sudo apt-get install lzop



      Build Kernel
      tar xvf arm-src-kernel-2015-11-04-9e845bea41.tar.gz
      cd arm-src-kernel-2015-11-04-9e845bea41

      mkdir -p .git/hooks
      make ARCH=arm64 meson64_defconfig
      make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8

      ... test build env has no errors ...

      Select drivers to compiler as kernel modules

      make menuconfig ARCH=arm64 meson64_defconfig
      Make changes and save config as test_build

      Update changes on original kernel config
      find . -name meson64_defconfig
      cp meson64_defconfig meson64_defconfig_
      cp test_build meson64_defconfig


      Clean config and build drivers
      make ARCH=arm64 clean
      make ARCH=arm64 meson64_defconfig
      make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8

      ...
      LD vmlinux.o
      MODPOST vmlinux.o
      WARNING: modpost: Found 5 section mismatch(es).
      To see full details build your kernel with:
      'make CONFIG_DEBUG_SECTION_MISMATCH=y'
      GEN .version
      CHK include/generated/compile.h
      UPD include/generated/compile.h
      CC init/version.o
      LD init/built-in.o
      KSYM .tmp_kallsyms1.o
      KSYM .tmp_kallsyms2.o
      LD vmlinux
      SORTEX vmlinux
      SYSMAP System.map
      OBJCOPY arch/arm64/boot/Image
      OBJCOPY arch/arm64/boot/Image
      Building modules, stage 2.
      MODPOST 24 modules
      GZIP arch/arm64/boot/Image.gz
      LZO arch/arm64/boot/Image.lzo
      CC drivers/amlogic/usb/dwc_otg/310/dwc_otg.mod.o
      CC drivers/hid/hid-dr.mod.o
      CC drivers/input/ff-memless.mod.o
      CC drivers/input/gameport/gameport.mod.o
      CC drivers/input/joydev.mod.o
      CC drivers/input/joystick/a3d.mod.o
      CC drivers/input/joystick/adi.mod.o
      CC drivers/input/joystick/analog.mod.o
      CC drivers/input/joystick/cobra.mod.o
      CC drivers/input/joystick/gf2k.mod.o
      CC drivers/input/joystick/grip.mod.o
      CC drivers/input/joystick/grip_mp.mod.o
      CC drivers/input/joystick/guillemot.mod.o
      CC drivers/input/joystick/iforce/iforce.mod.o
      CC drivers/input/joystick/interact.mod.o
      CC drivers/input/joystick/joydump.mod.o
      CC drivers/input/joystick/sidewinder.mod.o
      CC drivers/input/joystick/spaceball.mod.o
      CC drivers/input/joystick/spaceorb.mod.o
      CC drivers/input/joystick/tmdc.mod.o
      CC drivers/input/joystick/warrior.mod.o
      CC drivers/input/joystick/xpad.mod.o
      CC drivers/input/joystick/zhenhua.mod.o
      CC drivers/media/usb/gspca/gspca_main.mod.o
      LD [M] drivers/amlogic/usb/dwc_otg/310/dwc_otg.ko
      LD [M] drivers/hid/hid-dr.ko
      LD [M] drivers/input/ff-memless.ko
      LD [M] drivers/input/gameport/gameport.ko
      LD [M] drivers/input/joydev.ko
      LD [M] drivers/input/joystick/a3d.ko
      LD [M] drivers/input/joystick/adi.ko
      LD [M] drivers/input/joystick/analog.ko
      LD [M] drivers/input/joystick/cobra.ko
      LD [M] drivers/input/joystick/gf2k.ko
      LD [M] drivers/input/joystick/grip.ko
      LD [M] drivers/input/joystick/grip_mp.ko
      LD [M] drivers/input/joystick/guillemot.ko
      LD [M] drivers/input/joystick/iforce/iforce.ko
      LD [M] drivers/input/joystick/interact.ko
      LD [M] drivers/input/joystick/joydump.ko
      LD [M] drivers/input/joystick/sidewinder.ko
      LD [M] drivers/input/joystick/spaceball.ko
      LD [M] drivers/input/joystick/spaceorb.ko
      LD [M] drivers/input/joystick/tmdc.ko
      LD [M] drivers/input/joystick/warrior.ko
      LD [M] drivers/input/joystick/xpad.ko
      LD [M] drivers/input/joystick/zhenhua.ko
      LD [M] drivers/media/usb/gspca/gspca_main.ko

      Comment


      • #4
        XBOX 360 wireless driver / keylayout for s905 testing

        Prerequisite:
        * root access on device
        * busybox installed
        * terminal app install or adb shell access

        Install Keylayout
        su
        mount -o remount rw /system
        cp
        Vendor_045e_Product_0719.kl /system/usr/keylayout
        chmod 644 /system/usr/keylayout/Vendor_045e_Product_0719.kl
        reboot


        Testing out modules
        su
        insmod ff-memless.ko
        insmod xpad.ko


        test game pad ...


        (Known issue, left dpad issues scan key 704 (0x2c0) which firmware detects as power button)

        Other commands of note


        to view usb devices Vendor:Product ID use command:
        lsusb
        Attached Files
        Last edited by wwewwewwe; 01-20-2016, 16:08.

        Comment


        • #5
          Updated xbox 360 wireless driver (xpad) with reassigned scan codes so it does not caused s905 firmware to issue power button on pressing left dpad, This means d-pad scan codes have been altered to prevent firmware conflict and requires the updated keymap to assign new scan codes.

          See notes in previous email to test. Use script manager app to auto load modules on boot of android device.
          Attached Files
          Last edited by wwewwewwe; 01-28-2016, 10:40.

          Comment


          • #6
            nice, good work

            Comment


            • #7
              wwewwewwe Do you still have the rest of .ko modules you compiled? (according to your #3 post).

              I would need them to get a generic gamepad running on my Beelink M18 box (Amlogic S905) but I don't have the time right now to setup the dev environment and compile the kernel.

              Thanks in advance!

              Comment


              • #8
                Originally posted by wwewwewwe View Post
                XBOX 360 wireless driver / keylayout for s905 testing

                Prerequisite:
                * root access on device
                * busybox installed
                * terminal app install or adb shell access

                Install Keylayout
                su
                mount -o remount rw /system
                cp
                Vendor_045e_Product_0719.kl /system/usr/keylayout
                chmod 644 /system/usr/keylayout/Vendor_045e_Product_0719.kl
                reboot


                Testing out modules
                su
                insmod ff-memless.ko
                insmod xpad.ko


                test game pad ...


                (Known issue, left dpad issues scan key 704 (0x2c0) which firmware detects as power button)

                Other commands of note


                to view usb devices Vendor:Product ID use command:
                lsusb
                NICE!!!!

                Thanks for doing this...

                Bob
                "Pzebacz im, bo nie wiedzą, co czynią"
                "Прости им, они не ведают, что творят"
                "Perdona loro perché non sanno quello che fanno"
                "Vergib ihnen, denn sie wissen nicht, was sie tun"
                "Vergeef hen want ze weten niet wat ze doen"
                "Pardonne-leur car ils ne savent pas ce qu'ils font"
                "Perdónalos porque no saben que lo que hacen"
                "Oprosti im, jer ne znaju što čine"
                "Forgive them as they know not what they do"





                Comment


                • #9
                  Originally posted by CoMiKe View Post
                  wwewwewwe Do you still have the rest of .ko modules you compiled? (according to your #3 post).

                  I would need them to get a generic gamepad running on my Beelink M18 box (Amlogic S905) but I don't have the time right now to setup the dev environment and compile the kernel.

                  Thanks in advance!
                  Yes please for me too. I need especially the hid-dr.ko

                  Thank you!.

                  Comment


                  • #10
                    Thank you very much! Xbox joy works good.
                    And how about bluetooth keyboards? I have kl from my galaxy note 3, but it doesn't work with s905 too (beelink M18)

                    Comment


                    • #11
                      I've been trying to compile the modules needed for my joystick (hid-pl.ko) and I succeeded compiling but, when I load the module on my Beelink M18 using insmod, the device hangs.

                      I tried to compile them on Ubuntu 15.10 and Ubuntu 14.04.4 with gcc-aarch64-linux-gnu (v4.8), but I haven't been able to get the modules working.

                      Just for the record, these are the instructions I used:

                      Code:
                      mkdir -p .git/hooks
                      make defconfig ARCH=arm64
                      make menuconfig ARCH=arm64
                      make modules ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8
                      I tried with the modules as generated by the compiler and also stripping the modules (aarch64-linux-gnu-strip --strip-debug <module>.ko).

                      I also tried with different kernel sources from here:
                      http://openlinux.amlogic.com:8000/download/ARM/kernel/

                      Any recommendation to get working modules?

                      Comment


                      • #12
                        hi when i got to
                        > make ARCH=arm64 meson64_defconfig

                        make: gcc: Command not found
                        HOSTCC scripts/kconfig/conf.o
                        /bin/sh: 1: gcc: not found
                        make[1]: *** [scripts/kconfig/conf.o] Error 127
                        make: *** [meson64_defconfig] Error 2

                        I have gcc but perhaps for x86 any idea's where i am going wrong?

                        Comment


                        • #13
                          Originally posted by blackest View Post
                          hi when i got to
                          > make ARCH=arm64 meson64_defconfig

                          make: gcc: Command not found
                          HOSTCC scripts/kconfig/conf.o
                          /bin/sh: 1: gcc: not found
                          make[1]: *** [scripts/kconfig/conf.o] Error 127
                          make: *** [meson64_defconfig] Error 2

                          I have gcc but perhaps for x86 any idea's where i am going wrong?
                          Maybe ..

                          nstall Dev env on ubuntu 14.4
                          sudo apt-get install gcc-aarch64-linux-gnu

                          sudo apt-get install libc6-dev

                          sudo apt-get install gcc

                          sudo apt-get install g++

                          sudo apt-get install make

                          sudo apt-get install dpkg-dev

                          sudo apt-get install ncurses-dev

                          sudo apt-get install lzop
                          if [ $up.post.type = $type.two.lazy.to_use_google ] || [ $up.post.type = $type.silly_question ];
                          then mv $user.contact.up.post /.trash; set response($response.type = ignore);
                          $user.up.post.ignore_in_future = true; fi;

                          Comment


                          • #14
                            Originally posted by abdul_pt View Post

                            Maybe ..

                            hmm I did this with ubuntu on my mac book and it didnt work
                            well i had an acer dual booting win 10 and mint and junked mint for ubuntu 14.04 (same as on the mac) of course its now making .o files

                            actually stock might not be so bad discovered my usb sata dock with i think cmedia audio built in works for audio in and out.
                            I plugged a web cam into the dock and that worked.

                            skype voice call was fine, switching to video the audio in switched off and audio out switched to the monitor.

                            camera app brought up webcam but recorded a green pic but the screenshot tool recorded my mug shot

                            surprised you bet I was

                            Comment


                            • #15
                              I got this error during compilation...
                              " CC drivers/amlogic/crypto/aml-sha-dma.o
                              CC fs/proc/proc_devtree.o
                              drivers/amlogic/crypto/aml-sha-dma.c: In function ‘aml_sha_update_dma_start’:
                              drivers/amlogic/crypto/aml-sha-dma.c:426:28: error: ‘final’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
                              return aml_sha_xmit_start(dd, dsc, ctx->fast_nents, final);
                              ^
                              cc1: all warnings being treated as errors
                              make[3]: *** [drivers/amlogic/crypto/aml-sha-dma.o] Error 1
                              make[2]: *** [drivers/amlogic/crypto] Error 2
                              make[1]: *** [drivers/amlogic] Error 2
                              make: *** [drivers] Error 2
                              make: *** Waiting for unfinished jobs....

                              CC fs/proc/kmsg.o
                              CC fs/nfs/nfs4xdr.o
                              CC fs/proc/page.o
                              CC fs/nfs/nfs4state.o
                              LD fs/proc/proc.o

                              "

                              Any ideas how to solve it? Thanks

                              Comment

                              Working...
                              X