NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux

Developer Guide
5.1.0.2 Release


 
SIPL (Sensor Input Processing Library) Camera
 
Architecture
Running the application
Display Layout
Slave Capture
Command Line Switches
Interactive menu options
Examples
Platform configuration: SF3324 modules in two-lane DPHY mode
Camera Commands
AR0231 (Camera Module SF3324) Using 2 Lane DPHY
AR0231 (Camera Module SF3324) Using 2 Lane CPHY
AR0231 (Camera Module SF3325) Using 2 Lane DPHY
AR0231 (Camera Module SF3325) Using 2 Lane CPHY
AR0144 (Camera Module AR0144P) Using 2 Lane DPHY
Constellation 2MP Using 2 Lane DPHY
Constellation 8MP Using 4 Lane DPHY
MAX96712 RAW12 TPG Using 2 Lane DPHY
MAX96712 RGB TPG Using 2 Lane CPHY
The NvMedia nvsipl_camera sample application demonstrates how to use the NvMedia SIPL API to select and initialize a camera platform configuration. The sample uses the NvSIPLQuery, NvSIPLDeviceBlock, NvSIPLCamera, and NvSIPLClient functions to program the image devices, NVIDIA® Tegra® VI and ISP hardware engines.
nvsipl_camera provides switches to select the platform configuration and customize the selected platform configuration by specifying the enable mask. For more information about the NvSIPL API, see API documentation for NvSIPL.
Architecture
The following diagram shows the architecture of the nvsipl_camera application.
The test application has a single main() thread which parses the command line switches using a CmdLineParser object. It obtains the platform configuration using the NVSIPLQuery interfaces, then creates and configures an instance of CNvSIPLCamera. The main() thread creates CNvSIPLConsumer objects to receive the SIPL output buffers containing images obtained using the NvMediaICP or NvMediaISP API. The outputs in NvMediaImage are displayed using a CComposite object. CComposite composites the output images from a camera group and displays using NvMedia IDP. CNvSIPLConsumer can optionally dump the output RAW images to files using CFileWriter objects.
The SIPL library can optionally read images from a raw file containing output of NvMediaICP and then process them using NvMediaISP. When appropriate platform configuration is selected and command line switch ‑i is specified, main() feeds the raw frame to the SIPL library using a CNvSIPLFeeder object.
Running the application
Before you can run nvsipl_camera you must follow the procedures in Building and Running the NvMedia Samples.
To run the sample on the target
1. Change the current directory to the folder that contains the nvsipl_camera binary:
samples/nvmedia/nvsipl/test/camera/
2. Enter one of these commands to launch the application:
Without display:
$ ./nvsipl_camera -c "<platform>"
With display:
$ ./nvsipl_camera -c "<platform>" -d <id> -w <win id>
Where:
<platform> is the platform configuration name.
<id> is the display ID of the display to use.
<win id> is the ID of the display window.
Display Layout
When nvsipl_camera is run with -d option, the output images for one camera group are displayed using the layout shown below. If an output is not enabled, the corresponding portion of the display is black. You can use interactive commands to switch between the outputs of different camera groups.
If only one output is enabled on a camera group, it is displayed using the full screen.
RAW output
Link 0
ISP0 output
Link 0
ISP1 output
Link 0
RAW output
Link 1
ISP0 output
Link 1
ISP1 output
Link 1
RAW output
Link 2
ISP0 output
Link 2
ISP1 output
Link 2
RAW output
Link 3
ISP0 output
Link 3
ISP1 output
Link 3
Slave Capture
In slave capture mode, the slave (processor B) captures images from the sensors that are already programmed by the master (processor A).
When you run nvsipl_camera on processor B, you can use the ‑‑enableSlave switch to capture in slave mode.
Limitations
Before starting nvsipl_camera on the slave, you must start capture on the master. The slave can continue to capture even after the master has stopped capturing.
Enable masks specified using the ‑m command line switch must be identical for both master and slave. (See Command Line Switches.)
Platform configuration specified using the ‑c command line switch must be identical for master and slave. (See Command Line Switches.)
Command Line Switches
The following table shows the nvsipl_camera application’s command line switches.
All numeric arguments may be specified in decimal (e.g., 18) or hexadecimal (e.g., 0x12).
Switch
Description
Default Setting
-h
Displays help text.
Display only if an invalid command line argument is found.
-c "name"
Specifies name of platform configuration that describes the connection of image sensors to Xavier based platforms.
Supported configurations are displayed by the ‑h switch.
Required switch.
--link-enable-masks "<m‑AB> <m‑CD> <m‑EF> <m‑GH>"
Enables masks for links on each deserializer connected to camera groups A, B, C, and D.
The number of masks must equal the number of deserializers in the platform configuration selected with the ‑c switch.
Each mask <m-…> is a two-byte unsigned integer which applies to one deserializer, and controls the four links that can be enabled for that deserializer. If the mask is expressed as a four-digit hexadecimal number, the last digit may be 1 to enable link 0 or 0 to disable it; the next-to-last may be 1 to enable link 1 or 0 to disable it; and so on.
For example,
"0x0000 0x1101 0x0000 0x0000" disables all links on the deserializers connected to camera groups A, C, and D, and enables links 0, 2, and 3 on the deserializer connected to camera group B.
All links on all deserializers are enabled.
-d <id>
Specifies display ID to use for display output. Supported display IDs are displayed by the ‑h switch.
Display output is disabled.
-w <id>
Specifies display window ID. Supported values are 0 to 2.
0
-z <depth>
Specifies display window depth. Supported values are 0 to 255.
0
-p "x0 y0 width height"
Defines Display position (upper left corner is at x0,y0) and dimensions (width, height) of the display rectange.
Full screen display.
-f "prefix"
Sets a prefix for the output files’ filenames.
The output files contain the RAW images.
The names of the files created have the form:
<e>_cam_<s>_frame_<n>.raw
Where:
<e> is the prefix. It may begin with a pathname.
<s> is the ID of the sensor that originated the images.
<n> is the frame number.
For example, if the prefix is /home/nvidia/test, the pathname of the RAW output file for frame 10 from Sensor0 is:
/home/nvidia/test_cam_0_frame_10.raw
No output files are generated.
-r <n>
Exits application after n seconds.
Application runs forever.
-v <n>
Sets verbosity level. Supported values are 0 (only errors are printed) to 4 (maximum verbosity).
0
-t "file"
Specifies a custom platform configuration JSON file.
Application uses its built-in database of platform configurations.
-l
Lists platform configurations defined in the file specified by the -t switch.
 
-i "file"
Enables simulator mode testing and specify the RAW file to be used as input source for the SIPL library. If enabled, only one module must be enabled using -link-enable-masks.
Simulator mode is disabled.
--enableRawOutput
Enables RAW output.
Disabled.
--disableISP0Output
Disables ISP0 output.
Enabled.
--disableISP1Output
Disables ISP1 output.
Enabled.
--enableSlave
Runs the application in slave mode.
Disabled.
--showfps
Prints FPS (frames per second) messages on stdout.
Disabled.
--showmetadata
Shows metadata when ICP output is enabled.
Disabled.
Interactive menu options
The following table shows the options provided by the interactive menu.
Option
Description
ld
Lists all camera groups in use by the application.
Available only when command line switch -d is used to set a display ID.
e<id>
Displays the output of a specific camera group.
To see the available displayable outputs, use the ld option.
q
Quits the application.
Examples
Platform configuration: SF3324 modules in two-lane DPHY mode
This configuration assumes that 16 SF3324 camera modules are connected to the platform. (There are four deserializers, and there is an SF3324 module on each of the four links of each deserializer.)
Example 1: Use links 0 and 2 of group A
$ nvsipl_camera -c "SF3324_DPHY_x2" --link-enable-masks "0x0101 0x0000 0x0000 0x0000" -d 0 -w 1
This command specifies SF3324 modules on links 0 and 2 of the deserializer on camera group A. It displays output on display 0.
Example 2: Use link 0 of group A and link 2 of group D
$ nvsipl_camera -c "SF3324_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0100" -d 0 -w 1
This command specifies SF3324 modules on link 0 of the deserializer on camera group A and link 2 of the deserializer on camera group D. It displays output on display 0 and window 1.
Example 3: Use links 0 of group A and 2 of group D with slave capture
1. On processor A, enter this command:
$ nvsipl_camera -c "SF3324_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0100" -d 0 -w 1
This command specifies SF3324 modules on link 0 of the deserializer on camera group A and link 2 of the deserializer on camera group D. It displays output on display 0.
2. On processor B, enter this command:
$ nvsipl_camera -c "SF3324_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0100" -d 0 -w 1 --enableSlave
This command specifies SF3324 modules on link 0 of the deserializer on camera group A and link 2 of the deserializer on camera group D. It displays output on display 0.
Example 4: File input mode
$./nvsipl_camera -c "SF3324_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" -i <raw_file_name> -d 0 -w 1
This command specifies an input file which contains RAW frames captured using SF3324 modules. It displays output on display 0.
Camera Commands
This section describes supported camera commands for supported cameras.
AR0231 (Camera Module SF3324) Using 2 Lane DPHY
Camera Group
Number of Cameras
Command
A
1
./nvsipl_camera --platform-config "SF3324_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3324_DPHY_x2" --link-enable-masks "0x1111 0x0000 0x0000 0x0000" --showfps -d 0
B
1
./nvsipl_camera --platform-config "SF3324_DPHY_x2" --link-enable-masks "0x0000 0x0001 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3324_DPHY_x2" --link-enable-masks "0x0000 0x1111 0x0000 0x0000" --showfps -d 0
C
1
./nvsipl_camera --platform-config "SF3324_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0001 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3324_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x1111 0x0000" --showfps -d 0
D
1
./nvsipl_camera --platform-config "SF3324_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0001" --showfps -d 0 
4
./nvsipl_camera --platform-config "SF3324_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x1111" --showfps -d 0
AR0231 (Camera Module SF3324) Using 2 Lane CPHY
Camera Group
Number of Cameras
Command
A
1
./nvsipl_camera --platform-config "SF3324_CPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3324_CPHY_x2" --link-enable-masks "0x1111 0x0000 0x0000 0x0000" --showfps -d 0
B
1
./nvsipl_camera --platform-config "SF3324_CPHY_x2" --link-enable-masks "0x0000 0x0001 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3324_CPHY_x2" --link-enable-masks "0x0000 0x1111 0x0000 0x0000" --showfps -d 0
C
1
./nvsipl_camera --platform-config "SF3324_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x0001 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3324_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x1111 0x0000" --showfps -d 0
D
1
./nvsipl_camera --platform-config "SF3324_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0001" --showfps -d 0 
4
./nvsipl_camera --platform-config "SF3324_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x1111" --showfps -d 0
AR0231 (Camera Module SF3325) Using 2 Lane DPHY
Camera Group
Number of Cameras
Command
A
1
./nvsipl_camera --platform-config "SF3325_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3325_DPHY_x2" --link-enable-masks "0x1111 0x0000 0x0000 0x0000" --showfps -d 0
B
1
./nvsipl_camera --platform-config "SF3325_DPHY_x2" --link-enable-masks "0x0000 0x0001 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3325_DPHY_x2" --link-enable-masks "0x0000 0x1111 0x0000 0x0000" --showfps -d 0
C
1
./nvsipl_camera --platform-config "SF3325_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0001 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3325_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x1111 0x0000" --showfps -d 0
D
1
./nvsipl_camera --platform-config "SF3325_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0001" --showfps -d 0 
4
./nvsipl_camera --platform-config "SF3325_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x1111" --showfps -d 0
AR0231 (Camera Module SF3325) Using 2 Lane CPHY
Camera Group
Number of Cameras
Command
A
1
./nvsipl_camera --platform-config "SF3325_CPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3325_CPHY_x2" --link-enable-masks "0x1111 0x0000 0x0000 0x0000" --showfps -d 0
B
1
./nvsipl_camera --platform-config "SF3325_CPHY_x2" --link-enable-masks "0x0000 0x0001 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3325_CPHY_x2" --link-enable-masks "0x0000 0x1111 0x0000 0x0000" --showfps -d 0
C
1
./nvsipl_camera --platform-config "SF3325_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x0001 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "SF3325_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x1111 0x0000" --showfps -d 0
D
1
./nvsipl_camera --platform-config "SF3325_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0001" --showfps -d 0 
4
./nvsipl_camera --platform-config "SF3325_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x1111" --showfps -d 0
AR0144 (Camera Module AR0144P) Using 2 Lane DPHY
Camera Group
Number of Cameras
Command
A
1
./nvsipl_camera --platform-config "AR0144P_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "AR0144P_DPHY_x2" --link-enable-masks "0x1111 0x0000 0x0000 0x0000" --showfps -d 0
B
1
./nvsipl_camera --platform-config "AR0144P_DPHY_x2" --link-enable-masks "0x0000 0x0001 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "AR0144P_DPHY_x2" --link-enable-masks "0x0000 0x1111 0x0000 0x0000" --showfps -d 0
C
1
./nvsipl_camera --platform-config "AR0144P_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0001 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "AR0144P_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x1111 0x0000" --showfps -d 0
D
1
./nvsipl_camera --platform-config "AR0144P_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0001" --showfps -d 0 
4
./nvsipl_camera --platform-config "AR0144P_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x1111" --showfps -d 0
Constellation 2MP Using 2 Lane DPHY
Camera Group
Number of Cameras
Command
A
1
./nvsipl_camera --platform-config "CONSTELLATION_2MP_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" --showfps -d 0
2
./nvsipl_camera --platform-config "CONSTELLATION_2MP_DPHY_x2" --link-enable-masks "0x01010x0000 0x0000 0x0000" --showfps -d 0
B
1
./nvsipl_camera --platform-config "CONSTELLATION_2MP_DPHY_x2" --link-enable-masks "0x0000 0x0001 0x0000 0x0000" --showfps -d 0
2
./nvsipl_camera --platform-config "CONSTELLATION_2MP_DPHY_x2" --link-enable-masks "0x0000 0x0101 0x0000 0x0000" --showfps -d 0
C
1
./nvsipl_camera --platform-config "CONSTELLATION_2MP_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0001 0x0000" --showfps -d 0
2
./nvsipl_camera --platform-config "CONSTELLATION_2MP_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0101 0x0000" --showfps -d 0
D
1
./nvsipl_camera --platform-config "CONSTELLATION_2MP_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0001" --showfps -d 0 
2
./nvsipl_camera --platform-config "CONSTELLATION_2MP_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0101" --showfps -d 0
Constellation 8MP Using 4 Lane DPHY
Camera Group
Number of Cameras
Command
A
1
./nvsipl_camera --platform-config "CONSTELLATION_8MP_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" --showfps -d 0
2
./nvsipl_camera --platform-config "CONSTELLATION_8MP_DPHY_x2" --link-enable-masks "0x0101 0x0000 0x0000 0x0000" --showfps -d 0
B
1
./nvsipl_camera --platform-config "CONSTELLATION_8MP_DPHY_x2" --link-enable-masks "0x0000 0x0001 0x0000 0x0000" --showfps -d 0
2
./nvsipl_camera --platform-config "CONSTELLATION_8MP_DPHY_x2" --link-enable-masks "0x0000 0x0101 0x0000 0x0000" --showfps -d 0
C
1
./nvsipl_camera --platform-config "CONSTELLATION_8MP_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0001 0x0000" --showfps -d 0
2
./nvsipl_camera --platform-config "CONSTELLATION_8MP_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x01010x0000" --showfps -d 0
D
1
./nvsipl_camera --platform-config "CONSTELLATION_8MP_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0001" --showfps -d 0
2
./nvsipl_camera --platform-config "CONSTELLATION_8MP_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0101" --showfps -d 0
MAX96712 RAW12 TPG Using 2 Lane DPHY
Camera Group
Number of Cameras
Command
A
1
./nvsipl_camera --platform-config "MAX96712_RAW12_TPG_DPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "MAX96712_RAW12_TPG_DPHY_x2" --link-enable-masks "0x1111 0x0000 0x0000 0x0000" --showfps -d 0
B
1
./nvsipl_camera --platform-config "MAX96712_RAW12_TPG_DPHY_x2" --link-enable-masks "0x0000 0x0001 0x0000 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "MAX96712_RAW12_TPG_DPHY_x2" --link-enable-masks "0x0000 0x1111 0x0000 0x0000" --showfps -d 0
C
1
./nvsipl_camera --platform-config "MAX96712_RAW12_TPG_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0001 0x0000" --showfps -d 0
4
./nvsipl_camera --platform-config "MAX96712_RAW12_TPG_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x1111 0x0000" --showfps -d 0
D
1
./nvsipl_camera --platform-config "MAX96712_RAW12_TPG_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0001" --showfps -d 0
4
./nvsipl_camera --platform-config "MAX96712_RAW12_TPG_DPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x1111" --showfps -d 0
MAX96712 RGB TPG Using 2 Lane CPHY
Camera Group
Number of Cameras
Command
A
1
./nvsipl_camera --platform-config "MAX96712_RGB_TPG_CPHY_x2" --link-enable-masks "0x0001 0x0000 0x0000 0x0000" --showfps -d 0 --disableISP1Output --disableISP0Output --enableRawOutput
4
./nvsipl_camera --platform-config "MAX96712_RGB_TPG_CPHY_x2" --link-enable-masks "0x1111 0x0000 0x0000 0x0000" --showfps -d 0 --disableISP1Output --disableISP0Output --enableRawOutput
B
1
./nvsipl_camera --platform-config "MAX96712_RGB_TPG_CPHY_x2" --link-enable-masks "0x0000 0x0001 0x0000 0x0000" --showfps -d 0 --disableISP1Output --disableISP0Output --enableRawOutput
4
./nvsipl_camera --platform-config "MAX96712_RGB_TPG_CPHY_x2" --link-enable-masks "0x0000 0x1111 0x0000 0x0000" --showfps -d 0 --disableISP1Output --disableISP0Output --enableRawOutput
C
1
./nvsipl_camera --platform-config "MAX96712_RGB_TPG_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x0001 0x0000" --showfps -d 0 --disableISP1Output --disableISP0Output --enableRawOutput
4
./nvsipl_camera --platform-config "MAX96712_RGB_TPG_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x1111 0x0000" --showfps -d 0 --disableISP1Output --disableISP0Output --enableRawOutput
D
1
./nvsipl_camera --platform-config "MAX96712_RGB_TPG_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x0001" --showfps -d 0 --disableISP1Output --disableISP0Output --enableRawOutput
4
./nvsipl_camera --platform-config "MAX96712_RGB_TPG_CPHY_x2" --link-enable-masks "0x0000 0x0000 0x0000 0x1111" --showfps -d 0 --disableISP1Output --disableISP0Output --enableRawOutput