Driver for omnivision sensor OV5650

2,225 views
Skip to first unread message

Jayakrishnan VR

unread,
Mar 15, 2012, 5:25:54 AM3/15/12
to pandaboard
Hi,
I am trying to interface the omnision sensor OV5650 to the pandaboard.
I got the camera adapter board and the sensor.
I downloaded the kernel from https://www.gitorious.org/omap4-v4l2-camera/pages/Home.
the ubuntu-natty_ti-omap4-v4l2cam” branch.
I did native compilation of the kernel on pandaboard as per
http://adventuresinsilicon.blogspot.in/2011/02/pandaboard-ubuntu-how-to-recompile.html
Then I connected the sensor and tried with cheese .It showed no
"device found". Then with gstreamer It showed error"cannot recognize /
dev/video0" . I then changed the command line to gst-launch v4l2src
device = /dev/video1 !............Then it showed error "/dev/video1
is not a capture device".
I then tried crosscompiling the kernel(using arm-linux-gnueabi-) to
generate uImage and replaced uImage in the pandaboard. Still same
result.
Can anyone tell me the correct procedure for compiling and using
kernel for interfacing OV5650 sensors. This is urgent. please reply
soon.

Vladimir Pantelic

unread,
Mar 19, 2012, 6:10:44 AM3/19/12
to panda...@googlegroups.com
Jayakrishnan VR wrote:
> Hi,
> I am trying to interface the omnision sensor OV5650 to the pandaboard.
> I got the camera adapter board and the sensor.
> I downloaded the kernel from https://www.gitorious.org/omap4-v4l2-camera/pages/Home.
> the ubuntu-natty_ti-omap4-v4l2cam� branch.

> I did native compilation of the kernel on pandaboard as per
> http://adventuresinsilicon.blogspot.in/2011/02/pandaboard-ubuntu-how-to-recompile.html
> Then I connected the sensor and tried with cheese .It showed no
> "device found". Then with gstreamer It showed error"cannot recognize /
> dev/video0" . I then changed the command line to gst-launch v4l2src
> device = /dev/video1 !............Then it showed error "/dev/video1
> is not a capture device".
> I then tried crosscompiling the kernel(using arm-linux-gnueabi-) to
> generate uImage and replaced uImage in the pandaboard. Still same
> result.
> Can anyone tell me the correct procedure for compiling and using
> kernel for interfacing OV5650 sensors.

you have to realize that there are only a very few people outside
of TI that have such a camera module and are able to use it.
you might want to ask the people behind that v4l2 driver directly.

> This is urgent. please reply soon.

yeah, right

gulraize zeeshan

unread,
Mar 19, 2012, 8:04:31 AM3/19/12
to pandaboard
JayaKrishnan,

I've tested ov5640 its working fine with ubuntu-natty kernel. im
assuming you have connected the camera sensor to CSI2-A interface on
pandaboard and its not USB camera.

are you statically building the camera sensor driver or building it as
a module.?

irrespective of you;re building it as module or statically, run make
menu config and select v4l2 sub-dev modules and sensor modules and
compile the kernel.

a) check the kernel logs (dmesg | tail) and verify camera sensor is
detected and registered with i2c.

b) check omap4-camera module is loaded (camera interface driver).

c) make sure camera sensor is generating interrupts (cat /proc/
interrupts look for omap4-camera)

if a,b and c are successful, it should work straight away,

Also if you are cross compiling the kernel on host system please note
that ubuntu keep track of ABI changes, x-server crashes if the abi has
changed, so you need take care of that.

-Gulraize

On Mar 15, 2:25 pm, Jayakrishnan VR <jkv...@gmail.com> wrote:
> Hi,
> I am trying to interface the omnision sensor OV5650 to the pandaboard.
> I got the camera adapter board and the sensor.
>  I downloaded the kernel fromhttps://www.gitorious.org/omap4-v4l2-camera/pages/Home.
> the ubuntu-natty_ti-omap4-v4l2cam” branch.
> I did native compilation of the kernel on pandaboard as perhttp://adventuresinsilicon.blogspot.in/2011/02/pandaboard-ubuntu-how-...

David Sanz Kirbis

