AOSP Camera improvement ? - G2 Q&A, Help & Troubleshooting

Whenever I search for camera improvements in AOSP, I only find camera apps like lenovo super cam, HTC m9 cam, etc apps. But the thing is that camera apps alone can't improve the image and video quality. Camera apps can just be used to tweek some settings like ISO, contrast, brightness, HDR, and improve user experience. I don't find a noticible improvement between images taken on aosp stock camera app, lenovo, htc, and other AOSP camera mods.
The actual camera improvement lies in Camera HAL and drivers right?
But it is very difficult to write, edit, and test camera drivers.
There are devices with same camera sensor as g2 like
lg g3 (extra: laser auto focus and dual flash)
Moto x 2nd gen (extra: dual flash)
My question is that if the camera quality on those devices are better than our g2,
1. Is it possible to use the camera drivers and hal from those devices while compiling AOSP based roms?
2. Will the camera work as normal or other problems will encounter?
Devs: please take time to answer.
Others: Discussion is encouraged.

If I understand well the problem is that lg camera drivers are closed sources, so it is impossible to use the advanced functions of the sensor.
_____________________________________Read more write less and be smart

siggey said:
If I understand well the problem is that lg camera drivers are closed sources, so it is impossible to use the advanced functions of the sensor.
_____________________________________Read more write less and be smart
Click to expand...
Click to collapse
My question is about including camera drivers from other device sources which have same camera sensor/module while compiling the ROM.

I already asked this question, but didn't get any reply.
Is it possible to import LG framework into AOSP framework?
I'm asking, because I think there is no other way to get high camera image/video quality without LG stock camera app, but without LG framework the app won't work.
I'll introduce myself, I'm working for 2 years as HW and Realtime-Embedded SW engineer. I've designed (board design) Intel, Freescale and communication systems, made HDL design for FPGA with softcore (flexible custom built) micro-controller and I've written some custom cores for controller's interconnect (main inner bus). Of course for my custom cores I've written HAL drivers.
I've introduced myself, because I don't know anything about ROM building, but I'm pretty experienced in a low-level programming. I really want to help to resolve the problem with poor camera functioning.
I assume that the main problem with a camera and not only the camera of AOSP roms, is a very generic/basic framework. HAL drivers are only for the SOC itself. Camera module is not part of the SOC, it's connected to the SOC with I2C bus (control and status read) and LVDS transmitter (RAW sensor's data), so the only drivers needed are I2C and LVDS-IO. The drivers are part of the kernel, and the kernel doesn't know what is a camera, IR blaster and etc., the kernel takes care of CPU, GPU, AXI bus, UART, USB, I2C, LVDS transceivers and etc. The framework takes care of a camera - it includes the functions to control the camera. For example: to read supported resolutions of camera module:
char* camera_read_supported_res()
{
static char resolution_string[256];
if (i2c_write(CAMERA_ADDRESS, REG_ADDRESS, DATA) != 0) throw_exception();
if (i2c_read(CAMERA_ADDRESS, REG_ADDRESS, resolution_string) != 0) throw_exception();
return resolution_string;
}
Each camera module should have some (hundreds) essential registers with the same addresses and functionality, but nobody limits the manufacturers to add more registers to extend the functionality. And that's where the AAA manufacturers do monumental work to make additional features so great, like fast focusing, good low-light image quality and etc. Those manufacturers add additional hardware that require more control registers, and to manipulate them, they add additional functions to the framework. Those functions are just additional I2C_read/write set of function calls with some device specific registers (addresses). Stock camera apps make use of those additional functions, and if they don't exist in the framework, the should crash.
If each android mobile phone has sources of the stock ROM, is there anyway to add their framework to an AOSP framework?
Forgive me if some of my assumptions are incorrect, I've written them by basing on my work experience.
Click to expand...
Click to collapse

vitalik.t said:
I already asked this question, but didn't get any reply.
Click to expand...
Click to collapse
Your post has a lot of difficult things to understand. I'm studying engineering and I have Embedded systems as one of my subjects. I have heard lot of terms u used in the post in ES but still I was guessing a lot of things while reading.
Thanks for replying. You seem to have researched more than I did on the issue.
My question is a lot simpler.

