Hi @qiang_li-mpu_se
I take the ov5640.c for reference that in NXP bsp , then modify TP2850
The ioctrl function work well
I still try this command--> mx8_v4l2_cap_drm -cam 1 -d "/dev/video1" -fmt YUYV -ow 640 -oh 480 -of
It show -EINVAL when run mxc_isi_update_buf_paddr, because memplanes is 0
But I check YUYV output format as below, the memplanes should be 1
{
.name = "YUYV-16",
.fourcc = V4L2_PIX_FMT_YUYV,
.depth = { 16 },
.color = MXC_ISI_OUT_FMT_YUV422_1P8P,
.memplanes = 1,
.colplanes = 1,
.mbus_code = MEDIA_BUS_FMT_YUYV8_1X16,
},
Finally it run mxc_isi_cap_streamon and start capturing, but 0.YUYV file size is 0, I think it's releated above issue
Do you have any advice?
Thanks
evk_8mp:/mnt/media_rw #
evk_8mp:/mnt/media_rw #
evk_8mp:/mnt/media_rw # [ 77.940546] read descriptors
[ 77.943451] read strings
[ 78.080191] healthd: battery l=85 v=3 t=35.0 h=2 st=2 c=400 fc=4000000 cc=32 chg=a
[ 78.243172] healthd: battery l=85 v=3 t=35.0 h=2 st=2 c=400 fc=4000000 cc=32 chg=a
x8_v4l2_cap_drm -cam 1 -d "/dev/video1" -fmt YUYV -ow 640 -oh 480 -of[ 78.988844] read descriptors
[ 78.991751] read strings
(init_video_channel:497): in[ 79.541820] --> mxc_isi_get_hostdata
[ 79.548227] ==> tp2850_s_power on = 1
[ 79.548230] tp2850 tp2850_check_stable_decoder#4045
it channel[0] save_file_name=0.YUYV
(init_video_channel:504): init channel[0] v4l2_dev_name=/dev/video1 w/h=(640,480)
(open_save_file:577): open 0.YUYV success
[ 83.474060] tp2850_init_controls ret = 0
[ 83.477994] ==> tp2850_set_power on = 1
[ 93.104696] mxc_isi_cap_enum_fmt
[ 93.111182] mxc_isi_cap_enum_fmt
(open_v4l2_device:641): [ 93.114438] mxc_isi_cap_enum_fmt
open /dev/video1 success
(v4[ 93.120520] mxc_isi_cap_enum_fmt
l2_enum_fmt:1021): index=0 p[ 93.126618] mxc_isi_cap_enum_fmt
ixelformat=RGBP
(v4l2_enum_f[ 93.132696] mxc_isi_cap_enum_fmt
mt:1021): index=1 pixelforma[ 93.138784] mxc_isi_cap_enum_fmt
[ 93.144863] mxc_isi_cap_enum_fmt
t=RGB3
(v4l2_enum_fmt:1021):[ 93.148118] mxc_isi_cap_enum_fmt
[ 93.154203] mxc_isi_cap_enum_fmt
index=2 pixelformat=BGR3
--> tp2850_s_frame_interval start
[ 93.164652] ==> tp2850_try_frame_interval start
[0m(v4l2_enum_fmt:1021): ind[ 93.164654] ==>fi->numerator= 1
ex=3 pixelformat=YUYV
(v4l2_[ 93.169197] ==> tp2850_try_frame_interval best_fps=30
[ 93.175194] ==> tp2850_find_mode
[ 93.186419] ==> width = 640
[ 93.189223] ==> height = 480
[ 93.192110] ==> tp2850_try_frame_interval end
[ 93.192111] ==> tp2850_find_mode
[ 93.199696] ==> width = 640
[ 93.202499] ==> height = 480
[ 93.205397] --> tp2850_s_frame_interval end
enum_fmt:1021): index=4 pixe[ 93.209607] -->mxc_isi_cap_enum_framesizes
[ 93.216629] -->mxc_isi_find_format start
[ 93.220650] --> tp2850_enum_frame_size
lformat=YUV4
(v4l2_enum_fmt:[ 93.224406] --> fse->min_width 176
1021): index=5 pixelformat=N[ 93.230673] --> fse->max_height 144
V12
(v4l2_enum_fmt:1021): 93.237039] -->mxc_isi_cap_s_fmt_mplane
33mindex=6 pixelformat=YM24
[ 93.243800] mxc_isi_cap_s_fmt_mplane, fmt=0x56595559
(v4l2_enum_fmt:1021): index=[ 93.251617] format = YUYV
7 pixelformat=XR24
(v4l2_enu[ 93.257186] -->mxc_isi_cap_s_fmt_mplane i = 3
[ 93.264397] -->mxc_isi_cap_g_fmt_mplane
[ 93.268328] dst_f->o_width= 640
m_fmt:1021): index=8 pixelfo[ 93.271466] dst_f->o_height = 480
rmat=AR24
(v4l2_enum_fmt:101[ 93.277662] --> tp2850_g_frame_interval
7): channel VIDIOC_ENUM_FMT [ 93.284378] cap_vb2_queue_setup, buf_n=3, size=614400
fail
(adjust_width_height_for_one_sensor:1040): frmsiz[ 93.296521] -->cap_vb2_buffer_prepare start
[ 93.302093] cap_vb2_buffer_prepare
[ 93.305509] -->cap_vb2_buffer_prepare end
[ 93.309548] -->cap_vb2_buffer_prepare start
[ 93.313835] cap_vb2_buffer_prepare
[ 93.317245] -->cap_vb2_buffer_prepare end
[ 93.321269] -->cap_vb2_buffer_prepare start
[ 93.325547] cap_vb2_buffer_prepare
[ 93.328957] -->cap_vb2_buffer_prepare end
[ 93.332991] --> mxc_isi_get_hostdata
[ 93.336577] -->mxc_isi_cap_streamon
[ 93.340161] mxc_isi_cap_streamon
[ 93.343386] mxc_isi_cap_streamon 1063
[ 93.347057] --> mxc_isi_get_hostdata
[ 93.350638] --> mxc_isi_config_parm 1014
[ 93.354569] mxc_isi_source_fmt_init 874
[ 93.358410] mxc_isi_source_fmt_init 882
[ 93.362255] mxc_isi_source_fmt_init 888
[ 93.366097] @@@ mipi_csis_set_fmt 958
[ 93.369855] --> tp2850_set_fmt
[ 93.372914] --> tp2850_try_fmt_internal 111 fmt->width = 640 fmt->height = 480
[ 93.380406] ==> tp2850_find_mode
[ 93.383631] ==> width = 640
[ 93.386432] ==> height = 480
[ 93.389320] --> tp2850_try_fmt_internal 222 fmt->width = 640 fmt->height = 480
[ 93.396814] ==> tp2850_get_fmt
[ 93.396816] -->mxc_isi_get_src_fmt start
[ 93.403878] -->mxc_isi_get_src_fmt end index=1
e.discrete.width = 176
(adju[ 93.408332] mxc_isi_config_parm 1020
[ 93.414776] mxc_isi_channel_init
[ 93.418019] -->mxc_isi_channel_sw_reset
st_width_height_for_one_sensor:1041): frmsize.discrete.height[ 93.426949] mxc_isi_config_parm 1022
[ 93.431373] mxc_isi_channel_config
[ 93.434785] -->chain_buf
[ 93.437409] -->mxc_isi_channel_set_csc
[ 93.441254] bypass csc
[ 93.443612] input fmt YUV4
[ 93.446327] output fmt YUYV
[ 93.449127] -->mxc_isi_channel_set_scaling
[ 93.453319] -->mxc_isi_channel_clear_scaling
[ 93.457681] -->mxc_isi_channel_source_config
[ 93.462047] -->mxc_isi_channel_set_flip
[ 93.465976] -->mxc_isi_channel_set_alpha
[ 93.469994] -->mxc_isi_channel_set_panic_threshold
[ 93.474878] -->cap_vb2_buffer_queue start
[ 93.478898] isi_cap->dst_f.fmt->name = YUYV-16
[ 93.483340] -->mxc_isi_update_buf_paddr start
[ 93.487694] -->mxc_isi_update_buf_paddr -EINVAL memplanes 0
[ 93.493280] -->cap_vb2_buffer_queue start
[ 93.497292] isi_cap->dst_f.fmt->name = YUYV-16
[ 93.501733] -->mxc_isi_update_buf_paddr start
[ 93.506088] -->mxc_isi_update_buf_paddr -EINVAL memplanes 0
[ 93.511668] -->cap_vb2_buffer_queue start
[ 93.515679] isi_cap->dst_f.fmt->name = YUYV-16
[ 93.520121] -->mxc_isi_update_buf_paddr start
[ 93.524477] -->mxc_isi_update_buf_paddr -EINVAL memplanes 0
= 144
(v4l2_setup_dev:1163)[ 93.530072] --> mxc_isi_get_hostdata
[ 93.536489] -->cap_vb2_start_streaming
: planes=1 WxH@fps = 640x4[ 93.540338] cap_vb2_start_streaming
80@30
(get_memory_map_info:1[ 93.548471] cap_vb2_start_streaming: num_plane=0 discard_size=614400 discard_buffer=00000000c52f3121
[ 93.558676] -->mxc_isi_channel_set_outbuf
[ 93.562772] -->mxc_isi_channel_set_outbuf
[ 93.566881] mxc_isi_cap_streamon 1070
[ 93.570548] --> mxc_isi_channel_enable
[ 93.574309] -->mxc_isi_clean_registers
[ 93.578149] -->mxc_isi_get_irq_status
[ 93.581909] -->mxc_isi_clean_irq_status
[ 93.585837] --> mxc_isi_enable_irq
[ 93.589251] --> dump_isi_regs
[ 93.592223] ISI CHNLC register dump, isi0
[ 93.596246] CHNL_CTRL[0x00]: e0000000
[ 93.600871] CHNL_IMG_CTRL[0x04]: 20000001
[ 93.605500] CHNL_OUT_BUF_CTRL[0x08]: 7c707
[ 93.609862] CHNL_IMG_CFG[0x0c]: 1e00280
[ 93.614405] CHNL_IER[0x10]: 3cfc0000
[ 93.619025] CHNL_STS[0x14]: 100
[ 93.623215] CHNL_SCALE_FACTOR[0x18]: 10001000
[ 93.627840] CHNL_SCALE_OFFSET[0x1c]: 00
[ 93.631945] CHNL_CROP_ULC[0x20]: 00
[ 93.636060] CHNL_CROP_LRC[0x24]: 00
[ 93.640165] CHNL_CSC_COEFF0[0x28]: 00
[ 93.644267] CHNL_CSC_COEFF1[0x2c]: 00
[ 93.648370] CHNL_CSC_COEFF2[0x30]: 00
[ 93.652470] CHNL_CSC_COEFF3[0x34]: 00
213): V4L2 buffer[0]->planes[ 93.656577] CHNL_CSC_COEFF4[0x38]: 00
[0]:startAddr=0x0xe23d8be36000, o[ 93.663533] CHNL_CSC_COEFF5[0x3c]: 00
[ 93.670490] CHNL_ROI_0_ALPHA[0x40]: 00
[ 93.674592] CHNL_ROI_0_ULC[0x44]: 00
[ 93.678695] CHNL_ROI_0_LRC[0x48]: 00
[ 93.682799] CHNL_ROI_1_ALPHA[0x4c]: 00
[ 93.686909] CHNL_ROI_1_ULC[0x50]: 00
[ 93.691011] CHNL_ROI_1_LRC[0x54]: 00
[ 93.695115] CHNL_ROI_2_ALPHA[0x58]: 00
[ 93.699217] CHNL_ROI_2_ULC[0x5c]: 00
[ 93.703323] CHNL_ROI_2_LRC[0x60]: 00
[ 93.707430] CHNL_ROI_3_ALPHA[0x64]: 00
[ 93.711531] CHNL_ROI_3_ULC[0x68]: 00
[ 93.715637] CHNL_ROI_3_LRC[0x6c]: 00
[ 93.719738] CHNL_OUT_BUF1_ADDR_Y[0x70]: 73400000
[ 93.724364] CHNL_OUT_BUF1_ADDR_U[0x74]: 00
[ 93.728467] CHNL_OUT_BUF1_ADDR_V[0x78]: 00
[ 93.732572] CHNL_OUT_BUF_PITCH[0x7c]: 500
[ 93.736758] CHNL_IN_BUF_ADDR[0x80]: 00
[ 93.740873] CHNL_IN_BUF_PITCH[0x84]: 00
[ 93.744976] CHNL_MEM_RD_CTRL[0x88]: 00
[ 93.749082] CHNL_OUT_BUF2_ADDR_Y[0x8c]: 73100000
[ 93.753704] CHNL_OUT_BUF2_ADDR_U[0x90]: 00
[ 93.757808] CHNL_OUT_BUF2_ADDR_V[0x94]: 00
[ 93.761907] CHNL_SCL_IMG_CFG[0x98]: 1e00280
[ 93.766445] CHNL_FLOW_CTRL[0x9c]: 00
ffset=0x0, buf_size=614400
(get_memory_map_info:1213): V4L2 buffer[1]->planes[0]:startAddr=0x0xe23d8a46d000, offset=0x96000, buf_size=614400
(get_memory_map_info:1213): V4L2 buffer[2]->planes[0]:startAddr=0x0xe23d8a3d7000, offset=0x12c000, buf_size=614400
(v4l2_create_buffer:1255): channel[0] w/h=(640,480) alloc buffer success
(media_device_prepare:1472): v4l2_device_prepare ret=0
[ 93.952857] read descriptors
[ 93.955763] read strings
[ 94.092381] mxc_isi_cap_streamon 1072
[ 94.096070] mxc_isi_pipeline_enable start --> 1
[ 94.100631] --> tp2850_s_stream enable = 1
[ 94.104736] ==> tp2850_check_valid_mode
[ 94.104738] ==> tp2850_set_stream_mipi
[ 94.108583] ==> tp2850_write_reg
[ 94.114007] ==> tp2850_write_reg
[ 94.118853] ==> tp2850_write_reg
[ 94.228375] tp2850_set_stream_mipi ret= 0
[ 94.235716] tp2850_set_stream end enable 1
[ 94.256357] --- mipi_csis_s_stream ---
[ 94.260141] CSIS_VERSION[0]: 0x03060301
[ 94.264695] CSIS_CMN_CTRL[4]: 0x00004005
[ 94.269238] CSIS_CLK_CTRL[8]: 0x000f0000
[ 94.273787] CSIS_INTMSK[10]: 0x0fffff1f
[ 94.278415] CSIS_INTSRC[14]: 0x00000000
[ 94.283052] CSIS_DPHYSTATUS[20]: 0x000000e1
[ 94.287680] CSIS_DPHYCTRL[24]: 0x0d800003
[ 94.292314] CSIS_DPHYBCTRL_L[30]: 0x000001f4
[ 94.296947] CSIS_DPHYBCTRL_H[34]: 0x00000000
[ 94.301581] CSIS_DPHYSCTRL_L[38]: 0x00000000
[ 94.306220] CSIS_DPHYSCTRL_H[3c]: 0x00000000
[ 94.310856] CSIS_ISPCONFIG_CH0[40]: 0x00001078
[ 94.315483] CSIS_ISPCONFIG_CH1[50]: 0x000008fd
[ 94.320120] CSIS_ISPCONFIG_CH2[60]: 0x000008fe
[ 94.324751] CSIS_ISPCONFIG_CH3[70]: 0x000008ff
[ 94.329379] CSIS_ISPRESOL_CH0[44]: 0x01e00280
[ 94.334012] CSIS_ISPRESOL_CH1[54]: 0x80008000
[ 94.338645] CSIS_ISPRESOL_CH2[64]: 0x80008000
[ 94.343269] CSIS_ISPRESOL_CH3[74]: 0x80008000
[ 94.347894] CSIS_ISPSYNC_CH0[48]: 0x00000000
[ 94.352519] CSIS_ISPSYNC_CH1[58]: 0x00000000
[ 94.357146] CSIS_ISPSYNC_CH2[68]: 0x00000000
[ 94.361769] CSIS_ISPSYNC_CH3[78]: 0x00000000
[ 94.366405] --- mipi_csis_s_stream ---
[ 94.370163] GPR_GASKET_0_CTRL[60]: 0x00001e02
[ 94.374788] GPR_GASKET_0_HSIZE[64]: 0x00001e02
[ 94.379409] GPR_GASKET_0_VSIZE[68]: 0x00001e02
[ 94.388578] mxc_isi_cap_streamon 1074
(media_device_start:1517): v4l2_device_streamon start(v4l2_device_streamon:1434): channel[0] v4l_dev=0x4 start capturing
[ 94.997152] read descriptors
[ 95.000086] read strings
[ 96.036851] read descriptors
[ 96.039760] read strings