[Q] Camera API? - Galaxy Camera Q&A, Help & Troubleshooting

Does anyone out there actually have one yet? Does the stock android API allow you to take full 16MP photos, access the hardware zoom, etc? If not, are there Samsung API extensions available in the open source code that would allow custom camera developers to get to all the features of the camera?
I ask because I find developing on the "other" android camera from Nikon to be very frustrating. It has a 16MP camera, but the stock Camera class only allows access to a max 8MP picture size (and other features are apparently also limited).
I'd like to know if it is worth the extra money to get a platform that is better for developers (but I really don't want to buy a data plan from AT&T to go with it).

+1 for this question.
It would be cool to be able to develop some computational photography type apps (and therefore make it worth buying the device), so having access to focus, shutter time, while balance, etc. would be rather useful.

lardman said:
+1 for this question.
It would be cool to be able to develop some computational photography type apps (and therefore make it worth buying the device), so having access to focus, shutter time, while balance, etc. would be rather useful.
Click to expand...
Click to collapse
I did finally get one, and my camera app can indeed take 16 MP images, so at least one of the high end features is available. My app needs lots more work before I find out about everything else, but it is looking hopeful.

Claghorn said:
I did finally get one, and my camera app can indeed take 16 MP images, so at least one of the high end features is available. My app needs lots more work before I find out about everything else, but it is looking hopeful.
Click to expand...
Click to collapse
And could your application control optical zoom programmatically? (not by hardware button)

kingarold said:
And could your application control optical zoom programmatically? (not by hardware button)
Click to expand...
Click to collapse
That's one of the zillions of things I haven't written any code to try yet (I'm mostly working on fancy triggering methods - motion detection, light detection, etc., so I haven't done much with many of the settings).

Please read forum rules before posting
Questions go in Q&A
Thread moved
Thank you for your cooperation
Friendly Neighborhood Moderator

kingarold said:
And could your application control optical zoom programmatically? (not by hardware button)
Click to expand...
Click to collapse
I played around with the camera more today, and noticed that the "paper camera" app which comes preinstalled can indeed control the zoom (you can watch the lens move in and out as you use the slider on the screen). So unless samsung have installed some special samsung only version of paper camera, that probably means optical zoom works in the normal camera API.

