• 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]

I've successfully deposited a check using the USAA banking app.

adamto,

Great work man, I am glad some one was able to push the Triumph to ICS with a fully working camera!! Very nice work indeed!! :thrasher:
 
adamto,

Great work man, I am glad some one was able to push the Triumph to ICS with a fully working camera!! Very nice work indeed!! :thrasher:
Thanks! But, you and the rest of the team did all the hard work, I just pulled her into the garage after the cross country trip.
 
100% working? Well I'll be damned. Might get out the old Triumph and test her out. Great work guys! If everything works 100%, expect a donation.
 
100% working? Well I'll be damned. Might get out the old Triumph and test her out. Great work guys! If everything works 100%, expect a donation.

"Everything 100%" is probably a little premature, last I tried FFC was still broken.
 
Adamto: In case you wanted to move on to FFC, here is a logcat of switching to the FFC in the stock camera app:

V/QualcommCameraHardware( 135): SetautoFocusRectangle X V/QualcommCameraHard - Pastebin.com

I'm not sure this portion contains much useful. Please recapture the log with "adb logcat -v time *" (sometimes timing is important) and include the full log. It would be most useful if you could start from the back camera, switch to front, then take a picture. Also, I'm thinking the FFC may have some i2c misconfiguration, so please include the output of "dmesg" from the phone after you do this as well.

Getting the cm7 logs for comparison is a good step in getting the FFC working, and something I didn't think of doing (although I did for the back cam), so this is much appreciated.
 
I'm happy to announce I have taken my first picture in cm9 with preview working. I went the other way with kernels, moving the cm7 camera driver into the cm9 kernel, and that seems to do it.

I'd love to get a test version up somehow but I'm still new at this, let me see if I can figure out how to throw together something quickly.

EDIT: hope this works:
CM-MTDEV9-20130217-really02-21.zip (107.8 MB)
https://mega.co.nz/#!bF8BXQZL!JHhOwCW9Bbe2NQREHuNDfG8qjsZ7N_pSoNq53mlVBjo

- Yes, the date is wrong
- I'm only interested in whether or not the camera is working for you
- The rotation is still wrong
- Front camera doesn't work
- Good luck!

EDIT2: Don't switch to the front camera, causes a crash, then you can't change the camera app to back camera.
I'm away for a couple days and you get the camera working. Good job man!
I will be checking this in as a readme as well but here is some documentation I have been working on.
This is to keep track of what I know about the camera. It's certainly
not guaranteed to be right.

The camera is operated by four separate modules, now two of them are
binary, and quite frankly it's pretty scary this scheme actually
works. The MD5s of the binaries I am using:

f72f6ffb2df03f48e30984e61ba98eeb liboemcamera.so
5a5eac1a832129bfd7a37d60f547a7ee libcamera.so

First up is the kernel driver, in drivers/media/video/msm. This seems
to be mostly i2c control functions, although the version of it is
critical to the camera working for reasons I don't yet know, possibly
a difference in ioctl message values. The kernel driver I pulled is
from:

triumph-kernel-msm7x30-46cea7ad007cf38438208ce14dd1c3b4890f70c3

Second, is QualcommCameraHardware.cpp, aka libcamera.so. It doesn't
look like we actually have this source code file from a Triumph. I did
play around with a couple ideas with QualcommCameraHardware.cpp, but
could never get things working. So, I decided to use the binary
libcamera.so that we know is working from CM7. One issue with using
the binary is that the content of QCamera_Intf.h needs to match the
binary liboemcamera.so, especially cam_ctrl_type, as there is a least
one jump table in the binary that depends on its values. I have
changed QCamera_Intf.h to match libeomcamera.so as best I could.

