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

This rotation issue is proving trickier than expected. I've tried changing several things in several places, and few of it is having any impact. It's so strange it works after taking a picture... I can't tell what is happening differently the second time the preview is initialized.

EDIT: Found it. Enabling CAMERA_MSG_PREVIEW_FRAME before starting the preview in camerahal fixes rotation. Next step is checking this stuff in, I'll figure that out tomorrow.
 
UPDATE:
Skype and ooVoo aren't working.I try to sign on and it won't let me sign in :/.Going to reflash it and see if it works.
 
Just had a quick play with this. Camera is so nearly fully there, and usable in it's current form. I tried it with QR reader with success, the killer app for me is the Chase check deposit, but I don't have a check to test it with yet but am hopeful.

Really well done Adamto, am looking forward to the kernel making it to other ROMs, especially Paranoid Android.

I have Capital One and they do the same thing I think. I need to download this myself so I can play with it.
 
UPDATE:
Skype and ooVoo aren't working.I try to sign on and it won't let me sign in :/.Going to reflash it and see if it works.

I would imagine that they are starting with the FFC. And as it's not working right now I bet that is why they are crashing.
 
I would imagine that they are starting with the FFC. And as it's not working right now I bet that is why they are crashing.
No they are not crashing.Like I put in my password with Skpye and sign in and it stays stuck on Signing in.... as for ooVoo it says can not sign in right now try again later.But they are not FC'ing

UPDATE:
When I choose to not enable video calling it allows me to sign in but when I enable it during start up I'm stuck on signing screen.
UPDATE 2:
When I try to enable video from setting after signing on I get kicked off Skype.Also when I try to enable video it I will cause the camera app to not work.
 
I don't know if anybody's missed this, but if you look here:
https://github.com/MTCM9/camerahal-test/blob/ics/Android.mk#L20-L24

You will notice there's a flag for FFC. I have tried this with it enabled and it will stop the crashing of the FFC, but it won't really change much. It's trying to enable the FFC, but ends up using the same as the rear camera. I just liked it because it got rid of that horrible camera crash :P
I'm assuming you are posting this in refference to my post about Skype.If so like I said there is no crashing or closing of the app.All that happens is if I enable video when I first sign on I get stuck where it says signing in....The circle loading thing keeps moving but it won't push any data to get me in Skype.From what I can see Skype sees that we have camera with the build adam(I guess that's his name lol) made.But when you go to enable video it stops the data from being sent to complete the sign in.To give an example....when you sign in you can see the data being transferred with the little data arrows.But in my case it won't do that with video enabled but if I don't the data goes thru and I can sign on.


This leads me to believe there is something in the camera file permissions that were changed that is keeping Skype from completing what it needs to complete to allow sign on with camera enabled.It's like whatever changes were made is keeping video streaming apps from letting you log in with video enabled.
 
No they are not crashing.Like I put in my password with Skpye and sign in and it stays stuck on Signing in.... as for ooVoo it says can not sign in right now try again later.But they are not FC'ing

UPDATE:
When I choose to not enable video calling it allows me to sign in but when I enable it during start up I'm stuck on signing screen.
UPDATE 2:
When I try to enable video from setting after signing on I get kicked off Skype.Also when I try to enable video it I will cause the camera app to not work.

Are you set up to take a logcat?
 
I'm assuming you are posting this in refference to my post about Skype.If so like I said there is no crashing or closing of the app.All that happens is if I enable video when I first sign on I get stuck where it says signing in....The circle loading thing keeps moving but it won't push any data to get me in Skype.From what I can see Skype sees that we have camera with the build adam(I guess that's his name lol) made.But when you go to enable video it stops the data from being sent to complete the sign in.To give an example....when you sign in you can see the data being transferred with the little data arrows.But in my case it won't do that with video enabled but if I don't the data goes thru and I can sign on.


This leads me to believe there is something in the camera file permissions that were changed that is keeping Skype from completing what it needs to complete to allow sign on with camera enabled.It's like whatever changes were made is keeping video streaming apps from letting you log in with video enabled.
Not necessarily. This is for all FFC crashes in the general
 
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.
 
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. Also, there
is an msm_camera.h here that should probably be kept in sync with the
kernel's.

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.

You sir, are a very smart man. This is all way over my head.
 
Are you set up to take a logcat?

I/ActivityManager( 228): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.skype.raider cmp=com.skype.raider/.Main bnds=[360,254][480,405]} from pid 449
I/ActivityManager( 228): Start proc com.skype.raider for activity com.skype.raider/.Main: pid=3899 uid=10062 gids={1006, 3003, 3002, 1015}
W/ActivityManager( 228): Activity idle timeout for ActivityRecord{2bcf41d0 com.skype.raider/.Main}
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][800,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][800,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_STATUS cmp=com.skype.raider/.Main bnds=[0,170][480,266]} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_STATUS cmp=com.skype.raider/.Main bnds=[0,170][480,266] }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_STATUS cmp=com.skype.raider/.Main bnds=[0,170][480,266]} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_STATUS cmp=com.skype.raider/.Main bnds=[0,170][480,266] }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][480,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][800,266] (has extras)} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_CHAT cmp=com.skype.raider/.Main bnds=[0,170][800,266] (has extras) }
I/ActivityManager( 228): START {act=com.skype.NOTIFICATION_STATUS cmp=com.skype.raider/.Main bnds=[0,170][480,266]} from pid -1
W/ActivityManager( 228): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=com.skype.NOTIFICATION_STATUS cmp=com.skype.raider/.Main bnds=[0,170][480,266] }
I/ActivityManager( 228): Process com.skype.raider (pid 3899) has died.


