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.

OV7670 and Leopardboard DM368

Other Parts Discussed in Thread: THS7303, TVP5146

Hi,
I'm trying to add support for OV7670 sensor in LB-DM368. The foll. are the configurations that I'm using:

Board: Leopardboard DM368
Kernel: linux-2.6.32.17-psp03.01.01.39
Sensor: OV7670 (16 pin module- without FIFO)

I've modified few lines in kernel files as follows:
1. /arch/arm/mach-davinci/board-dm368-leopard.c:

#if defined(CONFIG_VIDEO_OV7670) || defined(CONFIG_VIDEO_OV7670_MODULE)
/* Input available at the ov7670 */
static struct v4l2_input ov7670_inputs[] = {
    {
        .index = 0,
        .name = "Camera",
        .type = V4L2_INPUT_TYPE_CAMERA,
        
    }
};
#endif

static struct vpfe_subdev_info vpfe_sub_devs[] = {
#if defined(CONFIG_VIDEO_OV7670) || defined(CONFIG_VIDEO_OV7670_MODULE)
    {
        .module_name = "ov7670",
        //.is_camera = 1,
        .grp_id = VPFE_SUBDEV_OV7670,
        .num_inputs = ARRAY_SIZE(ov7670_inputs),
        .inputs = ov7670_inputs,
        .ccdc_if_params = {
            .if_type = VPFE_RAW_BAYER,
            .hdpol = VPFE_PINPOL_POSITIVE,
            .vdpol = VPFE_PINPOL_POSITIVE,
        },
        .board_info = {
            I2C_BOARD_INFO("ov7670", 0x21),
            .platform_data = (void *)1,
        },
    },
#endif
};
2. /media/video/davinci/vpfe-capture.c:
In function static int vpfe_config_ccdc_image_format(struct vpfe_device *vpfe_dev),
commented out: //pix_fmt = vpfe_dev->fmt.fmt.pix.pixelformat;
    /* At CCDC we need to set pix format based on source. */
/*    if (vpfe_dev->imp_chained) {
        if (vpfe_dev->current_subdev->is_camera)
            pix_fmt = V4L2_PIX_FMT_SBGGR16;
        else if (pix_fmt == V4L2_PIX_FMT_NV12)
            pix_fmt = V4L2_PIX_FMT_UYVY;
    }
*/
and added:
pix_fmt = V4L2_PIX_FMT_YUYV;

Then I tried running a gstreamer pipeline to capture a single frame:
#FILE_NAME=VGA_jpeg_file.jpg
#gst-launch -e v4l2src always-copy=false num-buffers=1 chain-ipipe=true ! video/x-raw-yuv,format=\(fourcc\)UYVY, width=640, height=480 ! ffmpegcolorspace ! dmaienc_jpeg !filesink location=$FILE_NAME

Output:
Setting pipeline to PAUSED ...
davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
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:
../../../src/sys/v4l2/v4l2_calls.c(587): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: No such device
Setting pipeline to NULL ...
Freeing pipeline ...

But /dev/video0 is there if I try ls /dev/video*.

What am i missing here? Can anyone please guide me how to proceed?

Regards,

