[Module] Camera2API enabler

Search This thread
Aug 16, 2019
33
13
My results

Here's what I got

aIPacdH.png


Code:
[persist.camera.camera2]: [true]
 

pr1jker

Senior Member
Jan 15, 2015
280
34
Xiaomi Mi 11
Xiaomi Poco F3

Randi_kurniawan

New member
Oct 11, 2019
1
1
#!/system/bin/sh
# Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/...
# This will make your scripts compatible even if Magisk change its mount point in the future
MODDIR=${0%/*}

# This script will be executed in post-fs-data mode
# More info in the main Magisk thread
 
  • Like
Reactions: fernat

TrueHD

Senior Member
Jun 9, 2010
153
33
36
Minsk
Hello, friends! How can i raise my level of HW Support from LEGACY to something higher? I have Snapdragon 615 (Lenovo Vibe Shot). Tried many things, got root, got busybox, SELinux to permissive, installed HAL3.Enabler from Google Play and let it run, checked in build.prop that there is a line about HAL3 enabling and there is "1" next to it.
Google Camera apps are installing ok. But 'HDR+' and 'HDR off' fotoes has no differences. And H/W Level always just LEGACY.

I tried 5 different ROMs with Android 6. There are some others with Android 6 and some more on Android 7. Should i keep trying other ROM's or am i forgetting something or doing something wrong?
 
Last edited:

j1505243

Senior Member
Jan 2, 2016
487
489
Masovia
Google Nexus 5
LG G2 Mini
Hello, friends! How can i raise my level of HW Support from LEGACY to something higher? I have Snapdragon 615 (Lenovo Vibe Shot). Tried many things, got root, got busybox, SELinux to permissive, installed HAL3.Enabler from Google Play and let it run, checked in build.prop that there is a line about HAL3 enabling and there is "1" next to it.
Google Camera apps are installing ok. But 'HDR+' and 'HDR off' fotoes has no differences. And H/W Level always just LEGACY.

I tried 5 different ROMs with Android 6. There are some others with Android 6 and some more on Android 7. Should i keep trying other ROM's or am i forgetting something or doing something wrong?
Snapdragon 615 is an edge case. You'd have more luck with 625 most probably.
 

TrueHD

Senior Member
Jun 9, 2010
153
33
36
Minsk
Snapdragon 615 is an edge case. You'd have more luck with 625 most probably.
Thanks for answer!
Well, i'm not sure Google Translate interpreted "edge case" correctly. And yap, i can't chanhe my phone's processor. Is there atleast anything that i can try even with little chance? May other ROM's work in the end with HW Level? Or am i 100% just wasting time?
 

j1505243

Senior Member
Jan 2, 2016
487
489
Masovia
Google Nexus 5
LG G2 Mini
Thanks, but i wouldn't mind a bit of more technically based explanation. In the end, according to Camera2 API specification, it's "favorite" CPUs are Snapdragons 6xx and 8xx. And 615 fills right in there, doesn't it?
There's nothing like that. Qcom implemented HAL3 only on the chipsets from a given time. I'm unsure about 615, but it's really on the edge. It's not as obvious as 625 or 820. For example, 800/801 needed a specially written HAL since qcom didn't add any support on their own. It makes Nexus 5 an exception.
 

TrueHD

Senior Member
Jun 9, 2010
153
33
36
Minsk
according to Camera2 API specification, it's "favorite" CPUs are Snapdragons 6xx and 8xx.
There's nothing like that
That's what i read in Manual for enabling HAL3. It has been saying that HAL3 "loves" for sure only Snapdragons 6xx and 8xx, if you have different processor then you can hope only for rare exceptions.

Qcom implemented HAL3 only on the chipsets from a given time. I'm unsure about 615, but it's really on the edge. It's not as obvious as 625 or 820
Forgive me may be i'm not understanding English correctly (it's not my native), but what so not-obvious about this 615 processor? Qcom either implemented HAL3 here or didn't. It's yes or no, right? The same as any other processor. Or am i misunderstanding something?
 
Last edited:

j1505243

Senior Member
Jan 2, 2016
487
489
Masovia
Google Nexus 5
LG G2 Mini
That's what i read in Manual for enabling HAL3. It has been saying that HAL3 "loves" for sure only Snapdragons 6xx and 8xx, if you have different processor then you can hope only for rare exceptions.

Forgive me may be i'm not understanding English correctly (it's not my native), but what so not-obvious about this 615 processor? Qcom either implemented HAL3 here or didn't. It's yes or no, right? The same as any other processor. Or am i misunderstanding something?

First thing, SDM450 is a part of msm8953 platform and because of that it supports HAL3. Snapdragon 439 is a similar case. It's more about the recency rather than pricing tier. As said above, no prop will ever enable HAL3 on Snapdragon 800/801 because it requires a specially written HAL (not by qcom).
The only thing I'm unsure about is that if Snapdragon 615 belongs to the chipsets like the example above, but since I can't remind any device with it that has HAL3, I'm just saying that you should abandon the hope. Especially with the module, if it doesn't do the thing, the HAL doesn't care about the prop and would need to be rebuilt. Since it's not an easy work, nobody will try doing that and certainly not me.
 
Last edited:

TrueHD

Senior Member
Jun 9, 2010
153
33
36
Minsk
Sorry, what is SDM450?

is a part of msm8953 platform
It's not my platform, mine is msm8939...

and because of that it supports HAL3.
So, msm8953 kinda magical, and my msm8939 is not? Were i can find a list of supported platforms?

Snapdragon 439 is a similar case.
What? It's also a part of msm8953 platform and also supports HAL3? How old 4xx generation coud be a part of more modern platform? Sorry, all those Snapdragon generations and platorms are little mess to me.

It's more about the recency rather than pricing tier.
Ok, this one i can understand. So let me know the date when HAL3 started to be implemented from and i will check the date of my CPU in Google... right?

As said above, no prop will ever enable HAL3
I'm sorry, who is "prop"?

on Snapdragon 800/801
I don't understand, why we talking lower (4xx) or higher (8xx) generations of CPUs, if i am having 615?

because it requires a specially written HAL (not by qcom).
Ok, one more explanation, please. What is "HAL (not by qcom)"? I thought, "HAL3" it's a name for Camera2 API technology?

The only thing I'm unsure about is that if Snapdragon 615 belongs to the chipsets like the example above, but since I can't remind any device with it that has HAL3
Well, i also was curious and when i checked there's just not so many devices on this CPU. Just a few notable. So may be the owners didn't even bother. But it doesn't mean it's not capable, right? May be i still can activate the technology on it?

I'm just saying that you should abandon the hope. Especially with the module,
By "module" you mean camera module?

if it doesn't do the thing, the HAL doesn't care about the prop and would need to be rebuilt
Ohh damn i understood almost nothing out of this sentense. Sry guys for my such a bad english, i feel myself like a redneck who doesn't understand a thing here. Seems to be i need to learn english harder.
 
Last edited:

j1505243

Senior Member
Jan 2, 2016
487
489
Masovia
Google Nexus 5
LG G2 Mini
Sorry, what is SDM450?

It's not my platform, mine is msm8939...

So, msm8953 kinda magical, and my msm8939 is not? Were i can find a list of supported platforms?

What? It's also a part of msm8953 platform and also supports HAL3? How old 4xx generation coud be a part of more modern platform? Sorry, all those Snapdragon generations and platorms are little mess to me.

Ok, this one i can understand. So let me know the date when HAL3 started to be implemented from and i will check the date of my CPU in Google... right?

I'm sorry, who is "prop"?

I don't understand, why we talking lower (4xx) or higher (8xx) generations of CPUs, if i am having 615?

Ok, one more explanation, please. What is "HAL (not by qcom)"? I thought, "HAL3" it's a name for Camera2 API technology?

Well, i also was curious and when i checked there's just not so many devices on this CPU. Just a few notable. So may be the owners didn't even bother. But it doesn't mean it's not capable, right? May be i still can activate the technology on it?


By "module" you mean camera module?

Ohh damn i understood almost nothing out of this sentense. Sry guys for my such a bad english, i feel myself like a damn redneck who doesn't understand a thing here. Seems to be i need to learn much harder.

SDM450 is Snapdragon 450. msm8953 is quite newer than msm8939. The CAF tags indicate that msm8939 comes under msm8916 common platform, same like the example in previous sentence. That platform was released on December 2013. For comparison, msm8953 was released at February 2016. Makes great sense now, right? Supported platforms aren't listed for any of our conveniences, but there are open source CAF repos that let us to verify few things. Prop is a short them for property, there's a file called build.prop that contains them. All of the examples I listed before are because of the fact that I wasn't unsure if CAF repo would let me deduce the HAL level availability easily. HAL is "hardware abstraction layer". HAL3 is a short term for camera HAL of version 3.x. HAL is a backend for the API that actually defines what's available and what isn't, while Camera2 API itself is available on every Android 5.0+ device, but of course without HAL3, it gets only the Legacy hardware level. By the module, I mean the Magisk module that this thread is about.

To sum up, there's no HAL3 directory in the camera HAL source for your platform at all. That's it, implementing that would be a lot of work and an easier thing to do would be to earn money for a new device, sorry.
https://source.codeaurora.org/quic/...ra/tree/QCamera2?h=LA.BR.1.2.9.1-02310-8x16.0
 
  • Like
Reactions: kkjb

TrueHD

Senior Member
Jun 9, 2010
153
33
36
Minsk
j1505243
Thank you for all the answers. Now i understand most of the terms. Except the CAF tag. What is it? What are CAF repos? And what are camera HAL sources?

To sum up, there's no HAL3 directory in the camera HAL source for your platform at all.
Does it mean that now we know that Snapdragon 615 DEFINITELY doesn't support HAL3? Or it support it, but support has never been implemented on software level? And the latter actually could be done maually?

easier thing to do would be to earn money for a new device, sorry.
I'm not buying new device definitely. First - i really like Vibe Shot's design. Secondly, it absolutely satisfy me in all aspects except the camera quality. Even all unusual problems with flashing Lenovo Vibe Shot - yea, that phone is well-known coz it's hard to juggle ROMs with, but i learned all the details). And the third - this phone literally saved my life once. In overall - it's a memory, it's a nostalgic. I will keep using it anyways.

That's it, implementing that would be a lot of work
I have the time. And strong desire to use Google Camera with HDR+ on our device. If it's possible i would be greatfull to a link to exact article i have to learn to do it. Atleast just to extimate amount and difficulty of stuff to learn.
 
Last edited:

j1505243

Senior Member
Jan 2, 2016
487
489
Masovia
Google Nexus 5
LG G2 Mini
j1505243
Thank you for all the answers. Now i understand most of the terms. Except the CAF tag. What is it? What are CAF repos? And what are camera HAL sources?

Does it mean that now we know that Snapdragon 615 DEFINITELY doesn't support HAL3? Or it support it, but support has never been implemented on software level? And the latter actually could be done maually?

I'm not buying new device definitely. First - i really like Vibe Shot's design. Secondly, it absolutely satisfy me in all aspects except the camera quality. Even all unusual problems with flashing Lenovo Vibe Shot - yea, that phone is well-known coz it's hard to juggle ROMs with, but i learned all the details). And the third - this phone literally saved my life once. In overall - it's a memory, it's a nostalgic. I will keep using it anyways.

I have the time. And strong desire to use Google Camera with HDR+ on our device. If it's possible i would be greatfull to a link to exact article i have to learn to do it. Atleast just to extimate amount and difficulty of stuff to learn.

CAF is Code Aurora Forums, this abbreviation is used to describe the open source part of the code that needs to be built to run any Qualcomm Android smartphone, the project is called Android for MSM. CAF tag is repo tag utilized to sync every git repository at a specific version. Snapdragon 615 could support HAL3, at least partially, and yeah, it wasn't ever implemented because it's real, huge pile of work. People doing things like that professionally are paid, hence even the Snapdragon 800/801 flagships never got it, except for Nexus line (Google wrote the HAL on their own) and maybe OnePlus One, but I can't remind the full story. The issue with your plan is that you need to be motivated more than me. The questions you've asked, they're a pretty common knowledge findable on Android forums. I went further than that to explain everything that matters already. You're trying to beat a dragon with a stick. You won't do that. If it happens otherwise, if you're an experienced programmer, you no longer need to ask me about any single thing. But you aren't, so good luck, appreciate what you have already.



EDIT and tl;dr: how do you image coding if you don't know what's source?
 
  • Like
Reactions: kkjb

DekiS3

Member
Mar 7, 2014
9
0
Hi guys!
I have a Xiaomi mi a2 lite and have always used this Magisk module (C2API_enabler_v1500.zip) to enable camera2 API. But now, after january update, it seems it does't work anymore.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 121
    Since Google Camera with HDR+ was ported already, it requires that camera2api to be enabled.
    This is done by editing build.prop to add or enable "persist.camera.HAL3.enabled=1".
    Note:
    This mod only adds camera2api support in the build.prop systemlessly. This does not guarantee modded google camera hdr+ will work on your device.

    Axon 7 Users:
    Here's a working GCAM that works on my device. However, I don't see any difference with my stock cam hdr. I just use this for slowmo, panorama, photosphere and lens blur effects.
    MGCB_7.0H_C2API_Mid_v.3.6_AllinOne_Full_Manual.apk


    Requirements:
    Android 5.0 & up
    Magisk v15
    ~2014+ Snapdragon SoCs

    Instruction:
    Add the zip in Magisk Manager -> Modules and reboot.
    Or you could also flash it in your custom recovery, TWRP etc.

    How to check if it is running:
    1. Open terminal and issue command "getprop | grep camera".
    If it's running, you should be able to find a line "persist.camera.HAL3.enabled=1". Check attached screenshot for example.
    Or
    2. Install Camera2 Probe from playstore to check your device's camera capabilities.

    UPDATES:
    9-15-17:
    -added v1400 template
    -added camera2api with slowmo fix for Axon 7 users. (I can't guarantee slowmo on other models will work since I used my device's media_profiles.xml file.)

    01-25-18
    -updated to v1500 template for C2API - Download this file if you only want the HAL3 enabled.
    -updated to v1500 template for C2API+slowmo+ (credits to @j1505243)

    :D :D :D

    Credits:
    - BSG (4pda)
    - @j1505243
    5
    Noob question: how do I check in terminal if it's already enabled because in rom included?

    How to check if it is running:
    1. Open terminal and issue command "getprop | grep camera".

    If it's running, you should be able to find a line "persist.camera.HAL3.enabled 1"
    4
    Not working on lenovo zuk z2..... Snapdragon 820
    3
    Another reason is so that you don't have to edit the actual build.prop file. Magisk is all about systemless system mods after all...

    Edit: Wait a minute... I just looked at the module zip. Why is it so complicated? Why not just use the Magisk built-in resetprop tool through the module system.prop to set the desired prop value?

    Edit 2: @otaconremo You've just taken an old Universal SafetyNet fix module and used that instead of the normal template, haven't you?

    Thanks for pointing that out. I added a comment on the front page news article and quoted you. XDA staff should not be posting random mods on the front page unless they have checked it out and understand what it does.

    EDIT: Hold on, [my comment] is waiting to be approved by XDA-Developers. I used HTML.

    @otaconremo No offense to you intended. I learned how to make Magisk modules the same way: Take it apart to see how it works. Start with the Magisk module template instead. ;)

    Thanks for finding something to contribute. Let me know when you get the module sorted and I'll add it to my Collection of Magisk Modules v2 thread.