That's the idle log

Here is the log for when signed in without video enabled


V/SID ( 8277): Connect: /tmp/pcm_from_skypekit_key server connect suceeded
V/SID ( 8277): AVTransportWrapper (/tmp/pcm_from_skypekit_key): connected!
V/SID ( 8277): Connect: /tmp/pcm_to_skypekit_key, server: 0, timeout: 500
V/SID ( 8277): Connect: /tmp/pcm_to_skypekit_key client connect suceeded
V/SID ( 8277): AVTransportWrapper (/tmp/pcm_to_skypekit_key): connected!



And here is when I try to enable the video


V/SID ( 8277): Connect: /tmp/pcm_from_skypekit_key server connect suceeded
V/SID ( 8277): AVTransportWrapper (/tmp/pcm_from_skypekit_key): connected!
V/SID ( 8277): Connect: /tmp/pcm_to_skypekit_key, server: 0, timeout: 500
V/SID ( 8277): Connect: /tmp/pcm_to_skypekit_key client connect suceeded
V/SID ( 8277): AVTransportWrapper (/tmp/pcm_to_skypekit_key): connected!
I/ActivityManager( 228): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.skype.raider cmp=com.skype.raider/.Main bnds=[360,254][480,405]} from pid 449
W/System.err( 8277): at com.skype.ipc.h.a(Unknown Source)
W/System.err( 8277): at com.skype.ipc.h.d(Unknown Source)
W/System.err( 8277): at com.skype.ipc.ResponseListener.e(Unknown Source)
W/System.err( 8277): at com.skype.ipc.ResponseListener.run(Unknown Source)
V/SID ( 8277): UnixSocket.cpp:295(bool Sid::UnixSocket::Poll(int, short int, int)): poll error: m_Key: /tmp/pcm_from_skypekit_key, revents: 0x11, errno: 0, time: 1361653956021545
V/SID ( 8277): UnixSocket: closing socket /tmp/pcm_from_skypekit_key
V/SID ( 8277): UnixSocket: closing socket /tmp/pcm_to_skypekit_key
D/dalvikvm( 8277): Trying to load lib /data/data/com.skype.raider/lib//libnvomxadaptor.so 0x2b7af728
D/dalvikvm( 8277): Trying to load lib /data/data/com.skype.raider/lib/libnvomxadaptor.so 0x2b7af728
D/dalvikvm( 8277): Trying to load lib /data/data/com.skype.raider/lib//libvideohost_skype.so 0x2b7af728
D/dalvikvm( 8277): Added shared lib /data/data/com.skype.raider/lib//libvideohost_skype.so 0x2b7af728
D/dalvikvm( 8277): No JNI_OnLoad found in /data/data/com.skype.raider/lib//libvideohost_skype.so 0x2b7af728, skipping init
I/com.skype.AndroidVideoHost.Common.b( 8277): VH_Log level set to: 3
 
Hmmm, there is no camera log traffic??
That would be correct.Like I said whenever I go to enable the video all data going to and from Skpye stops and I get stuck in an infinate loading screen.Like I said it doesn't force close it just stays loading.And when I enable video on Skype it also disables the camera on the phone til I restart the phone.

Reboot catlog

W/PackageManager( 233): Package com.skype.raider desires unavailable shared library com.htc.hardware.twinCamDevice; ignoring!
W/PackageManager( 233): Package com.skype.raider desires unavailable shared library com.motorola.hardware.frontcamera; ignoring!
W/PackageManager( 233): Package com.skype.raider desires unavailable shared library com.sprint.hardware.twinCamDevice; ignoring!
W/PackageManager( 233): Not granting permission android.permission.CALL_PRIVILEGED to package com.skype.raider (protectionLevel=3 flags=0x8be44)
W/PackageManager( 233): Not granting permission android.permission.CALL_PRIVILEGED to package com.skype.raider (protectionLevel=3 flags=0x8be44)
W/ActivityManager( 233): Permission Denial: receiving Intent { act=android.intent.action.BOOT_COMPLETED flg=0x10 } to com.skype.raider requires android.permission.RECEIVE_BOOT_COMPLETED due to sender null (uid 1000)
 
Yeah what scares me is if we have to reverse engineer proprietary drivers. I certainly hope that we won't have too. Also messing with the kernel can be a pain, but if you have enough experience (fro your posts adamto I have no doubts) the kernel is doable. But I don't think anyone on Earth except those with the source code can fix the camera if that's the case. But I believe the drivers work. My programming professor said that it's just a bunch of coding issues that we can handle if we have the right guy. adamto, if you can fix this, you will be revered. Thank you for all your work. This camera has been a bayonet in our asses for about a year or so now. So if you can fix this, expect donations to the project and yourself if you want them. Now that we have a solution in sight, it's worth putting cash into MTDEV again.
 
Yeah but it will be more worth it now that stuff is progressing. Money can maintain everything, but we need knowledge. That is priceless. But the thing is g60 has gotten back to real life recently and he still manages the finances. We may have to reorganize who maintains finances to what (if he wishes to have less stress on him) or at least figure out how to distribute the money in order to get dev phones, maintain rigs, the website, etc. We are making progress and now have more help, but some have moved on and although Chairshot215 and g60madman were awesome, we need to get these new guys dev phones once they need them.
 
Yes knowledge is priceless but sometimes I have an empty brain lol



imagescrash-test-dummies.gif
 
Great work adamto and all the other devs involved. One request, can we enable the flashlight notification bar button?
 
Back
Top Bottom