Archive

Posts Tagged ‘hi802’

Wandboard Quad Unboxing, Getting Started with Android and Linux (via The Yocto Project)

July 25th, 2013 46 comments

After my review of the Wandboard Dual in February, I’ve now received Wanboard Quad development board  powered by Freescale i.MX6 Quad Cortex A9 processor, with 2 GB RAM, HDMI output, Gigabit Ethernet, and SATA. The board is available from several distributors including Mouser ($139), DigiKey ($144.38) and FutureElectronics ($125). I’ll start by showing some unboxing pictures of the board, as well as pictures of Wandboard Dual and Quad side-by-side. Then I’ll explain how to install Android and Linux on the board, build the images from source, run some benchmarks, and test different features.

Wandboard Quad Unboxing

Ive received the board via UPS in a large box that contained the package below. This is exactly the same as Wandboard Dual, except for the sticker.

Wandboard_Quad_package
There’s just the board inside the package, and it would just look like Wandboard Dual with all connectors on the top, and the EDM module at the back, were it not for the massive heatsink to keep i.MX 6Quad cool. One other key difference is that the SATA connector is populated, and you can connect an hard drive. Since there’s no paper documentation, you may want to download and read Wandboard Quad user’s manual and schematics PDF for details.

Wandboard Quad (Click to Enlarge)

Wandboard Quad (Click to Enlarge)

I’ve taken a few picture with Wandboard Quad and Wandboard Dual side and side, and as expect both baseboards are virtually the same.

Wandboard Dual vs Wandboard Quad (Click to Enlarge)

Wandboard Quad (Left) vs Wandboard Dual (Right)  (Click to Enlarge)

The older board (Revision A0) has been replaced with Revision B1 that fixes SPDIF wiring, updates MIPI voltage updated, slightly change USB circuitry, and adds an additional resistor pad option for playing with different I2C channels for audio/HDMI. Another difference is that the fuse is now easily replaceable without soldering involved. I assume all new Wandboard Solo/Dual/Quad now ship with Rev B1. Note that if you’ve got an older revision, there’s an hardware fix for SPDIF.

EDM Boards - Wandboard Dual vs Wandboard Quad (Click to Enlarge)

EDM Boards – Wandboard Dual vs Wandboard Quad (Click to Enlarge)

I’ve removed the heatsink, and taken the EDM module out of the baseboard, and there’s very little difference between the dual and quad modules.

EDM Module - Wandboard Dual (Left) vs Wandboard Quad (Right)

EDM Module – Wandboard Dual (Left) vs Wandboard Quad (Right)

On the back of the module, the key differences are the memory chips: Hynix H5TQ4G63MFR (4Gbit) on the quad version, and Hynix H5TQ2G63BFR (2Gbit) on the dual version. On another note, I can often see people ask if they can buy the EDM module separately, and the answer is yes. The distributors I’ve mentioned at the top of the post sell the modules in pack of 10.

I also tried the casing and Wi-Fi antenna I got with my Wandboard Dual board, and assembly is not a problem despite the extra heatsink. The antenna cable will touch the heatsink, but I’ve been told it’s not an issue, as it’s isolated.
Wandboard_Quad_Enclosure

Installing Android 4.2.2 on Wandboard Quad

Let’s prepare a micro SD card with the latest Android 4.2.2 image. For optimal performance, make sure you use a Class 10 SD card (I’m using ADATA 16GB Class 10 micro SD for testing).

The installation is just the same as with Wandboard Dual, just a different image. Download and extract the file:

wget http://www.wandboard.org/images/downloads/android-4.2.2-wand-quad-20130621.zip
unzip android-4.2.2-wand-quad-20130621.zip

There are 4 files in the archive: The image itself, a short changelog, win32diskimager, and “Source_and_Build_Simple_Howtos.txt”, an how-to explaining how to build Android from source, install Google Play, and flash the image to an SD card.

Insert a micro SD card in your Linux PC (8GB or greater), umount the partition, and flash the image:

The second line is optional, but I had to do this, or Ubuntu would just remount the partitions, and the final dd would fail. I just run “sudo dd if=/dev/zero…” for a few seconds and press control+C.

If you need Google Play, there are a few more steps. Remove and re-insert the micro SD card, download and extract gapps-jb-20130301-signed.zip, and copy Google Play to the micro SD:

