i.mx8M Mini v4l2-ctl streaming fails on L5.4.70_2.3.0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx8M Mini v4l2-ctl streaming fails on L5.4.70_2.3.0

712 Views
manabukiri
Contributor I

All,

I tried to streaming using v4l2-ctl  on BSP L5.4.70_2.3.0 but fails as following.

//////////////////v4l2-ctl on  L5.4.70_2.3.0 fail ////////////

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=YUYV --stream-mmap --stream-to=output.yuyv --stream-count=1

[ 709.672328] thp7312_mipi 2-0061: s_stream: 1

[ 718.084571] skip frame 1

^C

////////////////

The driver , thp7312_mipi 2-0061 which I created was called and started to stream but v4l2-ctl never completed and I had to kill v4l2-ctl.

 

Could you please help me to fix this issue?

 

I tried to streaming using v4l2-ctl  on BSP L4.14.98_2.0.0  and succeeded as follows. So I think problem is related to BSP L5.4.70_2.3.0.

 

//////////////////v4l2-ctl on  L4.14.98_2.0.0  succeeded ////////////

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=YUYV --stream-mmap --stream-to=output.yuyv --stream-count=1
[ 4194.060066] mxc_mipi-csi 32e30000.mipi_csi: mipi_csis_s_stream(): 1
[ 4194.066580] mxc_mipi-csi 32e30000.mipi_csi: __mipi_csis_set_format(): 0x2008, 1920 x 1080
[ 4194.074803] thp7312_mipi 2-0061: s_stream: 1
<[ 4194.248881] mxc_mipi-csi 32e30000.mipi_csi: mipi_csis_s_stream(): 0
[ 4194.255178] thp7312_mipi 2-0061: s_stream: 0

////////////////////////////////////////////////////

 

I tried to streaming using GStreamer on BSP L5.4.70_2.3.0 and succeeded. The Issue is only streaming from v4l2-ctl

//////////////////gst-launch-1.0 on  L5.4.70_2.3.0 succeeded////////////

root@imx8mmevk:~# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=1920,height=1080,framerate=30/1 ! queue max-size-time=0 ! imagefreeze num-buffers=1 ! filesink location=fhd.yuv
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 738.860358] thp7312_mipi 2-0061: s_stream: 1
Got EOS from element "pipeline0".

[ 739.010451] thp7312_mipi 2-0061: s_stream: 0

Execution ended after 0:00:00.285222125
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

////////////////////////////////////////////////////

 

 

Labels (1)
0 Kudos
2 Replies

687 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @manabukiri 

Can you get more error log about this issue?

0 Kudos

657 Views
manabukiri
Contributor I

 

I got logs and found that the cause of this issue is  mx6s_vidioc_s_parm() is called or not.

At the case of GStreamer ,

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=3840,height=2160,framerate=30/1 ! queue max-size-time=0 ! imagefreeze num-buffers=1 ! filesink location=4k.yuv

mx6s_vidioc_s_parm() is called  with arguments for frame rate and capture mode when I run above GSrreamer, so v4l2 driver set the MIPI camera to output 3840x2160 30fps.

 

At the case of v4l2-ctl,

v4l2-ctl --set-fmt-video=width=3840,height=2160,pixelformat=YUYV --stream-mmap --stream-to=output.yuyv --stream-count=1

mx6s_vidioc_s_parm() is not called when I run above v4l2-ctl, and so  v4l2 driver does not set the output of MIPI camera.

MIPI camera keep to output default (Full HD 30fps)  or  keep to output the width, height and frame rate set by GStreamer if GStreamer is run before the v4l2-ctl.

Therefore captured by v4l2-ctl fails if current MIPI camera outputs is difference from the output requested by v4l2-ctl. 

 

Are there any way to call mx6s_vidioc_s_parm()  with the argument for frame rate and capture mode from v4l2-ctl?

I  tired following but failed. Are there any other way?

 

v4l2-ctl --set-fmt-video=width=3840,height=2160,pixelformat=YUYV --set-parm=30 --stream-mmap --stream-to=output.yuyv --stream-count=1

 

 mx6s_vidioc_s_parm()  was called but capture mode is not set. (should be 3 but 0)

 

followings are logs of "GStreamer", "v4l2-ctl" and  "v4l2-ctl  --set-parm=30 added".

///////////////////GStreamer /////////////////////////////////////

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=3840,height=2160,framerate=30/1 ! queue max-size-time=0 ! imagefreeze num-buffers=1 ! filesink location=4k.yuv

 

///////////////////log/////////////////////////////////////
[ 97.942388] mx6s-csi 32e20000.csi1_bridge: csi v4l2 busfreq high request.
[ 97.942466] mx6s-csi 32e20000.csi1_bridge: csi v4l2 busfreq high release.
[ 97.959416] mx6s-csi 32e20000.csi1_bridge: csi v4l2 busfreq high request.
[ 97.960706] mx6s-csi 32e20000.csi1_bridge: No more fmt
[ 97.960719] mx6s-csi 32e20000.csi1_bridge: G_PIXELASPECT not implemented
[ 97.960723] mx6s-csi 32e20000.csi1_bridge: VIDIOC_G_SELECTION not implemented
[ 97.960726] mx6s-csi 32e20000.csi1_bridge: VIDIOC_G_SELECTION not implemented
[ 97.960745] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_framesizes() is called
[ 97.960753] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_frameintervals() is called
[ 97.960763] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_frameintervals() is called
[ 97.960770] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_frameintervals() is called
[ 97.960788] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_framesizes() is called
[ 97.960793] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_frameintervals() is called
[ 97.960800] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_frameintervals() is called
[ 97.960812] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_framesizes() is called
[ 97.960817] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_frameintervals() is called
[ 97.960823] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_frameintervals() is called
[ 97.960890] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_enum_framesizes() is called
[ 97.961183] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_try_fmt_vid_cap() is called
[ 97.962436] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_try_fmt_vid_cap() is called
[ 97.962449] mx6s-csi 32e20000.csi1_bridge: set to pixelformat 'YUYV-1'
[ 97.962476] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_s_parm() is called fps=30 capturemode=3
[ 98.080291] mx6s-csi 32e20000.csi1_bridge: count=4, size=0
[ 98.080299] size=16588800
[ 98.110752] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x00000000131026fc) 0x0000000045b50a40 0
[ 98.110783] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x00000000076be4f8) 0x0000000081f26831 0
[ 98.110803] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x000000005f9ea9e6) 0x00000000fba47dad 0
[ 98.110823] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x000000000e13178c) 0x00000000a9b65c9b 0
[ 98.110867] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x00000000131026fc) 0x0000000045b50a40 16588800
[ 98.110871] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x00000000076be4f8) 0x0000000081f26831 16588800
[ 98.110875] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x000000005f9ea9e6) 0x00000000fba47dad 16588800
[ 98.110879] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x000000000e13178c) 0x00000000a9b65c9b 16588800
[ 98.129330] thp7312_mipi 2-0061: s_stream: 1
[ 98.194677] base address switching Change Err.
[ 98.329433] skip frame 1
[ 98.363289] mx6s-csi 32e20000.csi1_bridge: mx6s_csi_frame_done (vb=0x00000000131026fc) 0x0000000045b50a40 16588800
[ 98.397078] mx6s-csi 32e20000.csi1_bridge: mx6s_csi_frame_done (vb=0x00000000076be4f8) 0x0000000081f26831 16588800
[ 98.397300] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x00000000076be4f8) 0x0000000081f26831 0
[ 98.397307] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x00000000076be4f8) 0x0000000081f26831 16588800
[ 98.430918] mx6s-csi 32e20000.csi1_bridge: mx6s_csi_frame_done (vb=0x000000005f9ea9e6) 0x00000000fba47dad 16588800
[ 98.464778] mx6s-csi 32e20000.csi1_bridge: mx6s_csi_frame_done (vb=0x000000000e13178c) 0x00000000a9b65c9b 16588800
[ 98.498320] mx6s-csi 32e20000.csi1_bridge: mx6s_csi_frame_done (vb=0x00000000076be4f8) 0x0000000081f26831 16588800
[ 98.546000] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x00000000131026fc) 0x0000000045b50a40 0
[ 98.546011] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x00000000131026fc) 0x0000000045b50a40 16588800
[ 98.548625] thp7312_mipi 2-0061: s_stream: 0
[ 98.565871] mx6s-csi 32e20000.csi1_bridge: csi v4l2 busfreq high release.

 

///////////////////v4l2-ctl/////////////////////////////////////

v4l2-ctl --set-fmt-video=width=3840,height=2160,pixelformat=YUYV --stream-mmap --stream-to=output.yuyv --stream-count=1

 

///////////////////log/////////////////////////////////////

