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!
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.
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" ],
[...]
}
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?
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.