gst-launch-1.0 capture from 4 cameras simultaneously success, but v4l2-ctl failed

Now,I can capture images from 4 cameras simultaneously in one Max9286 with gst-launch-1.0 . But if I used v4l2-ctl, capture failed. To reduce the use of cpu, I must choose v4l2-ctl. Error log is following.

[   84.922733] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 512, id = 0
[   84.962788] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   84.962811] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 112, err_data 6291552, id = 3
[   84.962828] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2, flags: 0, err_data 512, id = 3
[   84.962872] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 96, err_data 4194400, id = 2
[   84.963033] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 96, err_data 4194400, id = 1
[   84.967278] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2, flags: 112, err_data 6291552, id = 1
[   84.967531] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2, flags: 112, err_data 6291552, id = 2
[   84.967723] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 3
[   85.002795] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160, id = 0
[   85.042809] tegra194-vi5 15c10000.vi: corr_err: discarding frame 3, flags: 112, err_data 6291552, id = 2
[   85.042962] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.042969] tegra194-vi5 15c10000.vi: corr_err: discarding frame 3, flags: 112, err_data 6291552, id = 1
[   85.043089] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 12583008, id = 0
[   85.043174] tegra194-vi5 15c10000.vi: corr_err: discarding frame 3, flags: 0, err_data 131072, id = 3
[   85.082839] tegra194-vi5 15c10000.vi: corr_err: discarding frame 4, flags: 112, err_data 6291552, id = 2
[   85.083073] tegra194-vi5 15c10000.vi: corr_err: discarding frame 4, flags: 96, err_data 4194400, id = 1
[   85.083170] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.083211] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   85.122967] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   85.123173] tegra194-vi5 15c10000.vi: corr_err: discarding frame 5, flags: 112, err_data 6291552, id = 1
[   85.123362] tegra194-vi5 15c10000.vi: corr_err: discarding frame 5, flags: 112, err_data 6291552, id = 3
[   85.123373] tegra194-vi5 15c10000.vi: corr_err: discarding frame 5, flags: 96, err_data 4194400, id = 2
[   85.127491] tegra194-vi5 15c10000.vi: corr_err: discarding frame 6, flags: 112, err_data 6291552, id = 1
[   85.162631] tegra194-vi5 15c10000.vi: corr_err: discarding frame 6, flags: 112, err_data 14680160, id = 3
[   85.162642] tegra194-vi5 15c10000.vi: corr_err: discarding frame 6, flags: 112, err_data 6291552, id = 2
[   85.162932] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160, id = 0
[   85.202977] tegra194-vi5 15c10000.vi: corr_err: discarding frame 7, flags: 96, err_data 4194400, id = 1
[   85.202986] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 12583008, id = 0
[   85.203009] tegra194-vi5 15c10000.vi: corr_err: discarding frame 7, flags: 112, err_data 6291552, id = 2
[   85.203024] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.203035] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 131072, id = 3
[   85.203815] tegra194-vi5 15c10000.vi: corr_err: discarding frame 8, flags: 0, err_data 512, id = 1
[   85.207375] tegra194-vi5 15c10000.vi: corr_err: discarding frame 8, flags: 112, err_data 6291552, id = 2
[   85.207566] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.207634] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 1
[   85.242948] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160, id = 0
[   85.282797] tegra194-vi5 15c10000.vi: corr_err: discarding frame 9, flags: 112, err_data 6291552, id = 2
[   85.283053] tegra194-vi5 15c10000.vi: corr_err: discarding frame 9, flags: 112, err_data 6291552, id = 3
[   85.283060] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194400, id = 1
[   85.283065] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160, id = 0
[   85.283076] tegra194-vi5 15c10000.vi: corr_err: discarding frame 9, flags: 0, err_data 131072, id = 1
[   85.322975] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 12583008, id = 0
[   85.323200] tegra194-vi5 15c10000.vi: corr_err: discarding frame 10, flags: 112, err_data 6291552, id = 2
[   85.323245] tegra194-vi5 15c10000.vi: corr_err: discarding frame 10, flags: 112, err_data 6291552, id = 3
[   85.323285] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 1
[   85.362987] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 12583008, id = 0
[   85.363108] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.363156] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 131072, id = 3
[   85.363196] tegra194-vi5 15c10000.vi: corr_err: discarding frame 11, flags: 96, err_data 4194400, id = 2
[   85.363263] tegra194-vi5 15c10000.vi: corr_err: discarding frame 11, flags: 112, err_data 6291552, id = 1
[   85.403005] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   85.403177] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.403182] tegra194-vi5 15c10000.vi: corr_err: discarding frame 12, flags: 112, err_data 6291552, id = 2
[   85.403218] tegra194-vi5 15c10000.vi: corr_err: discarding frame 12, flags: 96, err_data 4194400, id = 1
[   85.442997] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 12583008, id = 0
[   85.443196] tegra194-vi5 15c10000.vi: corr_err: discarding frame 13, flags: 112, err_data 6291552, id = 3
[   85.443218] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 1
[   85.443240] tegra194-vi5 15c10000.vi: corr_err: discarding frame 13, flags: 112, err_data 6291552, id = 2
[   85.443273] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 131072, id = 1
[   85.447583] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194400, id = 1
[   85.482961] tegra194-vi5 15c10000.vi: corr_err: discarding frame 14, flags: 112, err_data 6291552, id = 2
[   85.483103] tegra194-vi5 15c10000.vi: corr_err: discarding frame 14, flags: 112, err_data 14680160, id = 3
[   85.483182] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160, id = 0
[   85.523051] tegra194-vi5 15c10000.vi: corr_err: discarding frame 15, flags: 96, err_data 4194400, id = 1
[   85.523074] tegra194-vi5 15c10000.vi: corr_err: discarding frame 15, flags: 112, err_data 6291552, id = 2
[   85.523090] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.523102] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 131072, id = 3
[   85.523110] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160, id = 0
[   85.563106] tegra194-vi5 15c10000.vi: corr_err: discarding frame 16, flags: 96, err_data 4194400, id = 2
[   85.563145] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.563162] tegra194-vi5 15c10000.vi: corr_err: discarding frame 16, flags: 112, err_data 6291552, id = 1
[   85.563232] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   85.603103] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   85.603153] tegra194-vi5 15c10000.vi: corr_err: discarding frame 17, flags: 112, err_data 6291552, id = 3
[   85.603159] tegra194-vi5 15c10000.vi: corr_err: discarding frame 17, flags: 112, err_data 6291552, id = 2
[   85.603647] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194400, id = 1
[   85.603830] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 131072, id = 1
[   85.643118] tegra194-vi5 15c10000.vi: corr_err: discarding frame 18, flags: 112, err_data 6291552, id = 2
[   85.643159] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194400, id = 1
[   85.643166] tegra194-vi5 15c10000.vi: corr_err: discarding frame 18, flags: 96, err_data 4194400, id = 3
[   85.643182] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   85.682967] tegra194-vi5 15c10000.vi: corr_err: discarding frame 19, flags: 112, err_data 6291552, id = 1
[   85.683048] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 3
[   85.683087] tegra194-vi5 15c10000.vi: corr_err: discarding frame 19, flags: 112, err_data 6291552, id = 2
[   85.683133] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 512, id = 3
[   85.683183] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160, id = 0
[   85.723089] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   85.723106] tegra194-vi5 15c10000.vi: corr_err: discarding frame 20, flags: 96, err_data 4194400, id = 1
[   85.723213] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194400, id = 3
[   85.723259] tegra194-vi5 15c10000.vi: corr_err: discarding frame 20, flags: 112, err_data 6291552, id = 2
[   85.762963] tegra194-vi5 15c10000.vi: corr_err: discarding frame 21, flags: 112, err_data 6291552, id = 2
[   85.763177] tegra194-vi5 15c10000.vi: corr_err: discarding frame 21, flags: 112, err_data 6291552, id = 3
[   85.763184] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 1
[   85.763202] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 131072, id = 1
[   85.763233] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160, id = 0
[   85.803119] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   85.803182] tegra194-vi5 15c10000.vi: corr_err: discarding frame 22, flags: 96, err_data 4194400, id = 3
[   85.803257] tegra194-vi5 15c10000.vi: corr_err: discarding frame 22, flags: 112, err_data 6291552, id = 2
[   85.803291] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 1
[   85.843172] tegra194-vi5 15c10000.vi: corr_err: discarding frame 23, flags: 112, err_data 6291552, id = 1
[   85.843395] tegra194-vi5 15c10000.vi: corr_err: discarding frame 23, flags: 96, err_data 4194400, id = 2
[   85.843476] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.843489] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 0, err_data 131072, id = 3
[   85.843557] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 14680160, id = 0
[   85.848963] tegra194-vi5 15c10000.vi: corr_err: discarding frame 24, flags: 96, err_data 4194400, id = 1
[   85.883044] tegra194-vi5 15c10000.vi: corr_err: discarding frame 24, flags: 112, err_data 6291552, id = 2
[   85.883064] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291552, id = 3
[   85.883272] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160, id = 0

