Failed to build/run tegra multimedia API samples

I tried to build tegra multimedia api samples from “Tegra_Multimedia_API_R24.2.1_aarch64.tbz2” but got the folllowing error:

make[1]: Entering directory '/home/ubuntu/v4l/tegra_multimedia_api/samples/backend'
g++  -I"/usr/include/aarch64-linux-gnu" -I"../../include" -std=c++11 -I"../../include/libjpeg-8b" -I"../common/algorithm/cuda" -I"../common/algorithm/gie" -I"/usr/local/cuda/targets/aarch64-linux/include" -D ENABLE_GIE -c v4l2_backend_csvparser.cpp
In file included from v4l2_backend_csvparser.cpp:14:0:
../common/algorithm/gie/gie_inference.h:42:21: fatal error: NvInfer.h: No such file or directory
compilation terminated.

When I tried to run camera samples, I got:

ubuntu@tegra-ubuntu:~/v4l/tegra_multimedia_api/samples/09_camera_jpeg_capture$ sudo ./camera_jpeg_capture
NvPclHwGetModuleData: Misc Driver v4l2_focuser_stub already exists. Avoiding duplicate drivers
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
PRODUCER: Creating output stream
PRODUCER: Launching consumer thread
CONSUMER: Waiting until producer is connected...
CONSUMER: Waiting until producer is connected...
Segmentation fault

Has anyone tried to build and run tegra multimedia api sample?

Thanks

Try disabling GIE in the samples/backend Makefile

ENABLEGIE := 0

I set “ENABLEGIE := 0” and was able to build without error, but still failed to run “camera_jpeg_capture”.

I manually installed the following 2 packages on Jetson TX1, and was able to compile “backend” with GIE enabled.

sudo apt-get install libgie-dev libgie1

Hello, yahoo2016:
For compile failure, please take a look at tegra_multimedia_api/README. In jetpack, you need install some components to compile these samples.

For camera_jpeg_capture error, can you run a gst pipeline first to make sure that on-board camera works well? If gst works and camera_jpeg_capture still crashes, please paste syslog as well.

br
Chenjian

I installed libgie and was able to build all samples without error.
When I tried camera_jpeg_capture I got the folloing errors:

ubuntu@tegra-ubuntu:~/v4l/tegra_multimedia_api/samples/09_camera_jpeg_capture$ sudo ./camera_jpeg_capture
NvPclHwGetModuleData: Misc Driver v4l2_focuser_stub already exists. Avoiding duplicate drivers
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
PRODUCER: Creating output stream
PRODUCER: Launching consumer thread
CONSUMER: Waiting until producer is connected...
CONSUMER: Waiting until producer is connected...
Segmentation fault

The following is from dmesg:

camera_jpeg_cap[1791]: unhandled level 3 permission fault (11) at 0x7f813f6a38, esr 0x9200004f
[  166.756811] pgd = ffffffc0a37ad000
[  166.760216] [7f813f6a38] *pgd=000000012afde003, *pmd=0000000125eb2003, *pte=002000016ae20fd3

[  166.770454] CPU: 2 PID: 1791 Comm: camera_jpeg_cap Not tainted 3.10.96-tegra #1
[  166.770461] task: ffffffc0fdce7200 ti: ffffffc0eade8000 task.ti: ffffffc0eade8000
[  166.770469] PC is at 0x7f813f6874
[  166.770473] LR is at 0x7f813f6868
[  166.770477] pc : [<0000007f813f6874>] lr : [<0000007f813f6868>] pstate: 60000000
[  166.770480] sp : 0000007ffdefd150
[  166.770483] x29: 0000007ffdefee00 x28: 0000000000000000 
[  166.770489] x27: 0000000000000000 x26: 00000000016d17f0 
[  166.770494] x25: 0000000000000000 x24: 0000007f81413000 
[  166.770499] x23: 0000007f813f6a38 x22: 00000000016d8ab0 
[  166.770504] x21: 0000000001bd7690 x20: 00000000016d8a90 
[  166.770509] x19: 0000000000000000 x18: 0000000043600000 
[  166.770514] x17: 0000007f8113c268 x16: 0000007f81431cd8 
[  166.770518] x15: 0000007f816aa000 x14: 0000000000000000 
[  166.770523] x13: 0000000000000000 x12: 0000000000000000 
[  166.770528] x11: 0000000000000000 x10: 0000000000000000 
[  166.770532] x9 : 0000000000000000 x8 : 0000000000000110 
[  166.770537] x7 : 0000000001bd97f0 x6 : 0000000000000001 
[  166.770542] x5 : 0000000000000111 x4 : 0000000001bd97f0 
[  166.770546] x3 : 0000000001bd98f0 x2 : 0000000000000000 
[  166.770551] x1 : 0000000000000001 x0 : 0000000000000000 

