[Galaxy Ace S5830 Original Android Development] lagloose:
Hey,

Most important things are already said in first post of this thread. But here some more stuff...

General informations on how all this stuff works can be found here: http://xdaforums.com/showthread.php?t=1379368

There are 2 different 'kind' of solutions floating around at the moment. The first one is implementing HAL (camera.cooper.so) AND llibcamera.so. This is what we have in Jellaxy. See our solution here: https://github.com/Jellaxy/android_device_samsung_msm7x27-common/tree/jellybean/libcamera

The second attempt is to build ONLY HAL and use prebuild libcamera.so from a STOCK Rom. This is i.e. what Wayland does in his CM9. See HAL Sources here: https://github.com/WaylandAce/libcamera

But regardless which solution you choose the way is always: HAL -> libcamera.so -> liboemcamera.so -> kernel

Our solution fails. as you all know, when trying to shoot picture. The reason is a failing 'copy_to_user' instruction in the kernel driver. Open this one: https://github.com/Jellaxy/android_...lykernel/drivers/media/video/msm/msm_camera.c and go to line 1133. This is copy_to_user that fails.

It is most probably a problem with allocated and/or not allocated memory. Bur i still didn't find out where.

So conclusion is, that we can go 2 ways...

- we try to fix the copy_to_user problem in kernel

- we try to use a completely different HAL solution

I already tried Waylands HAL with prebuilt camera libs. This is result in logcat:

I/ActivityManager( 1730): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.camera/.Camera bnds=[80,316][160,413] u=0} from pid 3750

D/PermissionCache( 211): checking android.permission.READ_FRAME_BUFFER for uid=1000 => granted (301 us)

D/memalloc( 211): /dev/pmem: Allocated buffer base:0x4188c000 size:614400 offset:3727360 fd:32

D/memalloc( 1730): /dev/pmem: Mapped buffer base:0x4e808000 size:4341760 offset:3727360 fd:194

I/ActivityManager( 1730): Start proc com.android.camera for activity com.android.camera/.Camera: pid=4669 uid=10023 gids={1006, 1015, 1028}

E/Trace ( 4669): error opening trace file: No such file or directory (2)

D/memalloc( 3750): /dev/pmem: Unmapping buffer base:0x4b2a8000 size:3072000 offset:2457600

D/memalloc( 3750): /dev/pmem: Unmapping buffer base:0x4b6e4000 size:4997120 offset:4382720

D/memalloc( 3750): /dev/pmem: Unmapping buffer base:0x4bbac000 size:5611520 offset:4997120

D/memalloc( 211): /dev/pmem: Freeing buffer base:0x41ae4000 size:614400 offset:2457600 fd:47

D/memalloc( 211): /dev/pmem: Freeing buffer base:0x41cba000 size:614400 offset:4382720 fd:63

I/QualcommCameraHardware( 214): Found a matching camera info for ID 0

I/QualcommCameraHardware( 214): HAL_getCameraInfo: orientation = 90

D/CameraHAL( 214): camera_get_camera_info: id:0 faceing:0 orientation: 90

V/CameraHolder( 4669): open camera 0

D/memalloc( 211): /dev/pmem: Freeing buffer base:0x41d50000 size:614400 offset:4997120 fd:66

I/QualcommCameraHardware( 214): Found a matching camera info for ID 0

I/QualcommCameraHardware( 214): HAL_getCameraInfo: orientation = 90

D/CameraHAL( 214): camera_get_camera_info: id:0 faceing:0 orientation: 90

I/CameraService( 214): Opening camera 0

D/CameraHAL( 214): camera_device open+++

I/QualcommCameraHardware( 214): getCameraInfo: IN

I/QualcommCameraHardware( 214): getCameraInfo: loading libqcamera at 0x4001ade4

I/QualcommCameraHardware( 214): getCameraInfo: numOfCameras = 1

I/QualcommCameraHardware( 214): Camera sensor 0 info:

I/QualcommCameraHardware( 214): camera_id: 0

I/QualcommCameraHardware( 214): modes_supported: 1

I/QualcommCameraHardware( 214): position: 0

I/QualcommCameraHardware( 214): sensor_mount_angle: 90

V/QualcommCameraHardware( 214): getCameraInfo: dlclose(libqcamera)

I/QualcommCameraHardware( 214): getCameraInfo: OUT

I/QualcommCameraHardware( 214): openCameraHardware: call createInstance

I/QualcommCameraHardware( 214): openCameraHardware:Valid camera ID 0

I/QualcommCameraHardware( 214): createInstance: E

I/QualcommCameraHardware( 214): QualcommCameraHardware constructor E

V/QualcommCameraHardware( 214): MMCameraDL: E

V/QualcommCameraHardware( 214): Open MM camera DL libeomcamera loaded at 0x4001ade4

V/QualcommCameraHardware( 214): MMCameraDL: X

V/QualcommCameraHardware( 214): Storing the current target type as 1

V/QualcommCameraHardware( 214): setExifFixAttribute E

V/QualcommCameraHardware( 214): openCamera : E

