DELETED

M

Meticulus

Guest
Development Notes

Camera Notes



Rear Camera Code path: Gallery2 -> android.hardware.Camera -> liboemcamera.so -> camera.msm8660.so -> sec_isx012.c ->hardware

Front Camera Code path Gallery2 -> android.hardware.Camera -> liboemcamera.so -> camera.msm8660.so -> sec_s5k6aafx.c ->hardware

Locations:
android.hardware.Camera: frameworks/base/core/java/android/hardware/Camera.java
Gallery2: packages/apps/Gallery2
camera.msm8660.so: vendor/Samsung/exhilarate/proprietary/libs/hw
liboemcamera.so: vendor/Samsung/exhilarate/proprietary/libs
sec_s5k6aafx.c: kernel/Samsung/msm8660-common/drivers/media/video/msm
sec_isx012.c: kernel/Samsung/msm8660-common/drivers/media/video/msm

Torch:
driver values conversion:
Setting off: getting 0,0 | should be: 50,0
Setting auto: getting 1,0 | should be: 50,1
Setting on: getting 2,0 | should be: 50,2
Setting torch: getting 3,0 | should be: 50,3 ?





Specific Issues
  • 9/9/2013: Preview windows on both cameras are rotated 90 degrees
  • 9/11/2013: Invalid Picture sizes for our camera's
  • 9/11/2013: Captured Images on front are rotated 90 degrees
  • 9/12/2013: Captured Video on front and rear camera is rotated 90 degrees.
  • Rear Camera crashes when snapping photo..
  • 9/10/2013: Flash does not work
  • Touch to focus crashes video capture (both cams)
  • Torch/Flash code may need some refinement
Resources
 

Attachments

Last edited:
M

Meticulus

Guest
Progress

  • 9/9/2013: As far as I can tell, the issues with the camera can't be resolved in the kernel or by using device specific code.
    • I think that most of the errors we are getting are stopping at proprietary blobs and aren't making it to the kernel driver.
    • Seems like the only entry points are the camera app Gallery2 ( which would only fix issues for that app and not third party Camera apps) or in the android framework ( com.android.hardware.Camera ).
  • 9/9/2013: Corrected the preview orientation in Gallery2
  • 9/9/2013: Updated to Slim-4.3.beta.5.2 and forked the repositories I'm working with.... reapplying changes...
  • 9/10/2013: Changes reapplied and published. Narrowed down the initial issue with Gallery2 force closing. Its is the flash. Gallery tries to set flash-mode=auto which cases crash.
  • 9/10/2013: Flash (Torch) has been fixed
  • 9/11/2013: I had some thoughts on correcting the rotation problem. Might be able to use getDisplayOrientation; insert an offset. Today I'm going to try and correct the image sizes for the rear camera... Note to self: move preview rotation fix to framework so it fixes 3rd party camera's too..
  • 9/11/2013: Hack to correct picture size values
  • 9/11/2013: I think I got a handle on the rotation problem!!!
  • 9/12/2013: Rotation problem solved! Turns out it was in the kernel all along!
  • 9/13/2013: After doing some thinking last night, I went back to jb 4.1.2 and checked out the dmesg while snapping a photo on the rear cam. I compared that to me memory of the dmesg in 4.3. There are so many things that aren't happening on 4.3 compared to 4.1.2. I don't think the camera driver has changed at all so perhaps there is a high level abstraction, that uses that orchestrates the cam driver, that has changed... I'm going to pull the dmesg's from both and and compare. Will post in development notes.
  • 9/14/2013: Rear cam is being a bear... Going to work on getting proper conversions for flash and focus so those wont be a problem while diagnosing the rear cam...
  • 9/15/2013: I spent most of day yesterday inserting debug code into the camera driver... Trying to learn how the rear camera operates... Today, I'm going to try and trace down msm_poll_config. This even seems generic but is called from the blobs after the camera snap code. It never seems to get the results it's looking for so...
  • 9/20/2013: Light Sensor fixed!
 
Last edited:

car vs driver

Senior Member
Jun 11, 2012
2,653
4,806
0
Earth
Can you shoot me over the code changes you've made so far on the camera? I'm expecting to get my exhilarate today or tomorrow and this is the first thing I'm going to start digging into. Would rather not have to recreate anything you may have already done :)

Thanks!
 
  • Like
Reactions: afme89
M

Meticulus

Guest
Can you shoot me over the code changes you've made so far on the camera? I'm expecting to get my exhilarate today or tomorrow and this is the first thing I'm going to start digging into. Would rather not have to recreate anything you may have already done :)

