Finally Android 9

Its nice to finally see some Android 9 for this board: https://github.com/96rocks/manifests/releases/tag/Android9.0_rk3399_box_20190508_0134_6ce3c20

Its unfortunate that its from such a deep quagmire of rockchip repositories, but something is better than nothing.

However, running this build, I’m seeing some GL related faults;

06-09 19:59:19.136   460  3097 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LEANBACK_LAUNCHER] flg=0x10000000 pkg=org.xbmc.kodi cmp=org.xbmc.kodi/.Splash} from uid 10025
06-09 19:59:19.160   460  3097 E ActivityManager: getPackageFerformanceMode--ComponentInfo{org.xbmc.kodi/org.xbmc.kodi.Splash}----org.xbmc.kodi
06-09 19:59:19.171  1136  1136 I AppLifecycleTracker: onActivityPaused: 
06-09 19:59:19.171   460  3097 E ActivityManager: getPackageFerformanceMode--ComponentInfo{org.xbmc.kodi/org.xbmc.kodi.Splash}----org.xbmc.kodi
06-09 19:59:19.202  3100  3100 I Zygote  : seccomp disabled by setenforce 0
06-09 19:59:19.202   460   477 I ActivityManager: Start proc 3100:org.xbmc.kodi/u0a82 for activity org.xbmc.kodi/.Splash
06-09 19:59:19.234   460  3097 W ActivityManager: Request to remove task ignored for non-existent task 19
06-09 19:59:19.250  3100  3100 I org.xbmc.kodi: The ClassLoaderContext is a special shared library.
06-09 19:59:19.287  3100  3100 I Kodi    : ABI: arm64-v8a
06-09 19:59:19.287  3100  3100 I Kodi    : ABI: armeabi-v7a
06-09 19:59:19.287  3100  3100 I Kodi    : ABI: armeabi
06-09 19:59:19.288  3100  3100 D Kodi    : External storage = /storage/emulated/0; state = mounted
06-09 19:59:19.434  3100  3100 D OpenGLRenderer: Skia GL Pipeline
06-09 19:59:19.463  3100  3117 I mali_so : [File] : hardware/rockchip/mali_so/driver/product/base/src/mali_base_kbase.c; [Line] : 876; [Func] : base_context_deal_with_version_affairs_rk_ext;
06-09 19:59:19.463  3100  3117 I mali_so : arm_release_ver of this mali_so is 'r18p0-01rel0', rk_so_ver is '7@0'.
06-09 19:59:19.464  3100  3117 D mali_so : [File] : hardware/rockchip/mali_so/driver/product/base/src/mali_base_kbase.c; [Line] : 881; [Func] : base_context_deal_with_version_affairs_rk_ext;
06-09 19:59:19.464  3100  3117 D mali_so : current process is NOT sf, to bail out.
06-09 19:59:19.473  3100  3117 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
06-09 19:59:19.473  3100  3117 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
06-09 19:59:19.473  3100  3117 I OpenGLRenderer: Initialized EGL, version 1.4
06-09 19:59:19.473  3100  3117 D OpenGLRenderer: Swap behavior 2
06-09 19:59:19.473  3100  3117 I mali_winsys: [File] : hardware/rockchip/mali_so/driver/product/android/winsys/mali_egl_winsys_android.cpp; [Line] : 490; [Func] : isFrameSkippingAllowed;
06-09 19:59:19.473  3100  3117 I mali_winsys: frame_skipping IS allowd in current process.
06-09 19:59:19.474  3100  3117 I mali_winsys: [File] : hardware/rockchip/mali_so/driver/product/android/winsys/mali_egl_winsys_android.cpp; [Line] : 272; [Func] : FrameSkipping_init;
06-09 19:59:19.474  3100  3117 I mali_winsys: got INVALID frames_num_of_section and frames_num_to_skip, frame_skipping would NOT be enabled.
06-09 19:59:19.482  3100  3117 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
06-09 19:59:19.494  3100  3117 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
06-09 19:59:19.499  3100  3117 D GRALLOC-ROCKCHIP: RK_GRAPHICS_VER=commit-id:54ce74b
06-09 19:59:19.535  3100  3117 I mali_winsys: [File] : hardware/rockchip/mali_so/driver/product/android/winsys/mali_egl_winsys_android.cpp; [Line] : 321; [Func] : FrameSkipping_needSkipSwapBuffer;
06-09 19:59:19.535  3100  3117 I mali_winsys: got INVALID frames_num_of_section and frames_num_to_skip, frame_skipping would NOT be enabled.
06-09 19:59:19.574  3100  3117 I mali_winsys: [File] : hardware/rockchip/mali_so/driver/product/android/winsys/mali_egl_winsys_android.cpp; [Line] : 321; [Func] : FrameSkipping_needSkipSwapBuffer;
06-09 19:59:19.574  3100  3117 I mali_winsys: got INVALID frames_num_of_section and frames_num_to_skip, frame_skipping would NOT be enabled.
06-09 19:59:19.578  3100  3117 F OpenGLRenderer: Failed to set damage region on surface 0x774af34c80, error=EGL_BAD_ACCESS
06-09 19:59:19.579  3100  3117 F libc    : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 3117 (RenderThread), pid 3100 (org.xbmc.kodi)
06-09 19:59:19.597   460   474 I ActivityManager: Displayed org.xbmc.kodi/.Splash: +444ms
06-09 19:59:19.609   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:19.626   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:19.632  3131  3131 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
06-09 19:59:19.632   392   392 I /system/bin/tombstoned: received crash request for pid 3117
06-09 19:59:19.633  3131  3131 I crash_dump64: performing dump of process 3100 (target tid = 3117)
06-09 19:59:19.641  3131  3131 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-09 19:59:19.641  3131  3131 F DEBUG   : Build fingerprint: 'rockchip/rk3399_box/rk3399_box:9/PQ2A.190205.003/175334:userdebug/test-keys'
06-09 19:59:19.641  3131  3131 F DEBUG   : Revision: '0'
06-09 19:59:19.641  3131  3131 F DEBUG   : ABI: 'arm64'
06-09 19:59:19.641  3131  3131 F DEBUG   : pid: 3100, tid: 3117, name: RenderThread  >>> org.xbmc.kodi <<<
06-09 19:59:19.641  3131  3131 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
06-09 19:59:19.641  3131  3131 F DEBUG   : Abort message: 'Failed to set damage region on surface 0x774af34c80, error=EGL_BAD_ACCESS'
06-09 19:59:19.641  3131  3131 F DEBUG   :     x0  0000000000000000  x1  0000000000000c2d  x2  0000000000000006  x3  0000000000000008
06-09 19:59:19.641  3131  3131 F DEBUG   :     x4  feff71647164636d  x5  feff71647164636d  x6  feff71647164636d  x7  7f7f7f7f7f7f7f7f
06-09 19:59:19.641  3131  3131 F DEBUG   :     x8  0000000000000083  x9  00000077d8cb7a68  x10 fffffff87ffffbdf  x11 0000000000000001
06-09 19:59:19.641  3131  3131 F DEBUG   :     x12 000000773c701bd0  x13 ffffffffffffffff  x14 ffffffffff000000  x15 ffffffffffffffff
06-09 19:59:19.642  3131  3131 F DEBUG   :     x16 00000077d8cf02c8  x17 00000077d8c2e2d8  x18 000000773c7013ba  x19 0000000000000c1c
06-09 19:59:19.642  3131  3131 F DEBUG   :     x20 0000000000000c2d  x21 0000000000000083  x22 000000774ae97730  x23 000000773c7021b0
06-09 19:59:19.642  3131  3131 F DEBUG   :     x24 0000000000000000  x25 000000774ae976a4  x26 000000773c702198  x27 000000774ae976a2
06-09 19:59:19.642  3131  3131 F DEBUG   :     x28 0000000000000000  x29 000000773c701af0
06-09 19:59:19.642  3131  3131 F DEBUG   :     sp  000000773c701ab0  lr  00000077d8c22a90  pc  00000077d8c22abc
06-09 19:59:19.642   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:19.689  3131  3131 F DEBUG   : 
06-09 19:59:19.689  3131  3131 F DEBUG   : backtrace:
06-09 19:59:19.689  3131  3131 F DEBUG   :     #00 pc 0000000000021abc  /system/lib64/libc.so (abort+124)
06-09 19:59:19.689  3131  3131 F DEBUG   :     #01 pc 00000000000080f8  /system/lib64/liblog.so (__android_log_assert+296)
06-09 19:59:19.689  3131  3131 F DEBUG   :     #02 pc 0000000000486e64  /system/lib64/libhwui.so (android::uirenderer::renderthread::EglManager::damageFrame(android::uirenderer::renderthread::Frame const&, SkRect const&)+180)
06-09 19:59:19.689  3131  3131 F DEBUG   :     #03 pc 0000000000480858  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::draw(android::uirenderer::renderthread::Frame const&, SkRect const&, SkRect const&, android::uirenderer::FrameBuilder::LightGeometry const&, android::uirenderer::LayerUpdateQueue*, android::uirenderer::Rect const&, bool, bool, android::uirenderer::BakedOpRenderer::LightInfo const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::Re
06-09 19:59:19.689  3131  3131 F DEBUG   :     #04 pc 0000000000108728  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+192)
06-09 19:59:19.689  3131  3131 F DEBUG   :     #05 pc 0000000000485854  /system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+644)
06-09 19:59:19.689  3131  3131 F DEBUG   :     #06 pc 000000000043c5a8  /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+168)
06-09 19:59:19.689  3131  3131 F DEBUG   :     #07 pc 0000000000115e5c  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+244)
06-09 19:59:19.689  3131  3131 F DEBUG   :     #08 pc 000000000000fb80  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)
06-09 19:59:19.689  3131  3131 F DEBUG   :     #09 pc 000000000008319c  /system/lib64/libc.so (__pthread_start(void*)+36)
06-09 19:59:19.689  3131  3131 F DEBUG   :     #10 pc 00000000000233bc  /system/lib64/libc.so (__start_thread+68)
06-09 19:59:19.692   251   324 I chatty  : uid=1000(system) HwBinder:251_1 identical 3 lines
06-09 19:59:19.709   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:19.717   261   302 E BufferQueueProducer: [com.google.android.tvlauncher/com.google.android.tvlauncher.HomeScreen#0] disconnect: not connected (req=1)
06-09 19:59:19.717  1136  1343 W libEGL  : EGLNativeWindowType 0x772ba98010 disconnect failed
06-09 19:59:19.727   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:19.744   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:19.753   261   302 W SurfaceFlinger: Attempting to set client state on removed layer: Splash Screen org.xbmc.kodi#0
06-09 19:59:19.753   261   302 W SurfaceFlinger: Attempting to destroy on removed layer: Splash Screen org.xbmc.kodi#0
06-09 19:59:19.762   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:19.776   251   324 I chatty  : uid=1000(system) HwBinder:251_1 identical 1 line
06-09 19:59:19.792   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:20.181   392   392 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_01
06-09 19:59:20.186   460  3138 W ActivityManager:   Force finishing activity org.xbmc.kodi/.Splash
06-09 19:59:20.197   460   475 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
06-09 19:59:20.197   460   475 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
06-09 19:59:20.199   260   260 E lowmemorykiller: Error writing /proc/3100/oom_score_adj; errno=22
06-09 19:59:20.202   460   480 I BootReceiver: Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
06-09 19:59:20.209   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:20.228   460   475 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
06-09 19:59:20.229   460   475 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
06-09 19:59:20.225   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:20.267   460   532 W InputDispatcher: channel 'bd5707c Info (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
06-09 19:59:20.267   460   532 E InputDispatcher: channel 'bd5707c Info (server)' ~ Channel is unrecoverably broken and will be disposed!
06-09 19:59:20.267   460   532 W InputDispatcher: channel '2e61e4e org.xbmc.kodi/org.xbmc.kodi.Splash (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
06-09 19:59:20.267   460   532 E InputDispatcher: channel '2e61e4e org.xbmc.kodi/org.xbmc.kodi.Splash (server)' ~ Channel is unrecoverably broken and will be disposed!
06-09 19:59:20.284   460  1794 I WindowManager: WIN DEATH: Window{2e61e4e u0 org.xbmc.kodi/org.xbmc.kodi.Splash}
06-09 19:59:20.284   460   478 W libprocessgroup: kill(-3100, 9) failed: No such process
06-09 19:59:20.284   460   478 I libprocessgroup: Successfully killed process cgroup uid 10082 pid 3100 in 0ms
06-09 19:59:20.284   460  1794 W InputDispatcher: Attempted to unregister already unregistered input channel '2e61e4e org.xbmc.kodi/org.xbmc.kodi.Splash (server)'
06-09 19:59:20.284   460  1282 I ActivityManager: Process org.xbmc.kodi (pid 3100) has died: vis  +99TOP 
06-09 19:59:20.284   373   373 I Zygote  : Process 3100 exited due to signal (6)
06-09 19:59:20.293   251   324 E hwc_rk  : hwc_get_handle_layername:cann't get value from gralloc
06-09 19:59:20.294   460  2448 I WindowManager: WIN DEATH: Window{bd5707c u0 Info}
06-09 19:59:20.294   460  2448 W InputDispatcher: Attempted to unregister already unregistered input channel 'bd5707c Info (server)'
06-09 19:59:20.304   261   429 W SurfaceFlinger: Attempting to set client state on removed layer: org.xbmc.kodi/org.xbmc.kodi.Splash#0
06-09 19:59:20.304   261   429 W SurfaceFlinger: Attempting to destroy on removed layer: org.xbmc.kodi/org.xbmc.kodi.Splash#0

Hope to see this resolved soon.

Building from source.

It is a bit of a challenge to navigate the rockchip source tree mess, but it is, at least, somewhat buildable.

First of all, a little background.

We have here, 2 devices.
rock960-AB
rock960-C

There is a third device that is nearly identical, but is not in any way 96boards, rather it uses a raspberry pi footprint instead. This would be the RockPI-4 from radxa. I don’t know what the exact relationship is between radxa and vamrs, but the same names are on the git commits and schematics, so the relationship is very close.

At the moment, the radxa/rockpi4 tree is a little newer, with some helpful bug fixes over the vamrs/rock960. In addition, the rock960 instructions have not been updated properly, making it a challenge to follow, so to build the latest Android 9 for rock960, we use the radxa/rockpi4 instructions, with just a couple of very minor changes.

The instructions are in the readme, here:

There is only ONE change needed to switch between rockpi4/rock960ab/rock960c, and that is the kernel device tree. In fact, the rock960c will boot with the rockpi4 device tree, but it takes about 5 minutes longer than it should. Once booted, it works pretty normally, but lets do it right.

Follow the instructions verbatim, until you get to this line;
make rk3399-rockpi-4b.img -j$(nproc)

For rock960ab:
make rk3399-rock960-model-ab.img -j$(nproc)

For rock960c:
make rk3399-rock960-model-c.img -j$(nproc)

** Note: contrary to what you would expect, the compiled device tree is NOT located in the dtb/dtbo partitions, rather it is in the resource partition. So if you want to use a prebuilt rockpi4 image on a rock960, simply replace the contents of that partition with the one matching your device.

And now there is just ONE other change needed, because there is a bug/oversight in one of their scripts. Where the instructions say;

$ cd rockdev
$ ./android-gpt.sh

In between the two lines, add the line;
$ ln -s Image-rk3399_box Image

Alternatively, you can just edit the script on line 3 to target the correct path.

dd the gpt.img to your sdcard and let it boot.

1 Like

@hipboi :

I have discovered that the Mali EGL driver (libGLES_mali.so) has references to the package name of kodi. Specifically, “org.xbmc.kodi”. When I change kodi’s package name, it works correctly. When it has its default name, something in the EGL driver breaks it and it crashes with the error listed in the first post of this thread.

Obviously, I don’t have access to source code for this driver, since Mali is closed source, so somebody on your end needs to take this up with whoever is responsible for that driver in order to have it fixed.