i.MX6Q Automotive board has one ADV7180 analog video decoder with 2 video inputs. By default, only input 1 is used (connector J42).
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).
Hi karinavalencia, ebiz_ws_prod,
Do you know where the attached files were moved to? I don't have them anymore.
Best regards,
Rogerio
Fixed.
karinavalencia rogeriopimentel
Thank you very much. This will be very useful in my project.
I patch the my file according your patch files, but difference with yours.
Could you share your adv7180.c file? I will make a compare.
And share your adv7180' connect circuit , mybe I have some error with it.
Hi wanbenzhou,
Sorry, I don't have this source code anymore. I used the 4.1.15_1.0.0_ga branch. Please, check if the branch you're applying the patch is the same.
About the HW, I used the i.MX6Q Automotive board with its base board. Do you have their schematics?
Best regards,
Rogerio
Thanks for your reply.
And what's the step to switching channel?
1. I switch the channel during play /dev/video0(gst-launch-1.0 imxv4l2src device=/dev/video0 ! autovideosink) success,
but sometimes, the display scroll down for a while, such as waite a synchronize signal.
2. If I operate following step the screen is well. (stop play -> switch channel -> start play)
The result is looks like your demo video.
Is it the right way?