Safe video switch using ADV7180 and i.MX6Q Automotive Board

Document created by rogeriopimentel Employee on Nov 17, 2016Last modified by ebiz_ws_prod on Dec 13, 2017
Version 10Show Document
  • View in full screen mode

i.MX6Q Automotive board has one ADV7180 analog video decoder with 2 video inputs. By default, only input 1 is used (connector J42).

 

Fast Video Switch using ADV7180 and i.MX6Q Automotive Board

 

To connect 2 analog video sources and switch the display between them, the following changes are needed:

 

1 - Create a new IOCTL on V4L2_capture and ADV7180 device drivers to receive the information from user space application on what input will be selected.

2 - In this new IOCTL, use the "Fast Switch Script" for ADV7180 described at Analog Devices site: ADV7180 Fast Switch Script | EngineerZone 

3 - Create a user space application to call the IOCTL mentioned on step 1.

 

See attached:

 

1 - 0001-ADV7180-Adding-input-switch-IOCTL.patch.zip - Patch to be applied on NXP kernel 4.1.15_1.0.0_ga

2 - example2.c.zip - Source code example of user space application. It changes the video input in each 2 seconds. (See it working on attached video)

3 - example2.zip - User space application executable file 

4 - Makefile.zip - Makefile of user space application to be used as example

5 - adv7180_switch.mp4 - Video showing the application

 

In the application, VIDIOC_S_CHIP_INPUT IOCTL is called to change the input:

 

int input = 0;

if (ioctl(fd_capture_v4l, VIDIOC_S_CHIP_INPUT, &input) < 0) {
    printf("VIDIOC_S_CHIP_INPUT failed\n");
    return TFAIL;
}

 

This IOCTL calls the ADV7180 Fast Switch Script, added on ADV7180 driver (see attached patch).

Original Attachment has been moved to: 0001-ADV7180-Adding-input-switch-IOCTL.patch.zip

Original Attachment has been moved to: Makefile.zip

Original Attachment has been moved to: example2.c.zip

Original Attachment has been moved to: example2.zip

Attachments

Outcomes