I've had a look at the Camera api and it appears that manual focus isn't supported (on any Android phone). It does seem that people have coded manual focus capabilities by extending the camera driver in the kernel (see e.g. http://forum.xda-developers.com/showthread.php?t=630989)
Therefore we need to know what the camera chipset is. I'll have a look around and see if there's some dmesg and sysfs output, otherwise those would be useful. I've already grabbed the kernel source and will have a look through to see what's specified in the defconfig.

Just had a trawl through the defconfig and source code and didn't see anything that looked obviously like the camera chip. I suppose it and the processing chip may well be completely closed source (which is probably quite likely) in which case it would be interesting to see what kernel modules are loaded with the camera app open.
Ah, relevant system info here: http://forum.xda-developers.com/showthread.php?t=1982198 time to do some more digging

I'd guess that the camera and other image processing hw are attached to the m9mo SoC.
The kernel header says this:
* Driver for M9MO (16MP camera) from NEC
(header here: Kernel\include\media\m9mo_platform.h)
and this module appears to be loaded in the output linked above.
I suppose with some work one might be able to determine the meaning of the parameters which are passed through the kernel module functions, and perhaps enable manual focus mode.

All the non stock camera apps I have tried so far use the optical zoom through the software interface. The lens barrel clearly moving in response to the zoom function.
In fact what's missing is the ability to use the hardware button to control the zoom in a third party app. Awkwardly written to use an on screen slider instead but understandable as these apps are designed to be run on phones/devices without hardware zoom buttons.

Not sure if y'all have seen this, but here is the publicly released code from Samsung for the Galaxy Camera:
http://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=EK-GC100

I grabbed the factory images (http://forum.xda-developers.com/showthread.php?t=2006138), and attempted to extract the initramfs from the boot.img file; unfortunately this failed using the tools I've previously used on the Galaxy Tab (i.e. https://github.com/mistadman/Extract-Kernel-Initramfs/blob/master/unpack-initramfs). Any thoughts appreciated (I'm trying to get hold of the closed source kernel modules, namely *m9mo*.ko assuming this exists)
I had more success with the system.img (using simg2img to convert the file then mounting it as an ext4 loop device). There are also some camera-named odex files, which I took a quick look at, but I'm new to the whole reverse-engineering of Dalvik files so will have to re-visit this when I have some more time at the weekend.
More interestingly, there are some native library files in /lib and /lib/hw that look relevant. There's a camera service and a camera client library, which presumably are used by the Java code via JNI (or the like). I also note that there are a group of files named libarcsoft_*.so, which perform things like blink/smile/face detection and tracking (from the names).
Anyway I'll have a look at the .so files later in the week (as this is what I'm used to doing), but any advice/analysis on the Dalvik side would be appreciated.
---------- Post added at 07:26 PM ---------- Previous post was at 07:09 PM ----------
apprentice said:
All the non stock camera apps I have tried so far use the optical zoom through the software interface. The lens barrel clearly moving in response to the zoom function.
In fact what's missing is the ability to use the hardware button to control the zoom in a third party app. Awkwardly written to use an on screen slider instead but understandable as these apps are designed to be run on phones/devices without hardware zoom buttons.
Click to expand...
Click to collapse
Is the hw button status available thought the sysfs? I.e. check /sys/class/input (or open the relevant dev files directly if possible). I'm still unsure how much of the camera functionality is handled by a SoC which would need to be talked to (i.e. to control the sensor, zoom, focus, etc.), or whether some of this functionality is controlled directly by the kernel (i.e. easier for us to get into).

For those who need some android camera information that can be retrieved on SGC, I can say that:
optical zoom can be controlled by
Code:
Camera camera = ...
Camera.Parameters params = camera.getParameters();
params.setZoom(number);
camera.setParameters(params);
Flatten returns such parametres:
Code:
flash-mode-values=off,auto,red-eye,fillin,slow,red-eye-fix;
focus-mode-values=auto,infinity,macro,fixed,face-detection,continuous,manual,multi,touch,object-tracking;
preferred-preview-size-for-video=640x480;
factory-af-led-lv-limit=-1,-1;
zoom=0;
factory-af-scan-limit=-1,-1;
max-num-detected-faces-hw=0;
continuous-mode=off;
zoom-supported=true;
metering=center;
whitebalance=auto;
scene-mode=auto;
jpeg-quality=1;
factory-testno=0;
factory-af-diff-check=-1,-1;
preview-format-values=yuv420sp,yuv420p;
best-mode=off;
red-eye-fix=fail;
jpeg-thumbnail-quality=100;
preview-format=yuv420sp;
zoom-action=zoom-stop;
face-detection=off;
video-size-values=1920x1080,1280x720,768x512,640x480,320x240,176x144;
factory-zoom-slope-check-data=-1,-1;
preview-size=640x480;
focal-length=4.100000;
flash-charging=0;
factory-cap-range=-1,-1;
factory-iris-range=-1,-1;
preview-frame-rate-values=120,60,30,25,20,15,10,7;
factory-af-scan-range=-1,-1;
preview-frame-rate=30;
jpeg-thumbnail-width=160;
video-size=0x0;
scene-mode-values=auto,portrait,landscape,night,beach,snow,sunset,fireworks,sports,party,candlelight,dusk-dawn,fall-color,back-light,text;
preview-fps-range-values=(7000,120000);
jpeg-thumbnail-size-values=160x120,160x90,192x128,0x0;
zoom-ratios=100,120,150,180,220,280,340,400,500,610,750,940,1140,1390,1790,2100;
preview-size-values=1280x720,1056x704,960x720,768x512,640x480;
factory-zoom-range-check-data=-1,-1;
factory-af-led-range=-1,-1,-1,-1;
picture-size-values=4608x2592,3264x2448,4608x3456,4608x3072,3648x2736,2592x1944,2304x1728,1984x1488,1920x1080,1024x768,960x720;
preview-fps-range=7000,120000;
auto-whitebalance-lock=false;
min-exposure-compensation=-6;
antibanding=off;
max-num-focus-areas=1;
vertical-view-angle=46.3;
factory-wb-value=-1,-1,-1,-1;
horizontal-view-angle=59.6;
jpeg-thumbnail-height=120;
continuous-fps=;
focus-mode=auto;
factory-sc-speedtime=-1,-1;
factory-gyro-range-data=-1,-1,-1,-1;
video-frame-format=yuv420sp;
max-num-detected-faces-sw=3;
picture-format-values=jpeg;
max-exposure-compensation=6;
factory-ois-range-data=-1,-1,-1,-1,-1,-1,-1;
focus-areas=(0,0,0,0,0);
exposure-compensation=0;
exposure-compensation-step=0.33;
flash-mode=off;
flash-standby=off;
auto-exposure-lock=false;
wb-custom=-1,-1;
effect-values=none,mono,negative,sepia,antique,point-blue,point-red,point-yellow,warm,cold,washed;
factory-punt-range-data=-1,-1,-1;
factory-vib-range-data=-1,-1,-1,-1,-1,-1;
picture-size=4608x2592;
max-zoom=15;
factory-gain-liveview-range=-1,-1;
effect=none;
blink=fail;
whitebalance-values=auto,incandescent,fluorescent,warm-fluorescent,daylight,cloudy-daylight,custom,temperature,incandescent,prohibition,horizon,ledlight;
picture-format=jpeg;
focus-distances=0.15,1.20,Infinity;
factory-flash-range=-1,-1;
raw-save=0;
curr_zoom_level=0;
hdr-mode=0;
antibanding-values=50hz,off;
Also I have noticed in log that internal camera has such parametres:
Code:
AppShutterSound=0;
acb=off;
af-lamp=off;
antibanding=50hz;
antibanding-values=50hz,off;
aperture=80;
auto-exposure-lock=false;
auto-whitebalance-lock=false;
best-mode=off;
blink=fail;
bracket=off;burst-mode=off;
cam_mode=0;
camera-id=1;
continuous-fps=1fps;
continuous-mode=off;
contrast=0;
curr_zoom_level=0;
disable-aeawb-lock=0;
drive=single;
effect=none;
effect-values=none,mono,negative,sepia,antique,point-blue,point-red,point-yellow,warm,cold,washed;
exposure-compensation=0;
exposure-compensation-step=0.33;
face-detection=off;
factory-af-diff-check=-1,-1;
factory-af-led-lv-limit=-1,-1;
factory-af-led-range=-1,-1,-1,-1;
factory-af-scan-limit=-1,-1;
factory-af-scan-range=-1,-1;
factory-cap-range=-1,-1;
factory-flash-range=-1,-1;
factory-gain-liveview-range=-1,-1;
factory-gyro-range-data=-1,-1,-1,-1;
factory-iris-range=-1,-1;
factory-ois-range-data=-1,-1,-1,-1,-1,-1,-1;
factory-punt-range-data=-1,-1,-1;
factory-sc-speedtime=-1,-1;
factory-testno=0;
factory-vib-range-data=-1,-1,-1,-1,-1,-1;
factory-wb-value=-1,-1,-1,-1;
The only thing that does not work for me is setting ISO value.
I have tried such methods, but camera shoots in auto mode, not 200:
Code:
Camera camera = ...
Camera.Parameters params = camera.getParameters();
params.set("iso", 200);
params.set("current-iso", 200);
params.set("iso-mode-value", 200);
params.set("iso-value", 200);
params.set("iso-mode", 200);
camera.setParameters(params);
Any help, how can I control ISO?

No idea how to set your desired ISO value I'm afraid, perhaps try setting scene-mode to something other than auto to see if the scene mode selection overrides your ISO setting?
I was interested in focus rather than zoom, is it possible to programmatically set the focus using e.g. focus-mode=manual (or fixed) and then setting a value for "focal-length"?

lardman said:
No idea how to set your desired ISO value I'm afraid, perhaps try setting scene-mode to something other than auto to see if the scene mode selection overrides your ISO setting?
I was interested in focus rather than zoom, is it possible to programmatically set the focus using e.g. focus-mode=manual (or fixed) and then setting a value for "focal-length"?
Click to expand...
Click to collapse
Tried doing this, had no effect.
I set focus-mode to "manual" then dumped parameters (got the same parameters so nothing changed). As a shot in the dark I tried setting focal-length but it's a float value and you can only set string and int values. I tried setting it as an int which did nothing and also as the string representation of a float which did nothing.
It appears to me that this is going to require some spalunking through libraries to see if someone exposed a move_lense function lol

luscoma said:
Tried doing this, had no effect.
I set focus-mode to "manual" then dumped parameters (got the same parameters so nothing changed). As a shot in the dark I tried setting focal-length but it's a float value and you can only set string and int values. I tried setting it as an int which did nothing and also as the string representation of a float which did nothing.
It appears to me that this is going to require some spalunking through libraries to see if someone exposed a move_lense function lol
Click to expand...
Click to collapse
I've spent the last day or so poking around in the camera and have pretty much approached the limit of my knowledge. I'm going to post what I've found here so that maybe someone whose been down this road can give some more information.
TL;DR; The functionality we seek is not directly exposed, there's a possibility that some functions which look like factory test functions in the driver may do what we need to do but I am not sure if that can really be confirmed.
Okay starting with the bits I know:
First up the m9mo driver in the linux kernel (/drivers/media/video/m9mo.c/h). As far as I can tell this is the driver for the soc actually used in the camera it writes some i2c commands and maintains the state of the hardware. It has a lot of neat functions which are all exposed to the v4l2 subsystem and can be poked via ioctls if you can get a sysfs node to do it on. It seems to me that this thing is a registered as subdevice in v4l2 and subsequently it's set to not expose itself as a sysfs node. Only the main device which I believe is registered by libfimc is exposed in sysfs. Looking back at the m9mo driver it seems like the only way that manual control of the focus motor can be achieved is via a set of methods called factory_af*, particularly I'm looking at set_factory_af, set_factory_af_step, set_factory_af_position. set_factory_af has a lot of options for manually manipulating the focus lock and the focus range and things but I believe most of that functionality is exposed already via Android (with the exception of setting specific scan ranges).
The other two though look more interestin, particularly set_factory_af_position. If you look though the m9mo.h file it seems like the i2c commands it sends are divided into categories, this function sends a function under the CAMERA_LENS category called AUTOFOCUS_ADJUST which to me feels like a way to either relatively or absolutely position the camera motor. I have not tried sending the raw i2c command though it's pretty trivial to figure out what to send based on the driver code. I may try this if I find some time.
Going up a level to fimc (/drivers/media/video/s5p-fimc):
I'm pretty hazy on this but I think that this is the unified camera interface for samsung. This has been explored some by the CM team and so there's knowledge out there about this sub-system I just don't have it lol. Based on my rudimentary understanding of v4l2 this seems like it's registered as the main camera device and then m9mo is registered as a sub device of it. So on my device /dev/video2 and /dev/video3 are registered by libfimc and I can't seem to open /dev/video1 or 0 (the other video devices in the teens are libjpeg stuff).
Going up another level to the android hal type things, libcamera_client.so does contain some very interesting tidbits. This is the module that basically services android calls via android.hardware.camera and it seems to me that if you do objdump -T on it that it actually contains parameter name strings for the super interesting stuff in the m9mo driver. Things like:
000222f7 g DO .rodata 0000000b _ZN7android16CameraParameters26FACTORY_AF_ZONE_AUTO_MACROE
000233ea g DO .rodata 00000006 _ZN7android16CameraParameters21FACTORY_AF_ZONE_MACROE
00022899 g DO .rodata 00000007 _ZN7android16CameraParameters22FACTORY_AF_ZONE_NORMALE
0002298d g DO .rodata 00000006 _ZN7android16CameraParameters20FACTORY_AFLENS_CLOSEE
0002206a g DO .rodata 00000005 _ZN7android16CameraParameters19FACTORY_AFLENS_OPENE
0002283a g DO .rodata 00000002 _ZN7android16CameraParameters28FACTORY_AF_POSITION_POSITIONE
00022737 g DO .rodata 00000002 _ZN7android16CameraParameters24FACTORY_AF_POSITION_NEARE
00022406 g DO .rodata 00000002 _ZN7android16CameraParameters23FACTORY_AF_POSITION_FARE
00022847 g DO .rodata 00000008 _ZN7android16CameraParameters18FACTORY_AF_LED_LOGE
00022603 g DO .rodata 0000000e _ZN7android16CameraParameters24FACTORY_AF_LED_END_CHECKE
00022726 g DO .rodata 0000000a _ZN7android16CameraParameters20FACTORY_AF_STEP_SAVEE
00022eb8 g DO .rodata 00000008 _ZN7android16CameraParameters24FACTORY_AF_INTERRUPT_SETE
000222e5 g DO .rodata 0000000a _ZN7android16CameraParameters20FACTORY_AF_FOCUS_LOGE
000230a8 g DO .rodata 0000000a _ZN7android16CameraParameters20FACTORY_AF_RANGE_LOGE
00022ef1 g DO .rodata 0000000a _ZN7android16CameraParameters20FACTORY_AF_LOCK_STOPE
0002283c g DO .rodata 0000000b _ZN7android16CameraParameters21FACTORY_AF_LOCK_STARTE
00022d2c g DO .rodata 00000009 _ZN7android16CameraParameters19FACTORY_AF_STEP_LOGE
00022bfd g DO .rodata 0000000a _ZN7android16CameraParameters25FACTORY_AF_MOVE_END_CHECKE
00023359 g DO .rodata 00000005 _ZN7android16CameraParameters15FACTORY_AF_MOVEE
00022788 g DO .rodata 00000009 _ZN7android16CameraParameters23FACTORY_AF_LOCK_OFF_SETE
00022f87 g DO .rodata 00000008 _ZN7android16CameraParameters22FACTORY_AF_LOCK_ON_SETE
00022c1f g DO .rodata 00000003 _ZN7android16CameraParameters10AF_LAMP_ONE
00022445 g DO .rodata 00000004 _ZN7android16CameraParameters11AF_LAMP_OFFE
00022214 g DO .rodata 00000016 _ZN7android16CameraParameters25KEY_FACTORY_TILT_AF_RANGEE
00022ca3 g DO .rodata 00000014 _ZN7android16CameraParameters41KEY_FACTORY_DEFECTPIXEL_SET_NLV_DRAFT1_HDE
00023173 g DO .rodata 00000010 _ZN7android16CameraParameters40KEY_FACTORY_DEFECTPIXEL_SET_NLV_DRAFT_HSE
000225e7 g DO .rodata 00000011 _ZN7android16CameraParameters38KEY_FACTORY_DEFECTPIXEL_SET_NLV_DRAFT2E
000220a0 g DO .rodata 00000011 _ZN7android16CameraParameters38KEY_FACTORY_DEFECTPIXEL_SET_NLV_DRAFT1E
000235fc g DO .rodata 00000011 _ZN7android16CameraParameters38KEY_FACTORY_DEFECTPIXEL_SET_NLV_DRAFT0E
0002321c g DO .rodata 00000016 _ZN7android16CameraParameters25KEY_FACTORY_AF_DIFF_CHECKE
00022e07 g DO .rodata 00000013 _ZN7android16CameraParameters23KEY_FACTORY_AF_LED_TIMEE
00022b6b g DO .rodata 00000018 _ZN7android16CameraParameters27KEY_FACTORY_AF_LED_LV_LIMITE
00022bb3 g DO .rodata 00000015 _ZN7android16CameraParameters24KEY_FACTORY_AF_LED_RANGEE
00021f8c g DO .rodata 00000010 _ZN7android16CameraParameters19KEY_FACTORY_AF_ZONEE
000228ac g DO .rodata 0000000f _ZN7android16CameraParameters18KEY_FACTORY_AFLENSE
00022b8e g DO .rodata 00000019 _ZN7android16CameraParameters28KEY_FACTORY_AF_RESOL_CAPTUREE
00022049 g DO .rodata 00000016 _ZN7android16CameraParameters25KEY_FACTORY_AF_SCAN_RANGEE
00023583 g DO .rodata 00000016 _ZN7android16CameraParameters25KEY_FACTORY_AF_SCAN_LIMITE
00021f00 g DO .rodata 0000000f _ZN7android16CameraParameters23KEY_FACTORY_AF_POSITIONE
000226d2 g DO .rodata 00000010 _ZN7android16CameraParameters23KEY_FACTORY_AF_STEP_SETE
000233df g DO .rodata 0000000b _ZN7android16CameraParameters14KEY_FACTORY_AFE
000229ac g DO .rodata 00000008 _ZN7android16CameraParameters11KEY_AF_LAMPE
00022732 g DO .rodata 00000002 _ZN7android16CameraParameters23FACTORY_AF_POSITION_PARE
Going a step further and disasembling in ida or doing a string dump, the key_factory_* blah stuff actually maps to parameter names you can set in CameraParameters:
factory-af-pos
factory-af-zone
factory-af-scan-range
factory-tilt-af-range
factory-af-step
factory-aflens
af-lamp
factory-af-led-lv-limit
factory-af-resol-capture
factory-af-led-range
factory-af-ledtime
factory-af-diff-check
factory-af
factory-af-scan-limit
Unfortunately I tried just doing:
Camera c = Camera.open()
Parameters p = c.getParameters()
p.set("focus-mode", "manual") // This actually works the camera defines a valid autofocus mode of manual and if you look at the kernel logs this does get sent to the driver
p.set("factory-af-pos", 123) // The function in the driver writes a single byte of 0-255 so I imagine this is just a focus step range.
c.setParameters(p)
This appeared to do nothing but it doesn't raise a RuntimeError so that's something. If you try reading (most) of those parameters you just get null out, a few of them actually show up with factory data. My guess is that you probably have to put the camera into a special mode or know the right incantation to get it to respond properly -- even then I'm not sure how it is implemented in the hardware (i.e. it probably wouldn't trigger an AutoFocusMoved callback in Android).
Hope this helps someone, I'm dieing for this functionality

