51全志R58平台Android4.4下Camera的HAL层修改


51全志R58平台Android4.4下Camera的HAL层修改

2018/11/7 15:20

版本:V1.0

 

 

开发板:SC5806

 

 

1、系统编译:

(略)

 

 

 

 

2、全志R58平台Android4.4下Camera的HAL层在这个目录:

/home/wwt/r58_android_v4.4/android/device/softwinner/octopus-common/hardware/camera

 

可以使用mm编译:

BuildImg 0

Dragon execute image.cfg SUCCESS !

----------image is at----------

 

/home/wwt/r58_android_v4.4/lichee/tools/pack/sun8iw6p1_android_sc5806_uart0.img

 

pack finish

rootroot@cm88:/home/wwt/r58_android_v4.4/android$

rootroot@cm88:/home/wwt/r58_android_v4.4/android$ cd device/softwinner/octopus-common/hardware/

rootroot@cm88:/home/wwt/r58_android_v4.4/android/device/softwinner/octopus-common/hardware$ ll

总用量 20

-rwxrwxr-x 1 rootroot rootroot  682 11月  6 15:09 Android.mk

drwxrwxr-x 2 rootroot rootroot 4096 11月  6 15:09 audio

drwxrwxr-x 4 rootroot rootroot 4096 11月  7 10:10 camera

drwxrwxr-x 2 rootroot rootroot 4096 11月  6 15:09 include

drwxrwxr-x 3 rootroot rootroot 4096 11月  6 15:09 libhardware

rootroot@cm88:/home/wwt/r58_android_v4.4/android/device/softwinner/octopus-common/hardware$ cd camera/

rootroot@cm88:/home/wwt/r58_android_v4.4/android/device/softwinner/octopus-common/hardware/camera$ ll

总用量 940

-rwxrwxr-x 1 rootroot rootroot   2969 11月  6 15:09 Android.mk

-rwxrwxr-x 1 rootroot rootroot   2616 11月  6 15:09 BufferListManager.cpp

-rwxrwxr-x 1 rootroot rootroot    810 11月  6 15:09 BufferListManager.h

-rwxrwxr-x 1 rootroot rootroot  48106 11月  6 15:09 CallbackNotifier.cpp

-rwxrwxr-x 1 rootroot rootroot  12823 11月  6 15:09 CallbackNotifier.h

-rwxrwxr-x 1 rootroot rootroot   1110 11月  6 15:09 CameraDebug.cpp

-rwxrwxr-x 1 rootroot rootroot   3058 11月  6 15:09 CameraDebug.h

-rwxrwxr-x 1 rootroot rootroot 120855 11月  6 15:09 CameraHardware2.cpp

-rwxrwxr-x 1 rootroot rootroot  24391 11月  6 15:09 CameraHardware2.h

-rwxrwxr-x 1 rootroot rootroot  75852 11月  6 15:09 CameraHardware.cpp

-rwxrwxr-x 1 rootroot rootroot  19409 11月  6 15:09 CameraHardware.h

-rwxrwxr-x 1 rootroot rootroot   2356 11月  6 15:09 CameraPlatform.h

-rwxrwxr-x 1 rootroot rootroot   9748 11月  6 15:09 CCameraConfig.cpp

-rwxrwxr-x 1 rootroot rootroot   6227 11月  6 15:09 CCameraConfig.h

-rwxrwxr-x 1 rootroot rootroot  11760 11月  6 15:09 HALCameraFactory.cpp

-rwxrwxr-x 1 rootroot rootroot   3623 11月  6 15:09 HALCameraFactory.h

drwxrwxr-x 2 rootroot rootroot   4096 11月  6 15:09 libfacedetection

-rwxrwxr-x 1 rootroot rootroot  13444 11月  6 15:09 libproc.so

-rwxrwxr-x 1 rootroot rootroot   1416 11月  6 15:09 OSAL_Mutex.c

