Camera & Camera2 API - missing features & bugs

Makes sense, my bad :see_no_evil:

@xblax

+1


Dump question from someone less experienced than you guys:
How to you “patch” the camera apps?
Where exactly is the SYSTEM_CAMERA permission set? Or is this equal to install the Camera Apps as system app? EDIT: source.android.com - docs - system-cameras

Open Camera can use the full 4000x3000 resolution, even without SYSTEM_CAMERA permission.

4000x3000 is 12MP (and yes Open Camera shows this as max resolution, also without modification/patching or after a normal installation), while the cameras have 48MP in the specs - afaiu.
Or is this the “Pixel Binning” I read about (best of 4 Pixels will be taken), which reduces the 48-Megapixel-photos to 12 Megapixel?

(default Camera of CalyxOS - package com.android.camera2 - also shows 12MP as max resolution :thinking: but I only see one back camera in settings.)

After these facts, why it the overall interim conclusion to use the Stock camera or make it working?

The 12MP resolution (4000x3000) is accessible when using the old camera API. When using Camera2, it tops at 3952x1824 for some unknown reason. The primary sensor (IMX582) is actually capable of taking 48MP (8000x6000) photos, as seen in the stock camera app. The same applies to the selfie camera (IMX576), which is capable of taking 24MP (5760×4312) photos. The ultra-wide sensor is advertised as 48MP (I can’t find the exact sensor number), but I guess it uses binning, so you can’t really get a 48MP photo out of it, only 12MP.

The permission must be declared in the AndroidManifest.xml of the APK. This is where existing APKs need to be patched or compiled with the change. See

Then the app must be installed in /system/priv-app (or on the vendor partition). It must also be granted the system camera in /system/etc/permissions. For the stock camera we add privapp-permissions-com.fp.camera.xml

<?xml version="1.0" encoding="utf-8"?>
<permissions>
    <privapp-permissions package="com.fp.camera">
        <permission name="android.permission.SYSTEM_CAMERA"/> 
    </privapp-permissions>
</permissions>

And last the camera package name must also be whitelisted in vendor.camera.aux.packagelist property. It’s easier to disable that property so that it’s empty. Then all apps are allowed if they fulfill the other requirements …

Camera2 from AOSP shows 12MP in the settings, but the captured image is not. I didn’t try modify if for SYSTEM_CAMERA permission. Also don’t know if it supports aux cameras at all.

I believe 12MP is the intended native resolution of the sensor. The “high res” 48mp images are probably only available in a special capture mode. Afaik that is a function of the Qualcomm camera HAL but the camera Apps need special support for it.

Because it implements all the features like High Res, Timelapse, Slomo etc and it can be extracted from the stock images like the other blobs. Usability is easier than for OpenCamera. Also I think it’s probably the best baseline for custom ROMs to see what features are working and which are not.

2 Likes

A post was merged into an existing topic: FP4 Stock Camera app on /e/ or Iodé

Answer by fairphone:


I will be unable to provide you further help regarding alternative/custom OS, but you can find some tips on … → links to the FP Forum and the e Forum for Fairphones …

We will take your feedback into consideration for our future developments.

We appreciate your response as it is very helpful for us and it gives a good insight into the wishes and needs of our community.

Thats it → pretty much a standard response, but I think it doesn’t make sense to bother them further, as they are already aware of the problem and they just got another feedback from a user who would like to get this fixed. → which is/was the intention here.

2 Likes

The problem is, when you mention somehow custom ROM, then they are done and dont bother to read the rest really. At the end its a FP “issue” not a custom ROM issue or something caused by flashing a custom ROM…let’s hope they will change this and all custom ROM (not only e/OS) can fully use all cams…

I was also interested in that. I asked FP support to check with the relevant department. The support replied after 2 weeks that they had done so. After another 2,5 weeks came the answer :slight_smile::

The ultra-wide-angle camera uses the same sensor as the main camera - a ½"-IMX582-sensor.

3 Likes

In the same request as my last post, I also asked about the solution for using alternative camera apps. I referred to this thread. I asked to contact the development team to ask when we can expect a solution. (This was my second request about this, by the way, because in the first one, support wanted to forward the question, but then closed the request with no response). An answer to this also came after another 2.5 weeks:

[…] Right now, our efforts are focused on making sure our camera app and all of its features work well. Other customers have given us feedback similar to yours, and we are considering how best to address it in the future. […]

I’m confused. :thinking: It sounds to me like the issue is not being worked on right now and that they will look at it someday (or never?). But to @Razem it sounded like they are already on it:

