[resolved] surfaceflinger dies with EGL error

Post Reply
sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

[resolved] surfaceflinger dies with EGL error

Unread post by sang0627 » Sat Dec 21, 2019 4:45 pm

Let me tell a long story short.
I'm trying to containerize android with linux container (LXC/LXD), and it launches ok but fails to display android UI.

I have flashed ubuntu 18.04 onto my odroid-c2 board which runs several containers including kodi container, softap container, etc without problem.
I mean it works fine for ubuntu-based containers.

I built android marshmallow with lunch odroid-c2-eng-64, which is cloned from the branch s905_6.0.1_master of hardkernel git.
Should I have used odroid-c2-eng-32?

Anyway, my android container launches successfully and runs several android components as below.

Code: Select all

user@odroid-c2:~$lxc exec mm -- /system/bin/sh
/system/bin/sh: /system/etc/mkshrc[10]: getprop: not found
root@android:/ # export PATH=$PATH:/sbin:/system/xbin:/system/bin
root@android:/ # ps
PID   USER     TIME   COMMAND
    1 root       0:00 /init --second-stage
  189 root       0:00 /sbin/ueventd
  190 root       0:00 /sbin/watchdogd 10 20
  192 logd       0:00 /system/bin/logd
  194 root       0:00 /system/bin/vold --blkid_context=u:r:blkid:s0 --blkid_untrusted_context=u:r:blkid_untrusted:s0
  199 root       0:00 /sbin/healthd
  200 root       0:00 /system/bin/lmkd
  201 system     0:00 /system/bin/servicemanager
  203 root       0:00 /system/xbin/su --daemon
  209 root       0:03 /system/bin/debuggerd
  210 drm        0:00 /system/bin/drmserver
  212 root       0:00 /system/bin/installd
  213 keystore   0:00 /system/bin/keystore /data/misc/keystore
  214 root       0:00 /system/bin/systemcontrol
  216 root       0:00 /system/bin/pppoe_wrapper
  218 system     0:00 /system/bin/gatekeeperd /data/misc/gatekeeper
  220 root       0:00 /system/xbin/perfprofd
  221 root       0:00 /sbin/adbd --root_seclabel=u:r:su:s0
 1840 root       0:00 /system/bin/sh
 1842 root       0:00 ps
root@android:/ # 
root@android:/ # ls -al /dev/graphics/                                                                              
total 0
drwxr-xr-x    2 root         root                80 Dec 21 07:15 .
drwxr-xr-x   17 root         root             13420 Dec 21 07:15 ..
crw-rw----    1 root         graphics       29,   0 Dec 21 07:15 fb0
crw-rw----    1 root         graphics       29,   1 Dec 21 07:15 fb1
root@android:/ # 
But it fails to initialize egl, thus repeats re-launching surfaceflinger indefinitely.
I attached logcat and tombstone of my android container.
What should I look for to resolve this problem?

I appreciate any comments.

P.S.
According to my googling, a few articles say that kernel version for EGL driver and version of libEGL should match to work appropriately.
Even though I do not use the kernel in android source tree, it is different from my host kernel.
My host kernel is 3.14.79+ built by myself and android source tree has the kernel version of 3.14.29.
Does this difference in revision number matter?
Attachments
tombstone_00.txt
(67.3 KiB) Downloaded 5 times
logcat.txt
(671.77 KiB) Downloaded 5 times
Last edited by sang0627 on Mon Jan 13, 2020 10:24 am, edited 2 times in total.

User avatar
mad_ady
Posts: 7113
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 308 times
Been thanked: 212 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by mad_ady » Sat Dec 21, 2019 5:01 pm

You should try the 3.16 ketnel that comes with ubuntu 18. It's better supported than 3.14.

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Sat Dec 21, 2019 5:05 pm

mad_ady wrote:
Sat Dec 21, 2019 5:01 pm
You should try the 3.16 ketnel that comes with ubuntu 18. It's better supported than 3.14.
well, at the first time, I tried with kernel 3.16 and changed to 3.14 after I saw the version mismatch articles from my googling.
It was the same with 3.16.

User avatar
mad_ady
Posts: 7113
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 308 times
Been thanked: 212 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by mad_ady » Sat Dec 21, 2019 8:03 pm

I know that android needs some specific modules to run - see this article: https://magazine.odroid.com/article/lin ... -in-a-box/

Not sure if it helps with egl, but are you able to run glmark2-es2 on the linux side?

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Sun Dec 22, 2019 4:08 am

mad_ady wrote:
Sat Dec 21, 2019 8:03 pm
I know that android needs some specific modules to run - see this article: https://magazine.odroid.com/article/lin ... -in-a-box/

Not sure if it helps with egl, but are you able to run glmark2-es2 on the linux side?
Thank you for this up-to-date reference.
I enabled two required kernel configs the article mentions, binder and ashmem, when I built my host kernel.
So, I can see those device files in /dev/ of my android container since I mounted them inside container.

In fact, I had already tried anbox on my laptop and odroid-c2.
It worked fine on x86 but failed to run on arm, and anbox outputs that it does not support armhf/arm64 yet when I start anbox manager on my odroid-c2.
In addition, I found that the article you mentioned also says as below.
(i.e. this article seems to be written in 1st Nov which is earlier than my anbox trial.)
"Maybe someone else has more luck in getting Anbox to work on armhf or arm64 ODROIDs I would very much appreciate it."

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Sun Dec 22, 2019 1:43 pm

mad_ady wrote:
Sat Dec 21, 2019 8:03 pm
I know that android needs some specific modules to run - see this article: https://magazine.odroid.com/article/lin ... -in-a-box/

Not sure if it helps with egl, but are you able to run glmark2-es2 on the linux side?
oops, I forgot to reply to your 2nd comment.
Actually, I am using minimal ubuntu image of odroid-c2 and do not use any window manager or graphics library in host side.
My host provides primitive functions for containerization and containers provide user applications like kodi-fb.
This is my first time to use OpenGL-related stuff, thus I don't have glmark2 things in host side.

User avatar
mad_ady
Posts: 7113
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 308 times
Been thanked: 212 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by mad_ady » Sun Dec 22, 2019 7:04 pm

Hmm, I don't know how I can help you further. It sounds like a cool project and hope to see it running (might want to run it on the N2).
I take it /dev/mali exists and has the correct permissions on the android side, right?

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Mon Dec 23, 2019 7:48 am

