Archive for August 2009

Running Android on other hardware

Now that building Donut for Dream is not working at the moment (because of the prioritary files) and it is unkown if it will be possible (because of the memory size on the device) I become interested in porting Android to different hardware.

It would be nice to have hardware with the complete specifications. This way there is no (or less) problem with proprietary files because code can be written to implement these parts (because of the hardware specification available). This would be great to expand my knowledge about Android (and the linux kernel) which is currently not that big.

I was looking at some hardware and found two options: the beagleboard or the chumby. Both devices don’t have a GSM radio stack but maybe this can be added by the use of an USB device.

Beagleboard

The USB-powered Beagle Board is a low-cost, fan-less single board computer that unleashes laptop-like performance and expandability without the bulk, expense, or noise of typical desktop machines.

Above is the description of the beagleboard (http://www.beagleboard.org) as written on their website. It is a really small piece of hardware (about 7.6 cm) and can be extended with other (USB) hardware. Just like the Dream it also uses an ARM processor.

BEAGLE BOARD

Beagle Board

A small shopping list of hardware that should be bought when using the BeagleBoard can be found at http://code.google.com/p/beagleboard/wiki/BeagleBoardShoppingList Looking at the minimal hardware list, the total price is about $250 without shipping costs(with the current exchangerate of 1.4 this will be 176 EUR). You can lower the price if you buy some parts on eBay (for example the USB HUB with Ethernet http://www.supermediastore.com/gwc-usb-2-0-3-port-hub-ethernet-adapter.html can be found on eBay for 12.50 EUR). BTW with the hardware you don’t have a nice touchscreen.

Beagleboard with connected hardware

Beagleboard with connected hardware

Chumby

The chumby (http://www.chumby.com) is some kind of cute device which can be described as an Internet radio/media player/alarm clock. Because it is a complete product there is already software installed. The Chumby runs linux and makes use of widgets (which are developed in Flash).

Looking at the hardware, the Chumby has an ARM processor, 3.5 inch touchscreen, Wifi connection and sensors (Squeeze and accelerometer). The hardware specification and source code of the Chumby is available (http://www.chumby.com/developers) which makes it a really good starting point for porting Android to the Chumby.

Chumby

Chumby

The price of a Chumby is $199.95 (141 EUR) shipping costs not included. The only problem for me is that I cannot order it to my address in The Netherlands.

What’s next?

I know that there is already some porting done (like for the Beagleboard http://labs.embinux.org/index.php/Android_Porting_Guide_to_Beagle_Board). But let’s be clear, I am more interested in where to start with porting Android and which steps to take than simply run some build scripts. If I know the details of the porting process than I can describe them here as a reference for other devices. BTW I am not trying to reinvent the wheel, so if some porting is done and for me it is clear why that has been done, i might/will use that ported stuff. But it should be clear why and not because somebody else said so.

When looking at the BeagleBoard and the Chumby, my choice goes to the Chumby. In the mean time, while ordering the hardware, I would like to get some pointers of you where to start with porting Android.

Building donut for dream – Second attempt: a home screen

The first attempt was not a success, but based on the discussion at http://groups.google.com/group/android-platform/browse_thread/thread/929aa624d2da63a7 I decided to make another build with less proprietary files.

Before the patch with the extracting and adding of the extra proprietary files was applied on the source tree (master, cupcake and donut) there was a small list of proprietary files. I used that list again with libcamera.so added because otherwise you cannot make a build. I kept the extract-files.sh the same because I doesn’t matter if the files are inside the proprietary directory. I changed the AndroidBoard.mk file  inside the ~/mydroid/vendor/htc/dream-open to this (only showing the htc proprietary section, the rest is kept the same)

# htc proprietary code
#
proprietary := $(LOCAL_PATH)/proprietary

PRODUCT_COPY_FILES += \
   $(proprietary)/akmd:system/bin/akmd

PRODUCT_COPY_FILES += \
   $(proprietary)/AudioFilter.csv:system/etc/AudioFilter.csv \
   $(proprietary)/AudioPara4.csv:system/etc/AudioPara4.csv \
   $(proprietary)/gps.conf:system/etc/gps.conf \
   $(proprietary)/brf6300.bin:system/etc/firmware/brf6300.bin \
   $(proprietary)/tiwlan.ini:system/etc/wifi/tiwlan.ini \
   $(proprietary)/Fw1251r1c.bin:system/etc/wifi/Fw1251r1c.bin

PRODUCT_COPY_FILES += \
   $(proprietary)/libaudioeq.so:system/lib/libaudioeq.so \
   $(proprietary)/libgps.so:system/lib/libgps.so \
   $(proprietary)/libhgl.so:system/lib/libhgl.so \
   $(proprietary)/libhtc_acoustic.so:system/lib/libhtc_acoustic.so \
   $(proprietary)/libhtc_ril.so:system/lib/libhtc_ril.so \
   $(proprietary)/libOmxCore.so:system/lib/libOmxCore.so \
   $(proprietary)/libqcamera.so:system/lib/libqcamera.so \
   $(proprietary)/libcamera.so:system/lib/libcamera.so

PRODUCT_COPY_FILES += \
   $(proprietary)/libgps.so:obj/lib/libgps.so \
   $(proprietary)/libOmxCore.so:obj/lib/libOmxCore.so

After the build is finished, I flashed the images again to the phone and did a reboot. This time donut boots and shows a home screen.

Donut Home Screen

Donut Home Screen

About phone screen

About phone screen

Although the phone boots, you can’t do anything serious with it. For example you cannot make phone calls because the simcard is not recognized. This also prevents the use of 3G connection. When enabling Wifi the system crashes and reboots (and ends in an endless boot sequence because Wifi is set to enabled but cannot be started).  The camera and media playing seems to work fine. But missing the phone functionality makes it not useful.

So next question is, how to get the phone functionality working? When looking at the proprietary files which are not added this time to the image, I did not find one related to this functionality. So is it related to something else or should we search for the solution inside the closed parts of the Android Dev Phone (maybe the radio part)?

If the issue is related to the closed parts of the system, then we should wait for HTC when they provide us with an updated version of the proprietary files. It is a pity that this dependency exists for a open sourced operating system. Shouldn’t it be possible to develop open variants of the proprietary files by looking at the hardware specifications of the Dream?

To be continued… (hopefully soon)

Building donut for dream – First attempt: a black screen

Yesterday I started downloading the source code from the donut branch again to see if it was possible to get it running on the HTC Dream (Android Dev Phone).

I build the source the same way as building cupcake but this time I used the defaults (like the prebuilt kernel and wlan.ko module) and did not change the htc_dream.mk build script.

The libcamera.so proprietary file is needed (and should be extracted from the official image) to make a sucessfull build (succesfull like that it builds). This is a difference with cupcake.

After flashing the phone, it shows the two boot logo’s and than a black screen. Looking at the debug information (shown inside logcat within Eclipse) you can see that there is an endless loop whereby android crash (the system_server) and is started over again (and crash… etc). Some of the errors are shown in this discussion (http://groups.google.com/group/android-platform/browse_thread/thread/929aa624d2da63a7).

So not a bootable donut version yet. For the record the steps I took

Initialize repo and get the source

cd ~
mkdir mydroid
cd mydroid
repo init -u git://android.git.kernel.org/platform/manifest.git -b donut
repo sync

Extract proprietary files (after source is downloaded)

cd ~/mydroid/vendor/htc/dream-open
./extractfiles.sh

You can also use the unyaffs method (described in this post http://www.johandekoning.nl/index.php/2009/06/07/building-android-15-getting-the-source/). But don’t forget to copy the libcamera.so from the lib folder

cp ~/htc/lib/libcamera.so ~/mydroid/vendor/htc/dream-open/proprietary/libcamera.so

Build source

Create a buildspec.mk file (inside the ~/mydroid directory) to define that a htc-dream build should be made. Because the prebuilt kernel is used, the file has the following contents:

TARGET_PRODUCT:=htc_dream

Save the file and start the make command from the mydroid directory

make

Flashing the phone

After build is finished flash the image files to your phone within fastboot (more details at http://www.johandekoning.nl/index.php/2009/07/03/building-android-1-5-flashing-the-phone/).

fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot flash userdata userdata.img

And reboot the device

fastboot reboot

Result

Now you will have a non bootable donut version :) I will try a second attempt whereby I use less proprietary files to see if it boots (this suggestion is made in the same discussion about building donut http://groups.google.com/group/android-platform/browse_thread/thread/929aa624d2da63a7)

Proprietary patch is now part of Android source tree

When building Android 1.5 (cupcake) for the HTC Dream (Android Dev Phone), you had to apply patch (10899) with to command

repo download platform/vendor/htc/dream-open 10889/4

But this patch is now part of the android source tree (for the tree different branches: master, cupcake and donut). This will simplify the build process and therefore I will update the blogpost.

There is also the discussion with the different branches (which one to use). Inside the building Android 1.5 posts I use the cupcake-release branch. There is a good explaination about the different branches written by Jean-Baptiste Queru at http://groups.google.com/group/android-platform/browse_thread/thread/3670ed63a7d9e3ab Reading this post I decide from the development perspective to update the blogposts so that the cupcake branch is used.

While there is less development on the cupcake branch, I did not managed to get a working donut build. Will download the source code again in the coming days to perform another build. I will post the results on this blogpost.