[KERNEL]Kernel with full support for XBox 360 / One controllers[v1.3]

hennamann

New member
Jun 20, 2017
1
2
0
Stavanger
Noticed that Nvidia released the sources for the latest update, seeing as how no one has recompiled the new kernel with the latest driver, I decided to do it myself using the information shared by others in this thread. Here is a link to download it: "https://drive.google.com/open?id=0B003rqnaMJB_S2xRbUx4bmlfbWM" I compiled it for the 2015 base model, and has only been tested with the 2015 base model, from my understanding it should work with both 2015 models, but not with the 2017 model.
 
  • Like
Reactions: trblz and Toniooo

Toniooo

Senior Member
Oct 31, 2009
89
42
0
Crotone
Noticed that Nvidia released the sources for the latest update, seeing as how no one has recompiled the new kernel with the latest driver, I decided to do it myself using the information shared by others in this thread. Here is a link to download it: "https://drive.google.com/open?id=0B003rqnaMJB_S2xRbUx4bmlfbWM" I compiled it for the 2015 base model, and has only been tested with the 2015 base model, from my understanding it should work with both 2015 models, but not with the 2017 model.
tired and work well on my shield tv 2015 16gb :D
 

haze_nme

Senior Member
Apr 27, 2010
84
105
0
Tucson, AZ
Source for kernel with xpad.c backported from linux 4.13rc2

Here is a repo for the kernel source with backported xpad driver from Linux 4.13rc2

https://github.com/hazenme/android_shield_kernel

Latest commit to upstream xpad.c was 20170618

There were only a few merge conflicts that needed to be resolved manually, but you can cherry-pick these commits into your own repo very easily.

I updated the upstream android_kernel_common android-3.10 branch back in 2015 with the backported xpad.c changes and it looks like nvidia has not pulled them from upstream android (android.googlesource.com).

If anyone knows if nvidia runs a gerrit instance for submitting changes, I would love to submit these changes for the next official release since they are not tracking the upstream android common kernel.
 

haze_nme

Senior Member
Apr 27, 2010
84
105
0
Tucson, AZ
I have initialized my repo to "git://nv-tegra.nvidia.com/manifest/android/binary.git -b rel-24-uda-r1.1-partner -m tlk/t210.xml"

Synced.

Then built the kernel using the following:

export TOP=`pwd`
cd vendor/nvidia/licensed-binaries
./extract-nv-bins.sh
cd $TOP
. build/envsetup.sh
setpaths
lunch darcy-userdebug
mp bootimage