If you’re using Windows, you can use Win32DiskImager to flash the image, and adb.exe to transfer Google Play framework to the board, but since you’re using a Linux based system, I really recommend you install Linux, either in dual boot configuration with Windows, or as a virtual machine (e.g. Virtual Box).

Create an Android 4.2.2 Image from source for Wandboard Quad

I haven’t tried this myself, but those are the steps mentioned in the How-to:

Now copy google gapps-jb-20130301-signed.zip to ~/wandboard/Build, and start the build:

Lunch will take a while :), and once this is done you are ready to create an SD card with the right partitions:

and copy the binaries:

You’ve now built and installed Android 4.2.2 image for Wandboard Quad from source all by yourself.

Android 4.2.2 in Wandboard Quad and Antutu & Quadrant Benchmarks

Let’s insert the micro SD in the EDM module slot (under the heatsink), connect an HDMI, Ethernet and serial NULL modem cable, some input device (Mele F10 receiver in the picture below), and the power supply. The most natural way may be to put the heatsink on the table, and have easy access to the connectors as shown below.

Wandboard Quad Will Overheat in This Position

Wandboard Quad Will Overheat in This Position

But don’t do that, it will prevent proper heat dissipation, and your board will overheat and hang. Instead make sure the heatsink points to the ceiling as shown below. In this configuration, I’ve measured 52 degrees Celcius at idle time, and 56 degrees Celcius during benchmarks by pointing an IR Thermometer to the heatsink.

Wandboard_Quad_Connection

If you don’t have a DB9 serial port on your PC, you’ll need an RS232 to USB converter to access the serial console. via programs such as Putty or Minicom.  This is what the boot log looks like for Wandboard Quad.

As with Wandboard Dual, Android is really smooth as long as you use a fast SD card, the system appears to be stable, but there’s still more work to make it a fully functional image, as I encountered a few issues:

  • No HDMI audio on my system
  • Bluetooth can be enabled, but it failed to find my smartphone, and the system is not currently compatible with Sixaxis (to connect PS3 controllers)
  • Video hardware decoding does not work (at least for H.264 and MPEG2).

However, Antutu and Quadrant benchmarks show some impressive progress compared to other i.MX6 Quad / Android 4.0 solutions I tested a few months ago.

Wandboard_Quad_Antutu

In this benchmark, Wandboard Quad is equivalent to Google Nexus 7 based on Tegra 3, and interestingly 3D performance is impressive, whereas it was dismal in Hi802/GK802 mini PC when I tested it, so there seems to have been some dramatic software improvements both with Android (4.0 vs 4.2), and Vivante drivers. The table below shows the performance difference between Wandboard Dual/Android 4.1.2, Hi802/Android 4.0.4 and Wandboard Quad/Android 4.2.2.

Antutu 3.x Tests Wandboard Dual
Android 4.1.2
Hi802
Android 4.0.4
Wandboard Quad
Android 4.2.2
Total 6190 8516 12615
RAM 1032 1619 1477
CPU Integer 1299 2490 2514
CPU float-point 1120 1838 2200
2D Graphics [720×1232] 477 [1280×672] 733 [720×1232] 929
3D Graphics [720×1232] 1771 [1280×672] 1272 [720×1232] 4901
Database IO 280 245 315
SD card write 97 115 87
SD card read 114 204 192
CPU frequency (x2) (x4) 996 MHz (x4)
Date 2013-06-10 2013-01-18 2013-07-24

Quadrant benchmark shows Wandboard Quad (3402) to be a bit slower than Transformer Prime mainly due to the processor benchmark. Wandboard Dual got 2305 points.

Wandboard_Quad_Quadrant

Following the good GPU results, I tried a 3D game that may be challenging to render smoothly: Real Racing 3. The game  is actually very smooth, and at first it looks much better than the RK3188 platforms I’ve tried, but closer inspection shows the game has decided to use a lower quality level… Nevertheless, 3D performance appears to be now much better than when i.MX6 Quad was first release with Android 4.0.4.

Building Linux with the Yocto Project on Wandboard Quad

There are now more and more Linux distributions for Wandboard (Quad): Ubuntu 11.10, Ubuntu 12.04, images built with the Yocto Project or buildroot, Timesys Linux (Wandboard Quad support is work in progress), and recently an XBMC Linux image has popped up. Wandboard boards are also part of mainline U-boot, and will be supported, at least partially, in Linux 3.12.

