Android Virtual Device - Black screen and I've tried everything - android

This is a fresh install of Android Studios on Ubuntu 16.04.
I just get a black screen on the AVD every time. I been reading related threads tried the following:
Changing to software gpu
many different device profiles
many different andoid system image versions
wiping the user data for the device
both x86 and arm images
both the x86 and x64 emulators
various amount of RAM for each device
running with no skins
And more things that I can't recall right now.
The qemu process does start and consume quite a bit of CPU time, but nothing ever happens. No error messages either. Just hangs up.
My i5 processor does have virtualization support as well.
Before I break down and install windows to get this working, is there anything else I can try?
EDIT: The kernel does boot but enters an infinite loop repeating these messages:
[ 117.942709] init: property_set("ro.boottime.wificond", "117942505853") failed: property already set
[ 117.964867] init: starting service 'netd'...
[ 117.965726] init: property_set("ro.boottime.netd", "117965553859") failed: property already set
[ 117.974155] init: Created socket '/dev/socket/netd', mode 660, user 0, group 1000
[ 117.975147] init: Created socket '/dev/socket/dnsproxyd', mode 660, user 0, group 3003
[ 117.976174] init: Created socket '/dev/socket/mdns', mode 660, user 0, group 1000
[ 117.977136] init: Created socket '/dev/socket/fwmarkd', mode 660, user 0, group 3003
[ 117.989764] init: starting service 'zygote'...
[ 118.000458] init: property_set("ro.boottime.zygote", "118000275846")
failed: property already set
[ 118.010134] init: no such service 'wpa_supplicant'
[ 118.011053] init: Created socket '/dev/socket/zygote', mode 660, user 0, group 1000
[ 122.394998] init: starting service 'surfaceflinger'...
[ 122.396072] init: property_set("ro.boottime.surfaceflinger", "122395874175") failed: property already set
[ 122.397299] init: Failed to bind socket 'pdx/system/vr/display/client': No such file or directory
[ 122.398293] init: Failed to bind socket 'pdx/system/vr/display/manager': No such file or directory
[ 122.399281] init: Failed to bind socket 'pdx/system/vr/display/vsync': No such file or directory
[ 122.454693] healthd: battery l=100 v=5000 t=25.0 h=2 st=2 chg=a
[ 122.486518] init: Service 'surfaceflinger' (pid 2847) killed by signal 6
[ 122.487278] init: Sending signal 9 to service 'surfaceflinger' (pid 2847) process group...
[ 122.488207] init: Successfully killed process cgroup uid 1000 pid 2847 in 0ms
[ 122.489051] init: Sending signal 9 to service 'zygote' (pid 2815) process group...
[ 122.498945] init: Successfully killed process cgroup uid 0 pid 2815 in 9ms
[ 122.500398] init: Service 'zygote' (pid 2815) killed by signal 9
[ 122.501398] init: Unable to open '/sys/android_power/request_state': No such file or directory
[ 122.502779] init: Unable to write to '/sys/power/state': Invalid argument
[ 122.503869] init: Sending signal 9 to service 'audioserver' (pid 2804) process group...
[ 122.511295] init: Successfully killed process cgroup uid 1041 pid 2804 in 6ms
[ 122.513308] init: Sending signal 9 to service 'cameraserver' (pid 2805) process group...
[ 122.521445] init: Successfully killed process cgroup uid 1047 pid 2805 in 6ms
[ 122.522669] init: Sending signal 9 to service 'media' (pid 2806) process group...
[ 122.530468] init: Successfully killed process cgroup uid 1013 pid 2806 in 6ms
[ 122.531675] init: Sending signal 9 to service 'netd' (pid 2814) process group...
[ 122.539229] init: Successfully killed process cgroup uid 0 pid 2814 in 6ms
[ 122.540805] init: Sending signal 9 to service 'wificond' (pid 2812) process
group...
[ 122.548870] init: Successfully killed process cgroup uid 1010 pid 2812 in 6ms
[ 122.550996] init: Service 'audioserver' (pid 2804) killed by signal 9
[ 122.552127] init: Sending signal 9 to service 'audio-hal-2-0' (pid 2807) process group...
[ 122.559507] init: Successfully killed process cgroup uid 1041 pid 2807 in 6ms
[ 122.561085] init: Service 'cameraserver' (pid 2805) killed by signal 9
[ 122.562292] init: Service 'media' (pid 2806) killed by signal 9
[ 122.563413] init: Service 'audio-hal-2-0' (pid 2807) killed by signal 9
[ 122.564576] init: Service 'wificond' (pid 2812) killed by signal 9
[ 122.565608] init: Service 'netd' (pid 2814) killed by signal 9
[ 122.566673] init: Untracked pid 2858 exited with status 0
[ 122.567567] init: Untracked pid 2817 killed by signal 9
[ 122.568495] init: Untracked pid 2818 killed by signal 9
[ 122.569442] init: processing action (init.svc.zygote=stopping) from
(/system/etc/init/bootstat.rc:62)
[ 122.578092] init: starting service 'audioserver'...
[ 122.579401] init: property_set("ro.boottime.audioserver", "122579133766") failed: property already set
[ 122.580660] init: starting service 'cameraserver'...
[ 122.581377] init: property_set("ro.boottime.cameraserver", "122581249935") failed: property already set
[ 122.582626] init: starting service 'media'...
[ 122.583276] init: property_set("ro.boottime.media", "122583158219") failed: property already set
[ 122.600086] init: couldn't write 2865 to /dev/cpuset/camera-daemon/tasks: No such file or directory
[ 122.870197] init: starting service 'audio-hal-2-0'...
[ 122.871067] init: property_set("ro.boottime.audio-hal-2-0", "122870905135") failed: property already set
[ 122.920102] binder: 2864:2864 transaction failed 29189/-22, size 32-0 line 2936
[ 122.921441] binder: 2864:2864 transaction failed 29189/-22, size 32-0 line 2936
[ 122.942631] init: starting service 'wificond'...
[ 122.943501] init: property_set("ro.boottime.wificond", "122943322473") failed: property already set
[ 122.965669] init: starting service 'netd'...
[ 122.966468] init: property_set("ro.boottime.netd", "122966306126") failed: property already set
[ 122.971540] init: Created socket '/dev/socket/netd', mode 660, user 0, group 1000
[ 122.972491] init: Created socket '/dev/socket/dnsproxyd', mode 660, user 0, group 3003
[ 122.973386] init: Created socket '/dev/socket/mdns', mode 660, user 0, group 1000
[ 122.974265] init: Created socket '/dev/socket/fwmarkd', mode 660, user 0, group 3003
[ 123.002232] init: no such service 'wpa_supplicant'
[ 123.002902] init: starting service 'zygote'...
[ 123.003738] init: property_set("ro.boottime.zygote", "123003531647") failed: property already set
[ 123.009193] init: Created socket '/dev/socket/zygote', mode 660, user 0, group 1000