[  166.770565] Library at 0x7f813f6874: 0x7f813c0000 /usr/lib/aarch64-linux-gnu/tegra/libargus.so
[  166.779883] Library at 0x7f813f6868: 0x7f813c0000 /usr/lib/aarch64-linux-gnu/tegra/libargus.so
[  166.789772] vdso base = 0x7f816a8000

I’ve not seen a “permission fault”. It makes me curious as to whether you are using user “ubuntu” for this test? If not, then try adding your user to group “video”, e.g.:

sudo usermod -a -G video <username>

I have always been using user “ubuntu”. gst works fine for on board camera.

I was also able to use v4l capture sample to capture video (raw10) without using gst.

Hello, yahoo2016:
I suggest you re-flashing your Jetson board with Jetpack and enable all dependencies according to tegra_multimedia_api/README.

that program works well in my side. Paste the log for your reference.

./camera_jpeg_capture 
...
...
PRODUCER: Creating output stream
PRODUCER: Launching consumer thread
CONSUMER: Waiting until producer is connected...
CONSUMER: Waiting until producer is connected...
PRODUCER: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
CONSUMER: Producer has connected; continuing.
Sensor_GetV4LPixelType: pixel type 0x101 invalid
CONSUMER: Done.
CONSUMER: Done.
PRODUCER: Done -- exiting.

br
Chenjian

We can’t run Jetpack on company network. We always got “manifest is broken” error when tried to run Jetpack on different laptops with Ubuntu 14.04. Jetpack on the same laptop runs fine on home network.

Are there ways to install multi-media-api without Jetpack?

Hello, yahoo2016:
Would you please run jetpack by:

"NV_DEVTOOLS_FORBID_MULTIPLE_DOWNLOAD_THREADS=1 ./JetPack-L4T-2.3-linux-x64.run"

It seems that your company network has problem in downloading with multi-threads.

br
ChenJian

Camera Samples in MM API installed by Jetpack 2.3 (on home network) worked.

“NV_DEVTOOLS_FORBID_MULTIPLE_DOWNLOAD_THREADS=1” also worked for Jetpack on company network.

There may be some missing symbolic links when install MM API manually.

Thanks

Hi,jachen,
I run tegra multimedia api samples.

