FORUMS
Remove All Ads from XDA

[Fire TV 2 Kernel Module] Xbox One Controller Support

31 posts
Thanks Meter: 24
 
By bash-ninja, Member on 16th December 2015, 10:13 PM
Post Reply Email Thread
This is the XPAD linux kernel module, built for the Fire TV 2. Kindly enough, Amazon built their kernel with module support, so we can load modules. We'll have to wait until we get kexec before we can fully replace the kernel.

Note: I added modules for the Fire TV 1, but I don't own a Fire TV 1 so they're unsupported. I've had others tell me they work great though.

Demo Video

Prerequisites:
rooted amazon fire tv 2

Instructions:
  1. Download the Zip and extract the two modules
  2. Copy the modules to your fire tv wherever you like
  3. Open a shell.
  4. Type these commands, accept root permission on your FireTV if prompted:
    Code:
    su
    mount -o remount,rw /system
    cp /system/usr/keylayout/Vendor_045e_Product_0291.kl /system/usr/keylayout/Vendor_045e_Product_02d1.kl
    chmod 644 /system/usr/keylayout/Vendor_045e_Product_02d1.kl
    mount -o remount,ro /system
    reboot
  5. When your FireTV comes back up, open a shell again.
  6. Type these commands, accept root permission on your FireTV if prompted:
    Code:
    su
    insmod <module location>/ff-memless.ko
    insmod <module location>/firepad.ko

Your controller should instantly work. Upon every reboot you'll have to 'insmod' the modules again.

A nice way to deal with this is D4rKn3sSyS's Module Loader Apk from 2011.
You can find that here: http://forum.xda-developers.com/show....php?t=1228605
Basically, you need to give it permanent root access, add your modules in the list, save them, and go into the settings of the app to enable it on boot. (Use the Menu key on your remote to enter the settings)

Enjoy!

Use at your own risk!
Source can be found here:
https://gitlab.com/miketweaver/andro..._amazon_sloane

Thanks goes to:
  • zeroepoch - For root. You rock, my friend.
  • xpad developers - They coded the module. I just changes a few function names to make it work on the firetv2.

Prebuilt Kernel Modules (DIY instructions found in next post)
Download Mirrors:
Fire TV 1 - OUTDATED
Fire TV 2
Attached Files
File Type: zip firepad1.1.zip - [Click for QR Code] (147.2 KB, 246 views)
The Following 10 Users Say Thank You to bash-ninja For This Useful Post: [ View ] Gift bash-ninja Ad-Free
 
 
16th December 2015, 10:13 PM |#2  
bash-ninja's Avatar
OP Member
Thanks Meter: 24
 
More
DIY/Build Instructions
Only if you want to build yourself. Prebuilt modules are found in the post above.
These instructions are geared towards a linux machine, though you may be able to adapt it to a windows environment.

Build Setup
  1. Download and extract the AArch64 compiler
    http://developer.android.com/ndk/downloads
  2. Clone the repo
    Code:
    $ git clone https://gitlab.com/miketweaver/android_kernel_amazon_sloane.git
    $ cd android_kernel_amazon_sloane/
  3. Setup the build environment
    Code:
    $ export PATH=<path_to_ndk>/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin:$PATH
  4. Create the kernel config
    Code:
    $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- mt8173_sloane_defconfig
  5. Set Firepad to be a module in the kernel config
    Code:
    $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- menuconfig
    Device Drivers -> Input Device Support -> Joysticks/Gamepads
    Hit <M> to set "X-box Gamepad Support" as a module
    (optional) Hit <space> to add "X-Box gamepad rumble support (NEW)" and "LED Support for Xbox360 controller 'BigX' LED (NEW)", if desired.
  6. Build the kernel and modules
    Code:
    $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j<num_cores>
  7. Copy the kernel and modules
    Code:
    $ cp arch/arm64/boot/Image <target_dir>/
    $ find . -name '*ko' -exec cp '{}' ~/<target_dir>/ \;
    The module you're looking for is "firepax.ko" and (optional) "ff-memless.ko".
  8. Clean kernel sources (optional)
    Code:
    $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- mrproper
The Following 3 Users Say Thank You to bash-ninja For This Useful Post: [ View ] Gift bash-ninja Ad-Free
17th December 2015, 06:38 AM |#3  
bash-ninja's Avatar
OP Member
Thanks Meter: 24
 
More
I added information about a good module loader.
http://forum.xda-developers.com/show....php?t=1228605
This solves the issue with the modules not surviving reboot.
The Following User Says Thank You to bash-ninja For This Useful Post: [ View ] Gift bash-ninja Ad-Free
17th December 2015, 12:46 PM |#4  
Senior Member
Flag San Francisco, CA
Thanks Meter: 206
 
Donate to Me
More
It looks like you forgot to add the new files to the repo since they were untracked, although the old files were removed. I'm not trying to build it just an observation.
17th December 2015, 09:20 PM |#5  
Senior Member
Thanks Meter: 150
 
More
Any chance this can be done for the first Fire TV?
17th December 2015, 09:42 PM |#6  
bash-ninja's Avatar
OP Member
Thanks Meter: 24
 
More
Quote:
Originally Posted by Sizzlechest

Any chance this can be done for the first Fire TV?

I don't have a firetv 1, but I should be able to cross compile for it. Give me a bit to check if I can build the kernel for it. Once I get it done, would you be willing to test?
The Following User Says Thank You to bash-ninja For This Useful Post: [ View ] Gift bash-ninja Ad-Free
17th December 2015, 10:06 PM |#7  
bash-ninja's Avatar
OP Member
Thanks Meter: 24
 
More
Quote:
Originally Posted by zeroepoch

It looks like you forgot to add the new files to the repo since they were untracked, although the old files were removed. I'm not trying to build it just an observation.

Wow, that's a rookie mistake. Thanks for pointing that out. Fixed.

I also added the build instructions, for those who want to build themselves, or would like a guide on building the kernel for the fire tv 2.
17th December 2015, 10:17 PM |#8  
Junior Member
Flag Austin, TX
Thanks Meter: 14
 
More
Awesome! Thanks @bash-ninja ... I'm still trying to compile the aftv2 kernel with some of zeroepoch's fixes, but you're howto guide definitely helps. I might go buy a used xbox one controller just to test this.. lol.

Good work!
17th December 2015, 10:22 PM |#9  
bash-ninja's Avatar
OP Member
Thanks Meter: 24
 
More
Quote:
Originally Posted by z_thompsonpa

Awesome! Thanks @bash-ninja ... I'm still trying to compile the aftv2 kernel with some of zeroepoch's fixes, but you're howto guide definitely helps. I might go buy a used xbox one controller just to test this.. lol.

Good work!

The guide is a simple adaptation of the Readme found in @zeroepoch's repo. The thanks goes to him!
18th December 2015, 05:52 AM |#10  
Senior Member
Thanks Meter: 150
 
More
Quote:
Originally Posted by bash-ninja

I don't have a firetv 1, but I should be able to cross compile for it. Give me a bit to check if I can build the kernel for it. Once I get it done, would you be willing to test?

Absolutely!
The Following User Says Thank You to Sizzlechest For This Useful Post: [ View ] Gift Sizzlechest Ad-Free
18th December 2015, 05:38 PM |#11  
bash-ninja's Avatar
OP Member
Thanks Meter: 24
 
More
Quote:
Originally Posted by Sizzlechest

Absolutely!

Go ahead and give these a try:
https://www.androidfilehost.com/?fid=24269982087021362
The Following User Says Thank You to bash-ninja For This Useful Post: [ View ] Gift bash-ninja Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes