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.

Linux/PROCESSOR-SDK-AM437X: Video format questions

Part Number: PROCESSOR-SDK-AM437X

Tool/software: Linux

Hello,

I am using AM437x-gp-evm to connect our fingerprint sensor on connector J3. I am writing a device driver based on ov2659.c for the fingerprint sensor. I modify the dual camera demo software to display the video on th 7-inch LCD of the EVM board.

What we did:

1. The fingerprint sensor is a 8-bit gray video with w800 x h600. The data pins are connected to the higher 8 data pins of the J3.

2. I modified the following statement in the dual camera demo file loopback.c:

device->fmt.fmt.pix.pixelformat = FOURCC_STR("GREY");

device->fmt.fmt.pix.pixelformat = FOURCC_STR("GREY");

device->fmt.fmt.pix.pixelformat = FOURCC_STR("GREY");

disabled cap1 that on the board with #if 0

   1105 #if 0
   1106         if(v4l2_init_device(&cap1_device) < 0) {
   1107                 /* If there is not a second camera, program can still continue */
   1108                 if(status.num_cams ==2){
   1109                         status.num_cams=1;
   1110                         status.pip=false;
   1111                         printf("Only one camera detected\n");
   1112                 }
   1113                 //first camera wasn't detected
   1114                 else if (!status_cam0){
   1115                         printf("No camera detected\n");
   1116                         goto Error;
   1117                 }
   1118         }
   1119         else{
   1120                 unsigned int i;
   1121                 struct dmabuf_buffer **buffers = get_vid_buffers(&drm_device, cap1_device.num_buffers,
   1122                         cap1_device.fmt.fmt.pix.pixelformat, cap1_device.width, cap1_device.height);
   1123                 if (!buffers) {
   1124                         goto Error;
   1125                 }
   1126
   1127                 drm_device.buf[1] = buffers;
   1128
   1129                 /* Pass these buffers to the capture drivers */
   1130                 if (v4l2_request_buffer(&cap1_device, buffers) < 0) {
   1131                         goto Error;
   1132                 }
   1133
   1134                 for (i = 0; i < cap1_device.num_buffers; i++) {
   1135                         v4l2_queue_buffer(&cap1_device, buffers[i]);
   1136                 }
   1137
   1138                 status_cam1 = 1;
   1139         }
   1140 #endif

I have the following questions:

1. When I use use MEDIA_BUS_FMT_YUYV8_2X8 format in the device driver, I can get fingerprint video. It is greenish, stretched and only occupies left side half screen.

2. When I change the MEDIA_BUS_FMT_GRAY_Y8_1X9 or MEDIA_BUS_FMT_Y10_1X10, I get error message when booting (probing):

no suitable format reported by subdev...

Error registering async notifier

vpfe: probe of 48438000.vpfe gailed with error: -22

3. I checked file board-support/linux-4.9.69+gitAUTOINC+9ce43c71ae-g9ce43c71ae/drivers/media/platform/am437x/am437x-vpfe.c, I can't find the Y8 and Y10 supports in the format. See below. Does it mean no Y8 or Y10 soppprts by ti vpfe?

static struct vpfe_fmt formats[] = {
        {
                .fourcc         = V4L2_PIX_FMT_YUYV,
                .code           = MEDIA_BUS_FMT_YUYV8_2X8,
                .bitsperpixel   = 16,
        }, {
                .fourcc         = V4L2_PIX_FMT_UYVY,
                .code           = MEDIA_BUS_FMT_UYVY8_2X8,
                .bitsperpixel   = 16,
        }, {
                .fourcc         = V4L2_PIX_FMT_YVYU,
                .code           = MEDIA_BUS_FMT_YVYU8_2X8,
                .bitsperpixel   = 16,
        }, {
                .fourcc         = V4L2_PIX_FMT_VYUY,
                .code           = MEDIA_BUS_FMT_VYUY8_2X8,
                .bitsperpixel   = 16,
        }, {
                .fourcc         = V4L2_PIX_FMT_SBGGR8,
                .code           = MEDIA_BUS_FMT_SBGGR8_1X8,
                .bitsperpixel   = 8,
        }, {
                .fourcc         = V4L2_PIX_FMT_SGBRG8,
                .code           = MEDIA_BUS_FMT_SGBRG8_1X8,
                .bitsperpixel   = 8,
        }, {
                .fourcc         = V4L2_PIX_FMT_SGRBG8,
                .code           = MEDIA_BUS_FMT_SGRBG8_1X8,
                .bitsperpixel   = 8,
        }, {
                .fourcc         = V4L2_PIX_FMT_SRGGB8,
                .code           = MEDIA_BUS_FMT_SRGGB8_1X8,
                .bitsperpixel   = 8,
        }, {
                .fourcc         = V4L2_PIX_FMT_RGB565,
                .code           = MEDIA_BUS_FMT_RGB565_2X8_LE,
                .bitsperpixel   = 16,
        }, {
                .fourcc         = V4L2_PIX_FMT_RGB565X,
                .code           = MEDIA_BUS_FMT_RGB565_2X8_BE,
                .bitsperpixel   = 16,
        },
};

Please help me how to set the format on both driver and application sides.

Thanks you,.