nvidia@tegra-ubuntu:~/tegra_multimedia_api/samples/09_camera_jpeg_capture$ ./camera_jpeg_capture 
[INFO] (NvEglRenderer.cpp:109) <renderer0> Setting Screen width 640 height 480
initializeDevNode: Failed to open dev node '/dev/camera/video1'; No such file or directory, trying alternate default location
(NvOdmDevice) Error BadParameter: Control 10094858 not found (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function findControlById(), line 1367)
(NvOdmDevice) Error BadParameter:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function getControlRange(), line 299)
initialize: focus query failed
(Argus) Error InvalidState: Scf SensorModeType 0 not found (in src/common/ScfTranslate.cpp, function fromNvMMSensorModeType(), line 322)
(Argus) Error InvalidState: Scf SensorModeType 0 not found (in src/common/ScfTranslate.cpp, function fromNvMMSensorModeType(), line 322)
(Argus) Error InvalidState: Scf SensorModeType 0 not found (in src/common/ScfTranslate.cpp, function fromNvMMSensorModeType(), line 322)
(Argus) Error InvalidState: Scf SensorModeType 0 not found (in src/common/ScfTranslate.cpp, function fromNvMMSensorModeType(), line 322)
PRODUCER: Creating output stream
PRODUCER: Launching consumer thread
CONSUMER: Waiting until producer is connected...
CONSUMER: Waiting until producer is connected...
PRODUCER: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
CONSUMER: Producer has connected; continuing.
(NvOdmDevice) Error IoctlFailed:  (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function allocateBuffers(), line 768)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function enableStreamingConfiguration(), line 1730)
(NvOdmDevice) Error BadParameter: enableStreamingConfiguration FAILED (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorBase.cpp, function writeMode(), line 291)
(NvOdmDevice) Error BadParameter:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 154)
(NvOdmDevice) Error BadParameter: Sensor mode has not been configured! (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 184)
libv4l2: error turning on stream: Invalid argument
(NvOdmDevice) Error IoctlFailed:  (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1163)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 186)
libv4l2: error turning on stream: Invalid argument
(NvOdmDevice) Error IoctlFailed:  (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1163)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 186)
libv4l2: error turning on stream: Invalid argument
(NvOdmDevice) Error IoctlFailed:  (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1163)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 186)
SCF: Error Timeout:  (propagating from src/services/autocontrol/NvCameraIspDriver.cpp, function programIsp(), line 1199)
SCF: Error Timeout:  (propagating from src/services/autocontrol/NvCameraIspDriver.cpp, function programIsp(), line 1241)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceCore.cpp, function programIsp(), line 321)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceCore.cpp, function doCSItoISPCapture(), line 446)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceCore.cpp, function issueCapture(), line 344)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceDevice.cpp, function issueCaptures(), line 1190)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceDevice.cpp, function issueCaptures(), line 1042)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceEvent.cpp, function wait(), line 59)
Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc
launchCC abort cc 104
SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 750)
(Argus) Error Timeout: Failed to submit first capture request (propagating from src/api/CaptureSessionImpl.cpp, function submitCaptureRequests(), line 301)
(Argus) Error Timeout:  (propagating from src/api/CaptureSessionImpl.cpp, function threadFunction(), line 741)
SCF: Error Timeout: ISP port 0 timed out! (in src/services/capture/CaptureServiceDeviceIsp.cpp, function waitIspFrameEnd(), line 663)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceDeviceIsp.cpp, function waitIspFrameEnd(), line 704)
SCF: Error Timeout:  (propagating from src/common/Utils.cpp, function workerThread(), line 113)
SCF: Error Timeout: Worker thread IspHw frameComplete failed (in src/common/Utils.cpp, function workerThread(), line 130)
Error: waitCsiFrameStart timeout guid 0
VI Stream Id = 2 Virtual Channel = 0
************VI Debug Registers**********
VI_CSIMUX_STAT_FRAME_8	 = 0x00000000
VI_CSIMUX_FRAME_STATUS_0	 = 0x00000000
VI_CFG_INTERRUPT_STATUS_0	 = 0x3f000000
VI_ISPBUFA_ERROR_0	 = 0x00000000
VI_FMLITE_ERROR_0	 = 0x00000000
VI_NOTIFY_ERROR_0	 = 0x00000000
*****************************************
CSI Stream Id = 2 Brick Id = 1
************CSI Debug Registers**********
NVCSI_PHY_0_CILA_INTR_STATUS_CILA_0	 = 0x00000000
NVCSI_PHY_0_CILB_INTR_STATUS_CILB_0	 = 0x00000000
NVCSI_STREAM_0_INTR_STATUS_0	 = 0x00000000
NVCSI_STREAM_0_INTR_STATUS_0	 = 0x00000000
NVCSI_STREAM_0_ERR_INTR_STATUS_0	 = 0x00000000
NVCSI_STREAM_0_ERROR_STATUS2VI_VC0_0	 = 0x9f80bf00
NVCSI_STREAM_0_ERROR_STATUS2VI_VC1_0	 = 0x00000000
NVCSI_STREAM_0_ERROR_STATUS2VI_VC2_0	 = 0x00000000
NVCSI_STREAM_0_ERROR_STATUS2VI_VC3_0	 = 0x00000000
*****************************************
Error: waitCsiFrameStart Something went wrong with waiting on frame start
SCF: Error Timeout: ISP Stats timed out! (in src/services/capture/CaptureServiceDeviceIsp.cpp, function waitIspStatsFinished(), line 746)
SCF: Error Timeout: ISP Stats timed out! (in src/services/capture/CaptureServiceDeviceIsp.cpp, function waitIspStatsFinished(), line 746)

How to solve it? Could you give me some suggestions? Thank you in advance!

Hello, Holy_chen:
From log, it seems that on-board camera does not work.
You can check that first.

br
ChenJian

Hi,jachen,
First,thank for your suggestion.I have checked on-board as your said.I run the code on jstson-tx2 terminal.

gst-launch-1.0 nvcamerasrc ! nvoverlaysink

Work well.
Then,i run the under code.