yes, I can see /dev/mali even though it's permission is world writable.
In addition, my monitor displays "A N D R O I D" graphics fonts which looks like boot logo when it starts and then repeats relaunching surfaceflinger.
(edit: oops, I checked it again and it looks like console fonts not graphics ones.)
I think it means android container can access mali GPU.

Code: Select all

root@android:/ # ls -al /dev/{binder,ashmem,mali}
crw-rw-rw-    1 root         root           10,  60 Dec 22 22:42 /dev/ashmem
crw-rw-rw-    1 root         root           10,  61 Dec 22 22:42 /dev/binder
crw-rw-rw-    1 system       graphics       10,  62 Dec 22 22:42 /dev/mali
root@android:/ # ps
I'll try to build odroid-c2-eng-32 instead of odroid-c2-eng-64 since odroid wiki mentions only 32bit build command but not 64bit one.
And then, I'll try with odroid-n2.

@mad_ady, thank you for all your comments.

User avatar
mad_ady
Posts: 7113
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 308 times
Been thanked: 212 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by mad_ady » Mon Dec 23, 2019 2:12 pm

If that doesn't work, I'd try to replace the ubuntu kernel with the android one (it's a different branch)

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Mon Dec 23, 2019 3:40 pm

mad_ady wrote:
Mon Dec 23, 2019 2:12 pm
If that doesn't work, I'd try to replace the ubuntu kernel with the android one (it's a different branch)
Yes!!! I think that's the one that I should do because I found this log in logcat.
As I mentioned my googling output in my early post of this thread , it seems there is some version mismatch.
Downgrading Ubuntu kernel from 3.16.75 to 3.14.79 does not resolve this version mismatch issue. (android kernel is 3.14.29)

Code: Select all

12-23 06:19:50.195   283   283 I SurfaceFlinger: SurfaceFlinger is starting                                                                                                                                   
12-23 06:19:50.196   283   283 I SurfaceFlinger: SurfaceFlinger's main thread ready to run. Initializing graphics H/W...                                                                                      
12-23 06:19:50.198   283   283 D libEGL  : loaded /system/lib/egl/libGLES_mali.so                                                                                                                             
12-23 06:19:50.234   283   283 E         : ERROR in Mali driver:                                                                                                                                              
12-23 06:19:50.234   283   283 E         :  * Device driver API mismatch                                                                                                                                      
12-23 06:19:50.234   283   283 E         :  * Device driver API version: 900                                                                                                                                  
12-23 06:19:50.234   283   283 E         :  * User space API version: 800                                                                                                                                     
12-23 06:19:50.234   283   283 W libEGL  : eglInitialize(0x1) failed (EGL_BAD_ALLOC)                                                                                                                          
12-23 06:19:50.236   283   283 E FrameBuffer: init_frame_buffer_locked of dev:(/dev/graphics/fb0),fb idx (0)                                                                                                  
12-23 06:19:50.236   283   283 W [Gralloc-Warning]: int init_frame_buffer_locked(framebuffer_info_t*):407 fbdev pixclock is zero for fd: 11                                                                   
12-23 06:19:50.236   283   283 I [Gralloc]: using (fd=11)                                                                                                                                                     
12-23 06:19:50.236   283   283 I [Gralloc]: id           = OSD FB                                                                                                                                             
12-23 06:19:50.236   283   283 I [Gralloc]: xres         = 1920 px                                                                                                                                            
12-23 06:19:50.236   283   283 I [Gralloc]: yres         = 1080 px                                                                                                                                            
12-23 06:19:50.236   283   283 I [Gralloc]: xres_virtual = 1920 px                                                                                                                                            
12-23 06:19:50.236   283   283 I [Gralloc]: yres_virtual = 3240 px                                                                                                                                            
12-23 06:19:50.236   283   283 I [Gralloc]: bpp          = 32                                                                                                                                                 
12-23 06:19:50.236   283   283 I [Gralloc]: r            =  0:8                                                                                                                                               
12-23 06:19:50.236   283   283 I [Gralloc]: g            =  8:8                                                                                                                                               
12-23 06:19:50.236   283   283 I [Gralloc]: b            = 16:8                                                                                                                                               
12-23 06:19:50.236   283   283 I [Gralloc]: width        = 305 mm (159.895081 dpi)                                                                                                                            
12-23 06:19:50.236   283   283 I [Gralloc]: height       = 171 mm (160.421051 dpi)                                                                                                                            
12-23 06:19:50.236   283   283 I [Gralloc]: refresh rate = 60.00 Hz                                                                                                                                           
12-23 06:19:50.236   283   283 D gralloc : init_frame_buffer get frame size 8294400

User avatar
mad_ady
Posts: 7113
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 308 times
Been thanked: 212 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by mad_ady » Mon Dec 23, 2019 7:09 pm

Hmm, now that you mention it, android should have its own /lib/modules/`uname -r` equivalent that would cause the version mismatch. Have you found where these modules are located and replaced them with the ubuntu ones? I know there were some aml-specific modules like ion that are needed. I don't know - is an lxc container allowed to load modules in the host kernel? Maybe the correct (newer) modules are already loaded on the linux side, but android tries to load them anyway...

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Mon Dec 23, 2019 9:25 pm

Well, this is a little complicated issue.
First of all, you need to know that any drivers that container uses should be loaded on host side with host drivers before container starts. So, drivers should be loaded manually in advance or be configured as like 'lxc config set $container_name linux.kernel_modules $module_name'.
I mean there is no guest kernel or guest kernel-level drivers since container shares host kernel.

I enabled mali-related kernel configs with 'Y' not 'm' to simplify my manual tasks.
In addition, I loaded some kernel modules like btusb which android container tries to load with insmod in init.xxx.rc before android container starts.
So, proper kernel-level device drivers are all loaded in advance throughout my trials.
I always watches kernel messages with 'dmesg -w' when I proceed any tests, and there has been no error messages related to kernel module loading.
(i.e. I tried also 'insmod mali.ko' which comes from Android rootfs but it fails to load the driver resulting in format error.)

This situation comes from the gap between user-level library(libEGES_mali.so) and kernel-level mali device driver(mali.ko if it is built as module, but I marked it 'Y' when I configure host kernel).
As my logcat depicts, kernel-level device driver provides API version 900 which is higher than the API version 800 which is used by user-level library, thus libGLES_mali.so cannot initiates gralloc successfully.
To resolve this issue, I tried to downgrade my host kernel(ubuntu kernel 3.14.79) to match the API version to 800 but failed, so I need to try with Android kernel(3.14.29) in Android source tree.

In summary, I have been working with ubuntu kernel adopting android kernel configs, but from now on I am going to work with android kernel adopting ubuntu kernel configs.
I think this is the appropriate way to minimize my additional task (eg. compiling with Android NDK to build libGLES_mali.so to get higher API version)

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Tue Dec 24, 2019 10:09 am

Merry Christmas!
But, I'm still working on this issue T.T

I built Android kernel and installed it as below.

Code: Select all

git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidc2-3.14.y-android
cd linux
make odroidc2_defconfig
make -j4 Image dtbs modules
make modules_install
cp arch/arm64/boot/Image arch/arm64/boot/dts/meson64_odroidc2.dtb /media/boot/
sync
reboot
However, it stuck in boot logo without blinking blue LED and here is my minicom messages.
What should I do to boot Android kernel without making Android boot partitions?
(i.e. As you know, I'm trying to replace Ubuntu kernel to Android kernel for running Android container on Ubuntu host OS.)
God be with me to enjoy Christmas...

Code: Select all

Welcome to minicom 2.7.1                                                      
                                                                              
OPTIONS: I18n                                                                 
Compiled on Aug 13 2017, 15:25:34.                                            
Port /dev/ttyUSB0, 09:54:11                                                   
                                                                              
Press CTRL-A Z for help on special keys                                       
                                                                              
GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;READ:0;CHK:0;
TE: 217572                                                                    
no sdio debug board detected                                                  
                                                                              
BL2 Built : 11:44:26, Nov 25 2015.                                            
gxb gfb13a3b-c2 - jcao@wonton                                                 
                                                                              
Board ID = 8                                                                  
set vcck to 1100 mv                                                           
set vddee to 1050 mv                                                          
CPU clk: 1536MHz                                                              
DDR channel setting: DDR0 Rank0+1 same
DDR0: 2048MB(auto) @ 912MHz(2T)-13
DataBus test pass!
AddrBus test pass!
Load fip header from SD, src: 0x0000c200, des: 0x01400000, size: 0x000000b0
Load bl30 from SD, src: 0x00010200, des: 0x01000000, size: 0x00009ef0
Sending bl30........................................OK. 
Run bl30...
Load bl301 from SD, src: 0x0001c200, des: 0x01000000, size: 0x000018c0
Wait bl30...Done
Sending bl301.......OK. 
Run bl301...
 0x10100000, size: 0x0001113020200, des


--- UART initialized after reboot ---
[Reset cause: unknown]
[Image: unknown, amlogic_v1.1.3046-00db630-dirty 2016-08-31 09:24:14 tao.zeng@droid04]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: eLoad bl33 from SD, src: 0x00034200, des: 0x01000000, size: 0x000769f0
f be ad de d f0 ad ba ef be ad de not ES chip
[0.332452 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):4d2e34d
NOTICE:  BL3-1: Built : 17:08:35, Oct 29 2015
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9


U-Boot 2015.01-00014-g2e4380b-dirty (Jan 16 2018 - 02:09:02)

DRAM:  2 GiB
Relocation Offset is: 76f2f000
-------------------------------------------------
* Welcome to Hardkernel's ODROID-C2
-------------------------------------------------
CPU : AMLogic S905
S/N : HKC213254E0062B3
MAC : 00:1e:06:36:af:33
BID : HKC2211902
-------------------------------------------------
register usb cfg[1][0] = 0000000077f95010
register usb cfg[0][1] = 0000000077f95030
vpu detect type: 5
vpu clk_level = 7
set vpu clk: 666667000Hz, readback: 666660000Hz(0x300)
MMC:   aml_priv->desc_buf = 0x0000000073f27d30
aml_priv->desc_buf = 0x0000000073f29ec0
SDIO Port B: 0, SDIO Port C: 1
ret = 1 .[mmc_init] mmc init success
In:    serial
Out:   serial
Err:   serial
----------------------------------
MMC Size : 16 GB
----------------------------------
reading boot-logo.bmp.gz
3705732 bytes read in 169 ms (20.9 MiB/s)
hpd_state=1
[CANVAS]addr=0x3f800000 width=3840, height=1440

set hdmitx VIC = 16
hdmitx phy setting done
set hdmitx VIC = 16
hdmitx phy setting done
Net:   Meson_Ethernet
Hit [Enter] key twice to stop autoboot:  0 
reading boot.ini
7665 bytes read in 4 ms (1.8 MiB/s)
cfgload: applying boot.ini...
cfgload: setenv display_autodetect "true"
cfgload: setenv m "1080p60hz" # Progressive 60Hz
cfgload: setenv m_bpp "32"
cfgload: setenv vout "hdmi"
cfgload: setenv hpd "false"
cfgload: setenv monitor_onoff "false" # true or false
cfgload: setenv nographics "0"
cfgload: setenv mesontimer "1"
cfgload: setenv disableuhs "false"
cfgload: setenv mmc_removable "true"
cfgload: setenv usbmulticam "false"
cfgload: setenv disable_vu7 "false"
cfgload: setenv condev "console=ttyS0,115200n8"   # on both
cfgload: setenv maxcpus "4"
cfgload: setenv max_freq "1536"  # 1.536GHz
cfgload: if test "${display_autodetect}" = "true"; then usb pwren; hdmitx edid; fi
USB0:   dwc_usb driver version: 2.94 6-June-2012
USB (1) peri reg base: c0000020
USB (1) use clock source: XTAL input, div: 1
USB (1) base addr: 0xc9100000
Force id mode: Host
dwc_otg: Highspeed device found !

..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
edid extension block number : 2
Manufacturer: GSM Model 5ab8 Serial Number 16843009
EDID version: 1.3
Established timings supported:
  720x400@70Hz
  640x480@60Hz
  640x480@75Hz
  800x600@60Hz
  800x600@75Hz
  1024x768@60Hz
  1024x768@75Hz
  1280x1024@75Hz
Standard timings supported:
  1152x864@75Hz
  1280x1024@60Hz
  1440x900@60Hz
  1680x1050@60Hz
  1600x900@60Hz
  1280x800@60Hz
  1280x720@60Hz
  1400x1050@60Hz
Detailed mode (1) : Clock 148 MHz, 480 mm x 270 mm
               1920 2008 2052 2200 hborder 0
               1080 1084 1089 1125 vborder 0
               +hsync +vsync 
Monitor ranges (GTF): 56-75Hz V, 30-83kHz H, max dotclock 150MHz
Serial number: 
Has 1 extension blocks
Checksum: 0x64 (valid)

CEA extension block
Extension version: 3
25 bytes of CEA data
    VIC  16 1920x1080@60Hz (native)
    VIC   4 1280x720@60Hz 
    VIC   3 720x480@60Hz 
    VIC   1 640x480@60Hz 
    VIC  20 1920x1080i@50Hz 
    VIC  18 720x576@50Hz 
    VIC   5 1920x1080i@60Hz 
    VIC  31 1920x1080@50Hz 
    VIC  16 1920x1080@60Hz 
    VIC  19 1280x720@50Hz 
    Linear PCM, max channels 2
  Vendor-specific data block, OUI 000c03 (HDMI)
Detailed mode (1) : Clock 148 MHz, 480 mm x 270 mm
               1920 2008 2052 2200 hborder 0
               1080 1084 1089 1125 vborder 0
               +hsync +vsync 
Detailed mode (1) : Clock 74 MHz, 480 mm x 270 mm
               1920 2008 2052 2200 hborder 0
                540  542  547  562 vborder 0
               +hsync +vsync interlaced 
Detailed mode (1) : Clock 74 MHz, 480 mm x 270 mm
               1280 1390 1430 1650 hborder 0
                720  725  730  750 vborder 0
               +hsync +vsync 
Detailed mode (1) : Clock 27 MHz, 480 mm x 270 mm
                720  736  798  858 hborder 0
                480  489  495  525 vborder 0
               -hsync -vsync 
Checksum: 0xae (valid)

EDID block does NOT conform to EDID 1.3!
        Name descriptor not terminated with a newline
bestmode is custombuilt, IEEEOUI 0x000c03
HDMI Mode
cfgload: if test "${m}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi
cfgload: if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0ei
cfgload: setenv androidopt "androidboot.hardware=odroidc2"
cfgload: setenv selinuxopt "androidboot.selinux=disabled"
cfgload: setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro ${"
cfgload: showlogo ${m} 1920 1080
reading boot-logo.bmp.gz
3705732 bytes read in 168 ms (21 MiB/s)
hpd_state=1
[CANVAS]addr=0x3f800000 width=5760, height=2160

Not find 'custombuilt' mapped VIC
Not find 'custombuilt' mapped VIC
cfgload: setenv loadaddr "0x11000000"
cfgload: setenv dtb_loadaddr "0x1000000"
cfgload: setenv initrd_loadaddr "0x13000000"
cfgload: setenv loadaddr "0x11000000"
cfgload: setenv dtb_loadaddr "0x1000000"
cfgload: setenv initrd_loadaddr "0x13000000"
cfgload: fatload mmc 0:1 ${initrd_loadaddr} uInitrd
reading uInitrd
7671702 bytes read in 342 ms (21.4 MiB/s)
cfgload: fatload mmc 0:1 ${loadaddr} Image
reading Image
14010952 bytes read in 618 ms (21.6 MiB/s)
cfgload: fatload mmc 0:1 ${dtb_loadaddr} meson64_odroidc2.dtb
reading meson64_odroidc2.dtb
29813 bytes read in 6 ms (4.7 MiB/s)
cfgload: fdt addr ${dtb_loadaddr}
cfgload: if test "${mesontimer}" = "0"; then fdt rm /meson_timer; fdt rm /cpus/cpu@0/tii
cfgload: if test "${mesontimer}" = "1"; then fdt rm /timer; fi
cfgload: if test "${nographics}" = "1"; then fdt rm /reserved-memory; fdt rm /aocec; fi
cfgload: if test "${nographics}" = "1"; then fdt rm /meson-fb; fdt rm /amhdmitx; fdt rmi
cfgload: if test "${nographics}" = "1"; then fdt rm /meson-vout; fdt rm /mesonstream; fi
cfgload: if test "${nographics}" = "1"; then fdt rm /deinterlace; fdt rm /codec_mm; fi
cfgload: booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}
## Loading init Ramdisk from Legacy Image at 13000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (uncompressed)
   Data Size:    7671638 Bytes = 7.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
load dtb from 0x1000000 ......
## Flattened Device Tree blob at 01000000
   Booting using the fdt blob at 0x1000000
   Loading Ramdisk to 737d4000, end 73f24f56 ... OK
   Loading Device Tree to 000000001fff5000, end 000000001ffff474 ... OK

Starting kernel ...

uboot time: 6058675 us

User avatar
mad_ady
Posts: 7113
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 308 times
Been thanked: 212 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by mad_ady » Tue Dec 24, 2019 2:56 pm

See if there is an android-specific defconfig. Also, check the bootargs (cat /proc/cmdline) when running stock android and compare it with what you're passing through boot.ini.

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Thu Dec 26, 2019 11:34 am

As you mentioned, I merged android-specific kernel configs from android/configs/{android-base.cfg, android-recommended.cfg} to odroidc2-defconfig when I build kernel.
(i.e. I commented out 'CONFIG_PM_WAKELOCKS=y' from android-base.cfg since enabling this config incurs compilation error.)
I tried to make bootargs in boot.ini to those of stock android but it failed with the same situation.
I cannot figure out what I am doing wrong. :(

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Sat Jan 04, 2020 6:30 pm

Well, I boldly tried to replace mali subtree(API version 900) of Ubuntu kernel(3.16.y) with mali subtree(API version 800) of Android kernel(3.14.29).
It seems resolving API mismatch error and surfaceflinger keeps alive.
My monitor displays my mouse pointer tracking movement properly and some distorted images which I guess parts of bootanimation.
However, I see that too many 'out of memory' errors are raised from OpenGL as below.
My odroid-c2 has 2GB memory and I limit my Android container has 1GB memory.
Is there any config related to target device memory size when I build Android?

I appreciate any comment.

parts of logcat

Code: Select all

01-04 09:16:42.919   194   194 E SurfaceFlinger: GL error 0x0505
01-04 09:16:42.969   194   194 E SurfaceFlinger: GL error 0x0505
01-04 09:16:43.019   194   194 E SurfaceFlinger: GL error 0x0505
01-04 09:16:43.066  1237  1237 V MediaUtils: physMem: 1024000000
01-04 09:16:43.066  1237  1237 V MediaUtils: requested limit: 665600000
01-04 09:16:43.066  1237  1237 V MediaUtils: actual limit: 665600000
01-04 09:16:43.066  1237  1237 V MediaUtils: original limits: 4294967295/4294967295
01-04 09:16:43.066  1237  1237 V MediaUtils: new limits: 665600000/4294967295
01-04 09:16:43.067  1237  1237 I mediaserver: ServiceManager: 0xf66d5120
01-04 09:16:43.067  1237  1237 I AudioFlinger: Using default 3000 mSec as standby time.
01-04 09:16:43.069  1237  1237 I CameraService: CameraService started (pid=1237)
01-04 09:16:43.069   194   194 E SurfaceFlinger: GL error 0x0505
01-04 09:16:43.069  1237  1237 I CameraService: CameraService process starting
01-04 09:16:43.074  1237  1237 E cutils-trace: Error opening trace file: Permission denied (13)
01-04 09:16:43.074  1237  1237 I CameraService: Loaded "Camera Module" camera module
01-04 09:16:43.079  1237  1237 I AudioPolicyService: AudioPolicyService CSTOR in new mode
01-04 09:16:43.079  1237  1237 I APM::ConfigParsingUtils: loadAudioPolicyConfig() loaded /system/etc/audio_policy.conf
01-04 09:16:43.082  1237  1237 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xfffffffd in tid 1237 (mediaserver)
01-04 09:16:43.119   194   194 E SurfaceFlinger: GL error 0x0505
01-04 09:16:43.133   199   199 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-04 09:16:43.133   199   199 F DEBUG   : Build fingerprint: 'ODROID/odroidc2/odroidc2:6.0.1/MOI10E/ubuntu12020956:eng/test-keys'
01-04 09:16:43.133   199   199 F DEBUG   : Revision: '0'
01-04 09:16:43.133   199   199 F DEBUG   : ABI: 'arm'
01-04 09:16:43.133   199   199 F DEBUG   : pid: 1237, tid: 1237, name: mediaserver  >>> /system/bin/mediaserver <<<
01-04 09:16:43.133   199   199 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xfffffffd
01-04 09:16:43.140   199   199 F DEBUG   :     r0 00000000  r1 f4b3ef80  r2 01000000  r3 00000000
01-04 09:16:43.140   199   199 F DEBUG   :     r4 f4b3ef66  r5 00000006  r6 f66ff200  r7 f4b3ad21
01-04 09:16:43.140   199   199 F DEBUG   :     r8 ffaa0798  r9 ffaa06b8  sl f66d1058  fp 00000000
01-04 09:16:43.140   199   199 F DEBUG   :     ip 00008080  sp ffaa0670  lr f711168b  pc f4b3a168  cpsr 800f0030
01-04 09:16:43.143   199   199 F DEBUG   : 
01-04 09:16:43.143   199   199 F DEBUG   : backtrace:
01-04 09:16:43.143   199   199 F DEBUG   :     #00 pc 00002168  /system/lib/hw/audio.primary.odroidc2.so
01-04 09:16:43.143   199   199 F DEBUG   :     #01 pc 00002af1  /system/lib/hw/audio.primary.odroidc2.so
01-04 09:16:43.143   199   199 F DEBUG   :     #02 pc 00027fdf  /system/lib/libaudioflinger.so
01-04 09:16:43.143   199   199 F DEBUG   :     #03 pc 0002826f  /system/lib/libaudioflinger.so
01-04 09:16:43.143   199   199 F DEBUG   :     #04 pc 00009b7b  /system/lib/libaudiopolicyservice.so
01-04 09:16:43.143   199   199 F DEBUG   :     #05 pc 0001bb45  /system/lib/libaudiopolicymanagerdefault.so (_ZN7android18AudioPolicyManagerC1EPNS_26AudioPolicyClientInterfaceE+708)
01-04 09:16:43.143   199   199 F DEBUG   :     #06 pc 000007d1  /system/lib/libaudiopolicymanager.so (createAudioPolicyManager+16)
01-04 09:16:43.143   199   199 F DEBUG   :     #07 pc 000065c9  /system/lib/libaudiopolicyservice.so
01-04 09:16:43.143   199   199 F DEBUG   :     #08 pc 00002541  /system/bin/mediaserver
01-04 09:16:43.143   199   199 F DEBUG   :     #09 pc 00001d91  /system/bin/mediaserver
01-04 09:16:43.143   199   199 F DEBUG   :     #10 pc 00017365  /system/lib/libc.so (__libc_init+44)
01-04 09:16:43.143   199   199 F DEBUG   :     #11 pc 00002020  /system/bin/mediaserver
01-04 09:16:43.169   194   194 E SurfaceFlinger: GL error 0x0505
01-04 09:16:43.178   508   600 I ServiceManager: Waiting for service media.audio_policy...
01-04 09:16:43.206   199   199 F DEBUG   : 
01-04 09:16:43.206   199   199 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_04
01-04 09:16:43.210   193   193 I ServiceManager: service 'media.audio_flinger' died
01-04 09:16:43.210   193   193 I ServiceManager: service 'media.player' died
01-04 09:16:43.211   193   193 I ServiceManager: service 'media.resource_manager' died
01-04 09:16:43.211   193   193 I ServiceManager: service 'media.camera' died
01-04 09:16:43.219   194   194 E SurfaceFlinger: GL error 0x0505
01-04 09:16:43.269   194   194 E SurfaceFlinger: GL error 0x0505
01-04 09:16:43.319   194   194 E SurfaceFlinger: GL error 0x0505
01-04 09:16:43.369   194   194 E SurfaceFlinger: GL error 0x0505
These users thanked the author sang0627 for the post:
mad_ady (Sat Jan 04, 2020 9:43 pm)

User avatar
mad_ady
Posts: 7113
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 308 times
Been thanked: 212 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by mad_ady » Sat Jan 04, 2020 9:56 pm

Great progress!
Could it be that android gets total system memory from the kernel without keeping track of what the cgroup sets? Not sure if there are different syscalls or not.
Have you tried without limiting memory?
Maybe android needs different boot parameters. Try bind-mounting /proc/cmdline with the one from android.

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Sun Jan 05, 2020 4:10 pm

I guess the resolution difference incurs out-of-memory error as shown below logcat messages.
I colored blue in logcat messages for explaining my point.

I have hdmimode=1080p in bootargs of Ubuntu boot.ini. As you know, this Android container does not boot with uboot, so I added ubootenv.var.hdmimode=1080p60hz to system/build.prop while expecting it would be delivered to Android. But, Android's SystemControl service outputs 'not a ubootenv variable' error.
However, at last, SystemControl service sets OSD mouse region to 1920x1080 strangely. How does he know that?

Anyway, gralloc allocates with 1280x720 size framebuffer as shown in "framebufferSize 3686400", but SystemControl service recognizes the display resolution as 1920x1080.
I suspect this gap might be the reason of SurfaceFlinger's GL error 0x0505.

I need to look for a way to deliver uboot parameters to Android.

Code: Select all

01-05 05:34:34.799   206   206 I SurfaceFlinger: SurfaceFlinger is starting                                                 
01-05 05:34:34.799   206   206 I SurfaceFlinger: SurfaceFlinger's main thread ready to run. Initializing graphics H/W...    
01-05 05:34:34.801   215   215 I SystemControl: ServiceManager: 0xf7195040                                                  
01-05 05:34:34.802   215   215 E SystemControl: [ubootenv] ubootenv.var.hdmimode is not a ubootenv varible.                 
01-05 05:34:34.802   215   215 E SystemControl: [ubootenv] ubootenv.var.hdmimode is not a ubootenv varible.                 
01-05 05:34:34.802   215   215 E SystemControl: [ubootenv] ubootenv.var.customwidth is not a ubootenv varible.              
01-05 05:34:34.802   215   215 E SystemControl: [ubootenv] ubootenv.var.customheight is not a ubootenv varible.             
01-05 05:34:34.857   215   215 I SystemControl: init mbox display hpdstate:1, old outputmode:custombuilt, new outputmode: 
01-05 05:34:34.894   206   206 D libEGL  : loaded /system/lib/egl/libGLES_mali.so                                           
01-05 05:34:34.907   215   215 E SystemControl: [ubootenv] ubootenv.var.1080p_x is not a ubootenv varible.                  
01-05 05:34:34.907   215   215 E SystemControl: [ubootenv] ubootenv.var.1080p_y is not a ubootenv varible.                  
01-05 05:34:34.907   215   215 E SystemControl: [ubootenv] ubootenv.var.1080p_w is not a ubootenv varible.                  
01-05 05:34:34.907   215   215 E SystemControl: [ubootenv] ubootenv.var.1080p_h is not a ubootenv varible.                  
01-05 05:34:34.908   215   215 I SystemControl: video is not playing, don't need set video axis                             
01-05 05:34:34.908   215   215 I SystemControl: setMboxOutputMode cvbsMode = 0                                              
01-05 05:34:34.908   215   215 I SystemControl: HDCP thread start                                                           
01-05 05:34:34.908   215   254 I SystemControl: HDCP thread loop entry                                                      
01-05 05:34:34.908   215   215 I SystemControl: display mode, create hdcp thread thread id = 4144232752                     
01-05 05:34:34.908   215   254 E SystemControl: readSysFs, open /sys/class/amhdmitx/amhdmitx0/hdcp_lstore fail.             
01-05 05:34:34.908   215   254 I SystemControl: HDCP TX key:                                                                
01-05 05:34:34.908   215   215 E SystemControl: [ubootenv] ubootenv.var.digitaudiooutput is not a ubootenv varible.         
01-05 05:34:34.908   215   215 I SystemControl: set output mode: done                                                       
01-05 05:34:34.908   215   215 I SystemControl: instantiate add system_control service result:0                             
01-05 05:34:34.963   206   206 E FrameBuffer: init_frame_buffer_locked of dev:(/dev/graphics/fb0),fb idx (0)                
01-05 05:34:34.983   206   206 I [Gralloc]: using (fd=12)                                                                   
01-05 05:34:34.983   206   206 I [Gralloc]: id           = OSD FB                                                           
01-05 05:34:34.983   206   206 I [Gralloc]: xres         = 1280 px                                                          
01-05 05:34:34.983   206   206 I [Gralloc]: yres         = 720 px                                                 
01-05 05:34:34.983   206   206 I [Gralloc]: xres_virtual = 1280 px                                                          
01-05 05:34:34.983   206   206 I [Gralloc]: yres_virtual = 2160 px                                                          
01-05 05:34:34.983   206   206 I [Gralloc]: bpp          = 32                                                               
01-05 05:34:34.983   206   206 I [Gralloc]: r            =  0:8                                                             
01-05 05:34:34.983   206   206 I [Gralloc]: g            =  8:8                                                             
01-05 05:34:34.983   206   206 I [Gralloc]: b            = 16:8                                                             
01-05 05:34:34.983   206   206 I [Gralloc]: width        = 203 mm (160.157639 dpi)                                          
01-05 05:34:34.983   206   206 I [Gralloc]: height       = 114 mm (160.421051 dpi)                                          
01-05 05:34:34.983   206   206 I [Gralloc]: refresh rate = 121.43 Hz                                                        
01-05 05:34:34.983   206   206 D gralloc : init_frame_buffer get frame size 3686400                                         
01-05 05:34:34.983   206   206 W [Gralloc-Warning]: int gralloc_register_buffer(const gralloc_module_t*, buffer_handle_t):76
01-05 05:34:34.983   206   206 D Gralloc : gralloc_register_buffer register framebuffer                                     
01-05 05:34:34.993   206   206 D Gralloc : register frame buffer count 3                                                    
01-05 05:34:35.137   206   206 E FrameBuffer: init_frame_buffer_locked of dev:(/dev/graphics/fb0),fb idx (0)                
01-05 05:34:35.137   206   206 I [Gralloc]: using (fd=14)                                                                   
01-05 05:34:35.137   206   206 I [Gralloc]: id           = OSD FB                                                           
01-05 05:34:35.137   206   206 I [Gralloc]: xres         = 1280 px                                                          
01-05 05:34:35.137   206   206 I [Gralloc]: yres         = 720 px                                                           
01-05 05:34:35.137   206   206 I [Gralloc]: xres_virtual = 1280 px                                                          
01-05 05:34:35.137   206   206 I [Gralloc]: yres_virtual = 2160 px                                                          
01-05 05:34:35.137   206   206 I [Gralloc]: bpp          = 32                                                               
01-05 05:34:35.137   206   206 I [Gralloc]: r            =  0:8                                                             
01-05 05:34:35.137   206   206 I [Gralloc]: g            =  8:8                                                             
01-05 05:34:35.137   206   206 I [Gralloc]: b            = 16:8                                                             
01-05 05:34:35.137   206   206 I [Gralloc]: width        = 203 mm (160.157639 dpi)                                          
01-05 05:34:35.137   206   206 I [Gralloc]: height       = 114 mm (160.421051 dpi)                                          
01-05 05:34:35.137   206   206 I [Gralloc]: refresh rate = 121.43 Hz                                                        
01-05 05:34:35.137   206   206 W [Gralloc-Warning]: int gralloc_register_buffer(const gralloc_module_t*, buffer_handle_t):76
01-05 05:34:35.137   206   206 D Gralloc : gralloc_register_buffer register framebuffer                                     
01-05 05:34:35.137   206   206 E Gralloc : ERROR::register frambuffer again!!!                                              
01-05 05:34:35.137   206   206 E FrameBuffer: init_cursor_buffer_locked of dev:(/dev/graphics/fb1),fb idx (1)               
01-05 05:34:35.137   206   206 E FrameBuffer: vinfo. 32 32                                                                  
01-05 05:34:35.137   206   206 I [Gralloc]: using (fd=15)                                                                   
01-05 05:34:35.137   206   206 I [Gralloc]: id           = OSD FB                                                           
01-05 05:34:35.137   206   206 I [Gralloc]: xres         = 32 px                                                            
01-05 05:34:35.137   206   206 I [Gralloc]: yres         = 32 px                                                            
01-05 05:34:35.137   206   206 I [Gralloc]: xres_virtual = 32 px                                                            
01-05 05:34:35.137   206   206 I [Gralloc]: yres_virtual = 32 px                                                            
01-05 05:34:35.137   206   206 I [Gralloc]: bpp          = 32                                                               
01-05 05:34:35.137   206   206 I [Gralloc]: width        = 5 mm                                                             
01-05 05:34:35.137   206   206 I [Gralloc]: height       = 5 mm                                                             
01-05 05:34:35.137   206   206 E FrameBuffer: init_cursor_buffer_locked: finfo.line_length is 0x80,info.yres_virtual is 0x20
01-05 05:34:35.137   206   206 I SurfaceFlinger: Using composer version 1.4                                                 
01-05 05:34:35.137   206   206 E HWComposer:   881 hwc_getDisplayAttributes - unknown display attribute 6                   
01-05 05:34:35.137   206   206 E HWComposer:   843 hwc_getDisplayConfigs - hwc_getDisplayConfigs:connect =  0               
01-05 05:34:35.138   206   206 I SurfaceFlinger: EGL information:                                                           
01-05 05:34:35.138   206   206 I SurfaceFlinger: vendor    : Android                                                        
01-05 05:34:35.138   206   206 I SurfaceFlinger: version   : 1.4 Android META-EGL                                           
01-05 05:34:35.138   206   206 I SurfaceFlinger: extensions: EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EG
01-05 05:34:35.138   206   206 I SurfaceFlinger: Client API: OpenGL_ES                                                      
01-05 05:34:35.138   206   206 I SurfaceFlinger: EGLSurface: 8-8-8-8, config=0x60000016                                     
01-05 05:34:35.139   206   206 I SurfaceFlinger: OpenGL ES informations:                                                    
01-05 05:34:35.139   206   206 I SurfaceFlinger: vendor    : ARM                                                            
01-05 05:34:35.139   206   206 I SurfaceFlinger: renderer  : Mali-450 MP                                                    
01-05 05:34:35.139   206   206 I SurfaceFlinger: version   : OpenGL ES 2.0                                                  
01-05 05:34:35.139   206   206 I SurfaceFlinger: extensions: GL_EXT_debug_marker GL_OES_texture_npot GL_OES_vertex_array_obj
01-05 05:34:35.139   206   206 I SurfaceFlinger: GL_MAX_TEXTURE_SIZE = 4096                                                 
01-05 05:34:35.139   206   206 I SurfaceFlinger: GL_MAX_VIEWPORT_DIMS = 4096                                                
01-05 05:34:35.139   206   206 E cutils-trace: Error opening trace file: Permission denied (13)                             
01-05 05:34:35.139   206   206 D FrameBuffer: ****************************** 3                                              
01-05 05:34:35.139   206   206 D FrameBuffer: ****************************** 3                                              
01-05 05:34:35.140   206   206 D gralloc : allocate framebufferVaddr 0xf57f8000 , framebufferSize 3686400                   
01-05 05:34:35.141   206   206 D SurfaceFlinger: Set power mode=2, type=0 flinger=0xf6deb000                          
01-05 05:34:35.141   206   206 D SurfaceFlinger: Set power mode=2, type=0 flinger=0xf6deb000                                
01-05 05:34:35.374   215   255 I SystemControl: boot animation detect boot video:0                                          
01-05 05:34:35.400   215   255 E SystemControl: [ubootenv] ubootenv.var.customwidth is not a ubootenv varible.              
01-05 05:34:35.400   215   255 E SystemControl: [ubootenv] ubootenv.var.customheight is not a ubootenv varible.             
01-05 05:34:35.400   215   255 E SystemControl: [ubootenv] ubootenv.var.overscan_left is not a ubootenv varible.            
01-05 05:34:35.400   215   255 E SystemControl: [ubootenv] ubootenv.var.overscan_top is not a ubootenv varible.             
01-05 05:34:35.400   215   255 E SystemControl: [ubootenv] ubootenv.var.overscan_right is not a ubootenv varible.           
01-05 05:34:35.400   215   255 E SystemControl: [ubootenv] ubootenv.var.overscan_bottom is not a ubootenv varible.          
01-05 05:34:35.400   215   255 I SystemControl: set osd mouse x:0 y:0 w:1920 h:1080                                 
01-05 05:34:35.427   215   255 I SystemControl: void DisplayMode::setOverscan(const char*)                                  
01-05 05:34:35.428   215   255 E SystemControl: [ubootenv] ubootenv.var.overscan_left is not a ubootenv varible.            
01-05 05:34:35.428   215   255 E SystemControl: [ubootenv] ubootenv.var.overscan_top is not a ubootenv varible.             
01-05 05:34:35.428   215   255 E SystemControl: [ubootenv] ubootenv.var.overscan_right is not a ubootenv varible.           
01-05 05:34:35.428   215   255 E SystemControl: [ubootenv] ubootenv.var.overscan_bottom is not a ubootenv varible.          
01-05 05:34:35.428   215   255 I SystemControl: overscan values is N/A                                                      
01-05 05:34:35.532   206   206 D SurfaceFlinger: shader cache generated - 24 shaders in 30.347029 ms                        
01-05 05:34:35.538   277   296 D libEGL  : loaded /system/lib/egl/libGLES_mali.so                                           
01-05 05:34:35.543   206   206 D gralloc : allocate framebufferVaddr 0xf5b7c000 , framebufferSize 3686400                
01-05 05:34:35.586   277   296 E cutils-trace: Error opening trace file: Permission denied (13)                             
01-05 05:34:35.597   277   296 E BootAnimation: couldn't find audio_conf.txt                                                
01-05 05:34:35.744   212   212 V MediaUtils: physMem: 1811410944                                                            
01-05 05:34:35.744   212   212 V MediaUtils: requested limit: 1177417085                                                    
01-05 05:34:35.744   212   212 V MediaUtils: actual limit: 1177417085                                                       
01-05 05:34:35.744   212   212 V MediaUtils: original limits: 4294967295/4294967295                                         
01-05 05:34:35.744   212   212 V MediaUtils: new limits: 1177417085/4294967295                                              
01-05 05:34:35.827   206   206 E SurfaceFlinger: GL error 0x0505                                                            
01-05 05:34:35.842   212   212 I mediaserver: ServiceManager: 0xf63d5120    
Last edited by sang0627 on Sun Jan 05, 2020 6:14 pm, edited 1 time in total.

User avatar
mad_ady
Posts: 7113
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 308 times
Been thanked: 212 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by mad_ady » Sun Jan 05, 2020 4:13 pm

Try bind mounting /proc/cmdline. Under linux at least there is a script that parses it and sets resolution.

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Sun Jan 05, 2020 4:40 pm

well, it is already mounted and I can see the same boot parameters in Android as host Linux.

User avatar
mad_ady
Posts: 7113
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 308 times
Been thanked: 212 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by mad_ady » Sun Jan 05, 2020 6:15 pm

The point is android should have different kernel boot parameters. Check the difference in stock android.
These users thanked the author mad_ady for the post:
sang0627 (Thu Jan 09, 2020 5:38 pm)

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Tue Jan 07, 2020 10:10 am

According to Android source tree at
vendor/amlogic/frameworks/services/systemcontrol/{SystemControl.cpp, DisplayMode.cpp, ubootenv.c},
I think that odroid-c2's Android reads uboot environment variables from boot partition directly, not from kernel bootarg.

Code: Select all

#ifdef ODROIDC2
    if (!stat("/dev/block/mmcblk0", &st)) { /* For ODROID-C2 */
        sprintf(BootenvPartitionName, "/dev/block/mmcblk0");
        if ((fd = open(BootenvPartitionName, O_RDWR)) < 0) {
            ERROR("[ubootenv] open device(%s) error\n",BootenvPartitionName );
            return -2;
        }
Fortunately, Android and Ubuntu use the same section of boot partition for uboot environment variable according to https://wiki.odroid.com/odroid-c2/softw ... tion_table.
So, my Android container should have read successfully those uboot environment variables from the boot device directly.
But, it failed saying that "xxx is not a ubootenv varible" which I think "not found such uboot environment variable in the boot partition".
I tried to add 'setenv hdmimode 1080p60hz' command to boot.ini of host Ubuntu and also 'protect off' and 'saveenv' commands.
No luck.
I need to investigate key/value pairs in the uboot environment section of partition table.

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Tue Jan 07, 2020 11:13 am

after creating /etc/fw_env.config as below,

Code: Select all

# MTD device name       Device offset    Env. size       Flash sector size
/dev/mmcblk0            0xB4000          0x8000          0x200
With fw_printenv command, Ubuntu host prints uboot environment variables correctly which are as set in /media/boot/boot.ini file.
So, I think uboot environment variables are written correctly at the right position.

However, I cannot see those key/value pairs in Android container.

Code: Select all

root@odroidc2:/ # fw_printenv                                                                                              
Cannot get MTD information: Invalid argument
root@odroidc2:/ # cat etc/fw_env.config                                                                                  
# MTD device name       Device offset    Env. size       Flash sector size
/dev/block/mmcblk0            0xB4000          0x8000          0x200
root@odroidc2:/ # ls -al /dev/block/
brw------- root     root       7,   0 2020-01-06 09:43 loop0
brw------- root     root       7,   1 2020-01-06 09:43 loop1
brw------- root     root       7,   2 2020-01-06 09:43 loop2
brw------- root     root       7,   3 2020-01-06 09:43 loop3
brw------- root     root       7,   4 2020-01-06 09:43 loop4
brw------- root     root       7,   5 2020-01-06 09:43 loop5
brw------- root     root       7,   6 2020-01-06 09:43 loop6
brw------- root     root       7,   7 2020-01-06 09:43 loop7
brw-rw---- root     root     179,   0 2020-01-06 09:43 mmcblk0
brw------- root     root     179,   1 2020-01-06 09:43 mmcblk0p1
brw------- root     root     179,   2 2020-01-06 09:43 mmcblk0p2
drwxr-xr-x root     root              2020-01-06 09:43 platform
drwx------ root     root              2020-01-06 09:44 vold
root@odroidc2:/ # 

sang0627
Posts: 32
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: surfaceflinger dies with EGL error

Unread post by sang0627 » Thu Jan 09, 2020 5:38 pm

Let me close this thread.
I describe how I resolved this issue for following others with similar problem.

I finally made surfaceflinger display Android boot logo and boot animation.
Ubuntu host and containerized Android share the same uboot env section of boot partition, but my Android cannot read correct MTD info from /dev/block/mmcblk0.
This was caused by the difference between header files for ioctl(fd, MEMGETINFO, ...) due to kernel version difference.
In short, Android user-level binary is built with mtd.h from kernel 3.14.y but host kernel is built with mtd.h from 3.16.y.
I matched host kernel version and Android kernel version as close as possible, and it enabled reading uboot environment variables correctly.
Now, Android properly configures framebuffer and display mode.

Thank you so much, @mad_ady.
Your comments and discussion helped me very much.

I am starting another journey with audioflinger which raises new seg. fault. ;)
These users thanked the author sang0627 for the post:
odroid (Thu Jan 09, 2020 9:05 pm)

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 4 guests