-rwxrwxr-x 1 rootroot rootroot    415 11月  6 15:09 OSAL_Mutex.h

-rwxrwxr-x 1 rootroot rootroot   4297 11月  6 15:09 OSAL_Queue.c

-rwxrwxr-x 1 rootroot rootroot    912 11月  6 15:09 OSAL_Queue.h

-rwxrwxr-x 1 rootroot rootroot  14594 11月  6 15:09 PreviewWindow.cpp

-rwxrwxr-x 1 rootroot rootroot   5540 11月  6 15:09 PreviewWindow.h

-rwxrwxr-x 1 rootroot rootroot  10318 11月  6 15:09 scaler.c

drwxrwxr-x 2 rootroot rootroot   4096 11月  6 15:09 SceneFactory

-rwxrw-r-- 1 rootroot rootroot  71864 11月  7 10:10 V4L2CameraDevice2.cpp

-rwxrwxr-x 1 rootroot rootroot  17068 11月  6 15:09 V4L2CameraDevice2.h

-rwx------ 1 rootroot rootroot  71802 10月 26 14:38 V4L2CameraDevice2 - 副本 (2).cpp

-rwx------ 1 rootroot rootroot  71802 10月 26 14:38 V4L2CameraDevice2 - 副本 (3)修改完工.cpp

-rw-rw-r-- 1 rootroot rootroot  71455 10月 26 11:01 V4L2CameraDevice2 - 副本.cpp

-rw-rw-r-- 1 rootroot rootroot  17068  5月 12  2016 V4L2CameraDevice2 - 副本.h

-rwxrwxr-x 1 rootroot rootroot  44340 11月  6 15:09 V4L2CameraDevice.cpp

-rwxrwxr-x 1 rootroot rootroot  13544 11月  6 15:09 V4L2CameraDevice.h

-rw-rw-r-- 1 rootroot rootroot  13544  5月 12  2016 V4L2CameraDevice - 副本.h

rootroot@cm88:/home/wwt/r58_android_v4.4/android/device/softwinner/octopus-common/hardware/camera$ mm

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=4.4.4

TARGET_PRODUCT=octopus_sc5806

TARGET_BUILD_VARIANT=eng

TARGET_BUILD_TYPE=release

TARGET_BUILD_APPS=

TARGET_ARCH=arm

TARGET_ARCH_VARIANT=armv7-a-neon

TARGET_CPU_VARIANT=cortex-a7

HOST_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty

HOST_BUILD_TYPE=release

BUILD_ID=KTU84Q

OUT_DIR=out

============================================

PRODUCT_COPY_FILES device/softwinner/octopus-common/hardware/audio/audio_policy.conf:system/etc/audio_policy.conf ignored.

PRODUCT_COPY_FILES device/softwinner/octopus-common/hardware/audio/phone_volume.conf:system/etc/phone_volume.conf ignored.

No private recovery resources for TARGET_DEVICE octopus-sc5806

make:进入目录'/home/wwt/r58_android_v4.4/android'

target thumb C++: camera.octopus <= device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:1108:5: warning: multi-line comment [-Wcomment]

In file included from device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:19:0:

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h: In constructor 'android::V4L2CameraDevice::V4L2CameraDevice(android::CameraHardware*, android::PreviewWindow*, android::CallbackNotifier*)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:521:13: warning: 'android::V4L2CameraDevice::mVideoFormat' will be initialized after [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:481:13: warning:   'int android::V4L2CameraDevice::mFrameRate' [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:292:1: warning:   when initialized here [-Wreorder]

In file included from device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:19:0:

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:592:19: warning: 'android::V4L2CameraDevice::mCurrentV4l2buf' will be initialized after [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:559:13: warning:   'bool android::V4L2CameraDevice::mCanBeDisconnected' [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:292:1: warning:   when initialized here [-Wreorder]

In file included from device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:19:0:

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:584:37: warning: 'android::V4L2CameraDevice::mContinuousPictureAfter' will be initialized after [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:572:34: warning:   'bool android::V4L2CameraDevice::mSmartPictureDone' [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:292:1: warning:   when initialized here [-Wreorder]

In file included from device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:19:0:

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:609:19: warning: 'android::V4L2CameraDevice::mSceneMode' will be initialized after [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:607:13: warning:   'int android::V4L2CameraDevice::mFlashMode' [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:292:1: warning:   when initialized here [-Wreorder]

In file included from device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:19:0:

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:607:13: warning: 'android::V4L2CameraDevice::mFlashMode' will be initialized after [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.h:518:13: warning:   'int android::V4L2CameraDevice::mZoomRatio' [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:292:1: warning:   when initialized here [-Wreorder]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'android::status_t android::V4L2CameraDevice::connectDevice(android::HALCameraInfo*)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:556:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:559:15: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'android::status_t android::V4L2CameraDevice::startDevice(int, int, uint32_t, bool)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:659:2: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:659:2: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:663:2: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:663:2: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:668:2: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:668:2: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:671:2: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:671:2: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getCurrentFaceFrame(void*, int*, int*)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:1739:3: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:1741:40: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::openCameraDev(android::HALCameraInfo*)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:1853:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:1856:15: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'void android::V4L2CameraDevice::closeCameraDev()':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:1866:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:1869:15: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::v4l2QueryBuf()':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2030:63: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::tryFmt(int)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2167:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getAutoFocusStatus()':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2506:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getSnrValue()':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2528:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getGainValue()':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2554:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getExpValue()':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2579:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::setHDRMode(void*)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2604:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getAeStat(isp_stat_buf*)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2622:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getGammaStat(isp_stat_buf*)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2639:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2645:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'void*' [-Wformat]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getHistStat(isp_stat_buf*)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2657:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getSensorType()':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2896:19: warning: NULL used in arithmetic [-Wpointer-arith]

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp: In member function 'int android::V4L2CameraDevice::getExifInfo(isp_exif_attribute*)':

device/softwinner/octopus-common/hardware/camera/V4L2CameraDevice2.cpp:2915:19: warning: NULL used in arithmetic [-Wpointer-arith]

target SharedLib: camera.octopus (out/target/product/octopus-sc5806/obj/SHARED_LIBRARIES/camera.octopus_intermediates/LINKED/camera.octopus.so)

target Symbolic: camera.octopus (out/target/product/octopus-sc5806/symbols/system/lib/hw/camera.octopus.so)

target Strip: camera.octopus (out/target/product/octopus-sc5806/obj/lib/camera.octopus.so)

Install: out/target/product/octopus-sc5806/system/lib/hw/camera.octopus.so

make:离开目录“/home/wwt/r58_android_v4.4/android”

rootroot@cm88:/home/wwt/r58_android_v4.4/android/device/softwinner/octopus-common/hardware/camera$

 

 

在R58的开发板sc5806上面查找camera.octopus.so的位置:

[   10.761187] lowmemorykiller: oom_adj 1 => oom_score_adj 58

[   10.767400] lowmemorykiller: oom_adj 2 => oom_score_adj 117

[   10.773701] lowmemorykiller: oom_adj 3 => oom_score_adj 176

[   10.780092] lowmemorykiller: oom_adj 9 => oom_score_adj 529

[   10.786361] lowmemorykiller: oom_adj 15 => oom_score_adj 1000

[   11.288052] acc_open

[   11.290593] acc_release

[   11.743295] init: no such service 'fuse_sdcard'

[   13.488068] init: sys_prop: permission denied uid:1003  name:service.bootanim.exit

[   13.783140] [dsm] Scene:0 "init" (pid:1)

[   15.982241] [dsm] Scene:1 "init" (pid:1)

[   15.986744] [ddrfreq] DDR: 672000KHz->456000KHz start

[   15.992460] [ddrfreq] current cpu is cpu7

[   15.997031] [ddrfreq] mdfs in cfs mode

[   16.001709] [ddrfreq] elapsed: 280us

[   16.005861] [ddrfreq] DDR: 672000KHz->456000KHz ok!

[   26.647983] [ddrfreq] DDR: 456000KHz->672000KHz start

[   26.660197] [ddrfreq] current cpu is cpu0

[   26.664794] [ddrfreq] mdfs in cfs mode

[   26.674157] [ddrfreq] elapsed: 223us

[   26.678192] [ddrfreq] DDR: 456000KHz->672000KHz ok!

[   27.365067] [dsm] Scene:0 "init" (pid:1)

 

shell@octopus-sc5806:/ $

shell@octopus-sc5806:/ $ lsmod

sunxi_schw 13015 0 - Live 0x00000000 (O)

cdc_ether 3163 0 - Live 0x00000000

rtl8150 9023 0 - Live 0x00000000

mcs7830 5644 0 - Live 0x00000000

qf9700 5904 0 - Live 0x00000000

asix 13590 0 - Live 0x00000000

usbnet 14128 4 cdc_ether,mcs7830,qf9700,asix, Live 0x00000000

bcm_btlpm 7658 0 - Live 0x00000000

bcmdhd 618780 0 - Live 0x00000000

uvcvideo 61280 0 - Live 0x00000000

videobuf2_vmalloc 2308 1 uvcvideo, Live 0x00000000

videobuf2_memops 1802 1 videobuf2_vmalloc, Live 0x00000000

videobuf2_core 18902 1 uvcvideo, Live 0x00000000

pvrsrvkm 279443 26 - Live 0x00000000 (O)

hdmi 38647 0 - Live 0x00000000

disp 1053993 6 hdmi, Live 0x00000000

sunxi_tr 9348 1 disp, Live 0x00000000

nand 299839 0 - Live 0x00000000 (O)

shell@octopus-sc5806:/ $ cd /dev

shell@octopus-sc5806:/dev $ ll v*

crw------- root     root       7,   0 1970-01-02 08:09 vcs

crw------- root     root       7,   1 1970-01-02 08:09 vcs1

crw------- root     root       7, 128 1970-01-02 08:09 vcsa

crw------- root     root       7, 129 1970-01-02 08:09 vcsa1

crwxrwx--- media    media     81,   0 1970-01-02 08:09 video0

shell@octopus-sc5806:/dev $

shell@octopus-sc5806:/dev $ cd /

shell@octopus-sc5806:/ $ find . -name camera.octopus.so

/system/bin/sh: find: not found

127|shell@octopus-sc5806:/ $ busybox

/system/bin/sh: busybox: not found

127|shell@octopus-sc5806:/ $ su

shell@octopus-sc5806:/ # busybox

BusyBox v1.18.3 (2012-12-03 15:06:10 CST) multi-call binary.

Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko

and others. Licensed under GPLv2.

See source distribution for full notice.

 

Usage: busybox [function] [arguments]...

   or: busybox --list[-full]

   or: function [arguments]...

 

BusyBox is a multi-call binary that combines many common Unix

utilities into a single executable.  Most people will create a

link to busybox for each function they wish to use and BusyBox

will act like whatever it was invoked as.

 

Currently defined functions:

[, [[, addgroup, adduser, ar, arping, ash, awk, basename, bunzip2,

bzcat, cat, catv, chattr, chgrp, chmod, chown, chroot, chrt, chvt,

cksum, clear, cmp, cp, cpio, crond, crontab, cut, date, dc, dd,

deallocvt, delgroup, deluser, devmem, df, diff, dirname, dmesg, dnsd,

dnsdomainname, dos2unix, du, dumpkmap, echo, egrep, eject, env,

ether-wake, expr, false, fdflush, fdformat, fdisk, fgrep, find, fold,

free, freeramdisk, fsck, fuser, getopt, getty, grep, gunzip, gzip,

halt, hdparm, head, hexdump, hostid, hostname, hwclock, id, ifconfig,

ifdown, ifup, inetd, init, insmod, install, ionice, iostat, ip, ipaddr,

ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kill, killall,

killall5, klogd, last, length, less, linux32, linux64, linuxrc, ln,

loadfont, loadkmap, logger, login, logname, losetup, ls, lsattr, lsmod,

lspci, lsusb, lzcat, lzma, makedevs, md5sum, mdev, mesg, microcom,

mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.vfat, mknod, mkswap,

mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv,

nameif, netstat, nice, nohup, nslookup, od, openvt, passwd, patch,

pidof, ping, pipe_progress, pivot_root, poweroff, printenv, printf, ps,

pwd, rdate, readahead, readlink, readmbr, readprofile, realpath,

reboot, renice, reset, resize, rm, rmdir, rmmod, route, run-parts,

runlevel, sed, seq, setarch, setconsole, setkeycodes, setlogcons,

setsid, sh, sha1sum, sha256sum, sha512sum, sleep, sort,

start-stop-daemon, strings, stty, su, sulogin, swapoff, swapon,

switch_root, sync, sysctl, syslogd, tail, tar, tee, telnet, test, tftp,

time, top, touch, tr, traceroute, true, tty, udhcpc, umount, uname,

uniq, unix2dos, unlzma, unxz, unzip, uptime, usleep, uudecode,

uuencode, vconfig, vi, vlock, watch, watchdog, wc, wget, which, who,

whoami, xargs, xz, xzcat, yes, zcat

 

shell@octopus-sc5806:/ # find . -name camera.octopus.so

sh: find: not found

127|shell@octopus-sc5806:/ # busybox find . -name camera.octopus.so

./system/lib/hw/camera.octopus.so

find: ./proc/158/task/212/fdinfo/45: No such file or directory

find: ./proc/158/task/212/fdinfo/64: No such file or directory

find: ./proc/158/task/495/fd/77: No such file or directory

find: ./proc/158/fd/57: No such file or directory

find: ./proc/1290/task/1290/fd/80: No such file or directory

find: ./proc/1290/task/1299/fdinfo/79: No such file or directory

find: ./proc/1290/task/1324/fd/80: No such file or directory

find: ./proc/1290/task/1324/fdinfo/71: No such file or directory

find: ./proc/1290/task/1370/fdinfo/71: No such file or directory

find: ./proc/1290/task/1435/fdinfo/71: No such file or directory

find: ./proc/1290/task/1435/fdinfo/77: No such file or directory

find: ./proc/2121: No such file or directory

find: ./proc/2122: No such file or directory

find: ./proc/2123: No such file or directory

1|shell@octopus-sc5806:/ #

 

 

通过adb将修改过的camera.octopus.so文件推送到开发板SC5806上。(注意修改权限)

Microsoft Windows [版本 6.1.7600]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

 

C:\Users\Administrator>adb shell

root@octopus-sc5806:/ # cd /dev

cd /dev

root@octopus-sc5806:/dev # ll v*

ll v*

crw------- root     root       7,   0 1970-01-01 09:07 vcs

crw------- root     root       7,   1 1970-01-01 09:07 vcs1

crw------- root     root       7, 128 1970-01-01 09:07 vcsa

crw------- root     root       7, 129 1970-01-01 09:07 vcsa1

crwxrwx--- media    media     81,   0 1970-01-02 08:02 video0

root@octopus-sc5806:/dev #

C:\Users\Administrator>cd W:\r58_android_v4.4\android\out\target\product\octopus-sc5806\system\lib\hw

 

C:\Users\Administrator>w:

 

W:\r58_android_v4.4\android\out\target\product\octopus-sc5806\system\lib\hw>dir

 驱动器 W 中的卷是 rootroot

 卷的序列号是 940F-E71D

 

 W:\r58_android_v4.4\android\out\target\product\octopus-sc5806\system\lib\hw 的目录

 

2018/11/06  16:20    <DIR>          .

2018/11/06  16:23    <DIR>          ..

2018/11/06  16:17             9,540 audio.a2dp.default.so

2018/11/06  16:16             5,396 local_time.default.so

2018/11/06  16:17             9,484 keystore.exdroid.so

2018/11/06  16:16             9,820 gralloc.default.so

2018/11/06  16:17            30,204 audio.primary.octopus.so

2018/11/06  16:16             5,400 audio.primary.default.so

2018/11/06  16:16             5,396 power.default.so

2018/11/06  16:17             5,436 audio.usb.default.so

2018/11/06  16:16           130,932 sensors.exdroid.so

2018/11/06  16:17            26,460 hwcomposer.octopus.so

2018/11/06  16:16             5,388 lights.octopus.so

2018/11/07  10:11           136,760 camera.octopus.so

2018/11/06  16:17            75,272 audio_policy.default.so

2018/11/06  16:17             5,392 keystore.default.so

2018/11/06  16:20            17,800 audio.r_submix.default.so

2018/11/06  16:17         1,073,172 bluetooth.default.so

              16 个文件      1,551,852 字节

               2 个目录 96,538,443,776 可用字节

 

W:\r58_android_v4.4\android\out\target\product\octopus-sc5806\system\lib\hw>adb push camera.octopus.so /system/lib/hw/

failed to copy 'camera.octopus.so' to '/system/lib/hw//camera.octopus.so': Read-only file system

 

W:\r58_android_v4.4\android\out\target\product\octopus-sc5806\system\lib\hw>adb remount

remount succeeded

 

W:\r58_android_v4.4\android\out\target\product\octopus-sc5806\system\lib\hw>adb push camera.octopus.so /system/lib/hw/

661 KB/s (136760 bytes in 0.202s)

 

 

修改权限:

1|shell@octopus-sc5806:/ #

1|shell@octopus-sc5806:/ # cd /system/lib/hw/                                  

shell@octopus-sc5806:/system/lib/hw #

(通过adb推入camera.octopus.so之前的权限:)

shell@octopus-sc5806:/system/lib/hw # ll

-rw-r--r-- root     root         9540 2018-11-06 16:17 audio.a2dp.default.so

-rw-r--r-- root     root         5400 2018-11-06 16:16 audio.primary.default.so

-rw-r--r-- root     root        30204 2018-11-06 16:17 audio.primary.octopus.so

-rw-r--r-- root     root        17800 2018-11-06 16:20 audio.r_submix.default.so

-rw-r--r-- root     root         5436 2018-11-06 16:17 audio.usb.default.so

-rw-r--r-- root     root        75272 2018-11-06 16:17 audio_policy.default.so

-rw-r--r-- root     root      1073172 2018-11-06 16:17 bluetooth.default.so

-rw-r--r-- root     root       136760 2018-11-06 16:17 camera.octopus.so

-rw-r--r-- root     root         9820 2018-11-06 16:16 gralloc.default.so

-rw-r--r-- root     root        26460 2018-11-06 16:17 hwcomposer.octopus.so

-rw-r--r-- root     root         5392 2018-11-06 16:17 keystore.default.so

-rw-r--r-- root     root         9484 2018-11-06 16:17 keystore.exdroid.so

-rw-r--r-- root     root         5388 2018-11-06 16:16 lights.octopus.so

-rw-r--r-- root     root         5396 2018-11-06 16:16 local_time.default.so

-rw-r--r-- root     root         5396 2018-11-06 16:16 power.default.so

-rw-r--r-- root     root       130932 2018-11-06 16:16 sensors.exdroid.so

shell@octopus-sc5806:/system/lib/hw #

shell@octopus-sc5806:/system/lib/hw # [  354.337386] EXT4-fs (mmcblk0p7): re-mounted. Opts: (null)

shell@octopus-sc5806:/system/lib/hw #

(通过adb推入camera.octopus.so之后的权限:)

shell@octopus-sc5806:/system/lib/hw # ll

-rw-r--r-- root     root         9540 2018-11-06 16:17 audio.a2dp.default.so

-rw-r--r-- root     root         5400 2018-11-06 16:16 audio.primary.default.so

-rw-r--r-- root     root        30204 2018-11-06 16:17 audio.primary.octopus.so

-rw-r--r-- root     root        17800 2018-11-06 16:20 audio.r_submix.default.so

-rw-r--r-- root     root         5436 2018-11-06 16:17 audio.usb.default.so

-rw-r--r-- root     root        75272 2018-11-06 16:17 audio_policy.default.so

-rw-r--r-- root     root      1073172 2018-11-06 16:17 bluetooth.default.so

-rw-rw-rw- root     root       136760 2018-11-07 10:11 camera.octopus.so

-rw-r--r-- root     root         9820 2018-11-06 16:16 gralloc.default.so

-rw-r--r-- root     root        26460 2018-11-06 16:17 hwcomposer.octopus.so

-rw-r--r-- root     root         5392 2018-11-06 16:17 keystore.default.so

-rw-r--r-- root     root         9484 2018-11-06 16:17 keystore.exdroid.so

-rw-r--r-- root     root         5388 2018-11-06 16:16 lights.octopus.so

-rw-r--r-- root     root         5396 2018-11-06 16:16 local_time.default.so

-rw-r--r-- root     root         5396 2018-11-06 16:16 power.default.so

-rw-r--r-- root     root       130932 2018-11-06 16:16 sensors.exdroid.so

shell@octopus-sc5806:/system/lib/hw # chmod 644 camera.octopus.so

shell@octopus-sc5806:/system/lib/hw #

shell@octopus-sc5806:/system/lib/hw # sync

shell@octopus-sc5806:/system/lib/hw # ll

-rw-r--r-- root     root         9540 2018-11-06 16:17 audio.a2dp.default.so

-rw-r--r-- root     root         5400 2018-11-06 16:16 audio.primary.default.so

-rw-r--r-- root     root        30204 2018-11-06 16:17 audio.primary.octopus.so

-rw-r--r-- root     root        17800 2018-11-06 16:20 audio.r_submix.default.so

-rw-r--r-- root     root         5436 2018-11-06 16:17 audio.usb.default.so

-rw-r--r-- root     root        75272 2018-11-06 16:17 audio_policy.default.so

-rw-r--r-- root     root      1073172 2018-11-06 16:17 bluetooth.default.so

-rw-r--r-- root     root       136760 2018-11-07 10:11 camera.octopus.so

-rw-r--r-- root     root         9820 2018-11-06 16:16 gralloc.default.so

-rw-r--r-- root     root        26460 2018-11-06 16:17 hwcomposer.octopus.so

-rw-r--r-- root     root         5392 2018-11-06 16:17 keystore.default.so

-rw-r--r-- root     root         9484 2018-11-06 16:17 keystore.exdroid.so

-rw-r--r-- root     root         5388 2018-11-06 16:16 lights.octopus.so

-rw-r--r-- root     root         5396 2018-11-06 16:16 local_time.default.so

-rw-r--r-- root     root         5396 2018-11-06 16:16 power.default.so

-rw-r--r-- root     root[  366.771164] healthd: battery l=100 v=0 t=30.0 h=2 st=5 c=0 chg=au

       130932 2018-11-06 16:16 sensors.exdroid.so

shell@octopus-sc5806:/system/lib/hw #

 

 

重启即生效。

可以看见LOGV的打印生效,文件名、行号以及函数名都可以打印出来,但是printf无效。

printf("**** %s-%d-%s \n", __FILE__, __LINE__, __func__);

LOGV("**** %s-%d-%s ", __FILE__, __LINE__, __func__);

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值