About nvarguscamerasrc and v4l2-ctl

I have a problem now, my v4l2-ctl collection command is experiencing issues when using nvargus for collection.

My operation flow is like this
1.v4l2-ctl -d /dev/video0 --set-fmt-video=width=3000,height=5760,pixelformat=RG12 --set-ctrl bypass_mode=0 --set-ctrl sensor_mode=0 --stream-mmap --stream-count=-1
<<<<<<<<<<<<<<<<<<<<<<< 21.33 fps
<<<<<<<<<<<<<<<<<<<<< 21.33 fps
<<<<<<<<<<<<<<<<<<<<< 21.33 fps
<<<<<<<<<<<<<<<<<<<<<< 21.33 fps
Can capture flow normally
2. gst-launch-1.0 nvarguscamerasrc num-buffers=50 sensor-id=0 sensor-mode=1 wbmode=9 ! ‘video/x-raw(memory:NVMM), width=2896, height=1880, framerate=46/1, format=NV12’ ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=test0.mp4
Setting pipeline to PAUSED …
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Redistribute latency…
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 2896 x 1880 FR = 46.000001 fps Duration = 21739130 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3000 x 5760 FR = 46.000001 fps Duration = 21739130 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 1
Output Stream W = 3000 H = 5760
seconds to Run = 0
Frame Rate = 46.000001
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
H264: Profile = 66, Level = 0
NVMEDIA: Need to set EMC bandwidth : 4403733
NvVideo: bBlitMode is set to TRUE
Got EOS from element “pipeline0”.
Execution ended after 0:00:02.788205655
Setting pipeline to NULL …
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success
Freeing pipeline …

Can store mp4 files normally

3.v4l2-ctl -d /dev/video0 --set-fmt-video=width=3000,height=5760,pixelformat=RG12 --set-ctrl bypass_mode=0 --set-ctrl sensor_mode=0 --stream-mmap --stream-count=-1
VIDIOC_STREAMON returned -1 (Remote I/O error)
Re executing v4l2 ctrl will result in error collection

Wait few time to run the v4l2-ctl to try or restart nvargus-daemon to try.

sudo service nvargus-daemon stop
sudo enableCamInfiniteTimeout=1 nvargus-daemon

it’s no use

It could be the CID function like xxx_set_frame_rate()/xxx_set_exposure() cause the problem. Maybe make them as dummy function to confirm it.

Hi,
It is possible that after the capture with nvargus happens, v4l2-ctl is not able to correctly update the settings for the sensor.

Check if the override_enable option is available in v4l2-ctl:

v4l2-ctl -d /dev/video0 --all

If it is available, try adding the --set-ctrl override_enable=1 to the command. This could allow v4l2-ctl to correctly set the sensor mode and other settings.

Hi,
I added it as you said

v4l2-ctl -d /dev/video3 --set-fmt-video=width=3000,height=5760,pixelformat=RG12 --set-ctrl bypass_mode=0 --set-ctrl sensor_mode=0 --set-ctrl override_enable=1 --stream-mmap --stream-count=2 --stream-to=1.raw

  •   VIDIOC_STREAMON returned -1 (Remote I/O error)*
    

Just reported an error directly

Check dmesg if any error to sensor communication.

There are no errors reported

How many cameras are connected to this board?
Are you working with a custom driver?

The error you are seeing seems to show that the camera is still under use or that the channel is being used which causes the error.

Have you checked the vi trace for errors? Enable before capture:

sudo su
echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo > /sys/kernel/debug/tracing/trace

View output:

sudo cat /sys/kernel/debug/tracing/trace 

Save output to file:

sudo cat /sys/kernel/debug/tracing/trace > log.txt

Comparing what happens in each capture (v4l2 before nvargus, nvarguscamerasrc, and v4l2 after nvargus) could give more information

You can clean the trace file so only the information for each capture is seen:

sudo echo > /sys/kernel/debug/tracing/trace