Home > AllWinner A1X, Linux, Video > XBMC for Linux on AllWinner A10 Devices? It Works! (Sort of)

XBMC for Linux on AllWinner A10 Devices? It Works! (Sort of)

November 12th, 2012 Leave a comment Go to comments

Following the lack of support by AllWinner for the video engine libraries (CedarX), I had more or less given up on hope XBMC for Linux would ever run properly on AllWinner A10/A13 hardware. But recently, I found out some progress had been made using existing libs, and saw the Pengpod Tablet video showing XBMC running in Linux fairly smoothly.

So I decided to cross-compile XBMC by following the instructions available at http://linux-sunxi.org/XBMC and trying to run it in Linaro ALIP 12.04 rootfs in my Mele A1000. Finally, I managed to cross-compile XBMC, but the performance was very poor in the GUI (6 to 12 fps) and I was unable to play videos and my serial console was flooded with messages like:

[DISP] not supported image0 pixel sequence:216 in img_sw_para_to_reg

[Update: I managed to have XBMC Linux running & playing videos on Mele A1000 by using j1nx image (rootfs + kernel). I would first exhibit the exact same issue I had, but those where fixed:

1. To solve the video playback issue I had to modify script.bin as follows:

fb0_pixel_sequence = 1
fb0_scaler_mode_enable = 0

2. I add to modify XRES/YRES (1024x768) in S99xbmcinit in order to start the UI when outputting to VGA with this image or EGL would failed to initialize.

XBMC (alpha) is currently optimized for 720p (1280x720) resolution, so although I get up to 12 fps using VGA output with 1024x768 resolution, the UI is rendered at over 40 fps when the Mele outputs to HDMI @ 720p.

Source: http://www.j1nx.nl/buildroot-xbmc-on-mele-a1000-allwinner-a10/#comment-1244]

But Jasbir managed to get XBMC armhf running the the Hackberry using an Ubuntu 12.10 armhf image by “Guillaume” and natively compiling XBMC in the Hackberry board. Alternatively, if you’ve got an armel rootfs, you could try xbmca10.deb by Neal Peacock (the person behing the Pengpod Linux tablets).

In this post, I’ll still describe the steps I followed to build and run XBMC in Linaro ALIP rootfs (and hopefully I’ll eventually find the reason behind the performance issue),  ans show Jasbir results with XBMC armhf on the Hackberry.

XBMC ARMHF Build Instructions

Since we want to run XBMC armhf, we’ll first need a Linux image with an armhf rootfs. I’ll use Lianro ALIP 12.10 rootfs, following the hardware packs instructions. Insert an SD card in the build machine, and make it bootable:

wget https://raw.github.com/cnxsoft/a10-tools/master/a1x-media-create.sh
wget http://dl.linux-sunxi.org/nightly/2012.11.06/mele-a1000-vga_hwpack_2012.11.06.7z
wget http://releases.linaro.org/12.10/ubuntu/precise-images/alip/linaro-precise-alip-20121021-453.tar.gz
sudo ./a1x-media-create.sh /dev/sdb mele-a1000-vga_hwpack_2012.11.06.7z linaro-precise-alip-20121021-453.tar.gz

Now remove the SD card from the build machine, and insert it in the Mele A100 (or another A10 device) to install dependencies to build XBMC:

sudo apt-get build-dep xbmc
sudo apt-get install swig default-jre cmake libgtk2.0-bin libssh-dev
sudo apt-get remove libegl1-mesa libegl1-mesa-dev libegl1-mesa-drivers libgles2-mesa libgles2-mesa-dev
sync

Now back to the build machine. Checkout XBMC source code:

mkdir xbmc-linux
cd xbmc-linux
git clone git://github.com/empatzero/xbmca10.git

and extract the image from the SD card and mount the rootfs:

sudo dd if=/dev/sdb2 of=rootfs_xbmc.img
mkdir rootfs
sudo mount -o loop rootfs_xbmc.img rootfs

Create symlinks to the mounted libraries (requires full path):

sudo ln -s /home/jaufranc/edev/mele_a1000/xbmc-linux/rootfs/lib/arm-linux-gnueabihf /lib/arm-linux-gnueabihf
sudo ln -s /home/jaufranc/edev/mele_a1000/xbmc-linux/rootfs/usr/lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf
sudo ln -s /home/jaufranc/edev/mele_a1000/xbmc-linux/rootfs/usr/include/arm-linux-gnueabihf /usr/include/arm-linux-gnueabihf

Enable hard-float in in xbmca10/tools/a10/depends/depends.mk:

USEARMHF=1

and Update the following keys around line 50 in the same file:

#where is your arm rootfs
SDKSTAGE=/home/jaufranc/edev/mele_a1000/xbmc-linux/rootfs
#where is your xbmc install root
XBMCPREFIX=/allwinner/xbmc-pvr-bin$(HF)
#where is your toolchain
TOOLCHAIN=/usr/arm-linux-gnueabi$(HF)

Install some tools required to build XBMC, and create a symlink for the ARM g++ compiler:

sudo apt-get install cmake shtool swig autoconf autotools-dev automake libtool default-jre gawk gperf zip g++-arm-linux-gnueabihf autopoint
sudo ln -s /usr/bin/arm-linux-gnueabihf-g++-4.6 /usr/bin/arm-linux-gnueabihf-g++

Create the tarballs directory in the user’s root directory as well as XBMC install directory:

mkdir ~/tarballs
sudo mkdir -p /allwinner/xbmc-pvr-binhf
sudo chown [user].[user] /allwinner/xbmc-pvr-binhf -R

Replace [user] with your username.

You can now cross-compile XBMC for ARM:

cd xbmca10/tools/a10/depends
make
make -C xbmc
cd ../../..
make install

This will take a little while, and once the build completes, copy XBMC binaries to your SD card:

cp -r /allwinner/xbmc-pvr-binhf /allwinner/xbmc-pvr-binhf

All good! Time to give XBMC a try. Insert the SD card in your A10 device, change some permissions, and run XBMC:

chmod 666 /dev/mali /dev/ump /dev/cedar_dev /dev/disp
chmod -R 666 /dev/input/*
chmod -R 666 /dev/snd/*
export A10HWR=1
cd /allwinner/xbmc-pvr-binhf/lib/xbmc
./xbmc.bin

After a few seconds, you should now be able to access XBMC user interface. In case you have issues, you can have a look at the log in ~/.xbmc/temp/xbmc.log.

XBMC A10 ARMHF Build on the HackBerry

First of all, this is a development version, so you should not expect a perfect user experience. There should be bugs, crashes, missing features and performance might not be optimal yet.

If you want to have a quick look, watch Jasbir video of XBMC armhf on the HackBerry board.

I did try to use Jasbir image on the Mele A1000 (After updating U-Boot and U-Boot SPL) to evaluate the current status of XBMC on A10, but I could only see XBMC boot logo before the system reboot, as XBMC actually terminates, after apparently thinking I pressed some key….

At the current stage of development, XBMC for Linux appears to work pretty well on AllWinner A10 devices, but there is still more work to do before users can enjoy it on their devices.

If you want to give it a try on your hardware, check out Hackberry A10 – XBMC blog post.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

  1. Martin Revert
    November 12th, 2012 at 21:58 | #1

    UI performance is not so far from my Raspberry PI, so it seems very usable. I’m crossing fingers on this!. A big goal would be to have support for most common external wifi usb adapters, specially for A10 hdmi sticks with bad internal wifi implementations (as far as I know that will be all).

  2. November 13th, 2012 at 01:38 | #2

    “wget http://dl.linux-sunxi.org/nightly/latest/mele-a1000-vga_hwpack_2012.11.06.7z

    $ wget http://dl.linux-sunxi.org/nightly/latest/mele-a1000-vga_hwpack_2012.11.06.7z
    –2012-11-12 19:38:10– http://dl.linux-sunxi.org/nightly/latest/mele-a1000-vga_hwpack_2012.11.06.7z
    Resolving dl.linux-sunxi.org… 88.198.34.130, 2a01:4f8:a0:3161::2
    Connecting to dl.linux-sunxi.org|88.198.34.130|:80… connected.
    HTTP request sent, awaiting response… 404 Not Found
    2012-11-12 19:38:10 ERROR 404: Not Found.

  3. November 13th, 2012 at 01:58 | #3

    Also the a1x-media-create.sh script should exit if it does not find 7z (my case).

    Add a set -e for example.

    I also forked your tool to add some banner seperations in the build log:

    https://github.com/zoobab/a10-tools

    And console redirection to a log file is better done with tee:

    now=”`date +%Y%m%d-%H%M%S`”
    logfile=”logs/a1x-media-create_$now.log”
    exec 2>&1> >(tee -a $logfile)

  4. November 13th, 2012 at 09:23 | #4

    @zoobab
    Oups I had written instructions that can only work on the 6th of November 2012! The correct link is http://dl.linux-sunxi.org/nightly/2012.11.06/mele-a1000-vga_hwpack_2012.11.06.7z

    If you’ve modified a1x-media-create.sh for 7z detection, you can submit a pull request if you wish.

    For the console redirection for tee, it will not do what I want, which is only output the steps on the console, and all command line messages to the log file.

    I suppose eventually most people will use the sunxi-bsp – https://github.com/linux-sunxi/sunxi-bsp.
    But for now there’s no hwpack for Mele VGA and Mele server. So my images can still be useful for a big longer.

  5. November 26th, 2012 at 19:33 | #5

    I’ve just updated the post with instructions to have over 40fps in XBMC user interface and playing videos in Mele A1000.

  6. November 28th, 2012 at 16:59 | #6

    @cnxsoft
    As the GUI is drawn directly onto the framebuffer, you might want to have a look at this file;
    https://github.com/huceke/xbmc/blob/8fc6371afffc1b299da975aabd0a3cd4b5b76535/xbmc/windowing/egl/EGLNativeTypeGeneric.cpp

    Have not changed the hardcoded values, but you might want to give it a go and compile it for a test run.

  1. November 12th, 2012 at 23:26 | #1
  2. November 13th, 2012 at 01:11 | #2
  3. November 13th, 2012 at 14:39 | #3
  4. December 27th, 2012 at 16:35 | #4
  5. August 30th, 2013 at 17:40 | #5