And it continues:
Here are the camera parameters you can set in Camera.Parameters (determined via dumpstrings and a regex to look for anything lowercase with '-'. Interestingly you can't poke the factory ones UNLESS factory-testno is > 0. So I did a quick experiment setting factory-testno to 1 and then poked factory-af-pos. I had hoped that that would let me control the motor, unfortunately it seemed like it just toggled the AF mode from af, macro, infinity or something similar :/ Still searching for a way if I can find out.
aeb-value
af-lamp
alive-off
alive-on
antibanding-values
aperture-capture
aperture-cmd
aperture-preview
auto-exposure-lock
auto-exposure-lock-supported
auto-macro
auto-macro
auto-value
auto-whitebalance-lock
auto-whitebalance-lock-supported
background-blur
back-light
back-light-portrait
barrel-off
barrel-on
barrel-start
barrel-stop
bayer-rggb
beach-snow
best-group-pose
best-mode
blue-sky
burst-mode
burst-shot-save-folder
charge-end
check-off
check-on
close-up
cloudy-daylight
comp-off
comp-on
comp-start
comp-stop
contextualtag-weather
continuous-fps
continuous-mode
continuous-picture
continuous-video
cross-filter
digital-tele-start
digital-wide-start
dl-check
dual-is
dual-off
dual-on
dusk-dawn
eep-write
effect-values
end-check
end-check
end-check
end-check
exposure-compensation
exposure-compensation-step
face-detection
face-detection
face-retouch
factory-adj-iris
factory-ae-target
factory-af
factory-af-diff-check
factory-af-led-lv-limit
factory-af-led-range
factory-af-ledtime
factory-aflens
factory-af-pos
factory-af-resol-capture
factory-af-scan-limit
factory-af-scan-range
factory-af-step
factory-af-zone
factory-backlash
factory-backlash-count
factory-bl-max
factory-cap-ctrl
factory-cap-gain
factory-cap-gain-offset-sign
factory-cap-gain-offset-val
factory-cap-range
factory-common
factory-defocus
factory-dfpx
factory-dfpx-dr0
factory-dfpx-dr1
factory-dfpx-dr1-hd
factory-dfpx-dr2
factory-dfpx-hs
factory-dfpx-nlvcap
factory-df-tele
factory-df-wide
factory-down-result
factory-end-result
factory-fail-stop
factory-flash-chg-chk
factory-flash-cmd
factory-flash-manual-charge
factory-flash-manual-en
factory-flash-range
factory-flicker
factory-fw-ver-isp
factory-fw-ver-ois
factory-fw-ver-result
factory-gain-live
factory-gain-liveview-range
factory-gyro
factory-gyro-range-data
factory-interpolation
factory-ircheck-bgain
factory-ircheck-rgain
factory-iris-range
factory-ldc
factory-liveview-offset-sign
factory-liveview-offset-val
factory-lsc
factory-lsc-ref
factory-lsc-table
factory-lsc-zoom-interrupt
factory-lv-target
factory-mode
factory-nodefocusyes
factory-ois
factory-ois-centering-move-shift-data
factory-ois-range-data
factory-punt
factory-punt-long
factory-punt-range-data
factory-punt-short
factory-resol
factory-rtc-manually-limit
factory-rtc-manually-time
factory-sc
factory-sc-iris-num
factory-sc-iso
factory-sc-range
factory-sc-set-iris
factory-sc-speedtime
factory-shift
factory-shift-x
factory-shift-y
factory-sys-mode
factory-testno
factory-tilt-1time-sciprt-run
factory-tilt-af-range
factory-tilt-diff-range
factory-tilt-field
factory-tilt-scan-limiit
factory-vib
factory-vib-range-data
factory-wb
factory-wb-range
factory-wb-value
factory-zoom
factory-zoom-range-check-data
factory-zoom-slope-check-data
factory-zoom-step
fall-color
fillin-step
firm-dl
flash-charging
flash-low-battery
flash-mode
flash-mode-values
flash-standby
flash-step
flash-value-of-isp
focal-length
focus-area-mode
focus-areas
focus-distances
focus-log
focus-mode
focus-mode-values
focus-range
gps-altitude
gps-latitude
gps-longitude
gps-processing-method
gps-timestamp
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
h}D-h
high-speed
hold-lens
horizontal-view-angle
image-stabilizer
indoor-end-check
indoor-run
int-set
ircheck-run
jpeg-quality
jpeg-thumbnail-height
jpeg-thumbnail-quality
jpeg-thumbnail-size-values
jpeg-thumbnail-width
led-end-check
led-log
lens-control
light-trail-shot
lock-off
lock-on
lock-start
lock-stop
long-scan-data
long-scan-start
long-scan-stop
low-light-mode
lsc-log
macro-color
macro-text
max-exposure-compensation
max-num-detected-faces-hw
max-num-detected-faces-sw
max-num-focus-areas
max-num-metering-areas
max-thr
max-zoom
metering-areas
min-exposure-compensation
move-step
moving-shot
natural-green
natural-green
night-portrait
object-tracking
optical-scale-zoom
optical-tele-start
optical-wide-start
outdoor-end-check
outdoor-run
picture-format
picture-format-values
picture-size
picture-size-values
point-blue
point-red
point-yellow
preferred-preview-size-for-video
preview-format
preview-format-values
preview-fps-range
preview-fps-range-values
preview-frame-rate
preview-frame-rate-values
preview-size
preview-size-values
range-check-start
range-check-stop
range-log
range-start
range-stop
raw-save
recording-hint
red-eye
red-eye-fix
return-center
scenario-6
scene-mode
scene-mode-values
short-scan-data
short-scan-start
short-scan-stop
shutter-speed
slope-check-start
slope-check-stop
slow-tele-start
slow-wide-start
smart-auto
smart-scene-detection
smart-touch
smooth-zoom-supported
start-filter
step-log
step-save
vertical-view-angle
video-frame-format
video-size
video-size-values
video-snapshot-supported
video-stabilization
video-stabilization-supported
warm-fluorescent
warm-fluorescent
wb-a
wb-b
wbb-value
wb-custom
wb-g
wb-k
wb-m
whitebalance-values
wide-run
widget-mode-level
yuv422i-yuyv
zoom-action
zoom-key-start
zoom-lens-status
zoom-pinch-start
zoom-ratios
zoom-stop
zoom-stop
zoom-supported