Since I have already shown how to install Ubuntu 11.10, and build the kernel from the SDK for Wandboard Dual, and using Ubuntu 11.10 or 12.04 on Wandboard Quad is basically the same with a different image, I’ll try something different today with the Yocto Project which allows you to build images fully customized for your project. I’ll mainly follow the instructions on elinux.org.

First let’s get the repo tool:

Add it to the path, and retrieve the source code from Freescale Yocto BSP on github.

Note that we use the development branch (master), because Wandboard Quad was not available for Yocto 1.4 (dylan) release.

Now set the machine to Wandboard Quad, setup the environment, and start the build for a minimal image:

Since all of the sources are downloaded from the Internet and built from scratch (including things like the toolchain), it may take a while depending on your Internet connection, and the performance of your build machine. The full process took three hours on my machine (AMD FX8350 with 16GB RAM). Subsequent builds are much faster.

Once the build is complete you can find the image in ./tmp/deploy/images/core-image-minimal-wandboard-quad.sdcard (28 MB). Just flash it to a micro SD card (32 MB or greater) to try it out:

Replace /dev/sdX by your actual micro SD card device name, e.g. /dev/sdc. I have a USB hard drive attached to my build machine, so I always run lsblk, before running dd in order to double check the device, and avoid losing my precious data, and hating myself for the rest of my life… Once this is done, you probably want to resize the rootfs partition to make full use of your SD card storage capacity with tools such as gparted.

Finally insert the micro SD card into your Wandboard Quad, boot it up, and access the terminal via an HDMI monitor, or a serial console:

Wandboard_Quad_Yocto_Minimal

Here’s the boot log for the minimal image built with Yocto:

If you want an image with a desktop environment, you can run bitbake core-image-sato instead (See SATO UI screenshot). In theory, It’s also possible to build a custom image with XFCE by adding sources/meta-openembedded/meta-xfce to the list of layers, as well as packagegroup-xfce-base, packagegroup-xfce-extended and packagegroup-xfce-multimedia to the list of package groups, either via the command line, or hob, Yocto’s graphical user interface, but for some reasons the build failed when I tried to build an XFCE image via hob for the Wandboard Dual a few weeks ago. I believe the pre-built Yocto image for Wandboard Quad does indeed include XFCE (TBC).

A Preliminary XBMC Image is now Available for Wandboard, GK802

July 19th, 2013 4 comments

Yesterday, Stephan Rafin left a message on Wandboard mailing list saying he had released a preliminary (Linux) XBMC image that can run on Wandboard Quad development board. GPU and VPU acceleration work, but this is still work in progress, so if you want something that just works, this is not for you. But if you just want to give it a try, it should work on any hardware based on Freescale i.MX6, such as Wandboard Dual or GK802 mini PC, with some minor modifications.

If you’ve got a Wandboard Quad board, the installation is straightforward from a Linux machine:

  1. Download the SD card image
  2. Decompress it with xz or 7x:
  3. Dump the resulting to a 2GB or greater microSD card:

    Where /dev/sdx is the sdcard device (e.g. /dev/sdc). You can check with lsblk command.

If you’ve got a machine running Windows only, you can use Win32DiskImager for step 3.

Now insert the microSD card in the EDM module’s SD card slot, and you can run XBMC. The board will get an IP address from DHCP, and you can access the board via SSH or the serial console with root/xbmcpoc as username and password.

There are some known issues.limitations:

  • SPDIF and analog audio output are disabled for now, so that XBMC selects HDMI for audio output.
  • Wifi is untested, and most probably not working

Stephan has made XMBC i.MX6 source code available on github.

I mentioned XBMC should also work on other i.MX6 platforms such as Wandboard Dual, or GK802 / Hi802 mini PC. I haven’t had time to try it, but in theory, you can either the three steps for Wandboard Quad, and update uboot and possibly the VPU firmware file (if not using i.MX 6Quad) for your hardware, or more simple, use an existing working (Linux) SD card for your device, and replace the rootfs with the content from rfs_wand.tgz. If your device is not based on the quad core version of i.MX6 SoC, you may also want to save the content of /lib/firmware/vpu/ to copy it back, after updating the rootfs.

Debian 7.0 Installer for Hi802 / GK802 mini PCs

May 21st, 2013 No comments

We’ve had Ubuntu support on i.MX6 HDMI dongles, specifically HiApad Hi802 and Zealz GK802, for a little while,  but for those who prefer Debian distribution, a Debian installer is now available thanks to Angus Gratton. Bear in mind that 2D/3D GPU acceleration is disabled in order to save 192MB RAM, as this image is mainly destined to server and/or robotic applications. If you need a desktop experience with GPU acceleration, you’d have to use Ubuntu, or you may try enable it in Debian, and see if it works, but this has not been tested.

