Baumer GAPI SDK for USB Multi-Camera Systems with Linux [AN201707]
Baumer GAPI SDK – Linux Baumer USB Industrial Cameras
This document describes the use of USB multi-camera systems on Linux-based computers.
Technical Background
The Linux kernel's USB module has a memory limit of 16 MB, which will result in restrictions on the use of USB multi-camera systems.
Replacing the kernel's USB module memory
Determining the memory limit
The memory limit of the Linux USB module can be determined by running the following command:
# cat /sys/module/usbcore/parameters/usbfs_memory_mb
By default, the returned value should be 16. This memory limit is a kernel startup argument that must be changed during startup. Kernel startup arguments are handled by the system's bootloader. The most common distributions such as Ubuntu, Debian or Fedora all use the grub bootloader. Here's how to change the startup arguments for the Grub bootloader.
Changing memory limit with GRUB bootloader
The /etc/default/grub[1] file contains the GRUB_CMDLINE_LINUX_DEFAULT entry. On Ubuntu systems, this entire entry looks like this: GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”.
The memory limit can be increased on the next startup by adding the usbcore.usbfs_memory_mb=xxx[2] argument.
To increase the memory limit to 1000 MB, the entire entry should be:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.usbfs_memory_mb=1000"
To apply the changes to grub, you need to run grub-mkconfig -o /boot/grub/grub.cfg as the root user.
[1] In order to change this file, you must have root user administrator rights.
[2] Memory size for USB module is given in Megabytes.
Changing Memory Limit with U-Boot-Loader
Some ARM boards use U-Boot-Loader to boot the system. This section explains how to change the USB memory limit for Nvidia Jetson. The paths may be slightly different on other cards.
To increase the memory limit you need to edit the Linux kernel startup arguments. To change the boot arguments, edit /boot/extlinux/extlinux.conf with an editor of your choice.
Look for an entry that starts like this:
APPEND console=ttyS0,115200n8 console=tty1 no_console_suspend=1 lp0_vec=2064@0xf46....
Add this to the end of this line:
usbcore.usbfs_memory_mb=XXX (Replace XXX with a value that suits your needs. Do not add a new line after adding this entry.)
Now you should reboot your system and check the USB memory limit with the following command:
# cat /sys/module/usbcore/parameters/usbfs_memory_mb
If the memory has been successfully increased, the returned value must match the initialization argument.