Add custom camera ov2659 via parallel interface into IMX6Q evb

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

Add custom camera ov2659 via parallel interface into IMX6Q evb

2,660 Views
ASTRIHK
Contributor III

I modified the source code of ov5642 to suit ov2659. When the kernel booted, ov2659 could be found.

camera ov5640 is not found

ioctl_g_fmt_cap

usb 1-1: new low-speed USB device number 2 using ci_hdrc

camera ov2659 is found

ov5640_read_reg:write reg error:reg=300a

camera ov5640_mipi is not found

mxc_v4l2_output v4l2_out.36: V4L2 device registered as video16

mxc_v4l2_output v4l2_out.36: V4L2 device registered as video17

usbcore: registered new interface driver uvcvideo

USB Video Class driver (1.1.1)

However, after ov2659 driver was loaded, "slave not found" was shown.

++++++++++++++++ioctl_g_fmt_cap

ERROR: v4l2 capture: slave not found!

+++++++++++++++++ioctl_g_ifparm

+++++++++++++++++ioctl_g_fmt_cap

ERROR: v4l2 capture: slave not found!

+++++++++++++++++ioctl_g_ifparm

+++++++++++++++++ioctl_g_fmt_cap

warning: `zygote' uses 32-bit capabilities (lega��support in use)

Then I installed google camera into KK443, after camera icon was clicked, nothing was shown on the screen.

++++++++++++++++ioctl_g_parm

+++++++++++++++++V4L2_BUF_TYPE_VIDEO_CAPTURE

+++++++++++++++++iocpl_g_ifparm

+++++++++++++++++ioctl_g_fmt_cap

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

+++++++++++++++++ioctl_g_ifparm

+++++++++++++++++ioctl_g_fmt_cap

Then I quitted the camera app and clicked again, camera image could be shown on the screen this time and forever.

+++++++++++++++++ioctl_g_parm

+++++++++++++++++V4L2_BUF_TYPE_VIDEO_CAPTURE

+++++++++++++++++ioctl_g_ifparm

+++++++++++++++++ioctl_g_fmt_cap

However, if I reboot the Android, I will need to reinstall the camera app and do the same procedures as above, please kindly advise.

Labels (1)
0 Kudos
15 Replies

1,886 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Jackie,

    by default, mxc_v4l2_caputure will check 2 cameras, one is CSI parallel, the other is MIPI-CSI2 , at first, check if your ov2659 driver can correctly loaded. from your log, It seems that there are something wrong with ov2659 driver, the camera didn't attached to CSI interface.

Regards,

Weidong

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Hi Weidong,

Thanks for your advice. Actually I just used the template of ov5642 including "ov564x: ov564x@3c" in imx6qdl-sabresd.dtsi and ov5642.c, what I did is just to modify the resolution and the init code in ioctl_dev_init() of ov5642.c. I assumed that the original camera ov5642 driver can attach CSI interface, right?

BR,

Jackie

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Hi Weidong,

You seems correct, the printed message of mxc_v4l2_capture.c showed csi doesn't match, how to correct it? Thanks.

slave.name = ov2659

master.name = mxc_v4l2_cap1

sdata->csi=0, cam->csi=1

mxc_v4l2_master_attach: csi doesn't match

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Hi Weidong,

I would like to provide you more information. I added some print message in mxc_v4l2_master_attach() & mxc_v4l_open().

I don't know why v4l2_master_attach() was called twice. First time sdata->csi=0 & cam->csi weren't matched but it was ok for 2nd time.

In MVC: mxc_v4l2_master_attach

   slave.name = ov2659

   master.name = mxc_v4l2_cap1

Not match, sdata->csi=0, cam->csi=1

mxc_v4l2_master_attach: csi doesn't match

In MVC: mxc_v4l2_master_attach

   slave.name = ov2659

   master.name = mxc_v4l2_cap0

MATCHED, sdata->csi=0, cam->csi=0

camera ov2659 is found

ov564x: ov564x@30 {

        compatible = "ovti,ov564x";

        /*reg = <0x3c>;*/

        reg = <0x30>;

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_ipu1_2>;

        clocks = <&clks 201>;

        clock-names = "csi_mclk";

        DOVDD-supply = <&vgen4_reg>; /* 1.8v */

        AVDD-supply = <&vgen3_reg>;  /* 2.8v, on rev C board is VGEN3,

                        on rev B board is VGEN5 */

        DVDD-supply = <&vgen2_reg>;  /* 1.5v*/

        pwn-gpios = <&gpio1 16 1>;   /* active low: SD1_DAT0 */

        rst-gpios = <&gpio1 17 0>;   /* active high: SD1_DAT1 */

        cam-led = <&gpio4 5 0>; /* active high: GPIO19 */

        csi_id = <0>;

        mclk = <24000000>;

        mclk_source = <0>;

    };

when mxc_v4l_open() was called, the following message showed that ioctl_dev_init() of ov2659 was called three times. In imx6qdl-sabresd.dtsi, csi_id should be 0 but I just wondered why the error message printed "slave not found!, ipu_id=0, csi=1".

In MVC: mxc_v4l_open

   device name is Mxc Camera

ioctl_g_ifparm

ioctl_g_fmt_cap

ioctl_dev_init, tgt_fps=25

ov2659-0x3633=3d

ov2659-0x0100=1

In MVC: mxc_v4l_open

   device name is Mxc Camera

ERROR: v4l2 capture: slave not found!, ipu_id=0, csi=1

In MVC: mxc_v4l_open

   device name i  Mxc Camera

ioctl_g_ifparm

ioctl_g_fmt_cap

+ioctl_dev_init, tgt_fps=25

ov2659-0x3633=3d

ov2659-0x0100=1

In MVC: mxc_v4l_open

   device name is Mxc Camera

ERROR: v4l2 capture: slave not found!, ipu_id=0, csi=1

In MVC: mxc_v4l_open

   device name is Mxc Camera

ioctl_g_ifparm

ioctl_g_fmt_cap

ioctl_dev_init, tgt_fps=25

ov2659-0x3633=3d

ov2659-0x0100=1

warning: `zygote' uses 32-bit capabilipies (legacy support in use)

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Hi Weidong,

It's better when I disabled the unused camera such as ov5640 & ov5640_mipi in dtsi file. "ERROR: v4l2 capture: slave not found!" is disappeared. It seemed this bug is fixed.

In MVC: mxc_v4l2_master_attach

  slave.name = ov5642

  master.name = mxc_v4l2_cap0

MATCHED, sdata->csi=, cam->csi=0

However, the camera app disappeared in android launcher suddenly. If I installed another camera app, camera image could be shown on the screen. If I reboot the android, after the launcher was launched and I clicked the camera icon, "app isn't installed" was popped up. What's going on?

Also, before the android was launched, the following messages was printed out, it seems that ov2659 driver was initialized three times. I have attached my ov2659 driver, please help to dig out my problems, thanks.

In MVC: mxc_v4l_open

   device name is Mxc Camera

+++++++++++++++++ioctl_g_ifparm

+++++++++++++++++ioctl_g_fmt_cap

++++++++++ioctl_dev_init, tgt_fps=25

ov5642-0x3633=3d

ov5642-0x0100=1

In MVC: mxc_v4l_open

   device name is Mxc Camera

+++++++++++++++++ioctl_g_ifparm

+++++++++++++++++ioctl_g_fmt_cap

++++++++++ioctl_dev_init, tgt_fps=25

ov5642-0x3633=3d

ov5642-0x0100=1

In MVC: mxc_v4l_open

   device name is Mxc Camera

+++++++++++++++++ioctl_g_ifparm

+++++++++++++++++ioctl_g_fmt_cap

++++++++++ioctl_dev_init, tgt_fps=25

ov5642-0x3633=3d

ov5642-0x0100=1

0 Kudos

1,886 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Jackie,

  Can Original Camera.apk normally work ? I mean , could you see image preview in it ?

Regards,

Weidong

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Hi Weidong,

I watched the original camera.apk's icon would be disappeared after the 1st launch of Android. What will trigger this issue?

BR,

Jackie

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Hi Weidong,

I just installed another camera app and seemed ok, but another problem was happened. When video mode of camera app was selected, captured image could be shown on the screen. But when camera mode was selected, nothing was shown and error message "ERROR: v4l2 capture: mxc_streamon buffer has not been queued yetindex=0, length=460800" was printed. Then I logcat and felt strange with some debug messages. Why SupportedPictureSizes was 640 x 480 but not 1280 x 720? Where can I configure the SupportedPictureSizes?

camera_device open: 0

I/FslCameraHAL(  154): DeviceAdapter: Create ov2659 csi device

I/FslCameraHAL(  154): SupportedPictureSizes: 640 x 480

A/FslCameraHAL(  154): SupportedPreviewSizes: 1280 x 720

I/FslCameraHAL(  154): SupportedPreviewSizes: 640 x 480

I/FslCameraHAL(  154): SupportedPreviwSizes: 176 x 144

I/FslCameraHAL(  154): FrameDuration is 33331760, 30000000000

I/FslCameraHAL(  154): mMaxWidth:640, mM`xHeight:480

I/FslCameraHAL(  154): ov5642Csi, mFocalLength:3.370000, mPhysicalWidth:3.628800, mPhysicalHeight 2.7

21600

In ov2659_probe() of my camera driver, I have set

    ov2659_data.i2c_client = client;

    ov2659_data.pix.pixelformat = V4L2_PIX_FMT_YUYV;

    ov2659_data.pix.width = 1280;

    ov2659_data.pix.height = 720;

    ov2659_data.streamcap.capability = V4L2_MODE_HIGHQUALITY | V4L2_CAP_TIMEPERFRAME;

    ov2659_data.streamcap.capturemode = 0;

    ov2659_data.streamcap.timeperframe.denominator = 25;

    ov2659_data.streamcap.timeperframe.numerator = 1;

What is the meaning of ov2659_data.streamcap.capturemode = 0?

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Any idea?

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Fixed.

0 Kudos

1,886 Views
Blackrose
Contributor I

Hi, Jackie.How did you fix it?Could you show some hint for me?Thanks.

0 Kudos

1,886 Views
pro-supportengi
NXP Employee
NXP Employee

Jackie,

what was he fix to this split screen behavior?

B.R.

Tracy

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Hi Weidong,

I have attached the split images for your reference.

BR,

Jackie

0 Kudos

1,886 Views
ASTRIHK
Contributor III

Hi Weidong,

I have fixed the SupportedPictureSizes issue and faced another problem. I used my HD camera and 3rd party app to output 1280x720 jpeg. However, sometimes whole jpeg is split into 2 parts(left & right) and those 2 parts' positions are exchanged. Sometimes whole jpeg is split into 4 parts and those 4 parts' positions are also exchanged.Please kindly advise.

BR,

Jackie

0 Kudos

1,886 Views
ASTRIHK
Contributor III

I checked "cam->sensor == NULL" when mxc_v4l_open() was called, what does it mean? Thanks.

0 Kudos