New XBMC yocto image

Introduction

I am pleased to announce that a new yocto based image (v0.0.3) with my newest XBMC for iMX6 is now available.
This is a Yocto image based upon the dora version (V1.5).
This image takes advantage of the great work from freescale community while adding my own layer for most XBMC related stuff.
Today this release is available for the following devices :

  • Wandboard Dual and Quad
  • Utilite : I have a pro model but it may work on other variants (untested for now)

What’s in it

Basically, this image packages XBMC Gotham Alpha 9 with :

  • iMX6 hw accelerated decoding (VPU) for most standard formats
  • iMX CEC support (for utilite only as wandboards are not properly wired)
  • WIFI configuration thanks to network manager addon
  • Support for HDMI/SPDIF/Analog sound outputs (including passthrough for HDMI and SPDIF)
  • SMB/NFS/uPNP network shares and other standard XBMC features

It is a ARMHF build with 3.0.35_4.1.0 kernel.

Compared to my previous images, it tries to provide better support for developers :

  • Native compilation (gcc and standard dev libraries already installed)
  • Cross compilation (Full SDK provided)
  • Straightforward way to fully rebuild the yocto distro

It also solves some bugs found in the previous images :

  • The transiant black screens are gone
  • The Jump backward and Fast Backward Fast Forward are now OK
  • Many videos are now perfectly smooth and no frame drop occurs (except when the GUI is being opened)
  • Some bugs related to the main XBMC Gotham alpha are fixed in this updated alpha 9 version

Resources

The following sdcard images are available :

  • Wandboard Quad (md5sum f913b2d586e96f8ddaa0d1014720abba)
  • Wandboard Dual (md5sum cc39390ee87de8b8ef806604a79c410a)
  • utilite (md5sum 6a3dae479cccedeae63d692f32cdaba2) (Was updated on 11/20 to solve boot issue some users were faced with)

You can also download :

  • the wandoard Quad RFS alone (md5sum 6494d166591044beba3b27d4d6e889b6)
  • the SDK for x86_64 linux host (md5sum c6ec065ba02add6005f8f4b82b5aa0a9)

Installation

The provided images target 2GiB sdcards.

  • Download the relevant image for you device
  • Extract it by using the xz utility :
xz -dv image_name.bin.xz
  • Burn it on a sdcard by using
dd if=image_name.bin of=/dev/sdx bs=4M

With /dev/sdx being the sdcard device (for instance /dev/sdd)

Optionally, you can use gparted to resize the second partition/FS and benefit from all the available space on your card.

Note that installation on internal SSD for utilite pro is perfectly doable. I will publish the way to do it when the recovery tool from Compulab will be available.

How to use

At startup, XBMC is automatically launched, just have fun…
Be aware that :

  • login is root and password is empty
  • You have a shell on the serial line interface (115200n8)
  • A ssh/scp server is up and running
  • Your wired Ethernet will be configured by DHCP and you can setup wifi thanks to the XBMC nm addon

Known issues

  • Sound saturation still occurs on analog output : Refer to this ticket
  • HDMI passthrough for HD audio is not yet validated
  • live TV support is being worked on but not yet available

Moreover, the Smart packages updater has a few issues in this release :
If the update command

smart update

does not work in spite of working internet connection, then, issue the following commands :

rm -rf /var/lib/smart/
smart channel --add wolf_repo type=rpm-md baseurl=http://www.stephan-rafin.net/rpmhf2

For obscure reasons, smart is fooled in thinking that some basics packages are not installed (while they are ) and fails when it tries to reinstall them…
As a workaround, when you install a package, use the stepped option :

smart install --stepped your_package

and refuse installation of already installed packages…

Bugs Report

This image is still work in progress.
If you experience instabilities, crashes or bugs, please report them to me without being too rude 😉
Known bugs are tracked here
Please when you report a bug :

  • Try to be as precise as possible regarding the context.
  • When it occurs, try to download the 2 files :
    • /tmp/temp/xbmc.log
    • /var/log/messages
  • Try to reproduce it

For now, report these bugs on this blog, then we will move to a forum thread may it be the XBMC one or another one if required.
I will create tickets in trac by myself as I have disabled the ability to create tickets for anonymous because of spams.