V/QualcommCameraHardware( 214): setExifFixAttribute X

V/QualcommCameraHardware( 214): constructor EX

I/QualcommCameraHardware( 214): createInstance: created hardware=0x26230

V/QualcommCameraHardware( 214): startCamera E

V/QualcommCameraHardware( 214): loading liboemcamera at 0x4001ade4

V/QualcommCameraHardware( 214): openCamera : X

V/QualcommCameraHardware( 214): startCamera picture_sizes 0xa7758430 PICTURE_SIZE_COUNT 7

V/QualcommCameraHardware( 214): startCamera preview_sizes 0xa7758468 previewSizeCount 5

V/QualcommCameraHardware( 214): startCamera X

I/QualcommCameraHardware( 214): initDefaultParameters E

F/libc ( 214): Fatal signal 8 (SIGFPE) at 0x000000d6 (code=0), thread 4686 (mediaserver)

I/DEBUG ( 209): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG ( 209): Build fingerprint: 'Samsung/cm_cooper/cooper:4.1.1/JRO03L/eng.cas.20120917.223301:userdebug/test-keys'

I/DEBUG ( 209): pid: 214, tid: 4686, name: mediaserver >>> /system/bin/mediaserver <<<

I/DEBUG ( 209): signal 8 (SIGFPE), code -6 (?), fault addr 000000d6

I/DEBUG ( 209): r0 00000000 r1 00000008 r2 00000000 r3 00000028

I/DEBUG ( 209): r4 00000008 r5 00001555 r6 00000000 r7 00000025

I/DEBUG ( 209): r8 41f4bf08 r9 00000000 sl a770ac95 fp 00100000

I/DEBUG ( 209): ip 4009920b sp 4204b930 lr 40099219 pc 400956bc cpsr 00000010

I/DEBUG ( 209): d0 0000000000000000 d1 3ff0000000000000

I/DEBUG ( 209): d2 0000000000000000 d3 0000000000000000

I/DEBUG ( 209): d4 0000000000000000 d5 0000000000000000

I/DEBUG ( 209): d6 7e37e43c8800759c d7 3ff0000000000000

I/DEBUG ( 209): d8 0000000000000000 d9 0000000000000000

I/DEBUG ( 209): d10 0000000000000000 d11 0000000000000000

I/DEBUG ( 209): d12 0000000000000000 d13 0000000000000000

I/DEBUG ( 209): d14 0000000000000000 d15 0000000000000000

I/DEBUG ( 209): scr 20000000

I/DEBUG ( 209):

I/DEBUG ( 209): backtrace:

I/DEBUG ( 209): #00 pc 000136bc /system/lib/libc.so (kill+12)

I/DEBUG ( 209): #01 pc 00017215 /system/lib/libc.so (raise+10)

I/DEBUG ( 209): #02 pc 00001553 <unknown>

I/DEBUG ( 209):

I/DEBUG ( 209): stack:

I/DEBUG ( 209): 4204b8f0 ffffffaf

I/DEBUG ( 209): 4204b8f4 ffffffb1

I/DEBUG ( 209): 4204b8f8 ffffffb2

I/DEBUG ( 209): 4204b8fc ffffffb3

I/DEBUG ( 209): 4204b900 ffffffb4

I/DEBUG ( 209): 4204b904 ffffffb5

I/DEBUG ( 209): 4204b908 ffffffb6

I/DEBUG ( 209): 4204b90c ffffffb7

I/DEBUG ( 209): 4204b910 ffffffb8

I/DEBUG ( 209): 4204b914 ffffffb9

I/DEBUG ( 209): 4204b918 ffffffba

I/DEBUG ( 209): 4204b91c ffffffbb

I/DEBUG ( 209): 4204b920 ffffffbc

I/DEBUG ( 209): 4204b924 ffffffbd

I/DEBUG ( 209): 4204b928 df0027ad

I/DEBUG ( 209): 4204b92c 00000000

I/DEBUG ( 209): #00 4204b930 00000008

I/DEBUG ( 209): ........ ........

I/DEBUG ( 209): #01 4204b930 00000008

I/DEBUG ( 209): 4204b934 00001555

I/DEBUG ( 209): #02 4204b938 00000000

I/DEBUG ( 209): 4204b93c 00004cd4

I/DEBUG ( 209): 4204b940 4009920b /system/lib/libc.so (raise)

I/DEBUG ( 209): 4204b944 40099219 /system/lib/libc.so (raise+14)

I/DEBUG ( 209): 4204b948 a7792a00 /system/lib/liboemcamera.so

I/DEBUG ( 209): 4204b94c 400ba078 /system/lib/libc.so (__aeabi_idiv0+12)

I/DEBUG ( 209): 4204b950 00000000

I/DEBUG ( 209): 4204b954 a77455e7 /system/lib/liboemcamera.so (vfe_set_dimension+458)

I/DEBUG ( 209): 4204b958 00000000

I/DEBUG ( 209): 4204b95c 4204b9d8

