android - Droid's mediaserver dies on camera.takePicture() -
on motorola droid, firmware 2.1-update1, kernel 2.9.29-omap1, build # ese81
when attempting take picture, mediaserver dies segmentation fault.
i've tried putting takepicture
in timer , running few seconds after camera initialization check race conditions, no change. calling camera.open()
doesn't cause crash. also, calling camera.open()
causes think autofocus motor make sort of ticking sound.
code breaks:
import android.app.activity; import android.os.bundle; public final class choppermain extends activity { public void oncreate(bundle savedinstancestate) { try { camera camera = camera.open(); catch (exception e) { e.printstacktrace(); } camera.takepicture( new camera.shuttercallback() { public void onshutter() { ; } }, new camera.picturecallback() { public void onpicturetaken(byte[] data, camera camera) { ; } }, new camera.picturecallback() { public void onpicturetaken(byte[] data, camera camera) { ; } }, new picturecallback() { public void onpicturetaken(byte[] data, camera camera) { system.out.println("ta da."); } } }); } catch (exception e) { e.printstacktrace(); } } }
debug log:
d/camerahal(10158): camerasettings constructor d/camerahal(10158): camerahal constructor d/camerahal(10158): model id: droid d/camerahal(10158): software id 2.1-update1 d/dalvikvm( 988): gc freed 2 objects / 56 bytes in 215ms d/viewflipper( 1074): updaterunning() mvisible=false, mstarted=true, muserpresent=false, mrunning=false i/hpandroidhal(10158): version 2988. build time: oct 26 2009:11:21:55. d/camerahal(10158): 19 default parameters d/camerahal(10158): immediate zoom/1:0. current zoom level/1:0 d/camerahal(10158): camerahal constructor exited ok d/cameraservice(10158): client::client x (pid 10400) d/cameraservice(10158): cameraservice::connect x d/cameraservice(10158): takepicture (pid 10400) i/debug (10159): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** i/debug (10159): build fingerprint: 'verizon/voles/sholes/sholes:2.1-update1/ese81/29593:user/release-keys' i/debug (10159): pid: 10158, tid: 10158 >>> /system/bin/mediaserver <<< i/debug (10159): signal 11 (sigsegv), fault addr 00000008 i/debug (10159): r0 00000000 r1 00000000 r2 a969030c r3 a9d1bfe0 i/debug (10159): r4 00045eb0 r5 0000eb10 r6 000153a0 r7 a9c89fd2 i/debug (10159): r8 00000000 r9 00000000 10 00000000 fp 00000000 i/debug (10159): ip a969085c sp bec4fba0 lr a9689c65 pc a9d1bfde cpsr 60000030 i/debug (10159): #00 pc 0001bfde /system/lib/libutils.so i/debug (10159): #01 pc 00009c62 /system/lib/libcamera.so i/debug (10159): #02 pc 00007b0c /system/lib/libcameraservice.so i/debug (10159): #03 pc 00021f98 /system/lib/libui.so i/debug (10159): #04 pc 00015514 /system/lib/libbinder.so i/debug (10159): #05 pc 00018dd8 /system/lib/libbinder.so i/debug (10159): #06 pc 00018fa6 /system/lib/libbinder.so i/debug (10159): #07 pc 000087d2 /system/bin/mediaserver i/debug (10159): #08 pc 0000c228 /system/lib/libc.so i/debug (10159): i/debug (10159): code around pc: i/debug (10159): a9d1bfcc bd1061e3 f7f3b510 bd10e97e 4d17b570 i/debug (10159): a9d1bfdc 6886a300 460418ed fff4f7ff d10a4286 i/debug (10159): a9d1bfec 46234913 20054a13 f06f1869 18aa040a i/debug (10159): i/debug (10159): code around lr: i/debug (10159): a9689c54 e0240412 0204f8d0 050cf104 edf0f7fd i/debug (10159): a9689c64 f7fd4628 f8d4ecf2 b1533204 f852681a i/debug (10159): a9689c74 18581c0c 7101f504 ed82f7fd f8c42000 i/debug (10159): i/debug (10159): stack: i/debug (10159): bec4fb60 4000902c /dev/binder i/debug (10159): bec4fb64 a9d19675 /system/lib/libutils.so i/debug (10159): bec4fb68 00002bb4 i/debug (10159): bec4fb6c a9d1b26f /system/lib/libutils.so i/debug (10159): bec4fb70 bec4fbbc [stack] i/debug (10159): bec4fb74 00095080 [heap] i/debug (10159): bec4fb78 a9c8c028 /system/lib/libcameraservice.so i/debug (10159): bec4fb7c a9c8c028 /system/lib/libcameraservice.so i/debug (10159): bec4fb80 00015390 [heap] i/debug (10159): bec4fb84 a9c89fd2 /system/lib/libcameraservice.so i/debug (10159): bec4fb88 00045ebc [heap] i/debug (10159): bec4fb8c afe0f110 /system/lib/libc.so i/debug (10159): bec4fb90 00000000 i/debug (10159): bec4fb94 afe0f028 /system/lib/libc.so i/debug (10159): bec4fb98 df002777 i/debug (10159): bec4fb9c e3a070ad i/debug (10159): #00 bec4fba0 00045eb0 [heap] i/debug (10159): bec4fba4 00045ebc [heap] i/debug (10159): bec4fba8 000153a0 [heap] i/debug (10159): bec4fbac a9689c65 /system/lib/libcamera.so i/debug (10159): #01 bec4fbb0 a9c8c028 /system/lib/libcameraservice.so i/debug (10159): bec4fbb4 00015390 [heap] i/debug (10159): bec4fbb8 000153a0 [heap] i/debug (10159): bec4fbbc a9c87b0f /system/lib/libcameraservice.so i/debug (10159): debuggerd committing suicide free zombie! i/debug (10426): debuggerd: mar 22 2010 17:31:05 w/mediaplayer( 1021): mediaplayer server died! i/servicemanager( 984): service 'media.audio_flinger' died i/servicemanager( 984): service 'media.player' died i/servicemanager( 984): service 'media.camera' died i/servicemanager( 984): service 'media.audio_policy' died w/camera (10400): camera server died! w/camera (10400): icamera died e/camera (10400): error 100 i/system.out(10400): camera error, code 100 w/audiosystem( 1021): audioflinger server died! w/audiosystem( 1021): audiopolicyservice server died! i/ (10425): servicemanager: 0xad08 e/audiopostprocessor(10425): e/audiopostprocessor(10425): audiomgr error:failed open gains file /data/ap_gain.bin e/audiopostprocessor(10425): e/audiopostprocessor(10425): audiomgr error:failed read gains/coeffs /data e/audiopostprocessor(10425): audio coeffs init success. i/cameraservice(10425): cameraservice started: pid=10425 d/audio_unsolicited(10425): in readytorun d/audio_unsolicited(10425): create socket successful 10 i/audioflinger(10425): audioflinger's thread 0x11c30 ready run e/audioservice( 1021): media server died. e/audioservice( 1021): media server started. w/audiopolicymanager(10425): setphonestate() setting same state 0
you missing of code necessary work camera
. here sample project more complete.
Comments
Post a Comment