Project: Android JB 4.1 with Hardware acceleration


127 posts   Page 1 of 6   1, 2, 3, 4, 5, 6
by chocis » Mon Nov 05, 2012 6:47 pm
Hi, recently I bought RPi to start learning embedded Linux and Android development. Since then it's been super fun :)

Purpose of this topic:

There are few threads going on about Android porting on RPi, but I wanted to start a new one specially for JB and hardware acceleration functionality.


My progress:

I've been successful at building and booting Android AOSP Jelly Bean 4.1 WITHOUT HW acceleration and it looks the same way as the existing CM9 port on http://androidpi.wikia.com . Android boots and then shows error that system GUI has stopped working. BIG thanks to https://github.com/Mathijsz ,because I used his kernel unmodified and thanks to CM, because there were few glitches that needed to be resolved in order for an ARMv6 to compile.


"RPi is too weak to run Android, especially JB" :

1.) I DON'T CARE :) Because from the beginning this project is for learning purposes.
2.) Video from Broadcom with ICS was really smooth, so I think it would be possible to have a good working port.
3.) RPi has now 512MB (mine is 256), and it can be over-clocked to 1Ghz.
4.) In future RPi will probably be upgraded to something more powerful (i.e. ARMv7).


Main goal:

Of course we should somehow get this hardware acceleration working, because from reading the posts, I understand that is the reason for System UI crash. Is it really possible now that Broadcom userspace is open source?... I really hope so. :)


My background:

Mostly Web development, desktop application development. Recently started working in embedded field, and got interested in Linux and Android source code ( I am a beginner at this).

GAZILLION questions:

Of course I have millions of questions, and if someone knows answer to at least one of them, it would be super great to hear the answer. Anyway I will of course try to find answers my self, and these questions will show you on what I am working now.

HW acceleration related
1.) BEFORE Broadcom Userspace drivers were open source, where did you get them and where you have to put them, for Linux to work (in case I wanted to create my Distribution from scratch)? Are they included somewhere as BLOBS in kernel repository? Or are they added when making Linux distribution somewhere in file system?

2.) Now that they are open source, how can we compile them? Should they be compiled together with kernel? I did take a look to source code of these drivers and there where many android related macroses, so I thought: If I knew how to compile for Linux, then I could configure it to work on Android.

Android GUI related:
3.) When Android boots there is an error that System GUI stopped working. Reading logs there is this information:
Code: Select all
W/dalvikvm(  369): threadid=1: thread exiting with uncaught exception (group=0x40cc7300)
E/AndroidRuntime(  369): FATAL EXCEPTION: main
E/AndroidRuntime(  369): java.lang.RuntimeException: eglConfig not initialized
E/AndroidRuntime(  369):    at com.android.systemui.ImageWallpaper$DrawableEngine.initGL(ImageWallpaper.java:579)

Is this really because Video drivers are not adapted to Android and that's why GUI crashes? Does Andriod >= 4.0 needs double buffering and that's why Gingerbread port isn't crashing?

4.) I tried disabling HW acceleration explicitly, but it still crashed.
init.rc:
Code: Select all
setprop debug.egl.hw 0


Information in log:
Code: Select all
I/SurfaceFlinger(   52): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
W/gralloc (   52): FBIOPUT_VSCREENINFO failed, page flipping not supported
W/gralloc (   52): page flipping not supported (yres_virtual=880, requested=1760)
I/gralloc (   52): using (fd=12)
I/gralloc (   52): id           = BCM2708 FB
I/gralloc (   52): xres         = 1720 px
I/gralloc (   52): yres         = 880 px
I/gralloc (   52): xres_virtual = 1720 px
I/gralloc (   52): yres_virtual = 880 px
I/gralloc (   52): bpp          = 16
I/gralloc (   52): r            = 11:5
I/gralloc (   52): g            =  5:6
I/gralloc (   52): b            =  0:5
I/gralloc (   52): width        = 880 mm (49.645454 dpi)
I/gralloc (   52): height       = 1720 mm (12.995349 dpi)
I/gralloc (   52): refresh rate = 60.00 Hz