I've checked the sources of the kernel that is published by LG. I was right about the drivers, there are no drivers for external modules. Need to use the camera? Use I2C and Rapid-IO drivers. But LG didn't publish the sources of the framework. And it looks like that Google also not publishing the sources, they do provide you an API.
We need somebody to decompile the framework.

Try the new snapdragon camera in apps and theme selection.

Related

Google Camera2 API

Hello every one! Hope you're having a great day
I'm here because I need your help To make a long story short, until I can save enough to buy a new proper camera, I'm stuck with my P9 Lite, which cannot save pictures as RAW/DNG files. This feature is provided by Google's Camera2 API, which my phone doesn't have/support. Four questions:
1. Is it possible to install Camera2 API on my phone, through a custom ROM?
2. Is it possible to install a custom ROM without losing on the initial image quality provided by my phone's camera?
3. In theory, could this API be enabled by a future software update? Or does it only have to do with how the phone was originally conceived?
4. Even if I managed to get the API on my phone, would it be possible to make it fully supported, and would I be able to save RAW/DNG files even if my phone originally doesn't offer this option?
Thank you very much!
P.S: I've never thought of "flashing" a custom ROM on my phone, this issue is the only reason why I'm considering it. As you may have noticed by my way of explaining things, I'm a five year old when it comes to informatics, and I'd probably be the first in line to buy Smartphone Software For Dummies. As much as I admire how technical and specialised you can get about a science that goes way beyond my understanding abilities, if you can keep things slow and simple, as if you were talking to an actual five year old, I'd be very grateful
themadbuddha said:
Hello every one! Hope you're having a great day
I'm here because I need your help To make a long story short, until I can save enough to buy a new proper camera, I'm stuck with my P9 Lite, which cannot save pictures as RAW/DNG files. This feature is provided by Google's Camera2 API, which my phone doesn't have/support. Four questions:
1. Is it possible to install Camera2 API on my phone, through a custom ROM?
2. Is it possible to install a custom ROM without losing on the initial image quality provided by my phone's camera?
3. In theory, could this API be enabled by a future software update? Or does it only have to do with how the phone was originally conceived?
4. Even if I managed to get the API on my phone, would it be possible to make it fully supported, and would I be able to save RAW/DNG files even if my phone originally doesn't offer this option?
Thank you very much!
P.S: I've never thought of "flashing" a custom ROM on my phone, this issue is the only reason why I'm considering it. As you may have noticed by my way of explaining things, I'm a five year old when it comes to informatics, and I'd probably be the first in line to buy Smartphone Software For Dummies. As much as I admire how technical and specialised you can get about a science that goes way beyond my understanding abilities, if you can keep things slow and simple, as if you were talking to an actual five year old, I'd be very grateful
Click to expand...
Click to collapse
Can't you just install https://play.google.com/store/apps/details?id=net.sourceforge.opencamera on stock ROM? I think the camera2 api should be available.
Thank you for replying! The application supports Camera2 API, but if the API is not available on my phone in the first place, I don't think the application will work...According to my researches, the API is like, let's say, a camera: if your phone doesn't have a camera, you could install as many camera apps as you want, your phone still won't take any pictures...What I need is a way to add a camera to my phone - in our case, the API - so that I can start taking pictures - in our case, saving RAW/DNG files. Also, I might be wrong.
themadbuddha said:
Thank you for replying! The application supports Camera2 API, but if the API is not available on my phone in the first place, I don't think the application will work...According to my researches, the API is like, let's say, a camera: if your phone doesn't have a camera, you could install as many camera apps as you want, your phone still won't take any pictures...What I need is a way to add a camera to my phone - in our case, the API - so that I can start taking pictures - in our case, saving RAW/DNG files. Also, I might be wrong.
Click to expand...
Click to collapse
So the app doesn't work? I can't test it cause I am not on stock.
Just tried open cam on stock rom and I can capture RAW dng files, so it seems like camera2 is supported try it out!
UPDATE: Enable "Use alternative flash method" in photo settings if it won't take pictures when camera2 is enabled.
Open camera is pretty buggy on this phone when shooting RAW. Try "Footej camera", seems to work better
yaa but for footej need to pay to have fully featured. I payed for this but for m there is no diference to open camera.
I didn't say that Footej is better than open camera. Just that open camera often bugs for me when using camera2 - eg nothing happens when pressing camera button.
Sry for reviving the thread, is there any way to increase max shutter speed in camera2 api? I'm really interested in shooting some raw stuff but apps like Opencamera or Adobe Lightroom won't allow me to set over 1 second shutter speed (apart from the built-in camera app that allows up to 8 secs, but without raw support...) so it's a pain in the butt if I want to take raw pictures at night.
Using the stock Marshmallow Emui
The Lightroom app has a built in camera which can shoot RAW, I tried it and it works flawlessly.
Camera API2 *IS* present on p9 lite and *DOES* work.
zgomot said:
The Lightroom app has a built in camera which can shoot RAW, I tried it and it works flawlessly.
Camera API2 *IS* present on p9 lite and *DOES* work.
Click to expand...
Click to collapse
Yup it does, but shutter speed cannot be set over 1 second (see the screenshot), that means night photos end up being very noisy since I need to drastically increase iso. The default camera app allows much longer shutter time, that's why I'm wondering what's wrong
If it was possible to set it to like 10 secs in the Lightroom app, the camera would be damn great
Krastinov said:
Yup it does, but shutter speed cannot be set over 1 second (see the screenshot), that means night photos end up being very noisy since I need to drastically increase iso. The default camera app allows much longer shutter time, that's why I'm wondering what's wrong
If it was possible to set it to like 10 secs in the Lightroom app, the camera would be damn great
Click to expand...
Click to collapse
Have you tried Camera FV5?
zgomot said:
Have you tried Camera FV5?
Click to expand...
Click to collapse
Yea, but it says that this device doesn't support raw :|
Krastinov said:
Yea, but it says that this device doesn't support raw :|
Click to expand...
Click to collapse
Is it the trial version?
zgomot said:
Is it the trial version?
Click to expand...
Click to collapse
Full. Does it work for you?
Also I heard that official Nougat brings raw support to the built-in camera, can anyone verify that? I might wanna update in that case
Krastinov said:
Full. Does it work for you?
Also I heard that official Nougat brings raw support to the built-in camera, can anyone verify that? I might wanna update in that case
Click to expand...
Click to collapse
I Know This Is Quite Old But In Case Someone Is Still Wondering;
I'm Using Stock Nougat Firmware On My P9 Lite And It Does Support Raw Format, But You Have To Root The Phone And Enable Raw/DNG Format In Some System Files

