on ranchu opengles

795 views
Skip to first unread message

Guang Li

unread,
Mar 17, 2016, 12:10:49 PM3/17/16
to android-em...@googlegroups.com
Hi, All

I checkout ranchu opengles in qemu-android,
but seems it do not work,
I build android ranch target, and can lunch ranch normally,
if turn on opengles propery in init.ranchu.rc, failed to launch ranchu,
so, I miss something?
or, what's the correct way to try opengles support for ranch?

error msg:
init: Service 'surfaceflinger' (pid 810) killed by signal 6
init: Service 'surfaceflinger' (pid 810) killing any children in process group
init: Service 'zygote' is being killed...
...

launch cmd line:
./aarch64-softmmu/qemu-system-aarch64 -cpu cortex-a57 -machine type=ranchu -m 2048 -append "androidboot.selinux=disabled console=ttyAMA0,38400 keep_bootcon earlyprintk=ttyAMA0" -serial mon:stdio -kernel /home/android/prebuilts/qemu-kernel/arm64/kernel-qemu -initrd /home/android/out/target/product/ranchu/ramdisk.img -drive index=2,id=userdata,file=/home/android/out/target/product/ranchu/userdata-qemu.img -device virtio-blk-device,drive=userdata -drive index=1,id=cache,file=/home/android/out/target/product/ranchu/cache.img -device virtio-blk-device,drive=cache -drive index=0,id=system,file=/home/android/out/target/product/ranchu/system.img -device virtio-blk-device,drive=system -netdev user,id=mynet -device virtio-net-device,netdev=mynet -show-cursor

Thanks!
Li Guang

--

Sidere mens eadem mutato

Guang Li

unread,
Mar 21, 2016, 3:45:45 AM3/21/16
to android-em...@googlegroups.com, David Turner
Hi, David


can you give some advice?

Thanks!

David Turner

unread,
Mar 21, 2016, 4:34:30 AM3/21/16
to Guang Li, Android emulator development
How are you building your system image exactly? I don't think there is a build configuration that would put things under out/target/product/ranchu from AOSP, i.e. you should try to build aosp_arm64-eng instead, which will put things in out/target/product/generic_arm64/ instead.
You should also use the 'emulator' launcher to ensure that the underlying emulation engine has the right library search paths and environment variables set.
 
Thanks!
Li Guang

--

Sidere mens eadem mutato

--
You received this message because you are subscribed to the Google Groups "Android emulator development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-emulator...@googlegroups.com.
To post to this group, send email to android-em...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-emulator-dev.
For more options, visit https://groups.google.com/d/optout.

Guang Li

unread,
Mar 22, 2016, 12:01:18 AM3/22/16
to David Turner, Android emulator development
do you mean I have to build the aosp_arm64-eng target then use qemu-system-aarch64 build from qemu-android's opengles branch
instead of the default one?

Guang Li

unread,
Mar 25, 2016, 1:49:28 AM3/25/16
to David Turner, Android emulator development
Hi, David

seems really strange to me after browsing your patches for opengles on qemu-android,
function android_net_pipe_init isn't called anywhere,
so opengles pipe would not pass libGLES info at all,
and, how do you get GPU work?

