This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAPL138 VPIF ov5640 Linux

Other Parts Discussed in Thread: OMAPL138, OMAP-L138

Hi,

I've been looking for information how to connect ov5640 camera to VPIF port in OMAPL138 prcessor but I haven't found an answer. I am using custom board that is based on OMAPL138-LCDK board. I'm using linux-3.3-psp03.22.00.06.sdk.


Problem 1. I have turned on VPIF interface in kernel following this instruction:
http://processors.wiki.ti.com/index.php/Demonstration_of_VPIF_raw_capture_using_MT9T031_sensor_on_AM18X/DA850/OMAP-L138_running_Linux

Unfortunately I cannot see any video device in /dev/ (no /dev/video0 or any other). I can see though that video4linux is in /proce/devices when I cat this file:
81 video4linux

Question 1. Should I see /dev/video0 automatically after booting kernel or should I create it on my own? like this: mknod /dev/video0 c 81 0

Problem 2. Assuming that I can create device with mknod I tried to use gstreamer to capture raw video (beforehand I configure camera with i2c interface by application written by me). I use this command:

gst-launch-0.10 v4l2src device=/dev/video0 ! video/x-raw-yuv,width=640,height=480 ! avimux ! filesink location=test0.avi

but in return I get:

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not open device '/dev/video0' for reading and writing.
Additional debug info:
v4l2_calls.c(511): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: No such device or address
Setting pipeline to NULL ...
Freeing pipeline ...

Question 2:

Is it possible at all to communicate with ov5640 with this scenario? What I should to to acheive this?
1. Boot linux
2. Run own application that will configure camera via I2C
3. Open VPIF to read from camera
4. Capture data to memory
5. Copy this data to my PC computer
6. Throw this data to my FrameBuffer (I assume I will write an application that does that)

What steps do I need to acheive points 1-4?