GK802_Debian

The instructions below are to be used with the internal microSD card, but if you’re ready to hack a bit around, it might be possible to run the installer from an external microSD or USB device thanks to Jasbir’s U-boot multiboot. You’d still need to use an internal microSD, but you’d only have to open the case once only, even if you change OS later on.

Let’s install the Debian installer to a microSD from a Linux PC:

Where [sd_card_device] is the device name of your SD card (e.g. sdc). Always use tools like lsblk or blkid to locate the proper device before using dd to avoid erasing data from your other USB mass storage devices.

You can also do this in a Windows PC via Win32DiskImager.

Now insert the microSD in the internal microSD slot of GK802, connect a keyboard, and power the device. You should be able to access the terminal via the HDMI display or the serial console. You’ll then be directed to install Debian to a microSD or a USB device. Using this method, if you install Debian to a USB drive, you’ll have to delete the installer partition in the microSD.

Angus decided to use an installer instead of simply providing a working image directly, because the steps to create the installer are (mostly) reproducible, and he uploaded the source code to gk802-debian-installer github repo.

Categories: Linux, Linux 3.0, NXP i.MX Tags: debian, gk802, hi802, how-to, Linux

Preliminary Ubuntu 12.04 RootFS for GK802/HI802 mini PC

April 5th, 2013 No comments

After releasing a pretty good Ubuntu 11.10 image with both VPU and GPU acceleration for Freescale i.MX6 based HDMI dongles last month, Jasbir (aka jas-hacks) has released an Ubuntu 12.04 image with GPU support thanks to the help of Octavio (Yocto Project contributor), and Wi-Fi support. It’s possible to select Unity 2D or Xubuntu desktop, and Chromium and Neverball, a 3D ball game, are part of the image. There’s still more work however, as VPU (Video Processing Unit) support is work in progress, Bluetooth does not work yet, and OpenGL ES test programs such as glmark2-es2 or es2gears do not work properly with Xubuntu, even though they do work fine with Unity 2D.

Jasbir uploaded a video showing Neverball 3D game in GK802, and it works pretty good, although the framerate does not seem optimal for now.

If you want to give this image a try, install GK802 Ubuntu 11.10 image first, and follow the instructions below:

  • Download Ubuntu 12.04 rootfs for i.MX6 dongles:
  • Insert the micro SD card into a Linux PC, delete the existing rootfs from the Oneiric image, and extract the new rootfs:
  • Remove micro SD card, insert it in the internal micro SD slot for your mini PC, and power the device up to start Ubuntu 12.04.

If you have questions about the image and/or want to participate in development, feel free to join imx6-dongle developers’ community, and contact developers on #imx6-dongle IRC channel or imx6-dongle mailing list.

Ubuntu 11.10 Image for Hi802 / GK802 is Now Available for Download

March 25th, 2013 27 comments

About 2 weeks ago, Jasbir released an Ubuntu 11.10 image and installation instructions for GK802 and Hi802 mini PCs based on Freescale i.MX6. I could only find time to give it try yesterday and today. I’ll provide the steps I followed to install the image, and my quick first impressions of the stability and performance of this image.

Totem (1080p Video) + Firefox + es2gears + htop running in Ubuntu 11.10 on Hi802 (Click to Enlarge)

Totem (1080p Video) + Firefox + es2gears + htop running in Ubuntu 11.10 on Hi802 (Click to Enlarge)

Installation Instructions

I mainly followed the instructions provided by Jasbir, and run GParted to increased the partition size on my micro SD card. The image is for a 8 GB micro SD, but those instructions should work on 4GB SD card and greater, as the rootfs partition is only 3GB large.

  1. Download the Ubuntu 11.10 image, uboot, as well as the kernel image and modules in a Linux PC:
  2. Copy the image, uboot and the kernel to the micro SD card by typing the commands below:

    Replace /dev/<sd_device> by your actual device. In my case: /dev/sdc. N.B. My 8 GB micro SD is slightly smaller than Jasbir’s image so dd failed with “No space left on device“, but it’s not an issue, as there’s no critical data at the end of the image.
  3. Remove the micro SD from your PC, and reinsert it to automatically mount the rootfs. If it does not automatically mount, you may need to mount it manually (e.g. sudo mount -t vfat /dev/sdc1 /media/ubuntu)
  4. Copy the kernel modules to the rootfs. Replace <sd_mount_pt> by your micro SD mount point (e.g. /media/ubuntu):
  5. Unmount the microSD, and run
    gparted /dev/<sd_device> to resize the root filesystem, as shown below

    Ubuntu GK802 gparted

    GParted failed to run e2fsck properly for an unknown reason, possibly because my micro SD is smaller than the provided image, so I slightly reduced the size of the partition, and it worked OK.

  6. Exit GParted, remove the micro SD from your PC to insert it in the internal microSD slot of your  Hi802 / GK802 mini PC.

