Changes

Jump to: navigation, search

XUELK-AN-007: USB Camera input on i.MX6UL-based platforms

10,254 bytes added, 17:02, 11 July 2017
no edit summary
[ 7.191864] USB Video Class driver (1.1.1)
[ 7.439394] usb_audio: Warning! Unlikely big volume range (=6144), cval->res is probably wrong.
[ 7.489486] usb_audio: [3] FU [Mic Capture Volume] ch = 1, val = 5120/11264/1[ 7.546073] usbcore: registered new interface driver snd-usb-audio
</pre>
<pre class="board-terminal">
root@sbc-lynx:~# smart update
Updating cache... ######################################## [100%]
 
Fetching information for 'cortexa7hf_vfp_neon_mx6ul'...
-> http://yocto.dave.eu/xuelk-latest/cortexa7hf_vfp_neon_mx6ul/.../repomd.xml
repomd.xml ######################################## [ 16%]
-> http://yocto.dave.eu/xuelk-latest/.../filelists.xml.gz
filelists.xml.gz ######################################## [ 25%]
-> http://yocto.dave.eu/xuelk-latest/.../primary.xml.gz
primary.xml.gz ######################################## [ 33%]
 
Fetching information for 'cortexa7hf_vfp_neon'...
-> http://yocto.dave.eu/xuelk-latest/cortexa7hf_vfp_neon/repodata/repomd.xml
repomd.xml ######################################## [ 50%]
-> http://yocto.dave.eu/xuelk-latest/cortexa7hf_vfp_neon/.../filelists.xml.gz
filelists.xml.gz ######################################## [ 58%]
-> http://yocto.dave.eu/xuelk-latest/cortexa7hf_vfp_neon/.../primary.xml.gz
primary.xml.gz ######################################## [ 66%]
 
Fetching information for 'sbc_lynx'...
-> http://yocto.dave.eu/xuelk-latest/sbc_lynx/repodata/repomd.xml
repomd.xml ######################################## [ 83%]
-> http://yocto.dave.eu/xuelk-latest/sbc_lynx/repodata/filelists.xml.gz
-> http://yocto.dave.eu/xuelk-latest/sbc_lynx/repodata/primary.xml.gz
primary.xml.gz ######################################## [ 91%]
filelists.xml.gz ######################################## [100%]
 
Updating cache... ######################################## [100%]
 
Channels have 11874 new packages.
Saving cache...
 
root@sbc-lynx:~#
</pre>
Adding these three channels there will be <b>11874</b> new available packages.
===Adding gstreamer packages===
<pre class="board-terminal">
root@sbc-lynx:~# smart install gstreamer1.0-1.4.5-r0
Loading cache...Updating cache... ######################################## [100%] Computing transaction... Installing packages (1): gstreamer1.0-1.4.5-r0@cortexa7hf_vfp_neon 763.6kB of package files are needed. 1.8MB will be used. Confirm changes? (Y/n): y Fetching packages...-> http://yocto.dave.eu/.../gstreamer1.0-1.4.5-r0.cortexa7hf_vfp_neon.rpmgstreamer1.0-1.4.5-r0.cortexa.. ######################################## [100%]  Committing transaction...Preparing... ######################################## [ 0%] 1:Installing gstreamer1.0 ######################################## [100%]  root@sbc-lynx:~#
</pre>
 
as it's shown on installation log, smart asks for installing xxx MB of additional packages.
Then, it is enough to install the other gstreamer <code>plugins</code>, for example:
gstreamer1.0-plugins-base-1.4.5-r0
gstreamer1.0-plugins-bad-1.4.5-r0
</pre>
 
These packages will install about:
 
<pre>
plugins-good: 5.5MB of package files are needed. 11.7MB will be used.
plugins-base: 1.8MB of package files are needed. 3.7MB will be used.
plugins-bad: 2.1MB of package files are needed. 3.9MB will be used.
</pre>
 
===Adding fsl gstreamer plugin ===
 
For video sink on framebuffer, the NXP gstreamer plugin is required. This can be installed from <code>fsl</code> package:
 
<pre class="board-terminal">
root@sbc-lynx:~# smart install gst1.0-fsl-plugin-4.0.8-r0
Loading cache...
Updating cache... ######################################## [100%]
 
Computing transaction...
 
Installing packages (7):
gst1.0-fsl-plugin-4.0.8-r0@sbc_lynx
lib-oggvorbis-dec-arm11-elinux2-4.0.8-r0@cortexa7hf_vfp_neon_mx6ul
libfslcodec-aac-4.0.8-r0@cortexa7hf_vfp_neon_mx6ul
libfslcodec-mp3-4.0.8-r0@cortexa7hf_vfp_neon_mx6ul
libfslparser-4.0.8-r0@cortexa7hf_vfp_neon_mx6ul
libgstfsl-1.0-0-4.0.8-r0@sbc_lynx
libpxp0-1:5.3-r0@sbc_lynx
 
1.6MB of package files are needed. 5.9MB will be used.
 
Confirm changes? (Y/n): y
 
Fetching packages...
-> http://yocto.dave.eu/.../libfslcodec-mp3-4.0.8-r0.cortexa7hf_vfp_neon_mx6ul.rpm
-> http://yocto.dave.eu/.../lib-oggvorbis-dec-arm11-elinux2-4.0.8-r0.cortexa7hf_vfp_neon_mx6ul.rpm
lib-oggvorbis-dec-arm11-elinu.. ######################################## [ 14%]
-> http://yocto.dave.eu/xuelk-latest/.../libgstfsl-1.0-0-4.0.8-r0.sbc_lynx.rpm
libgstfsl-1.0-0-4.0.8-r0.sbc_.. ######################################## [ 28%]
-> http://yocto.dave.eu/.../libfslcodec-aac-4.0.8-r0.cortexa7hf_vfp_neon_mx6ul.rpm
libfslcodec-aac-4.0.8-r0.cort.. ######################################## [ 42%]
libfslcodec-mp3-4.0.8-r0.cort.. ######################################## [ 57%]
-> http://yocto.dave.eu/.../gst1.0-fsl-plugin-4.0.8-r0.sbc_lynx.rpm
-> http://yocto.dave.eu/xuelk-latest/sbc_lynx/libpxp0-5.3-r0.sbc_lynx.rpm
libpxp0-5.3-r0.sbc_lynx.rpm ######################################## [ 71%]
-> http://yocto.dave.eu/.../libfslparser-4.0.8-r0.cortexa7hf_vfp_neon_mx6ul.rpm
libfslparser-4.0.8-r0.cortexa.. ######################################## [ 85%]
gst1.0-fsl-plugin-4.0.8-r0.sb.. ######################################## [100%]
 
 
Committing transaction...
Preparing... ######################################## [ 0%]
1:Installing libfslparser ######################################## [ 14%]
2:Installing libfslcodec-mp3 ######################################## [ 28%]
3:Installing libfslcodec-aac ######################################## [ 42%]
4:Installing libpxp0 ######################################## [ 57%]
5:Installing lib-oggvorbis.. ######################################## [ 71%]
6:Installing libgstfsl-1.0-0 ######################################## [ 85%]
7:Installing gst1.0-fsl-pl.. ######################################## [100%]
 
 
root@sbc-lynx:/lib/modules#
</pre>
* pipeline:
<pre class="board-terminal">
root@sbc-lynx:~# gst-launch-1.0 -v v4l2src device=/dev/video1 ! 'video/x-raw, format=YUY2, width=640, height=480, framerate=30/1' ! imxv4l2sink force-aspect-ratio=true====== IMXV4L2SINK: 4.0.8 build on Aug 25 2016 18:01:57. ======Setting pipeline to PAUSED ...display(/dev/fb0) resolution is (800x480).Pipeline is live and does not need PREROLL ...Setting pipeline to PLAYING ...New clock: GstSystemClock/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"/GstPipeline:pipeline0/GstImxV4l2Sink:imxv4l2sink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"v4l2sink need allocate 3 buffers.
</pre>
* top process shows that cpu is running at 20%
<pre class="board-terminal">
root@sbc-lynx:~# gst-launch-1.0 -v v4l2src device=/dev/video1 ! 'video/x-raw, format=YUY2, width=320, height=240, framerate=30/1' ! imxv4l2sink overlay-top=120 overlay-left=240 overlay-width=320 overlay-height=240 force-aspect-ratio=true====== IMXV4L2SINK: 4.0.8 build on Aug 25 2016 18:01:57. ======Setting pipeline to PAUSED ...display(/dev/fb0) resolution is (800x480).Pipeline is live and does not need PREROLL ...Setting pipeline to PLAYING ...New clock: GstSystemClock/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"/GstPipeline:pipeline0/GstImxV4l2Sink:imxv4l2sink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"v4l2sink need allocate 3 buffers.</pre> * top process shows that cpu is running at 13% <pre class="board-terminal">Mem: 176956K used, 70208K free, 356K shrd, 3896K buff, 116504K cachedCPU: 0% usr 9% sys 0% nic 71% idle 0% io 0% irq 19% sirqLoad average: 0.27 0.35 0.36 1/64 683 PID PPID USER STAT VSZ %VSZ %CPU COMMAND 676 378 root S 35512 14% 13% gst-launch-1.0 -v v4l2src device=/dev/
</pre>
In this use case the PXP iMX6UL hardware cell is performing an image rotation on the screen using the <code>imxvideoconvert_pxp</code> <b>NXP</b> gstreamer plugin
<pre class="board-terminal">
root@sbc-lynx:~# gst-launch-1.0 -v v4l2src device=/dev/video1 ! capsfilter caps="video/x-raw, width=640, height=480, framerate=30/1" ! imxvideoconvert_pxp rotation=1 ! imxv4l2sink force-aspect-ratio=true====== IMXV4L2SINK: 4.0.8 build on Aug 25 2016 18:01:57. ======Setting pipeline to PAUSED ...display(/dev/fb0) resolution is (800x480).Pipeline is live and does not need PREROLL ...Setting pipeline to PLAYING ...New clock: GstSystemClock/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"/GstPipeline:pipeline0/imxvideoconvert_pxp:imxvideoconvert_pxp0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)BGRx\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ framerate\=\(fraction\)30/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"/GstPipeline:pipeline0/GstImxV4l2Sink:imxv4l2sink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)BGRx\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ framerate\=\(fraction\)30/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"/GstPipeline:pipeline0/imxvideoconvert_pxp:imxvideoconvert_pxp0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1"v4l2sink need allocate 3 buffers.
</pre>
8,221
edits

Navigation menu