[ 87.956121] mx6s-csi 32e20000.csi1_bridge: csi v4l2 busfreq high request.
[ 87.956188] mx6s-csi 32e20000.csi1_bridge: VIDIOC_G_SELECTION not implemented
[ 87.956528] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_try_fmt_vid_cap() is called
[ 87.956536] mx6s-csi 32e20000.csi1_bridge: set to pixelformat 'YUYV-1'
[ 87.956704] mx6s-csi 32e20000.csi1_bridge: count=4, size=0
[ 87.956706] size=16588800
[ 87.988664] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x000000007ac96f2f) 0x0000000045b50a40 0
[ 87.988680] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x00000000065e2dc9) 0x0000000081f26831 0
[ 87.988686] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x0000000053f4a176) 0x00000000fba47dad 0
[ 87.988692] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x00000000c8f4155a) 0x00000000a9b65c9b 0
[ 87.988710] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x000000007ac96f2f) 0x0000000045b50a40 16588800
[ 87.988714] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x00000000065e2dc9) 0x0000000081f26831 16588800
[ 87.988718] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x0000000053f4a176) 0x00000000fba47dad 16588800
[ 87.988722] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x00000000c8f4155a) 0x00000000a9b65c9b 16588800
[ 88.009187] thp7312_mipi 2-0061: s_stream: 1
[ 88.136257] base address switching Change Err.
[ 88.237510] base address switching Change Err.
[ 88.338731] base address switching Change Err.
[ 88.439984] base address switching Change Err.
[ 88.541241] base address switching Change Err.
[ 88.642491] base address switching Change Err.
[ 88.743744] base address switching Change Err.
[ 88.844966] base address switching Change Err.
[ 88.946218] base address switching Change Err.
[ 89.047472] base address switching Change Err.
[ 89.148725] base address switching Change Err.
[ 89.249979] base address switching Change Err.
[ 89.351231] base address switching Change Err.
[ 89.452452] base address switching Change Err.
[ 89.550442] mx6s-csi 32e20000.csi1_bridge: csi v4l2 busfreq high release.

 

///////////////////v4l2-ctl --set-param=30 added/////////////////////////////////////

v4l2-ctl --set-fmt-video=width=3840,height=2160,pixelformat=YUYV --set-parm=30 --stream-mmap --stream-to=output.yuyv --stream-count=1

///////////////////log/////////////////////////////////////

[ 193.014102] mx6s-csi 32e20000.csi1_bridge: csi v4l2 busfreq high request.
[ 193.014169] mx6s-csi 32e20000.csi1_bridge: VIDIOC_G_SELECTION not implemented
[ 193.014589] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_try_fmt_vid_cap() is called
[ 193.014619] mx6s-csi 32e20000.csi1_bridge: set to pixelformat 'YUYV-1'
[ 193.014636] mx6s-csi 32e20000.csi1_bridge: mx6s_vidioc_s_parm() is called fps=30 capturemode=0
[ 193.078276] mx6s-csi 32e20000.csi1_bridge: count=4, size=0
[ 193.078282] size=16588800
[ 193.105705] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x00000000d279dd61) 0x00000000ccf4ad36 0
[ 193.105719] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x00000000f6f38174) 0x00000000bdc6fe81 0
[ 193.105725] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x00000000363eb2c6) 0x00000000ee8e4bc9 0
[ 193.105731] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_prepare (vb=0x0000000021ac9653) 0x000000006522ee3d 0
[ 193.105748] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x00000000d279dd61) 0x00000000ccf4ad36 16588800
[ 193.105752] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x00000000f6f38174) 0x00000000bdc6fe81 16588800
[ 193.105756] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x00000000363eb2c6) 0x00000000ee8e4bc9 16588800
[ 193.105760] mx6s-csi 32e20000.csi1_bridge: mx6s_videobuf_queue (vb=0x0000000021ac9653) 0x000000006522ee3d 16588800
[ 193.124882] thp7312_mipi 2-0061: s_stream: 1
[ 193.160688] base address switching Change Err.
[ 193.261940] base address switching Change Err.
[ 193.363194] base address switching Change Err.
[ 193.464415] base address switching Change Err.
[ 193.565668] base address switching Change Err.
[ 193.666921] base address switching Change Err.
[ 193.768174] base address switching Change Err.
[ 193.869428] base address switching Change Err.
[ 193.970651] base address switching Change Err.
[ 194.071903] base address switching Change Err.
[ 194.173157] base address switching Change Err.
[ 194.274414] base address switching Change Err.
[ 194.375663] base address switching Change Err.
[ 194.476916] base address switching Change Err.
[ 194.578139] base address switching Change Err.
[ 194.679391] base address switching Change Err.
[ 194.780645] base address switching Change Err.
[ 194.881899] base address switching Change Err.
[ 194.983153] base address switching Change Err.
[ 195.084373] base address switching Change Err.
[ 195.156199] mx6s-csi 32e20000.csi1_bridge: csi v4l2 busfreq high release.

 

0 Kudos