-Ken Li

  • typo: MEDIA_BUS_FMT_GRAY_Y8_1X9 -> MEDIA_BUS_FMT_GRAY_Y8_1X8. Sorry.
  • Please help us. It is critical issue for us. How to support our grey 8-bit 800wx600h fingerprint sensor? Thank you.
  • Please use bus format as MEDIA_BUS_FMT_SBGGR8_1X8. This brings 8 bit data inside the SoC using VPFE. If you are following ov2659.c code, it supports this format.
  • Thank you. I will try this. Do you know what format to set in "dual camera demo" app? Thanks.
  • V4L2_PIX_FMT_SBGGR8
  • Thanks you. Testing now.
  • I also set bytes_pp to 1. It was 2 for FMT_YUYV before.
  • I can't see any image now. It is black.
  • Do you know what changes I need do for dual camera demo?
  • Oh, the fourcc format for DRM is not same as V4l2 for all pixel types and they share the buffers which is allocated by DRM. While we tricked V4l2 capture device to use BGGR8 to bring 8 bit pixel into the SoC, same won't work for DRM. Find the DRM fourcc code for Y8 and force the fourcc to that code in alloc_buffer() function call.
  • current I am using device->fmt.fmt.pix.pixelformat = FOURCC_STR("GBBR"); I will try device->fmt.fmt.pix.pixelformat = FOURCC_STR("Y8 ")? any suggestions?

    Thanks ,
  • Hello,

    I use FOURCC_STR("Y8 ") for pixelformat in dual camera demo. When I start dual camera demo in matrix, I got black screen. (capture, switch, exit pip buttons are still there, pip frame is there).

    So I stop matrix using /etc/init.d/matrix stop. And I run /usr/bin/dual_camera.sh (or /usr/bin/dual_camera -platform linuxfb) I get the same black LCD screen as running in matrix and the error message in my serial terminal: ( I added some printouts in the driver that we called it columbo)

    ***************************************************************************************************************
    root@am437x-evm:~# /usr/bin/dual_camera.sh
    Stopping Matrix GUI applicationstart-stop-daemon: warning: killing process 1298: No such process
    .
    USAGE: -platform linuxfb <use_cmem flag>

    Set the use_cmem flag to 1 to allocate memory from CMEM driver. By default it is set to 0


    CRTCs size: 800x480[ 466.220394] columbo_enum_frame_sizes, index 0, code 12289, min_w 320, max_w 320, max_h 240, min_h 240


    Capture 0: Opened Channel

    Capture 0: Capable of streaming[ 466.231014] columbo_enum_frame_sizes, index 1, code 12289, min_w 640, max_w 640, max_h 480, min_h 480


    [ 466.250544] columbo_enum_frame_sizes, index 2, code 12289, min_w 800, max_w 800, max_h 600, min_h 600
    [ 466.261373] __columbo_try_frame_size: input 800 600
    [ 466.267788] __columbo_try_frame_size: output 800 600
    [ 466.272785] columbo_set_fmt, idex=0: input code 12289, columbo code 12289
    Capture 0: Init done successfully


    Allocating memory from OMAP DRM pool
    fourcc:825770306, fb_id 0
    ERROR:alloc_buffer:174: drmModeAddFB2 failed: Invalid argument (-22)
    ERROR:get_vid_buffers:218: allocation failed
    Using Wayland-EGL
    ERROR:drm_restore_props:716: ret from drmModeAtomicCommit = -13

    wlpvr: PVR Services Initialised
    **************************************************************************************************************************

    I hope these info may help you.

    Thanks you.

    Ken Li
  • When I run dual_camera demo with matrix, no error message printed on the serial port terminal.
  • I am trying V4L2_PIX_FMT_SRGGB8 ("RGGB") in dual camera demo....
  • which one do you like me to try?

    static struct vpfe_fmt formats[] = {
    {
    .fourcc = V4L2_PIX_FMT_YUYV,
    .code = MEDIA_BUS_FMT_YUYV8_2X8,
    .bitsperpixel = 16,
    }, {
    .fourcc = V4L2_PIX_FMT_UYVY,
    .code = MEDIA_BUS_FMT_UYVY8_2X8,
    .bitsperpixel = 16,
    }, {
    .fourcc = V4L2_PIX_FMT_YVYU,
    .code = MEDIA_BUS_FMT_YVYU8_2X8,
    .bitsperpixel = 16,
    }, {
    .fourcc = V4L2_PIX_FMT_VYUY,
    .code = MEDIA_BUS_FMT_VYUY8_2X8,
    .bitsperpixel = 16,
    }, {
    .fourcc = V4L2_PIX_FMT_SBGGR8,
    .code = MEDIA_BUS_FMT_SBGGR8_1X8,
    .bitsperpixel = 8,
    }, {
    .fourcc = V4L2_PIX_FMT_SGBRG8,
    .code = MEDIA_BUS_FMT_SGBRG8_1X8,
    .bitsperpixel = 8,
    }, {
    .fourcc = V4L2_PIX_FMT_SGRBG8,
    .code = MEDIA_BUS_FMT_SGRBG8_1X8,
    .bitsperpixel = 8,
    }, {
    .fourcc = V4L2_PIX_FMT_SRGGB8,
    .code = MEDIA_BUS_FMT_SRGGB8_1X8,
    .bitsperpixel = 8,
    }, {
    .fourcc = V4L2_PIX_FMT_RGB565,
    .code = MEDIA_BUS_FMT_RGB565_2X8_LE,
    .bitsperpixel = 16,
    }, {
    .fourcc = V4L2_PIX_FMT_RGB565X,
    .code = MEDIA_BUS_FMT_RGB565_2X8_BE,
    .bitsperpixel = 16,
    },
    };
  • I get the same error message using 4L2_PIX_FMT_SRGGB8 ("RGGB") in dual camera demo.
  • Do you have update about the issue? Thanks,
  • Hi Ken,

    Monochrome content display is not supported by DSS driver. You can run modetest to find the supported display formats on various planes of DSS.

    If you just want to see if sensor is capturing right content before you can further process it, you may want to dump the captured image in file and view the content offline using some tools.

    Regards,
    Manisha