Platform: RK3399
OS: Android 7.1
Board: Firefly-RK3399
背景:
在调试usb camera的时候,因为有异常,因此单独编译了so库调试,第一反应是系统用的是64位库,路径是 out/xxx/system/lib64/hw下,但是测试发现,系统用的是out/xxx/system/lib/hw下的camera so库。
分析:
找到异常点log
264 1088 E CameraHal: setParameters(627): previewsize(640x480) not supported
进程号是264
查看对应的进程
1|rk3399_firefly_edp_box:/ # ps | grep 264
cameraserver 264 1 57116 24276 binder_thr 00f59008e8 S /system/bin/cameraserver
对应进程是cameraserver,路径在frameworks/av/camera/cameraserver
查看cameraserver的格式
kris@eco:~/firefly_rk3399/out/target/product/rk3399_firefly_edp_box/system/bin$ readelf -h cameraserver
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: ARM
Version: 0x1
Entry point address: 0x9b8
Start of program headers: 52 (bytes into file)
Start of section headers: 12800 (bytes into file)
Flags: 0x5000200, Version5 EABI, soft-float ABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 9
Size of section headers: 40 (bytes)
Number of section headers: 28
Section header string table index: 27
也就是说此进程是编译成32位的,那么它对应加载的库也是32的,因此加载的是 system/lib/hw下的camera.rk30board.so
为什么会编译成32位的? Android.mk中有
LOCAL_MODULE:= cameraserver
LOCAL_32_BIT_ONLY := true
LOCAL_32_BIT_ONLY表示编译成32bit,答案揭晓。
原作者:KrisFei
|