I can't use the built in camera

So I have a Jetson TX2 Developper Kit but I wasn’t able to use the onboard camera.

I tried :

gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=640, height=480, framerate=30/1, format=NV12' ! nvvidconv flip-method=2 ! nvegltransform ! nveglglessink -e

but there is an error message :

Setting pipeline to PAUSED ...

Using winsys: x11 
Socket read error. Camera Daemon stopped functioning.....
gst_nvcamera_open() failed ret=0
ERROR: Pipeline doesn't want to pause.
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
ERROR: from element /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
gstbasesrc.c(3354): gst_base_src_start (): /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0:
Failed to start
Setting pipeline to NULL ...
Caught SIGSEGV
#0  0x0000007f95c4f130 in pthread_join (threadid=547918643712, 
#1  0x0000007f95d05e40 in ?? () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#2  0x0000000000000011 in ?? ()
Spinning.  Please run 'gdb gst-launch-1.0 7805' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

I tried running the

gdb gst-launch-1.0 7885

but :

Attaching to program: /usr/bin/gst-launch-1.0, process 7805
ptrace: No such process.
/home/nvidia/7805: No such file or directory.

I’ve tried :

v4l2-ctl -d /dev/video0 --list-formats-ext

but :

Failed to open /dev/video0: No such file or directory

If this is on Jetpack 4.2, nvcamerasrc is deprecated in favor of nvarguscamerasrc.

You can use dmesg | grep cam (or other) to see if the driver / sensor probe is working or failing during boot.

I tried running the command with nvarguscamerasrc, a window named “gst-launch-1.0” appears but its content is froze with the background. It does not work. I’ve run dmesg | grep cam :

dmesg | grep cam
[    0.146466] node /plugin-manager/fragment-p3310-c00-camera match with board >=3310-1000-800
[    0.263305] GPIO line 461 (cam0-rst) hogged as output/low
[    0.263371] GPIO line 456 (cam0-pwdn) hogged as output/low
[    0.263425] GPIO line 457 (cam1-rst) hogged as output/low
[    0.263477] GPIO line 426 (cam1-pwdn) hogged as output/low
[    0.364013] en-vdd-cam: 1800 mV 
[    0.375837] en-vdd-cam-hv-2v8: 2800 mV 
[    0.376349] en-vdd-cam-1v2: 1200 mV 
[    0.459187] tegra_camera_platform tegra-camera-platform: tegra_camera_probe:camera_platform_driver probe
[    0.459278] misc tegra_camera_ctrl: tegra_camera_isomgr_register tpg_max_iso = 3916800KBs
[    0.459309] misc tegra_camera_ctrl: tegra_camera_isomgr_register isp_iso_bw=4687500, vi_iso_bw=1500000, max_bw=4687500
[    2.916374] tegra186-cam-rtcpu b000000.rtcpu: Trace buffer configured at IOVA=0xa0000000
[    2.917953] tegra186-cam-rtcpu b000000.rtcpu: already unhalted
[    2.918982] tegra186-cam-rtcpu b000000.rtcpu: using cam RTCPU IRQ (52)
[    2.918985] tegra186-cam-rtcpu b000000.rtcpu: tegra_camrtc_mon_create is successful
[    2.919724] tegra186-cam-rtcpu b000000.rtcpu: firmware version cpu=sce cmd=4 sha1=a8b1ecdd9615cd817a56df035be363fce3b0b88f
[    2.925045] tegra-ivc-cdev ivc-b000000.rtcpu:echo@0: probing /dev/camchar-echo
[    2.928084] tegra-ivc-cdev ivc-b000000.rtcpu:dbg@7c00: probing /dev/camchar-dbg
[    2.928192] camchar: rtcpu character device driver loaded
[    5.032358] en-vdd-cam: disabling
[    5.032368] en-vdd-cam-hv-2v8: disabling
[    5.032370] en-vdd-cam-1v2: disabling
[  265.858930] nvcamera-daemon[3787]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x92000006
[  265.881836] CPU: 3 PID: 3787 Comm: nvcamera-daemon Not tainted 4.4.38-tegra #1
[  265.999195] Library at 0x403038: 0x400000 /usr/sbin/nvcamera-daemon
[  266.005466] Library at 0x403034: 0x400000 /usr/sbin/nvcamera-daemon
[  628.500230] nvcamera-daemon[3997]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x92000006
[  628.523042] CPU: 0 PID: 3997 Comm: nvcamera-daemon Not tainted 4.4.38-tegra #1
[  628.640070] Library at 0x403038: 0x400000 /usr/sbin/nvcamera-daemon
[  628.646340] Library at 0x403034: 0x400000 /usr/sbin/nvcamera-daemon
[ 1000.421640] nvcamera-daemon[4891]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x92000006
[ 1000.445454] CPU: 0 PID: 4891 Comm: nvcamera-daemon Not tainted 4.4.38-tegra #1
[ 1000.563478] Library at 0x403038: 0x400000 /usr/sbin/nvcamera-daemon
[ 1000.569775] Library at 0x403034: 0x400000 /usr/sbin/nvcamera-daemon