If you need to send files, I will give you a direct link to upload on my server by mail.
In case I ask you to create a core dump dump here is the way to do it :

  • Stop XBMC
  • login on the board and issue the commands :
echo "/tmp/core.%e.%p" > /proc/sys/kernel/core_pattern
ulimit -c unlimited
/imx6/xbmc/lib/xbmc/xbmc.bin &

Then if XBMC crashes, a file core.* will be created in /tmp folder

Rebuild your own distro

Just issue the following commands on a Linux host to rebuild from scratch the whole distro :

#Install repo
mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

#Create BSP folder
PATH=${PATH}:~/bin
mkdir xbmc-bsp
cd xbmc-bsp

#Download layers
repo init -u https://github.com/wolfgar/fsl-community-bsp-platform -b dora
repo sync

#Initialize build environement
#Valid MACHINE values are wandboard-quad wandboard-dual and utilite
TEMPLATECONF=`pwd`/sources/meta-stef/conf MACHINE=wandboard-quad source setup-environment build

#Let's build the whole thing
bitbake xbmc-image

At the end you will find the image in build/tmp/deploy/images/$MACHINE folder.

Conclusion

That’s all for now, I will focus on liveTV (including hw deinterlacing) and I will investigate the analog sound output issue during the next days.
If you design a iMX6 board/device (Dual ultra or Quad) and would like that I add support to it, please mail me.
At last, if you appreciate my work and want to encourage it, you can consider to click the following button.
Donate Button

geeXboX for utilite

Hi all,

I am happy to announce that utilite is an official target of the brand new geeXboX V3.1.
All my recent work related to XBMC and CEC is now properly packaged in this distro.
I warmly thank the geeXboX team for welcoming me in the team and for allowing utilite to become a supported target.

You can download the image here.

To install this image on a sdcard, please use this make-sdcard script and have a look at the geeXboX documentation

Edit : Following several requests, here is a 4GiB sdcard image ready to be burned -MD5sum is ceab483a976d8f67d4f40882f237ae68-

I know that some of you were expecting such a news and I hope that it will enable for a smooth experience.

Kind regards

XBMC for utilite (CEC support included)

Utilite device

I have already alluded to utilite devices several times (at least here, here and here).

The utilite pro is definitively the best i.MX6 device I currently own for several reasons :

  • It is based on the powerful i.MX6Q with 2Gib of RAM
  • The bootloader is in a dedicated SPI NOR flash (so it is always available)
  • It includes a SanDisk SSD U100 drive which is just a sdcard killer
  • It provides 2 Gbps Ethernet interfaces (one of it being the standard imx6 ENET interface and the other a PCIe intel I211 controller).
  • It comes well packaged in a nice aluminum case (with power button) and accessories (wifi antenna + power supply + S/PDIF coax and uUSB to RS232 cables)
  • It also has an backed RTC (it may appear as a detail but is just another little asset for this product)

(it is worth mentioning that this product is based upon the embedded board cm-fx6 which is properly documented, especially schematics are available)

Some people would argue that it is expensive. Obviously it may seem to be the case when compared to a GK802 stick. But when you have a detailed look at the features, it is simply aligned with the price of comparable devices I guess…

XBMC for utilite

When I released my HardFloat XBMC image, I said I will also release an image for utilite.
So here it is ! This image is special : Not only does it provide my most recent XBMC build for iMX6, but it also features CEC as I mentioned in my previous post
You can download the image from this link – md5sum is cf4523d1e32ebd35faa5264abe3523fb.
Warning : I updated the image on the 30th of September 20:10 GMT because the included XBMC had an issue. Please check carefully your md5sum and download the image again if it is not the good one…

It is a sdcard image : That way you can try it without interfering with your SSD install (of course you will not benefit from the SSD that way but it is a safe and easy way to give a first try at my image)
To get it up and running :

  • Flash the sdcard and insert it in your device
  • Plug the serial line, configure it @115200n8 and power on your device
  • Stop the bootloader by pressing ESC
  • Issue the following commands :