BTW,
I started qemud on generic_arm64,
turned on opengles propery,
and got message like following,
01-01 00:00:22.343   953   953 D libEGL  : loaded /system/lib64/egl/libEGL_emulation.so
01-01 00:00:22.346   953   953 D libEGL  : loaded /system/lib64/egl/libGLESv1_CM_emulation.so
01-01 00:00:22.402   953   953 D libEGL  : loaded /system/lib64/egl/libGLESv2_emulation.so
01-01 00:00:22.429   953   953 E         : Failed to connect to host (QemuPipeStream)!!!
01-01 00:00:22.430   953   953 E EGL_emulation: Failed to establish connection with the host
01-01 00:00:22.430   953   953 W libEGL  : eglInitialize(0x7f9b500028) failed (EGL_SUCCESS)
01-01 00:00:22.433   953   953 I gralloc : using (fd=11)
01-01 00:00:22.433   953   953 I gralloc : id           =
01-01 00:00:22.433   953   953 I gralloc : xres         = 640 px
01-01 00:00:22.433   953   953 I gralloc : yres         = 480 px
01-01 00:00:22.433   953   953 I gralloc : xres_virtual = 640 px
01-01 00:00:22.433   953   953 I gralloc : yres_virtual = 960 px
01-01 00:00:22.433   953   953 I gralloc : bpp          = 16
01-01 00:00:22.433   953   953 I gralloc : r            = 11:5
01-01 00:00:22.433   953   953 I gralloc : g            =  5:6
01-01 00:00:22.433   953   953 I gralloc : b            =  0:5
01-01 00:00:22.435   953   953 I gralloc : width        = 99 mm (164.202026 dpi)
01-01 00:00:22.435   953   953 I gralloc : height       = 74 mm (164.756760 dpi)
01-01 00:00:22.435   953   953 I gralloc : refresh rate = 60.00 Hz
01-01 00:00:22.439   953   953 E SurfaceFlinger: hwcomposer module not found
01-01 00:00:22.442   953   953 E EGL_emulation: tid 953: eglGetConfigs(552): error 0x3001 (EGL_NOT_INITIALIZED)
01-01 00:00:22.442   953   953 E EGL_emulation: tid 953: eglChooseConfig(574): error 0x3001 (EGL_NOT_INITIALIZED)


Thanks!


2016-03-22 14:44 GMT+08:00 Guang Li <ligu...@gmail.com>:
I tried to do like you suggested, built generic_arm64 target, use emuator wrapper,
if use default qemu-system-aarch64, android launched successfully,
if use my opengles qemu-system-aarch64, failed to startup, logcat like following messages,
and also both failed after opengles property turned on.

logcat messages:

init: cannot find '/system/bin/lmkd', disabling 'lmkd'
init: cannot find '/system/bin/servicemanager', disabling 'servicemanager'
init: cannot find '/system/bin/surfaceflinger', disabling 'surfaceflinger'
init: cannot find '/system/bin/sh', disabling 'console'
init: write_file: Unable to open '/sys/class/android_usb/android0/enable': No such file or directory
init: write_file: Unable to open '/sys/class/android_usb/android0/idVendor': No such file or directory
init: write_file: Unable to open '/sys/class/android_usb/android0/idProduct': No such file or directory
init: write_file: Unable to open '/sys/class/android_usb/android0/functions': No such file or directory
init: write_file: Unable to open '/sys/class/android_usb/android0/enable': No such file or directory
init: Starting service 'adbd'...
binder: 794:794 transaction failed 29189, size 0-0
binder: 794:794 transaction failed 29189, size 0-0
binder: 794:794 transaction failed 29189, size 0-0
...

Thanks!

David Turner

unread,
Mar 25, 2016, 12:02:08 PM3/25/16
to Guang Li, Android emulator development
On Fri, Mar 25, 2016 at 6:49 AM, Guang Li <ligu...@gmail.com> wrote:
Hi, David

seems really strange to me after browsing your patches for opengles on qemu-android,
function android_net_pipe_init isn't called anywhere,
so opengles pipe would not pass libGLES info at all,
and, how do you get GPU work?

At the moment, qemu-android has its own duplicate implementation, the function you're looking for is android_net_pipes_init()
which is actually called.

in this case. I'm working on refactoring all this so that only the shared code in AndroidEmu is used by both codebases though,
but this will take some time to get through.

I'm not sure what you're doing right now that might break GPU emulation with your system images.

Guang Li

unread,
Mar 27, 2016, 11:31:13 PM3/27/16
to David Turner, Android emulator development
Hi, David

2016-03-26 0:02 GMT+08:00 David Turner <di...@google.com>:


On Fri, Mar 25, 2016 at 6:49 AM, Guang Li <ligu...@gmail.com> wrote:
Hi, David

seems really strange to me after browsing your patches for opengles on qemu-android,
function android_net_pipe_init isn't called anywhere,
so opengles pipe would not pass libGLES info at all,
and, how do you get GPU work?

At the moment, qemu-android has its own duplicate implementation, the function you're looking for is android_net_pipes_init()
which is actually called.

in this case. I'm working on refactoring all this so that only the shared code in AndroidEmu is used by both codebases though,
but this will take some time to get through.