Whats the best camera app for A7

Currently just trying out open camera, is this the best? Clearly the ZTE camera software is terrible, the image processing looks like its been handled by my 1985 Casio calculator.
Mike
Hi. I've been using this, much more controls/settings. Even turned on HDR. NO ADS EITHER!
Open Camera is a fully featured and completely free Camera app for Android phones and tablets. Features:
* Option to auto-stabilize so your pictures are perfectly level no matter what (see example image).
* Expose your camera's functionality: support for focus modes, scene modes, color effects, white balance, ISO, exposure compensation/lock, face detection, torch.
* Video recording (including HD).
* Handy remote controls: timer (with optional voice countdown), auto-repeat mode (with configurable delay).
* Option to take photo remotely by making a noise (e.g., voice, whistle), or by voice command "cheese".
* Configurable volume keys.
* Optimise GUI for left or right-handed users.
* Zoom via multi-touch gesture and single-touch control.
* Option to lock orientation to portrait or landscape for photo or video. Upside-down preview option for use with attachable lenses.
* Choice of save folder (including support for Storage Access Framework).
* Disable shutter sound.
* Overlay a choice of grids and crop guides.
* Optional GPS location tagging (geotagging) of photos and videos; for photos this includes compass direction (GPSImgDirection, GPSImgDirectionRef).
* Apply date and timestamp, location coordinates, and custom text to photos; store date/time and location as video subtitles (.SRT).
* Yes you can take a selfie (also known as front camera), includes support for "screen flash".
* Support for (some) external microphones.
* Widget to automatically take a photo after launching.
* Support for Camera2 API: manual focus distance; manual ISO; manual exposure time; RAW (DNG) files.
* Support for HDR and Exposure Bracketing (Camera2 only).
* Dynamic range optimisation mode.
* Small file size.
* Completely free, and no ads in the app
Since ZTE did not implement Camera2 support, third pary apps do not handle it well. The only good option is the native camera app. Image processing is bad yes, but if you care about your photos, shoot them in RAW and do the processing yourself. That can get you some impressive results, on par with the hardware really. Hopefully the next update will fix the autofocusing problem.
How do I shoot in Raw mode on this thing?
I'd rather have a larger file size but a better result.
Mike
rolfey83 said:
How do I shoot in Raw mode on this thing?
I'd rather have a larger file size but a better result.
Mike
Click to expand...
Click to collapse
If you are on the US version of the phone, go to manual mode, settings and enable raw. (you have to shoot in manual mode but can leave all settings auto). If your device is the A2017G version or you use a custom rom, you would have to flash the US camera app from here: https://forum.xda-developers.com/axon-7/themes/zte-camera-flashable-zip-t3553638
Or, if you cannot flash, I'm afraid you'll have to wait until the G version implements the american camera improvements.
I'm not sure what the situation is with the chinese version of the device
0Kajuna0 said:
If you are on the US version of the phone, go to manual mode, settings and enable raw. (you have to shoot in manual mode but can leave all settings auto). If your device is the A2017G version or you use a custom rom, you would have to flash the US camera app from here: https://forum.xda-developers.com/axon-7/themes/zte-camera-flashable-zip-t3553638
Or, if you cannot flash, I'm afraid you'll have to wait until the G version implements the american camera improvements.
I'm not sure what the situation is with the chinese version of the device
Click to expand...
Click to collapse
Flashing the camera zip won't bring raw support on G devices running marshmallow/nougat roms for G devices...
I think it's a kernel-dependent feature. There's so little information about this...I'm waiting for nougat just for this, but I don't want to lose Xposed either
aLexzkter said:
Flashing the camera zip won't bring raw support on G devices running marshmallow/nougat roms for G devices...
I think it's a kernel-dependent feature. There's so little information about this...I'm waiting for nougat just for this, but I don't want to lose Xposed either
Click to expand...
Click to collapse
Oh ok. I assumed it would work on Nougat stock rom, if flashed. It does work on LineageOS A2017G
0Kajuna0 said:
Oh ok. I assumed it would work on Nougat stock rom, if flashed. It does work on LineageOS A2017G
Click to expand...
Click to collapse
You assumed something and I assumed something else. I hope I'm wrong. I just found it very weird that no one said anything about it working/not working
Deleted
Well, I'm not rooted, and have no plans to currently, so maybe raw mode will come at some point.
If not.....I'll live with it.
Mike
rolfey83 said:
Well, I'm not rooted, and have no plans to currently, so maybe raw mode will come at some point.
If not.....I'll live with it.
Mike
Click to expand...
Click to collapse
You don't need to root the phone to install TWRP and flash the zip. But you do need to unlock the bootloader.
Yep, I know
I've done all that in the past, flashing ROM after ROM.
I totally understand why people do it, I was one of them....it's just that's all gone for me now, just want to use the phone.
I'll sideload and apk, but that's about it for me now
Mike
Snap Camera
meboy said:
Snap Camera
Click to expand...
Click to collapse
I'll take a a look.
Mike
rolfey83 said:
I'll take a a look.
Mike
Click to expand...
Click to collapse
Mike did you try it? I'm gonna try one of them. My major problem is when I take a photo in a WhatsApp chat, it opens ok and takes the pic, but then freezes for a while on the photo. If I hit back or try to type or select a function, nothing​ happens. However the home and recent apps keys work. Actually if I snap the pic then hit recent apps right away then reselect WhatsApp, I can immediately use tools or type. Makes no sense to me, but maybe someone can tell what's happening. For now will try one of the suggested apps.