I/DEBUG ( 209): 4204b960 a7792a00 /system/lib/liboemcamera.so

I/DEBUG ( 209): 4204b964 41f4bf08

I/DEBUG ( 209): 4204b968 00000000

I/DEBUG ( 209): 4204b96c 4204ba7c

I/DEBUG ( 209): 4204b970 4204ba7c

I/DEBUG ( 209): 4204b974 4204b9d8

I/DEBUG ( 209):

I/DEBUG ( 209): memory near r5:

I/DEBUG ( 209): 00001534 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 00001544 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 00001554 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 00001564 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 00001574 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209):

I/DEBUG ( 209): memory near r8:

I/DEBUG ( 209): 41f4bee8 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 41f4bef8 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 41f4bf08 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 41f4bf18 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 41f4bf28 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209):

I/DEBUG ( 209): memory near sl:

I/DEBUG ( 209): a770ac74 58e06002 ee8af7fc f7fc1c28 bd70ee6a .`.X....(...j.p.

I/DEBUG ( 209): a770ac84 0004d5e6 ffffff94 0008e71a ffffff98 ................

I/DEBUG ( 209): a770ac94 4d65b5f0 49664f65 4d6644ad 44694b66 ..eMeOfI.DfMfKiD

I/DEBUG ( 209): a770aca4 59ee447d 20879001 4e646834 600c2200 }D.Y... 4hdN.".`

I/DEBUG ( 209): a770acb4 496358ec 447e00c7 446f6072 220c4479 .XcI..~Dr`oDyD."

I/DEBUG ( 209):

I/DEBUG ( 209): memory near fp:

I/DEBUG ( 209): 000fffe0 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 000ffff0 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 00100000 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 00100010 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209): 00100020 ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 209):

I/DEBUG ( 209): memory near ip:

I/DEBUG ( 209): 400991e8 b013fe1b 46c0bdf0 0002e366 80045430 .......Ff...0T..

I/DEBUG ( 209): 400991f8 000246b3 9300b507 930117db e8baf7fb .F..............

I/DEBUG ( 209): 40099208 b510bd0e f7fa1c04 1c21ef06 ea4cf7fc ..........!...L.

I/DEBUG ( 209): 40099218 0000bd10 1c02b508 48034902 f7fc2300 .........I.H.#..

I/DEBUG ( 209): 40099228 bd08e872 28121969 fee1dead 2400b513 r...i..(.......$

I/DEBUG ( 209):

I/DEBUG ( 209): memory near sp:

I/DEBUG ( 209): 4204b910 ffffffb8 ffffffb9 ffffffba ffffffbb ................

I/DEBUG ( 209): 4204b920 ffffffbc ffffffbd df0027ad 00000000 .........'......

I/DEBUG ( 209): 4204b930 00000008 00001555 00000000 00004cd4 ....U........L..

I/DEBUG ( 209): 4204b940 4009920b 40099219 a7792a00 400ba078 ...@...@.*y.x..@

I/DEBUG ( 209): 4204b950 00000000 a77455e7 00000000 4204b9d8 .....Ut........B

I/DEBUG ( 209):

I/DEBUG ( 209): code around pc:

I/DEBUG ( 209): 4009569c e3a070f0 ef000000 e8bd0090 e12fff1e .p............/.

I/DEBUG ( 209): 400956ac eaffffea e92d50f0 e3a07025 ef000000 .....P-.%p......

I/DEBUG ( 209): 400956bc e8bd50f0 e1b00000 512fff1e ea009dc4 .P......../Q....

I/DEBUG ( 209): 400956cc e92d50f0 e3a070ee ef000000 e8bd50f0 .P-..p.......P..

I/DEBUG ( 209): 400956dc e1b00000 512fff1e ea009dbd e92d50f0 ....../Q.....P-.

I/DEBUG ( 209):

I/DEBUG ( 209): code around lr:

I/DEBUG ( 209): 400991f8 000246b3 9300b507 930117db e8baf7fb .F..............

I/DEBUG ( 209): 40099208 b510bd0e f7fa1c04 1c21ef06 ea4cf7fc ..........!...L.

I/DEBUG ( 209): 40099218 0000bd10 1c02b508 48034902 f7fc2300 .........I.H.#..

I/DEBUG ( 209): 40099228 bd08e872 28121969 fee1dead 2400b513 r...i..(.......$

I/DEBUG ( 209): 40099238 94019400 ef18f7fb 0000bd16 4d10b570 ............p..M

I/BootReceiver( 1730): Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)

I/ServiceManager( 206): service 'media.audio_flinger' died

I/ServiceManager( 206): service 'media.player' died

I/ServiceManager( 206): service 'media.camera' died

I/ServiceManager( 206): service 'media.audio_policy' died

W/AudioSystem( 4542): AudioFlinger server died!

W/AudioSystem( 3740): AudioFlinger server died!

W/Camera ( 4669): Camera server died!

and to prevent further posts... YES, i have tried different prebuild libs. You can't imagine how many different libs i've tried :)

Ok, that's it for now. If you want more special informations, just ask...

Greetz