Looks like the kernel is not booting.
try to run this command to see some messages.
cd /path/to/your/sdk/emulator-official
./emulator -show-kernel -avd your-avd-name
Please try the following command to use guest gpu:
./emulator -show-kernel -gpu guest -avd your-avd-name

from: \users\yourUsername\AppData\Local\Android\sdk\platform-tools‌​\
execute following command:
emulator -avd yourAvdDeviceName -netdelay none -netspeed full

Related

Cannot run avd with custom kernel

I want to run a custom kernel build from ci.android.com on an avd. I downloaded the kernel files from here. I start the avd like so - ~/Library/Android/sdk/emulator/emulator -avd Pixel_6_Pro_API_32 -show-kernel -netspeed full -debug init -verbose -writable-system -kernel Image. However the boot fails with the following logs
[ 0.511774][ T1] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[ 0.512810][ T1] ALSA device list:
[ 0.513168][ T1] No soundcards found.
[ 0.513800][ T1] uart-pl011 9000000.pl011: no DMA platform data
[ 0.517151][ T1] Freeing unused kernel memory: 1536K
[ 0.542181][ T1] Run /init as init process
[ 0.551684][ T1] init: init first stage started!
[ 0.552764][ T1] init: Loading module /lib/modules/ac97_bus.ko with args ''
[ 0.553928][ T1] ac97_bus: disagrees about version of symbol module_layout
[ 0.555305][ T1] init: Failed to insmod '/lib/modules/ac97_bus.ko' with args '': Exec format error
[ 0.556731][ T1] init: LoadWithAliases was unable to load ac97_bus
[ 0.557747][ T1] init: Copied ramdisk prop to /second_stage_resources/system/etc/ramdisk/build.prop
[ 0.558989][ T1] init: [libfs_mgr]ReadFstabFromDt(): failed to read fstab from dt
[ 0.560418][ T1] init: Using Android DT directory /proc/device-tree/firmware/android/
[ 0.569781][ T1] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found in /sys, waiting for their uevent(s): metadata, super
VER
I know this is because of the loaded kernel modules. I have the kernel modules as well. But I have no idea how to replace them. I pushed them to /vendor/lib/modules. That didn't help. Any ideas? Thanks!

