AnsweredAssumed Answered

IMX6 support for a 8 bit grey scale sensor

Question asked by Omar Pighi on Oct 9, 2014
Latest reply on Jan 15, 2016 by Amadeus Holmer

Dear all,

 

I'm trying to acquire pictures from a 8 bit greyscale sensor (AR0134 from aptina) but i cannot succeed on it. (I'm working on 3.10.17_1.0.1_ga )

What i obtain (acquiring using gstreame pipeline) is a someting bad. tried to acquire a jpeg or a raw snapshot.

first take a look to this other thread:

IPU2 parallel port on IMX6Q

imx6 support for 8-bit RAW camera

I decided to open a new thread with a specific question on grey scale (but i think could be the same problem with a raw sensor), So maybe with a very specific question is easy to have a answer that could help me.

 

and here the gstreamer pipe for jpeg and for raw snapshot:

gst-launch mfw_v4lsrc num-buffers=1 device=/dev/video3 ! filesink location=/mnt/nfs/home/sample.raw

gst-launch mfw_v4lsrc num-buffers=1 device=/dev/video3 !  jpegenc ! filesink location=/mnt/nfs/home/sample.jpeg

 

I attach to this question the two jpeg and raw snapshot.

Please note that the sensor is 1280x960 so the raw should be 1228800 bytes, instead it is 1.8Mbyte the exact dimension of a 420 image ... soi think something is bad configurated in the IPU that make some kind of conversion....

 

I added around the code the supprto for the grey scale pix format V4L2_PIX_FMT_GREY... but it is not sufficent yet...

here i put the dmesg (i enable a lot of debug print around and some added by myself to understand what is going wrong)

 

[   85.106229] mxc_v4l_open: Mxc Camera ipu1/csi1

[   85.106329] mxc_v4l_open: 1 ipu1/csi1

[   85.106337]    clock_curr=mclk=27000000

[   85.108874]    clock_curr=mclk=27000000

[   85.108879] vsync_pol(1) hsync_pol(1) ext_vsync(1)

[   85.108884] ioctl_g_fmt_cap: 1

[   85.108888] ioctl_g_fmt_cap: 1280x960

[   85.108892]    g_fmt_cap returns widthxheight of input as 1280 x 960

[   85.108896] On Open: Input to ipu size is 1280 x 960

[   85.108901] End of setup_ifparm: v2f pix widthxheight 1280 x 960

[   85.108906] End of setup_ifparm: crop_bounds widthxheight 1280 x 960

[   85.108910] End of setup_ifparm: crop_defrect widthxheight 1280 x 960

[   85.108914] End of setup_ifparm: crop_current widthxheight 1280 x 960

[   85.108918] ioctl_g_fmt_cap: b

[   85.108922] ioctl_g_fmt_cap: left=0, top=0, 0x0

[   85.108943] imx-ipuv3 2800000.ipu: ipu_csi_init_interface: 1280x960

[   85.108953] imx-ipuv3 2800000.ipu: CSI_SENS_CONF = 0x80008B03

[   85.108960] imx-ipuv3 2800000.ipu: CSI_ACT_FRM_SIZE = 0x03BF04FF

[   85.108969] power_up_camera: ipu1/csi1

[   85.130541] ioctl_init

[   85.131604]    Setting mclk to 27 MHz

[   85.133965] AR0134_init

[   85.550613] mxc_v4l_ioctl

[   85.550828] mxc_v4l_do_ioctl: c02c5651 ipu1/csi1

[   85.550847] mxc_v4l_ioctl

[   85.550860] mxc_v4l_do_ioctl: c02c564a ipu1/csi1

[   85.550874] mxc_v4l_ioctl

[   85.550887] mxc_v4l_do_ioctl: c0045627 ipu1/csi1

[   85.550896]    case VIDIOC_S_INPUT

[   85.550907] mxc_v4l_ioctl

[   85.550920] mxc_v4l_do_ioctl: c0cc5616 ipu1/csi1

[   85.550930]    case VIDIOC_S_PARM

[   85.550938] mxc_v4l2_s_param

[   85.550947]    Current capabilities are 1001

[   85.550956]    Current capturemode is 0  change to 0

[   85.550965]    Current framerate is 54  change to 30

[   85.572065]    clock_curr=mclk=27000000

[   85.574614]    clock_curr=mclk=27000000

[   85.574628] vsync_pol(1) hsync_pol(1) ext_vsync(1)

[   85.574639] ioctl_g_fmt_cap: 1

[   85.574649] ioctl_g_fmt_cap: 1280x960

[   85.574659]    g_fmt_cap returns widthxheight of input as 1280 x 960

[   85.574668] ioctl_g_fmt_cap: b

[   85.574679] ioctl_g_fmt_cap: left=0, top=0, 0x0

[   85.574717] imx-ipuv3 2800000.ipu: ipu_csi_init_interface: 1280x960

[   85.574739] imx-ipuv3 2800000.ipu: CSI_SENS_CONF = 0x80008B03

[   85.574756] imx-ipuv3 2800000.ipu: CSI_ACT_FRM_SIZE = 0x03BF04FF