I thought maybe this way it shouldn't crash, but it does. Maybe someone can explain why.

5.) Can I start android without GUI? Simply boot into terminal. How?

Android/HDMI resolution related
6.) I am connecting my RPi with TV via HDMI, but the picture is drifted. How can I get it to fit perfectly onto screen and terminal commands could be read? I tried pixel offset, but then android bootimage and lockscreen where screwed up dramatically. Should I play with config.txt? Or this can be configured Android side too? It would be best not to use all the screen, but 50% for example.

7.) Because my TVs resolution is so big, does it influence RPi GPU for rendering image?

DEBUGGING, logging related:
8.) Until now I am using really slow logging method. I wait till Android is booted and then blindly type
Code: Select all
logcat > /data/local/tmp/log.txt

which dumps log infomation into a file, but that is really slow, annoying and not productive way of doing things. Can it be set to somehow log ALWAYS into file, and not only Android log, but dmesg information too? Are there any better alternatives you can suggest?

9.) Is there a way to connect computer with RPi via serial line and debug information via terminal? USB? USB OTG? USB to Serial?

10.) Terminal and GUI are rendered both on TV and they are both flickering. I can't easily use terminal, because it is shown for a second and then goes back to Android GUI. How can I overcome this? GUI on TV, terminal on PC? Or switch between both of them?

Other questions:
11.) When GUI crashes there are other interesting errors in log too:
Code: Select all
E/AndroidRuntime(  433): FATAL EXCEPTION: main
E/AndroidRuntime(  433): java.lang.OutOfMemoryError
E/AndroidRuntime(  433):    at android.graphics.Bitmap.nativeCreate(Native Method)
E/AndroidRuntime(  433):    at android.graphics.Bitmap.createBitmap(Bitmap.java:640)

Maybe the GUI crashes because of low RAM? Or is it result of buggy HW acceleration. Would it be a good idea to create a SWAP space as a file in data partition?


Thank you.
Posts: 10
Joined: Mon Nov 05, 2012 4:41 pm
by Warg » Mon Nov 05, 2012 7:12 pm
I would suggest you join the IRC-channel (#razdroid on irc.freenode.net, (clicky clicky web link, enter #razdroid as channel and a nickname for, well, nick)) and asking us there, as I'm not really in the mood to post a wall of text at the moment.

//Warg
Posts: 20
Joined: Thu Jul 05, 2012 8:47 pm
Location: Sweden
by Ray_GTI-R » Fri Nov 09, 2012 12:36 am
Hi chocis.

There are few threads going on about Android porting on RPi
Yes although as you probably know, very little progress. By that I mean lots of people seem to have tried with almost no news about what's in the pipeline/timeline(s). What sucess there has been so far is proclaimed in the Press as "unusable" as recently as 3 weeks ago. I got one of these Android versions running on the RPi but it was hopeless. Then there's that "boots, fast but without AudioFlinger" or somesuch update that's a circular loop and no link to an actual app.
Of course we should somehow get this hardware acceleration working
Absolutely right.
I have an ODROID-X (launched after the RPi) that I got an Android OS working .img working OK 1st time, running nativeboinc 24/7, overclocked to 1.6ghz, no clever suff on my part. I just press buttons until stuff works.

From the tiny bits of info on Android on the RPi and the ODROID that I've tried to understand with my simple mind it seems to me that "drivers" such as Broadcom hardware acceleration must be integrated with the kernel. (Drivers/packages viz Windows/Unix just don't seem to work the same way in Android. An Android app appears to work just like, say, a Windows program in that it expects everything that it needs in order to run to already exist in the Android OS. If what it needs isn't there in the OS it'll panic.)