Third, is the cameraHAL, new to ICS, which is camera.msm7x30.so. This
contains a copy of QualcommCameraHardware.cpp, so I changed the build
to link directly with the binary libcamera.so. It is worth noting that
this library is actually loaded by the mediaserver process, and that
if you want to replace it on a live phone, you need to kill the
mediaserver process before the changes will take effect. There
is an msm_camera.h here that should probably be kept in sync with the
kernel's. Also, The CameraHardwareInterface class contains a vtable
that needs to be kept in sync with libcamera.so.

Last up is the camera framework. This is part of the C++ code that is made
into JNI so it can be called from Java. There is an important piece of
the puzzle here as well: CameraParameters.cpp/h. Certainly
libcamera.so depends on the parameters being correct and possibly
liboemcamera.so as well. I pulled these from cm7 frameworks.

Note that libcamera2.so is not used
.
Very good info, just need to get the code in to a repo so we can all get to work on the nitty gritty.

I'm having trouble pushing my commits to MTDEV git, so I have made another testing build, with the orientation fixed:

Mediafire:
CM-MTDEV9-20130223.zip

Mega:
https://mega.co.nz/#!SAUnjYqA!W4AUcgRT9-CYX6uWNDtpOwx8AlByhiZPtmTb4gpTjQM
I always have issues pushing to git, I have my keys set up and everything. This is what you are gonna have to do:

1. Make a folder to contain everything that you are gonna be pushing to git(leave it empty)
2. Open terminal and navigate to that folder
3. git clone all the repos that you changed
Example: git clone git@github.com:BSydz/android_vendor_pa.git -b ics
4. Replace the files that you changed in the repos you just cloned
5. Once the changes have been made, in terminal navigate to each repo folder, and run these commands:

[HIGH]git add .[/HIGH]should return with no response

[HIGH]git commit -a[/HIGH]when the screen pops up, type in a short description of the changes made, and hit these keys ctrl+x, then y, then enter.

[HIGH]git push -u origin ics[/HIGH]This should do it, if you have any questions let me know. I don't know why I can't push with a repo sync, and have to git clone, but that is how I have had to do it.
 
Great work, backing everything up to install as we speak. G60Madman can you update the initial post to show the 2/23 camera working update.

Thanks
 
I'm having trouble pushing my commits to MTDEV git, so I have made another testing build, with the orientation fixed:

Mediafire:
CM-MTDEV9-20130223.zip

Mega:
https://mega.co.nz/#!SAUnjYqA!W4AUcgRT9-CYX6uWNDtpOwx8AlByhiZPtmTb4gpTjQM
So great job on getting the camera and preview working perfectly but there is still no camcorder and now the build breaks the ability for ooVoo and Skype to use the camera for video calls.Here's the logcat for Skype.It still gets stuck at sign in screen when I enable video and it also causes the camera to not open til phone is restarted.



W/PackageManager( 247): Package com.skype.raider desires unavailable shared library com.htc.hardware.twinCamDevice; ignoring!
W/PackageManager( 247): Package com.skype.raider desires unavailable shared library com.motorola.hardware.frontcamera; ignoring!
W/PackageManager( 247): Package com.skype.raider desires unavailable shared library com.sprint.hardware.twinCamDevice; ignoring!
I/ActivityManager( 247): Force stopping package com.skype.raider uid=10055
W/PackageManager( 247): Not granting permission android.permission.CALL_PRIVILEGED to package com.skype.raider (protectionLevel=3 flags=0x8be44)
D/BackupManagerService( 247): Received broadcast Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.skype.raider flg=0x10000010 (has extras) }
I/ActivityManager( 247): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.skype.raider cmp=com.skype.raider/.Main} from pid 1162
I/ActivityManager( 247): Start proc com.skype.raider for activity com.skype.raider/.Main: pid=2280 uid=10055 gids={1006, 3003, 3002, 1015}
W/PackageManager( 247): Not granting permission android.permission.CALL_PRIVILEGED to package com.skype.raider (protectionLevel=3 flags=0x8be44)
W/PackageManager( 247): Not granting permission android.permission.CALL_PRIVILEGED to package com.skype.raider (protectionLevel=3 flags=0x8be44)
I/ActivityManager( 247): No longer want com.skype.raider (pid 2280): hidden #16
I/WindowManager( 247): WIN DEATH: Window{2b7ed240 com.skype.raider/com.skype.raider.Main paused=false}
W/InputDispatcher( 247): channel '2b8501d8 com.skype.raider/com.skype.raider.Main (server)' ~ Consumer closed input channel or an error occurred. events=0x8
E/InputDispatcher( 247): channel '2b8501d8 com.skype.raider/com.skype.raider.Main (server)' ~ Channel is unrecoverably broken and will be disposed!
W/InputDispatcher( 247): Attempted to unregister already unregistered input channel '2b8501d8 com.skype.raider/com.skype.raider.Main (server)'
I/WindowManager( 247): WIN DEATH: Window{2b8501d8 com.skype.raider/com.skype.raider.Main paused=false}
I/WindowManager( 247): WINDOW DIED Window{2b8501d8 com.skype.raider/com.skype.raider.Main paused=false}
 
