ADV7282A Linux driver for IMX6: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 28: Line 28:


Execute the command:
Execute the command:
<source lang="bash">
<syntaxhighlight lang=bash>
ls /proc/device-tree/./soc/aips-bus@02100000/i2c@021a8000/adv7282@21
ls /proc/device-tree/./soc/aips-bus@02100000/i2c@021a8000/adv7282@21
</source>
</syntaxhighlight>


The output returned is the following:
The output returned is the following:


<source lang="bash">
<syntaxhighlight lang=bash>
AVDD-supply    DVDD-supply    clock-names    compatible    mclk          name          pinctrl-names  status
AVDD-supply    DVDD-supply    clock-names    compatible    mclk          name          pinctrl-names  status
DOVDD-supply  PVDD-supply    clocks        csi_id        mclk_source    pinctrl-0      reg
DOVDD-supply  PVDD-supply    clocks        csi_id        mclk_source    pinctrl-0      reg
</source>
</syntaxhighlight>


===Verify if the driver is loaded===
===Verify if the driver is loaded===


Execute the command:
Execute the command:
<source lang="bash">
<syntaxhighlight lang=bash>
lsmod
lsmod
</source>
</syntaxhighlight>


The output returned is the following:
The output returned is the following:


<source lang="bash">
<syntaxhighlight lang=bash>
Module                  Size  Used by
Module                  Size  Used by
usb_f_hid              8735  2
usb_f_hid              8735  2
Line 69: Line 69:
configfs              23790  5 usb_f_acm,usb_f_mass_storage,libcomposite,usb_f_hid
configfs              23790  5 usb_f_acm,usb_f_mass_storage,libcomposite,usb_f_hid
galcore              366496  0
galcore              366496  0
</source>
</syntaxhighlight>


==Video Capture==
==Video Capture==
Line 76: Line 76:


Execute the command:
Execute the command:
<source lang="bash">
<syntaxhighlight lang=bash>
GST_DEBUG=3 gst-launch-1.0 imxv4l2videosrc ! imxipuvideotransform ! queue ! imxg2dvideosink async=false sync=false
GST_DEBUG=3 gst-launch-1.0 imxv4l2videosrc ! imxipuvideotransform ! queue ! imxg2dvideosink async=false sync=false
</source>
</syntaxhighlight>
The output returned is the following:
The output returned is the following:
<source lang="bash">
<source lang="bash">
Line 93: Line 93:
Freeing pipeline ...
Freeing pipeline ...
[16330.053914] imx-ipuv3 2400000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00000001
[16330.053914] imx-ipuv3 2400000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00000001
</source>
</syntaxhighlight>


Take a picture:
Take a picture:
<source lang="bash">
<syntaxhighlight lang=bash>
gst-launch-1.0 imxv4l2videosrc num-buffers=1 ! jpegenc ! filesink location=test.jpg
gst-launch-1.0 imxv4l2videosrc num-buffers=1 ! jpegenc ! filesink location=test.jpg
</source>
</syntaxhighlight>


The output returned is the following:
The output returned is the following:
<source lang="bash">
<syntaxhighlight lang=bash>
Setting pipeline to PAUSED ...
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is live and does not need PREROLL ...
Line 113: Line 113:
Setting pipeline to NULL ...
Setting pipeline to NULL ...
Freeing pipeline ...
Freeing pipeline ...
</source>
</syntaxhighlight>


=== Driver input selection control===
=== Driver input selection control===
Line 119: Line 119:


This is the pipeline used to capture from the Video 1
This is the pipeline used to capture from the Video 1
<source lang="bash">
<syntaxhighlight lang=bash>
gst-launch-1.0 imxv4l2videosrc input=1 ! imxipuvideotransform ! queue ! imxg2dvideosink async=false sync=false
gst-launch-1.0 imxv4l2videosrc input=1 ! imxipuvideotransform ! queue ! imxg2dvideosink async=false sync=false
</source>
</syntaxhighlight>
This is the pipeline used to capture from the Video 2
This is the pipeline used to capture from the Video 2
<source lang="bash">
<syntaxhighlight lang=bash>
gst-launch-1.0 imxv4l2videosrc input=2 ! imxipuvideotransform ! queue ! imxg2dvideosink async=false sync=false
gst-launch-1.0 imxv4l2videosrc input=2 ! imxipuvideotransform ! queue ! imxg2dvideosink async=false sync=false
</source>
</syntaxhighlight>
Also you can use v4l2-ctl to select the video input, these are the commands:
Also you can use v4l2-ctl to select the video input, these are the commands:
<source lang="bash">
<syntaxhighlight lang=bash>
v4l2-ctl --set-input 1
v4l2-ctl --set-input 1
v4l2-ctl --set-input 2
v4l2-ctl --set-input 2
</source>
</syntaxhighlight>
This is the expected output:
This is the expected output:
<source lang="bash">
<syntaxhighlight lang=bash>
[ 1795.624535] adv7282 3-0021: Input Ain1
[ 1795.624535] adv7282 3-0021: Input Ain1
Video input set to 1 (CSI MEM: Camera, no power)
Video input set to 1 (CSI MEM: Camera, no power)
</source>
</syntaxhighlight>
Note: If you use the previous command and after that you run the Gstreamer pipeline, the video input selected is will be overwritten by the imxv4l2videosrc element.
Note: If you use the previous command and after that you run the Gstreamer pipeline, the video input selected is will be overwritten by the imxv4l2videosrc element.


The driver is using VIDIOC_S_INPUT to select the video input. I have created the code below to show the steps required to perform the channel switching.
The driver is using VIDIOC_S_INPUT to select the video input. I have created the code below to show the steps required to perform the channel switching.
<source lang="c">
 
<syntaxhighlight lang="c">
#include <fcntl.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
Line 177: Line 178:
     return 0;
     return 0;
}
}
</source>
</syntaxhighlight>


{{ContactUs}}
{{ContactUs}}


[[Category: iMX6]][[Category: AnalogDevices]]
[[Category: iMX6]][[Category: AnalogDevices]]