[i.mx6d] acquisition from parallel camera interface

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

[i.mx6d] acquisition from parallel camera interface

3,245 Views
francescoprospe
Contributor II

Hi,

 

We are trying to acquire image data from a camera connected to the Parallel Camera Interface.

 

We are using an i.mx6dual with kernel 3.0.35 with some patches for our board (the SB-FX6 + CM-FX6) provided by Compulab.

 

In the imx-test suite, we examined the mxc_ipudev_test example program, but it seems to use the IC device (inside the IPU) to make

some operations to the data read from a binary file so, in our opinion, is not an example of ipu capture.

 

Another example program (mxc_v4l2_capture) shows the interaction with the /dev/video0 device.

 

In the kernel menuconfig, we enabled all the components as built-in it should need to enable /dev/video0 but it does not show up

at runtime. Attached is the .config of the kernel in use for verification.

 

Could you please tell us how to enable the debug messages inside the v4l2 driver? There are a number of pr_debug() calls

but the messages do not show up in the dmesg (drivers/media/video/mxc/capture/mxc_v4l2_capture.c).

 

Thanks for the help,

 

Regards,

Francesco e Daniele

Original Attachment has been moved to: .config.zip

Labels (2)
6 Replies

1,131 Views
francescoprospe
Contributor II

Hi Raybiztech,

the problem is that our custom camera is not I2C. Is there any example that manages a custom camera with non-I2C interface?

Should we use soc camera support  (generic) module in our code?

Regards,

F

1,131 Views
francescoprospe
Contributor II

Hi,

In the attached board-cm-fx6.c we saw no imx6q_add_v4l2_capture (present in board-mx6q_arm2.c)

so we suppose the capture is not set up.

In the board-mx6q_arm2.c, mx6_csi0_io_init is also defined, in which the pads are configured and the camera is reset.

Such mx6_csi0_io_init is used in the camera_data structure, that is associated with the i2c camera sensor ov5640 as in the following.

static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {

        {

                I2C_BOARD_INFO("cs42888", 0x48),

                .platform_data = (void *)&cs42888_data,

        }, {

                I2C_BOARD_INFO("ov5640", 0x3c),

                .platform_data = (void *)&camera_data,

        }, {

                I2C_BOARD_INFO("adv7180", 0x21),

                .platform_data = (void *)&tvin_data,

        },

};

In our case, the camera, that is custom, receives commands through SPI but we intend to communicate with it at user level (spidev).

So, basically, could mx6_csi0_io_init be called inside the main init function of the board (in order to initialize its pin)?

In camera_data there are some sensible information, as mclk, mclk_source and csi device index.

Thanks for any further inputs, we are kind of lost.

F

0 Kudos

1,131 Views
Raybiztech
Contributor V

Hi Francesco,

   Generally you initialise the pins in module init or in probe function.So mx6_csi0_io_init function is called in probe or module init function.

For reference you can study ov5642.c file under driver/media/mxc/capture . In ov5642_probe they called plat_data->io_init() which is routed to mx6_csi0_io_init().

I hope you are taking care of spi. as csi is configured for i2c.

regards,

raybiztech

0 Kudos

1,131 Views
Peca
Contributor I

Hi Raybiztech

I am trying to solve a similar problem. I am using  L3.0.35_4.1.0 kernel source  (by Freescale) with Compulab CM-FX6 board (i.MX6Q processor). I am developing a new camera driver for MT9M034  (parallel interface) based on the OV5642 driver included in the kernel. Sensor is correctly detected on I2C bus and special file /dev/video0 is created. But when I try to read any frame from this device using V4L2 interface I get EAGAIN error.

Trace debugging of the reading is:

In open_device.

In init_device.

In xioctl.

In xioctl.

In xioctl.

Video bytespreline = 1280

In init_mmap.

In xioctl.

In xYUV420

ioctl.

In xioctl.

In xioctl.

In xioctl.

In start_capturing.

In xioctl.

In xioctl.

In xioctl.

In xioctl.

In xioctl.

In mainloop.

In read_frame.

In xioctl.

In read_frame: EAGAIN.

frame: 00

In stop_capturing.

In xioctl.

In uninit_device.

In close_device.

Dmesg:

In MVC:mxc_streamon

YUV420

eba 18640000

eba 180c0000

In MVC:mxc_poll

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c0445611

   case VIDIOC_DQBUF                           #< here error probably occurs

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl 40045613

   case VIDIOC_STREAMOFF

In MVC:mxc_streamoff

In MVC:mxc_free_frames

In MVC:mxc_v4l_close

In MVC:mxc_streamoff

In ioctl_s_power( mt9m034, 0).

mxc_v4l_close: release resource

MVC: In mxc_free_frame_buf

In MVC:mxc_free_frames

I think that pins initialization is correct because if I disable them the test reading will fail much sooner.

Thanks for any suggestions.

Regards

Petr

0 Kudos

1,131 Views
Raybiztech
Contributor V

Hi Francesco,

   I have seen your config file.Not even a single ovXXXX camera is set.Will you let us know which camera you are using.So we can track your issue.

regards,

raybiztech

0 Kudos

1,131 Views
francescoprospe
Contributor II

Hi Raybiztech,

We are dealing with a custom camera, databus 12 bits (but we will work with 10 of them),

which wants to be clocked at 100 MHz with no VSYNC or HSYNC signals.

For a custom camera, enabling CONFIG_SOC_CAMERA_PLATFORM is the right choice (as generic)?

Right now we do not have the camera so we wanted to set things up.

It seems enabling CONFIG_DEBUG_KERNEL it is not enough to print out the kernel debug messages.

What's missing?

We know the mxc_v4l2 init is executed (we put a printk()) as a pretty dumb test.

Thanks for your time,

F

0 Kudos