Android 4.2 and Linux 3.4 source building

Started by dave-at-axon, January 30, 2014, 03:17:03 PM

Previous topic - Next topic

dave-at-axon

After I modified one of the XML files to remove the SATA configuration, I was able to build both Linux and Android without any errors.

The trouble is that the final img output is rejected by PhoenixSuit so I suspect that the final output is still be created and missing the boot and kernel.

Anyone have anything on how to pack the file for the nand image?

dave-at-axon

#1
OK. Looks like I figured it out. I have not tried it yet but this does appear to build the image. New job for tomorrow.

To complete the build of the nand image, you need to:

cd lichee/tools/pack

./pack -c sun7i -p android -b wing-nck70

This will then build the image and show you the location in red.


PS.. I noticed that the sdram is set for 412 Mhz and this appears to be unstable. Setting this to 384 is much better and boots without issues. This is in the sys_config.fex file for the platform.


[dram_para]
dram_clk = 384


dave-at-axon

More updates (really need to go to bed after this)

pack command after the Android build fails because the -b (board) option is wrong. Change this in the packages.sh file located in the /android4.2/device/softwinner/olinuxino-a20 directory to suit the pack configuration. I tried wing-nck70 but so far it won't boot into Android.I keep getting loads of untracked pid xx exited's in the debug output.

The kernel boots so I am working on it.

Once I finally get this all working, I will write up a webpage and I will provide any files that are needed etc. My sys_config.fex has been taken from the existing working image :)

Scutum

Hello!

Same here. After compiling android from sources I have only a lot of untracked pids. If anyone have a solution please post it here :-)


dave-at-axon

This source doesn't appear to be 100% the same as the one used to build the image on the website. The final size is about 8MB smaller.

I've compared the script.bin on the pre-installed image and it is very different in some areas. DRAM settings are different. UART 6 & 7 are not enabled in the source version either.

I've tried to build with the extracted script.bin after converting it but it doesn't seem to make any difference. I am going to extract all the other rc files etc and compare them today.

I am working on this over the next few days so hopefully we can have a working solution soon.

If anyone else finds anything else in the meantime, then please post it here.

dave-at-axon

OK. A little more digging. Whilst the PID exit's are showing in the serial terminal, start a capture of the serial out and type logcat.

Prepare for a deluge of data. Sifting through this I find this section.


I/ServiceManager( 6206): Waiting for service SurfaceFlinger...
I/SurfaceFlinger( 6228): Using composer version 1.0
W/SurfaceFlinger( 6228): getting VSYNC period from fb HAL: 16784155
I/SurfaceFlinger( 6228): SurfaceFlinger run00.
E/Trace   ( 6228): error opening trace file: No such file or directory (2)
I/SurfaceFlinger( 6228): GraphicBufferAlloc::createGraphicBuffer
W/SurfaceFlinger( 6228): hw_get display module Failed!
D/SurfaceFlinger( 6228): display dispatcher enabled
W/SurfaceFlinger( 6228): wifidisplay dispatcher disable
I/SurfaceFlinger( 6228): GraphicBufferAlloc::createGraphicBuffer
I/SurfaceFlinger( 6228): EGL informations:
I/SurfaceFlinger( 6228): vendor    : Android
I/SurfaceFlinger( 6228): version   : 1.4 Android META-EGL
I/SurfaceFlinger( 6228): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_EXT_create_context_robustness EGL_ANDROID_image_native_buffer
I/SurfaceFlinger( 6228): Client API: OpenGL_ES
I/SurfaceFlinger( 6228): EGLSurface: 8-8-8-8, config=0x60000014
I/SurfaceFlinger( 6228): OpenGL ES informations:
I/SurfaceFlinger( 6228): vendor    : ARM
I/SurfaceFlinger( 6228): renderer  : Mali-400 MP
I/SurfaceFlinger( 6228): version   : OpenGL ES-CM 1.1
I/SurfaceFlinger( 6228): extensions: GL_EXT_debug_marker GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_size_array GL_OES_point_sprite GL_OES_texture_npot GL_OES_query_matrix GL_OES_matrix_palette GL_OES_extended_matrix_palette GL_OES_compressed_ETC1_RGB8_texture GL_OES_EGL_image GL_OES_draw_texture GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_framebuffer_object GL_OES_stencil8 GL_OES_depth24 GL_ARM_rgba8 GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_OES_texture_cube_map GL_EXT_discard_framebuffer GL_EXT_robustness GL_OES_depth_texture_cube_map
I/SurfaceFlinger( 6228): GL_MAX_TEXTURE_SIZE = 4096
I/SurfaceFlinger( 6228): GL_MAX_VIEWPORT_DIMS = 4096 x 4096
D/SurfaceFlinger( 6228): Screen acquired, type=0 flinger=0x40ca3370
F/libc    ( 6228): Fatal signal 11 (SIGSEGV) at 0x00000084 (code=1), thread 6229 (SurfaceFlinger)
I/AwesomePlayer( 1142): setDataSource_l(URL suppressed)
I/ServiceManager( 1142): Waiting for service window...
I/DEBUG   ( 6061): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 6061): Build fingerprint: 'softwinners/olinuxino_a20/olinuxino-a20:4.2.2/JDQ39/20140130:eng/test-keys'
I/DEBUG   ( 6061): Revision: '0'
I/DEBUG   ( 6061): pid: 6228, tid: 6229, name: SurfaceFlinger  >>> /system/bin/surfaceflinger <<<
I/DEBUG   ( 6061): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000084
I/DEBUG   ( 6061):     r0 00000000  r1 00000000  r2 00000000  r3 40b4df60
I/DEBUG   ( 6061):     r4 40b4f3b8  r5 40cc3d80  r6 00000000  r7 00000001
I/DEBUG   ( 6061):     r8 40b4dfe8  r9 00000001  sl 00000000  fp 00000009


There is a segmentation fault appearing here and it appears to be from the graphics driver as this is further down the list.


I/DEBUG   ( 6061): backtrace:
I/DEBUG   ( 6061):     #00  pc 000254c2  /system/lib/libsurfaceflinger.so (android::DisplayDispatcher::startSwapBuffer(int)+5)
I/DEBUG   ( 6061):     #01  pc 0001fdf1  /system/lib/libsurfaceflinger.so (android::DisplayDevice::onSwapBuffersCompleted(android::HWComposer&) const+12)
I/DEBUG   ( 6061):     #02  pc 0002bf9f  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::postFramebuffer()+134)
I/DEBUG   ( 6061):     #03  pc 0002c103  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::doComposition()+158)
I/DEBUG   ( 6061):     #04  pc 0002c331  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::handleMessageRefresh()+52)
I/DEBUG   ( 6061):     #05  pc 0002d093  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::onMessageReceived(int)+58)
I/DEBUG   ( 6061):     #06  pc 00014c53  /system/lib/libutils.so (android::Looper::pollInner(int)+426)
I/DEBUG   ( 6061):     #07  pc 00014d71  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+104)
I/DEBUG   ( 6061):     #08  pc 00027b7d  /system/lib/libsurfaceflinger.so (android::MessageQueue::waitMessage()+40)
I/DEBUG   ( 6061):     #09  pc 000281d5  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::threadLoop()+6)
I/DEBUG   ( 6061):     #10  pc 00011267  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+114)
I/DEBUG   ( 6061):     #11  pc 00010dcd  /system/lib/libutils.so
I/DEBUG   ( 6061):     #12  pc 0000e3d8  /system/lib/libc.so (__thread_entry+72)
I/DEBUG   ( 6061):     #13  pc 0000dac4  /system/lib/libc.so (pthread_create+160)


