Xpad driver - include LED support

Hi,

I’m trying to use a Wireless Xbox 360 controller on a Xavier NX dev kit.

From what I can tell the xpad driver is compiled as a built-in but without LED support, e.g.

Screenshot_20201212_120121

This is slightly annoying as it means the LED is always flashing as if it’s not connected.

Would it be possible to either:

  • add the LED support
  • compile it as a module (or not at all) so I can add the xpad driver myself?

I can of course compile my own version of the kernel, but it would be more convenient if this could be included in the official one.

Unless there’s a reason not to I suppose rumble support could be added as well?

Many thanks,

David

Hi,
Not sure but it looks like the configs are specific to Xbox joysticks. Since kernel of each L4T release is open source, we would like users to enable these manually.

Hi DaneLLL,

Thanks for your reply.

The above image is from the menuconfig when using the default Xavier defconfig, so the “X-Box gamepad support” is already enabled as “built-in” in L4T. This means that I can’t disable it to install my own with dkms without re-compiling the kernel.

I was just wondering if it could be changed to M so it’s included as a module instead, or fully enabled so it works properly.

Alternatively could it be disabled completely?

Hi,
Since we have guidance for fetching kernel source code and build/apply kernel image, Would like to suggest you refer to the guidance for customization. Please take a look at:
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fkernel_custom.html%23

Thanks. I’m trying to do this but I’m struggling to understand what to do for step 5 (“Replace <release_packagep>/Linux_for_Tegra/kernel/Image with a copy of: $TEGRA_KERNEL_OUT/arch/arm64/boot/Image”) and beyond.

I’ve compiled the kernel on the Jetson and have the new Image file in $TEGRA_KERNEL_OUT/arch/arm64/boot/, but the Linux_for_Tegra directory that was extracted doesn’t have a kernel directory. Do I just need to make it or am I missing something?

After that it’s not clear how to install and start using the new kernel. I assume I have to copy is to /boot? I tried that but it failed to start after I rebooted, possibly because I hadn’t compiled and replaced the kernel modules?

I tried again and got the same results, I think.

The steps I took:

  • Downloaded the sources: https://developer.nvidia.com/embedded/L4T/r32_Release_v4.4/r32_Release_v4.4-GMC3/Sources/T186/public_sources.tbz2
  • Extracted the archive
  • Made an output directory
  • Set TEGRA_KERNEL_OUT to the output directory
  • Navigated to the extracted Linux_for_Tegra/source/public/kernel/kernel-4.9/
  • Ran make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig to make the config file
  • Ran make ARCH=arm64 O=$TEGRA_KERNEL_OUT menuconfig to make the changes I wanted
  • Ran make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j6

after which I had the compiled kernel. I then tried:

  • Copying $TEGRA_KERNEL_OUT/arch/arm64/boot/Image to /boot/ (after backing up the existing Image)
  • Copying $TEGRA_KERNEL_OUT/arch/arm64/boot/dts to /boot/dtb (also backed up the existing dtb directory)

When I rebooted I saw the Nvidia logo (though in yellow - because the signature doesn’t match?) and the regular boot text. It fails to start nvpmodel but continues after that. Then the screen goes black. I looked at /var/log/syslog on the sd card and found:

Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (II) NVIDIA GLX Module  32.4.4  Release Build  (integ_stage_rel)  (buildbrain@mobile-u64-4294)  Tue Oct 27 21:00:13 PDT 2020
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics device!
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (EE) NVIDIA(0): Failing initialization of X screen 0
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (II) UnloadModule: "nvidia"
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (II) UnloadSubModule: "glxserver_nvidia"
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (II) Unloading glxserver_nvidia
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (II) UnloadSubModule: "wfb"
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (II) UnloadSubModule: "fb"
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (EE) Screen(s) found, but none have a usable configuration.
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (EE)
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: Fatal server error:
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (EE) no screens found(EE)
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (EE)
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: Please consult the The X.Org Foundation support
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: #011 at http://wiki.x.org
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]:  for help.
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
Jan  3 13:36:15 david-xavier /usr/lib/gdm3/gdm-x-session[8591]: (EE)

There was nothing in /var/log/Xorg.0.log and only the same messages in Xorg.0.log.old.

It looks like nvpmodel fails with:

Jan  3 13:36:04 david-xavier nvpmodel[5565]: NVPM ERROR: Error opening /sys/devices/gpu.0/tpc_pg_mask: 2
Jan  3 13:36:04 david-xavier nvpmodel[5565]: NVPM ERROR: optMask is 2, no request for power mode

So I suspect the same things causes the Xorg errors.

What am I missing?

Finally figured it out.

Firstly, I’d downloaded just the kernel sources as that’s what suggested in the “Manually Downloading and Expanding Kernel Sources” section (at least, that seemed to be the only file ending in public_sources.tbz2). This is why I didn’t have any of the scripts or the Linux_for_Tegra/kernel directory.

Secondly, I’d not done step 7.

I now have it working. The full steps I carried out were:

  • Downloaded the BSP (which now I think was possibly unnecessary, but it helped with following the instructions)
  • Extracted the archive
  • Made an output directory
  • Set TEGRA_KERNEL_OUT to the output directory
  • Navigated to the extracted Linux_for_Tegra/source/public/kernel/kernel-4.9/
  • Ran make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig to make the config file
  • Ran make ARCH=arm64 O=$TEGRA_KERNEL_OUT menuconfig to make the changes I wanted
  • Ran make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j6
  • Ran cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image .../Linux_for_Tegra/kernel/Image
  • Ran rm .../Linux_for_Tegra/kernel/dtb/*
  • Ran cp -r $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/* .../Linux_for_Tegra/kernel/dtb
  • Ran sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=.../Linux_for_Tegra/rootfs/
  • Ran cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image /boot/
  • Ran sudo cp -r .../Linux_for_Tegra/rootfs/lib /

This time rebooting was successful and my kernel modifications were present.

1 Like