Difference between revisions of "HummingBoard"

From eLinux.org
Jump to: navigation, search
(Configure)
(local.conf)
Line 108: Line 108:
 
                         gstreamer1.0-plugins-imx gstreamer1.0-plugins-ugly-meta \
 
                         gstreamer1.0-plugins-imx gstreamer1.0-plugins-ugly-meta \
 
                         pulseaudio pulseaudio-server \
 
                         pulseaudio pulseaudio-server \
                         alsa-utils alsa-utils-speakertest\
+
                         alsa-utils alsa-utils-speakertest \
 
                         "
 
                         "
  

Revision as of 01:46, 30 July 2015

HummingBoard is an ARM development board with Freescale i.MX6 (ARMv7 architecture) manufactured by SolidRun. Its technical specifications are similar to SolidRun series of small computers Cubox-i. The following models of the board are available: HummingBoard-i1, HummingBoard-i2, and HummingBoard-i2eX.

Getting Started

The following OS image are provided from SolidRun:

  • OPENELEC – A Kodi Media Center
  • Android
  • GeexBox XBMC – A Kodi Media Center
  • Debian Linux by Igor Pečovnik

For more information please visit SolidRun download page.

Yocto

The following tutorial for build a Linux based distribution for HummingBoard (or Cubox-i) with Yocto is based on this article. The tutorial has been tested on Ubuntu 14.04 LTS (Trusty Tahr) and Ubuntu 14.10 (Utopic Unicorn).

Prepare

  • Please ensure that Git and the following packages are installed on the host if you plan to build image with Wayland, Weston and Crosswalk: gawk, wget, git-core, diffstat, unzip, texinfo, gcc-multilib, g++-multilib, build-essential, chrpath, libsdl1.2-dev, xterm, gyp.[1] For example, on Ubuntu you can installed them using the following command:
sudo apt-get install git gawk wget git-core diffstat unzip texinfo \
gcc-multilib g++-multilib build-essential chrpath libsdl1.2-dev xterm gyp
  • Download Poky
git clone -b dizzy git://git.yoctoproject.org/poky.git
  • Download ARM and Freescale layers
    • For Wayland & Weston version 1.5
cd poky
git clone -b dizzy git://git.yoctoproject.org/meta-fsl-arm
git clone -b dizzy git://github.com/Freescale/meta-fsl-arm-extra.git
    • For Wayland & Weston version 1.6
cd poky
git clone -b av-poky https://github.com/konsulko/meta-fsl-arm.git
git clone -b dizzy git://github.com/konsulko/meta-fsl-arm-extra.git
  • Optionally you may add Crosswalk if you want to run standalone HTML5 applications
git clone https://github.com/crosswalk-project/meta-crosswalk.git
git clone https://github.com/konsulko/meta-crosswalk-embedded.git
  • Initialize build directory
source oe-init-build-env

Configure

local.conf

Perform the following modifications of conf/local.conf:

  • Change machine type to cubox-i:
MACHINE ??= "cubox-i"
  • Append the following additional configurations:
PACKAGE_CLASSES ?= "package_rpm"
ACCEPT_FSL_EULA = "1"
LICENSE_FLAGS_WHITELIST = "commercial"
  • Optionally change the following settings to optimize the build depending on the hardware specifications of your build system:
PARALLEL_MAKE ?= "-j 4"
BB_NUMBER_THREADS ?= "4"
  • Optionally append the following configuration if you are building Wayland and Weston
DISTRO_FEATURES_remove = "x11"
  • Optionally append the following configuration if you want to use systemd.
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
MACHINE_FEATURES_remove = "irda"
  • Optionally append the following configuration if you want to save disk space by deleting temporary files after the build
INHERIT += "rm_work"
  • Optionally if you want to build Crosswalk append the following line to the end of the file:
IMAGE_INSTALL_append = " crosswalk"
  • If systemd is enabled add network-eth0-config to the image to make sure eth0 will initialized automatically at boot, for example:
IMAGE_INSTALL_append = " network-eth0-config"
  • Optionally if you want to include gstreamer with video and audio support, append it to IMAGE_INSTALL_append. Check gstreamer user's guide to learn how to verify that it is working on the image for HummingBoard. For example to build Crosswalk and gstreamer use:
IMAGE_INSTALL_append = " crosswalk gstreamer1.0 gstreamer1.0-plugins-imx-meta \
                        gstreamer1.0-plugins-base-meta gstreamer1.0-plugins-good-meta \
                        gstreamer1.0-plugins-bad-meta gstreamer1.0-plugins-good \
                        gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
                        gstreamer1.0-libav gstreamer1.0-plugins-base-playback \
                        gstreamer1.0-meta-base \
                        gstreamer1.0-meta-video \
                        gstreamer1.0-meta-audio \
                        gstreamer1.0-meta-debug \
                        gstreamer1.0-plugins-imx gstreamer1.0-plugins-ugly-meta \
                        pulseaudio pulseaudio-server \
                        alsa-utils alsa-utils-speakertest \
                        "