Camera2 API support level for manual controls in 3rd party camera apps

Hi!
As a dedicated camera phone, I would expect the ZF3 Zoom to have good support for the Camera2 API that gives camera app developers access to manual controls. Can anyone run a test with "Camera2 probe" and let me know what the hardware support level is? It will be one of four: Legacy (worst), Limited, Full or Level 3 (best). I do hope it's either Full or Level 3, otherwise this would be a great disappointment.
Cheers!
Celludroid said:
Hi!
As a dedicated camera phone, I would expect the ZF3 Zoom to have good support for the Camera2 API that gives camera app developers access to manual controls. Can anyone run a test with "Camera2 probe" and let me know what the hardware support level is? It will be one of four: Legacy (worst), Limited, Full or Level 3 (best). I do hope it's either Full or Level 3, otherwise this would be a great disappointment.
Cheers!
Click to expand...
Click to collapse
Here.
Pender666 said:
Here.
Click to expand...
Click to collapse
Thanks!
Celludroid said:
Thanks!
Click to expand...
Click to collapse
What does that mean for custom camera apps in this phone?
rafa10pj said:
What does that mean for custom camera apps in this phone?
Click to expand...
Click to collapse
By "custom" do you mean 3rd party camera apps or the native camera app of the phone? I'm mostly interested in pro video recording apps and as far as I can see they need 'Full' or 'Level 3' support to work at all (Filmic Pro) or have the pro mode with manual controls like shutter speed available (Lumio Cam for instance). I'm not sure how 'Limited' does affect most apps as I have only devices that have either 'Legacy' (which is the worst support level) or 'Full'/'Level 3' (best). Phone makers can integrate advanced manual controls in their native apps without relying (fully) on the Camera2 API because they manipulate the software on a deeper level but 3rd party devs need to rely on Camera2 API as far as I know.
Which are the best 3rd party camera apps to use? That's a new world for me.
Celludroid said:
By "custom" do you mean 3rd party camera apps or the native camera app of the phone? I'm mostly interested in pro video recording apps and as far as I can see they need 'Full' or 'Level 3' support to work at all (Filmic Pro) or have the pro mode with manual controls like shutter speed available (Lumio Cam for instance). I'm not sure how 'Limited' does affect most apps as I have only devices that have either 'Legacy' (which is the worst support level) or 'Full'/'Level 3' (best). Phone makers can integrate advanced manual controls in their native apps without relying (fully) on the Camera2 API because they manipulate the software on a deeper level but 3rd party devs need to rely on Camera2 API as far as I know.
Click to expand...
Click to collapse
Not so deeper, rather their own APIs or just Qualcomm APIs (extended Camera1).