Running Ubuntu 11.10 in Hi802

Since this is a development release, and the boot may fail with your configuration, you’d better connect a USB to TTL board to your device to access the serial console. During my first boot, I got to the Ubuntu desktop on my HDMI display (720p), but my USB mouse or keyboard would not work. I’d get no messages (via dmesg) at all when I connected a USB hub, and upon connecting my mouse or keyboard directly in Hi802 USB port, I’d get the message below in the serial console:

rzk2 advised me to try another power supply on #imx6-dongle IRC. After my Droid Stick A2 5V/2A power supply, I tried a 5V/1.2A Nokia power supply, but the device would just keep rebooting, and finally I found another 5V/2A that make the device, my USB hub, mouse, keyboard and me happy 🙂

I could setup Wi-Fi very easily via Ubuntu user interface. As with other boards running Ubuntu + Unity from an SD card, the system is not super responsive but still (sort of) usable. To test the GPU and 2D/3D acceleration, I ran both es2gears and glmark2-es2.

es2gears renders at about 58 fps.

es2gears
EGL_VERSION = 1.4
vertex shader info:
fragment shader info:
info:
821 frames in 5.0 seconds = 164.069 FPS
818 frames in 5.1 seconds = 161.916 FPS
767 frames in 5.1 seconds = 149.893 FPS
511 frames in 5.0 seconds = 101.773 FPS
293 frames in 5.0 seconds = 58.495 FPS
292 frames in 5.0 seconds = 58.295 FPS
292 frames in 5.0 seconds = 58.272 FPS
292 frames in 5.0 seconds = 58.318 FPS
291 frames in 5.0 seconds = 58.107 FPS
293 frames in 5.0 seconds = 58.483 FPS
291 frames in 5.0 seconds = 58.142 FPS

and glmark2-es2 works, but gets a score between 12 and 14, which is quite lower than the score (54) I got on ODROID-X with Ubuntu 12.11 using the same resolution. A lower score was expected, but the difference is quite large, although I’m not sure whether it’s OK to compare glmark2-es2 results on Ubuntu 11.10 and 12.11.

glmark2-es2
=======================================================
glmark2 2012.03
=======================================================
OpenGL Information
GL_VENDOR: Vivante Corporation
GL_RENDERER: GC2000 core
GL_VERSION: OpenGL ES 2.0
=======================================================
[build] use-vbo=false: FPS: 31
[build] use-vbo=true: FPS: 30
[texture] texture-filter=nearest: FPS: 26
[texture] texture-filter=linear: FPS: 18
[texture] texture-filter=mipmap: FPS: 18
[shading] shading=gouraud: FPS: 19
[shading] shading=blinn-phong-inf: FPS: 12
[shading] shading=phong: FPS: 7
[bump] bump-render=high-poly: FPS: 6
[bump] bump-render=normals: FPS: 10
[bump] bump-render=height: FPS: 12
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 5
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 2
[pulsar] light=false:quads=5:texture=false: FPS: 12
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 14
[desktop] effect=shadow:windows=4: FPS: 0
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 10
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 7
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 7
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 14
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 6
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 7
[function] fragment-complexity=low:fragment-steps=5: FPS: 6
[function] fragment-complexity=medium:fragment-steps=5: FPS: 3
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 23
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 30
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 7
=======================================================
glmark2 Score: 12
=======================================================

In some cases, the HDMI display would just become black during 2D/3D testing for a short period of time (1 or 2 seconds).

I then tried video playback in Ubuntu, something I can’t do with any other boards or devices I own. I tried to play videos in Totem directly from a SAMBA share. Big Buck Bunny 480p plays just fine, but the 720p can’t play smoothly. So I copied Big Buck Bunny 1080p (~44 MB) to the micro SD. This took about 44 seconds (1MB/s), which means currently Wi-Fi performance is slower than in Android (1.42 MB/s). However, once I got the video in the micro SD, it could play just fine with low CPU usage.

