Page 4 of 11

Re: Porting Android

Posted: Tue Jul 10, 2012 11:23 am
by Mathijs
arturo777 wrote:What exactly does the infamous "colour screen" look like? :idea: I'd like to check that we're seeing the same thing.
Image

I narrowed it down to the CONFIG_ANDROID option. Whenever that one is enabled, I get the colour screen. It's in Device Drivers -> Staging -> Android. Its suboptions don't matter.

Re: Porting Android

Posted: Tue Jul 10, 2012 2:00 pm
by lesderid
Does anyone have a (probably) working filesystem of GB or ICS for the Pi?

Re: Porting Android

Posted: Tue Jul 10, 2012 2:06 pm
by Mathijs
lesderid wrote:Does anyone have a (probably) working filesystem of GB or ICS for the Pi?
You can find one here:
http://forum.xda-developers.com/showpos ... stcount=27

It's outdated but it should work.

Re: Porting Android

Posted: Tue Jul 10, 2012 2:43 pm
by arturo777
Mathijs wrote:I narrowed it down to the CONFIG_ANDROID option. Whenever that one is enabled, I get the colour screen. It's in Device Drivers -> Staging -> Android. Its suboptions don't matter.
Thanks :) Do you know what actually produces the colour screen?

Question: are you try to start a "standard" file system, e.g. Debian, rather than an Android one? If so what sort?

Re: Porting Android

Posted: Tue Jul 10, 2012 2:59 pm
by Mathijs
arturo777 wrote:
Mathijs wrote:I narrowed it down to the CONFIG_ANDROID option. Whenever that one is enabled, I get the colour screen. It's in Device Drivers -> Staging -> Android. Its suboptions don't matter.
Thanks :) Do you know what actually produces the colour screen?

Question: are you try to start a "standard" file system, e.g. Debian, rather than an Android one? If so what sort?
The colour screen is because the firmware was not able to load the kernel. I don't know the specifics, except that the boot process is kind of unusual (firmware gets loaded into GPU, then the CPU gets started later on).

Not sure if I understand your second question right. Do you mean ext4? I extracted the rootfs zip from the link to an ext4 partition. Make sure this is in cmdline.txt on your boot partition:

Code: Select all

root=/dev/mmcblk0p2 rootfstype=ext4 rootwait init=init
If your android partition is not the second partition on your sd card, then you need to alter the root=mmcblk0p2 of course. init=init makes sure the kernel finds the right init file, which is in the root of your android partition.

I haven't tried making my own Android root filesystem, because some changes are needed. Usually it generates a boot.img, system.img, userdata.img, etc. but we'd rather have it all on one to make things easier. This file contains a device tree that apparently generates a root filesystem for a device (the Mini6410) that looks rather similar regarding the SoC.

Re: Porting Android

Posted: Tue Jul 10, 2012 3:12 pm
by lesderid
Same problem here as Mathijs got earlier. Using a 3.3 kernel, booting fine up to "A N D R O I D" and then processes start crashing, ending with something along the lines of "servicemanager crashed 4 times in 4 minutes" and then trying to go into recovery mode.

Why is it crashing though, does Android log it anywhere?

Re: Porting Android

Posted: Tue Jul 10, 2012 3:17 pm
by Warg
lesderid wrote:Why is it crashing though, does Android log it anywhere?
Might only be for apps, but check '/anr/traces.log' as that's where the full traces are logged usually.

Re: Porting Android

Posted: Tue Jul 10, 2012 3:21 pm
by arturo777
The reason I ask about which file system is because apparently an android kernel can be used to start an non-android one. Reading http://elinux.org/Android_on_OMAP#Kernel_configuration, it appears this makes it easier to iron out problems, although if it is failing so early on I guess it is never making it to some sort of /init and is probably dying in the kernel.

What I find really interesting is that then you can chroot to the android /init

Re: Porting Android

Posted: Tue Jul 10, 2012 3:23 pm
by lesderid
Warg wrote:
lesderid wrote:Why is it crashing though, does Android log it anywhere?
Might only be for apps, but check '/anr/traces.log' as that's where the full traces are logged usually.
I can't find such a file, I'm afraid.

Anyway, we should try to compile Android specific for the Pi, it seems to me that this rootfs isn't going to work.

Has anyone created an IRC channel for Android on the Pi yet? That might be a bit better than spamming this thread...

Re: Porting Android

Posted: Tue Jul 10, 2012 3:25 pm
by Mathijs
lesderid wrote:Same problem here as Mathijs got earlier. Using a 3.3 kernel, booting fine up to "A N D R O I D" and then processes start crashing, ending with something along the lines of "servicemanager crashed 4 times in 4 minutes" and then trying to go into recovery mode.

Why is it crashing though, does Android log it anywhere?
I tried google on that error, it is because there is no ipc binder present according to here:
https://groups.google.com/forum/#!topic ... hyOnOdE0DI

Maybe something went wrong with compiling the ipc binder? Did you turn it on at all?

An IRC channel would be great, but I don't know how to make one :oops: .

Re: Porting Android

Posted: Tue Jul 10, 2012 3:27 pm
by lesderid
Mathijs wrote:
An IRC channel would be great, but I don't know how to make one :oops: .
I made one:
Server: irc.rizon.net
Channel: #androidpi
Link: irc://irc.rizon.net/androidpi

Re: Porting Android

Posted: Tue Jul 10, 2012 3:27 pm
by arturo777
lesderid wrote:Why is it crashing though, does Android log it anywhere?
Depending how far along it got, logcat might be working, in which if you've got the android SDK installed, you can use:

Code: Select all