setenv sdargs 'setenv bootargs console=ttymxc3,115200 root=/dev/mmcblk0p2 rootwait video=mxcfb0:dev=hdmi,1920x1080@60,if=RGB24 consoleblank=0' 
setenv start_sd 'mw.l 0x20E0034 0x593A046 ; mmc dev 2 ; fatload mmc 2 0x10800000 uImage-cm-fx6 ; run sdargs ; bootm'
saveenv
  • Then you can boot by issuing the command :
run start_sd

Please note that you will only have to issue the command :

run start_sd

to boot from the sdcard instead of the SSD during the next reboots …

Apart from this, you can refer to my previous post to get more info regarding this image…

i.MX6 CEC

Introduction

According to wikipedia definition : “Consumer Electronics Control (CEC) is an HDMI feature designed to allow the user to command and control up-to 15 CEC-enabled devices, that are connected through HDMI by using only one of their remote controls (for example by controlling a television set, set-top box, and DVD player using only the remote control of the TV). CEC also allows for individual CEC-enabled devices to command and control each other without user intervention.
It is a one-wire bidirectional serial bus that is based on the CENELEC standard AV.link protocol to perform remote control functions.”
Since the Eden release XBMC has support for CEC thanks to libCEC. Besides the freescale i.MX6 SOC is able to handle this bus by itself : There is no need to buy an additional USB device such as this one.
Unfortunately, so far, nobody publicly added i.MX6 CEC support in libCEC. It was a shame and I decided to address this issue.

Development

While developing this missing part, I had to tackle 3 tasks :

  • Finding a hardware platform to develop and test this feature
  • Adding support in libCEC
  • Solving issues with the CEC driver itself

The first item may seem trivial but it is not. Indeed, many iMX6 products/boards do not properly wire the CEC signal.
Here are the info I gathered :

  • Wandboard was reported by a user to have CEC signal unconnected in this comment which refers to wandboard forums
    Edit (october, 12): After lots of comments, I confirm that no wandboard version is properly wired to use CEC (At this time at least). But if you have a wandboard quad and are able to use a soldering iron, then have a look at this thread
  • GK802 is no longer of interest to me : It is a device with no engineering support nor official technical data. It is not properly cooled. It has a very attractive price but, as a developer, I lost enough time with it. CEC signal may be connected or not, I don’t care as I know I will have no resource to understand what happens if it does not work…
  • I also know that nitrogen6x (I don’t own that board by myself) from boundary devices does not expose the CEC signal (thanks to this comment)
  • My utilite pro would have been a perfect device to test CEC. Unfortunately, my device comes from an early batch which was not properly wired (while currently produced devices are all good).

So, at the end, finding the right device for this development was not so easy. Fortunately compulab was kind enough to send me a new utilite from their new batch (and a properly wired CEC signal). I am about to publish a XBMC image with CEC support for utilite as a way to thank them for their support.

Then adding support for a new adapter in libCEC was not so hard : The code is well structured and there is obviously a provision to add new devices.
At some stage, I found that support for existing devices was a little cumbersome but I finally understood that the real culprit was not libCEC but the interface with underlying hardware and that I was able to have a simpler implementation as long as the driver allows for it. Note that, for now, I have not added support to handle several logical addresses at the same time (The hardware allows for it but there is not yet support in the driver for this)

And so we come to the third item : The CEC kernel driver. Freescale provides this driver but I was a little surprised of the current state of this driver (in the their BSP V4.0.0 or V4.1.0). It is supposed to be a simple character device (which is just fine) but I found quite a few shortcomings.

  • First they don’t care about being compliant with the well known POSIX interface :
    The read syscall will immediately return if no data is available even if the device is not opened with the O_NONBLOCK flag.
    This same read syscall will return a false value (ie not the effective number of bytes seen by userspace)
    The write syscall will return 0 if successful while it should return the number of written bytes
    The poll syscall will never state that the device is writable
  • Then they do not properly release the IRQ when the kernel module is unloaded (because of this, you will not be able to reload the module a second time)
  • At last, they use locking in a sometime hazardous way and even copy/paste comments from “vpu” in this driver…

As a conclusion, this driver has not been very carefully developed and is misleading when you try to use it at first time.
But I don’t blame freescale for this : At least they release this driver and, that way, they allow to enhance it. All the more as they also provide an excellent reference manual which describes very well the hardware interface.
So I had to solve the afforded mentioned items in order to use it smoothly from libCEC.

Final thoughts

At the end, I rebuilt XBMC with CEC support and was able to give it a try faced to my panasonic PZ81 TV.
And… it works just fine !
I am able to browse XBMC GUI with my TV remote.
I have already published my changes for libCEC here and will try to mainline them.
Changes for the kernel driver should be released next week.
[Edit : A first (still wip) patch is now public]
Last but not least, all this work is useful only if a product can take advantage of it. So here is a XBMC image which provides XBMC with CEC support targeted at utilite here.

Edit 2014/03/13 : I have moved iMX6 libcec to xbmc-imx6. Enhancement and bug tracking can occur here starting from now…
Edit 2014/04/28 : Other important fixes and port to 3.10 kernel are here

utilite benchmarks

In a previous post, I said I will publish some additional benchmarks regarding utilite product. Unfortunately I had no opportunity to run and publish these benchmarks so far.
That’s why, I am pleased to share with you the comparative benchmarks between Rpi and utilite which have just been updated by Peter on is website.
Beyond these numbers, I would also like to underline that utilite is the only iMX6 product I am aware of which has a real gbps Ethernet controller.
Indeed other iMX6 products only have a Ethernet port connected to the internal ENET interface which is subject to 470 Mbps limitation (total for Tx and Rx) due to internal bus throughput. For details, see the ERR004512 erratum in the i.MX6Dual/6Quad errata document IMX6DQCE. Utilite pro has a second gpbs ethernet interface which is connected to PCIe and which is not subject to this limitation (of course the other port is concerned by the limitation)…

Odds are high I will speak about this device soon as installing an alternative image on SSD may interest some people while the first units are shipped…

ARMHF XBMC image – Part 2

Introduction

As announced in a previous quick post, I have just released a new image for wandboard quad.

What’s in it

This image packages my latest version of XBMC for iMX6. It is built using ARMHF ABI.
This XBMC is derived from a gotham dev branch (which is 4 month old. A sync to catch latest main devs will happen soon).
It exhibits the following features :

  • Hw decoding is available for most codecs which are handled by the iMX6 VPU (noticeable exceptions are RV and AVS standard but they are not so common so it is not a major drawback).
  • codecs which are not directly handled by VPU are available through sw decoding
  • Network shares such as uPNP, SMB, NFS are available
  • RTMP protocol is available
  • Support for bluray has been built in (but tests are required)
  • All sound interfaces are available (HDMI, SPDIF and sgtl5000) and passthrough should work (not yet tested on my side)

How to install

  • Download the compressed (xz) SDcard image – md5sum is 70c39feda421fc4130909127219e27b8.
  • Extract it by using the xz utility :
xz -dv wand.bin.xz
  • Burn it on a sdcard (At least 2GiB) by using
dd if=wand_v0.0.2.bin of=/dev/sdx bs=4M

With /dev/sdx being the sdcard device (for instance /dev/sdd)

How to use

On startup, XBMC is automatically launched, just have fun…
Be aware that :

  • login is root and password is empty
  • You have a shell on the serial line interface
  • A ssh/scp server is up and running

Bugs

This image is still beta and work in progress.
If you experience instabilities, crashes or bugs, please report them to me without being too rude 😉
Known bugs are tracked here
Please when you report a bug :

  • Try to be as precise as possible regarding the context.
  • When it occurs, try to download the 2 files :
    • /tmp/temp/xbmc.log
    • /var/log/messages
  • Try to reproduce it

For now, report these bugs on this blog or in XBMC thread. I will create tickets in trac by myself as I have disabled the ability to create tickets for anonymous because of spams.

If you need to send files, I will give you a direct link to upload on my server by mail.
In case I ask you to create a core dump dump here is the way to do it :

  • Stop XBMC
  • login on the board and issue the commands :
echo "/tmp/core.%e.%p" > /proc/sys/kernel/core_pattern
ulimit -c unlimited
/imx6/xbmc/lib/xbmc/xbmc.bin &