I’ve performed a final quick test running Firefox, Totem (1080p video), es2gears, and htop at the same time (pictured above). Most of the time the system can manage this workload, but CPU usage is quite high (noticeably because of es2gears), and if you try to interact with Ubuntu while all those run, it’s just very sluggish. For example, if you take a screenshot with “Print Screen”, the pop-up window may take several seconds to appear, and video playback will be extremely choppy.  When I run all those programs at the same time, the system may also end up rebooting automatically.

Yet this is the first image that can boot properly on my HiAPAD Hi802, so this is good progress, and it shows good potential for this hardware. A faster micro SD, and/or replacing Unity with LXDE or XFCE desktop environment esshould greatly improve the responsiveness of the system.

Ubuntu 11.10 on GK802/Hi802 mini PC with 2D/3D and Video Hardware Acceleration

March 3rd, 2013 5 comments

You may remember an Ubuntu 11.10 image was released via Geekbuying early January, but this image would not boot on my Hi802, lacked 2D/3D acceleration, and to my knowledge there hasn’t been any update since then. So hope of proper Linux support on the device was fading, until the community discovered Freescale released patches for i.mx6 HDMI dongles, developers setup the imx6-dongle community, and after a lot of work, mainly by three members: Jasbir, Dmitriy (rz2k) and James, there’s now GPU and VPU support on Ubuntu 11.10.

Here’s a summary of the current status:

  1. Wifi working.
  2. External SD working
  3. Matched IOMUX configuration to align with the Android image.
  4. Stripped out unnecessary device initialisation from the original HDMI dongle source.
  5. Enabled EGL and GLES HW Acceleration in Ubuntu.
  6. Unity desktop might be partially HW accelerated (TBC)

Jasbir uploaded a video to YouTube to show the progress, and it looks pretty good. Firefox loads within a decent period of time, and embedded YouTube videos play fine,  Totem Player can play 720p videos (apparently with HW acceleration), glmark2-es2 is indeed using the GPU, and the system looks reasonably responsive.

The changes have not been pushed to the kernel tree just yet, but this will probably be done later this week. Jasbir explains there’s still more work to handle power management due to the lack of PMIC on the device. Once further progress has been done an image will certainly be released on imx6-dongle mailing list, Jasbir’s blog and this blog.

The system does not appear to be quite as responsive as Ubuntu 12.10 on ODROID-X / Exynos 4412, but I ran the later from an eMMC module which makes the loading times amazingly fast compared to a microSD card, and AFAIK although ODROID boards support 2D/3D hardware acceleration, they still lack hardware video decoding in Linux.

Needless to say this is great progress, and this should open the way to the development of multimedia applications (e.g. XBMC) on i.MX6 mini PCs. If you want to contribute to the development, or just follow its progress, feel free to join imx6-dongle IRC channel.

Developer Community for Freescale i.MX6 HDMI Dongles

February 13th, 2013 19 comments

Last week, I explained how to build U-boot, the kernel, and Android for Freescale i.MX6 HDMI dongle reference platform. Since them, there has been a bit more activity, with Richtechie releasing source code to some ARMTvTech members. However, this source code is very similar to the one released by Freescale, and misses some part present in the kernel config on GK802 such as CONFIG_MACH_MX6Q_RICHTECHIE, and the company clearly does not comply with the GPL. Let’s forget that for now, as Jasbir (who is also behind the Hackberry board) has managed to build and boot the kernel on his mini PC. There’s still more work to do, but at least we have a based to work on. In the meantime, I’ve noticed rz2k, an other developer, was also giving it a try on #arm-netbook Freenode IRC channel, so we decided to setup a few things to facilitate development and communication between developers.

There are now 2 repositories on gihub rz2k account for HI802/GK802 software development:

Assuming, you’ve already installed Linaro toolchain in Ubuntu or another Linux distribution, here’s how to get and build the Linux kernel:

and U-boot:

For both repositories, the git checkout part is not really needed since imx-android-r13.4-ga-hdmidongle is the default branch, and there’s no default config for Hi802/GK802 yet, so “imx6_android_defconfig” and “mx6q_hdmidongle_android_config” are just taken as examples, but this should change soon.

We’ve also setup two communication channels for developers, and anybody is welcomed to join:

Freescale i.MX6 platform holds a lot of promise with GPU and VPU support in Linux, and hopefully, there will be enough traction in the community to make it a great Linux platform.

U-boot, Linux Kernel, and Android Patches for Freescale i.MX6 HDMI TV Dongles

February 6th, 2013 36 comments

We can now get some quad core Android mini PCs (e.g. Hi802, GK802) featuring Freescale i.MX6Q processor, Freescale has released full documentation and source code its development platforms, Hi802 / GK802 HDMI TV dongles are easily hackable, and there’s even an Ubuntu image for the devices. So it looks pretty good ,right? Well almost.. there are some patches and config for GK802 that have not been released by Richtechie, so we can’t modify the  bootloader and Linux kernel. But this may change, as ARMTvTech forum user hste noticed some Freescale i.MX6 HDMI dongle patches om IMX Community website. Even though I’m not sure those are fully compatible with Hi802 / GK802, this could be a starting point. Today, I’ll provide the instructions to build u-boot, the linux kernel and Android ICS with those patches in a machine running Linux 12.04 64-bit.

Patch Sets Descriptions

There are two set of patches that can be applied to R13.4-GA release:

  • hdmidongle_REVB_R13.4_patch-20121115.tgz –  Adds HDMI dongle support in U-boot, the Linux kernel and customize Android 4.0.4 for mini PCs.
  • hdmidongle_REVB_R13.4_patch-20130201.tgz –   Adds support for ldo bypass , uboot fastboot, ntfs, Bluetooth A2DP, fakes an alway full battery, removed the screen locker, and check the video mode. There are also patches for bug fixes for WifiDirect, Wi-Fi performance, uboot mmu, and system stability

A script (revb_dongle_patch_install.sh) is provided to apply 20121115 patches.

Getting Freescale i.MX6 U-boot, Linux kernel and Android source code (R13.4-GA)

Since those patches need to be applied against R13.4-GA, so we need to get the code first. The instructions are explained in section 5 “Get Android Source Code (Android/Kernel/U-Boot)” of R13.4-GA.01_Android_User_Guide.pdf.

First download IMX6_R13.4_ANDROID_SOURCE_CODE (171 MB). After download, you should get a file named imx-android-r13.4-ga.01.tar.gz that includes the documentation, patches, and Mfgtool for Android 4.0.4.

Let’s extract it, extract the (default) patches:

If you don’t have it the repo tool yet download it, and add it to your path:

Now let’s create a working directory (myandroid) and get Android 4.0.4 r1.1 AOSP source code:

repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.4_r1.1
cp ../code/r13.4-ga/default.xml .repo/manifests/default.xml
repo sync

This will take a little while, after or while it’s progressing you can (also) get imx kernel and U-boot source code:

When checking out imx-android-r13.4 branch for the kernel and U-boot, you’ll get messages like:
HEAD is now at c9dfae3… ENGR00224938 HDMI audio: clear HDMI dma done bit before start
HEAD is now at 097643f… ENGR00224313:i.MX6 general:enable CONFIG_CMD_IMXOTP to fix the build error

It just shows the latest commit, so there’s no issue here.

After repo sync is complete, you’ll also need to get some more code:

Now patch all those with R13.4-GA patches:

After a lot of debug output (and warnings), you should see the following message to indicate patching was successful:
**************************************************************
Success: Now you can build the Android code for FSL i.MX platform
**************************************************************

We’re done for this part we now have all source for R13.4-GA release.

Patching R13.4-GA with HDMI dongle patches

We can now patch the code to add HDMI dongle support. I’ll assume you’ve downloaded all 3 files describe at the top of this post to ~/edev/Freescale/imx-android-r13.4-ga directory:

For the second set of patches, you’ll noticed patches 0001 to 0012 have been applied, except 0008 since it’s not needed anymore.

One more step completed. Have a tea break, or drink a beer, since there’s still a bit more work to do.

Building U-Boot, the kernel and Android for Freescale i.MX6 HDMI TV Dongles

I’m probably missing some per-requisites in this part, and most required dependencies were already installed in my PC. You may want to have a look at the post “How to compile Android on Ubuntu 12.04“, and in particular the part about install Sun Java 6 JDK, where you need to download Sun Java 6 JDK, install it, and run update-alternatives:

Now we should be ready to build:

Build Freescale imx6 hdmidongle lunch menu

We can select either hdmidongle_6dq-eng or hdmidongle_6dq-user for the build. The “eng(ineering)” build is a debug build, and the “user” build is a release version. I’ve gone with hdmidongle_6dq-user (15) to try it out.