COMMERCIAL_AUDIO_PLUGINS ?= " \
gst-plugins-ugly-mad \
gst-plugins-ugly-mpegaudioparse \
"
COMMERCIAL_VIDEO_PLUGINS ?= " \
gst-plugins-ugly-mpeg2dec \
gst-plugins-ugly-mpegstream \
gst-plugins-bad-mpegvideoparse \
"
CORE_IMAGE_EXTRA_INSTALL += " \
gst-plugins-base-videotestsrc \
gst-plugins-bad-fbdevsink \
gst-ffmpeg alsa-utils \
gst-plugins-good-isomp4 \
"

bblayers.conf

  • Append the following two lines to BBLAYERS at conf/bblayers.conf:
   /home/test/poky/meta-fsl-arm \
   /home/test/poky/meta-fsl-arm-extra \
  • Append the following lines if you want to enable Crosswalk layers
   /home/test/poky/meta-crosswalk \
   /home/test/poky/meta-crosswalk-embedded \

Build & Run

  • Run the following command to build a minimal image:
bitbake core-image-minimal
  • Alternatively, run the following command to build an Wayland/Weston image with Crosswalk (Crosswalk will be included depending on the configuration at conf/local.conf):
bitbake core-image-weston
  • Alternatively, run the following command to build an image with Crosswalk and X11:
bitbake core-image-sato
  • The build may take up to several hours depending on the technical specifications of the build system. Grab a cup of coffee and when the image is ready go to tmp/deploy/images/cubox-i/. Replace X with the corresponding letter to a microSD card and copy the image to it using the following commands:
cd tmp/deploy/images/cubox-i/
umount /dev/sdX*
dd if=core-image-weston-cubox-i.sdcard of=/dev/sdX bs=4M conv=fsync

Troubleshooting

libsdl-native

Install libsdl-native on the host or just remove it from conf/local.conf if you experience an error similar to the one below. For more information please check Yocto Project Bug 6509.

ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    libsdl-native is set to be ASSUME_PROVIDED but sdl-config can't be found in PATH. Please either install it, or configure qemu not to require sdl.

Gstreamer

Playing Video

To play a video with sound execute the following command:

gst-play-1.0 --interactive --audiosink="pulsesink" --videosink=autodetect foo.mp4

To play a video without sound run the command below:

gst-play-1.0 --interactive --audiosink fakesink --videosink=autodetect foo.mp4
  • The following keyboard commands are supported in interactive mode[2]:
    • SPACE - Pause/Resume playback
    • ARROW UP/DOWN - Volume up/down
    • ARROW LEFT/RIGHT - Seek back/forward
    • > - Skip to next item in playlist
    • < - Go back to previous item in playlist
    • Q, ESC - Quit

i.MX Gstreamer Plugins

After building an image that includes gstreamer, boot it on HummingBoard and execute the following command to verify that i.MX gstreamer plugins have been successfully included:

gst-inspect-1.0 | grep imx

If the gstreamer1.0-plugins-imx is available you will see something like:

imxvpu:  imxvpudec: Freescale VPU video decoder
imxvpu:  imxvpuenc_h263: Freescale VPU h.263 video encoder
imxvpu:  imxvpuenc_h264: Freescale VPU h.264 video encoder
imxvpu:  imxvpuenc_mpeg4: Freescale VPU MPEG-4 video encoder
imxvpu:  imxvpuenc_mjpeg: Freescale VPU motion JPEG video encoder
imxeglvivsink:  imxeglvivsink: Freescale EGL video sink
imxv4l2src:  imxv4l2src: V4L2 CSI Video Source
imxaudio:  imxuniaudiodec: Freescale i.MX uniaudio decoder
imxpxp:  imxpxpvideosink: Freescale PxP video sink
imxpxp:  imxpxpvideotransform: Freescale PxP video transform
imxipu:  imxipuvideotransform: Freescale IPU video transform
imxipu:  imxipuvideosink: Freescale IPU video sink
imxg2d:  imxg2dvideosink: Freescale G2D video sink
imxg2d:  imxg2dvideotransform: Freescale G2D video transform

i.MX VPU

To verify that i.MX VPU is used in the pipeline while playing video using gst-play-1.0 enable debug information and check the output. For example:

gst-play-1.0 --gst-debug=DEBUG --audiosink fakesink --videosink=autodetect foo.mp4 2>&1 >/dev/null | grep "Plugin 'i
mxvpu'"

If i.MX VPU is used the output will be similar to:

0:00:00.631060000  1318  0x1179800 DEBUG           GST_REGISTRY /media/storage/poky-crosswalk/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.1-r0/gstreamer-1.4.1/gst/gstregistrychunks.c:565:gst_registry_chunks_load_feature: Plugin 'imxvpu' feature 'imxvpudec' typename : 'GstElementFactory'
0:00:00.631917000  1318  0x1179800 DEBUG           GST_REGISTRY /media/storage/poky-crosswalk/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.1-r0/gstreamer-1.4.1/gst/gstregistrychunks.c:565:gst_registry_chunks_load_feature: Plugin 'imxvpu' feature 'imxvpuenc_h263' typename : 'GstElementFactory'
0:00:00.634468667  1318  0x1179800 DEBUG           GST_REGISTRY /media/storage/poky-crosswalk/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.1-r0/gstreamer-1.4.1/gst/gstregistrychunks.c:565:gst_registry_chunks_load_feature: Plugin 'imxvpu' feature 'imxvpuenc_h264' typename : 'GstElementFactory'
0:00:00.635288334  1318  0x1179800 DEBUG           GST_REGISTRY /media/storage/poky-crosswalk/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.1-r0/gstreamer-1.4.1/gst/gstregistrychunks.c:565:gst_registry_chunks_load_feature: Plugin 'imxvpu' feature 'imxvpuenc_mpeg4' typename : 'GstElementFactory'
0:00:00.636089334  1318  0x1179800 DEBUG           GST_REGISTRY /media/storage/poky-crosswalk/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.1-r0/gstreamer-1.4.1/gst/gstregistrychunks.c:565:gst_registry_chunks_load_feature: Plugin 'imxvpu' feature 'imxvpuenc_mjpeg' typename : 'GstElementFactory'

Sound

To enable sound for gstreamer perform the following steps:

  • Add the following configurations to conf/local.conf:
IMAGE_INSTALL_append = " crosswalk gstreamer1.0 gstreamer1.0-plugins-imx-meta \
                        gstreamer1.0-plugins-base-meta gstreamer1.0-plugins-good-meta \
                        gstreamer1.0-plugins-bad-meta gstreamer1.0-plugins-good \
                        gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
                        gstreamer1.0-libav gstreamer1.0-plugins-base-playback \
                        gstreamer1.0-meta-base \
                        gstreamer1.0-meta-video \
                        gstreamer1.0-meta-audio \
                        gstreamer1.0-meta-debug \
                        gstreamer1.0-plugins-imx gstreamer1.0-plugins-ugly-meta \
                        pulseaudio pulseaudio-server \
                        alsa-utils alsa-utils-speakertest\
                        "

COMMERCIAL_AUDIO_PLUGINS ?= " \
gst-plugins-ugly-mad \
gst-plugins-ugly-mpegaudioparse \
"
COMMERCIAL_VIDEO_PLUGINS ?= " \
gst-plugins-ugly-mpeg2dec \
gst-plugins-ugly-mpegstream \
gst-plugins-bad-mpegvideoparse \
"
CORE_IMAGE_EXTRA_INSTALL += " \
gst-plugins-base-videotestsrc \
gst-plugins-bad-fbdevsink \
gst-ffmpeg alsa-utils \
gst-plugins-good-isomp4 \
"
  • Configure kernel to have sound over HDMI
bitbake -c menuconfig virtual/kernel
  • From the menu select Device Drivers > Generic Driver Options > Userspace firmware loading support[3] and set it to:
 [*] Include in-kernel firmware blobs in kernel binary
 (imx/sdma/sdma-imx6q.bin) External firmware blobs to build into the kernel binary
  • Save the config and exit
  • Compile the image. For example:
bitbake core-image-weston
  • Boot the image and if pulseaudio has not been already started: add root user to group audio, and launch pulseaudio:
gpasswd -a root audio
pulseaudio --system
  • Quick sound test with gstreamer:
gst-launch-1.0 audiotestsrc ! audioconvert ! audioresample ! pulsesink
  • Play mp3:
gst-launch-1.0 playbin uri=file:///home/root/vivaldi.mp3 audio-sink="pulsesink"

Tizen

There are ongoing efforts for porting Tizen:Common and Tizen IVI with Wayland, Weston and Crosswalk on HummingBoard:

Debugging

It is possible to debug Tizen images on HummingBoard using 3.3V USB to serial cable, such as Olimex USB-Serial-Cable-F, connected to the UART of the board. Follow the instructions below to connect a cable to the board (do it on your own risk, no warranty is provided):

  • The RX line of the cable (GREEN wire if you are using Olimex USB-Serial-Cable-F) should go to pin 8 (TX line) of HummingBoard,
  • The TX line of the cable (RED wire if you are using Olimex USB-Serial-Cable-F) should go to pin 10 (RX line) of HummingBoard,
  • The BLUE wire if you are using Olimex USB-Serial-Cable-F should go to pin 6 (GND line which is also available on pins 9,14,20, and 25) of HummingBoard.


Olimex USB-Serial-Cable-F attached to HummingBoard for debugging through the serial console


Plug the USB connector of the cable to your computer and use your favorite tool for serial communication, for example on Ubuntu and other Linux distributions you may use screen:

sudo screen /dev/ttyUSB0 115200

For more information and details check the article about serial console at SolidRun wiki.

Useful Resources

  • meta-crosswalk-embedded README
  • GST-PLAY-1.0
  • Cubox-I Yocto core-image-sato no audio over HDMI