The drivers seems to be loaded…
I don’t know the issue here

The log you posted indicates that nvcamera-daemon has crashed. The presence of nvcamera-daemon indicates that you are not yet using R32.1. If possible I recommend updating to the R32.1 release.

In my experience with nvcamera-daemon on R28.2.1 it would segfault when devname and/or proc-device-tree was not set properly under tegra-camera-platform.

However, if /dev/video0 does not exist that implies that your camera driver has not successfully probed. You should solve this problem first as nothing else will work until the camera driver loads.

Regards,
Greg

So I flashed the Jetson TX2 with JetPack 4.2 today but it hasn’t solved the problem.
As suggested by scott85rlu, I’ve used the nvarguscamerasrc command :

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=640, height=480, framerate=30/1, format=NV12' ! nvvidconv flip-method=2 ! nvegltransform ! nveglglessink -e

but that dosn’t work :

Setting pipeline to PAUSED …

Using winsys: x11 
Pipeline is live and does not need PREROLL ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:521 No cameras available

And still there is no /dev/video0 so I guess that the problem I had before is still there. I have no idea on how to solve this, I would accept any documentation or tutorial. Thanks !

Maybe your camera is damaged. If you’re using the standard kernel and device tree from JetPack 4.2 it really should “just work” and /dev/video0 should be present when you boot.

You could try re-seating your camera. Do you have other cameras you could try?

I don’t have any other camera to try but I have other Jetson TX2 that I could flash and see if it works. But I intended to install and configure this camera beforehand to make sure the whole procedure is working.

I am using the standard kernel and device tree of JetPack 4.2.

I’ve been told that I could “just” add node in the device tree or build one from scratch but I have currently no idea how to do that.

You should not have to mess around with building a kernel or updating the device tree if you want to use the camera that comes with the devkit.

I haven’t touched the kernel nor the Device tree, yet. I’ve just been told by my Internship supervisor that to solve this problem I could had the camera node in the device tree.

It seems that the probing is correct, it is detecting the camera:

nvidia@nvidia:/boot/dtb$ dmesg | grep v4l2
[    3.644930] ov5693 2-0036: probing v4l2 sensor.

and I have more detail about the sensor :

[    3.644930] ov5693 2-0036: probing v4l2 sensor.
[    3.645800] ov5693 2-0036: tegracam sensor driver:ov5693_v2.0.6
[    3.667271] ov5693 2-0036: could not read otp bank
[    3.667331] ov5693 2-0036: Error -5 reading otp data
[    3.669858] ov5693 2-0036: board setup failed
[    3.670025] ov5693: probe of 2-0036 failed with error -5

What is error -5. If the driver crashes, how can I fix that.

Are you sure your camera is functional? Can your camera stream with other program like Cheese and Argus?

How do I test the camera with libargus ?

this command use gstreamer and libargus right ?

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=640, height=480, framerate=30/1, format=NV12' ! nvvidconv flip-method=2 ! nvegltransform ! nveglglessink -e

Plus the file dev/video0 isn’t created…

This is a hardware problem, I’ve flashed another tx2 with the exact same settings and the built in camera works perfectly fine. Thank you everyone for your kind answers.