[   85.574775] mxc_v4l_ioctl

[   85.574791] mxc_v4l_do_ioctl: c0cc5605 ipu1/csi1

[   85.574800]    case VIDIOC_S_FMT

[   85.574808] mxc_v4l2_s_fmt

[   85.574815]    type=V4L2_BUF_TYPE_VIDEO_CAPTURE

[   85.574830] End of mxc_v4l2_s_fmt: v2f pix widthxheight 1280 x 960

[   85.574842] End of mxc_v4l2_s_fmt: crop_bounds widthxheight 1280 x 960

[   85.574852] End of mxc_v4l2_s_fmt: crop_defrect widthxheight 1280 x 960

[   85.574863] End of mxc_v4l2_s_fmt: crop_current widthxheight 1280 x 960

[   85.574874] mxc_v4l_ioctl

[   85.574887] mxc_v4l_do_ioctl: c008561c ipu1/csi1

[   85.574896]    case VIDIOC_S_CTRL

[   85.574904] mxc_v4l2_s_ctrl

[   85.574915] mxc_v4l_ioctl

[   85.574928] mxc_v4l_do_ioctl: c0145608 ipu1/csi1

[   85.574936]    case VIDIOC_REQBUFS

[   85.574950] mxc_streamoff: ipu1/csi1 capture_on=0 CSI MEM

[   85.574959] mxc_free_frame_buf

[   85.574971] mxc_allocate_frame_buf: size=1843200

[   85.643157] mxc_v4l_ioctl

[   85.643184] mxc_v4l_do_ioctl: c0cc5604 ipu1/csi1

[   85.643194]    case VIDIOC_G_FMT

[   85.643204] mxc_v4l2_g_fmt: type=1

[   85.643213]    type is V4L2_BUF_TYPE_VIDEO_CAPTURE

[   85.643225] End of mxc_v4l2_g_fmt: v2f pix widthxheight 1280 x 960

[   85.643236] End of mxc_v4l2_g_fmt: crop_bounds widthxheight 1280 x 960

[   85.643247] End of mxc_v4l2_g_fmt: crop_defrect widthxheight 1280 x 960

[   85.643257] End of mxc_v4l2_g_fmt: crop_current widthxheight 1280 x 960

[   85.643403] mxc_v4l_ioctl

[   85.643419] mxc_v4l_do_ioctl: c0445609 ipu1/csi1

[   85.643430]    case VIDIOC_QUERYBUF

[   85.643440] mxc_v4l2_buffer_status

[   85.643476] mxc_mmap:pgoff=0x40300, start=0x76661000, end=0x76823000

[   85.646940] mxc_v4l_ioctl

[   85.646959] mxc_v4l_do_ioctl: c044560f ipu1/csi1

[   85.646969]    case VIDIOC_QBUF

[   85.646991] mxc_v4l_ioctl

[   85.647003] mxc_v4l_do_ioctl: c0445609 ipu1/csi1

[   85.647011]    case VIDIOC_QUERYBUF

[   85.647019] mxc_v4l2_buffer_status

[   85.647045] mxc_mmap:pgoff=0x40500, start=0x7649f000, end=0x76661000

[   85.650373] mxc_v4l_ioctl

[   85.650387] mxc_v4l_do_ioctl: c044560f ipu1/csi1

[   85.650395]    case VIDIOC_QBUF

[   85.650411] mxc_v4l_ioctl

[   85.650423] mxc_v4l_do_ioctl: c0445609 ipu1/csi1

[   85.650431]    case VIDIOC_QUERYBUF

[   85.650439] mxc_v4l2_buffer_status

[   85.650462] mxc_mmap:pgoff=0x40700, start=0x762dd000, end=0x7649f000

[   85.653270] mxc_v4l_ioctl

[   85.653278] mxc_v4l_do_ioctl: c044560f ipu1/csi1

[   85.653283]    case VIDIOC_QBUF

[   85.653292] mxc_v4l_ioctl

[   85.653297] mxc_v4l_do_ioctl: c0445609 ipu1/csi1

[   85.653300]    case VIDIOC_QUERYBUF

[   85.653304] mxc_v4l2_buffer_status

[   85.653315] mxc_mmap:pgoff=0x40900, start=0x7611b000, end=0x762dd000

[   85.654871] mxc_v4l_ioctl

[   85.654877] mxc_v4l_do_ioctl: c044560f ipu1/csi1

[   85.654881]    case VIDIOC_QBUF

[   85.654888] mxc_v4l_ioctl

[   85.654893] mxc_v4l_do_ioctl: c0445609 ipu1/csi1

[   85.654897]    case VIDIOC_QUERYBUF

[   85.654900] mxc_v4l2_buffer_status

[   85.654912] mxc_mmap:pgoff=0x40b00, start=0x75f59000, end=0x7611b000

[   85.656461] mxc_v4l_ioctl

[   85.656466] mxc_v4l_do_ioctl: c044560f ipu1/csi1

[   85.656470]    case VIDIOC_QBUF