hello zmaqidong,

may I know which JetPack release you’re working with.
please also share the v4l2-ctl commands that you’re used to access camera sensors,
thanks

Also have boost the VI/NVCSI clocks a try.

https://elinux.org/Jetson_TX2_Camera_BringUp

JetPack4.1 + L4T32.1 + Jetson AGX Xavier(ram is 16G)

my v4l2-ctl cmd is
v4l2-ctl --set-fmt-video=width=1280,height=1069,pixelformat=UYVY --stream–mmap -stream-count=1000 -d /dev/video0 &
v4l2-ctl --set-fmt-video=width=1280,height=1069,pixelformat=UYVY --stream–mmap -stream-count=1000 -d /dev/video1 &
v4l2-ctl --set-fmt-video=width=1280,height=1069,pixelformat=UYVY --stream–mmap -stream-count=1000 -d /dev/video2 &
v4l2-ctl --set-fmt-video=width=1280,height=1069,pixelformat=UYVY --stream–mmap -stream-count=1000 -d /dev/video3 &

my gst-launch-1.0 cmd is
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)1069, framerate=(fraction)25/1’ ! xvimagesink -ev &
gst-launch-1.0 v4l2src device=/dev/video1 ! ‘video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)1069, framerate=(fraction)25/1’ ! xvimagesink -ev &
gst-launch-1.0 v4l2src device=/dev/video2 ! ‘video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)1069, framerate=(fraction)25/1’ ! xvimagesink -ev &
gst-launch-1.0 v4l2src device=/dev/video3 ! ‘video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)1069, framerate=(fraction)25/1’ ! xvimagesink -ev &