How to boot a Qualcomm Snapdragon without HDMI

I am developing a video app for a Qualcomm Snapdragon which runs Android. I have an app that takes in a video stream, processes it, and sends a datastream out based on the image. It can also have a mode to display the images to HDMI, but it is not necessary. I have also configured my app to automatically run on startup.
It is important that the system can be started without an HDMI plugged in. However, when starting the system without a monitor plugged in, the boot process gets caught in an infinite loop where it seems to be trying to start video/audio services, failing, and trying again. When the HDMI is plugged in, the system is able to finish booting and then continue to the home screen. Here is the log I obtained over serial that is looped forever when trying to boot without HDMI:
[ 22.471956] init: property_set("ro.boottime.audioserver", "22471598897") failed: property already set
[ 22.481207] init: property_set("ro.boottime.cameraserver", "22480859470") failed: property already set
[ 22.490533] init: property_set("ro.boottime.media", "22490197595") failed: property already set
[ 22.499191] init: property_set("ro.boottime.netd", "22498862751") failed: property already set
[ 22.531151] init: property_set("ro.boottime.wificond", "22530820772") failed: property already set
[ 22.983305] MSM-CPP cpp_init_hardware:1023 stream_cnt:0
[ 23.126367] init: property_set("ro.boottime.zygote", "23125974574") failed: property already set
[ 23.206157] MSM-CPP cpp_init_hardware:1023 stream_cnt:0
[ 23.561725] msm_qti_pp_get_rms_value_control, back not active to query rms be_idx:3
[ 23.573642] msm_voice_sound_focus_get: Error getting Sound Focus Params, err=-22
[ 23.580423] msm_voice_source_tracking_get: Error getting Source Tracking Params, err=-22
[ 23.588465] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 23.594484] msm_audio_sound_focus_get: Could not get copp idx for port_id=16385
[ 23.602184] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 23.608040] msm_audio_source_tracking_get: Could not get copp idx for port_id=16385
[ 23.616115] msm_voice_sound_focus_get: Error getting Sound Focus Params, err=-22
[ 23.623421] msm_voice_source_tracking_get: Error getting Source Tracking Params, err=-22
[ 23.631478] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 23.637464] msm_audio_sound_focus_get: Could not get copp idx for port_id=4101
[ 23.644995] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 23.651027] msm_audio_source_tracking_get: Could not get copp idx for port_id=4101
[ 23.658855] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 23.664939] msm_audio_sound_focus_get: Could not get copp idx for port_id=4103
[ 23.672444] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 23.678435] msm_audio_source_tracking_get: Could not get copp idx for port_id=4103
[ 23.688260] msm_pcm_volume_ctl_get substream runtime not found
[ 23.694029] msm_pcm_volume_ctl_get substream runtime not found
[ 23.699605] msm_pcm_volume_ctl_get substream runtime not found
[ 23.705037] msm_compr_audio_effects_config_get: stream or effects inactive
[ 23.712576] msm_pcm_volume_ctl_get substream runtime not found
[ 23.717709] msm_compr_audio_effects_config_get: stream or effects inactive
[ 23.725125] msm_compr_audio_effects_config_get: stream or effects inactive
[ 23.731802] msm_pcm_volume_ctl_get substream runtime not found
[ 23.737211] msm_pcm_volume_ctl_get substream or runtime not found
[ 23.744698] msm_pcm_volume_ctl_get substream runtime not found
[ 23.749964] msm_compr_audio_effects_config_get: stream or effects inactive
[ 23.757250] msm_compr_audio_effects_config_get: stream or effects inactive
[ 23.764110] msm_compr_audio_effects_config_get: stream or effects inactive
[ 23.770790] msm_compr_audio_effects_config_get: stream or effects inactive
[ 23.777327] msm_compr_audio_effects_config_get: stream or effects inactive
[ 23.784724] msm_compr_audio_effects_config_get: stream or effects inactive
[ 25.705018] init: property_set("ro.boottime.surfaceflinger", "25704640562") failed: property already set
[ 25.705499] init: Failed to bind socket 'pdx/system/vr/display/client': No such file or directory
[ 25.705779] init: Failed to bind socket 'pdx/system/vr/display/manager': No such file or directory
[ 25.706060] init: Failed to bind socket 'pdx/system/vr/display/vsync': No such file or directory
[ 26.052708] init: Unable to open '/sys/android_power/request_state': No such file or directory
[ 26.060404] init: Unable to write to '/sys/power/state': Invalid argument
[ 26.138413] init: property_set("ro.boottime.hwcomposer-2-1", "26138041187") failed: property already set
[ 26.534961] init: property_set("ro.boottime.audio-hal-2-0", "26534542802") failed: property already set
[ 27.048016] msm_qti_pp_get_rms_value_control, back not active to query rms be_idx:3
[ 27.057638] msm_voice_sound_focus_get: Error getting Sound Focus Params, err=-22
[ 27.064137] msm_voice_source_tracking_get: Error getting Source Tracking Params, err=-22
[ 27.072189] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 27.078398] msm_audio_sound_focus_get: Could not get copp idx for port_id=16385
[ 27.085828] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 27.092048] msm_audio_source_tracking_get: Could not get copp idx for port_id=16385
[ 27.099817] msm_voice_sound_focus_get: Error getting Sound Focus Params, err=-22
[ 27.107172] msm_voice_source_tracking_get: Error getting Source Tracking Params, err=-22
[ 27.115220] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 27.121482] msm_audio_sound_focus_get: Could not get copp idx for port_id=4101
[ 27.128760] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 27.135023] msm_audio_source_tracking_get: Could not get copp idx for port_id=4101
[ 27.142667] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 27.148883] msm_audio_sound_focus_get: Could not get copp idx for port_id=4103
[ 27.156218] msm_audio_get_copp_idx_from_port_id: Invalid FE, exiting
[ 27.162444] msm_audio_source_tracking_get: Could not get copp idx for port_id=4103
[ 27.171810] msm_pcm_volume_ctl_get substream runtime not found
[ 27.177051] msm_pcm_volume_ctl_get substream runtime not found
[ 27.182976] msm_pcm_volume_ctl_get substream runtime not found
[ 27.188378] msm_compr_audio_effects_config_get: stream or effects inactive
[ 27.195922] msm_pcm_volume_ctl_get substream runtime not found
[ 27.201188] msm_compr_audio_effects_config_get: stream or effects inactive
[ 27.208164] msm_compr_audio_effects_config_get: stream or effects inactive
[ 27.215088] msm_pcm_volume_ctl_get substream runtime not found
[ 27.220547] msm_pcm_volume_ctl_get substream or runtime not found
[ 27.227649] msm_pcm_volume_ctl_get substream runtime not found
[ 27.232647] msm_compr_audio_effects_config_get: stream or effects inactive
[ 27.239729] msm_compr_audio_effects_config_get: stream or effects inactive
[ 27.246622] msm_compr_audio_effects_config_get: stream or effects inactive
[ 27.253478] msm_compr_audio_effects_config_get: stream or effects inactive
[ 27.260348] msm_compr_audio_effects_config_get: stream or effects inactive
[ 27.267146] msm_compr_audio_effects_config_get: stream or effects inactive
I believe there should be some way to edit the init.rc file to prevent the audio/video services being run at bootup, then register some sort of "hot plug" in ueventd when HDMI is plugged in later, after boot.
While I have looked into these things, I am lost on how to actually go about implementing them and I do not know for sure if this is the correct path. Any help would be much appreciated!
Edit: It seems that the way to properly do this by editing Android source code is way above my pay grade, but an easy fix is to buy an HDMI dummy plug that simulates an HDMI monitor. Basically it just has EDID data in its registers and spits that back out when the operating system initially looks for its display.
DisplayDevice.cpp has lead me to Virtual display composition:
Virtual display composition is similar to external display composition. The difference between virtual display composition and physical display composition is that virtual displays send output to a Gralloc buffer instead of to the screen. Hardware Composer (HWC) writes the output to a buffer, provides the completion fence, and sends the buffer to a consumer (such as the video encoder, GPU, CPU, and so on). Virtual displays can use 2D/blitter or overlays if the display pipeline writes to memory.
Also Virtual displays explains it:
SurfaceFlinger supports an internal display (built into the phone or tablet), external displays (such as a television connected through HDMI), and one or more virtual displays that make composited output available within the system. Virtual displays can be used to record the screen or send the screen over a network. Frames generated for a virtual display are written to a BufferQueue.
One would have to connect a virtual display device, in order to provide the expected output buffer. After a short research, I'm not exactly sure how to accomplish that, but when looking at the log... it seems that it already fucks up when trying to get a display, in order to show the boot animation.
That virtual display device would need to be setup as the primary output buffer.
I'd assume it should be possible to configure that with file system.prop or some *.rc file or any init.*.sh it may reference. TYPE_HDMI = 2 and TYPE_VIRTUAL = 5 ... found in Display.java. It seems the event you are looking for, when plugging in or unplugging the HDMI cable, is DisplayAdapter.DISPLAY_DEVICE_EVENT_CHANGED.
Feel free to post a better answer, in case you can find out how that works.