nvidia@tegra-ubuntu:~/tegra_multimedia_api/samples/09_camera_jpeg_capture$ ./camera_jpeg_capture 
[INFO] (NvEglRenderer.cpp:109) <renderer0> Setting Screen width 640 height 480
PRODUCER: Creating output stream
PRODUCER: Launching consumer thread
CONSUMER: Waiting until producer is connected...
CONSUMER: Waiting until producer is connected...
PRODUCER: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
CONSUMER: Producer has connected; continuing.
(NvOdmDevice) Error IoctlFailed:  (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function allocateBuffers(), line 768)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function enableStreamingConfiguration(), line 1730)
(NvOdmDevice) Error BadParameter: enableStreamingConfiguration FAILED (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorBase.cpp, function writeMode(), line 291)
(NvOdmDevice) Error BadParameter:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 154)
(NvOdmDevice) Error BadParameter: Sensor mode has not been configured! (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 184)
libv4l2: error turning on stream: Invalid argument
(NvOdmDevice) Error IoctlFailed:  (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1163)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 186)
libv4l2: error turning on stream: Invalid argument
(NvOdmDevice) Error IoctlFailed:  (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1163)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 186)
libv4l2: error turning on stream: Invalid argument
(NvOdmDevice) Error IoctlFailed:  (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1163)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 186)
SCF: Error Timeout:  (propagating from src/services/autocontrol/NvCameraIspDriver.cpp, function programIsp(), line 1199)
SCF: Error Timeout:  (propagating from src/services/autocontrol/NvCameraIspDriver.cpp, function programIsp(), line 1241)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceCore.cpp, function programIsp(), line 321)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceCore.cpp, function doCSItoISPCapture(), line 446)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceCore.cpp, function issueCapture(), line 344)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceDevice.cpp, function issueCaptures(), line 1190)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceDevice.cpp, function issueCaptures(), line 1042)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceEvent.cpp, function wait(), line 59)
Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc
launchCC abort cc 104
SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 750)
(Argus) Error Timeout: Failed to submit first capture request (propagating from src/api/CaptureSessionImpl.cpp, function submitCaptureRequests(), line 301)
(Argus) Error Timeout:  (propagating from src/api/CaptureSessionImpl.cpp, function threadFunction(), line 741)
SCF: Error Timeout: ISP port 0 timed out! (in src/services/capture/CaptureServiceDeviceIsp.cpp, function waitIspFrameEnd(), line 663)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceDeviceIsp.cpp, function waitIspFrameEnd(), line 704)
SCF: Error Timeout:  (propagating from src/common/Utils.cpp, function workerThread(), line 113)
SCF: Error Timeout: Worker thread IspHw frameComplete failed (in src/common/Utils.cpp, function workerThread(), line 130)
SCF: Error Timeout: ISP Stats timed out! (in src/services/capture/CaptureServiceDeviceIsp.cpp, function waitIspStatsFinished(), line 746)
Error: waitCsiFrameStart timeout guid 0
VI Stream Id = 2 Virtual Channel = 0
************VI Debug Registers**********
VI_CSIMUX_STAT_FRAME_8	 = 0x00000000
VI_CSIMUX_FRAME_STATUS_0	 = 0x00000000
VI_CFG_INTERRUPT_STATUS_0	 = 0x3f000000
VI_ISPBUFA_ERROR_0	 = 0x00000000
VI_FMLITE_ERROR_0	 = 0x00000000
VI_NOTIFY_ERROR_0	 = 0x00000000
*****************************************
CSI Stream Id = 2 Brick Id = 1
************CSI Debug Registers**********
NVCSI_PHY_0_CILA_INTR_STATUS_CILA_0	 = 0x00000000
NVCSI_PHY_0_CILB_INTR_STATUS_CILB_0	 = 0x00000000
NVCSI_STREAM_0_INTR_STATUS_0	 = 0x00000000
NVCSI_STREAM_0_INTR_STATUS_0	 = 0x00000000
NVCSI_STREAM_0_ERR_INTR_STATUS_0	 = 0x00000000
NVCSI_STREAM_0_ERROR_STATUS2VI_VC0_0	 = 0x9f80bf00
NVCSI_STREAM_0_ERROR_STATUS2VI_VC1_0	 = 0x00000000
NVCSI_STREAM_0_ERROR_STATUS2VI_VC2_0	 = 0x00000000
NVCSI_STREAM_0_ERROR_STATUS2VI_VC3_0	 = 0x00000000
*****************************************
Error: waitCsiFrameStart Something went wrong with waiting on frame start
SCF: Error Timeout: ISP Stats timed out! (in src/services/capture/CaptureServiceDeviceIsp.cpp, function waitIspStatsFinished(), line 746)

Could you give me some suggestions?Thank you in advance.

For testing your camera, check this: https://devtalk.nvidia.com/default/topic/1001883/jetson-tx1/jetson-tx1-onboard-camera-don-t-work-really-/post/5118111/#51181.

If you want to get it to nvoverlaysink and unflip upside down, you may try this :

gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=640, height=480, framerate=30/1, format=I420' ! nvvidconv flip-method=6 ! nvoverlaysink -ev

Another possible reason is that the platform is not flashed correctly.
please remove all packages in jetpack directory, and re-run jetpack, re-flash the device and check whether it can work.

br
Chenjian