Sunday, 11 November 2012

Hackberry A10 - XBMC

I spent some time creating a working XBMC image for the Hackberry because of the increased interest generated on the xbmc forum. Firstly a big thanks to numerous contributors (empatzero,rellla,shivansps,gimli) on the xbmc forum for getting the cedar libaries integrated and getting a build-able xbmc for the A10 soc.

The latest compiled version of xbmc is towards the end of this post if just want to download it works on hackberry and should work on any distro with fb support (for non hackberry deployment).

Standard disclaimer at this point, its an unsupported release as there are many untested/non-working features but hopefully gives you a taste of progress or starting point for further improvements. Furthermore there's nothing stopping you getting this running on other A10 devices, at minimum you will need to replace script.bin, uboot and if no ethernet remove this from /etc/network/interfaces otherwise there will be a long delay before you see a command prompt on the screen. Lastly you may also need to replace the kernel.

To start with I took guillaume ubuntu 12.10 (armhf) build and reworked it so that it boots for the Hackberry from an SD card using a 3.0.42+ kernel (revision cbf3d41b7ed513a743854fde1ca0b5c4d0f11610 + my wemac patch). Again thanks to guillaume for such a useful headless build. One of the highlights of this build is that it presents an on screen command console, meaning there is no longer a reliance on ssh for a command shell. The main issue with the build seems to be graphical tearing while editing at the command line, something I can live for now. The build still starts an ssh daemon if you need access through Ethernet (host name is hackberry, try ssh root@hackberry). There's nothing stopping you using the image without xbmc, although it currently it assumes a default resolution of 1280 x 720 which is required by xbmc.

I created an armhf build of xbmc which was compiled on the Hackberry (taking numerous hour to complete, something to leave overnight). I mainly followed the instructions here.

Download the image (its quite large 722Mb) and dd (or equivalent in Windows) to an SD card, the image expands to 4GB but only takes around 2GB and should easily fit on a 4GB card. Repartition the ext3/ext4 partition to make use of the remaining space on your SD card. Instructions to dd the image:

    dd if=xbmc_hackberry.img of=/dev/<device> bs=1M
    sudo sync

You should alter script.bin (on the FAT partition) to contain a different mac address if you intend to use ethernet, more instruction here.

Boot the Hackberry with the newly created SD card and hopefully the command console should appear on your display:

    Ubuntu 12.10 hackberry tty1

    hackberry login :

To logon user/password is root and to start xbmc

    cd /allwinner/xbmc-pvr-binhf/lib 

Fingers crossed the xbmc log should appear followed by the main screen. Plug-in a keyboard/mouse to navigate.

Short video to demonstrate how well it runs (unfortunately no sound as I was using a hdmi to vga adapter).

I tried a 1080p video (.mov) which it played without any problems.

To enable audio,  go to setting and cycle through audio adapters and until sound is heard. For me thiss worked for hdmi and also through the hackberry AV port (the socket nearest to the usb ports).

I couldn't exit xmbc using the menu options, 'Power off System' occasionally worked but dropped to the command line. In the end I resorted to ssh'ing and powering down (shutdown -Ph now).

I compiled a new xbmc version based on commits as of  01-12-2012 from empatzero's repo. Main change as per commit log is:


Download xbmc_01_12_2012.tar.gz, which  contains the contents of the allwinner directory and replace with the existing one on the image. Beware the allwinner directory is owned by root on the image. Copy the downloaded tar file to the hackberry and then untar, example below.

    cd /
    tar xvf xbmc_01_12_2012.tar,gz

For those looking to make modifications or build from source, the repository I used is git:// along with following the instructions here to a greater extent.