audio-hal-2-0 not found on booting in android

I'm building android 9 for the Resenas Rcar-H3 board. The building process is successful. But after flash images into the board, The booting process doesn't work correctly. audioserver is restarted by init process and notify several errors like below:
[ 737.947862] init: Service 'audioserver' (pid 2734) exited with status 1
[ 737.954674] init: Sending signal 9 to service 'audioserver' (pid 2734) process group...
[ 737.962915] libprocessgroup: Successfully killed process cgroup uid 1041 pid 2734 in 0ms
[ 737.971171] init: Command 'restart vendor.audio-hal-2-0' action=onrestart (<Service 'audioserver' onrestart>:1) took 0ms and failed: service vendor.audio-hal-2-0 not found
[ 737.986524] init: Command 'restart audio-hal-2-0' action=onrestart (<Service 'audioserver' onrestart>:2) took 0ms and failed: service audio-hal-2-0 not found
[ 742.929725] init: starting service 'audioserver'...
[ 742.964835] init: Service 'audioserver' (pid 2735) exited with status 1
[ 742.971523] init: Sending signal 9 to service 'audioserver' (pid 2735) process group...
[ 742.979681] libprocessgroup: Successfully killed process cgroup uid 1041 pid 2735 in 0ms
[ 742.987951] init: Command 'restart vendor.audio-hal-2-0' action=onrestart (<Service 'audioserver' onrestart>:1) took 0ms and failed: service vendor.audio-hal-2-0 not found
[ 743.003317] init: Command 'restart audio-hal-2-0' action=onrestart (<Service 'audioserver' onrestart>:2) took 0ms and failed: service audio-hal-2-0 not found
[ 747.946500] init: starting service 'audioserver'...
[ 747.981024] init: Service 'audioserver' (pid 2736) exited with status 1
[ 747.987697] init: Sending signal 9 to service 'audioserver' (pid 2736) process group...
[ 747.995844] libprocessgroup: Successfully killed process cgroup uid 1041 pid 2736 in 0ms
[ 748.004108] init: Command 'restart vendor.audio-hal-2-0' action=onrestart (<Service 'audioserver' onrestart>:1) took 0ms and failed: service vendor.audio-hal-2-0 not found
...
Can anyone help me? Thank All!
It looks as if you told init to start vendor.audio-hal-2-0 but did not provide the service definition.
In one of your installed .rc-files there might be a call like this:
start vendor.audio-hal-2-0
You should also have a service definition file that looks somewhat like this:
service vendor.audio-hal-2-0 /vendor/bin/hw/<binary>
<options>
If you don't then you need to create one and if you do it is probably not installed correctly. You can install additional service files in your Android.bp module definition like this:
cc_binary {
[ ... ]
init_rc: [ "vendor.audio-hal-2-0.rc" ],
[...]
}

