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

Can someone post some simple instructions for going from 7 to 9?
I'm running CWM 5.0.2.6 - looks like I need to update, but got confused reading the instruction on updating CWM. Specifically which Zip download is flashable and the follow the instructions above, follow the instructions below - which to follow.

My plan was to.....
Backup from CWM 5.0xxx
Backup Apps using Titanium Root
Backup Texts and Contacts
Update to CWM 5.5xx
Flash 9

Thanks!
 
Upvote 0
Can someone post some simple instructions for going from 7 to 9?
I'm running CWM 5.0.2.6 - looks like I need to update, but got confused reading the instruction on updating CWM. Specifically which Zip download is flashable and the follow the instructions above, follow the instructions below - which to follow.

My plan was to.....
Backup from CWM 5.0xxx
Backup Apps using Titanium Root
Backup Texts and Contacts
Update to CWM 5.5xx
Flash 9

Thanks!

I'm using cwm v 6.0.1.9 by b_randon. You can flash this with the recovery you have now
 
Upvote 0
My cache partition was corrupted somehow. Wiping in CWM wasn't helping, but I manually ran mkfs.ext2 on it, and seems good now. And here I thought that build was all unstable... :p

Unfortunately, I spoke too soon and my cache became corrupted again. I see my CWM is quite old (5.0.2.6), so I'll try upgrading that.
I am thinking that may have to do with the init.triumph.rc, The line you fixed is wrong, check my PA device files. It is pointing to partitions 10 and 11 which is hidden(10) and cache(11), it should be 14 and 15. It didn't occur to me until you said something about the cache getting corrupted and I remembered that 10 and 11 were system partitions. I have no idea where that line came from cause none of the variants have it as 10 and 11.

This is the breakdown of the partitions on our phone:
So, this is what I have found so far about the partitions on the Triumph, I can't guarantee that this is all correct, but if anybody has any input feel free to chime in.

WARNING, THE INFORMATION PROVIDED BELOW IS SPECULATIVE AND COMES WITH NO WARRANTY. IF YOU MESS WITH THIS STUFF, I AM NOT RESPONSIBLE IF YOU DAMAGE YOUR PHONE.

Partitions:
1 (FAT) Mobile Partition containing image folder, which is very well documented around the forums.

2 (crypt/QNX4.x) Primary Boot Loader (PBL) I believe that this is what the SOC uses to boot.

3 (crypt) Secondary Boot Loader I believe this is where the hardware layout is contained, as it changes button configuration and was key to getting back to normal after I flashed the wrong nb0. It is linked to the mobile partition, as the phone will not boot properly without the correct amss.mbn

4 (extended) Just an extended partition containing partitions 5 - 17.

5 (Boot) This is where the boot img is extracted.

6 (OnTrack DM) I think this manages and verifies integrity of partitions 13-17.

7 (ext3) This is where the system/rom is located. This is what you see in root explorer as "system", containing the build.prop and other stuff.

8 (ext3) This is the "data" folder .

9 (ext) This partition holds CDA info, with OEM apks, ringtones, and wallpapers, it seems to be mounted inside partition 10 (hidden) when the phone is on you can find the information merged into "hidden/data" using root explorer.

10 (ext3) This is the hidden partition containing boot images and CDA info. This can be found in "hidden" using root explorer.

11 (ext3) This is the cache partition.

12 (ext3) This is the Caivs, can't find too much info on this.

13-17 (unknown) I believe this is where the phone specific data is stored, including but not limited to MEID, ESN, and PRL.
 
  • Like
Reactions: adamto
Upvote 0
Hi everyone,
Just wanted to say thanks for the awesome rom and a working camera! It's like Christmas all over again! However, my 3g drops are so bad that I lose connection for up 10 minutes sometimes. When you guys have perfected camera, can you proceed to perfect 3g too with your mad skillz? lol

Sorry I'm having trouble figuring out what the current state of the rom is?

It sounds like the rear camera works fully now for pictures but not video?

How about the front facing camera?

Thanks!

Well, like the title says. It's a work inprogress. adamto has broght us very far in a short time. When that's compleated we will probably work on the device files next. If you look at the thread list you will see one on the kernel. It's all tied together are talks on what files to use.
 
Upvote 0
I am thinking that may have to do with the init.triumph.rc, The line you fixed is wrong, check my PA device files. It is pointing to partitions 10 and 11 which is hidden(10) and cache(11), it should be 14 and 15. It didn't occur to me until you said something about the cache getting corrupted and I remembered that 10 and 11 were system partitions. I have no idea where that line came from cause none of the variants have it as 10 and 11.

This is the breakdown of the partitions on our phone:

Running good now since this morning with this set to 14 and 15, thanks. So nice to have a working phone again, heh. Glad I didn't slip that last "fix" into the '23 build =]
 
  • Like
