Changes between Version 56 and Version 57 of ventana/ubuntu


Ignore:
Timestamp:
06/25/2020 11:03:06 PM (2 years ago)
Author:
Tim Harvey
Comment:

remove outdated ubuntu trusty 14.04 and downstream vendor 3.14 kernel details

Legend:

Unmodified
Added
Removed
Modified
  • ventana/ubuntu

    v56 v57  
    3333
    3434Features:
    35 - Ubuntu arm core (created via debootstrap)
     35- Ubuntu arm core (created via [https://github.com/gateworks/ubuntu-rootfs ubuntu-rootfs.sh] debootstrap script)
    3636- Gateworks Ventana Linux kernel (Linux 5.4 based)
    3737- eth0 dhcp with a 30 second timeout
     
    7373   - eth0 dhcp
    7474   - user root passwd root
    75  * Ubuntu 14.04 LTS (Trusty Tahr) console image
    76   - Important Notes:
    77    - This is a mainline kernel that does not have Video Hardware Acceleration support for gstreamer and a few other Gateworks specific items. For more information, read [wiki:ventana#MainlineLinuxKernelsupport Gateworks Mainline Linux Support].
    78    - This requires the latest Gateworks Bootloader - U-Boot v2017.05 (see http://dev.gateworks.com/ventana/images and http://trac.gateworks.com/wiki/ventana/bootloader#PreBuiltBootloader)
    79   - A pre-built console image created using the  [#debootstrap debootstrap] method for [http://releases.ubuntu.com/14.04/ Ubuntu 14.04 (Trusty Tahr)] can be downloaded:
    80    * [http://dev.gateworks.com/ventana/images/trusty-ventana_large.ubi trusty-ventana_large.ubi] - UBI image for 4K page size 'large' geometry FLASH (see [wiki:/linux/ubi/#flashgeometry here] to determine your flash geometry) (see wiki:/linux/ubi#BasicMethod for info about flashing UBI images)
    81    * [http://dev.gateworks.com/ventana/images/trusty-ventana_normal.ubi trusty-ventana_normal.ubi] - UBI image for 2K page size 'large' geometry FLASH (see [wiki:/linux/ubi/#flashgeometry here] to determine your flash geometry) (see wiki:/linux/ubi#BasicMethod for info about flashing UBI images)
    82    * [http://dev.gateworks.com/ubuntu/trusty/trusty-ventana.tar.gz trusty-ventana.tar.gz] - tarball of rootfs you can use to image onto microSD / mSATA using instructions from [wiki:linux/blockdev linux/blockdev]
    83   - Features:
    84    - Ubuntu 14.04 (from debootstrap instructions)
    85    - Gateworks 3.14 kernel with modules
    86    - ventana bootscript
    87    - extra packages: openssh-server can-utils i2c-tools usbutils pciutils
    88    - eth0 dhcp
    89    - user root passwd root
    90  * Ubuntu 14.04 LTS (Trusty Tahr) multimedia image
    91   - A pre-built console image created using the [#debootstrap debootstrap] method for [http://releases.ubuntu.com/14.04/ Ubuntu 14.04 (Trusty Tahr)] and adding gstreamer-imx for IPU/VPU/GPU hw video acceleration can be downloaded:
    92    * [http://blog.gateworks.com/?wpdmpro=trusty-armhf-ventana_20160112_large.ubi trusty-armhf-ventana_20160112_large.ubi] - UBI image for 4K page size 'large' geometry FLASH (see [wiki:/linux/ubi/#flashgeometry here] to determine your flash geometry) (see wiki:/linux/ubi#BasicMethod for info about flashing UBI images)
    93    * [http://blog.gateworks.com/?wpdmpro=trusty-armhf-ventana_20160112.tar.gz trusty-armhf-ventana_20160112.tar.gz] -  tarball of rootfs you can use to image onto microSD / mSATA using instructions from [wiki:linux/blockdev linux/blockdev]
    94   - Features:
    95    - Ubuntu 14.04 (from debootstrap instructions)
    96    - Gateworks 3.14 kernel with modules
    97    - ventana bootscript
    98    - extra packages: openssh-server can-utils i2c-tools usbutils pciutils
    99    - eth0 dhcp
    100    - user root passwd root
    101    - gstreamer (gstreamer1.0-x gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa)
    102    - fsl vpu firmware
    103    - fsl lib-vpu
    104    - fsl codec library
    105    - fsl libg2d
    106    - dev tools (build-essential autoconf libtool wget python pkg-config git)
    107    - python
    108    - gstreamer/gstreamer-imx/libimxvpuapi
    109    - v4l-utils
    110   - For details on Gstreamer and Gstreamer-imx see our [wiki:Yocto/gstreamer page]
    11175 
    11276
     
    303267echo "blacklist rtc_snvs" > /etc/modprobe.d/blacklist-rtc.conf
    304268}}}
    305  a. Gateworks pre-built downstream vendor kernel: 3.14 kernel containing Vivante drivers (which is not currently in upstream Linux) - ** Not recommended **
    306 {{{
    307 #!bash
    308 cd /
    309 wget http://dev.gateworks.com/ventana/images/gateworks-linux-imx6-3.14.48.tar.gz
    310 tar -xvf gateworks-linux-imx6-3.14.48.tar.gz --keep-directory-symlink
    311 depmod $(ls /lib/modules/) # create module dependencies
    312 rm gateworks-linux-imx6-3.14.48.tar.gz
    313 }}}
    314   * the {{{depmod}}} trick above is to run depmod with the exact kernel version (which will be the subdir in /lib/modules). An alternative is to run {{{depmod}}} after the first boot
    315  a. Build your own kernel and install it as above with proper bootscript - see [wiki:linux/kernel#building] for more info (you can do this on a development host with a cross-toolchain or even even install development tools via the '''build-essential''' meta-package and build and install sources such as the kernel below (adds appx 180MB))
    316269
    31727012. exit the chroot shell and remove files we no longer need
     
    349302While a kernel is not specifically part of a root filesystem it usually resides on the root filesystem. There are several kernel sources you can choose from:
    350303 * Gateworks pre-built 5.4 kernel (**recommended**)
    351  * Gateworks pre-built 3.14 kernel
    352304 * Ubuntu built kernel
    353305 * Kernel built by hand
     
    435387mkimage -A arm -O linux -T script -n bootscript -d /boot/6x_bootscript-ventana.txt /boot/6x_bootscript-ventana
    436388}}}
    437 
    438 
    439 == version-specific notes
    440 Here are some version specific notes
    441 
    442 === trusty (14.04) LTS
    443  - An extra step is needed for serial console configuration:
    444 {{{
    445 #!bash
    446 cat << EOT >> /etc/init/serial.conf
    447 start on stopped rc RUNLEVEL=[2345]
    448 stop on runlevel [!2345]
    449 respawn
    450 exec /sbin/getty 115200 ttymxc1
    451 EOT
    452 }}}
    453 
    454 
    455 
    456 [=#gstreamer-imx]
    457 == Adding GStreamer IPU/VPU/GPU support via gstreamer-imx (**Trusty**)
    458 **Note: This section pertains only to the Gateworks downstream vendor 3.14 kernel with proprietary Freescale Drivers (Trusty Prebuilt image)**
    459 
    460 If using the Gateworks downstream vendor 3.14 kernel with proprietary Freescale drivers you can easily add IMX6 IPU, VPU, and GPU support via GStreamer and Gstreamer-imx plugins. Many of the pieces needed (firmware and source-code) are from Freescale and not freely redistributable thus must be downloaded from their mirror and extracted from a shell script that forces you to read and agree to their End User License Agreement (EULA).
    461 
    462 This support requires that you are using the Gateworks downstream vendor kernel as it has the necessary driver support that is not in the mainline Linux kernel.  '''This procedure has not been proven on versions newer than Trusty.   '''
    463 
    464 There are several pre-requisites you will need to install and/or build using the instructions below:
    465  - Gateworks downstream vendor kernel (containing non-upstreamed IPU/VPU/GPU drivers) with kernel headers. See [wiki:linux/kernel here] for instructions on building, or [http://dev.gateworks.com/ventana/images/gateworks-linux-imx6-3.14.48.tar.gz here] for a pre-built kernel tarball
    466  - gstreamer and libs
    467  - firmware-imx-3.14.28-1.0.0.bin - Freescale VPU firmware (EULA required)
    468  - imx-vpu-5.4.31.bin - Freescale lib_vpu (EULA required) - this is the low-level documented API that works with the (undocumented) VPU kernel driver API. You can think of this as a kernel driver in userspace
    469  - libfslcodec-4.0.3.bin - Freescale Codec Library (EULA required)
    470  - imx-gpu-viv-5.0.11.p4.5-hfp.bin - Freescale libg2d (EULA required) - this is the low-level documented API that works with the (undocumented) Vivante Galcore GPU kernel driver API. You can think of this as a kernel driver in userspace
    471  - libimxvpuapi - community based open-source high-level library over the low-level imx-vpu API
    472  - gstreamer-imx - community based open-source GStreamer plugins to utilize hardware accellerated capture, display, transforms, compositing, decode, encode capabilities of the IMX6.
    473 
    474 
    475 The following instructions can be used on top of the [#debootstrap debootstrap created rootfs] but should work on other sources of Ubuntu or other Linux distributions root filesystems as well.
    476 
    477 1. install build deps (~165MB):
    478 {{{
    479 #!bash
    480 apt-get install build-essential autoconf libtool wget python pkg-config git
    481 }}}
    482 
    483 2. install gstreamer1.x (~200MB):
    484 {{{
    485 #!bash
    486 apt-get install gstreamer1.0-x gstreamer1.0-tools
    487 # install videoparserbad for video parsers like h264parse, mpegvideoparse and mpeg4videoparse
    488 apt-get install gstreamer1.0-plugins-good gstreamer1.0-plugins-bad
    489 # install alsa plugin
    490 apt-get install gstreamer1.0-alsa
    491 }}}
    492  * note that the gstreamer1.0-plugins-bad meta-package is in the multiverse package feed
    493  * at this point you could use 'gst-launch-1.0 videotestsrc ! fbdevsink' but it will not stretch to the display, and will not be hardware accelerated
    494 
    495 3. install Freescale VPU firmware (firmware-imx) (EULA required)
    496 {{{
    497 #!bash
    498 wget http://www.freescale.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-3.14.28-1.0.0.bin
    499 /bin/sh firmware-imx-*.bin
    500 # install firmware
    501 mkdir -p /lib/firmware/vpu
    502 cp firmware-imx-*/firmware/vpu/vpu_fw_imx6*.bin /lib/firmware/vpu
    503 }}}
    504 
    505 4. build and install Freescale lib_vpu (EULA required)
    506 {{{
    507 #!bash
    508 wget http://www.freescale.com/lgfiles/NMG/MAD/YOCTO/imx-vpu-5.4.31.bin
    509 /bin/sh imx-vpu-*.bin
    510 cd imx-vpu-*
    511 make PLATFORM=IMX6Q all
    512 make install # installs vpu_lib.h and vpu_io.h in /usr/include and libvpu.* in /usr/lib
    513 cd ..
    514 }}}
    515 
    516 5. (optional) build and install Freescale Codec Library (libfslcodec) (EULA required)
    517 {{{
    518 #!bash
    519 wget http://www.freescale.com/lgfiles/NMG/MAD/YOCTO/libfslcodec-4.0.3.bin
    520 /bin/sh libfslcodec-*.bin
    521 cd libfslcodec-*
    522 ./autogen.sh --prefix=/usr --enable-fhw --enable-vpu
    523 make all
    524 make install
    525 # move the libs where gstreamer plugins will find them
    526 mv /usr/lib/imx-mm/video-codec/* /usr/lib
    527 mv /usr/lib/imx-mm/audio-codec/* /usr/lib
    528 rm -rf /usr/lib/imx-mm/
    529 cd ..
    530 }}}
    531  * this is optional and is needed if you want the audio codec support in gstreamer-imx
    532  * Note the Makefile will install the libs into $prefix/lib/imx-mm which is undesirable so we move them after 'make install'
    533 
    534 6. (optional) install Freescale libg2d (EULA required)
    535 {{{
    536 #!bash
    537 wget http://www.freescale.com/lgfiles/NMG/MAD/YOCTO/imx-gpu-viv-5.0.11.p4.5-hfp.bin
    538 /bin/sh imx-gpu-viv-*.bin
    539 cd imx-gpu-viv-*
    540 # install just the g2d headers/libs
    541 cp g2d/usr/include/* /usr/include/
    542 cp -d g2d/usr/lib/* /usr/lib/
    543 # install gpu-core headers/libs
    544 cp -d gpu-core/usr/lib/*.so* /usr/lib/
    545 cp -Pr gpu-core/usr/include/* /usr/include/
    546 # optional: install demos
    547 cp -r gpu-demos/opt /
    548 # optional: install gpu tools
    549 cp -axr gpu-tools/gmem-info/usr/bin/* /usr/bin/
    550 cd ..
    551 }}}
    552  * this is part of the Freescale Vivante GPU driver and apps (imx-gpu-viv) package which provides libgl/libgles1/libgles2/wayland-egl/libgal-x11/egl/libopenvg/libg2d
    553  * it comes in soft-float (sfp) and hard-float (hfp) - we want the hard-float as we are using an armhf rootfs
    554  * this is not required but needed for the gstreamer-imx g2d transform and sink plugins
    555 
    556 7. build and install libimxvpuapi library:
    557  - This library provides a community based open-source API to the Freescale imx-vpu library (the low-level IMX6 VPU interface). It is a replacement for Freescale's closed-development libfslvapwrapper library.
    558 {{{
    559 #!bash
    560 git clone git://github.com/Freescale/libimxvpuapi.git
    561 cd libimxvpuapi
    562 ./waf configure --prefix=/usr
    563 ./waf
    564 ./waf install
    565 cd ..
    566 }}}
    567 
    568 8. build and install gstreamer-imx:
    569 {{{
    570 #!bash
    571 apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev # +70MB
    572 git clone git://github.com/Freescale/gstreamer-imx.git
    573 cd gstreamer-imx
    574 ln -s /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/ /usr/lib/gstreamer-1.0
    575 ./waf configure --prefix=/usr --kernel-headers=/include
    576 ./waf
    577 ./waf install
    578 cd ..
    579 }}}
    580  * note './waf install' installs artifacts to its prefix + /lib/gstreamer-1.0 but they need to be installed to /usr/lib/arm-linux-gnueabihf/gstreamer-1.0 which is why we created a symlink above before installing
    581  * note the uniaudio decoder codecs are from Freescale (found in the fsl-mm-codeclib package) and you do not need these unless you want to use FSL's audio codecs instead of the GStreamer ones
    582  * note g2d lib required to build G2D
    583  * note that linux kernel headers are required to build PxP and IPU
    584  * note that libfslaudiocodec is required to build audio plugins
    585  * After this step you should be able to see several plugins with {{{gst-inspect-1.0}}}:
    586 {{{
    587 #!bash
    588 # gst-inspect-1.0 | grep imx
    589 imxv4l2videosrc:  imxv4l2videosrc: V4L2 CSI Video Source
    590 imxipu:  imxipucompositor: Freescale IPU video compositor
    591 imxipu:  imxipuvideosink: Freescale IPU video sink
    592 imxipu:  imxipuvideotransform: Freescale IPU video transform
    593 imxpxp:  imxpxpvideotransform: Freescale PxP video transform
    594 imxpxp:  imxpxpvideosink: Freescale PxP video sink
    595 imxvpu:  imxvpuenc_mjpeg: Freescale VPU motion JPEG video encoder
    596 imxvpu:  imxvpuenc_mpeg4: Freescale VPU MPEG-4 video encoder
    597 imxvpu:  imxvpuenc_h264: Freescale VPU h.264 video encoder
    598 imxvpu:  imxvpuenc_h263: Freescale VPU h.263 video encoder
    599 imxvpu:  imxvpudec: Freescale VPU video decoder
    600 imxg2d:  imxg2dcompositor: Freescale G2D video compositor
    601 imxg2d:  imxg2dvideotransform: Freescale G2D video transform
    602 imxg2d:  imxg2dvideosink: Freescale G2D video sink
    603 }}}
    604 
    605 9. install a U-Boot bootscript to setup kernel parameters for your display output:
    606 {{{
    607 #!bash
    608 apt-get install u-boot-tools
    609 wget https://github.com/Freescale/meta-freescale-3rdparty/raw/master/recipes-bsp/u-boot/u-boot-script-gateworks-imx/6x_bootscript-yocto.txt
    610 mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "boot script" -d 6x_bootscript-yocto.txt /boot/6x_bootscript-ventana
    611 reboot # reboot to setup bootargs for display
    612 }}}
    613  * The Freescale IMX6 display drivers use kernel parameters to configure what display outputs to enable and in what format. What displays, resolutions, and formats affect how much contiguous memory is needed (CMA) as well. The Gateworks Yocto BSP has a bootscript that configures connected displays based on various rules and we will use this here. See http://trac.gateworks.com/wiki/Yocto/Video_Out#DisplaysDevices for more info
    614 
    615 Now you will be able to use Gstreamer and Gstreamer-imx to tap the full potential of the IMX IPU/VPU/GPU hardware.
    616 
    617 Examples:
    618  * show gstreamer-imx plugins:
    619 {{{
    620 #!bash
    621 # gst-inspect-1.0 | grep imx
    622 imxvpu:  imxvpuenc_mjpeg: Freescale VPU motion JPEG video encoder
    623 imxvpu:  imxvpuenc_mpeg4: Freescale VPU MPEG-4 video encoder
    624 imxvpu:  imxvpuenc_h264: Freescale VPU h.264 video encoder
    625 imxvpu:  imxvpuenc_h263: Freescale VPU h.263 video encoder
    626 imxvpu:  imxvpudec: Freescale VPU video decoder
    627 imxv4l2videosrc:  imxv4l2videosrc: V4L2 CSI Video Source
    628 imxg2d:  imxg2dcompositor: Freescale G2D video compositor
    629 imxg2d:  imxg2dvideotransform: Freescale G2D video transform
    630 imxg2d:  imxg2dvideosink: Freescale G2D video sink
    631 imxipu:  imxipucompositor: Freescale IPU video compositor
    632 imxipu:  imxipuvideosink: Freescale IPU video sink
    633 imxipu:  imxipuvideotransform: Freescale IPU video transform
    634 imxpxp:  imxpxpvideotransform: Freescale PxP video transform
    635 imxpxp:  imxpxpvideosink: Freescale PxP video sink
    636 }}}
    637  * imxipuvideosink:
    638 {{{
    639 #!bash
    640 gst-launch-1.0 videotestsrc ! imxipuvideosink
    641 }}}
    642  * imxg2dvideosink:
    643 {{{
    644 #!bash
    645 gst-launch-1.0 videotestsrc ! imxg2dvideosink
    646 }}}
    647 
    648 See the [wiki:Yocto/gstreamer Gstreamer wiki page] for more details.
    649