iMX6 Night Vision, Navigation Huaping Summary

The following functions are added to the device based on the iMX6 Linux system

1. Boot animation (based on the VPU that comes with the CPU)

2. Night vision function (based on adv7180/7182)

3. Mobile phone navigation push function (mobile phone map resources are transparently transmitted to the device application through wifi)


The first is based on the official use case mxc_vpu_test and the second is based on the official use case mxc_v4l2_tvin

These three functions all draw the image into fb1, that is, the Overlay overlay of imx6 (fb1 is the foreground, fb0 is the background)

ioctl(fd, FBIOBLANK, FB_BLANK_NORMAL);

ioctl(fd, FBIOBLANK, FB_BLANK_UNBLANK);

ioctl(fd, MXCFB_SET_LOC_ALPHA, &loc_alpha);

ioctl(fd, MXCFB_SET_OVERLAY_POS, &pos);

ioctl(fd, FBIOPUT_VSCREENINFO, &vinfo);


The three functions are different as follows

The first to use the official decoder to play the video, it will directly open fb1 and overwrite it to play on fb0

The second will set the format of the cvbs input to uyuv and open the fb1 display

The third is a local application based on Qt, the displayed image is map data, which is displayed in rgba format


When these three functions are used in combination, it will bring about various screen problems.

1. When the night vision and navigation functions are switched to each other, the screen will be blurred. The improvement method: set the yuv and rgb formats to the right before use, then open FB_BLANK_UNBLANK, and ensure that the bpp is matched, otherwise it will cause color cast

    vinfo.bits_per_pixel = 32;
    vinfo.activate |= FB_ACTIVATE_FORCE;   

    vinfo.nonstd = v4l2_fourcc('A', 'B', 'G', 'R');
    vinfo.red.offset = 24;
    vinfo.red.length = 8;
    vinfo.green.offset = 16;
    vinfo.green.length = 8;
    vinfo.blue.offset = 8;
    vinfo.blue.length = 8;
    vinfo.transp.offset = 0;

    vinfo.transp.length = 8;

------------------------------------------------------------------------------

    vinfo.bits_per_pixel = 16;
    vinfo.activate |= FB_ACTIVATE_FORCE;
    vinfo.nonstd = V4L2_PIX_FMT_RGB565;
    vinfo.red.offset = 11;
    vinfo.red.length = 5;
    vinfo.green.offset = 5;
    vinfo.green.length = 6;
    vinfo.blue.offset = 0;
    vinfo.blue.length = 5;
    vinfo.transp.offset = 0;
    vinfo.transp.length = 8;

-----------------------------------------------------------------------------------------

    fmt.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_UYVY;
    fmt.fmt.pix.field       = V4L2_FIELD_INTERLACED;


2. When changing the display area of ​​the navigation function, there will be a blurry screen

The reason is that the current display mode is framebuffer without a window system, so the Qt program will create a Qt window according to the existing window size (export QT_QPA_EGLFS_FB=/dev/fb1 to make Qt run on fb1), and the Qt window size is based on fb1. (MXCFB_SET_OVERLAY_POS/FBIOPUT_VSCREENINFO, etc.), after the Qt window has been drawn successfully, if the size of the fb1 area is modified, it will cause a blurry screen, probably because the Qt window will not change with the fb area.


3. When using the combination of local_alpha and night vision (mxc_v4l2_tvin), there is a 16-bit alignment on the hardware, so the resolution should be set to a multiple of 16, otherwise it is prone to blurry screens. There is an 8-pixel alignment code in the mxc_v4l2_tvin code.


4. When the resolution of the night vision window is too large, the screen will flicker. The reason is unknown at present, but the probability seems to be positively related to the cpu/gpu load






Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325416483&siteId=291194637
Recommended