Reactions: BSydz
Upvote 0
As far as the htcoverlay and the regular overlay, it has to do with the gralloc, and how the camera and if we build it with the system, all display stuff works together, I think. In our board config file it has BOARD_USES_OVERLAY which is as flag in hardware/qcom/display, which is spelled wrong in the board config in the repository. the Overlay files should be located in frameworks/base/lib/ui/Overlay.cpp and frameworks/base/include/ui/Overlay.h, but it is not included in the source. Like I said, I am not sure myself. The camerhal folder has the two Overlay files and both folders have files with includes for htcOverlay.h in include/ui. Don't really know what I'm saying here, but just what I have seen.

Hmm, don't know much about overlays yet. Is there a problem with the htcoverlay?
This is the commit that I think I found the overlay files from or they were in a old CM9 I had on disk, https://github.com/mantera/android_frameworks_base/commit/fddc476754423c00b537e411f5f007d765f5872b


This is some info about some camera changes made in frameworks. On a side note, I am not using our frameworks base for PA, I only incorporated the ril, headset and one or two other small fixes. https://github.com/mantera/android_frameworks_base/commit/2bf9844dae4d70dab052ef426d010a4bd7a107cd
Hey adamto, I have been working on the overlay files and it is just a little over my head. Either we need to rewrite the cameraHal overlay ; overlay and use the Overlay files or we need to incorperate what is needed in to the OverlayHtc files. I uploaded a zip with six files in it, the four original files and a buildable merged OverlayHtc set of files. When the Overlay files are used it fixes all the LibOverlay errors but breaks the camera, and with the merged files it does the same. Also if you have not noticed the Overlay files in the cameraHal folder are the OverlayHtc files renamed.

Moto-Triumph-CM9-frameworks_base-ui-Overlay.zip
 
Upvote 0
Hey adamto, I have been working on the overlay files and it is just a little over my head. Either we need to rewrite the cameraHal overlay ; overlay and use the Overlay files or we need to incorperate what is needed in to the OverlayHtc files. I uploaded a zip with six files in it, the four original files and a buildable merged OverlayHtc set of files. When the Overlay files are used it fixes all the LibOverlay errors but breaks the camera, and with the merged files it does the same. Also if you have not noticed the Overlay files in the cameraHal folder are the OverlayHtc files renamed.

Moto-Triumph-CM9-frameworks_base-ui-Overlay.zip

First off, do you know we need this overlay for some reason? I ask because before I got the camera working, one of the things I tried was turning off BOARD_USES_OVERLAY, and as far as I can tell, the setting seems to have no effect (I even did a full rebuild for that one). I was thinking maybe any overlay functionality is incorporated into liboemcamera.so

Now, if we do need this overlay, well there's not much code in here. My best initial guess is that either the format is wrong or this ashmem stuff is not set up right. You can try commenting out all the formats but one in getFormatString(), and going through them. And if ashmem can't mmap() that fd, or isn't expecting the size it's getting or something like that there may be problems (I know nothing about ashmem just some ideas).
 
  • Like
Reactions: BSydz
Upvote 0
First off, do you know we need this overlay for some reason? I ask because before I got the camera working, one of the things I tried was turning off BOARD_USES_OVERLAY, and as far as I can tell, the setting seems to have no effect (I even did a full rebuild for that one). I was thinking maybe any overlay functionality is incorporated into liboemcamera.so

Now, if we do need this overlay, well there's not much code in here. My best initial guess is that either the format is wrong or this ashmem stuff is not set up right. You can try commenting out all the formats but one in getFormatString(), and going through them. And if ashmem can't mmap() that fd, or isn't expecting the size it's getting or something like that there may be problems (I know nothing about ashmem just some ideas).
Thanks for the reply. The deal is, we have two different CM9 setups.

1. mantera: He had everything working, and very well documented, which was built from isaacs setup, check this out
http://androidforums.com/triumph-all-things-root/495002-rom-alpha-triumph-cm9-v0-6-17-0-final.html lots of info in the first few posts
https://github.com/mantera?tab=repositories

2. MTDEV: there were actually two different setups for this. At first it was built using manteras code but then I believe that the one we are using now MTCM9 is based off of G60's dirty baby, if I remember correctly. I have them all on disk for the most part.

There are a lot of changes between the two, though a lot of it is just the upstream changes as mantera moved on from the device and the project. G60 worked on starting from scratch and his style is a lil different than manteras so stuff is rearranged a lil bit. To be honest mantera would have to coment on the importance of the Overlay files.

I just know that with BOARD_USES_OVERLAY := true the same OverlayLib errors flood the logcat and with the Overlay from mantera they go away and report correctly. This is tied to the QualcommCameraHardware, as the OverlayLib errors relate to preview width and height, as I pulled some stuff from the Code Aurora Forum ICS I have on my disk. I have like five or six PA setups on my computer, and a couple are using the the Overlay and a couple are using Overlayhtc. Plus after looking at some of the devs for the X6 variants device files, board uses overlay is in every one of them, from CM7 to CM10. So this may have been missed by G60 or he may have decided that the difference was not visible and the errors weren't worth it. I am only speculating since he didn't have the Overlay files in frameworks. No disrespect, big ups to G60 for his work.