adb logcat
This might be alittle tricker though, as you'd have to connect via ethernet rather than USB, which would require changing the setup a bit:

http://stackoverflow.com/questions/2604 ... er-3623727

Re: Porting Android

Posted: Fri Jul 13, 2012 7:18 am
by ScorpAL
First Jelly Bean port for ARMv6 device ever IS WORKING!

http://maclaw.pl/?p=205

Re: Porting Android

Posted: Fri Jul 13, 2012 9:11 am
by arturo777
I just found another resource about Android platform development that is very interesting reading: A Practical Real-World Approach To Android Platform Development In ODROID. The guide is about getting Android going on the ODROID platform, however many of the issues are the same.

http://com.odroid.com/sigong/nf_file_bo ... -A4&bid=98

Re: Porting Android

Posted: Sat Jul 14, 2012 11:55 am
by Mathijs
Here's a kernel that works in Debian. /dev/binder actually shows up.

http://dl.dropbox.com/u/2806139/kernel. ... ashmem.img

Re: Porting Android

Posted: Tue Jul 17, 2012 7:01 pm
by 6677
t166err wrote:Would the play store be usable on the android port or is that out of bounds ?
no, the play store - although primarily for android which is open source - is not open source. It infact needs a license to be paid in order for it to be included on the device, google do not allow it as an additional download for devices without it either. There are numerous ways of hacking it onto the pi afterwards but the play store filters out app search results based on hardware support and it probably won't recognise the pi so no apps will be returned as compatible. My ZTE blade as it is an ARMv6 device won't show results for ARMv7 apps or apps with a certain screen size requirement etc.

A case where someone did get in trouble for using the play store in an android fork would be cyanogen mod, they included it in their distributions, after google contacted them cyanogen pulled play out of all its builds. Most people use a few workarounds though that allow you to keep apps on your device already when installing cyanogen mod on their handsets, this works with play store aswell.

Re: Porting Android

Posted: Wed Jul 18, 2012 1:18 pm
by LAR
For the ICS port on the Kindle Fire, this was worked around by modifying the device information in Android so that the app store thinks it's a Galaxy Nexus.

Re: Porting Android

Posted: Wed Jul 18, 2012 6:30 pm
by fodi
maybe this can be used for constructing the root file system:
information on the partition layout of the galaxy s
http://forum.xda-developers.com/showthread.php?t=999097

Re: Porting Android

Posted: Thu Jul 19, 2012 8:37 pm
by Mathijs
Update for the people not following the IRC channel (#androidpi at irc.rizon.net).

We are able to boot Android 4.0! There is still one major problem: the framebuffer is interfering with the actual Android interface, making everything unbearably slow and buggy. System UI is crashing too, although these two things may be related. Any help with the framebuffer issue would be appreciated!

Re: Porting Android

Posted: Fri Jul 20, 2012 4:27 am
by zenguz
Hi I saw the good news!

What kernel are you using with Android 4.0?
How this kernel was compiled? can you post your .config?

I downloaded this kernel:
http://dl.dropbox.com/u/2806139/kernel. ... ashmem.img
Boot nice and I would like to compile myself but I need a working .config

Thanks,
Dave

Re: Porting Android

Posted: Fri Jul 20, 2012 5:43 am
by GizmoTheGreen
Nice!

I will join the irc channel after work today (I just started so thats in 8 hours)

Re: Porting Android

Posted: Fri Jul 20, 2012 8:18 am
by Mathijs
Please note that this is not yet in a very usable state!
@ zenguz: The instructions from Casey from headlessandroid should work. Here is my kernel configuration:
http://dl.dropbox.com/u/2806139/kernel.14.img.config

This is a confirmed working kernel:
http://dl.dropbox.com/u/2806139/kernel.14.img

There are kernels based on the linux kernel 3.3 that work too. You can find them here:
http://lesderid.net/RPi/Android/Kernel/

About the actual android version: we use CyanogenMOD 9 (based on ICS). A device tree for the Pi can be found here: http://dl.dropbox.com/u/2806139/rpi.tar.gz.
A small change was needed in build/core/combo/arch/arm/armv6-vfp.mk. You can find it here.
Also, you'll need a small change in init.rc in order to make the userdata and cache partitions work. Here's the init.rc with the changes applied: http://dl.dropbox.com/u/2806139/init.rc

So you will need 4 partitions:
1. boot partition, fat32
2. filesystem partition, this is where the root of android resides, ext4
3. userdata partition, ext4
4. cache partition, ext4

In config.txt on your boot partition, change cmdline.txt to:

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait init=init
If you don't feel like setting this all up, extract and flash this image to an sd card (2gb minimal) just like you would with the debian image:
http://www.4shared.com/archive/m_eBBrh_ ... _2tar.html

Re: Porting Android

Posted: Fri Jul 20, 2012 9:47 am
by CrysisLTU
Video showing this early port: http://www.youtube.com/watch?v=t0MrtlyJOq0

Re: Porting Android

Posted: Fri Jul 20, 2012 10:43 am
by fodi
wow, nice job
you might want to drop in here, probably tehre are some devs in there who know the answers
http://forum.xda-developers.com/forumdisplay.php?f=613 xda android chef forum
http://forum.xda-developers.com/forumdisplay.php?f=1507 xda android development forum

(anyway, Mathijs i sent you a pm last night, but don't know if it has any use or you)

Re: Porting Android

Posted: Fri Jul 20, 2012 1:25 pm
by rza
Please note that this is not yet in a very usable state!
@ zenguz: The instructions from Casey from headlessandroid should work. Here is my kernel configuration:
http://dl.dropbox.com/u/2806139/kernel.14.img.config
How did you fix the colour screen while loading the kernel? What was the problem?