Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

KIII AMLOGIC S905 Not picking up usb controllers (works with others)

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

    #16
    Originally posted by darro87 View Post

    Nice, glad you're having progress.

    It's probably related to the keylayout file indeed.
    Did you try GamePad Tester? It's supposed to show 'unsupported' keypresses in a text box on the GUI.

    If it works, and you got the time, use the following to build your kl file:

    Code:
    # Copyright (C) 2011 The Android Open Source Project
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    # http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    #
    # DragonRise Inc. SNES Pad (i made this up, you can rename it if you have a model number or something, it's just for documentation)
    #
    
    key 0x131 BUTTON_A
    key 0x132 BUTTON_B
    key 0x130 BUTTON_X
    key 0x133 BUTTON_Y
    key 0x134 BUTTON_L1
    key 0x135 BUTTON_R1
    key 0x136 BUTTON_L2
    key 0x137 BUTTON_R2
    key 0x138 BUTTON_SELECT
    key 0x139 BUTTON_START
    key 0x13a BUTTON_THUMBL
    key 0x13b BUTTON_THUMBR
    
    axis 0x00 X
    axis 0x01 Y
    axis 0x02 Z
    axis 0x05 RZ
    axis 0x10 HAT_X
    axis 0x11 HAT_Y
    You'll probably have to remove a few lines, as this follows the typical Xbox controller layout, so a SNES controller will have less buttons. The ABXY buttons are a little different on SNES vs Xbox pads as well, so keep that in mind when mapping.

    What you'll need to do is update the key 0x### lines with the corresponding code you get from your controller via the input application. Once you're done, you'll need to save the file as:

    Vendor_0079_Product_0011.kl

    This matches your controller's IDs and once installed on your box, will automatically be used for your controller.

    To install it, use the following:

    Install Keylayout
    From the terminal app, run:
    Code:
    su
    mount -o remount rw /system
    cd /storage/emulated/legacy/
    cp Vendor_0079_Product_0011.kl /system/usr/keylayout
    chmod 644 /system/usr/keylayout/Vendor_0079_Product_0011.kl
    reboot
    This will reboot your box automatically, so just remove the last line if you want to reboot it on your own. The kl file won't work til you do reboot, though, so keep that in mind. Again, this assumes that you copied the kl file to the root of your storage.

    That should do it. Good luck! Let me know if you bother giving it a go, and if you get through.

    darro87
    Cheers mate. The app i used is the one you've mentioned I had that downloaded from before and when I tested with it the buttons I said that didn't work throw out a 0 where the buttons that work give for example 96 and 97 etc. Basically the app knows there is button presses but it returns a 0. I also was on my way to making a kl file after doing some reading when I got stuck with the buttons showing a 0 instead of a number to use. I'm not sure what to do from there tho. Any ideas? I've learned quite alot in the last few days and that's down to yourself mate. Much appreciated.

    Comment


      #17
      Originally posted by cmac86 View Post

      Cheers mate. The app i used is the one you've mentioned I had that downloaded from before and when I tested with it the buttons I said that didn't work throw out a 0 where the buttons that work give for example 96 and 97 etc. Basically the app knows there is button presses but it returns a 0. I also was on my way to making a kl file after doing some reading when I got stuck with the buttons showing a 0 instead of a number to use. I'm not sure what to do from there tho. Any ideas? I've learned quite alot in the last few days and that's down to yourself mate. Much appreciated.
      Hmm..maybe. Open up terminal and enter 'getevent' ..it'll list devices connected. Plug in your controller and see if it pops up as a new device. Once it does, take note of which device it is, then press a key. The screen should fill up with some numbers, you'll have to sort through to pinpoint the values you need. The buttons will have a more or less sequential or grouped set of codes, so you can use that to figure out what numbers represent the key codes. For example, my controller had 0130, 0131, 0132, etc pop up when i pressed keys, and those corresponded to my key codes (I double checked my kl to verify). See if you have similar luck with yours.

      Comment


        #18
        Originally posted by darro87 View Post

        Hmm..maybe. Open up terminal and enter 'getevent' ..it'll list devices connected. Plug in your controller and see if it pops up as a new device. Once it does, take note of which device it is, then press a key. The screen should fill up with some numbers, you'll have to sort through to pinpoint the values you need. The buttons will have a more or less sequential or grouped set of codes, so you can use that to figure out what numbers represent the key codes. For example, my controller had 0130, 0131, 0132, etc pop up when i pressed keys, and those corresponded to my key codes (I double checked my kl to verify). See if you have similar luck with yours.
        Hey darro. I used gamepad test again and now I noticed that if I press either L1 R1 Y and X they all seemed to be linked to each other. If I was to press R1 on the gamepad app L1 Y and X also show they are being pressed. Very strange. I'm going to do some testing on my laptop with an emulator to see if the buttons are in fact the same or if I can key map them to work with something else. This will tell me that the controller does work or does not (could be the cheap controllers fault) maybe this is the reason all those buttons are showing a 0.

        Comment


          #19
          Originally posted by cmac86 View Post

          Hey darro. I used gamepad test again and now I noticed that if I press either L1 R1 Y and X they all seemed to be linked to each other. If I was to press R1 on the gamepad app L1 Y and X also show they are being pressed. Very strange. I'm going to do some testing on my laptop with an emulator to see if the buttons are in fact the same or if I can key map them to work with something else. This will tell me that the controller does work or does not (could be the cheap controllers fault) maybe this is the reason all those buttons are showing a 0.
          I think they appear linked because they all default to the same mapping (hopefully). Did the 'getevent' test give the same codes for each button as well? If not, then you should be fine, just need to map them out into the kl file. If you're having trouble reading the codes, hook up the controller and cycle through ABXY, then take a pic and post it here, I'll see if I can help decipher it with you.

          Comment


            #20
            Originally posted by darro87 View Post

            I think they appear linked because they all default to the same mapping (hopefully). Did the 'getevent' test give the same codes for each button as well? If not, then you should be fine, just need to map them out into the kl file. If you're having trouble reading the codes, hook up the controller and cycle through ABXY, then take a pic and post it here, I'll see if I can help decipher it with you.
            Success mate, I posted the previous message before reading about getevent. Tried getevent then copied down the codes for each button, created the kl file renamed it for my device id and installed it via terminal. rebooted and boom the controller works. Your a legend mate.You were correct because there was no default buttons mapped they appeared to be one button press. Seems terminal is far more accurate than the gamepad test app. Now to try and use the script so that the ko files run at start up. Thank you so much darro, you've made the family very happy (kids cant use ps3 controller, too big)

            I seem to be stuck with getting both ff-memless and hid-dr to run at boot with script manager, ive found both files in the directory where i put them from the start and edited them to show as a script and to have su permissions and boot at startup. It doesn't seem to work. For the minute i dont mind loading them via terminal but would love it to run at boot.
            Last edited by cmac86; 07 January 2017, 18:05.

            Comment


              #21
              Glad you got through it man! Congrats!

              I had a lil trouble with the script myself, so hopefully I can save you some time here as well. You can try:

              Code:
              cd /storage/emulated/legacy/
              insmod ff-memless.ko
              insmod hid-dr.ko
              As usual, this assumes the files are in the root directory.

              The options I set on my file are:

              Click image for larger version