Rebooted to fastboot and booted directly to the created boot.img in out/target/product/t210/boot.img (I'm running stock 5.2 non-dev)

It boots, but I do not have working USB. It feels like vendor blobs are mismatched or missing in the open source tree.

Before I go down the rabbit hole of troubleshooting non-working USB in the open source kernel, has anyone successfully built a kernel (With working USB) using the posted source for the 2017 Shield TV (darcy)?
 

trblz

New member
Aug 16, 2017
1
0
0
Just wanted to thank everyone for the excellent information in this thread.

I've been running the old 3.1 firmware with modified kernel xpad drivers on my 2015 Shield for quite a while, everything has been perfect.

Figured I might as well update to 5.2, everything went fine thanks to the info here.

- First I updated directly from my Shield, it made me update to 3.3 first then to 5.2

- Flashed the kernel posted above by hennamann (thank you!), worked perfectly

- Reinstalled SuperSU

At this point I thought I was done, but the home button wasn't working nor the right analog stick.

I never had to do anything to the keylayout file on earlier firmware, but I found there was no longer a keylayout that matched my hardware id.

Checked my device list via adb and found that the product ID of my offical wireless Xbox 360 receiver was showing up as 02a1 (not 0291) so I created a new keylayout as suggested here https://forum.xda-developers.com/showpost.php?p=67691145 named it correctly, and pushed it to the keylayout folder.

After rebooting everything was working except the d-pad seemed to be registering double presses for each actual button press.

The suggested keylayout contained the following:

# Hat.
axis 0x10 HAT_X
axis 0x11 HAT_Y

# Dpad
key 704 DPAD_LEFT
key 705 DPAD_RIGHT
key 706 DPAD_UP
key 707 DPAD_DOWN

I found I could only have one of the above in the keylayout, otherwise each D Pad press would register as 2.

When the keylayout contained only the Hat section as detailed above, holding down the D Pad would only register as 1 press - for example, navigating on the Shield home screen would require multiple presses to navigate.

When the keylayout contained only the Dpad section as detailed above, holding down the D Pad worked the way I expected - for example, when navigating the Shield home screen I can hold the D pad button down and the highlighted section would navigate in that direction until I let go.

So I opted to remove the #Hat section and leave the #Dpad mapping -- Did anyone else have this issue? Not sure why both would be suggested for the keylayout. Wasn't sure what the difference is... but I guess if you use the Hat axis mapping it would be incorrectly detecting the Dpad as analog? Would be curious if anyone can clarify.

Other than dealing with the keylayout, no issues. Just thought I would share how my upgrade went in case it helps anyone out in the future.

Thank you to everyone for the great information here, I could not stand the blinking light on the controller.
 
Last edited:

ricflairandy

Senior Member
Mar 9, 2009
52
1
0
Just wanted to thank everyone for the excellent information in this thread.

I've been running the old 3.1 firmware with modified kernel xpad drivers on my 2015 Shield for quite a while, everything has been perfect.

Figured I might as well update to 5.2, everything went fine thanks to the info here.

- First I updated directly from my Shield, it made me update to 3.3 first then to 5.2

- Flashed the kernel posted above by hennamann (thank you!), worked perfectly

- Reinstalled SuperSU

At this point I thought I was done, but the home button wasn't working nor the right analog stick.

I never had to do anything to the keylayout file on earlier firmware, but I found there was no longer a keylayout that matched my hardware id.

Checked my device list via adb and found that the product ID of my offical wireless Xbox 360 receiver was showing up as 02a1 (not 0291) so I created a new keylayout as suggested here https://forum.xda-developers.com/showpost.php?p=67691145 named it correctly, and pushed it to the keylayout folder.

After rebooting everything was working except the d-pad seemed to be registering double presses for each actual button press.

The suggested keylayout contained the following:

# Hat.
axis 0x10 HAT_X
axis 0x11 HAT_Y

# Dpad
key 704 DPAD_LEFT
key 705 DPAD_RIGHT
key 706 DPAD_UP
key 707 DPAD_DOWN

I found I could only have one of the above in the keylayout, otherwise each D Pad press would register as 2.

When the keylayout contained only the Hat section as detailed above, holding down the D Pad would only register as 1 press - for example, navigating on the Shield home screen would require multiple presses to navigate.

When the keylayout contained only the Dpad section as detailed above, holding down the D Pad worked the way I expected - for example, when navigating the Shield home screen I can hold the D pad button down and the highlighted section would navigate in that direction until I let go.

So I opted to remove the #Hat section and leave the #Dpad mapping -- Did anyone else have this issue? Not sure why both would be suggested for the keylayout. Wasn't sure what the difference is... but I guess if you use the Hat axis mapping it would be incorrectly detecting the Dpad as analog? Would be curious if anyone can clarify.

Other than dealing with the keylayout, no issues. Just thought I would share how my upgrade went in case it helps anyone out in the future.

Thank you to everyone for the great information here, I could not stand the blinking light on the controller.
Thanks mate

My box is currently on 5.1 and rooted. Can i add this without a reflash and avoid loosing my data.

Cant stand the shield controller.
 

Toniooo

Senior Member
Oct 31, 2009
89
42
0
Crotone
5.02 source has been up almost since launch of the update for Shield TV 2015. I recently tried my hand at compiling, using the excellent sources cited, and got a working kernel img for 5.02. I'm still waiting on 5.1 kernel sources, but this should help for those waiting on 5.02. It uses xpad from kernel.org.


Thanks!
your kernel still works in Update 6.0
:cool::cool::cool::cool:
 

Toniooo

Senior Member
Oct 31, 2009
89
42
0
Crotone
Just wanted to thank everyone for the excellent information in this thread.

I've been running the old 3.1 firmware with modified kernel xpad drivers on my 2015 Shield for quite a while, everything has been perfect.

Figured I might as well update to 5.2, everything went fine thanks to the info here.

- First I updated directly from my Shield, it made me update to 3.3 first then to 5.2

- Flashed the kernel posted above by hennamann (thank you!), worked perfectly

- Reinstalled SuperSU

At this point I thought I was done, but the home button wasn't working nor the right analog stick.

I never had to do anything to the keylayout file on earlier firmware, but I found there was no longer a keylayout that matched my hardware id.

Checked my device list via adb and found that the product ID of my offical wireless Xbox 360 receiver was showing up as 02a1 (not 0291) so I created a new keylayout as suggested here https://forum.xda-developers.com/showpost.php?p=67691145 named it correctly, and pushed it to the keylayout folder.

After rebooting everything was working except the d-pad seemed to be registering double presses for each actual button press.

The suggested keylayout contained the following:

# Hat.
axis 0x10 HAT_X
axis 0x11 HAT_Y

# Dpad
key 704 DPAD_LEFT
key 705 DPAD_RIGHT
key 706 DPAD_UP
key 707 DPAD_DOWN

I found I could only have one of the above in the keylayout, otherwise each D Pad press would register as 2.

When the keylayout contained only the Hat section as detailed above, holding down the D Pad would only register as 1 press - for example, navigating on the Shield home screen would require multiple presses to navigate.

When the keylayout contained only the Dpad section as detailed above, holding down the D Pad worked the way I expected - for example, when navigating the Shield home screen I can hold the D pad button down and the highlighted section would navigate in that direction until I let go.

So I opted to remove the #Hat section and leave the #Dpad mapping -- Did anyone else have this issue? Not sure why both would be suggested for the keylayout. Wasn't sure what the difference is... but I guess if you use the Hat axis mapping it would be incorrectly detecting the Dpad as analog? Would be curious if anyone can clarify.

Other than dealing with the keylayout, no issues. Just thought I would share how my upgrade went in case it helps anyone out in the future.

Thank you to everyone for the great information here, I could not stand the blinking light on the controller.
your kl differ from mine that work well on my shield 2015 16 gb
here a copy ;)
 