Then if XBMC crashes, a file core.* will be created in /tmp folder

Updates

A package manager (smart) is installed and will enable future updates.

First additional package is NTP client which is not already installed in the image. So, if you want a NTP client please issue the following commands on your board :

smart update
smart install ntp ntp-utils

What next ?

Of course stability is a must have and I will do my best to improve it by investigating and hopefully by solving reported bugs.
Then, regarding new features, my current priorities for the days to come are :

  • Sync with main gotham dev branch
  • Add support for liveTV
  • Add support for LIRC
  • Port libCEC on iMX6 to provide support in XBMC (not possible for wandboard as CEC pin is not connected, thanks to hste for pointing this. I will check if other products have connected this pin or not…)

I will also provide images ready to use for other devices than wandboard quad. I mostly think about utilite and maybe GK802 (with special care given the overheating issue) because I own these other products.
(If you want support for another iMX6 board or device and are ready to send to me a free sample then you can contact me.)

ARMHF XMBC image

A new image for Wandboard Quad has just been uploaded [here](https://stephan-rafin.net/owncloud/public.php?service=files&t=9dac4041e962c9e96e21a048c86e71cb)
Early adopters can give it a try.
I will update this post to explain what is new in it.
I will also publish all my specific yocto recipes.
For other targets, do not worry : an image for wandboard dual will be released very soon and a tutorial to install on utilite published…

EDIT : The following

Utilite & XBMC

In a previous post, I shared my first impressions regarding my brand new utilite pro.

I have just managed to get XBMC up and running on this device so it is time for a little update.
First, as I have just alluded : my XBMC build for iMX6 now works on the utilite. Basically, after a few tweaking in the utilite kernel, my whole yocto image runs fine. As compulab seemed to be very interested in getting XBMC up and running (and I shared all my work with them so far), odds are high they will package it in their own sw delivery (This is only my guess, not an official announcement in any way…)
Then, I expressed some fears regarding thermal dissipation when I realized that the case was used as a heatsink. In fact, I had a bad experience with my GK802 stick which exhibits a similar approach with very bad results. At the end, the utilite thermal behavior is correct : Not as good as the wandboard but perfectly acceptable : Using heavily the XBMC GUI for a few minutes enables to reach the following worst core temperature :

  • On the GK802 : 80°C (With an additional heatsink on the case, without it, you trigger the thermal protection at 90°C !)
  • On the wandboard quad : 55°C (The big heatsink is really efficient)
  • On the utilite : 65°C (Safe and far better than the GK802)

Note that the junction temperature of iMX6 (the consumer version) is 105°C and that a kernel driver is in charge of protecting the device against overheating (it handles an interrupt which is triggered when core temp reaches 90°C).
The 65°C worst figure of utilite seems just fine and, as a side note, it surely proves that the main issue with the GK802 is its thermal pad (and not the concept of heat dissipation through its aluminum case)

In my previous post, I also mentioned an issue with the second Ethernet interface. It is now solved thanks to compulab support : My device was one of the first produced units and some eeproms (whose content is required by the ethernet driver) were not properly programmed. No doubt that it will not happen with mass production units…
At last, I still have my little issue with the serial line (bad characters at 115200bps) but not a big deal as reducing the baudrate is a functional workaround. Out of curiosity, I will certainly plug a scope to understand why the reception is so poor at 115200bps…

As a conclusion, almost all my issues are solved and utilite is definitively a great product. It would be even better with a toslink connector for sure but well, I guess many people will be happy with the coax interface and this device has some serious assets with its SSD and its 2 Gbps Ethernet links…
As my yocto RFS is fully compatible, I will release images both for wandboard and for utilite in the future.
Ho, and you can expect a new image very soon : It is almost ready with an updated XBMC (new codecs and improved support for sound devices) and a full HardFloat ABI build. Stay tuned… 😉

First look at utilite

I was lucky enough to receive one of the first utilite pro model out of compulab production line and I thank them for this.
This device is based upon freescale iMX6Q SOC which is, to my mind, one of the best available system on chip to hack around (hence my work to provide XBMC on this chip)

One could think, this is just yet another ARM based device…

Well, of course it is. But this device has some interesting and not so common features.
First, it is a real device packaged in a nice aluminum (I guess) case. So if you are planing to design your own extension board ready to plug on an iMX6 based board, then this device is not for you and you would rather have a look at some other iMX6 development boards (or even, if you wish and are able to design a whole main board, at the FX6 board which is the computer on module board which powers the utilite device). But many people just want a nice box (and they buy or design additional plastic boxes for their development boards). As a real final product, a power supply, an antenna, and some cables (SPDIF coax and uUSB to male DB9 connector) are also provided in the box.
Then, this model features 2 gigabit Ethernet links which make this device a very good candidate for a powerful and low power router.
Another interesting feature is it can be dual headed : Both a HDMI and a DVI monitors/TV can be plugged at the same time with a 1920×1200 maximal resolution (especially, it makes it compatible with two 1080p screens)
And last but not least, it contains a SATA SSD. The official specifications state a 32GB drive but mine is a 64GB, more precisely a SanDisk SSD U100, I don’t know whether the following devices will also have this 64GB drive or not. Anyway, this sata SSD is definitively a major asset compared to other iMX6 devices and boards ! This is the end of slow sdcards which generally make ARM based devices so slow when it comes to disk IOs.
I have just run this trivial little benchmark to quickly check the improvement :

echo performance >  /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
time (dd if=/dev/zero of=./test.bin count=20 bs=4M ; sync)

 

  • On my wandboard with a class 10 usdcard, I get a mean 9.050s duration (write bandwidth of 8.8MBps)
  • On my utilite with the SSD, I get a mean 0.950s duration (write bandwidth of 84.2MBps)

So you really get a x10 factor regarding the sequential write bandwidth ! I will publish more benchmarks later but it is definitively very promising…

Regarding software, the box comes with a preinstalled linaro 11.10 which mostly just works and the desktop is quite responsive.
In fact it seems that this little box could be an alternative computer for desktop : I will perform additional tests to check whether it can really address such a need but it is definitively better than any other ARM based devices (pandaboard, beagleboard, Rpi…) I have been able to try.
So far, I never tried to install a linaro distro on my wandboard so I am unable to evaluate the difference between this utilite device and the wandboard for desktop use. Basically they run the same iMX6Q, but I guess the sata SSD makes a real difference for this use case. Of course some additional tests have to be run to confirm this supposition…

Is everything so perfect with this device ?
Well it is definitively very promising and I will setup an image with a ready to use XBMC in the coming days for sure !
For now, I only have a few remarks :

  • The serial line does not function so well : I often get “bad” (altered) characters. (I use the provided cable faced to a cheap Hl-340 usb-serial adapter. This adapter is not so good but works perfectly faced to the wandboard so there is something with the utilite serial line…) and, at the end, using the serial line is a real pain.
  • The 2nd Ethernet link does not work : I have to investigate and I don’t know what the problem is (hardware or software related). Fact is that only one Ethernet link can be used on my device…
  • There are 2 S/PDIF connectors but no optical (TOSLINK) connector which is disappointing.
  • The case seems to be used to cool the device and tends to become hot. Not a major issue of course. But I had a very bad experience with the GK802 stick which was unable a properly dissipate heat when GPU/VPU/CPU were heavily used (ie while using XBMC) : I really hope that this device will behave better. It is, by far, my major fear…

As a first conclusion, this device is already a great product. It can be used as a powerful network appliance, it will become a great multimedia product (as soon as I package XBMC ;-)) and it may even be used as a desktop computer (To be confirmed)
I hope the 2nd Ethernet link will work with a software update and XBMC will be able to run without overheating : I will keep you informed for sure.
By the time you can follow utilite news on their google+ account.

iMX6 XBMC : What is coming next ?

Hi all,

After releasing an XBMC image for wandboard quad and wandboard dual, some of you could wonder : And next ?

Well, i, fact lots of bug fixes and enhancements are already planed. I have just setup a bug tracker to organize this work.
So, if you are curious you can have a look at my active tickets

And if you find a bug or think about an interesting improvement, you are also very welcome to log your own ticket…

Cheers