Thank you in advance for quick response.

  • Hi Tad,

    Question 1. Should I see /dev/video0 automatically after booting kernel or should I create it on my own? like this: mknod /dev/video0 c 81 0

    Nope, it will create automatically through udev.

    Question 2:

    Is it possible at all to communicate with ov5640 with this scenario? What I should to to acheive this?
    1. Boot linux
    2. Run own application that will configure camera via I2C
    3. Open VPIF to read from camera
    4. Capture data to memory
    5. Copy this data to my PC computer
    6. Throw this data to my FrameBuffer (I assume I will write an application that does that)

    What steps do I need to acheive points 1-4?

    After enable the VPIF support in kernel and "ov5640" driver in linux kernel through menuconfig,

    Have you added the platform support code in board file located at "arch/arm/mach-davinci/board-omapl138-lcdkc"

    Some thing like below thread.

    http://e2e.ti.com/support/dsp/omap_applications_processors/f/42/p/329548/1157391.aspx

  • Hi,

    Thank you for fast reply. Since you say that /dev/video0 should be automatically added after properly configured then I should narrow down my problem. So my current problem is that there is no driver for ov5640 in linux for OMAPL138. But that is ok - I have my own application that communicates with ov5640 via I2C. I can set all registers in the camera.

    My problem seems to be that I don't have /dev/video0 or any other visible in the system.

    Question 1. Apart from this instruction showing how to enable VPIF capture device:
    http://processors.wiki.ti.com/index.php/Demonstration_of_VPIF_raw_capture_using_MT9T031_sensor_on_AM18X/DA850/OMAP-L138_running_Linux


    is there anything else I should do to have /dev/video0 visible in the system? In dmesg I can see this:

    i2c /dev entries driver
    Linux media interface: v0.10
    Linux video capture interface: v2.00

    watchdog watchdog: heartbeat 60 sec

    Does this mean that /dev/video0 should be visible or not? I can see that my main problem now is this missing device.

    Question 2. Is my approach reasonable? I would like to acheive this:

    1. Configure VPIF and use Linux VPIF driver for capture device
    2. Write own application that communicates with ov5640 camera via I2C and configure the chip
    3. Since ov5640 will be configured via my application and VPIF will be configured via Linux driver I should be able to use gstreamer to capture data or write own application that will get data from VPIF input buffer.

    Is my understanding correct?


    Tad.

    P.S. I will check the thread mentioned by you still today. I don't have access to HW right now.

  • Hi,

    I've been struggling with this case over the weekend. Here are some facts. I turned on support in kernel for OV5642 camera chip although mine is OV5640 (mine is not supported!). I wanted to check which steps are taken by kernel to identify OV5642 camera and possibly modify the code so that it would suit OV5640.

    To my surprise it seems that kernel calls vpif_init function and ov5642_mod_init. But no vpif_probe nor ov5642_probe or any other related function is called. It seems that kernel is not actually turning VPIF at all!

    I also used mmap to map 4K memory starting from address: 0x01E27000 to user space. According to SPRS586I – JUNE 2009 – REVISED SEPTEMBER 2014 document this is address range of PSC1. I then checked address 0x01E27800 which according to spruh77a should be Module Status n Register (modules 0-15) corresponding to VPIF. From this register I can see that VPIF is not turned on at all (registry value 0xA00).

    In kernel config I have this:

    System Type -> TI DaVinci Implementations -> TI DA850/OMAP-L138/AM18x Reference Platform -> Select peripherials connected to expander on UI board (CAMERA)

    And:

    Device Drivers -> Multimedia Support ->

    <*> Video For Linux
    [*] Video capture adapters -> V4L platform devices ->

    <*> DM646x/DA850/OMAPL138 EVM Video Capture
    -*- DaVinci VPIF Driver
    <*> SoC camera support
    <*> ov5642 camera support

    So the questions remain:

    Question 1:
    What do I have to do to enable VPIF in Linux? What to do to get capture device /dev/video0 ?

    Question 2. Is my approach reasonable? I would like to acheive this:

    1. Configure VPIF and use Linux VPIF driver for capture device
    2. Write own application that communicates with ov5640 camera via I2C and configure the chip
    3. Since ov5640 will be configured via my application and VPIF will be configured via Linux driver I should be able to use gstreamer to capture data or write own application that will get data from VPIF input buffer.

    Is my understanding correct?

    Question 3:
    Is it possible to have control of VPIF port similar like I2C? That I can use the port and not the device connected to it?

  • Hi Tad,

    Sorry for the delayed response here.

    Question 1. Apart from this instruction showing how to enable VPIF capture device:
    http://processors.wiki.ti.com/index.php/Demonstration_of_VPIF_raw_capture_using_MT9T031_sensor_on_AM18X/DA850/OMAP-L138_running_Linux


    is there anything else I should do to have /dev/video0 visible in the system? In dmesg I can see this:

    You have to enable the "VPIF capture driver" support in kernel.

    Have you done that ?

    i2c /dev entries driver
    Linux media interface: v0.10
    Linux video capture interface: v2.00

    watchdog watchdog: heartbeat 60 sec

    This kernel log not sufficient still we need VPIF logs on dmesg output.

    1. Configure VPIF and use Linux VPIF driver for capture device

    This is good.

    You have to enable VPIF support and OV5640 driver and need to add platform support code in board file.

    https://gitorious.org/droid3-kexec/droid3-kexec-kernel/source/2541e38b74af8b082e52424a7b47711273a62bce:drivers/media/video/ov5640.c

    Is it possible to have control of VPIF port similar like I2C? That I can use the port and not the device connected to it?

    No.

    In kernel config I have this:

    System Type -> TI DaVinci Implementations -> TI DA850/OMAP-L138/AM18x Reference Platform -> Select peripherials connected to expander on UI board (CAMERA)

    And:

    Device Drivers -> Multimedia Support ->

    <*> Video For Linux
    [*] Video capture adapters -> V4L platform devices ->

    <*> DM646x/DA850/OMAPL138 EVM Video Capture
    -*- DaVinci VPIF Driver
    <*> SoC camera support
    <*> ov5642 camera support

    Question 1:
    What do I have to do to enable VPIF in Linux? What to do to get capture device /dev/video0 ?

    What is your OMAPL138 SDK details and kernel version please ?

    Please configure the linux using following steps.

    System Type ->

    TI DaVinci Implementations ->

    TI DA850/OMAP-L138/AM18x Reference Platform ->

    Select peripherials connected to expander on UI board (Video port interface)