1.  PIXCI® Imaging Software and Drivers Installation: nVidia TX2 (ARM Cortex-A57)

This application note outlines the installation of XCAP software and drivers for PIXCI® frame grabbers on the nVidia TX2 with ARM Cortex-A57 processor running Linux. Changes to the TX2 and its Linux can be expected; this application note was written with the TX2 and Linux released circa April 2017 (Linux for Tegra r27.1). Updated information for later releases of Tegra follow.

This application note is applicable when using a separate PIXCI® frame grabber card, such as a PIXCI® EB1, with any TX2 carrier card. It is also applicable when using the PIXCI® E4TX2 — which integrates the functionality of a PIXCI® E4G2 with a TX2 carrier card.

1. Update Linux. The original release of Linux for nVidia TX2 is Tegra r27.0.1 with kernel 4.4.15-tegra. XCAP software was tested on Tegra r27.1 with kernel 4.4.15-tegra. Updating Tegra requires a second computer running Linux connected to the TX2 via USB cable; follow instructions provided by nVidia.

2. Install JRE. Unlike XCAP for x86 and x86−64 platforms, XCAP for nVidia TX2 does not include a Java Runtime Environment. If the Java JRE for Linux is not already installed, install the Java JRE from the Linux distribution and repository:

    apt-get update
    apt-get -y install openjdk-8-jre

(Use of ‘default-jre’ is not recommended; specifically, issues have been noted with openjdk−jre−11 and is not recommended).

Note: If the Java JRE for Linux is not already installed, newer releases of the XCAP installer (below) will offer to install the Java JRE from the Linux distribution and repository.

3. Install XCAP. Use the internet browser to download xcaplnx_aarch64.bin from www.epixinc.com/support/files.php. Or download with:

    wget ftp://ftp.epixinc.com/software/xcap_v38/xcaplnx_aarch64.bin

for the current release version, or:

    wget ftp://ftp.epixinc.com/downloads/xcaplnx_aarch64.bin

for the (next) prerelease version. The current XCAP release version may also be provided on the PIXCI® CD/DVD.

Do:

    chmod a+x xcaplnx_aarch64.bin
    ./xcaplnx_aarch64.bin

to execute the XCAP installer.

Note that only XCAP-Lite is supported for the nVidia TX2 - 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 TX2.

Newer versions of the JRE do not accept a ‘-client’ and/or ‘-Xincgc’ option. With older releases of XCAP, it may be necessary to edit /usr/local/xcap/xcaplnx and /usr/local/xcap/program/xcaplnx and remove the ‘-client’ and/or ‘-Xincgc’ options. Or by using:

    sed -i -e s/-client//g /usr/local/xcap/xcaplnx
    sed -i -e s/-client//g /usr/local/xcap/program/xcaplnx
    sed -i -e s/-Xincgc//g /usr/local/xcap/xcaplnx
    sed -i -e s/-Xincgc//g /usr/local/xcap/program/xcaplnx

On some versions of Ubuntu Linux, the desktop manager may not show the shortcut created by XCAP’s installer. Using the Linux file browser, find /usr/share/applications/xcap.desktop, then copy same and paste into the desktop.

4. XCAP’s installer will offer to start XCAP. Or, use the XCAP shortcut, above. Or, use

    xcap

from a terminal prompt.

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

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

Alternately, the PIXCI® driver can be compiled so as to match the current kernel.

Unfortunately, Tegra r27.1 is not configured for native compilation of the kernel, but for cross-compilation. Instructions for cross-compilation of the kernel are beyond the remit of this application note. Instead, we suggest following third party suggestions for native compilation, such as the article ‘Build Kernel and Modules - NVIDIA Jetson TX2’ at ‘www.jetsonhacks.com’.

Later releases of Tegra support native compilation, don’t require ‘www.jetsonhacks.com’, and are highly recommended.

After kernel build files are installed and tweaked for native compilation, use XCAP’s:

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

6. Configure TX2 memory. Unlike Linux for x86 and x86−64 systems which provides a single, large, pool of memory, the Linux for TX2 partitions memory into various pools each with a designated purpose. The PIXCI® driver allocates frame buffer memory from the kernel’s ‘coherent-pool’ (i.e. DMA pool).