luscoma said:
Camera c = Camera.open()
Parameters p = c.getParameters()
p.set("focus-mode", "manual") // This actually works the camera defines a valid autofocus mode of manual and if you look at the kernel logs this does get sent to the driver
p.set("factory-af-pos", 123) // The function in the driver writes a single byte of 0-255 so I imagine this is just a focus step range.
c.setParameters(p)
Hope this helps someone, I'm dieing for this functionality
Click to expand...
Click to collapse
I just now used this code to change the paramaters and my app actually took a picture without having to set factory-testno.
But I actually have no idea how to determine if the camera is doing any manual focusing. How can I do that?
What I'm really looking for is changing aperture and ISO.

beerockxs said:
I just now used this code to change the paramaters and my app actually took a picture without having to set factory-testno.
But I actually have no idea how to determine if the camera is doing any manual focusing. How can I do that?
What I'm really looking for is changing aperture and ISO.
Click to expand...
Click to collapse
Ya it will let you set the parameter but it doesn't do anything unless you have factory-testno set. The only way to check if manual focusing was working would be to take a picture and then another after twiddling the knobs and see if they were at different focal distances.
I think the aperture and ISO will be via an Android API but I didn't look into how.
As a follow up to my previous post, I've dug through the driver code. They just didn't expose the control of the autofocus motor in the driver. The driver is only responsible for telling the SOC was mode to be in and when to trigger its autofocus routine. My gut says there's an i2c command you can send to the soc and have it move but it isn't used in the driver and unless someone mysteriously turns up a datasheet then it isn't likely to be added in by anyone but Samsung.

Related

Let's fix up CM10.1 (bugs + discussion)