This repeats further down the logcat. Why I am not sure of yet. :(


dave-at-axon

A little more digging. I ran up the working image and captured the logcat


I/SurfaceFlinger( 1156): SurfaceFlinger is starting
I/SurfaceFlinger( 1156): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
D/libEGL  ( 1156): loaded /system/lib/egl/libEGL_mali.so
D/libEGL  ( 1156): loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL  ( 1156): loaded /system/lib/egl/libGLESv2_mali.so
I/[Gralloc]( 1156): using (fd=16)
I/[Gralloc]( 1156): id           =
I/[Gralloc]( 1156): xres         = 800 px
I/[Gralloc]( 1156): yres         = 480 px
I/[Gralloc]( 1156): xres_virtual = 800 px
I/[Gralloc]( 1156): yres_virtual = 960 px
I/[Gralloc]( 1156): bpp          = 32
I/[Gralloc]( 1156): r            = 16:8
I/[Gralloc]( 1156): g            =  8:8
I/[Gralloc]( 1156): b            =  0:8
I/[Gralloc]( 1156): width        = 127 mm (160.000000 dpi)
I/[Gralloc]( 1156): height       = 76 mm (160.421051 dpi)
I/[Gralloc]( 1156): refresh rate = 59.58 Hz
I/SurfaceFlinger( 1156): Using composer version 1.0
W/SurfaceFlinger( 1156): getting VSYNC period from fb HAL: 16784155
I/SurfaceFlinger( 1156): SurfaceFlinger run00.
E/Trace   ( 1156): error opening trace file: No such file or directory (2)
I/SurfaceFlinger( 1156): GraphicBufferAlloc::createGraphicBuffer
D/display ( 1156): DISPLAY open_display
D/display ( 1156): DISPLAY ctx->mFD_mp: 0
D/display ( 1156): ####disp_init, mode:0,out_type:1,tv_mode:0,app_width:800,app_height:480
D/SurfaceFlinger( 1156): display dispatcher enabled
W/SurfaceFlinger( 1156): wifidisplay dispatcher disable
I/SurfaceFlinger( 1156): GraphicBufferAlloc::createGraphicBuffer
I/SurfaceFlinger( 1156): EGL informations:
I/SurfaceFlinger( 1156): vendor    : Android
I/SurfaceFlinger( 1156): version   : 1.4 Android META-EGL
I/SurfaceFlinger( 1156): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_EXT_create_context_robustness EGL_ANDROID_image_native_buffer
I/SurfaceFlinger( 1156): Client API: OpenGL_ES
I/SurfaceFlinger( 1156): EGLSurface: 8-8-8-8, config=0x60000014
I/SurfaceFlinger( 1156): OpenGL ES informations:
I/SurfaceFlinger( 1156): vendor    : ARM
I/SurfaceFlinger( 1156): renderer  : Mali-400 MP
I/SurfaceFlinger( 1156): version   : OpenGL ES-CM 1.1
I/SurfaceFlinger( 1156): extensions: GL_EXT_debug_marker GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_size_array GL_OES_point_sprite GL_OES_texture_npot GL_OES_query_matrix GL_OES_matrix_palette GL_OES_extended_matrix_palette GL_OES_compressed_ETC1_RGB8_texture GL_OES_EGL_image GL_OES_draw_texture GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_framebuffer_object GL_OES_stencil8 GL_OES_depth24 GL_ARM_rgba8 GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_OES_texture_cube_map GL_EXT_discard_framebuffer GL_EXT_robustness GL_OES_depth_texture_cube_map
I/SurfaceFlinger( 1156): GL_MAX_TEXTURE_SIZE = 4096
I/SurfaceFlinger( 1156): GL_MAX_VIEWPORT_DIMS = 4096 x 4096
D/SurfaceFlinger( 1156): Screen acquired, type=0 flinger=0x417cf370


This line is in the original just before it reports hw_get display module failed. Here it passes.


I/SurfaceFlinger( 1156): GraphicBufferAlloc::createGraphicBuffer



ph.fouquet

At first time you seen have many problems with olimex sources.
For me I prefer to use the source that HeHoPMaJIeH give me at https://drive.google.com/folderview?id=0BzB_M_u_IizEemJzSmpBdmpVbWs&usp=sharing

compilation.txt explain howto used it

tested:

  • stability (more test in come from working in 24h/24h)
  • eternet
  • USB
  • SATA
  • LCD (LVDS connection)
  • Resitive touch screen
  • HDMI (but not improved)

I'm just to start my test but I hope to add more suported device

Philippe

dave-at-axon

Hi Philippe,

Interestingly when you unpack the Olimex image file, this name appears as a directory within it as "HeHoPMaJIeH"

The source that Olimex linked to yesterday does compile and it does load into the NAND, it just doesn't run.

Looking around on Google the segmentation fault is quite common with graphics and one site indicated that this was because the binary is not build for that particular Android version.

I am going back to using the stock image and modifying the script.bin to add the 2 extra serial ports. At least until I can figure out why the source won't run. I need to get on the the main application development ASAP :)

dave-at-axon

Quote from: ph.fouquet on January 31, 2014, 10:20:31 AM
For me I prefer to use the source that HeHoPMaJIeH give me at https://drive.google.com/folderview?id=0BzB_M_u_IizEemJzSmpBdmpVbWs&usp=sharing
Philippe

I tried this tonight but I can't get WiFI or touch screen working. It boots but there is no WiFi driver it says and there is no TS calibration even though I can see the code in the source. I suspect this is a configuration issue.

I tried to modify the script.bin for the existing image to add UART3 and UART4 but they don't appear in the dev directory so I am stuck just now to get a working image. :(

I am going to try and run a compare on this and the latest source from Olimex over the weekend. There has to be something simple here.

The source that Olimex have recently posted I am sure is not the same one used to generate the image they have on the website. If you check the sys_config.fex file that is uses to build the image, UART6 and 7 are not enabled and yet in the image they are. We are still missing something here. Also the SDDRAM speed is wrong.

We really do need the actual source used to build the image so that we can create it and run it on the A20. Then we have a working system we can start to make changes to.

I am looking at a number of these units to build into a commercial design for 2 big projects we are working on but right now I am missing the drivers that I need. The standard board just works and the battery charger etc makes my system ideal for these projects but I need the additional serial ports and to be able to custom build the system. I hope someone is listening and we can get what we need. :)