Attachments

Cjoman

Member
Apr 18, 2018
32
6
0
Because of the annoying constantly blinking LEDs of the wireless Xbox 360 controller I decided to compile an updated kernel myself.
I was Inspired by this post.
This kernel is 100% Nvidia source. The only difference is the backported xpad driver.
It is intended for use with Nvidia Shield Marshmallow firmware including zulu99's StockRestyle and full Android Marshmallow firmwares.

I have only tested it with the Pro model. It has been reported that it works with the 16GB model also.
Xbox One controllers are working also but only wired.
You can test the kernel by booting the new kernel with fastboot boot boot_xpad.img before flashing it.
If you are using systemless SuperSU (v2.56+) keep in mind that you will lose root when you flash or boot a new kernel.

Installation:

Code:
adb reboot bootloader

fastboot flash boot boot_xpad.img
Afterwards you can install SuperSU again by booting into recovery and installing the SuperSU.zip.

Download:
v1.4 kernel for firmware v3.3.0 with latest xpad driver from kernel.org
https://mega.nz/#!kUFHDSrY!eBMGNwKvTvr0TGyKRL2sNZQvscelxmGOA3RjKFXoaho

v1.3 kernel for firmware v3.2.0 with xpad driver from Linux kernel 4.7 rc6
https://mega.nz/#!UI1TwCaL!S8BCXWaKBU282mgW_TOtZfFN_69rG_BJnMwYdEkLUxc

v1.2 kernel for firmware v3.1.0 with latest xpad driver from Valve
https://mega.nz/#!cdExRSRI!FyhswyMsBRl3QrrPG--U0EYi_UMwjVi7e3Qiui2xKls

v1.1 kernel for firmware v3.0.0 with latest xpad driver from Valve
https://mega.nz/#!cZF3QZaD!bkQLTwECsH08cxCeef3s7ZR25hqLrr2gc6pNbvDLqm4

v1.0 kernel for firmware v3.0.0 with xpad driver from Linux kernel 4.5
https://mega.nz/#!sNNkCTZQ!TQVxESGSRadb0ueync5uGhnjf2obYzw_Mhh_tGLVgiE

Changelog:

Code:
v1.4
 - kernel for firmware 3.3.0
v1.3
 - kernel for firmware 3.2.0
v1.2
 - kernel for firmware 3.1.0
v1.1
 - found a newer version of the xpad driver directly from Valve
 - support for Xbox One Elite and a few other third party controllers has been added
Does this work with lenovo p70 a??