Again: No chitchat, no "thank you" posts, no non-technical questions, no bug reports without logcats.
As the other CM10.1 threads usually are overrun by users let's try to make use of the new section and create a new bug thread in here.
Bug reports including a clear description and a logcat are welcome, every offtopic post will get deleted. Simple as that :fingers-crossed:
This thread can get used for discussion of these bugs as well - as long as it's closely development focused (e.g. "based on the logcat the problem is in package xyz, here's my idea how to fix it").
We have created a github organization where we'll push the fixes (and commit them to Gerrit if @aremcee is still interested at maintaining the P990 ).
https://github.com/p990-dev
If you want to help just send a pull request (or PM me about getting full access).
There are dedicated branches for the old bootloader ("cm10.1", following CM) and new bootloader ("cm10.1-newbl").
This will hopefully make it easier for devs to support both bootloaders.
Again, pull requests are always welcome.
Please don't discuss gapps related bugs (keyboard closing, gtalk video not working etc.) in here, there's a dedicated thread about non-neon gapps.
1st update:
I digged into the Wifi Hotspot issue.
One reason it doesn't work seems to be that cyanogen reverted a P990 specific patch in the netd package for merging Android 4.2 sources.
Link: https://github.com/CyanogenMod/android_system_netd/commit/d2fe72845348bb1c9e67d2cf3c648e68a93be05f
We need to bring that back. But the structure of the SoftapController.cpp changed substantially, I (or whoever beats me to it) need to look into it closer to determine who to apply the custom patch with the new format.
Additionally I just committed the bootanimation fix:
https://github.com/p990-dev/android...mmit/e298d5c00afb1eb057f1599dd8a71ba677c3c6ca
HI tonyp, another bug is "in-call" mic muting. We can't mute the mic when in call, even when muted, the voice goes through. It's present in CM 10 as well as 10.1. Secondly, I found a temporary solution for Bluetooth A2DP accelerated streaming, keep your Bluetooth turned on and reboot the phone. When the phone connect immediately after booting, the streaming works normal. However when you disconnect subsequently and try to connect again, the music streaming will be accelerated again
About bluetooth, just found a similar issue reported on the HTC One X forums (http://forum.xda-developers.com/showpost.php?p=38647415&postcount=11481). Similar as in same log output, probably not in the result. But both our logs and his log show that there's a buffer overload that after a few starts exploding (our log follows)
Code:
...
03-07 19:54:21.230 W/bt-btif ( 834): btif_media_aa_prep_2_send congestion buf count 25
03-07 19:54:21.230 W/bt-btif ( 834): btif_media_aa_prep_2_send congestion buf count 24
03-07 19:54:21.230 E/GKI_LINUX( 834): ##### ERROR : timer_thread: tick delayed > 5 slots (-547249208,-50000000) -- cpu overload ? #####
03-07 19:54:21.230 E/GKI_LINUX( 834): ##### ERROR : timer_thread: tick delayed > 5 slots (-538364208,-50000000) -- cpu overload ? #####
03-07 19:54:21.230 E/GKI_LINUX( 834): ##### ERROR : timer_thread: tick delayed > 5 slots (-529468208,-50000000) -- cpu overload ? #####
03-07 19:54:21.230 W/bt-btif ( 834): btif_media_aa_prep_2_send congestion buf count 25
03-07 19:54:21.230 E/GKI_LINUX( 834): ##### ERROR : timer_thread: tick delayed > 5 slots (-520578208,-50000000) -- cpu overload ? #####
03-07 19:54:21.230 W/bt-btif ( 834): btif_media_aa_prep_2_send congestion buf count 24
03-07 19:54:21.240 E/GKI_LINUX( 834): ##### ERROR : timer_thread: tick delayed > 5 slots (-511690208,-50000000) -- cpu overload ? #####
03-07 19:54:21.240 W/bt-btif ( 834): btif_media_aa_prep_2_send congestion buf count 25
03-07 19:54:21.240 E/GKI_LINUX( 834): ##### ERROR : timer_thread: tick delayed > 5 slots (-502803208,-50000000) -- cpu overload ? #####
03-07 19:54:21.240 W/bt-btif ( 834): btif_media_aa_prep_2_send congestion buf count 24
...
Of course this leads to faster / slower output (in any case inconsistent). Now, the interesting report from that guy on the One X forum is that bt works fine when wifi is off, and doesn't when it's in COEX mode. Anyone that is able to reproduce the problem, please, can you log an a2dp streaming session with wifi on and one with wifi off ? I need to see if there are different outputs and i'm not on 10.1 at the moment. Probably later today or in the weekend i'll setup dual boot so i can test first hand.
Pengus, I cam confirm that BT without wifi works the same way. I pair my phone for music streaming in my car and it's the same accelerated streaming.
tonyp said:
As the other CM10.1 threads usually are overrun by users let's try to make use of the new section and create a new bug thread in here.
[*]HDMI orientation broken.
The problem is: the GB libnvdispmgr_d.so blob contained a method NvDispMgrAutoOrientation() to change the orientation.
The ICS binary doesn't have that anymore, and pengus and I couldn't figure out yet how to achive the rotation.
(and no, using the old blob won't work).[/LIST]
Please don't discuss gapps related bugs (keyboard closing, gtalk video not working etc.) in here, that'll happen in a dedicated thread.
Click to expand...
Click to collapse
About the hdmi this is also an issue on the P920 what i think lg did here was set the natural orientation in surface flinger to landscape 90 then countered it to 0 when using auto sensor while on cm10+ its @ 0 the hdmi output only reads the default orientation
defcomg said:
About the hdmi this is also an issue on the P920 what i think lg did here was set the natural orientation in surface flinger to landscape 90 then countered it to 0 when using auto sensor while on cm10+ its @ 0 the hdmi output only reads the default orientation
Click to expand...
Click to collapse
Something like that. I managed to have portrait hdmi work correctly changing only a bit of rom code in surface flinger, but the rotation to full landscape mode is achievable only using private methods from the blobs or, as i'm attempting to do, by hijacking the hdmi output and sensor orientation directly in the kernel at the framebuffer level.
pengus77 said:
Something like that. I managed to have portrait hdmi work correctly changing only a bit of rom code in surface flinger, but the rotation to full landscape mode is achievable only using private methods from the blobs or, as i'm attempting to do, by hijacking the hdmi output and sensor orientation directly in the kernel at the framebuffer level.
Click to expand...
Click to collapse
from my understanding its surface flinger -> hwc -> framebuffer
in my case the current output is 648x1080 if i were to make changes @ kernel level would it not result in 1080x648 not 1920x1080? do you guys use ida pro to check lib exports?
defcomg said:
from my understanding its surface flinger -> hwc -> framebuffer
in my case the current output is 648x1080 if i were to make changes @ kernel level would it not result in 1080x648 not 1920x1080? do you guys use ida pro to check lib exports?
Click to expand...
Click to collapse
I'm waiting to get my hands on the hex-ray arm decompiler... soon
Anyway this is the base init of the hdmi fb in kernel world
Code:
static struct tegra_fb_data star_hdmi_fb_data = {
#ifdef CONFIG_MACH_STAR
.win = 0,
.xres = 1366,
.yres = 768,
.bits_per_pixel = 16,
#else
.win = 0,
.xres = 800,
.yres = 480,
.bits_per_pixel = 32,
#endif
.flags = TEGRA_FB_FLIP_ON_PROBE,
};
In fact on boot it's correctly set, then it rotates when surfaceflibger/hwc takes control and never get back to the right mode.
Moreover in the drivers/video/tegra/dc/hdmi.c source file we can see that both 720p and 1080p resolutions are supported by the driver, together with 480p and 576p modes.
As soon as i'll get hex-rays i'll decompile the ics surfaceflinger lib and try to see what externals it calls for panel setup / rotation. I guess it'll happen somewhere next week.
Guys please do not push this thread without reason - so no "thank you" posts, no "good luck" posts and stuff like that.
Each post in here should have a valid reason (read: should be development related).
Read the instructions of the developer discussion section first.
Thank you
pengus77 said:
I'm waiting to get my hands on the hex-ray arm decompiler... soon
Anyway this is the base init of the hdmi fb in kernel world
Code:
static struct tegra_fb_data star_hdmi_fb_data = {
#ifdef CONFIG_MACH_STAR
.win = 0,
.xres = 1366,
.yres = 768,
.bits_per_pixel = 16,
#else
.win = 0,
.xres = 800,
.yres = 480,
.bits_per_pixel = 32,
#endif
.flags = TEGRA_FB_FLIP_ON_PROBE,
};
In fact on boot it's correctly set, then it rotates when surfaceflibger/hwc takes control and never get back to the right mode.
Moreover in the drivers/video/tegra/dc/hdmi.c source file we can see that both 720p and 1080p resolutions are supported by the driver, together with 480p and 576p modes.
As soon as i'll get hex-rays i'll decompile the ics surfaceflinger lib and try to see what externals it calls for panel setup / rotation. I guess it'll happen somewhere next week.
Click to expand...
Click to collapse
Further investigation into surfaceFlinger from ics from 2x + p920
Shows ics had this
Code:
.text:00021880 loc_21880 ; CODE XREF: android::SurfaceFlinger::setOrientation(int,int,uint)+24j
.text:00021880 MOVS R1, #1
.text:00021882 STRB.W R7, [R4,#0x6D]
.text:00021886 STRB.W R5, [R4,#0x6C]
.text:0002188A MOV R0, R4
.text:0002188C BL _ZN7android14SurfaceFlinger19setTransactionFlagsEj ; android::SurfaceFlinger::setTransactionFlags(uint)
.text:00021890 ADD.W R0, R4, #0x74 ; cond
.text:00021894 MOV R1, R6 ; mutex
.text:00021896 BLX pthread_cond_wait
.text:0002189A
.text:0002189A loc_2189A ; CODE XREF: android::SurfaceFlinger::setOrientation(int,int,uint)+2Aj
.text:0002189A ; android::SurfaceFlinger::setOrientation(int,int,uint)+64j
.text:0002189A MOV R0, R6 ; mutex
.text:0002189C BLX pthread_mutex_unlock
.text:000218A0
.text:000218A0 loc_218A0 ; CODE XREF: android::SurfaceFlinger::setOrientation(int,int,uint)+12j
.text:000218A0 MOV R0, R5
.text:000218A2 POP.W {R4-R8,PC}
.text:000218A6 ; ---------------------------------------------------------------------------
.text:000218A6
.text:000218A6 loc_218A6 ; CODE XREF: android::SurfaceFlinger::setOrientation(int,int,uint)+Cj
.text:000218A6 ADD.W R6, R0, #0x54
.text:000218AA MOV R0, R6 ; mutex
.text:000218AC BLX pthread_mutex_lock
.text:000218B0 LDRB.W R0, [R4,#0x6C]
.text:000218B4 CMP R0, R5
.text:000218B6 BNE loc_21868
.text:000218B8 B loc_2189A
.text:000218B8 ; End of function android::SurfaceFlinger::setOrientation(int,int,uint)
setOrientation(int,int,uint)
public static native void setOrientation(int display, int orientation, int flags);
think they excluded the method for hdmi from being called from the framework but just ran it from with in the lib
all they would have needed was the orientation value coming from display 0x0 and sent it to display 0x1 ie hdmi
jellybean is using nativeSetDisplayOrientation(IIII)V with the addition of parameter "externalRotation"
by the way getExternalRotation in Display.java is set to 0x0 i don't if CM10 CM10.1 etc knows what todo with "externalRotation" on our devices
Could someone on the newbl who has problems with bluetooth fast-forwarding-sound please try this build:
http://tonyp.hopto.org/temp/cm-10.1-20130311-UNOFFICIAL-p990.zip
My headset doesn't have any problems whatsoever - neither with official CM sources nor with this build, so I need to wait for testers.
Attach a kernel log + logcat as well please.
Oh and of course one of the most annoying bugs:
After unlocking the brightness often gets reset to a way too low value.
Logcat and kernel log don't show any error.
arcee already tried to fix it some time ago (see here) but this didn't fix it fully.
I guess we can workaround it in here:
https://github.com/CyanogenMod/lge-kernel-star/blob/cm-10.1/drivers/video/backlight/aat2870.c
tonyp said:
Could someone on the newbl who has problems with bluetooth fast-forwarding-sound please try this build:
http://tonyp.hopto.org/temp/cm-10.1-20130311-UNOFFICIAL-p990.zip
My headset doesn't have any problems whatsoever - neither with official CM sources nor with this build, so I need to wait for testers.
Attach a kernel log + logcat as well please.
Click to expand...
Click to collapse
Got this bug immideatly with this rom.
dmesg: http://pastebin.com/F0rTb6fR
logcat: http://pastebin.com/08h2bJBW
BT headset: Jabra BT3030
Here is mine. Hope it help.
Does the provided logs help a bit?
Are they sufficient or do you need more?
chp2 said:
Does the provided logs help a bit?
Are they sufficient or do you need more?
Click to expand...
Click to collapse
I finally compiled and flashed a clean 10.1 on my phone. I'm currently working on fixing both bluetooth media and the low I/O. What i found out so far:
- I/O is perfectly fine on ext4 filesystems (system / data / cache) but slow to a crawl on the sdcards (internal and external both). This is most probably a rom-related problem because testing the speed from a shell results in perfectly fine speeds. I'm looking into a fix.
- Bluetooth media is a mess. We're not the only ones facing this problem and it's not related to CM. I've found on google references to the same error on both CM and AOSP. I'm starting to think this one will be messy to fix and i'm following closely the AOSP git activity related to bt and audio.
pengus77 said:
I finally compiled and flashed a clean 10.1 on my phone. I'm currently working on fixing both bluetooth media and the low I/O.....
Click to expand...
Click to collapse
Yeepeee....
Pingus, I have no doubt you'll find the bugs.
(you're the best hehe)
Question : is it possible to use JB 4.1.2 BT subroutines here?
chp2 said:
Yeepeee....
Pingus, I have no doubt you'll find the bugs.
(you're the best hehe)
Question : is it possible to use JB 4.1.2 BT subroutines here?
Click to expand...
Click to collapse
Google changed from bluez to bluedroid in Android 4.2. It would be possible to revert that but it would be extremely messy and is only the last resort.
Sent from my LG-P990 using xda app-developers app
tonyp said:
Google changed from bluez to bluedroid in Android 4.2. It would be possible to revert that but it would be extremely messy and is only the last resort.
Sent from my LG-P990 using xda app-developers app
Click to expand...
Click to collapse
I understand that you don't want to revert bluedroid to Bluez but I found this when searching on Google where someone has already tried to do so. I'm not a dev so don't know if it was successful.
darkcastleking said:
I understand that you don't want to revert bluedroid to Bluez but I found this when searching on Google where someone has already tried to do so. I'm not a dev so don't know if it was successful.
Click to expand...
Click to collapse
Thank you very much for this, I will check out these instructions on Monday/Tuesday and do another testbuild!
Edit: Oh no, had a quick look, as you can see in the activity stream he deleted a couple repos in january which are linked in the manifest.
Additionally I'll try to revert the Wifi Hotspot changes. It would be better to write a new Interface for the Wifi Hotspot, but I don't really know how to do so.
Both approaches can't be submitted to Gerrit unfortunately, but as long as it works it would be nice.
Hopefully arcee will gain interest into the 2x again some day - I'm pretty sure he can easily fix that stuff, as he knows the Android Source and overall background really well.

[Q] moto x camera controls for brightness and contrast

I need to be able to control the contrast and brightness of the images I take with the moto x camera. Sharpness would also be handy. The lack of controls on the built-in camera app is pretty appalling, very crude compared to the 3 year old HTC Incredible I have been using with it's native app. What has surprised me is that none of the apps I have downloaded to try will allow control of both contrast and brightness either, not to mention sharpness. Can someone enlighten as to why this is? Is normal access to the lower level sensor data not available for some reason? I don't get it. I am knowledgeable about digital image processing, but not that much about the needed android access to the sensor and the specifics for the moto x. Even the apps that advertised these adjustments for android phones did not offer controls for these functions on the moto X. If I have missed the obvious fix, I apologize and please point me in the right direction.
Thanks -
This could be the next moto cam.
http://forum.xda-developers.com/showthread.php?t=2427015
aviwdoowks said:
This could be the next moto cam.
http://forum.xda-developers.com/showthread.php?t=2427015
Click to expand...
Click to collapse
I like the moto x camera the way it is picture quality and recording could be a little better but I don't want that lenovo crap.
Sent from my XT1058 using xda premium
Couldn't get Lenovo camera app to work. Downloaded the apk and tried installing both from adb window, and directly on my phone, and also downloaded the zip file and used my recovery to install that. IN all cases, "Unfortunately, Lenovo SNAPit and SEEit has stopped." is the result.
As far as the native app goes, I use my phone to take pictures of blackboards and white boards all the time, and need to be able to adjust the bias and gain of the sensor basically, commonly called brightness and contrast. The lenovo app doesn't seem to work on Moto X. Any other recommendations? Or has anyone else successfully used it on the moto x?
I've been successful in controlling "brightness" simply by manually controlling the focus and exposure.
nhizzat said:
I've been successful in controlling "brightness" simply by manually controlling the focus and exposure.
Click to expand...
Click to collapse
yes, it works reasonably for that, but on a blackboard that has chalk over a previously erased board, without great lighting, it really helps to have contrast control as well. It's not that hard to do, and between brightness and contrast controls it's pretty easy to get a good exposure. I'm really surprised there is nothing out there to do that, and it makes me think that there is something about the moto x that underlying it all. Thus my post. That would explain why those controls on apps that advertise them are missing when loaded onto the moto x.
Mine too!! I only last used it on 422 a week ago!!
Sorry. Great cam.
dmm108 said:
yes, it works reasonably for that, but on a blackboard that has chalk over a previously erased board, without great lighting, it really helps to have contrast control as well. It's not that hard to do, and between brightness and contrast controls it's pretty easy to get a good exposure. I'm really surprised there is nothing out there to do that, and it makes me think that there is something about the moto x that underlying it all. Thus my post. That would explain why those controls on apps that advertise them are missing when loaded onto the moto x.
Click to expand...
Click to collapse
Brightness/Contrast are adjusted after the shot, not before. This is easily done with any photo editor app.
What you're looking for is exposure compensation & ISO settings.....both of which are available on all of the 3rd party cameras I've downloaded. I like the Moto Camera because of the twist-to-launch gesture....but the camera is severely lacking in options. I keep the app Focal on my phone as well when I need to compose a specific shot.....but if I really wanna tinker I'll just forget crappy cell-phone cameras & pull out the DSLR.
Arak-Nafein said:
Brightness/Contrast are adjusted after the shot, not before. This is easily done with any photo editor app.
What you're looking for is exposure compensation & ISO settings.....both of which are available on all of the 3rd party cameras I've downloaded. I like the Moto Camera because of the twist-to-launch gesture....but the camera is severely lacking in options. I keep the app Focal on my phone as well when I need to compose a specific shot.....but if I really wanna tinker I'll just forget crappy cell-phone cameras & pull out the DSLR.
Click to expand...
Click to collapse
Actually I'm trying to avoid the extra step of post processing the photos in my computer. My old HTC Incredible had controls for brightness, contrast, and sharpening, and it was handy to just set it for the lighting conditions and be done. Doesn't seem like that much to ask for, since it was part of the default controls years ago. Simple image processing transformations and look-up table manipulation.
dmm108 said:
Actually I'm trying to avoid the extra step of post processing the photos in my computer. My old HTC Incredible had controls for brightness, contrast, and sharpening, and it was handy to just set it for the lighting conditions and be done. Doesn't seem like that much to ask for, since it was part of the default controls years ago. Simple image processing transformations and look-up table manipulation.
Click to expand...
Click to collapse
Well, that was probably some HTC software that gave you those settings. BTW most gallery apps have the ability to do minor editing like adjusting brightness & contrast.
What I'm trying to tell you is that you're looking for the wrong words. Look for ISO & exposure compensation instead. Contrast isn't simply "adjusted" in a camera....it depends on your lighting & exposure....so any "contrast" setting you were adjusting on the HTC was basically a filter. Same for "brightness".
If you want to make your photo brighter, set your ISO higher or up your exposure compensation....both settings easily adjusted on 3rd party camera apps. I can't say that I've ever used a camera app with "brightness" and "contrast" settings before taking a picture. Those are always adjusted after-the-fact.
^^^ this
Arak-Nafein said:
Well, that was probably some HTC software that gave you those settings. BTW most gallery apps have the ability to do minor editing like adjusting brightness & contrast.
What I'm trying to tell you is that you're looking for the wrong words. Look for ISO & exposure compensation instead. Contrast isn't simply "adjusted" in a camera....it depends on your lighting & exposure....so any "contrast" setting you were adjusting on the HTC was basically a filter. Same for "brightness".
If you want to make your photo brighter, set your ISO higher or up your exposure compensation....both settings easily adjusted on 3rd party camera apps. I can't say that I've ever used a camera app with "brightness" and "contrast" settings before taking a picture. Those are always adjusted after-the-fact.
Click to expand...
Click to collapse
"They are always adjusted afterwards" specifically because you never had a camera where that adjustment was possible before taking the picture, and you never had the need for it. So of course they were always adjusted afterwards.
I'm not using the wrong words. I simply want my camera app to give me control over contrast, and sharpness if possible. I never said I couldn't control brightness, and I understand what ISO and exposure controls do. I am a computer engineer with many years of experience in digital imaging. I know of what I speak, but more to the point, I know of what I want. If you can point me to an app that does that, great. Otherwise we can just agree to disagree about what you and I think I need. . If you can give me insight on a low level as to moto x's access to sensor data that might explain why camera apps that have this functionality on other platforms don't on the moto x, which would inform me writing my own controls, that would be even better.
dmm108 said:
"They are always adjusted afterwards" specifically because you never had a camera where that adjustment was possible before taking the picture, and you never had the need for it. So of course they were always adjusted afterwards.
I'm not using the wrong words. I simply want my camera app to give me control over contrast, and sharpness if possible. I never said I couldn't control brightness, and I understand what ISO and exposure controls do. I am a computer engineer with many years of experience in digital imaging. I know of what I speak, but more to the point, I know of what I want. If you can point me to an app that does that, great. Otherwise we can just agree to disagree about what you and I think I need. . If you can give me insight on a low level as to moto x's access to sensor data that might explain why camera apps that have this functionality on other platforms don't on the moto x, which would inform me writing my own controls, that would be even better.
Click to expand...
Click to collapse
I came off as condescending, my apologies.
I dunno man, the only thing I can think of even close to what you're talking about is maybe Paper camera? https://play.google.com/store/apps/details?id=com.dama.papercamera
I know it's silly, but you mentioned chalkboards & perhaps one of the silly filters will allow you to capture what you need? There's a brightness & contrast slider, it's all realtime adjustments.
Beyond that, I do not know. Good luck on your search! If you find something let us know because I'm interested to see how this pans out!
Arak-Nafein said:
I came off as condescending, my apologies.
I dunno man, the only thing I can think of even close to what you're talking about is maybe Paper camera? https://play.google.com/store/apps/details?id=com.dama.papercamera
I know it's silly, but you mentioned chalkboards & perhaps one of the silly filters will allow you to capture what you need? There's a brightness & contrast slider, it's all realtime adjustments.
Beyond that, I do not know. Good luck on your search! If you find something let us know because I'm interested to see how this pans out!
Click to expand...
Click to collapse
no apology needed, I appreciate the exchange - and if I find something pertinent, either an app, or some information about moto x specific barrier I'll pass it on.
dmm108 said:
no apology needed, I appreciate the exchange - and if I find something pertinent, either an app, or some information about moto x specific barrier I'll pass it on.
Click to expand...
Click to collapse
Are you using ART? I am and the fv-5 is not compatible.
aviwdoowks said:
Are you using ART? I am and the fv-5 is not compatible.
Click to expand...
Click to collapse
FV-5 did have contrast, brightness and sharpness control on one screen, but initially I had much trouble with it on the Moto-X. Basically I could not find a way to get solid confirmation of how many pictures I actually took. Sometimes I'd think I took several to find out I had one or two, and sometimes I had multiples. I did email the deveoper. I downloaded it again after your post, and it seems to be working as designed now. I wish the contrast/sharpness menu was not so buried in the menu tree and that I could choose it to be one of the on screen icons.
I'm not familiar with ART, so maybe you could explain that to me.
dmm108 said:
FV-5 did have contrast, brightness and sharpness control on one screen, but initially I had much trouble with it on the Moto-X. Basically I could not find a way to get solid confirmation of how many pictures I actually took. Sometimes I'd think I took several to find out I had one or two, and sometimes I had multiples. I did email the deveoper. I downloaded it again after your post, and it seems to be working as designed now. I wish the contrast/sharpness menu was not so buried in the menu tree and that I could choose it to be one of the on screen icons.
I'm not familiar with ART, so maybe you could explain that to me.
Click to expand...
Click to collapse
I just posted about it here.
http://forum.xda-developers.com/showthread.php?p=51782126#post51782126
http://forum.xda-developers.com/showthread.php?t=2589530
---------- Post added at 07:45 PM ---------- Previous post was at 07:43 PM ----------
So you must be on dalvik.
aviwdoowks said:
I just posted about it here.
http://forum.xda-developers.com/showthread.php?p=51782126#post51782126
http://forum.xda-developers.com/showthread.php?t=2589530
---------- Post added at 07:45 PM ---------- Previous post was at 07:43 PM ----------
So you must be on dalvik.
Click to expand...
Click to collapse
I have been, so I just turned on ART, and I'll let you know after a while the effects, but I'll switch over to your above thread so we can maintain the topic of this one.

[Q] RAW photos in Z3 with Android 5.0

It's really good to hear the Z3 models will get Android 5.0 sometime in the beginning of next year. As you might have read, Android 5.0 supports RAW image capture (in the API).
What I'm trying to figure out is if the Z3 will be able to utilize the RAW image capture functionality in the new Android.
I have written an "app" that prints all the possible camera settings to screen, and unfortunately there is no setting mentioning RAW. The only valid picture setting is 'jpeg'.
Maybe this will change in a future version? Or will A5 take RAW regardless of the capabilities in the camera settings?
Thanks!
Very inyereting . can't wait to see how this unveils
This article should answer the question: http://www.anandtech.com/show/8274/understanding-androids-camera-hal3
Doesn't this effectively mean that Lollipop (and new camera apps, utilizing Lollipops camera API) will solve most of the issues caused by unlocking the bootloader?
If third-party apps can access RAW from the camera, quality on par with, or even beyond, the stock camera-app on locked phones should be able to achieve.
I mean, degraded camera performance seems to be the most discussed problem with loosing the DRM keys. I for one wouldn't mind loosing Miracast and Sony services.
Yes and no. Third party software could do better in theory, but the sensor output still stays the same. Software can't perform miracles. And Sony's software already is quite advanced (whatever causes automatic mode to fail so badly is beyond me).
radicans said:
What I'm trying to figure out is if the Z3 will be able to utilize the RAW image capture functionality in the new Android.
I have written an "app" that prints all the possible camera settings to screen, and unfortunately there is no setting mentioning RAW. The only valid picture setting is 'jpeg'.
Click to expand...
Click to collapse
RAW isn't a sensor setting, it is a data encoding. The only "mandatory" difference between shooting "RAW" and "JPEG" in Android L is the binary format of the data you get back. RAW makes it possible to return *lots* of information about what's coming off the sensor, but it doesn't mandate it. For example, if Sony's proprietary software is using the white channel in the Exmor RS to get low-light performance (and no one knows for sure if it is), there's no guarantee they'll choose to include that in the RAW file. They could discard the W data (since only Sony's software really understands what to do with it) and give you back just the RGB.
Now, the ability to get back uncompressed (or losslessly compressed) data means 3rd party image post processing can do a better job with less artifacts. And the ability to request burst captures opens up the possibility of temporal noise reduction techniques. But we're probably a year or more away from having stable apps doing really interesting things with the new APIs.
Bottom line, if you must have root and camera quality is really important to you, do not buy a Z3C just on the "hope" that Android L will provide an adequate work-around.
Iruwen said:
This article should answer the question: http://www.anandtech.com/show/8274/understanding-androids-camera-hal3
Click to expand...
Click to collapse
Thanks for the informative article!
I have a slightly better image (!) of what is going on with the new API now. Although, it still leaves me uncertain about the RAW mode in the Z3. Quoting from the article:
"in effect it’s now possible to control shutter speed, ISO, focus, flash, white balance manually, along with options to control exposure level bias, exposure metering algorithms, and also select the capture format. This means that the images can be output as JPEG, YUV, RAW/DNG, or any other format that is supported."
Seeing as there is nothing in the current camera preferences indicating that RAW capture is allowed/supported, I guess we just have to wait and see.
Assuming though we will get RAW support, there will be quite some development work to get a decent noise free image, in phone, just working straight from the Bayer pattern! But if that is the only way to circumvent the sony processing algorithms, then so be it!
kopsis said:
RAW isn't a sensor setting, it is a data encoding. The only "mandatory" difference between shooting "RAW" and "JPEG" in Android L is the binary format of the data you get back. RAW makes it possible to return *lots* of information about what's coming off the sensor, but it doesn't mandate it. For example, if Sony's proprietary software is using the white channel in the Exmor RS to get low-light performance (and no one knows for sure if it is), there's no guarantee they'll choose to include that in the RAW file. They could discard the W data (since only Sony's software really understands what to do with it) and give you back just the RGB.
Click to expand...
Click to collapse
Thanks for the info, although I do know what RAW is What I was trying to point out is that there is nothing in the current camera parameters (in the API) indicating that we are allowed to ask for a RAW image, when taking a photo. So even if Android 5 supports RAW requests, I think the sony camera driver may still refuse to deliver one to us.
But what confuses me is that in Android 4 Camera API, you are also allowed to ask for a RAW image (not meaning you are guaranteed to get one), so in this respect I don't know what the difference is to Android 5.
radicans said:
But what confuses me is that in Android 4 Camera API, you are also allowed to ask for a RAW image (not meaning you are guaranteed to get one), so in this respect I don't know what the difference is to Android 5.
Click to expand...
Click to collapse
You can get a raw image with m8 or G2 or any other devices that permits it See this thread.
http://forum.xda-developers.com/showthread.php?t=2753946
As for further manual controls all are avialable except raw on the hybrid samsung zoom devices. There was no need for L there i don't know why vendors do not implement it more with their current flagship models.

Barcode scanning and camera focus

First, thanks for any input. I have a N6 that I use on my business, which is retail arbitrage. Basically I find cheap stuff and resell it online at a profit. I have many apps devoted to scanning items to look them up online. Most of them also work with a bluetooth barcode scanner, but that is not always withe me or convenient to the situation.
I have found that the my primary app, called scoutify (requires subscription), is very hard to scan barcodes with using the camera. It uses libraries/software called redlaser as the barcode scanning component. I have used this app on many other devices, many much lower than the N6 with no issues.
I have read about the N6 having camera slowness issues, but this does not seem to be slowness. What happens as you bring in a barcode, the camera is constantly attempting to focus on the backgound items as the barcode does not fill up the frame. It will focus in and out many times. you have to constantly move the item to scan close too and away from the camera and hope it actually focuses on what you want. Redlaser, at least as it is packaged in this app does not have any options. You can touch screen to focus, but it does not help on the N6.
Does anyone know of any settings under the hood that can be adjusted to maybe change the cameras focus behavior?
I am pretty comfortable with a rooted phone and ADB so I can backup and test things, I just do not know enough about the camera to know if this is possible or where to begin.
Thanks again!

[ROOT] Manual Video mode and other features on Oreo

Hello everybody,
I've been looking at the /system/etc/camera_config.xml file, and I noticed that there are so many features that the LG camera app supports, but some of them are disabled even if they work on our G5. So I made a flashable zip to enable these features:
Manual Video mode: works very well, but doesn't support 21:9 aspect ratio (also broken in Fulmics 5.5 G6 camera port)
Graphy (applies settings from existing photos to yours): working perfectly, you just need to install Graphy from the Play Store to access to many more photos.
Adjust Exposure in Automatic mode with a slider: working
Add signature: not working on my phone, may be worth to try on some other phones
ZSL (zero shutter lag) on Manual mode: working, but if you set exposure or shutter to AUTO, the camera shows a value of "0" for both ISO and shutter. It's just an UI bug, the photos are taken as expected.Removed, as it has too many drawbacks.
If you don't have TWRP, just extract the camera_config.xml file and place it in /system/etc/ and be sure to set permissions correctly.
If the options are not available after flashing the zip, clear the data of the camera app.
By the way, looking inside the Smali code of the camera app, it seems thate there is a [email protected] mode, but I have no clue on how to enable it to test if our camera supports such a high frame rate.
Lowering exposure on automatic would be useful. I always though on stock it was set too high with the wide angle exposure being perfect.
How exactly does that work? Will a slider button appear where there was none before? And do you think it can be done for Nougat?
EDIT: I'd like to manually edit the file myself, what do you have to change just to get the automatic mode exposure slider?
Thanks mate for your great finding.. I manually edit my LG V20 camera config according to yours and it's working as it should.
Those exposure slider should be a handy to me.. and graphy? idk what that is but i will try to explore those someday..
thanks again..
EDIT -
there is no need to reboot if change those config line, simply just clear the camera data and voila ! this should be time saving..
anyway, i'm going to spread your finding on LG V20 forums.. keep on the good works !
@tremalnaik
wow this is awesome, it is LG V30+ features for the Graphy things. Could you please find out how to get Cine Video Effect working as well?
@daniLaLaLaLaLa
Just found this thread, thanks to you.
Am I able to use this mod using Nougat on LGV20?
Please advise.
Thank you.
karkand said:
@tremalnaik
wow this is awesome, it is LG V30+ features for the Graphy things. Could you please find out how to get Cine Video Effect working as well?
@daniLaLaLaLaLa
Just found this thread, thanks to you.
Am I able to use this mod using Nougat on LGV20?
Please advise.
Thank you.
Click to expand...
Click to collapse
I guess it won't work on Nougat due to different camera apps.
ezzony said:
Lowering exposure on automatic would be useful. I always though on stock it was set too high with the wide angle exposure being perfect.
How exactly does that work? Will a slider button appear where there was none before? And do you think it can be done for Nougat?
EDIT: I'd like to manually edit the file myself, what do you have to change just to get the automatic mode exposure slider?
Click to expand...
Click to collapse
To lower the exposure just tap on the screen on the area you want to focus, then a slider with two suns will appear next to the shutter button. That's the slider for the exposure.
If you want to add that feature yourself, open the /system/etc/camera_config.xml file with a text editor (TotalCommander, Root Explorer, etc...) and look for AE_focus_supported string and replace "false" with "true".
If you want to do it on Nougat you can try, if you already find AE_focus_supported string in camera_config.xml, it will likely work.
karkand said:
@tremalnaik
wow this is awesome, it is LG V30+ features for the Graphy things. Could you please find out how to get Cine Video Effect working as well?
@daniLaLaLaLaLa
Just found this thread, thanks to you.
Am I able to use this mod using Nougat on LGV20?
Please advise.
Thank you.
Click to expand...
Click to collapse
I'll try to find out a way to use Cine Video Effect, there are some other modes, like mode_cinema and mode_disney_camera that are built in the camera code, but they make the camera app crash when selecting mode. There's also mode_food, that is shown correctly in the mode selection menu, but then crashes. Maybe some complementary files are missing from G5. I'll try to debug and see if it's just a matter of adding some files or if we need to edit the code.
If you want to use my file on V20 Nougat you can try, but make a backup of camera_config.xml, because different versions of camera app might not recognize some strings and crash. If you don't succeed, try editing your file, it's quite simple, you just have to replace some "false" with "true" and check if all works as expected.
EDIT: tried mode_cinema: the interface works perfectly, but it doesn't do anything You have the tutorial, the interactive zoom and the LUTs, but none of them works out of the box. As @xpirt explains here, Cinema Mode depends on the V30 camera sensor, and cannot be ported to G5 (and of course to G5, having the same sensor, at least on the primary camera).
Also Grid Photo (there are 4 modes) is buggy, because it takes stretched photos, with wrong aspect ratio and weird glitches. In this case doesn't seem to be a bug related to the hardware, but to the software.
@tremalnaik, ya that worked but it's ae_supported I think you meant not ae_focus. Anyway the setting was not available on my Nougat fone, I guess it could be made to work some way. I think I have the G6 camera app on my nougat g5 fone now I can't remember. Maybe it could be made to work by porting the G5 Oreo camera app over.
Incidentally what I don't like about the main rear camera is that it has a slighly orangy/yellow-y hue at times. The G4 camera was better. I wonder if there is any way to adjust it or is it basically the camera hardware.
For the AE Focus you might try adding this lines to your camera_config.xml
Code:
<item name="AE_focus_supported">
true
</item>
and see if your camera app makes use of this setting.
For the color I really don't know, there's so much code in that app to explore... If the color is too orange, you may want to switch to manual mode and set the white balance to something cooler. The problem would be if the color was too green or too purple (magenta), it wouldn't be possible to correct it using white balance, you woud need to edit the RAW file (or the JPG, with worst results).
https://drive.google.com/open?id=0BwmsIySoHg2FamhOaEQ1T1o0Wkk
---------- Post added at 01:30 PM ---------- Previous post was at 01:28 PM ----------
use this apk instead of playstore.after that active it in setting of camera.perhaps you may restart phone after install the apk.that's all
While I was testing the H-ROM G7, I noticed a bug in the camera that made me realize that Zero Shutter Lag and Manual mode are not compatible. If you have flashed the configuration with ZLS active in manual mode, please replace it flashing the other zip file.
Enabling ZLS has 2 huge drawbacks: not being able to save DNG raw files and having less control over shutter speed (especially not being able to take long exposures).
As I'm currently using H-ROM, I can't test if on stock Oreo this bug is there, but I'm pretty sure it is.
After playing around with smali code of the camera app, it seems to be possible to make manual video work without root (and the G7 camera app)
@jc9896 mind sharing your work?
Black_Eyes said:
@jc9896 mind sharing your work?
Click to expand...
Click to collapse
Extract the zip, install the app but dont open, and then copy the CamMod folder into the root of the internal storage.
I modified the app to search the CamMod folder for the relevant xml files.
Not a developer, no idea how to fix bugs and crashes.
Download here : https://mega.nz/#!ORIUBY6D!QzzC6m1BBYp-9LQB9kYIW9b2TFYyf7AqiO26T46sgos
Frank
Merci
tremalnaik said:
Hello everybody,
I've been looking at the /system/etc/camera_config.xml file, and I noticed that there are so many features that the LG camera app supports, but some of them are disabled even if they work on our G5. So I made a flashable zip to enable these features:
Manual Video mode: works very well, but doesn't support 21:9 aspect ratio (also broken in Fulmics 5.5 G6 camera port)
Graphy (applies settings from existing photos to yours): working perfectly, you just need to install Graphy from the Play Store to access to many more photos.
Adjust Exposure in Automatic mode with a slider: working
Add signature: not working on my phone, may be worth to try on some other phones
ZSL (zero shutter lag) on Manual mode: working, but if you set exposure or shutter to AUTO, the camera shows a value of "0" for both ISO and shutter. It's just an UI bug, the photos are taken as expected.Removed, as it has too many drawbacks.
If you don't have TWRP, just extract the camera_config.xml file and place it in /system/etc/ and be sure to set permissions correctly.
If the options are not available after flashing the zip, clear the data of the camera app.
By the way, looking inside the Smali code of the camera app, it seems thate there is a [email protected] mode, but I have no clue on how to enable it to test if our camera supports such a high frame rate.
Click to expand...
Click to collapse
Greetings!
I have a question. Is it possible in any way to install this apk on LG G5 running Nougat 7.0. When I try to install the app, It says "error parsing the package". This is probbably due to incompatibility with Nougat. I know there is a minimum SDK version set inside the apk files (AndroidManifest.xml) so would it be possible to tweak some settings? The software of the camera app on Oreo is messed up, producing noisy images so I wouldn't like to sacrifice that.
ToTheSpace2 said:
Greetings!
I have a question. Is it possible in any way to install this apk on LG G5 running Nougat 7.0. When I try to install the app, It says "error parsing the package". This is probbably due to incompatibility with Nougat. I know there is a minimum SDK version set inside the apk files (AndroidManifest.xml) so would it be possible to tweak some settings? The software of the camera app on Oreo is messed up, producing noisy images so I wouldn't like to sacrifice that.
Click to expand...
Click to collapse
For noisy images and general picture quality, I recommend Google Camera 6.1 on Oreo. (5.x on Nougat) Makes a huge difference in image quality.
You can find a good version by searching up google camera ports on xda, such as cstark's and Arnova's versions work well.
As for the stock cam, I tried with no success to port manual video over. There has been attempts iirc but it seems that manual video encoding is broken on Nougat. That issue is resolved on Oreo.
jc9896 said:
For noisy images and general picture quality, I recommend Google Camera 6.1 on Oreo. (5.x on Nougat) Makes a huge difference in image quality.
You can find a good version by searching up google camera ports on xda, such as cstark's and Arnova's versions work well.
As for the stock cam, I tried with no success to port manual video over. There has been attempts iirc but it seems that manual video encoding is broken on Nougat. That issue is resolved on Oreo.
Click to expand...
Click to collapse
Thank you for the reply!
Do you mind checking out a thread I made about LG G5 noise problem on Oreo (link: https://forum.xda-developers.com/lg-g5/help/long-exposure-images-lg-g5-oreo-noisier-t3956693)
I don't know if that's the general problem or is it just me, maybe you know something more about it? The manual video for Oreo is amazing but this image noise bug bothers me.
ToTheSpace2 said:
Thank you for the reply!
Do you mind checking out a thread I made about LG G5 noise problem on Oreo (link: https://forum.xda-developers.com/lg-g5/help/long-exposure-images-lg-g5-oreo-noisier-t3956693)
I don't know if that's the general problem or is it just me, maybe you know something more about it? The manual video for Oreo is amazing but this image noise bug bothers me.
Click to expand...
Click to collapse
There is noise on mine. Seems to be about the same as Nougat (can't really tell from my pics), but as I use GCam nowadays its not as much of a problem. Night sight on Oreo (GCam 6.1) does a lot to improve night shots and noise.
jc9896 said:
Extract the zip, install the app but dont open, and then copy the CamMod folder into the root of the internal storage.
I modified the app to search the CamMod folder for the relevant xml files.
Not a developer, no idea how to fix bugs and crashes.
Download here : https://mega.nz/#!ORIUBY6D!QzzC6m1BBYp-9LQB9kYIW9b2TFYyf7AqiO26T46sgos
Click to expand...
Click to collapse
I have tested your port for several days on my LG G5 (Oreo stock) and I am very grateful for your work. I know that some functions do not work but the most important ones for me such as manual video and manual photo modes work quite well. The LG Camera app 7.0 with your modifications is infinitely better than the one included in the stock rom.
Before, I had tried several video recording apps with manual controls from the Play Store but they used to have small jumps in the recordings. It seems that only LG apps record well in 4K with stock rom.
Works as described. Thank you for these tweaks. ???

Categories

Resources