Auto reboot when tried to preview with v4l2-ctl

Hi @JerryChang

I followed the procedure as mentioned in : Tegra channel error recovering on Xavier when capturing with v4l2 - #9 by JerryChang

The issue I’m facing is that :
If there’s a crash in v4l2 subsystem if we try to preview alongside gst-launch-1.0 and v4l2-ctl board is rebooting.

  1. V4l2 command to stream is giving frame rates:
    $ v4l2-ctl -d /dev/video0 -c bypass_mode=0 --stream-mmap

  2. Gstreamer command to preview firstly with 1 to crash v4l2, then 0:
    gst-launch-1.0 nvarguscamerasrc sensor_id=[1 or 0] ! ‘video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12’ ! nvvidconv flip-method=0 ! ‘video/x-raw,width=960, height=616’ ! nvvidconv ! nvegltransform ! nveglglessink -e

Thanks for any help on reboot in this case.

hello yash.j,

you cannot access the same sensor stream with v4l2-ctl and gstreamer command simultaneously.
please enable fpsdisplaysink plugin to shows frame-rate in the gstreamer pipeline.
for example,

$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v

also, may I know the JetPack release you’re currently working with.
thanks

Thanks for the information. We are working with L4T 32.4.2.
Can you suggest best method to test patches suggested for solving v4l2 subsystem crash on fauty preview here ?

Regards,
Yash

hello yash.j,

FYI,
you may upgrade your release version to the latest JetPack SDK, that kernel patch had already merged since JP-4.4 GA (i.e. l4t-r32.4.3),
thanks

thanks again, but since i’m working with a custom board for now can you please list the exact patch for issue i’m trying to solve.

hello yash.j,

may I know what’s the failure?
you cannot access the same sensor stream with v4l2-ctl and gstreamer command simultaneously.

Issue :
a. I successfully previewed a CSI capture using -
$ gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! ‘video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12’ ! nvvidconv flip-method=0 ! ‘video/x-raw,width=960, height=616’ ! nvvidconv ! nvegltransform ! nveglglessink -e

b. Simultaneously ran preview for sensor_id = 0.
c. On disconnecting CSI camera /dev/video1 and retrying preview error log from dmesg -wH is attached.
d. Thereafter no CSI-preview or capture worked.

Kindly, let me know your findings.
Thanks,
Yash

hello yash.j,

may I know what’s the exactly step while you disconnect the camera sensor, are you actually remove camera hardware to disconnect it physically?
BTW, I’m not able to access the logs.

Hi @JerryChang

Yes you’re correct I actually disconnect the camera(module supports Hotplug) and try previewing from the same, which gives me this log : v4l2_crash (14.7 KB)
All I want to fix is handling v4l2 crash, when we run faulty preview on non-existing camera, so that the existing ones should work asusual.

hello yash.j,

I would suggest you moving to the latest JetPack SDK, JetPack-4.5 is the latest production release, supporting all Jetson modules.
there’s error handling mechanism added to r32.5, which should able to support your use-case.
thanks