FWIW it seems that overclocking the ARM etc when running Android is "a nighmare" on certain (superceded) kernels as the programming was, well, we wouldn't start from here - that from a senior developer.
User avatar
Posts: 96
Joined: Fri Mar 09, 2012 1:21 am
by jamesh » Fri Nov 09, 2012 9:17 am
Not really much point in comparing O-DROID with Raspi Android - O-DROID was always intended as an Android device, and Android was ported on to it before release. Which is why it works now.

Android is pretty low priority for the Raspi - it's not its primary OS, and we have more important educational stuff to do, so I'm afraid patience is what is required.

What's needed are libraries for various features, that use the GPU for acceleration rather than relying the CPU - surface flinger, gralloc, camera etc etc. These do exist for the Videocore on other SoC's, and the GPU firmware on the Raspi does support all the features needed for Android acceleration. It's a matter of finding the time to plumb it all together.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11580
Joined: Sat Jul 30, 2011 7:41 pm
by Warg » Fri Nov 09, 2012 9:48 am
Hello, Ray_GTI-R. I am Warg from the Razdroid project, and I've decided to answer a few of your "complaints"/issues with our handling of things.

Yes although as you probably know, very little progress. By that I mean lots of people seem to have tried with almost no news about what's in the pipeline/timeline(s).

Define progress. There's been very little in terms of actual, runnable, libraries, yes, but that is to be expected when none of us working on this have:
  • Actual Android-porting experience
  • Driver-library writing experience
  • Time equivalent to that of a full-time job to actually learn the above from scratch
As for timelines etc, we honestly have no idea when anything will be in a working state and as such, we won't release any form of timeline or anything because we most likely will not be able to meet any deadlines.

What sucess there has been so far is proclaimed in the Press as "unusable" as recently as 3 weeks ago.

Yes, because we haven't properly integrated the VideoCore-libraries yet, so it is very slow. It is a work in progress at this point in time, but not from lack of effort on our side.

Then there's that "boots, fast but without AudioFlinger" or somesuch update that's a circular loop and no link to an actual app.

Because there is no actual app for that. That was in reference to Broadcom's Android video, and their .img has not (yet) been released.


Sorry for derailing this topic a bit.
//Warg
Posts: 20
Joined: Thu Jul 05, 2012 8:47 pm
Location: Sweden
by Ray_GTI-R » Thu Nov 15, 2012 12:17 am
Thanks, Warg, for your gentle progress update.
I did manage to track down a developers' thread here ... http://forum.xda-developers.com/showthr ... ?t=1941992 that helps me understand some of the issues being tackled and specifically clarifies the (old, days ago :o ) issues especially message #5 and message #9 which should reassure / depress respectively all waiting for a release "soon".

I wish you guys & gals all the very best on the way to achieving your target with the RPi.

Ray

(Strange that excellent, thorough, clear & concise progress is hosted off-RPi and takes forever to track down for us, the unwashed masses - well, no longer :twisted: )
User avatar
Posts: 96
Joined: Fri Mar 09, 2012 1:21 am
by jamesh » Thu Nov 15, 2012 9:27 am
Ray_GTI-R wrote:Thanks, Warg, for your gentle progress update.
I did manage to track down a developers' thread here ... http://forum.xda-developers.com/showthr ... ?t=1941992 that helps me understand some of the issues being tackled and specifically clarifies the (old, days ago :o ) issues especially message #5 and message #9 which should reassure / depress respectively all waiting for a release "soon".

I wish you guys & gals all the very best on the way to achieving your target with the RPi.

Ray

(Strange that excellent, thorough, clear & concise progress is hosted off-RPi and takes forever to track down for us, the unwashed masses - well, no longer :twisted: )


What do you want, a progress report from the Foundation team working on the Android port?

Well, main problem, there is no Foundation team working on an Android port. Never has been.

So, I can safely report, no progress. Sorry. As I said above, Android is simply NOT a priority for a set of people who volunteer part time when there is much more important stuff that needs dealing with.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11580
Joined: Sat Jul 30, 2011 7:41 pm
by Ray_GTI-R » Fri Nov 16, 2012 12:22 am
As a Moderator that reply falls short of the implicit trust placed in the position of any Moderator. It is antagonistic, truly disappointing by placing unwanted and unintended words in the "mouth" of this author, encouraging a further hostile response.

