,

1.  XCAP Application Note — Installation: nVidia/ARM TX1/Cortex-A57 — 1 May 2018

This application note outlines the installation of XCAP on the nVidia TX1 with ARM Cortex-A57 processor running Linux. Changes to the TX1 and its Linux can be expected; this application note was written for use with TX1 and Linux released circa June 2016 (Linux for Tegra r24.1).

1. Update Linux. The original release of Linux for nVidia TX1 supported a 64 bit kernel and 32 bit applications. Update nVidia TX1 with newer version of Linux supporting a 64 bit kernel and 64 bit applications. This requires a second computer running Linux connected to the TX1 via USB cable; follow instructions provided by nVidia.

2. Install JRE. Unlike XCAP for x86 and x86−64 platforms, XCAP for nVidia TX1 does not include a Java Runtime Environment. Install the default Java JRE from the Linux distribution:

    apt-get update
    apt-get -y install default-jre

3. Install XCAP. XCAP for TX1 is not provided on the PIXCI(R) CD, and only available via download. Download xcaplnx_aarch64.bin from www.epixinc.com/support/files.php. Do:

    chmod 755 xcaplnx_aarch64.bin
    ./xcaplnx_aarch64.bin

Note that only XCAP-Lite is supported for the nVidia TX1 - intended as a testing and configuration tool to assist in for developing application programs using the XCLIB C/C++ library. XCAP-Ltd and XCAP-Std are currently not supported for the nVidia TX1.

Newer versions of the JRE do not accept a ‘-client’ option. With releases of XCAP prior to Jan 2017, it may be necessary to edit /usr/local/xcap/xcaplnx and /usr/local/xcap/program/xcaplnx and remove the ‘-client’ option.

4. Install PIXCI(R) driver. One or more precompiled PIXCI(R) drivers are provided with XCAP. If one of these drivers match the current kernel, use XCAP’s:

    PIXCI(R)
    PIXCI(R) Open/Close
    Close (if open)
    Driver Assistant
    Install PIXCI(R) Driver
    Install Precompiled Driver
    Apply

Alternately, the PIXCI(R) driver can be compiled so as to match the current kernel. Install the kernel build modules:

    apt-get update
    apt-get -y install build-essential
    apt-get -y install module-assistant

Use XCAP’s:

    PIXCI(R)
    PIXCI(R) Open/Close
    Close (if open)
    Driver Assistant
    Install PIXCI(R) Driver
    Compile & Install Driver
    Apply

Note: The kernel module build process uses two utilities supplied by nVidia, modpost and fixdep. In some (all?) distributions, these are x86 executable files, not ARM A57 executable files, causing errors when compiling the PIXCI(R) driver on the TX1. Check with:

    find / -name modpost -exec file {} ";"
    find / -name fixdep  -exec file {} ";"

In the event of error, recompile the utility using normal Linux build procedures: find utility and its directory, find corresponding ‘makefile’ (i.e. in same directory or a parent directory), run ‘make’.

5. Configure TX1 memory. Unlike Linux for x86 and x86−64 systems providing a single, large, pool of memory, the Linux for TX1 partitions memory into various pools each with a designated purpose. The PIXCI(R) driver allocates frame buffer memory from the kernel’s ‘coherent-pool’ (i.e. DMA pool). The default TX1 coherent-pool is 1024 KB and allows, approximately, 512 KB of frame buffer memory. Edit /boot/extlinux/extlinux.conf and add, for example:

    vmalloc=256M cma=128M coherent-pool=96M

to the kernel command line so as to allow additional frame buffer memory. Note: The long kernel command line may be displayed by the editor as split into several lines; but it must be edited as a single line without line break.

There are many considerations in selecting these and other boot parameters for the nVidia TX1; this application note is not intended as a treatise on the subject.

The amount of frame buffer memory available for image capture is also determined by the amount of memory requested by the PIXCI(R) driver. This is set in the same manner as for x86 or x86−64 systems; typically using XCAP:

    PIXCI(R)
    PIXCI(R) Open/Close
    Close (if open)
    Driver Assistant
    Set Frame Buffer Memory Size
    ...

XCAP’s ‘Forceful Memory Allocation’ option, used with the memory architecture of x86 and x86−64 systems, is not applicable to the TX1.

6. Reboot TX1.

7. Configure memory clock speed. The TX1 memory clock speed can be adjusted. Lower speed presumably consumes lower power, but provides lower bandwidth for video capture. Higher speed presumably consumes more power, but provides higher bandwidth for video capture, and thus a potential remedy for ‘PCI FIFO Overflow’ error. See the

    jetson_clocks.sh

command and http://elinux.org/Jetson/Performance.

While this application note makes note of this Jetson feature, its impact on PCIe bandwidth has not been confirmed.

8. If using the XCLIB or XCLIB+PXIPL C/C++ library, download: xclib_aarch64.bin or xclip_aarch64.bin from www.epixinc.com/support/files.php. Install with:

    chmod 755 xclib_aarch64.bin
    ./xclib_aarch64.bin

or

    chmod 755 xclip_aarch64.bin
    ./xclip_aarch64.bin

9. Tegra r24.2 issues. A bug in Tegra r24.2 prevents PCIe DMA from working properly; in context of the PIXCI(R) frame grabber: image data is not captured, and Tegra may crash. The following script, published by Ximea, appears to provide a usable fix:

cd /usr/src/linux-headers-$(uname -r)
sudo make modules_prepare
sudo scripts/dtc/dtc -I dtb $(grep FDT /boot/extlinux/extlinux.conf|sed ’s/.*FDT //’) -o /boot/devicetree.dts
sudo sed -i~ -e ’/{$/ h ; x ; /pcie-controller / { x ; /iommus/ d ; x } ; x’ /boot/devicetree.dts
sudo scripts/dtc/dtc /boot/devicetree.dts -O dtb -o /boot/devicetree.dtb
sudo sed -i~ -e ’s|FDT .*|FDT /boot/devicetree.dtb|’ /boot/extlinux/extlinux.conf
sudo reboot

The script must be executed with super-user privileges. Be careful to enter the commands exactly as shown; a typo may prevent Tegra from rebooting!

10. Tegra R24.2.0 issues. The r24.2.0 release reports a ‘unusual’ kernel release identifier (i.e. ‘3.10.96+’), and kernel build modules do not seem to be available. Drivers can’t be compiled for use with this release.