The default TX2 coherent-pool is 1024 KB and allows, approximately, 512 KB of frame buffer memory. Edit /boot/extlinux/extlinux.conf and append, for example, a space and:

    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 some editors as split into several lines; but it must be edited as a single line without line break. (Use ‘cat /proc/cmdline’ to verify the current kernel command line).

There are many considerations in selecting these and other boot parameters for the nVidia TX2; 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® driver. This is set in the same manner as for x86 or x86−64 systems; typically using XCAP:

    PIXCI®
    PIXCI® 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 TX2.

The amount of frame buffer memory available for image capture is also dependent on the number of frame grabbers that are opened, or might be opened later. Deselecting:

    PIXCI®
    PIXCI® Open/Close
    Close (if open)
    Advanced
    Memory (tab)
    Reserve and Share Frame Buffer Memory

allows all of the memory to be used by one frame grabber and camera.

7. Reboot TX2.

8. Configure memory clock speed. The TX2 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.

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

    chmod a+x xclib_aarch64.bin
    ./xcliblnx_aarch64.bin

or

    chmod a+x xclip_aarch64.bin
    ./xcliplnx_aarch64.bin

Additional Tips:

1. If application software reports that the PIXCI® frame grabber isn’t installed, run the:

    lspci

Linux application. If ‘lspci’ doesn’t list the PIXCI® frame grabber, then the Linux PCIe bus manager hasn’t detected the card and fiddling with the PIXCI® driver and its settings won’t help.

Specifically, with a ConnectTech carrier card (circa 2017-2018), the ConnectTech Board Support Package may be required for the PCI Express slots to be activated and for the PIXCI® frame grabber to be detected. Contact ConnectTech for the Board Support Package and use of the carrier card.

In addition to the Board Support Package, the ConnectTech Elroy carrier card (circa 2017-2018) with two PCI Express slots may only detect the PIXCI® frame grabber on one of the two slots (the ‘lspci’ listing only one PIXCI® frame grabber). Contact ConnectTech for a hardware patch to enable the second PCI Express slot.

Linux for Tegra r28.2 with kernel 4.4.38-tegra:

1. The kernel module build process uses a utility supplied by nVidia, fixdep. For the Tegra r28.2, distribution, it is an x86 executable file, not ARM A57 executable files, causing errors when compiling the PIXCI® driver on the TX2. Check with:

    find /usr/src -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’ (might have to ‘touch’ the fixdep.c file so that ‘make’ believes a recompilation is needed).

This issue may also affect later versions of Tegra.

Linux for Tegra r31.0.2 with kernel 4.9.108-tegra:

1. The ‘build’ utilities necessary to compile a driver can’t be compiled. Use Linux for Tegra r31.1.

Linux for Tegra r31.1 with kernel 4.9.108-tegra:

1. The kernel module build process uses genksyms, recordmcount, and modpost utilities, supplied by nVidia, in addition to the fixdep utility (mentioned above). They may all be x86 executables and are all recompiled by the same make.

There are two copies of fixdep and other utilities under /usr/src; it is simpler to recompile both than question as to which is needed.

2. Using

    apt-get -y install default-jre

might install Open JDK 11; that version of Java throws SIGBUS or other errors. Installing:

    apt-get install openjdk-8-jre

is recommended.

An environment variable for Java isn’t set correctly; running XCAP results in:

    Unsatisfied link error ... libjawt.so

Edit /usr/local/xcap/xcaplnx and add, as second and third lines:

    LIBJAWT=$( find /usr -name libjawt.so | sed -e s:/libjawt.so:: )
    export LD_LIBRARY_PATH=$LIBJAWT

so as to point ‘LD_LIBRARY_PATH’ to the directory containing libjawt.so. If multiple versions of Java are installed, and, assuming a typical installation of the multiple versions, add, as second and third lines:

    LIBJAWT=$( find $( readlink -f /usr/bin/java | sed -e s:/bin/.*:: ) -name libjawt.so | sed -e s:/libjawt.so:: )
    export LD_LIBRARY_PATH=$LIBJAWT

The /usr/local/xcap/xcaplnx contains these lines, as comments, ready to be uncommented.

Newer releases of XCAP implement a workaround for this issue; editing /usr/local/xcap/xcaplnx is not required. (Circa July 2021).

Copyright (C) EPIX, Inc. All Rights Reserved

Updated: 27 March 2023