dave-at-axon

I am convinced that this is because the correct sys_config.fex and sys_partition.fex files are missing for the A20 build.

The pack files points to there being an olimex-a20 config but it is not in the configs directory.

Would Olimex be so kind as to check with the engineer who built the code to see if we can get these files please? The read.me file on the link indicates to use the wing-nck70 but this is not the same as the image script.bin. It has CTP as the touch.

dave-at-axon

I've found a sys_config.fex file on the sunxi website but it still crashes at the surfaceflinger. It does however show the 2 Allwinner splash screens on startup which is more than I have had previously. The bootanimation does not appear as the graphics at that point crashes.

Anyone else having this issue?

dave-at-axon

This is getting very frustrating.

Is anyone else getting the same surfaceflinger error with this build?

This appears at every point the surfaceflinger is starting.


hw_get display module Failed


I've even updated to Ubuntu 12.04 on the recommendation from the Google AOSP website for building the latest versions and then waited 4 hours for the build to complete to find that it crashes at the very same point.


Laihioh Yeh

There are sys_config.fex for a20-olinuxino on https://github.com/linux-sunxi/sunxi-boards/tree/master/sys_config/a20.
I downloaded the file a20-olinuxino_micro.fex and renamed to sys_config.fex.
Then I try to find out sys_partition.fex, but I can not get any one.
I see sys_partition.fex in folder lichee/tools/.../wing-evb-v10, wing-nck70, wing-s738... are very similar.
So I copyed the sys_partition.fex in wing-nck70 to a new folder "olinuxino-a20", which is created manually and put the sys_config.fex into the folder.

Then I can follow the steps on https://www.olimex.com/wiki/A20-OLinuXino-MICRO#How_to_build_the_Android_4.2.2_image_for_A20-OLinuXino-MICRO.3F to make my image.
Thanks for the information on http://mail.olimex.com/forum/index.php?topic=1625.msg7392#msg7392 and http://mail.olimex.com/forum/index.php?topic=2544.msg11025#msg11025.
Finally image sun7i_android_olinuxino-a20.img has hatched out.

The image can be write to a micro SD card with PhoenixSuit, but not to a MMC SD card. :-\
Put on pwr and HDMI to a LCD and it shows me a pink screen.

I think I should check with console, but I have no USB-Serial-Cable at this time.

dave-at-axon

Thanks for the feedback. I suspect you will be crashing in the same place as I am. If you can get a serial cable it will help a lot as you can see all the debug output and run logcat to see additional information.

I'll try out your link tomorrow for the sys_config.fex and report back what I find.

I have tried running from both nand and sdcard and same results.