Therefore the Moderator's reply is respectfully disregarded.

Bump.
Thanks, Warg, for your gentle progress update.
I did manage to track down a developers' thread here ... http://forum.xda-developers.com/showthr ... ?t=1941992 that helps me understand some of the issues being tackled and specifically clarifies the (old, days ago :o ) issues especially message #5 and message #9 which should reassure / depress respectively all waiting for a release "soon".

I wish you guys & gals all the very best on the way to achieving your target with the RPi.

Ray

(Strange that excellent, thorough, clear & concise progress is hosted off-RPi and takes forever to track down for us, the unwashed masses - well, no longer :twisted: )
User avatar
Posts: 96
Joined: Fri Mar 09, 2012 1:21 am
by jamesh » Fri Nov 16, 2012 9:49 am
Ray_GTI-R wrote:As a Moderator that reply falls short of the implicit trust placed in the position of any Moderator. It is antagonistic, truly disappointing by placing unwanted and unintended words in the "mouth" of this author, encouraging a further hostile response.

Therefore the Moderator's reply is respectfully disregarded.

Bump.
Thanks, Warg, for your gentle progress update.
I did manage to track down a developers' thread here ... http://forum.xda-developers.com/showthr ... ?t=1941992 that helps me understand some of the issues being tackled and specifically clarifies the (old, days ago :o ) issues especially message #5 and message #9 which should reassure / depress respectively all waiting for a release "soon".

I wish you guys & gals all the very best on the way to achieving your target with the RPi.

Ray

(Strange that excellent, thorough, clear & concise progress is hosted off-RPi and takes forever to track down for us, the unwashed masses - well, no longer :twisted: )


'Respectfully disregarded'. I would have to disagree with the word respectful - I think your post is entirely disrespectful. You have decided there hasn't been enough reporting on Android on this site, so you had a dig about it. I dug back. Karma.

You can disregard my comment if you want, and choose to believe that the Foundation are spending all their waking hours on an Android port if you wish. But have you considered that the reason there haven't been any reports here on Foundation based Android progress is that THERE HASN'T BEEN ANY PROGRESS? And the reason there isn't any progress is that there isn't actually any one working on it at the moment because there are more important things to do?

Now, there are other people looking on porting Android, and they have their own sites and forums, and I say, good for them. I suggest if you want progress reports on that then you look at their progress reports, and don't expect to find them here, for the simple reason that they are other people progress reports, so why one earth would you expect to find them here? That said, we are happy to do occasional blog posts on progress by third parties, if there actually is any. So far, nothing of real note has been reported to us.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11580
Joined: Sat Jul 30, 2011 7:41 pm
by Ray_GTI-R » Sat Nov 17, 2012 3:34 am
I have deliberately not read your reply in depth as the first sentence was obviously meant to antagonise. Once again, poor action for an adminisrator. In addition, I have carefully noted the general tone/unecessary shouts provided (thanks) and then researched your very, very many recent posts.

I note you use the word "we" quite a lot.

If you really are a RPi foundation member I recommend you review your recent posts hereabouts, take a deep breath and reconsider the tone of your replies as a reflection of the perception that others may have of the Foundation.

For KARMA see http://en.wikipedia.org/wiki/Invocation :idea:

For progress, see elsewhere, as I have freely supplied after much effort. I'm simply trying to help others hereabouts who may be puzzled at the bizzarre situation created by 4/5month old dead-end topics that result in hours of wasted effort/circular links/reinvention of what appears right now to be a square wheel. If that's my fault - hang me!
User avatar
Posts: 96
Joined: Fri Mar 09, 2012 1:21 am
by Ray_GTI-R » Sat Nov 17, 2012 3:55 am
If I have said anything here that is incorrect, I humbly apologise. 8-)
User avatar
Posts: 96
Joined: Fri Mar 09, 2012 1:21 am
by jamesh » Sat Nov 17, 2012 1:15 pm
Ray_GTI-R wrote:I have deliberately not read your reply in depth as the first sentence was obviously meant to antagonise. Once again, poor action for an adminisrator. In addition, I have carefully noted the general tone/unecessary shouts provided (thanks) and then researched your very, very many recent posts.