[   85.656477] mxc_v4l_ioctl

[   85.656481] mxc_v4l_do_ioctl: c0445609 ipu1/csi1

[   85.656485]    case VIDIOC_QUERYBUF

[   85.656489] mxc_v4l2_buffer_status

[   85.656498] mxc_mmap:pgoff=0x40d00, start=0x75d97000, end=0x75f59000

[   85.658052] mxc_v4l_ioctl

[   85.658057] mxc_v4l_do_ioctl: c044560f ipu1/csi1

[   85.658061]    case VIDIOC_QBUF

[   85.658070] mxc_v4l_ioctl

[   85.658075] mxc_v4l_do_ioctl: 40045612 ipu1/csi1

[   85.658080]    case VIDIOC_STREAMON

[   85.658084] mxc_streamon

[   85.658088] IPU:In csi_enc_enabling_tasks

[   85.661379] In csi_enc_setup

[   85.662971] imx-ipuv3 2800000.ipu: init channel req= 15

[   85.662981] imx-ipuv3 2800000.ipu: init channel= 15

[   85.662993] imx-ipuv3 2800000.ipu: ipu busfreq high requst.

[   85.663007] imx-ipuv3 2800000.ipu: channel = 268435392

[   85.663019] imx-ipuv3 2800000.ipu: _ipu_csi_init:CSI_SENS_CONF: ipu=80d20998,csi=1,data=84008b03

[   85.663031] imx-ipuv3 2800000.ipu: initializing idma ch 0 @ c0980000

[   85.663053] imx-ipuv3 2800000.ipu: ch 0 word 0 - 00000000 96000000 002EE000 E0000000 000EFC9F

[   85.663063] imx-ipuv3 2800000.ipu: ch 0 word 1 - 06F20000 00DE4000 0047C000 00013FC0 0000027F

[   85.663069] imx-ipuv3 2800000.ipu: PFS 0x2,

[   85.663076] imx-ipuv3 2800000.ipu: BPP 0x0,

[   85.663082] imx-ipuv3 2800000.ipu: NPB 0x1f

[   85.663089] imx-ipuv3 2800000.ipu: FW 1279,

[   85.663095] imx-ipuv3 2800000.ipu: FH 959,

[   85.663101] imx-ipuv3 2800000.ipu: EBA0 0x37900000

[   85.663107] imx-ipuv3 2800000.ipu: EBA1 0x37900000

[   85.663114] imx-ipuv3 2800000.ipu: Stride 1279

[   85.663119] imx-ipuv3 2800000.ipu: scan_order 0

[   85.663125] imx-ipuv3 2800000.ipu: uv_stride 639

[   85.663132] imx-ipuv3 2800000.ipu: u_offset 0x12c000

[   85.663138] imx-ipuv3 2800000.ipu: v_offset 0x177000

[   85.663144] imx-ipuv3 2800000.ipu: Width0 0+1,

[   85.663150] imx-ipuv3 2800000.ipu: Width1 0+1,

[   85.663156] imx-ipuv3 2800000.ipu: Width2 0+1,

[   85.663162] imx-ipuv3 2800000.ipu: Width3 0+1,

[   85.663168] imx-ipuv3 2800000.ipu: Offset0 31,

[   85.663174] imx-ipuv3 2800000.ipu: Offset1 19,

[   85.663180] imx-ipuv3 2800000.ipu: Offset2 0,

[   85.663186] imx-ipuv3 2800000.ipu: Offset3 0

[   85.663196] eba 40300000

[   85.663201] eba 40500000

[   85.665400] mxc_v4l_ioctl

[   85.665409] mxc_v4l_do_ioctl: c0445611 ipu1/csi1

[   85.665412]    case VIDIOC_DQBUF

[   85.665416] mxc_v4l_dqueue

[   85.751112] camera_callback

[   85.751139] eba 40700000

[   85.815804] mxc_v4l_ioctl

[   85.815821] mxc_v4l_do_ioctl: c044560f ipu1/csi1

[   85.815826]    case VIDIOC_QBUF

[   85.815986] mxc_v4l_ioctl

[   85.815995] mxc_v4l_do_ioctl: 40045613 ipu1/csi1

[   85.815999]    case VIDIOC_STREAMOFF

[   85.816005] mxc_streamoff: ipu1/csi1 capture_on=1 CSI MEM

[   85.824867] imx-ipuv3 2800000.ipu: CSI stop timeout - -44 * 10ms

[   85.824901] imx-ipuv3 2800000.ipu: ipu busfreq high release.

[   85.824909] mxc_free_frames

[   85.825283] mxc_v4l_close

[   85.825291] mxc_streamoff: ipu1/csi1 capture_on=0 CSI MEM

[   85.825297] mxc_v4l_close: release resource

[   85.825302] mxc_free_frame_buf

[   85.827188] mxc_free_frames

[   87.820602] power_down_callback: ipu1/csi1

 

Hope this could be helpfull...I think i'm not the only one that it is trying to acquire a BW or bayer sensor...

Thanks

Omar

Attachments

Outcomes