I'm not sure this portion contains much useful. Please recapture the log with "adb logcat -v time *" (sometimes timing is important) and include the full log. It would be most useful if you could start from the back camera, switch to front, then take a picture. Also, I'm thinking the FFC may have some i2c misconfiguration, so please include the output of "dmesg" from the phone after you do this as well.

Getting the cm7 logs for comparison is a good step in getting the FFC working, and something I didn't think of doing (although I did for the back cam), so this is much appreciated.

Adamto:

CM7 log of oppening camera app, switching from back to FFC, and taking a picture with FFC: 02-24 13:43:29.774 D/PowerManagerService( 240): Levels.length = 20 Current: 91 - Pastebin.com

CM7 dmesg of opening camera app, switching from back to FFC, and taking a picture with FFC:
http://pastebin.com/h2hr2xny
 
Great Job guys! Now maybe with these breakthroughs all the ics based roms can get working cameras on them too.
They should. I know BSydz is smart enough to do it.:D
Ha, I was thinking the same thing about you. I'll put in some work, I should be able to get this put in all the source built ROMs, including CM10, which sucks cause we are gonna have camera before we even get data or wifi fully working. Now that the source has been pushed, having a few more eyes on it may help. I'm about to pull in the changes now, and see what is happening.
 
Ha, I was thinking the same thing about you. I'll put in some work, I should be able to get this put in all the source built ROMs, including CM10, which sucks cause we are gonna have camera before we even get data or wifi fully working. Now that the source has been pushed, having a few more eyes on it may help. I'm about to pull in the changes now, and see what is happening.
Well once you get PA JB with a working camera up I will test the hell out of it for you.


Also I got some logcats for you to look at on my other post.
http://androidforums.com/triumph-all-things-root/692493-great-work-cm9-camera-guys.html
 
I have been using the 2/23/13 CM9 rom for the day now, great battery, camera is amazing. Scanned a check onto Navy Federal perfectly. Definatly amazing thanks MTDEV and everyone in-between. Excellent rom!! Cant wait for CM10.
 
I have been using the 2/23/13 CM9 rom for the day now, great battery, camera is amazing. Scanned a check onto Navy Federal perfectly. Definatly amazing thanks MTDEV and everyone in-between. Excellent rom!! Cant wait for CM10.

Very interesting, you haven't had any crashes/reboots all day?
 
None so far very smooth. I also have installed Seeder in the past to help lagging issues and it seems to do well for me with this rom as well.
 
None so far very smooth. I also have installed Seeder in the past to help lagging issues and it seems to do well for me with this rom as well.

Good to know, mine won't run for more than a couple hours. Maybe one of my apps is causing problems...
 
I've been running the new 2/23 for a full day now also no reboot (though I don't tend to use wifi), love that the barcode scanner works now, only things I noticed battery stats are gone now, which really isn't a big deal
 
Back
Top Bottom