unread,
Mar 20, 2012, 5:22:42 AM3/20/12
to pandaboard
> "you have to realize that there are only a very few people outside of TI that have such a camera module and are able to use it."

Don't want to argue, but this does not sound too encouraging... it
would be great something like "Great that you start a project to
interface a camera through the CSI2-A, please share your progress"
I personally would like to read a whole successful story/tutorial
about it... and the modules doesn't seem too inaccessible:

http://www.impactcomputers.com/ov5650.html
http://www.ebay.com/itm/CAMERA-FLASH-MODULE-REPLACEMENT-REPAIR-IPHONE-4-4G-/180605464280?pt=LH_DefaultDomain_0&hash=item2a0cecaed8#ht_1630wt_1165
http://www.ebay.com/itm/Genuine-Motorola-Xoom-MZ604-Rear-Camera-OEM-Part-/230746169141?pt=LH_DefaultDomain_0&hash=item35b98b1f35#ht_500wt_1180

Vladimir Pantelic

unread,
Mar 20, 2012, 1:05:59 PM3/20/12
to panda...@googlegroups.com

Don't get discouraged by me :)

Jayakrishnan VR

unread,
Mar 22, 2012, 4:17:54 AM3/22/12
to pandaboard
gulraize zeeshan,
I think the problem is with the cofiguration of the kernel.
In the default configuration with the OV5650 adapter connected ,I get
the following in dmesg

[ 5.431182] camera 0-0: Probing 0-0
[ 5.531921] ov5640 3-003c: Failed reading register 0x302a!
[ 5.532073] ov5640 3-003c: Failure to detect OV5640 chip
[ 5.532196] ov5640: probe of 3-003c failed with error -121
[ 5.532714] omap4-camera omap4-camera.0: OMAP4 Camera driver loaded
[ 5.643249] usbhid 1-1.3:1.0: usb_probe_interface
[ 5.643280] usbhid 1-1.3:1.0: usb_probe_interface - got id
[ 5.659851] omap_device: omap-aess-audio.-1: new worst case
activate latency 0: 30517

Actually the OV5650 driver needs to come up and check whether adapter
is interfaced. Instead of that OV5640 driver is coming up and is
failing to detect(adapter connected is OV5650 ). I removed the OV5640
driver using rmmod and inserted OV5650. still video is not working
with cheese or gstreamer.

I tried to rectify that by removing OV5640 and OV3640 from the kernel
configs and keeping OV5650 as 'M' type. Then I recompiled kernel.
In this case ,the OV5650 driver is not getting initialized at bootup
and video is not working.

Then in the kernel configs i put soc_camera as 'Y',OV5650 as
'Y',OV5640 as 'M', 3640 as 'M'. I also enabled I2C multiplexing
options. Then recompiled
In this case the dmesg output is as:
2.312530] i2c i2c-3: client [ov5640] registered with bus id 3-003c
[ 2.312591] i2c 3-003c: uevent
[ 2.312622] omap4-camera omap4-camera.0: OMAP4 Camera driver loaded
[ 2.312835] omap_vout omap_vout: 'hdmi' Display already enabled
[ 2.312835] omap_vout omap_vout: 'hdmi' Display already enabled
[ 2.312835] omap_vout omap_vout: Buffer Size = 3686400
[ 2.313903] omap_vout omap_vout: : registered and initialized video
device 1.

the dmesg is same even when the adapter is not connected. What i don't
understand is why does the ov5640 driver comeup and ov5650 does not
comeup.
Can you tell the correct configs so that ov5650 gets enabled?


On Mar 19, 5:04 pm, gulraize zeeshan <gulra...@gmail.com> wrote:
> JayaKrishnan,
>
> I've tested ov5640 its working fine with ubuntu-natty kernel. im
> assuming you have connected the camera sensor to CSI2-A interface on
> pandaboard and its not USB camera.
>
> are you statically building the camera sensordriveror building it as

gulraize zeeshan

unread,
Mar 26, 2012, 2:20:57 AM3/26/12
to pandaboard
Jayakrishnan,

Yes, it could be config issue.
How are you compiling the kernel? Please refer following

http://www.omappedia.com/wiki/Ubuntu_kernel_for_OMAP4#Building_the_kernel:_generate_a_kernel_package