Diwakar

  • Hi,

    Can you please attach your complete bootup logs to investigate video stuffs on your linux kernel,

    Did you create "/dev/video0" device node manually through "mknod" command ?

  • Hi Titus, thanks for the quick reply. "/dev/video0 " was automatically created. I even tried removing it and creating manually as it was suggested in some old post but,the result was same. I've attached the boot log here:

    Loading from nand0, offset 0x400000
       Image Name:   "RR Linux Kernel"
       Created:      2014-04-01   8:02:23 UTC
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    4428288 Bytes = 4.2 MiB
       Load Address: 80008000
       Entry Point:  80008000
    Automatic boot of image at addr 0x82000000 ...
    ## Booting kernel from Legacy Image at 82000000 ...
       Image Name:   "RR Linux Kernel"
       Created:      2014-04-01   8:02:23 UTC
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    4428288 Bytes = 4.2 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Linux version 2.6.32-17-ridgerun (adeptte@adeptte-laptop) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #823 PREEMPT Tue Apr 1 13:31:18 IST 2014
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    CPU: VIVT data cache, VIVT instruction cache
    Machine: DM368 Leopard
    Memory policy: ECC disabled, Data cache writeback
    DaVinci dm36x_rev1.2 variant 0x8
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 21082
    Kernel command line: davinci_enc_mngr.ch0_output=COMPONENT davinci_enc_mngr.ch0_mode=720P-60 davinci_display.cont2_bufsize=3145728 vpfe_capture.cont_bufoffset=3145728 vpfe_capt)
    PID hash table entries: 512 (order: -1, 2048 bytes)
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory: 83MB = 83MB total
    Memory: 79596KB available (3988K code, 291K data, 144K init, 0K highmem)
    SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    Hierarchical RCU implementation.
    NR_IRQS:245
    Console: colour dummy device 80x30
    Calibrating delay loop... 148.27 BogoMIPS (lpj=741376)
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    DaVinci: 8 gpio irqs
    NET: Registered protocol family 16
    davinci_serial_init:97: failed to get UART2 clock
    bio: create slab <bio-0> at 0
    DM365 IPIPE initialized in Single Shot mode
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    vpss vpss: dm365_vpss vpss probed
    vpss vpss: dm365_vpss vpss probe success
    dm365_afew_hw_init
    ch0 default output "COMPONENT", mode "720P-60"
    VPBE Encoder Initialized
    LogicPD encoder initialized
    Switching to clocksource timer0_1
    musb_hdrc: version 6.0, cppi-dma, host, debug=0
    musb_hdrc: USB Host mode controller at fec64000 using DMA, IRQ 12
    musb_hdrc musb_hdrc: MUSB HDRC host driver
    musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
    usb usb1: configuration #1 chosen from 1 choice
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)
    TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    TCP: Hash tables configured (established 4096 bind 4096)
    TCP reno registered
    NET: Registered protocol family 1
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    JFFS2 version 2.2. (NAND) (SUMMARY)  �© 2001-2006 Red Hat, Inc.
    msgmni has been set to 155
    alg: No test for stdrng (krng)
    io scheduler noop registered
    io scheduler anticipatory registered (default)
    davincifb davincifb.0: dm_osd0_fb: 720x480x16@0,0 with framebuffer size 1350KB
    davincifb davincifb.0: dm_osd1_fb: 0x0x8@0,0 with framebuffer size 1800KB
    DM365 IPIPEIF probed
    imp serializer initialized
    davinci_previewer initialized
    davinci_resizer initialized
    Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
    console [ttyS0] enabled
    brd: module loaded
    loop: module loaded
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
    3 cmdlinepart partitions found on MTD device davinci_nand.0
    Creating 3 MTD partitions on "davinci_nand.0":
    0x000000000000-0x000000400000 : "UBOOT"
    0x000000400000-0x0000008a0000 : "KERNEL"
    0x0000008a0000-0x00000d0a0000 : "FS"
    davinci_nand davinci_nand.0: controller rev. 2.3
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    usbcore: registered new interface driver usbtest
    i2c /dev entries driver
    Linux video capture interface: v2.00
    ths7303 1-002c: chip found @ 0x58 (DaVinci I2C adapter)
    vpfe_init
    vpfe-capture: vpss clock vpss_master enabled
    vpfe-capture vpfe-capture: v4l2 device registered
    vpfe-capture vpfe-capture: video device registered
    ov7670 1-0021: chip found @ 0x42 (DaVinci I2C adapter)
    vpfe-capture vpfe-capture: v4l2 sub device ov7670 registered
    vpfe_register_ccdc_device: DM365 ISIF
    DM365 ISIF is registered with vpfe.
    af major#: 252, minor# 0
    AF Driver initialized
    aew major#: 251, minor# 0
    AEW Driver initialized
    Trying to register davinci display video device.
    layer=c40d2800,layer->video_dev=c40d2964
    Trying to register davinci display video device.
    layer=c40d2c00,layer->video_dev=c40d2d64
    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded
    watchdog watchdog: heartbeat 60 sec
    davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
    usbcore: registered new interface driver usbhid
    usbhid: v2.6:USB HID core driver
    Advanced Linux Sound Architecture Driver Version 1.0.21.
    No device for DAI tlv320aic3x
    No device for DAI davinci-i2s
    asoc: tlv320aic3x <-> davinci-i2s mapping ok
    ALSA device list:
      #0: DaVinci DM365 EVM (tlv320aic3x)
    TCP cubic registered
    NET: Registered protocol family 17
    Clocks: disable unused mmcsd1
    Clocks: disable unused spi0
    Clocks: disable unused spi1
    Clocks: disable unused spi2
    Clocks: disable unused spi3
    Clocks: disable unused spi4
    Clocks: disable unused pwm0
    Clocks: disable unused pwm1
    Clocks: disable unused pwm2
    Clocks: disable unused pwm3
    Clocks: disable unused timer1
    Clocks: disable unused timer3
    Clocks: disable unused adc
    Clocks: disable unused emac
    Clocks: disable unused voice_codec
    Clocks: disable unused rto
    Clocks: disable unused mjcp
    davinci_emac_probe: using random MAC addr: 0e:a3:b7:30:ee:36
    emac-mii: probed
    IP-Config: Complete:
         device=eth0, addr=192.168.72.165, mask=255.255.255.0, gw=255.255.255.255,
         host=192.168.72.165, domain=, nis-domain=(none),
         bootserver=255.255.255.255, rootserver=192.168.72.137, rootpath=
    Looking up port of RPC 100003/2 on 192.168.72.137
    Looking up port of RPC 100005/1 on 192.168.72.137
    VFS: Mounted root (nfs filesystem) on device 0:13.
    Freeing init memory: 144K
    init started: BusyBox v1.18.2 (2014-01-25 13:15:59 IST)
    starting pid 990, tty '': '/etc/rcS'
    Starting System
    done.
    Welcome to
    __________ .__     .___               __________                
    \______   \|__|  __| _/  ____    ____ \______   \ __ __   ____  
     |       _/|  | / __ |  / ___\ _/ __ \ |       _/|  |  \ /    \
     |    |   \|  |/ /_/ | / /_/  >\  ___/ |    |   \|  |  /|   |  \
     |____|_  /|__|\____ | \___  /  \___  >|____|_  /|____/ |___|  /
            \/          \//_____/       \/        \/             \/
               
        Embedded Linux Solutions
     
    For further information see:
    http://www.ridgerun.com
    Build host: adeptte-laptop
    Built by: adeptte
    Build date: Tue, 01 Apr 2014 13:32:23 +0530
    Build tag: leopard
    Configuring network interfaces
    Starting D-Bus message bus system
    Starting Ipipe daemon
    Loading coprocessors modules...
      Loading cmem from 0x85900000 to 0x86900000
    CMEMK module: built on Mar 25 2014 at 16:16:06
      Reference Linux version 2.6.32
      File /home/adeptte/RidgeRun-SDK-DM36x-Turrialba-Eval/proprietary/dvsdk-4_02_00_06/dvsdk/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
    allocated heap buffer 0xc9000000 of size 0x1000000
    heap fallback enabled - will try heap if pool buffer is not available
    CMEM Range Overlaps Kernel Physical - allowing overlap
    CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x85300000)
    cmemk initialized
    EDMAK module: built on Mar 25 2014 at 16:16:10
      Reference Linux version 2.6.32
      File /home/adeptte/RidgeRun-SDK-DM36x-Turrialba-Eval/proprietary/dvsdk-4_02_00_06/dvsdk/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/edma/src/module/edmak.c
    IRQK module: built on Jan 25 2014 at 13:52:58
      Reference Linux version 2.6.32
      File /home/adeptte/RidgeRun-SDK-DM36x-Turrialba-Eval/proprietary/dvsdk-4_02_00_06/dvsdk/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/irq/src/module/irqk.c
    irqk initialized
    Starting Dropbear SSH server: dropbear.
    SD card not mounted
    eth0      Link encap:Ethernet  HWaddr 0E:A3:B7:30:EE:36  
              inet addr:192.168.72.165  Bcast:192.168.72.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:6459 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3257 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:7123374 (6.7 MiB)  TX bytes:511890 (499.8 KiB)
              Interrupt:52 Base address:0x7000

    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    Please press Enter to activate this console.

    Regards,

    Diwakar

  • Hi,

    vpfe_init
    vpfe-capture: vpss clock vpss_master enabled
    vpfe-capture vpfe-capture: v4l2 device registered
    vpfe-capture vpfe-capture: video device registered
    ov7670 1-0021: chip found @ 0x42 (DaVinci I2C adapter)
    vpfe-capture vpfe-capture: v4l2 sub device ov7670 registered
    vpfe_register_ccdc_device: DM365 ISIF
    DM365 ISIF is registered with vpfe.

    This seems that you have good camera configuration,

    Have you tried anytime to streaming the videos from "/dev/video0"  through gst-launch command?

    This will display the camera view in a window:

    gst-launch v4l2src ! ffmpegcolorspace ! xvimagesink

    This will display the camera view in a window with a specified size (320x240):

    gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! xvimagesink

    Have you tried mplayer ?

    Share your email ID and I will send cross builded mplayer bin to you.

  • Hi,

    Titusrathinaraj Stalin said:

    Have you tried anytime to streaming the videos from "/dev/video0"  through gst-launch command?

    This will display the camera view in a window:

    gst-launch v4l2src ! ffmpegcolorspace ! xvimagesink

    I'm getting : WARNING: erroneous pipeline: no element "xvimagesink"  for both the gst-launch commands.

    No I've not tried mplayer. I think the vpfe_capture.c file needs to be modified, though I'm not sure about it.

    Regards

     

  • Hi,

    Thanks for the mplayer binary. Since I've not used that before,I tried a command from the web:

    # ./mplayer -cache 128 -tv driver=v4l2:width=640:height=480:outfmt=i420:device=/dev/video0 -vc rawi420 -vo xv tv://

    Output:

    MPlayer 1.1-4.6 (C) 2000-2012 MPlayer Team

    Playing tv://.
    Cache fill:  0.00% (0 bytes)   

    TV file format detected.
    Selected driver: v4l2
     name: Video 4 Linux 2 input
     author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
     comment: first try, more to come ;-)
    v4l2: unable to open '/dev/video0': No such device
    v4l2: ioctl set mute failed: Bad file descriptor
    v4l2: 0 frames successfully processed, 0 frames dropped.

    Exiting... (End of file)

    But,video0 exists.

     # ls /dev/vid*
    /dev/video0  /dev/video2  /dev/video3

    Regards,

    Diwakar

  • Hi,

    Try to change the "device=/dev/video0" to /dev/video1 or /dev/video2 in maplyer as well gst-launch command,

  • Hi, I tried changing it and the output was:

    Device /dev/video2 is not a video capture device.

    Device /dev/video3 is not a video capture device.

    Well,I inserted some debugging messages in /media/video/davinci/vpfe_capture.c and observed something:

    1. In function static int vpfe_config_image_format(struct vpfe_device *vpfe_dev, const v4l2_std_id *std_id), I had given the following code before making call to v4l2_device_call_until_err()

    printk(KERN_NOTICE "\nBefore call.. vpfe_dev->fmt.fmt.pix.field:%d",vpfe_dev->fmt.fmt.pix.field); //diwakar-debug

    ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, video, g_fmt, &sd_fmt);

    printk(KERN_NOTICE "\nAfter call.. vpfe_dev->fmt.fmt.pix.field:%d, ret:%d",vpfe_dev->fmt.fmt.pix.field,ret); //diwakar-debug
    vpfe_dev->fmt = sd_fmt;
    printk(KERN_NOTICE "\nAfter (vpfe_dev->fmt=sd_fmt) vpfe_dev->fmt.fmt.pix.field:%d",vpfe_dev->fmt.fmt.pix.field); //diwakar-debug



     

     

     

     

    Output:

    #FILE_NAME=VGA_jpeg_file.jpg
    #gst-launch -e v4l2src always-copy=false num-buffers=1 chain-ipipe=true ! video/x-raw-yuv,format=\(fourcc\)UYVY, width=640, height=480 ! ffmpegcolorspace ! dmaienc_jpeg !filesink location=$FILE_NAME

    Setting pipeline to PAUSED ...
    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
    Before call.. vpfe_dev->fmt.fmt.pix.field:4
    After call.. vpfe_dev->fmt.fmt.pix.field:4, ret:0
    After (vpfe_dev->fmt=sd_fmt) vpfe_dev->fmt.fmt.pix.field:-1073561584
    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:
    ../../../src/sys/v4l2/v4l2_calls.c(587): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    system error: No such device
    Setting pipeline to NULL ...
    Freeing pipeline ...

    So,I commented vpfe_dev->fmt = sd_fmt, and tried the same gst-launch command.
    Output:
    Setting pipeline to PAUSED ...
    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
    Before call.. vpfe_dev->fmt.fmt.pix.field:4
    After call.. vpfe_dev->fmt.fmt.pix.field:4, ret:0
    After (vpfe_dev->fmt=sd_fmt) vpfe_dev->fmt.fmt.pix.field:0
    vpfe-capture vpfe-capture: IPIPE Chained
    vpfe-capture vpfe-capture: Resizer present
    vpfe-capture vpfe-capture: standard not supported
    Pipeline is live and does not need PREROLL ...
    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to set norm for device '/dev/video0'.
    Additional debug info:
    ../../../src/sys/v4l2/v4l2_calls.c(743): gst_v4l2_set_norm (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    system error: Invalid argument
    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.
    Additional debug info:
    ../../../src/sys/v4l2/v4l2src_calls.c(342): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    system error: Invalid argument
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock

    and it is hanging at this point. Can u guide me how to proceed?

    Regards,

    Diwakar

  • Hi Titus,

           I've done a small mistake in configuring the module. In board-dm368-leopard.c,in the camera configuration code,I've commented " .is_camera = 1",which SHOULD NOT be. After enabling it,the hanging at New clock: GstSystemClock issue  has been resolved. But the vpfe_process_buffer_complete interrupt is not being hit(in /media/video/davinci/vpfe_capture.c).

    Regards,

    Diwakar


          

  • Hi,

    issue  has been resolved. But the vpfe_process_buffer_complete interrupt is not being hit(in /media/video/davinci/vpfe_capture.c).

    Good to know that you fixed and I have seen your posts in old e2e thread that other member also facing the same issue and on the same processor,

    How did you know that the interrupt in not being hit?

    Have you put any printks in capture driver file?

    Are facing any error while booting up and Is there any difference between both bootup logs?

  • Hi,

    Titusrathinaraj Stalin said:

    How did you know that the interrupt in not being hit?

    Have you put any printks in capture driver file?

    Ya I've inserted printks in vpfe_capture.c and that's how I'm telling that interrupt is not being hit.

    Titusrathinaraj Stalin said:
    Are facing any error while booting up and Is there any difference between both bootup logs?

    No. There's absolutely no difference in the boot up logs.

    Regards,

    Diwakar

  • Hi,

    Can you please attach your board (board-dm368-leopard.c) file and vpfe capture driver file,

    Have you compared vpfe capture driver file with latest one  >2.6.37 ?

  • Hi Titus,
    1.)     I tried running mplayer and got the following result:
    /usr/share/ti/ti-dmai-apps # ./mplayer -cache 128 -tv driver=v4l2:width=640:heig
    ht=480:outfmt=i420:device=/dev/video0 -vc rawi420 -vo xv tv://
    MPlayer 1.1-4.6 (C) 2000-2012 MPlayer Team

    Playing tv://.
    Cache fill:  0.00% (0 bytes)   

    TV file format detected.
    Select name: Video 4Linux 2 input
    author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
    comment: first try, more to come ;-)
    v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
    Selected device: DM368 Leopard
    Capabilities:  video capture  streaming
    supported norms:
    inputs: 0 = Camera;
    Current input: 0
    Current format: unknown (0x31384142)
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set mute failed: Invalid argument
    v4l2: 0 frames successfully processed, 0 frames dropped.


    Exiting... (End of file)
    /usr/share/ti/ti-dmai-apps #

    2.) I've attached board file & vpfe_capture.c along with this(sorry for poor alignment of code!!).

    3.) No I didn't compare with latest one.How it'll be of use to me?

    Regards,

    Diwakar

  • Hi,

    Attached board-dm368-leopard.c file.

    Regards,

    Diwakar

  • Hi,

    I tried the same gst-launch command with mt9p031 sensor and it was able to capture an image.
     On debugging by connecting ov7670 sensor,I found that the following code

    ret = request_irq(irq_info.sdram, vpfe_imp_dma_isr, IRQF_DISABLED,"Imp_Sdram_Irq",vpfe_dev);

    returns 0 (which is correct) but it is not  entering vpfe_imp_dma_isr() function at all(I've inserted a printk here which is not getting printed).But for mt9p031,it is being printed.

    It is looping between vpfe_isr() and vpfe_imp_update_isr() ( Found through printks).

    Can you guide me further please?I'm very new to this.

    Regards,

    Diwakar

  • Hi,

    I followed the suggestion as mentioned in http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/p/219393/806734.aspx#806734 . Now it is hitting vpfe_imp_dma_isr() but it is not hitting vpfe_imp_update_isr().
    It is looping between vpfe_isr() and vpfe_imp_dma_isr(). I'm not sure how to proceed further.

  • Hi Titus,

          Thanks a lot for all your help. The first patch that you suggested is already being used in the SDK that I'm using.

    But,in the kernel that I'm using the second patch (davinci_vpfe in media/staging directory) is not being used. I'm not able to include too (Since it is related to RidgeRun SDK,I think I've to post in their forum about that). 

    And FYI, with isp5_write((isp5_read(0x14) | 0x1f0a0f0d), 0x14); in /media/video/davinci/vpss.c, gst-launch is working fine for mt9p031 and tvp5146.


    Regards,

    Diwakar

  • Hi,

         I tried running video encode demo.  I'm getting "VIDIOC_S_EXPOSURE failed" from the file dm365/capture.c:

     if (-1 == ioctl (fd, VIDIOC_S_CTRL, &ctrl)) {
                Dmai_err0("VIDIOC_S_EXPOSURE failed\n");
                return Dmai_EFAIL;
            }

  • Hi,

     I tried running gst-launch and captured a single frame.But its very dark.(Attached the picture along with this post.)

    Can anyone guide me how to proceed further?

    Regards,

    Diwakar

  • Obviously, the driver wasn't having any function to handle exposure setting ( Thanks to Chuck for pointing out this in LB forum). After including the required function,I'm able to play the video. But the sensor gain / exposure values are yet to be adjusted.

  • Hi,

        Now I'm able to display video frames using video_loopback code.  But the colors and exposure is not fine.Also, vertical white/gray stripes are being displayed in the frame(you can observe in the right most corner of the attached image). Is it due to the color space? Why I'm asking is, DMAI supports V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_NV12, and V4L2_PIX_FMT_NV16.  My camera module 0v7670 supports RGB (GRB 4:2:2, RGB565/555), YUV (4:2:2) and YCbCr (4:2:2) formats.  Is there any way to make it work? 

    Regards,

    Diwakar

     

    UPDATE: I was able to resolve the above mentioned stripes issue (Had to modify a REG value in driver code ). Yet to deal with adjusting RGB values :)

  • Had to modify few registers in the camera driver and it is working fine now.

    Regards,

    Diwakar

  • Hey,

    After lot of hard work,

    I'm Glad to hear this news from you,

    Thanks for your update.

    If possible, Brief your solutions to help others.

  • Hi Titus,

         The solution I tried worked for my requirement. So I'm not sure whether it'll suit others in future and that's why I posted a generic reply  that I had to modify few registers to make it work. Anyhow,as I've already posted the solutions for intermediate problems I faced,I'm posting the final steps of the solution as follows:

    1. Getting UYVY instead of YUYV:

    In ov7670 driver code, by default it sends YUYV. But I needed UYVY. Modify the registers(COM13 & TSLB) to send UYVY. This step eliminated the white stripes.

    2. Correcting colors:

    After performing the above step,I got negative colors. To fix this, modify hstart and hstop values for the resolution you need. The values provided with driver code for QVGA and VGA DIDN'T WORK for me. I had to alter the values and both resolutions work fine now.

  • Hi,

    Thanks for your update & effort.