I would never have thought that it is so difficult to use alternative camera apps with all the possibilities/functions of the hardware. That’s really sad. :frowning_face: I just expected that alternative camera apps might not be that good. By that I mean that they don’t achieve the same good quality as the original Google Camera app.

1 Like

If I remember correctly the e/OS stock cam App (is it still Open Camera?) can use all features, or? So FP made this happen, so they know how to, or do I miss something?

Damn good question. I’d like to know that, too.

I have to admit, I have a hard time following the technical details in this thread. I’m not sure I understand what exactly the problem is, why you can’t just install an alternative camera app yourself and use it with all the features of the hardware. This is really driving me crazy. However, I believe that /e/ themselves have modified their fork of Open Camera and installed it as a system app so that you can use the super wide angle. That’s not a general solution to the problem for me though. I want to see for myself which camera apps I want to try and use. Just install and go. I have no idea what exactly Fairphone would have to do to make this work. Or how complex that is for them and if it is even feasible. I wonder why the problem exists? Is it because of the AOSP or did Fairphone do something “wrong” in their stock ROM? You see, I have no knowledge of this stuff. But would like to know the basic correlations.

1 Like

The problem is Google added the option to Android (starting with 11) to declare some cameras as system cameras. Those can only be accessed by apps installed in on one of the system partitions (so basically shipping with the OS) or by apps signed with the system certificate (so by Fairphone in this case).

I don’t see any reason this option exists other than completely anti-consumer behavior, but it’s there and Fairphone are using it for the wide-angle camera for whatever stupid reason :roll_eyes:

Haven’t tried it, from what I read it only supports wide-angle and maybe some other options, but certainly not the full feature set that would be possible with the stock FP Camera app.
And it’s installed as a system app with the necessary permissions, something you can’t easily do with 3rd party camera apps…

There are more problems when it comes to the advanced functionality I don’t understand either, @xblax will have to break that down, but that’s basically the gist of it.

4 Likes

Then Fairphone just has to declare all cameras and the TOF sensor as a “normal” camera and most of the problems from the list in the first post are solved. And then they would have to gradually work through the remaining problems. It’s clear that they have other priorities at the beginning, of course. However, it is unsatisfactory that nothing concrete has come from Fairphone after more than half a year. But well, it’s probably not as easy to implement as I hinted at above. Let’s wait and see…

1 Like

Any chance to get that permission on CalyxOS for e.g. OpenCamera?

I am very interested in this as well, so I would be very happy if those people who understand what is going wrong and have a solution also drop any possible solution in the corresponding issue on gitlab: https://gitlab.com/CalyxOS/calyxos/-/issues/976

The CalyxOS developers have said that their claim for devices supported by them would also be a decent camera performance on the software side.
I think they are more than busy with Android 13 at the moment, so it would certainly be good to offer a solution in that issue :slight_smile:

2 Likes

Wow I played around with Open Camera on my FP4 and even with just 12MP it takes the app forever to focus - not to speak of the limitations that are mentioned in this thread. It would be super cool, if for now CalyxOS could include the stock FP4 camera app and install as system app :-/. The stock CalyxOS app seems quicker, but has nearly zero configuration options… I never thought the cam could be such a mess!

I think once a solution for the stock camera will land in LineageOS it will then be used for the other ROMs as well - at least that’s where my focus is. OpenCamera could in theory be built-in easier (like for /e/-os). But it wasn’t tested for android 12 yet, there could be additional problems.

But it’s probably better if the keep the ROM specific development discussions in the separate threads. This thread should be more about issues and internals about the camera implementation in the stock rom. To help us understand the issues and make Fairphone improve it :slight_smile:

8 Likes

Did you at least switch to Camera2 API? (even with the other problems described here it is quite okay to use Open Camera)

→ Settings (Gear Icon in the upper right corner) → Scroll down to the 5t option from the bottom → switch to “Camer2 API”

I switched to C2-API, but still focus seems incredibly slow :-(. I tried to take some photos of a puppy, which moves and looks around rather quickly… no chance for a stable picture…

Wait until the puppy gets tired and falls asleep, it’s much easier then. :smiley:

But seriously, I have some problems with Open Camera too. It’s the iodé version though, the normal one just crashed on iodé OS. Sometimes, it literally takes seconds until the shot is taken and sometimes I even have to kill the app because the white frame (indicating the camera is about to take a picture) isn’t disappearing anymore. Is it the same for you?