Browse KB Articles
Using Linux with USB 3.1
KB Number: 10685
Technical Application Note (TAN2012007): Using Linux with USB 3.1
Application Note Description
This Application Note explains the components and steps that are necessary to install and configure Linux for use with FlyCapture and USB 3.1. Testing is ongoing. Wherever possible, limitations have been noted; however, as more testing is completed this information may change. All possible configurations may not experience the same results.
Supported System Configuration
Before installing, you must have the following prerequisites:
The configuration of the test environment we used was:
For Ubuntu installation instructions see the Ubuntu documentation at:
For FlyCapture2 to run on a Linux Ubuntu system, the following dependencies must be installed:
These libraries are usually packaged with Ubuntu distributions or updates. If they are not pre-installed, use the apt-get console command, as in the following examples:
user$: sudo apt-get install libgtkmm-2.4-dev libglademm-2.4-dev libusb-1.0-0
If you have already installed a version of Ubuntu but are unsure if it supports USB 3.1 run the following command:
$ uname -r
The results look like this:
If the version is 3.5.0 or newer, it supports USB 3.1 and you can move to the next section, Configuring USBFS.
If the version is older than 3.5.0, run the update manager tool to install the newest updates, or run the following command:
$ sudo apt-get update && sudo apt-get upgrade
To install the kernel run the following command:
$ sudo apt-get install linux-generic-lts-quantal
If you prefer not to upgrade, proceed to Compiling a Custom Kernel for USB 3.1 Support to manually configure your system.
By default, Linux limits image capture to 2 MB. To capture images over 2 MB, extend the USBFS limit on how many buffers can be locked into the driver. This is done by updating the boot params in grub. You can set the memory limit until the next reboot, or set it permanently.
$ sudo modprobe usbcore usbfs_memory_mb=1000
1. Open the /etc/default/grub file in any text editor. Find and replace:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.usbfs_memory_mb=1000"
2. Update grub with these settings:
$ sudo update-grub
3. Reboot and test a USB 3.1 camera.
If this method fails to set the memory limit, run the following command:
$ sudo sh -c 'echo 1000 > /sys/module/usbcore/parameters/usbfs_memory_mb'
To confirm that you have successfully updated the memory limit, run the following command:
To install the FlyCapture2 SDK:
The packages with a preceding 'lib' are all the shared objects and their respective dev packages. The flycap package installs the capture application which can be launched by entering 'flycap' in a terminal or through the applications menu. The flycapture-doc package contains Point Grey documentation in pdf format.
user$ sudo sh install_flycapture.sh
Note: If you are using a USB 3.1 device on an Intel system, you may notice that the FlyCap2 viewer is slow to respond. To avoid this problem, ensure the following kernel versions are used:
Use the following commands to update the kernel:
The FlyCapture SDK includes a number of example applications to help get you started in programming common API tasks. The example files are installed under /usr/src/flycapture/src/.
Copy the extracted folder and sub-folders to a location with write access.
To compile the examples, install the GNU C++ (g++) compiler that is included with the build-essential package:
user$ sudo apt-get install build-essential
Some of the examples are GUI-based. The gtk and glade libraries are required to build these examples. These libraries should already be installed under Section 0. Note that the FlyCaptureGUI example must be built before the FlyCap2 or FlyCapture2GUITest examples can be built.
To compile a specific example, run the makefile located in the example directory. Binaries are copied to the bin directory, and libraries are copied to the lib directory. For example:
user$ cd <extraction folder>/FlyCapture-<version>/src/FlyCapture2Test
Linux users do not have access to Microsoft Windows-only technologies such as:
FlyCapture2 on a Linux device does not support:
We suggest the following tools for viewing previously recorded images and videos. FLIR does not officially endorse these tools.
For video viewing:
For working with Glade files:
To remove FlyCapture, run the uninstall script.
user$: sudo sh remove_flycapture
Delete any extracted files or newly compiled files on your system.
To compile Linux Kernel, the following is required:
To install the dependencies, run the following commands in terminal and enter the password for the user when prompted.
$ sudo apt-get install gcc
Ncurses dev package
$ sudo apt-get install libncurses5-dev
Update to the newest packages
$ sudo apt-get update && sudo apt-get upgrade
Getting the Kernel
$ wget http://www.kernel.org/pub/linux/kernel/v3.0/testing/linux-3.5-rc3.tar.bz2
$ cd Downloads/
$ sudo tar -xvf linux-3.5-rc3.tar.bz2 -C /usr/src
The unpacking may take some time.
$ cd /usr/src/linux-3.5-rc3/
Configuring the Kernel
Most of the default options for the kernel are appropriate for our use. However, you must select the ext4 file system and enable USB 3.1 support.
$ sudo make menuconfig
$ sudo gedit .config
Compiling and Installing the Kernel
Compilation can take about an hour.
$ sudo make
When asked if you want to add the commented out module, answer N.
$ sudo make modules_install install
This creates a number of files under your /boot/ directory and also makes an entry in grub.cfg for the new kernel. You should check that you have all these files in the /boot/ directory:
Once the kernel is compiled, reboot your computer. It can now capture images up to 2 MB. To capture images larger than 2 MB, follow the instructions in Configuring the USBFS.