if you are compiling kernel using make use config.common.ubuntu config
file, it selects appropriate modules. i suggest go with the first
option.

make sure you run the clean command before fresh build

also try building all the modules statically, (v4l2 subdev, ov5640,
5650 and 3640).

If you are following above steps correctly it could be hardware issue.
you need to probe the i2c lines.

Dont forget to take care of ABI changes,

if you run xvinfo it should show something like display 0

if the xvinfo out is "no display found" gstreamer or cheese wont work
(cheese uses gstreamer API's).

-Gulraize

gulraize zeeshan

unread,
Mar 26, 2012, 2:25:57 AM3/26/12
to pandaboard
PS: Also check if you have checked out appropriate branch (ubuntu-
natty_ti-omap4-v4l2cam).

On Mar 26, 11:20 am, gulraize zeeshan <gulra...@gmail.com> wrote:
> Jayakrishnan,
>
> Yes, it could be config issue.
> How are you compiling the kernel? Please refer following
>
> http://www.omappedia.com/wiki/Ubuntu_kernel_for_OMAP4#Building_the_ke...

Jayakrishnan VR

unread,
Mar 30, 2012, 1:30:59 AM3/30/12
to pandaboard
zeeshan,
Now the ov5650 is getting detected. However the video is still blank
in cheese.

I used defualt kernel configurations.I modified the files arch/arm/
mach-omap2/board-4430sdp.c and arch/arm/mach-omap2/board-omap4panda.c

I commented some lines so that 5650 is default sensor
//////////////////////////////////////////////////////////////////////////////////////

static struct i2c_board_info sdp4430_i2c_camera[] = {
/*
#ifdef CONFIG_MACH_OMAP_4430SDP_CAM_OV3640
{
// Uses same I2C Address as OV5640
I2C_BOARD_INFO("ov3640", OV5640_I2C_ADDRESS),
},
#endif
#ifdef CONFIG_MACH_OMAP_4430SDP_CAM_OV5640
{
I2C_BOARD_INFO("ov5640", OV5640_I2C_ADDRESS),
},
#endif
*/
//#ifdef CONFIG_MACH_OMAP_4430SDP_CAM_OV5650
{
I2C_BOARD_INFO("ov5650", OV5650_I2C_ADDRESS),
},
//#endif

};
/////////////////////////////////////////////////////

static struct soc_camera_link iclink_ov5640 = {
.bus_id = 0, /* Must match with the camera ID */
.board_info = &sdp4430_i2c_camera[0],
.i2c_adapter_id = 3,
/*
#ifdef CONFIG_MACH_OMAP_4430SDP_CAM_OV3640
.module_name = "ov3640",
#elif defined(CONFIG_MACH_OMAP_4430SDP_CAM_OV5640)
.module_name = "ov5640",
#elif defined(CONFIG_MACH_OMAP_4430SDP_CAM_OV5650)
*/ .module_name = "ov5650",
//#endif
.power = &sdp4430_ov5640_power,
.priv = &ov5640_if_params,
};

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

Now in the dmesg

[ 5.308959] camera 0-0: Probing 0-0
[ 5.371185] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 5.449188] ov5650 3-0036: Detected a OV5650 chip, revision 0
[ 5.449554] omap4-camera omap4-camera.0: OMAP4 Camera driver loaded

When I start cheese screen is blank ,when I try with gstreamer for
640*480 it is telling unable to display at resolution 640*480.I tried
with other configurations also.

When i try xvinfo, it is showing "no adapters present".

How can I rectify this xvinfo problem. Should I install some packages
for it?
> > > Actually the OV5650driverneeds to come up and check whether adapter
> > > is interfaced. Instead of that OV5640driveris coming up and is
> > > failing to detect(adapter connected is OV5650 ). I removed the OV5640
> > >driverusing rmmod and inserted OV5650. still video is not working
> > > with cheese or gstreamer.
>
> > > I tried to rectify that by removing OV5640 and OV3640 from the kernel
> > > configs and keeping OV5650 as 'M' type. Then I recompiled kernel.
> > > In this case ,the OV5650driveris not getting initialized at bootup
> > > and video is not working.
>
> > > Then in the kernel configs i put soc_camera as 'Y',OV5650 as
> > > 'Y',OV5640 as 'M', 3640 as 'M'. I also enabled I2C multiplexing
> > > options. Then recompiled
> > > In this case the dmesg output is as:
> > > 2.312530] i2c i2c-3: client [ov5640] registered with bus id 3-003c
> > > [    2.312591] i2c 3-003c: uevent
> > > [    2.312622] omap4-camera omap4-camera.0: OMAP4 Cameradriverloaded
> > > [    2.312835] omap_vout omap_vout: 'hdmi' Display already enabled
> > > [    2.312835] omap_vout omap_vout: 'hdmi' Display already enabled
> > > [    2.312835] omap_vout omap_vout: Buffer Size = 3686400
> > > [    2.313903] omap_vout omap_vout: : registered and initialized video
> > > device 1.
>
> > > the dmesg is same even when the adapter is not connected. What i don't
> > > understand is why does the ov5640drivercomeup and ov5650 does not

gulraize zeeshan

unread,
Mar 31, 2012, 3:13:02 AM3/31/12
to pandaboard
Jayakrishnan,

ABI version of the uImage that you are building should match with pre
built binaries otherwise some x11 modules cant load.

Please refer following to compile kernel with same ABI version as the
pre-built binaries.
http://www.omappedia.com/wiki/Ubuntu_kernel_for_OMAP4#Change_the_package_version

-Gulraize

Jayakrishnan VR

unread,
Apr 10, 2012, 11:38:20 AM4/10/12
to pandaboard
zeeshan,
I was able to capture image using yavta repositary in the gitorious
website. However gstreamer and cheese fails to work. I compiled kernel
using same version number. I now understand that the ov5650 sensor is
10 bit raw bayer format sensor which is not supported by v4l2src of
gstreamer. v4l2src must be patched to support this. If you find any
information regarding the changes to v4l2src to enable this, let me
know

On Mar 31, 12:13 pm, gulraize zeeshan <gulra...@gmail.com> wrote:
> Jayakrishnan,
>
> ABI version of the uImage that you are building should match with pre
> built binaries otherwise some x11 modules cant load.
>
> Please refer following to compile kernel with same ABI version as the
> pre-built binaries.http://www.omappedia.com/wiki/Ubuntu_kernel_for_OMAP4#Change_the_pack...
>
> -Gulraize
>
> On Mar 30, 10:30 am, Jayakrishnan VR <jkv...@gmail.com> wrote:
>
>
>
>
>
>
>
> > zeeshan,
> > Now theov5650is getting detected. However the video is still blank
> > [    5.449188]ov56503-0036: Detected aOV5650chip, revision 0
> > > > > In the default configuration with theOV5650adapter connected ,I get
> > > > > the following in dmesg
>
> > > > > [    5.431182] camera 0-0: Probing 0-0
> > > > > [    5.531921] ov5640 3-003c: Failed reading register 0x302a!
> > > > > [    5.532073] ov5640 3-003c: Failure to detect OV5640 chip
> > > > > [    5.532196] ov5640: probe of 3-003c failed with error -121
> > > > > [    5.532714] omap4-camera omap4-camera.0: OMAP4 Cameradriverloaded
> > > > > [    5.643249] usbhid 1-1.3:1.0: usb_probe_interface
> > > > > [    5.643280] usbhid 1-1.3:1.0: usb_probe_interface - got id
> > > > > [    5.659851] omap_device: omap-aess-audio.-1: new worst case
> > > > > activate latency 0: 30517
>
> > > > > Actually the OV5650driverneeds to come up and check whether adapter
> > > > > is interfaced. Instead of that OV5640driveris coming up and is
> > > > > failing to detect(adapter connected isOV5650). I removed the OV5640
> > > > >driverusing rmmod and insertedOV5650. still video is not working
> > > > > with cheese or gstreamer.
>
> > > > > I tried to rectify that by removing OV5640 and OV3640 from the kernel
> > > > > configs and keepingOV5650as 'M' type. Then I recompiled kernel.
> > > > > In this case ,the OV5650driveris not getting initialized at bootup
> > > > > and video is not working.
>
> > > > > Then in the kernel configs i put soc_camera as 'Y',OV5650as
> > > > > 'Y',OV5640 as 'M', 3640 as 'M'. I also enabled I2C multiplexing
> > > > > options. Then recompiled
> > > > > In this case the dmesg output is as:
> > > > > 2.312530] i2c i2c-3: client [ov5640] registered with bus id 3-003c
> > > > > [    2.312591] i2c 3-003c: uevent
> > > > > [    2.312622] omap4-camera omap4-camera.0: OMAP4 Cameradriverloaded
> > > > > [    2.312835] omap_vout omap_vout: 'hdmi' Display already enabled
> > > > > [    2.312835] omap_vout omap_vout: 'hdmi' Display already enabled
> > > > > [    2.312835] omap_vout omap_vout: Buffer Size = 3686400
> > > > > [    2.313903] omap_vout omap_vout: : registered and initialized video
> > > > > device 1.
>
> > > > > the dmesg is same even when the adapter is not connected. What i don't
> > > > > understand is why does the ov5640drivercomeup andov5650does not
> > > > > comeup.
> > > > > Can you tell the correct configs so thatov5650gets enabled?
>
> > > > > On Mar 19, 5:04 pm, gulraize zeeshan <gulra...@gmail.com> wrote:
>
> > > > > > JayaKrishnan,
>
> > > > > > I've tested ov5640 its working fine with ubuntu-natty kernel. im
> > > > > > assuming you have connected the camera sensor to CSI2-A interface on
> > > > > > pandaboard and its not USB camera.
>
> > > > > > are you statically building the camera sensordriveror building it as
> > > > > > a module.?
>
> > > > > > irrespective of you;re building it as module or statically, run make
> > > > > > menu config and select v4l2 sub-dev modules and sensor modules and
> > > > > > compile the kernel.
>
> > > > > > a)  check the kernel logs (dmesg | tail) and verify camera sensor is
> > > > > > detected and registered with i2c.
>
> > > > > > b) check omap4-camera module is loaded (camera interfacedriver).
>
> > > > > > c) make sure camera sensor is generating interrupts (cat /proc/
> > > > > > interrupts look for omap4-camera)
>
> > > > > > if a,b and c are successful, it should work straight away,
>
> > > > > > Also if you are cross compiling the kernel on host system please note
> > > > > > that ubuntu keep track of ABI changes, x-server crashes if the abi has
> > > > > > changed, so you need take care of that.
>
> > > > > > -Gulraize
>
> > > > > > On Mar 15, 2:25 pm, Jayakrishnan VR <jkv...@gmail.com> wrote:
>
> > > > > > > Hi,
> > > > > > > I am trying to interface the omnision sensorOV5650to the pandaboard.
> > > > > > > I got the camera adapter board and the sensor.
> > > > > > >  I downloaded the kernel fromhttps://www.gitorious.org/omap4-v4l2-camera/pages/Home.
> > > > > > > the ubuntu-natty_ti-omap4-v4l2cam” branch.
> > > > > > > I did native compilation of the kernel on pandaboard as perhttp://adventuresinsilicon.blogspot.in/2011/02/pandaboard-ubuntu-how-...
> > > > > > > Then I connected the sensor and tried with cheese .It showed no
> > > > > > > "device found". Then with gstreamer It showed error"cannot recognize /
> > > > > > > dev/video0" . I then changed the command line to gst-launch v4l2src
> > > > > > > device = /dev/video1 !............Then it showed  error "/dev/video1
> > > > > > > is not a capture device".
> > > > > > > I then tried crosscompiling the kernel(using arm-linux-gnueabi-) to
> > > > > > > generate uImage and replaced uImage in the pandaboard. Still same
> > > > > > > result.
> > > > > > > Can anyone tell me the correct procedure for compiling and using
> > > > > > > kernel for interfacingOV5650sensors. This is urgent. please reply
> > > > > > > soon.

Sajith

unread,
Nov 6, 2012, 11:32:57 PM11/6/12
to panda...@googlegroups.com
Hi Jayakrishnan,

Its nice to hear that you could made ov5640 to work on pandaboard.
I was trying to interface ov5640 with raspberry pi board.
I have made the adaptor board compatible to Raspberry Pi board.
How should I approach the software slow ?
How should I go about it ?

Sajith




Reply all
Reply to author
Forward
0 new messages