I note you use the word "we" quite a lot.

If you really are a RPi foundation member I recommend you review your recent posts hereabouts, take a deep breath and reconsider the tone of your replies as a reflection of the perception that others may have of the Foundation.

For KARMA see http://en.wikipedia.org/wiki/Invocation :idea:

For progress, see elsewhere, as I have freely supplied after much effort. I'm simply trying to help others hereabouts who may be puzzled at the bizzarre situation created by 4/5month old dead-end topics that result in hours of wasted effort/circular links/reinvention of what appears right now to be a square wheel. If that's my fault - hang me!


You are quite simply, with your continued digging at a moderator posts, asking for a ban. Is that what you want? We try and keep things civil here, but there are limits to my patience. I re-read my posts and have been civil, albeit slightly sarcastic. Since you, by your own admission have NOT read my all posts, I think it's you who need to consider what they are writing - it's definitely bad form to criticise other poeple post without reading them. Everything I have written, has been, to the best of my knowledge, completely accurate. And tbh, my knowledge, due to working at Broadcom with Eben and knowing him and Liz personally, is quite accurate (not necessarily perfect, as I do not know everything)
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11580
Joined: Sat Jul 30, 2011 7:41 pm
by MorgUK » Wed Nov 21, 2012 11:08 pm
Thanks for ruining the thread..

Good luck OP with your android search!
Waiting for a super-quick XBMC build!
My health forum http://www.thehealthcloud.co.uk/forum.php :)
Posts: 35
Joined: Sun Oct 16, 2011 4:46 pm
Location: Wales
by CoolApps » Thu Nov 22, 2012 9:09 pm
If Quadcomm created a stable port then why is it not officially out? :?:
Android, web, linux, windows and scripting developer
Download Page: caftp.3owl.com
Posts: 21
Joined: Thu Nov 22, 2012 8:43 pm
by aaa801 » Fri Nov 23, 2012 9:36 am
CoolApps wrote:If Quadcomm created a stable port then why is it not officially out? :?:

Because the drivers are not finished
Posts: 427
Joined: Mon Jun 04, 2012 9:06 pm
Location: Berkshire
by ghans » Fri Nov 23, 2012 12:23 pm
And its Broadcom , not Quadcomm. :D

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4409
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by CoolApps » Fri Nov 23, 2012 3:39 pm
ghans wrote:And its Broadcom , not Quadcomm. :D

ghans

Oops, thanks fo correcting me. :)
Android, web, linux, windows and scripting developer
Download Page: caftp.3owl.com
Posts: 21
Joined: Thu Nov 22, 2012 8:43 pm
by CoolApps » Fri Nov 23, 2012 3:40 pm
aaa801 wrote:
CoolApps wrote:If Quadcomm created a stable port then why is it not officially out? :?:

Because the drivers are not finished

Interesting, from the video it seems stable enough, I hope it becomes successful. :D
Android, web, linux, windows and scripting developer
Download Page: caftp.3owl.com
Posts: 21
Joined: Thu Nov 22, 2012 8:43 pm
by nickholtus » Sun Nov 25, 2012 11:34 am
Hi,

i just got a rpi and i am going to work on this too.
i tried to sent the op a pm with some tips and a question, but as i can't send pm's (won't send the pm) i will post some things here:

about the gui: i think this is related to the tripple buffer, that's needed for jellybean. it probaply needs some kernel tweaks to get it working.
also did you edit the ramdisk? (is it present in the kernel?), for jellybean the ramdisk needs a lot of changes, most likely something with init.trace.rc

also: can you upload the sources for me? or maybe the image?

Nick
Posts: 3
Joined: Wed Jul 25, 2012 2:30 pm
by aaa801 » Sun Nov 25, 2012 12:00 pm
nickholtus wrote:Hi,

i just got a rpi and i am going to work on this too.
i tried to sent the op a pm with some tips and a question, but as i can't send pm's (won't send the pm) i will post some things here:

about the gui: i think this is related to the tripple buffer, that's needed for jellybean. it probaply needs some kernel tweaks to get it working.
also did you edit the ramdisk? (is it present in the kernel?), for jellybean the ramdisk needs a lot of changes, most likely something with init.trace.rc

also: can you upload the sources for me? or maybe the image?

Nick


Drop in our irc channel
irc.freenode.net
#razdroid
Posts: 427
Joined: Mon Jun 04, 2012 9:06 pm
Location: Berkshire
by lasloHU » Mon Nov 26, 2012 1:12 pm
support RCA Composite Video Output?
Posts: 13
Joined: Wed Jun 20, 2012 5:00 pm
by tjsooley » Mon Nov 26, 2012 1:39 pm
I would also say check with XDA Developers here. http://forum.xda-developers.com/forumdisplay.php?f=1845 Most of theme are android programming wizards (not apps but the os itself). They want android bad on it and can help.
Posts: 1
Joined: Tue Oct 23, 2012 4:46 pm
by meltwater » Tue Nov 27, 2012 9:54 am
Composite isn't supported it seems.
Shame since I have HDMI here but only network through proxy, and composite at home, but suitable network.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 992
Joined: Tue Oct 18, 2011 11:38 am
by Ray_GTI-R » Wed Nov 28, 2012 2:21 am
OK, I think I've finally gotten my head around this ... the RPi may have clearly-publicly-on-the-forum unannounced, fundamental hardware/firmware issue that prevents any immeninent Android port being usable.

History?

Fingers were badly burned when the Foundation released the message "Android 4.0 is coming!" back in July (31st, 2012). The press announced that existing releases are "unusable" shortly thereafter and as recently as a month ago they said the same thing and keep doing so.

Since July all I've seen is negative news. Developers hit brick walls. Forum posts are circular, pleading, obtuse, repetitious, ignored and/or are hostile to kind requests for any update. Personal messages to the Foundation (Liz) go unanswered.

Prove me wrong, please! Just let everyone know ... we're all grown up hereabouts.
User avatar
Posts: 96
Joined: Fri Mar 09, 2012 1:21 am
by Wizard » Wed Nov 28, 2012 3:43 am
Maby the absence of Android support is down to the fact that it's not at all prio?
I work professionally with Android development at one of the biggest companies that manufactures Android phones and I have never really thought of Android in the same sentence as Raspberry Pi...

Yes it would be nice if Raspberry Pi could run every os - including Amiga OS 4.0 - but that's only a dream and is not feasible.

Since major parts are closed source and no full-time resources are devoted/assigned to produce various drivers etc we can only ask/beg/bribe/etc for new features but never demand.

If you look at the purpose with Raspberry Pi foundation it's all down to availability and learning and whilst linux really fits the bill, Android doesn't IMHO.

I doubt that Raspberry Pi has underlying issues that prevents Android from being ported to it due to own experience with Android bring-ups on new hardware. It's simply lack of time and resources that are in play here and this is quite logical.
The Telecom market is facing a low in business and people are made redundant every day and in those days profit matters more than usual - hence perhaps why none is working with Android at Broadcom? Just a qualified guess ;)

If Android is made available one day I will have a look at it from a graphics perspective but it's not something I wait for...

And please understand that the mods and admins do this out of love for the platform and the foundation, not for the profit (which doesn't exist) or the business.

Sorry for being OT.
Raspberry Pi - finally a worthy replacement for A500!!!
User avatar
Posts: 120
Joined: Sun Aug 19, 2012 4:52 am
Location: Sweden