500w camera problem, failed to get image

I have a UYVY mipi camra, which support 400w(25601440) and 500w(25921944). 400w mode has been tuned through, but 500w mode is failing. Here is my information, please give me some ideas to solve the problem, thank you!

dts

mode0 { /* CAM_MODE_2592x1944_20FPS */
mclk_khz = “24000”;
num_lanes = “2”;
tegra_sinterface = “serial_c”;
phy_mode = “DPHY”;
discontinuous_clk = “yes”;
dpcm_enable = “false”;
cil_settletime = “0”;

				active_w = "2592";
				active_h = "1944";
				pixel_t = "yuv_uyvy16";
				readout_orientation = "0";
				line_length = "3000";
				inherent_gain = "1";
				mclk_multiplier = "2";
				pix_clk_hz = "148500000";

				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16"; /* 1.00x */
				max_gain_val = "170"; /* 10.66x */
				step_gain_val = "1";
				default_gain = "16"; /* 1.00x */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "20000000"; /* 20 fps */
				max_framerate = "20000000"; /* 20 fps */
				step_framerate = "1";
				default_framerate = "20000000"; /* 20 fps */
				min_exp_time = "13"; /* us */
				max_exp_time = "333333"; /* us */
				step_exp_time = "1";
				default_exp_time = "2495"; /* us */

				embedded_metadata_height = "0";
			};

pipline

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! "video/x-raw(memory:NVMM),format=(string)UYVY, width=(int)2592, height=(int)1944,framerate=20/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

dmesg err