[DEV][NEED HELP] Wrong raw pictures with s5k3l8 back sensor

As you may know, our phone is capable of taking picture in raw format. Unfortunately, this is a non-official feature and even worse xiaomi uses three different sensors for the same device (sony, samsung, omnivision).
While for some people (sony and omnivision?) this feature may be working, this isn't the case with samsung sensor. Raw pictures are extremely desaturated and overexposed.
I don't know if this is caused by a bug in the software stack, or cheap material used for the sensor itself. Obviously raw pictures need some post-processing, but I have a Canon that takes nearly-perfect raw pictures even with 0 elaboration.
Since i know a bit of java/c/c++, I was thinking to write patch in order to fix this behavior; but I never worked in such a large project like the android source code and I don't know where to start. I am aware that the camera stack is composed at least by a kernel driver and an HAL, but in both of these there are bilion of strange function and I'm unable to find an entry point.
Some more experienced developer is interested in this project? These are some photo samples:
imgur. com/a/SxhPGYm (raw)
imgur. com/a/ozxOamG (camera jpeg)
(fix the link if you want, xda says I can't before 10 post)

Fix Camera2 API to show all cameras in all camera apps?

Hi, i was trying to use the ultra-wide camera in hedgecam2/OpenCamera, but besides gcam and the stock camera, no other apps show option to use the zoom or ultra-wide.
then i found out those apps like opencamera CAN and DO use all cameras the phones have, but the API of the phone only show 2 cameras available (like on opencamera log, "No. of cameras: 2").
on the forums, most newer LG and samsung phones show the correct amount of cameras, and allow all apps to use them (even on whatsapp, etc..)
so, my question: is this fixable? can the camera api be modified to show all cameras? or perhaps change the main camera to be the ultra-wide one?

Categories

Resources