Thanks!
I posted the changes in ktemp's Exhilarate thread here http://forum.xda-developers.com/showpost.php?p=45409092&postcount=2511

The plan is to fork the necessary repos, I'll try and get that done today...
 
M

Meticulus

Guest
Yeah, saw that ... wasn't sure if you had anything else. We're going to probably have a bit of an issue with the blobs I'm afraid.
I did make a little progress last night in correcting the preview window orientation in both camera's which I'll post once I get the repo's setup.

So far the front camera will take pictures at VGA and QVGA resolutions, The rear camera will record video at 1280x720 and the front at 640x480

there all just rotated 90 degrees....

I don't think there is an device specific code that we can modify to correct the camera issues. Most errors are thrown from camera.msm8660.so or liboemcamera.so before they get to the kernel driver. I think we'll have to correct them in userspace...
 
Last edited:

afme89

Senior Member
Jul 26, 2012
132
18
18
San José
I did make a little progress last night in correcting the preview window orientation in both camera's which I'll post once I get the repo's setup.

So far the front camera will take pictures at VGA and QVGA resolutions, The rear camera will record video at 1280x720 and the front at 640x480

there all just rotated 90 degrees....

I don't think there is an device specific code that we can modify to correct the camera issues. Most errors are thrown from camera.msm8660.so or liboemcamera.so before they get to the kernel driver. I think we'll have to correct them in userspace...
the camera issue is the big mistery on 4.3 ROMS. Flash doesn't work at all no matter what app I use. This happens on CM10.2, Slimbean, etc
 
M

Meticulus

Guest
the camera issue is the big mistery on 4.3 ROMS. Flash doesn't work at all no matter what app I use. This happens on CM10.2, Slimbean, etc
I've been so focused on the camera's I'd forgotten about the flash... added to the list.
 

Unjustified Dev

Recognized Developer
Oct 21, 2012
7,176
13,063
263
23
Memphis , TN
I've been so focused on the camera's I'd forgotten about the flash... added to the list.
Here is a link to the changes that were made initially when this phone was added to jellybean.

# Light sensor related
drivers/i2c/chips/taos.c
arch/arm/mach-msm/gpiomux-8x60_celox.c

# Camera related
drivers/media/video/msm/sec_isx012*
drivers/media/video/msm/sec_s5k6aafx

https://github.com/CyanogenMod/andr...mmit/487862c7a8663d3eba919fbc69228325d3bfbcb7

Sent from my SCH-I500 using xda app-developers app
 
Last edited:
M

Meticulus

Guest
Here is a link to the changes that were made initially when this phone was added to jellybean.

# Light sensor related
drivers/i2c/chips/taos.c
arch/arm/mach-msm/gpiomux-8x60_celox.c

# Camera related
drivers/media/video/msm/sec_isx012*
drivers/media/video/msm/sec_s5k6aafx

https://github.com/CyanogenMod/andr...mmit/487862c7a8663d3eba919fbc69228325d3bfbcb7

Sent from my SCH-I500 using xda app-developers app
Running a build right now, going to check that out when it gets done but wouldn't those changes be included in the cm-10.2 branch as well?
 

Unjustified Dev

Recognized Developer
Oct 21, 2012
7,176
13,063
263
23
Memphis , TN
Running a build right now, going to check that out when it gets done but wouldn't those changes be included in the cm-10.2 branch as well?
Nope most of it was removed in a commit merge t989 changes I think that's it. We did try adding it back before it didnt work but since the kernel is stable it might be worth the try this time.
 
  • Like
Reactions: InkSlinger420
M

Meticulus

Guest
Nope most of it was removed in a commit merge t989 changes I think that's it. We did try adding it back before it didnt work but since the kernel is stable it might be worth the try this time.
That's some goooood info man, Thanks... I'll be studying it after I get my changes published...
 
M

Meticulus

Guest
Ok, it took most of the day but I got my changes into github link in op #3. Tomorrow I can get back to it !
 
M

Meticulus

Guest
Yo meticulous,is this one giant leap towards stock camera??

Sent from my SAMSUNG-SGH-I577 using xda app-developers app
I'm not sure what you mean by "giant leap" but here is the state of things:

  1. Front camera takes images you just have to bump the quality down to VGA. (images are rotated 90 degrees)
  2. Both cams record video (rotated 90 degrees)
  3. Rear cam wont snap photo
  4. torch/flash works.
  5. Panorama works.
  6. Preview windows rotated properly.
  7. ???
I'm working from slimbean but if your building other rom's you might be able to sub-in my repos to get this working in other roms...

I'm still not sure how to approach the rotation problem but, workin' on it.:laugh: