• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [DEV] WIP CM9 (Camera) [updated 2/23/2013]

No it's not dead, I am healing from getting all my wisdom teeth pulled on Tuesday
stickyman.gif
I worked on the camera a little yesterday using dorreygaray's hacks but no dice on the camerahal loading. I am rolling back to using Tom Giordano camerahal since he has the same camera as us and I have gotten the camerahal to load using his source. I believe the key is our kernel is not using the 3G VMSPLIT. Almost every kernel I look at that has successfully had the camerahal work in CM9 is using the 3GVMSPLIT. So honestly I think I have resolved the camera in the past just didn't have enough memory from the kernel to run the camera. Give me some time, I am sure I will make some headway soon. May just get lucky and solve this before Christmas!

Woah- hope they knocked you out good for it- had that done as a teen with just Novocaine...not a smart decision. :(

Hope you're feeling better!
 
Could someone explain the difference between 2g and 3g split in lamans terms? It would be appreciated lol

I don't really know the specifics but the vmsplit 2g and 3g control the way virtual memory is alloted throughout the system...i dont know the difference between the two but g60 says that nearly all ics phones with cam working are using the 3gvmsplit...i trust in him and all the mtdevs enough to just let them deal with the specifics and hope they can solve the memory shortage for the camerahal...but i think they are going about this the best possible way with using true source code for the fixes and not glitchy patchwork...we will have camera soon i can feel it!
 
The difference is the way the memory is handled. Here is an example of the camerahal loading with 2g notice the 0x7000e9c0

Code:
09-04 06:33:35.365: D/CameraHAL(130): CameraHAL_GetNum_Cameras: loading libcamera at 0x7000e9c0
09-04 06:33:35.365: V/CameraHolder(1129): open camera 0
09-04 06:33:35.365: D/CameraHAL(130): CameraHAL_GetNum_Cameras: loading libcamera at 0x7000e9c0
09-04 06:33:35.365: I/CameraService(130): Opening camera 0
09-04 06:33:35.365: D/CameraHAL(130): qcamera_device_open: name:0 device:0x233ec cameraId:0
09-04 06:33:35.365: D/CameraHAL(130): loading libcamera at 0x7000e9c0
09-04 06:33:35.365: D/QualcommCameraHardware(130): createInstance: E
09-04 06:33:35.405: I/QualcommCameraHardware(130): startCamera: camsensor name mt9p111, flash 1
09-04 06:33:35.735: A/libc(130): Fatal signal 8 (SIGFPE) at 0x00000082 (code=0)
09-04 06:33:36.035: A/libc(130): Fatal signal 11 (SIGSEGV) at 0x00000116 (code=1)

and here is the camerahal with 3g at 0xb000e9c0

Code:
11-02 06:41:10.840: D/CameraHAL(129): CameraHAL_GetNum_Cameras: loading libcamera at 0xb000e9c0
11-02 06:41:10.840: V/CameraHolder(853): open camera 0
11-02 06:41:10.840: D/CameraHAL(129): CameraHAL_GetNum_Cameras: loading libcamera at 0xb000e9c0
11-02 06:41:10.840: I/CameraService(129): Opening camera 0
11-02 06:41:10.840: D/CameraHAL(129): qcamera_device_open: name:0 device:0x1eea4 cameraId:0
11-02 06:41:10.840: D/CameraHAL(129): loading libcamera at 0xb000e9c0
11-02 06:41:10.840: D/QualcommCameraHardware(129): createInstance: E
11-02 06:41:10.880: A/libc(129): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

The difference now is there is enough virtual memory in the 3G VMSPLIT to run the camera libs properly. I am also able to use tjstyle's camera files and boot them up, but still no dice yet with a working camera. I know we are in the home stretch at this point. I can almost taste it!
 
Did using new kernel seem to give any kind of boost to the rom? Just wonderin

No, as a matter of fact more RAM is now being used from the system so it's showing 227MB free all the time. But this was the whole change with ICS is it's using more RAM to run apps virtually so it seems faster than say GB or Froyo. The speed boost is still there but maybe degraded as you run more apps as we only have 512MB of RAM.
 
The difference is the way the memory is handled. Here is an example of the camerahal loading with 2g notice the 0x7000e9c0

Code:
09-04 06:33:35.365: D/CameraHAL(130): CameraHAL_GetNum_Cameras: loading libcamera at 0x7000e9c0
09-04 06:33:35.365: V/CameraHolder(1129): open camera 0
09-04 06:33:35.365: D/CameraHAL(130): CameraHAL_GetNum_Cameras: loading libcamera at 0x7000e9c0
09-04 06:33:35.365: I/CameraService(130): Opening camera 0
09-04 06:33:35.365: D/CameraHAL(130): qcamera_device_open: name:0 device:0x233ec cameraId:0
09-04 06:33:35.365: D/CameraHAL(130): loading libcamera at 0x7000e9c0
09-04 06:33:35.365: D/QualcommCameraHardware(130): createInstance: E
09-04 06:33:35.405: I/QualcommCameraHardware(130): startCamera: camsensor name mt9p111, flash 1
09-04 06:33:35.735: A/libc(130): Fatal signal 8 (SIGFPE) at 0x00000082 (code=0)
09-04 06:33:36.035: A/libc(130): Fatal signal 11 (SIGSEGV) at 0x00000116 (code=1)

and here is the camerahal with 3g at 0xb000e9c0

Code:
11-02 06:41:10.840: D/CameraHAL(129): CameraHAL_GetNum_Cameras: loading libcamera at 0xb000e9c0
11-02 06:41:10.840: V/CameraHolder(853): open camera 0
11-02 06:41:10.840: D/CameraHAL(129): CameraHAL_GetNum_Cameras: loading libcamera at 0xb000e9c0
11-02 06:41:10.840: I/CameraService(129): Opening camera 0
11-02 06:41:10.840: D/CameraHAL(129): qcamera_device_open: name:0 device:0x1eea4 cameraId:0
11-02 06:41:10.840: D/CameraHAL(129): loading libcamera at 0xb000e9c0
11-02 06:41:10.840: D/QualcommCameraHardware(129): createInstance: E
11-02 06:41:10.880: A/libc(129): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

I see a fatal error cleared up. And camera trying to load. Other thank that, I have no idea whatany of that means. You are a mad man. My f5 key is broken now.
 
Been watching this thread closely for a while now. Actually, I check all the MTDev threads multiple times each day. G60, you are the main reason I still have a Triumph. Thanks for making my phone rock again! Cant wait for camera to be fixed... thats the only thing keeping this ROM from being used daily.
 
Had never flashed a phone before, but did it last night with this ROM 10-28th, and it works perfectly. My previous crappy brick of a phone is now nice and fast again with ICS no less. Unbelievable...

Thanks Again!!
 
Wonder why its throwing a error from libc? Is it cause the camera Hal is calling some function in libc thats not there?
 
Wonder why its throwing a error from libc? Is it cause the camera Hal is calling some function in libc thats not there?

No clue this is all new ground for me. I have been trying to use tjstyles camerhal he rewrote from dzo but no luck with it yet. The key to these camerhals is we need to make proper calls to the gb camera lib files to make them work. Once the wrapper works right it creates the lib/hw/camera.msm7x30.so. I'm taking a break for a while but will try some more this weekend.
 
After further reading, signal 11 sigsegv is a segmentation fault where our program, the camerahal denoted as process 169, attempts to access a memory location that has not been allocated. So maybe the kernel isn't setting aside the righht amount of memory or not in the right space or something. Cause if I'm not mistaken the kernel is supposed to set aside the memory for the camera. I could be wrong tgoygg as this is all new to me as well!

Definatly making progress though!!
 
I think I flashed this one, if it's the 1028 link. Pretty darn smooth. Reminds me of my nexus 7 ; going bare bones on the apps till the camera is up and running. I don't have Facebook contacts sync, if that's been mentioned. Pretty sweet so far : )
 
Facebook contacts sync is a noted issue and someone posted a fix somewhere (I don't remember which thread though, there are two).


Another issue I just recently found which is quite minor is that when you turn caps-lock on, type something, and then turn it back off, the keyboard keeps displaying all capital letters until you push one, then just that one goes to lowercase. Can anyone else confirm this? (Long-press shift to get caps-lock on)
 
Facebook contacts sync is a noted issue and someone posted a fix somewhere (I don't remember which thread though, there are two).


Another issue I just recently found which is quite minor is that when you turn caps-lock on, type something, and then turn it back off, the keyboard keeps displaying all capital letters until you push one, then just that one goes to lowercase. Can anyone else confirm this? (Long-press shift to get caps-lock on)


An app called HaxSync can do the trick.
 
Hey g60 after more talking with my brother he said a seg fault happens when a set of instructions request information that is split between multiple pages so the kernel tries to load all the pages where the information is contained and if the information requested is too much larger than the memory page size, it will continuously seg fault causing a fatal error.

He said it sounds like the camera hal is running out of ram which we already suspected, but he said it sounds like we need to allocate more memory for the camera in the kernel. So I'm going to try to find where the memory is allocated for the camera in the kernel source!
 
Hey g60 after more talking with my brother he said a seg fault happens when a set of instructions request information that is split between multiple pages so the kernel tries to load all the pages where the information is contained and if the information requested is too much larger than the memory page size, it will continuously seg fault causing a fatal error.

He said it sounds like the camera hal is running out of ram which we already suspected, but he said it sounds like we need to allocate more memory for the camera in the kernel. So I'm going to try to find where the memory is allocated for the camera in the kernel source!

Crap is that all it is? That's easy

Is the line you are referring to?

https://github.com/g60madman/androi...ob/ics/arch/arm/mach-msm/board-msm7x30.c#L164
 
Bahaha lol looks exactly it to me! See my brother used to have a captivate and they had "bigmem" kernels that squeezed more memory out to the user by allocating less to the camera, but it broke 720p recording. Maybe ours don't have enough memory to even load the ics hal!

And I'm pretty sure all the camera libs don't use the standard memory available to the apps, although the actual camera.apk itself does, the libs run in the allocated memory by the kernel, just as the rild libs do as well.

So this maybe our breakthrough! Lol fingers crossed. Now I'm not sure about the hexadecimal format of the memory allocation define there but we can work with it!
 
Back
Top Bottom