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
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.