I have checked the rate.Now, the rate of vi/nvcsi/isp is the max_rate.

hello zmaqidong,

could you please add bypass_mode option controls,
for example,

$ v4l2-ctl --set-fmt-video=width=1280,height=1069,pixelformat=UYVY --stream--mmap <b>--set-ctrl bypass_mode=0 </b>--stream-count=1000 -d /dev/video0

Hello JerryChang,
With “–set-ctrl=bypass_mode=0”,the problem is the same as before.
With “–set-ctrl=bypass_mode=1”,it seems that the software flow is not right.It enter the bypass mode, and then nothing to do.

hello zmaqidong,

  1. could you please share device tree settings for checking.
  2. we had some experience that you should disable the frame sync in the MAX9286 for multi-camera works simultaneously,
    please also check similar issue, Topic 1052374 for reference.
    thanks

Hello JerryChang,
1.I have tried to disable the frame sync.But the problem still exists.
2.Maybe the root cause is not frame sync.When I use gst-launch-1.0, I can capture from 4 cameras simultaneously.But when I replace gst-launch-1.0 with v4l2-ctl, the probelm exists.
3.My device tree is similar to the one in ‘Topic 1052374’.When I capture from 4 cameras with gst-launch-1.0 or v4l2-ctl,the setting of max9286 is right(reg0x27:0xbf, reg0x31:0x42)
reg0x27: four cameras exist, reg0x31: four cameras frame sync succeed.

hello zmaqidong,

could you please narrow down the issue. could launching single/dual/triple camera sensors with v4l2-ctl works?
BTW, since JetPack-4.2.1 is now live, suggest you also moving to latest release for verification.
thanks

Hello JerryChang,
v4l2-ctl works well when launching single/dual camera sensors.But dosen`t work when launching triple/quad camera sensors.
gst-lanuch-1.0 work well when launching single/dual/triple/quad camera sensors.