Name:	su.jpg
Views:	264
Size:	24.7 KB
ID:	621103

              The issue I had in the earlies was putting su in the script itself, rather than just setting the su (and boot) parameter via ScriptManager as shown in the pic. Hopefully using it this way will work for you too.

              Let me know.

              Comment


                #22
                Originally posted by darro87 View Post
                Glad you got through it man! Congrats!

                I had a lil trouble with the script myself, so hopefully I can save you some time here as well. You can try:

                Code:
                cd /storage/emulated/legacy/
                insmod ff-memless.ko
                insmod hid-dr.ko
                As usual, this assumes the files are in the root directory.

                The options I set on my file are:

                Click image for larger version

Name:	su.jpg
Views:	264
Size:	24.7 KB
ID:	621103

                The issue I had in the earlies was putting su in the script itself, rather than just setting the su (and boot) parameter via ScriptManager as shown in the pic. Hopefully using it this way will work for you too.

                Let me know.
                Not sure I get what you mean mate? Is it possible to enter commands in Script manager? like "cd /storage/emulated/legacy/"
                Also when I used script manager I went to the directory (root as you've shown me) clicked on ff-memless.ko first and edited just like you have in your screenshot, I done this originally before ive read your last post but after saving and rebooting it still didn't work.

                So can I remake my steps.

                In terminal I do the steps to get the controller connected
                (cd /storage/emulated/legacy/
                insmod ff-memless.ko
                insmod hid-dr.ko)

                Once connected I open SM, then from there I find root directory where both files are. I then edit ff-memless.ko to be used as a script and tick boot su and fav. Do this the same for hid-dr.ko. Save then exit. reboot with no success,

                Thanks for helping me darro. honestly appreciate it mate.

                Comment


                  #23
                  Originally posted by cmac86 View Post

                  Not sure I get what you mean mate? Is it possible to enter commands in Script manager? like "cd /storage/emulated/legacy/"
                  Also when I used script manager I went to the directory (root as you've shown me) clicked on ff-memless.ko first and edited just like you have in your screenshot, I done this originally before ive read your last post but after saving and rebooting it still didn't work.

                  So can I remake my steps.

                  In terminal I do the steps to get the controller connected
                  (cd /storage/emulated/legacy/
                  insmod ff-memless.ko
                  insmod hid-dr.ko)

                  Once connected I open SM, then from there I find root directory where both files are. I then edit ff-memless.ko to be used as a script and tick boot su and fav. Do this the same for hid-dr.ko. Save then exit. reboot with no success,

                  Thanks for helping me darro. honestly appreciate it mate.
                  Oh, I see the issue.

                  That's not exactly how it works. You should undo those, ie delete the config for running those 2 files at boot etc.

                  What you have to do, is in the menu for script manager, click 'New Script'. Open it up in the SM Editor, and paste (or type) the code I gave you above. Once you save that, you set the 'su' and 'boot' parameters on that script file you created, and it'll run the script on boot with su permissions, which will insmod the ko files for you.

                  Sorry I wasn't clear on it earlier, my bad.

                  Let me know if you're successful!

                  Comment


                    #24
                    I'll give this a go when I get home today mate and ill get back to you. Top Man. Thanks alot darro

                    Comment


                      #25
                      Originally posted by darro87 View Post

                      Oh, I see the issue.

                      That's not exactly how it works. You should undo those, ie delete the config for running those 2 files at boot etc.

                      What you have to do, is in the menu for script manager, click 'New Script'. Open it up in the SM Editor, and paste (or type) the code I gave you above. Once you save that, you set the 'su' and 'boot' parameters on that script file you created, and it'll run the script on boot with su permissions, which will insmod the ko files for you.

                      Sorry I wasn't clear on it earlier, my bad.

                      Let me know if you're successful!
                      Hey darro, just had a go at your instructions and for some reason the controller doesn't work on boot, but to be honest this isn't a problem for me as now I can go straight into the script manager and run that script I created and the controller works straight after. For me that is less time taken where as before I had to enable both ko files via terminal so that in itself is an improvement. I want to thank you mate for helping me and also ive learned a great deal more about controllers and stuff. Cheers mate. Really appreciated your help with this. Gent.

                      Comment


                        #26
                        No problem man! Glad I could help out..take care!

                        Comment


                          #27
                          Originally posted by darro87 View Post
                          No problem man! Glad I could help out..take care!
                          Cheers mate. You too.

                          Comment


                            #28
                            Does the .ko file also works with s905x devices?

                            Sent from my GT-I9505G using Tapatalk

                            Comment


                              #29
                              Originally posted by Hez13 View Post
                              Does the .ko file also works with s905x devices?

                              Sent from my GT-I9505G using Tapatalk
                              Hey,

                              I have used a couple s905 ko files successfully on s905x devices. It may work for you as well, but I can't guarantee. There is no harm in trying however, as if they are incompatible, you'll just get an error message.

                              Hope this helps.

                              Comment


                                #30
                                Hi,

                                I'm searching the hid-dr.ko driver module(Dragonrise USB HID Gamepads. (Vendor_0079_Product_0006)) that works with a "Bqeel Y4 Max", S905X2, Android 8.1 and Kernel 4.9.76

                                I tried the one which has already been posted in this tread, but it give me this error: "insmod: failed to load hid-dr.ko: Exec format error"

                                Any help is greatly appreciated!

                                Comment

                                Working...
                                X