so, if I launch emulator command for generic_arm64, it calls qemu-system-aarch64 without AndroidEmu,
right?
 

I'm not sure what you're doing right now that might break GPU emulation with your system images.

and, do you have an emulator version that QEMU2+GPU work normally?
or we also need some time to take opengles to work normally with QEMU2
I don't like qemu1 emulator at all,  maybe I can do some jobs on that.

Thanks!
 

David Turner

unread,
Mar 29, 2016, 5:16:51 PM3/29/16
to Guang Li, David Turner, Android emulator development
On Mon, Mar 28, 2016 at 5:31 AM, Guang Li <ligu...@gmail.com> wrote:
Hi, David

2016-03-26 0:02 GMT+08:00 David Turner <di...@google.com>:


On Fri, Mar 25, 2016 at 6:49 AM, Guang Li <ligu...@gmail.com> wrote:
Hi, David

seems really strange to me after browsing your patches for opengles on qemu-android,
function android_net_pipe_init isn't called anywhere,
so opengles pipe would not pass libGLES info at all,
and, how do you get GPU work?

At the moment, qemu-android has its own duplicate implementation, the function you're looking for is android_net_pipes_init()
which is actually called.

in this case. I'm working on refactoring all this so that only the shared code in AndroidEmu is used by both codebases though,
but this will take some time to get through.

so, if I launch emulator command for generic_arm64, it calls qemu-system-aarch64 without AndroidEmu,
right?
 

When building from AOSP master branch, you should select aosp_<cpu>-eng to build system images that can be launched from the emulator. "generic_<cpu>" is a template build product, I'm not sure it contains all the things you will need for emulation to work correctly.

AndroidEmu is a static library, it's always linked into our QEMU2 binaries (qemu-system-<qemuarch> as opposed to the QEMU1 emulator-<cpu>). It contains code that is shared by both codebases.

Our version of QEMU2 has a number of features that are reimplemented outside of QEMU2, but we're moving them into AndroidEmu. One of the benefits, apart from code sharing, is that we can add unit tests to AndroidEmu in a way that is impossible with the QEMU codebases.
 

I'm not sure what you're doing right now that might break GPU emulation with your system images.

and, do you have an emulator version that QEMU2+GPU work normally?
or we also need some time to take opengles to work normally with QEMU2
I don't like qemu1 emulator at all,  maybe I can do some jobs on that.


It should already be working correctly, but you need to build the right product from AOSP master branch. Anything else is not guaranteed to work.

Also you may want to run the emulator binary built from the AOSP emu-master-dev branch (where all active development happens), the version in master is quite date, and I also need to update the prebuilts found under $AOSP/prebuilts/android-emulator/ at some point.

Guang Li

unread,
Apr 21, 2016, 3:49:42 AM4/21/16
to David Turner, David Turner, Android emulator development
Hi, David

seems runchu emulator on AOSP master branch also didn't work anymore,
I built aosp_arm64-eng, and aosp_x86_64-eng, then, launch emulator,
emulator -ranchu -qemu -enable-kvm,
error msg:
qemu-system-x86_64: goldfish_fb_read: Bad offset 0x0000000000000024
then, android stop at boot logo, adb device offline,
do you have plan to update the emulator?

Thanks!

David Turner

unread,
Apr 26, 2016, 10:36:11 AM4/26/16
to Guang Li, David Turner, Android emulator development
Hello,

On Thu, Apr 21, 2016 at 5:19 AM, Guang Li <ligu...@gmail.com> wrote:
Hi, David

seems runchu emulator on AOSP master branch also didn't work anymore,
I built aosp_arm64-eng, and aosp_x86_64-eng, then, launch emulator,
emulator -ranchu -qemu -enable-kvm,
error msg:
qemu-system-x86_64: goldfish_fb_read: Bad offset 0x0000000000000024
then, android stop at boot logo, adb device offline,
do you have plan to update the emulator?


Yes, I've uploaded the following patch to update them to the latest ToT: https://android-review.googlesource.com/#/c/219786/

Sorry for the annoyance, we tend to test AOSP by launching our own builds directly instead.

Hope this helps

- Digit
Reply all
Reply to author
Forward
0 new messages