This is what I changed that made the errors change and pointed me to the overlay being tied to the camera.
QualcommCameraHardware.cpp MTCM9
[HIGH]#define DEFAULT_PREVIEW_WIDTH 320
#define DEFAULT_PREVIEW_HEIGHT 240

//Default FPS
#define MINIMUM_FPS 15
#define MAXIMUM_FPS 31
#define DEFAULT_FPS MAXIMUM_FPS[/HIGH]QualcommCameraHardware.cpp CAF M7630AABBQMLZA4040325I-ICS
[HIGH]#define DEFAULT_PREVIEW_WIDTH 640
#define DEFAULT_PREVIEW_HEIGHT 480

//Default FPS
#define MINIMUM_FPS 5
#define MAXIMUM_FPS 31
#define DEFAULT_FPS MAXIMUM_FPS
#define DEFAULT_FIXED_FPS_VALUE 30[/HIGH]Error without Overlay in frameworks:
[HIGH]D/OverlayLIB( 128): getOverlayConfig: HDMI not connected...
E/OverlayLIB( 128): getZ: return zorder = 0 for fbdev = 0, pipesinUse = 1
E/OverlayLIB( 128): Rotator session failed
E/OverlayLIB( 128): mRotInfo:
E/OverlayLIB( 128): session_id 0 dst_x 0 dst_y 0 rotations 0 enable 0
E/OverlayLIB( 128): src: width 640 height 480 format MDP_YCRYCB_H2V1
E/OverlayLIB( 128): dst: width 640 height 480 format MDP_YCRYCB_H2V1
E/OverlayLIB( 128): src_rect: x 0 y 0 w 640 h 480
E/OverlayLIB( 128): decZ: freeing the pipe with zorder = 0 for fbdev = 0
E/OverlayLIB( 128): decZ: Pipes in use = 0
E/OverlayLIB( 128): startChannel for fb0 failed
E/msm7x30.hwcomposer( 128): prepareOverlay setSource failed[/HIGH]cameraHal code affected by overlay
[HIGH]dev->overlay = new Overlay(wrap_set_fd_hook,
wrap_set_crop_hook,
wrap_queue_buffer_hook,
(void *)dev);[/HIGH]OverlayHtc[HIGH]Overlay::Overlay(overlay_set_fd_hook set_fd,
overlay_set_crop_hook set_crop,
overlay_queue_buffer_hook queue_buffer,
void *data)
: mStatus(NO_INIT)
[/HIGH]Overlay[HIGH]Overlay::Overlay(uint32_t width, uint32_t height, Format format, QueueBufferHook queueBufferHook, void *data) :
mQueueBufferHook(queueBufferHook),
mHookData(data),
mNumFreeBuffers(0),
mStatus(NO_INIT),
mWidth(width),
mHeight(height),
mFormat(format)[/HIGH]This is what my two source code partitions look like, and when you open the Kernels folders, both sides would look about the same. I basically have my own little github on my computer. Seeing all the changes made has helped me understand the code a lot more, but realize I have scanned basically every one of those sets of code that is on my computer. I may not know what they all do but I know what is there and have compared all of them. :D
http://www.mediafire.com/conv/62a83971dddd357552a35c3ed7aaf39236d443ef55a39dcaff98014e3a284b916g.jpg
 
Upvote 0
Error without Overlay in frameworks:

Those error messages are from overlayLib in hardware/qcom/display/liboverlay. Inside overlayLib.h here we have a class Overlay. I wonder if this is the overlay that should be included in cameraHal? The interface is not quite the same though...

EDIT: This overlay stuff also seems to have a lot to do with the kernel framebuffer driver, so that is something to keep in mind as well.

EDIT2: Or maybe camerahal doesn't really need an overlay, and we need to just update what's in frameworks.

EDIT3: I realized I never mentioned on here but I have been hanging out in irc, might be good to talk there sometime.
 
Upvote 0
Those error messages are from overlayLib in hardware/qcom/display/liboverlay. Inside overlayLib.h here we have a class Overlay. I wonder if this is the overlay that should be included in cameraHal? The interface is not quite the same though...

EDIT: This overlay stuff also seems to have a lot to do with the kernel framebuffer driver, so that is something to keep in mind as well.
I think you are starting to understand what I couldn't fully put in to words, and was trying to convey.
 
Upvote 0
I think you are starting to understand what I couldn't fully put in to words, and was trying to convey.

I could never quite wrap my heard around why we need both libcamera.so and camera.msm7x30.so: clearly the app needs the former and the mediaserver needs the latter. But, why doesn't the app just use camera.msm7x30.so?

Now, it is looking like this scheme is essentially copied for the overlay library, which we will have in both frameworks and camera.msm7x30.so... something is rotten.

I guess the immediate options are to either 1) completely remove overlay from camerHal or 2) update cameraHal to use qcom overlayLib. Does one of these make more sense to you than the other?

Also, do you know offhand if we have a similar problem with overlayLib/framebuffer as we did with kernel/camera stuff (possibly mismatched version, etc)?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones