67 | | '''Note that coda support for the IMX6 was added to Linux in the 3.16 kernel. This page applies to Linux 3.16 and beyond. If you are using a kernel earlier than that for the Ventana IMX6 based boards (such as the Gateworks 3.14 kernel) you will need to refer the Yocto GStreamer pages documenting the proprietary VPU drivers and software from Freescale: |
68 | | * [wiki:Yocto/gstreamer] |
69 | | * [wiki:Yocto/gstreamer/compositing] |
70 | | * [wiki:Yocto/gstreamer/latency] |
71 | | * [wiki:Yocto/gstreamer/multimedia] |
72 | | * [wiki:Yocto/gstreamer/streaming] |
73 | | * [wiki:Yocto/gstreamer/video] |
74 | | ''' |
75 | | |
76 | | The Linux [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/platform/coda coda] media driver as of Linux 3.16 supports the CODA960 in the IMX6 and currently provides access to H264 encode/decode, MPEG4 encode/decode, and MPEG2 decode. |
| 71 | The Linux [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/platform/coda coda] media driver as of Linux 3.16 supports the CODA960 in the IMX6 and currently provides access to the following: |
| 72 | * decode |
| 73 | - H264 |
| 74 | - MPEG4 |
| 75 | - MPEG2 |
| 76 | * encode: |
| 77 | - H264 |
| 78 | - MPEG4 |
| 79 | |
| 80 | If the CODA driver is enabled in the kernel (CONFIG_VIDEO_CODA=m) and firmware is able to be loaded from {{{/lib/firmware/vpu}}} two {{{/dev/videoN}}} devices are created (one for encode, the other for decode): |
| 81 | {{{#!bash |
| 82 | root@imx6q-gw5404:~/# dmesg | grep coda |
| 83 | [ 12.893365] coda 2040000.vpu: Direct firmware load for vpu_fw_imx6q.bin failed with error -2 |
| 84 | [ 12.893389] coda 2040000.vpu: Falling back to syfs fallback for: vpu_fw_imx6q.bin |
| 85 | [ 15.168874] coda 2040000.vpu: Using fallback firmware vpu/vpu_fw_imx6q.bin |
| 86 | [ 15.201391] coda 2040000.vpu: Firmware code revision: 570363 |
| 87 | [ 15.201421] coda 2040000.vpu: Initialized CODA960. |
| 88 | [ 15.201433] coda 2040000.vpu: Firmware version: 3.1.1 |
| 89 | [ 15.205867] coda 2040000.vpu: codec registered as /dev/video[8-9] |
| 90 | root@imx6q-gw5404:~/# cat /sys/class/video4linux/video8/name |
| 91 | coda-encoder |
| 92 | root@imx6q-gw5404:~/# cat /sys/class/video4linux/video9/name |
| 93 | coda-decoder |
| 94 | }}} |
| 95 | |
| 96 | Note that the CODA960 encoder requires NV12/I420/YV12 YUV pixel formats with rec709 colorimetry. |
| 97 | |
| 98 | Note also that the CODA driver requires CMA memory for buffers when it is used. Make sure to provide the kernel with enough CMA memory with the kernel command-line (ie 'cma=64M' for 64MB which should be enough) |
198 | | gst-launch-1.0 videotestsrc ! 'video/x-raw, width=1920, height=1080, framerate=30/1, format=NV12, colorimetry=bt709' ! v4l2h264enc output-io-mode=4 ! rtph264pay ! udpsink host=$SERVER port=5000 |
| 221 | gst-launch-1.0 videotestsrc ! \ |
| 222 | 'video/x-raw,width=1920,height=1080,framerate=30/1,format=NV12,colorimetry=bt709' ! \ |
| 223 | v4l2h264enc output-io-mode=4 ! rtph264pay ! udpsink host=$SERVER port=5000 |