Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does A20 linux use Parallel CSI Camera and UVC at the same time

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How does A20 linux use Parallel CSI Camera and UVC at the same time? for this question, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

[target]

Use both the parallel csi camera and the usb camera to preview the parallel on the A20.

[type selection]

The hardware chooses the CubieBoard2 development board whose main control is A20.

The software SDK chooses the lichee package in Quanzhi A20 Kitkat SDK.

[process]

1. In the menuconfig of linux-3.4, turn on the uvc driver option, and set the USB_VIDEO_CLAS to mGrady USBVIDEO programs, classes installed and EVDEV to y.

Device Drivers->

Multimedia support->

[*] Video capture adapters->

[*] V4L USB devices->

USB Video Class (UVC)

[*] UVC input events device support

2. Add the testcase of usb camera to dragonboard. Quanzhi dragonboard environment uses linux+DirectFb, which can be added by referring to the existing csi camera testcase code. It is roughly divided into two steps:

The first step is to add the code to start usb camera test after the csi camera test code of df_view.c

X2 = 0layer_config.width height2 = layer_config.height > > 1layer_config.width y2 = layer_config.height > > 1layer_config.width if (mic_activated) {width3 = (layer_config.width > > 1)-(layer_config.width > > MIC_POWER_BAR_WITH_SHIFT);} else {width3 = (layer_config.width > > 1);} if (usb_camera_test_init (x2 return-1;}

The second step is to add usbcameratest.c,usbcameratest.c, which includes the core methods of initializing, opening, and setting parameters of usbcamera. The implementation of the usb_camera_test_init function mentioned above is also in this source file. Usbcameratest.c can be written according to the following process

Here, there are several points to note, first, the data format of usb camera is YUYV, so in set format, pixel format should be set to YUYV;. Second, the image size of usb camera is 640x480.

3. From the CubieBoard2 schematic diagram, we can only use csi1 to connect to parallel csi camera, so test_config.fex needs to make the following changes

[camera] activated = 1moduleaccount6module1paths= "/ system/vendor/modules/videobuf-core.ko" module2_path= "/ system/vendor/modules/videobuf-dma-contig.ko" module3_path= "/ system/vendor/modules/camera.ko" module4_path= "/ system/vendor/modules/gc0308.ko" module5_path= "/ system/vendor/modules/sunxi_csi1.ko" module6_path= "/ system/vendor/modules/uvcvideo.ko" dev_cnt = 1csi_cnt = 1fps = 30

4. Compile, package and burn

Cd lichee./build.sh-p sun7i_dragonboard./build.sh pack

[results]

The following image shows parallel csi camera preview in the upper right corner and usb camera preview in the lower left corner of the LCD. Both cameras have been turned on and continue to collect data and draw them on the screen.

[remaining problems and solutions]

Because the data format of usb camera is YUV420 in the usb camera preview area of YUYV,LCD, the picture data from usb camera cannot be displayed correctly. To solve this problem, we can consider the data format conversion, convert YUYV to YUV420 and then draw on the screen. A20G2D can be used to realize the conversion, which is more efficient.

This is the answer to the question about how A20 linux uses Parallel CSI Camera and UVC at the same time. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report