In theory, we now just need to run make:

However “in theory, there is no difference between theory and practice; In practice, there is”, and I’ve come across a few issues during the build, and if you build in Ubuntu 12.04 64-bit, you may want to perform the following steps before running make.

Some directories are duplicates in the source tree, and the build ends with error such as:

build/core/base_rules.mk:166: *** external/mtd-utils/mtd-utils/mkfs.ubifs: MODULE.HOST.EXECUTABLES.mkfs.ubifs already defined by external/mtd-utils/mkfs.ubifs.  Stop

I fixed it by deleting one of the duplicate in the source:

I found some dependencies missing, so you may have to install:

But the build still failed, so here’s an ugly hack:

Then I got several errors:

error: “_FORTIFY_SOURCE” redefined [-Werror]
make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1

The solution is to edit vi build/core/combo/HOST_linux-x86.mk and edit the corresponding line as follows:

Source: http://code.google.com/p/android/issues/detail?id=20795

External/mesa3d/src/glsl/linker.cpp:1734:59: error: ‘offsetof’ was not declared in this scope make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1

Edit external/mesa3d/src/glsl/linker.cpp and add #include <stddef.h>
Source: http://code.google.com/p/android/issues/detail?id=23206

host C++: liboprofile_pp <= external/oprofile/libpp/arrange_profiles.cpp In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0: external/oprofile/libpp/format_output.h:94:22: error: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive] make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/arrange_profiles.o] Error 1

Edit external/oprofile/libpp/format_output.h and Remove ‘mutable’ from ‘mutable counts_t & counts;’ on line 94 => counts_t & counts;
Source: https://groups.google.com/forum/?fromgroups=#!msg/android-building/2EwtWQTqjdI/eBl1bK-KNM8J

external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type

Edit external/gtest/include/gtest/internal/gtest-param-util.h and add one line:

Source: http://code.google.com/p/android/issues/detail?id=22005

/home/jaufranc/edev/Freescale/imx-android-r13.4-ga/myandroid/external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock’
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] Error 1

Edit vi frameworks/compile/linkloader/Android.mk and rename LOCAL_LDFLAGS to LOCAL_LDLIBS.
Source: https://bugs.launchpad.net/linaro-android/+bug/1018832/comments/6

frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_export_foreach.o] Error 1

Edit frameworks/compile/slang/Android.mk and remove -Werror
Source: http://code.google.com/p/android/issues/detail?id=22006

After all those changes, I was finally able to complete the build with the output in out/target/product/hdmidongle_6dq including the following directories and files:

  • root/ – Root file system (including init, init.rc, etc). Mounted at /
  • system/ – Android system binary/libraries. Mounted at /system.
  • data/ – Android data area. Mounted at /data.
  • recovery/ – Root file system when booting in “recovery” mode.
  • boot.img – Image which includes the kernel zImage, ramdisk, and boot parameters.
  • ramdisk.img – Ramdisk image generated from “root/”.
  • system.img – EXT4 image generated from “system/”. It can be programmed to “SYSTEM” partition on SD/eMMC card with “dd”.
  • userdata.img – EXT4 image generated from “data/”.
  • recovery.img – EXT4 image generated from “recovery/”. It can be programmed to “RECOVERY” partition on SD/eMMC card with “dd”.
  • u-boot-6q.bin – U-Boot image with padding for i.MX 6Quad version of the HDMI dongle.
  • u-boot-6dl.bin – U-Boot image with padding for i.MX 6Dual version of the HDMI dongle.
  • uImage – Kernel image

If you just want to build U-boot and/or the Kernel follow section 5.3 and 5.4 in R13.4-GA.01_Android_User_Guide.pdf. For the kernel there are 5 configs which all seem quite different from GK802 config:

  • imx6_android_defconfig – Android kernel config
  • imx6_defconfig – Linux kernel config
  • imx6_nand_android_defconfig
  • imx6_nand_updater_defconfig
  • imx6_updater_defconfig

To build U-boot for Freescale HDMI dongles, there are over 12 config (6 for i.MX6 dual, 6 for i.MX6 Quad), but the most interesting appear to be mx6q_hdmidongle_android_config and mx6q_hdmidongle_nand_android_config.

That’s all for today, I’ll post more if I, or somebody else, make progress trying it or/and building it for GK802 / Hi802 mini PC.