Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 04 Apr 2016 06:55 AM by  Adam Ford
DM3730 with 12-bit camera
 5 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Greg Otto
New Member
New Member
Posts:6


--
16 Mar 2016 04:00 PM

    App Note 596 describes 8-bit and 12-bit camera support for DM3730.   The Torepedo Development Kit only supports 8 bits, and the SOM only supports 8-bits, by default.

    However, we have modified the SOM to support 12-bit cameras, and we designed our own base board to support 12-bit cameras.   I modified Linux driver files "mt9p031.c" and "board-omap3logic.c" for 12-bit operation.   Unfortunately, I cannot acquire 12-bit images using "yavta" or any other video acquisition software.   It only works if I acquire 8-bit images (SGRBG8).  When I attempt to setup the pipeline, using "media-ctl" and format = SGRBG10 or SGRBG12, it attempts and then rolls back to SGRBG8 format.    Are there any additional Linux driver files that are coded for 8-bit video acquisition, preventing me from running a 12-bit camera ??

    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    17 Mar 2016 03:20 PM
    I talked with one of the developers, and he said that if you're using our BSP, you'll need to uncomment MT9P031_8MSB_ONLY.

    Would there be a way to send the output of all media-ctl commands you're are running? (making sure to add the "-v" option for extra debug information) Also, the output of "media-ctl -p" might prove to be helpful.

    adam
    Greg Otto
    New Member
    New Member
    Posts:6


    --
    17 Mar 2016 04:04 PM

    Hi Adam,

    Thank you for responding.  Yes, I removed the MT9P031_8MSB_ONLY definition in "mt9p031.c".   There were also some changes required in "board-omap3logic.c".   Then I rebuilt the kernel.

    Below are the simplest commands I could boil down to, consisting of 2 "media-ctl" commands to setup the pipeline, and "yavta" to acquire the image.   After the 2nd media-ctl command, it attempts to set SGRBG12 format, but then gives up and set SGRBS8 format.   (I also tried SGRBG10, but it had the same response.)   Notice that the yavta command does everything right, up to the VIDIOC_QBUF command, but during the VIDIOC_STREAMON command, it fails "Invalid argument" and then quits.   If I use SGRBG8 format, everything runs fine.  (I suspect that there is some code somewhere in the driver that specifies the camera only supports 8-bit mode, but where would that code reside ??)

     Greg

     

    DM-37x# media-ctl -v -r -l '"mt9p031":0->"OMAP3 ISP CCDC":0[1], "OMAP3 ISP CCDC":1->"OMAP3 ISP CCDC output":0[1]'
    Opening media device /dev/media0
    Enumerating entities
    Found 16 entities
    Enumerating pads and links
    Resetting all links to inactive
    Setting up link 16:0 -> 5:0 [1]
    Setting up link 5:1 -> 6:0 [1]

    DM-37x# media-ctl -v -f '"mt9p031":0 [SGRBG12 1600x1600 (507,226)/1600x1600], "OMAP3 ISP CCDC":1 [SGRBG12 1600x1600]'
    Opening media device /dev/media0
    Enumerating entities
    Found 16 entities
    Enumerating pads and links
    Setting up crop rectangle (507,22[   96.929626] omap_device: omap_i2c.2: new wor
    st case activate latency 0: 305175
    6)/1600x1600 on pad mt9p031 2-0048/0
    Crop rectangle set: (508,226)/1600x1600
    Setting up format SGRBG12 1600x1600 on pad mt9p031 2-0048/0
    Format set: SGRBG8 1600x1600
    Setting up format SGRBG8 1600x1600 on pad OMAP3 ISP CCDC/0
    Format set: SGRBG8 1600x1600
    Setting up format SGRBG12 1600x1600 on pad OMAP3 ISP CCDC/1
    Format set: SGRBG8 1600x1600

    DM-37x# yavta -f SGRBG12 -s 1600x1600 --capture=1 --file=image.raw /dev/video2
    Device /dev/video2 opened.
    Device `OMAP3 ISP CCDC output' on `media' is a video capture device.
    Video format set: SGRBG12 (32314142) 1600x1600 buffer size 5120000
    Video format: SGRBG12 (32314142) 1600x1600 buffer size 5120000
    8 buffers requested.
    length: 5120000 offset: 0
    Buffer 0 mapped at address 0x4027e000.
    length: 5120000 offset: 5120000
    Buffer 1 mapped at address 0x40763000.
    length: 5120000 offset: 10240000
    Buffer 2 mapped at address 0x40cb6000.
    length: 5120000 offset: 15360000
    Buffer 3 mapped at address 0x411f1000.
    length: 5120000 offset: 20480000
    Buffer 4 mapped at address 0x416f1000.
    length: 5120000 offset: 25600000
    Buffer 5 mapped at address 0x41c33000.
    length: 5120000 offset: 30720000
    Buffer 6 mapped at address 0x421a9000.
    length: 5120000 offset: 35840000
    Buffer 7 mapped at address 0x426aa000.
    Unable to start streaming: Invalid argument (22).
    8 buffers released.

    DM-37x# media-ctl -p
    Opening media device /dev/media0
    Enumerating entities
    Found 16 entities
    Enumerating pads and links
    Media controller API version 0.0.0

    Media device information
    ------------------------
    driver          omap3isp
    model           TI OMAP3 ISP
    serial
    bus info
    hw revision     0x0
    driver version  0.0.0

    Device topology
    - entity 1: OMAP3 ISP CCP2 (2 pads, 2 links)
                type V4L2 subdev subtype Unknown
                device node name /dev/v4l-subdev0
            pad0: Sink [SGRBG10 4096x4096]
                    <- "OMAP3 ISP CCP2 input":0 []
            pad1: Source [SGRBG10 4096x4096]
                    -> "OMAP3 ISP CCDC":0 []

    - entity 2: OMAP3 ISP CCP2 input (1 pad, 1 link)
                type Node subtype V4L
                device node name /dev/video0
            pad0: Source
                    -> "OMAP3 ISP CCP2":0 []

    - entity 3: OMAP3 ISP CSI2a (2 pads, 2 links)
                type V4L2 subdev subtype Unknown
                device node name /dev/v4l-subdev1
            pad0: Sink [SGRBG10 4096x4096]
            pad1: Source [SGRBG10 4096x4096]
                    -> "OMAP3 ISP CSI2a output":0 []
                    -> "OMAP3 ISP CCDC":0 []

    - entity 4: OMAP3 ISP CSI2a output (1 pad, 1 link)
                type Node subtype V4L
                device node name /dev/video1
            pad0: Sink
                    <- "OMAP3 ISP CSI2a":1 []

    - entity 5: OMAP3 ISP CCDC (3 pads, 9 links)
                type V4L2 subdev subtype Unknown
                device node name /dev/v4l-subdev2
            pad0: Sink [SGRBG8 1600x1600]
                    <- "OMAP3 ISP CCP2":1 []
                    <- "OMAP3 ISP CSI2a":1 []
                    <- "mt9p031 2-0048":0 [ENABLED]
            pad1: Source [SGRBG8 1600x1600]
                    -> "OMAP3 ISP CCDC output":0 [ENABLED]
                    -> "OMAP3 ISP resizer":0 []
            pad2: Source [SGRBG8 1600x1599]
                    -> "OMAP3 ISP preview":0 []
                    -> "OMAP3 ISP AEWB":0 [ENABLED,IMMUTABLE]
                    -> "OMAP3 ISP AF":0 [ENABLED,IMMUTABLE]
                    -> "OMAP3 ISP histogram":0 [ENABLED,IMMUTABLE]

    - entity 6: OMAP3 ISP CCDC output (1 pad, 1 link)
                type Node subtype V4L
                device node name /dev/video2
            pad0: Sink
                    <- "OMAP3 ISP CCDC":1 [ENABLED]

    - entity 7: OMAP3 ISP preview (2 pads, 4 links)
                type V4L2 subdev subtype Unknown
                device node name /dev/v4l-subdev3
            pad0: Sink [SGRBG10 4096x4096]
                    <- "OMAP3 ISP CCDC":2 []
                    <- "OMAP3 ISP preview input":0 []
            pad1: Source [YUYV 4082x4088]
                    -> "OMAP3 ISP preview output":0 []
                    -> "OMAP3 ISP resizer":0 []

    - entity 8: OMAP3 ISP preview input (1 pad, 1 link)
                type Node subtype V4L
                device node name /dev/video3
            pad0: Source
                    -> "OMAP3 ISP preview":0 []

    - entity 9: OMAP3 ISP preview output (1 pad, 1 link)
                type Node subtype V4L
                device node name /dev/video4
            pad0: Sink
                    <- "OMAP3 ISP preview":1 []

    - entity 10: OMAP3 ISP resizer (2 pads, 4 links)
                 type V4L2 subdev subtype Unknown
                 device node name /dev/v4l-subdev4
            pad0: Sink [YUYV 4095x4095 (4,6)/4086x4082]
                    <- "OMAP3 ISP CCDC":1 []
                    <- "OMAP3 ISP preview":1 []
                    <- "OMAP3 ISP resizer input":0 []
            pad1: Source [YUYV 4096x4095]
                    -> "OMAP3 ISP resizer output":0 []

    - entity 11: OMAP3 ISP resizer input (1 pad, 1 link)
                 type Node subtype V4L
                 device node name /dev/video5
            pad0: Source
                    -> "OMAP3 ISP resizer":0 []

    - entity 12: OMAP3 ISP resizer output (1 pad, 1 link)
                 type Node subtype V4L
                 device node name /dev/video6
            pad0: Sink
                    <- "OMAP3 ISP resizer":1 []

    - entity 13: OMAP3 ISP AEWB (1 pad, 1 link)
                 type V4L2 subdev subtype Unknown
                 device node name /dev/v4l-subdev5
            pad0: Sink
                    <- "OMAP3 ISP CCDC":2 [ENABLED,IMMUTABLE]

    - entity 14: OMAP3 ISP AF (1 pad, 1 link)
                 type V4L2 subdev subtype Unknown
                 device node name /dev/v4l-subdev6
            pad0: Sink
                    <- "OMAP3 ISP CCDC":2 [ENABLED,IMMUTABLE]

    - entity 15: OMAP3 ISP histogram (1 pad, 1 link)
                 type V4L2 subdev subtype Unknown
                 device node name /dev/v4l-subdev7
            pad0: Sink
                    <- "OMAP3 ISP CCDC":2 [ENABLED,IMMUTABLE]

    - entity 16: mt9p031 2-0048 (1 pad, 1 link)
                 type V4L2 subdev subtype Unknown
                 device node name /dev/v4l-subdev8
            pad0: Source [SGRBG8 1600x1600 (508,226)/1600x1600]
                    -> "OMAP3 ISP CCDC":0 [ENABLED]
     

    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    18 Mar 2016 08:30 AM
    I will forward this log to one of our developers to see if/what suggestions he might have.

    adam
    Anton Bakulev
    New Member
    New Member
    Posts:13


    --
    04 Apr 2016 04:38 AM
    Dear support,

    I have another question in this subject. There is 8bit support in Torpedo SOM in case of using parallel interface. If I'll be using a SPI interface could I use more bits without SOM hardware modification (additional resistors) ?
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    04 Apr 2016 06:55 AM
    Anton,

    without knowing more information about your camera it's hard to answer that question. If you're going to use a camera with the Parallel interface, you'll need a hardware modification in order to make it work with more than 8-bits. Most cameras use SPI or I2C for setting registers but use the parallel interface for the actual data.

    If you post a link to a data sheet for a camera you're considering, we could review it and give you better feedback.

    adam
    You are not authorized to post a reply.