imx8mm上mipi camera运行v4l2 sample出错

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

imx8mm上mipi camera运行v4l2 sample出错

Jump to solution
2,973 Views
Sen_tian1
Contributor II

Hello

在imx8mm上使用uvc camera跑v4l2官方的sample没有问题,但是使用ov5640的camera就跑不通,会报select timeout的错误。

https://linuxtv.org/downloads/v4l-dvb-apis-new/userspace-api/v4l/capture.c.html

v4l2-ctl --all

Driver Info:

Driver name : mx6s-csi

Card type : i.MX6S_CSI
Bus info : platform:32e20000.csi1_bridge
Driver version : 5.4.3
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 0
Video input : 0 (Camera: ok)
Format Video Capture:
Width/Height : 0/0
Pixel Format : ''
Field : Any
Bytes per Line : 0
Size Image : 0
Colorspace : Default
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 0, Height 0
Default : Left 0, Top 0, Width 0, Height 0
Pixel Aspect: 1/1
Crop: Left 0, Top 0, Width 0, Height 0
Selection: crop, Left 0, Top 0, Width 0, Height 0, Flags:
Selection: crop_default, Left 0, Top 0, Width 0, Height 0, Flags:
Selection: crop_bounds, Left 0, Top 0, Width 0, Height 0, Flags:
Selection: compose, Left 0, Top 0, Width 0, Height 0, Flags:
Selection: compose_default, Left 0, Top 0, Width 0, Height 0, Flags:
Selection: compose_bounds, Left 0, Top 0, Width 0, Height 0, Flags:
Selection: compose_padded, Left 0, Top 0, Width 0, Height 0, Flags:
Selection: native_size, Left 0, Top 0, Width 0, Height 0, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0

 

v4l2-ctl --list-formats

ioctl: VIDIOC_ENUM_FMT
Type: Video Capture

[0]: 'YUYV' (YUYV 4:2:2)

 

发现crop,selection的size都为0,是这个的原因,需要修改驱动代码嘛?

还是说mipi camera 和 uvc camera在调用v4l2接口的时候用什么不同,需要改写v4l2 sample代码?

有什么建议或可以提供一些解决的方向嘛?

十分感谢。

Labels (1)
0 Kudos
Reply
1 Solution
3 Replies
2,938 Views
Sen_tian1
Contributor II

@Zhiming_Liu 

十分感谢,增加了VIDIOC_S_PARM的相关操作后mipi camera可以截图了。

 

想再请教一个问题

想将ov5640_mipi_v2的模块编入到Image中,
修改相应config文件中的CONFIG_MXC_CAMERA_OV5640_MIPI_V2参数为y(默认为m),
替换Image和dtb文件后程序启动不了了,想请教下是什么原因,应该怎么办。
再次感谢!
0 Kudos
Reply
2,966 Views
Sen_tian1
Contributor II

root@myd-imx8mm:~# v4l2-ctl --stream-mmap -d /dev/video0
[ 17.029245] ------------[ cut here ]------------
[ 17.033883] WARNING: CPU: 3 PID: 805 at drivers/media/common/videobuf2/videobuf2-core.c:738 vb2_core_reqbufs+0x140/0x460
[ 17.044748] Modules linked in: uvcvideo snd_usb_audio snd_hwdep snd_usbmidi_lib bcmdhd crct10dif_ce snd_soc_imx_wm8904 ov5640_camera_mipi_v2
[ 17.057366] CPU: 3 PID: 805 Comm: v4l2-ctl Tainted: G W 5.4.3-g9c2490a-dirty #10
[ 17.066060] Hardware name: MYD-C8MMX-V2.0 i.MX8MM board (DT)
[ 17.071717] pstate: 80000005 (Nzcv daif -PAN -UAO)
[ 17.076506] pc : vb2_core_reqbufs+0x140/0x460
[ 17.080860] lr : vb2_core_reqbufs+0x108/0x460
[ 17.085213] sp : ffff800012683a80
[ 17.088524] x29: ffff800012683a80 x28: 00000000c0145608
[ 17.093833] x27: 0000000000000000 x26: 0000000000000000
[ 17.099142] x25: ffff00007b2f7170 x24: 0000000000000001
[ 17.104451] x23: ffff800012683cd8 x22: ffff00006ca58e00
[ 17.109760] x21: ffff000072a11e00 x20: 0000000000000000
[ 17.115069] x19: ffff00007b2f7110 x18: 0000000000000000
[ 17.120379] x17: 0000000000000000 x16: 0000000000000000
[ 17.125687] x15: 0000000000000000 x14: 0000000000000000
[ 17.130996] x13: 0000000000000000 x12: 0000000000000000
[ 17.136305] x11: 0000000000000000 x10: 0000000000000000
[ 17.141614] x9 : 0000000000000000 x8 : 0000000000000000
[ 17.146926] x7 : 0000000000000000 x6 : 0000000000000000
[ 17.152236] x5 : ffff00007a809410 x4 : 0000000000000000
[ 17.157545] x3 : 0000000000000001 x2 : ffff800012683afc
[ 17.162854] x1 : 0000000000000000 x0 : ffff800012683af8
[ 17.168164] Call trace:
[ 17.170613] vb2_core_reqbufs+0x140/0x460
[ 17.174622] vb2_reqbufs+0x78/0x88
[ 17.178025] mx6s_vidioc_reqbufs+0x3c/0x70
[ 17.182122] v4l_reqbufs+0x48/0x58
[ 17.185522] __video_do_ioctl+0x17c/0x3e0
[ 17.189528] video_usercopy+0x210/0x5c0
[ 17.193362] video_ioctl2+0x14/0x20
[ 17.196848] v4l2_ioctl+0x3c/0x58
[ 17.200165] do_vfs_ioctl+0x964/0xb48
[ 17.203825] ksys_ioctl+0x78/0xa8
[ 17.207138] __arm64_sys_ioctl+0x1c/0x28
[ 17.211063] el0_svc_common.constprop.0+0x68/0x160
[ 17.215851] el0_svc_handler+0x20/0x80
[ 17.219599] el0_svc+0x8/0xc
[ 17.222477] ---[ end trace 927816d33f358035 ]---

0 Kudos
Reply