[ 2411.355075] [RCE] Configuring VI GoS.
[ 2411.355086] [RCE] VM GOS[#0] addr=0xc2100000
[ 2411.355095] [RCE] VM GOS[#1] addr=0xc2101000
[ 2411.355103] [RCE] VM GOS[#2] addr=0xc2102000
[ 2411.355110] [RCE] VM GOS[#3] addr=0xc2103000
[ 2411.355118] [RCE] VM GOS[#4] addr=0xc2104000
[ 2411.355126] [RCE] VM GOS[#5] addr=0xc2105000
[ 2411.370665] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 32, err_data 162
[ 2411.400670] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 32, err_data 162
[ 2411.421892] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 131072
[ 2411.545248] cam_set_mode 684 
[ 2411.786314] cam_start_streaming 704 
[ 2412.979319] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 131072

trace err

Following this guide,Jetson/l4t/Camera BringUp - eLinux.org
There are 3 condtions:

  1. jetosn board crash and reboot. By the way, I use Jetpack4.6 rev2.
  2. trace infomation looks fine, but no video turns out.
kworker/0:2-10035 [000] ....  2423.338859: rtcpu_vinotify_event: tstamp:76121172315 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:76120847343 data:0x00000000
     kworker/0:2-10035 [000] ....  2423.338859: rtcpu_vinotify_event: tstamp:76121172462 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:77930078752 data:0x00020127
     kworker/0:2-10035 [000] ....  2423.338860: rtcpu_vinotify_event: tstamp:76121172624 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:77930084448 data:0x07020128
     kworker/0:2-10035 [000] ....  2423.338860: rtcpu_vinotify_event: tstamp:76121172759 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:77930299008 data:0x10000000
     kworker/0:2-10035 [000] ....  2423.338861: rtcpu_vinotify_event: tstamp:76121172916 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:77930307264 data:0x31000129
     kworker/0:2-10035 [000] ....  2423.338861: rtcpu_vinotify_event: tstamp:76121173052 tag:FS channel:0x00 frame:1 vi_tstamp:76120897627 data:0x00000012
     kworker/0:2-10035 [000] ....  2423.338862: rtcpu_vinotify_event: tstamp:76121173213 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:76120897627 data:0x00000000
     kworker/0:2-10035 [000] ....  2423.338862: rtcpu_vinotify_event: tstamp:76121173350 tag:CHANSEL_PXL_SOF channel:0x23 frame:1 vi_tstamp:76120897689 data:0x00000001
     kworker/0:2-10035 [000] ....  2423.338862: rtcpu_vinotify_event: tstamp:76121173507 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:77931682848 data:0x08020128
     kworker/0:2-10035 [000] ....  2423.338863: rtcpu_vinotify_event: tstamp:76122098903 tag:CHANSEL_PXL_EOF channel:0x23 frame:1 vi_tstamp:76122097332 data:0x059f0002
     kworker/0:2-10035 [000] ....  2423.338863: rtcpu_vinotify_event: tstamp:76122099069 tag:ATOMP_FRAME_DONE channel:0x23 frame:1 vi_tstamp:76122097347 data:0x00000000
     kworker/0:2-10035 [000] ....  2423.338864: rtcpu_vinotify_event: tstamp:76122099211 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:77970071072 data:0x02020128
     kworker/0:2-10035 [000] ....  2423.338864: rtcpu_vinotify_event: tstamp:76122099368 tag:FE channel:0x00 frame:1 vi_tstamp:76122097348 data:0x00000022
  1. Looks like Line start code mismatch?
     kworker/0:0-10237 [000] ....  2922.217851: rtcpu_vinotify_event: tstamp:91712352395 tag:CHANSEL_NOMATCH channel:0x04 frame:1 vi_tstamp:91712122473 data:0x000003c9
     kworker/0:0-10237 [000] ....  2922.273840: rtcpu_vinotify_error: tstamp:91713685826 tag:CHANSEL_NOMATCH channel:0x04 frame:1 vi_tstamp:91713684979 data:0x000003c9
queue:0x0bcbbbb8

hello xumm_td,

may I know which JetPack release you’re working with?
BTW, according to Sensor Software Driver Programming, pixel_t has deprecated.
please use the following properties instead: mode_type/ csi_pixel_bit_depth/ pixel_phase.
thanks

Thanks for the info.
It’s Jetpack4.6.

Hi,
I would like to redescribe my question.
Since my camera switching mode process takes longer, I think a few of the previous phenomena are related to this. Now ignore previous questions.for now.

Question: nvv4l2camerasrc VS. v4l2src

nvv4l2camerasrc works fine on 2560*1440 mode

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! "video/x-raw(memory:NVMM),format=(string)UYVY, width=(int)2560, height=(int)1440,framerate=30/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)NV12" ! nvoverlaysink sync=false

nvv4l2camerasrc shows wrong image on 2592*1944 mode while v4l2src works fine

  • nvv4l2camerasrc
gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! "video/x-raw(memory:NVMM),format=(string)UYVY, width=(int)2592, height=(int)1944,framerate=20/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

Gives picture like this:

  • v4l2src works fine
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)2592, height=(int)1944,framerate=20/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

Let me thank you in advance for your help.

hello xumm_td,

how about using NV12 instead of I420 for the video converter?

Hi,
@JerryChang

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! "video/x-raw(memory:NVMM),format=(string)UYVY, width=(int)2592, height=(int)1944" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)NV12" ! nvoverlaysink sync=false

No improvement, still have the same problem.

hello xumm_td,

could you please share the kernel and VI tracing logs, please check whether it output the same error logs?

You can ignore the logs mentioned at the beginning of my post.
I think both dmesg and trace are in normal state and no errors are reported.

  • Trace
 vi-output, veye-9041  [000] ....  1222.223065: tegra_channel_capture_frame: sof:1234.441770336
 vi-output, veye-9041  [000] ....  1222.223068: tegra_channel_capture_frame: eof:1234.490852064
     kworker/1:2-9050  [001] ....  1222.254082: rtcpu_vinotify_event: tstamp:38577871057 tag:CHANSEL_PXL_EOF channel:0x23 frame:1 vi_tstamp:38577839110 data:0x07970002
     kworker/1:2-9050  [001] ....  1222.254085: rtcpu_vinotify_event: tstamp:38577871199 tag:ATOMP_FRAME_DONE channel:0x23 frame:1 vi_tstamp:38577839124 data:0x00000000
     kworker/1:2-9050  [001] ....  1222.254086: rtcpu_vinotify_event: tstamp:38577871363 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:40489945216 data:0x020200dc
     kworker/1:2-9050  [001] ....  1222.254087: rtcpu_vinotify_event: tstamp:38577871502 tag:FE channel:0x00 frame:1 vi_tstamp:38577839127 data:0x00000022
     kworker/1:2-9050  [001] ....  1222.254088: rtcpu_vinotify_event: tstamp:38577871663 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:38577839127 data:0x00000000
     kworker/1:2-9050  [001] ....  1222.254089: rtcpu_vinotify_event: tstamp:38577871800 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:40489951520 data:0x000200dc
     kworker/1:2-9050  [001] ....  1222.254089: rtcpu_vinotify_event: tstamp:38577871958 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:40489957056 data:0x070200dd
     kworker/1:2-9050  [001] ....  1222.254090: rtcpu_vinotify_event: tstamp:38577872099 tag:FS channel:0x00 frame:1 vi_tstamp:38577867768 data:0x00000012
     kworker/1:2-9050  [001] ....  1222.254091: rtcpu_vinotify_event: tstamp:38577872257 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:38577867769 data:0x00000000
     kworker/1:2-9050  [001] ....  1222.254092: rtcpu_vinotify_event: tstamp:38577872390 tag:CHANSEL_PXL_SOF channel:0x23 frame:1 vi_tstamp:38577867832 data:0x00000001
     kworker/1:2-9050  [001] ....  1222.254093: rtcpu_vinotify_event: tstamp:38577872549 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:40490864608 data:0x080200dd
     kworker/1:2-9050  [001] ....  1222.254094: rtcpu_vinotify_event: tstamp:38577872687 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:40490944352 data:0x10000000
     kworker/1:2-9050  [001] ....  1222.254095: rtcpu_vinotify_event: tstamp:38578209706 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:40490971648 data:0x310000de
     kworker/1:2-9050  [001] ....  1222.254096: rtos_queue_send_from_isr_failed: tstamp:38578251442 queue:0x0bcb2e38
     kworker/1:2-9050  [001] ....  1222.254098: rtos_queue_send_from_isr_failed: tstamp:38578251601 queue:0x0bcb76a0
     kworker/1:2-9050  [001] ....  1222.254099: rtos_queue_send_from_isr_failed: tstamp:38578251754 queue:0x0bcb9220
     kworker/1:2-9050  [001] ....  1222.254100: rtos_queue_send_from_isr_failed: tstamp:38578251903 queue:0x0bcb9fe0
     kworker/1:2-9050  [001] ....  1222.254100: rtos_queue_send_from_isr_failed: tstamp:38578252048 queue:0x0bcbada0
 vi-output, veye-9041  [000] ....  1222.273079: tegra_channel_capture_frame: sof:1234.491770624
 vi-output, veye-9041  [000] ....  1222.273081: tegra_channel_capture_frame: eof:1234.540852352
     kworker/1:2-9050  [001] ....  1222.310082: rtcpu_vinotify_event: tstamp:38579566110 tag:CHANSEL_PXL_EOF channel:0x23 frame:1 vi_tstamp:38579401619 data:0x07970002
     kworker/1:2-9050  [001] ....  1222.310085: rtcpu_vinotify_event: tstamp:38579566293 tag:ATOMP_FRAME_DONE channel:0x23 frame:1 vi_tstamp:38579401634 data:0x00000000
     kworker/1:2-9050  [001] ....  1222.310086: rtcpu_vinotify_event: tstamp:38579566437 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:40539945504 data:0x020200dd
     kworker/1:2-9050  [001] ....  1222.310087: rtcpu_vinotify_event: tstamp:38579566594 tag:FE channel:0x00 frame:1 vi_tstamp:38579401636 data:0x00000022
     kworker/1:2-9050  [001] ....  1222.310088: rtcpu_vinotify_event: tstamp:38579566737 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:38579401636 data:0x00000000
     kworker/1:2-9050  [001] ....  1222.310089: rtcpu_vinotify_event: tstamp:38579566898 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:40539951808 data:0x000200dd
     kworker/1:2-9050  [001] ....  1222.310090: rtcpu_vinotify_event: tstamp:38579567036 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:40539957376 data:0x070200de
     kworker/1:2-9050  [001] ....  1222.310090: rtcpu_vinotify_event: tstamp:38579567193 tag:FS channel:0x00 frame:1 vi_tstamp:38579430278 data:0x00000012
     kworker/1:2-9050  [001] ....  1222.310091: rtcpu_vinotify_event: tstamp:38579567336 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:38579430278 data:0x00000000
     kworker/1:2-9050  [001] ....  1222.310092: rtcpu_vinotify_event: tstamp:38579567495 tag:CHANSEL_PXL_SOF channel:0x23 frame:1 vi_tstamp:38579430342 data:0x00000001
     kworker/1:2-9050  [001] ....  1222.310093: rtcpu_vinotify_event: tstamp:38579567630 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:40540864896 data:0x080200de
     kworker/1:2-9050  [001] ....  1222.310094: rtcpu_vinotify_event: tstamp:38579567786 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:40540947872 data:0x10000000
     kworker/1:2-9050  [001] ....  1222.310095: rtcpu_vinotify_event: tstamp:38579567921 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:40540956128 data:0x310000df
     kworker/1:2-9050  [001] ....  1222.310096: rtos_queue_send_from_isr_failed: tstamp:38579812792 queue:0x0bcb2e38
     kworker/1:2-9050  [001] ....  1222.310098: rtos_queue_send_from_isr_failed: tstamp:38579812949 queue:0x0bcb76a0
     kworker/1:2-9050  [001] ....  1222.310099: rtos_queue_send_from_isr_failed: tstamp:38579813101 queue:0x0bcb9220
     kworker/1:2-9050  [001] ....  1222.310100: rtos_queue_send_from_isr_failed: tstamp:38579813249 queue:0x0bcb9fe0
     kworker/1:2-9050  [001] ....  1222.310100: rtos_queue_send_from_isr_failed: tstamp:38579813395 queue:0x0bcbada0
 vi-output, veye-9041  [000] ....  1222.323083: tegra_channel_capture_frame: sof:1234.541770944
 vi-output, veye-9041  [000] ....  1222.323085: tegra_channel_capture_frame: eof:1234.590852640

dmesg shows no error.

hello xumm_td,

it looks SOF/EOF has sending to VI engine, it might be display side issue,
could you please try running fpsdisplaysink and fakesink, which disable preview and shows frame-rate only.
for example,
... nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! "video/x-raw(memory:NVMM),format=(string)UYVY, width=(int)2592, height=(int)1944" ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v

Thanks for you apply. This cmd works.

What can I use instead of nvoverlaysink?

hello xumm_td,

this might due to your display monitor not support such resolution,
please have a try to use nvvidconv to scale the output frames as standard 1080p for testing.
for example,
...! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)NV12, width=1920, height=1080' ! nvoverlaysink -ev

Hi Jerry,
My display monitor is 4K size, and your new cmd can not solve the problem.
I don’t think the previous fpsdisplaysink solves the problem. The problem now is that the image is error, while the pipleline is working normally and not reporting an error.

I also tried to do h264 recording and it shows the same error image as PREVIEW. The image below was taken from the video.

image

Using nvv4l2camerasrc does not work properly(wrong image), while using v4l2src does. Both PREVIEW and h264 video.
I think the key point of the problem is still on the difference between these two plugins.

hello xumm_td,

it should be alignment issue,
could you please have a try to use preferred_stride to configure the buffer alignment,
i.e. $ v4l2-ctl -d /dev/video0 --set-ctrl preferred_stride=5376
after that, launching the same resolution with nvv4l2camerasrc.

if this still not works,
you may modify your low-level driver to meet 64-alignment,
if the buffers are passing to VIC, it’ll need to have alignment with 256.

see-also, Gstnvv4l2camerasrc with GRAY8 support - #16 by DaneLLL
thanks

1 Like

Hi,
Thanks for your reply. I think that probably be the key point.

preferred_stride=5376 works !!

May I ask how did you calculate this value? 2592—64align–>2624—UYVYmode,*2–5248…

Thank you for your patience and support.

hello xumm_td,

YUYV: 1 pixel = 2 bytes.
2592x2/256 = 20.25, you’ll need to revise the alignment to 21. so, 256x21 = 5376.
internal driver called int NvBufferGetParams() and check the _NvBufferParams::pitch for the pitch of each planes used by hardware buffer.

hence,
you may need to revise the code to adjust the values for your use-case,
thanks

Got it, thank you very much!