How to fix sepolicy error in android emulator (goldfish kernel + android-9) boot loop

I want to run custom kernel ( goldfish ) on android-9 (API 28) avd.
So I just downloaded goldfish kernel:
git clone https://android.googlesource.com/kernel/goldfish/ -b android-4.4
make x86_64_ranchu_defconfig
make -j4
then I run emulator :
emulator -avd test -kernel goldfish/arch/x86/boot/bzImage -show-kernel
But there is some error between my kernel and SELinux policy of vendor.
Here the logs:
[ 1.170669] init: init first stage started!
[ 1.172289] init: Using Android DT directory /sys/bus/platform/devices/ANDR0001:00/properties/android/
[ 1.174652] init: First stage mount skipped (missing/incompatible fstab in device tree)
[ 1.176724] init: Skipped setting INIT_AVB_VERSION (not in recovery mode)
[ 1.178464] init: Loading SELinux policy
[ 1.182955] init: No precompiled sepolicy: No such file or directory
[ 1.184557] init: Compiling SELinux policy
[ 1.185672] init: Failed to read /vendor/etc/selinux/plat_sepolicy_vers.txt: No such file or directory
[ 1.188030] init: Unable to load SELinux policy
[ 1.189192] init: Reboot start, reason: reboot, rebootTarget: bootloader
Obviously the system go in boot loop.
How can I fix this?

error while bringup hummingbird A20 with android image

I have been successfully build the android image for the hummingbird and using peonixsuit uploaded the image on board, but not successful in brining the board up following is the log which i am getting in UART0 while booting the board.
Hit any key to stop autoboot: 0
Starting kernel ...
[ 3.294581] init: width = 1024
[ 3.298059] init: height = 600
[ 3.301490] init: s.st_size = 2457600
[ 4.112131] init: do_umount: /data
[ 4.403401] init: do_umount: /cache
[ 4.726198] init: dont need format /dev/block/UDISK
[ 4.944192] init: do_umount: /databk
[ 5.624185] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
[ 6.302551] i2c i2c-1: Invalid 7-bit I2C address 0x00
[ 6.596336] android_usb: already disabled
[ 6.601920] init: using deprecated syntax for specifying property 'sys.usb.config', use ${name} instead
[ 6.649823] init: using deprecated syntax for specifying property 'sys.usb.config', use ${name} instead
[ 31.820483] start_powernow uncare mode:859320624!
[ 32.517665] init: sys_prop: permission denied uid:1003 name:service.bootanim.exit
please help me to solve this issue.

Categories

Resources