yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Well we have indications that pbrp did work for some, so it seems to be a version thing, and we don't know which versions are which.

And, twrp has worked for some, right out of the box (so to speak). I didn't have to disable mtp for it to work. So exactly what do you say? I'll update in the reserved comments, that *maybe* try this or that, etc etc.

It would be helpful if people put versions, but that doesn't mean there won't be conflicting indications even then. A prior user went with (the same) twrp and had no issues.

Like a lot of 'guides', there really isn't any empirical testing going on here. Without specifics, and even with! there are a lot of things not controlled. The PC OS in use, the version of the USB drivers, the version of the PC OS, the version of pbrp or twrp,

I can mention the things that people have recently found to help, but people will probably still have to do some reading if there is a problem. I can't really help that, no one can.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] diegoaquinosza:
incredible! Congratulations to all who dedicated themselves to get camera2api! I finally got through this topic! very happy! thank you developer! :good::laugh::highfive:
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] s5282noob:
Here's my specs :

PC : Custom built

OS : Windows 10 Pro

OS Ver : 1809

Mi A2 : Nov OTA (V9.6.16.0.ODIMIFE)

USB Driver : Android ADB Composite

TWRP : twrp-3.2.3-jasmine-20181020.img (Tingyichen's TWRP)

Current Slot in fastboot : A

Trick that worked : Guide by AsItLies & Disabling MTP in twrp as mentioned in post #93
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Sift:
Oh, disabling MTP works. Was able to get into adb with TWRP.

I wanted to avoid flashing the recovery. But as lept suggested, disabling MTP in the mount option solved it for me. Thanks, both of you.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] waterfade:
Hi,

Thanks to the whole thread community to help working this out.

I'm with NOV18 OTA and with 102018 TWRP, following the steps and it works pretty well for me

However, any downside to stay with 'oem unlock' eg. Android pay, uncertified play store status? By going thru all these concern I'm thinking of to 'oem relock'. after I have completed the camera2 api enabled.

I did a bit more research and found another thread -https://xdaforums.com/mi-a1/how-to/manual-google-camera-root-magisk-enable-t3823595

However, when I get to the very last step, fastboot oem lock and then reboot. The phone cannot boot ( stuck at the AndroidOne , running line ).

Any comment and suggestion on this.

Appreciate.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Well, yes, having the device with the bootloader unlocked is a security issue. Obviously, that's why the oem's warn you about it.

But, the MiA2 doesn't have NFC, so you can't use Android Pay anyway. As far as the device being 'uncertified' with Play, it would only be an issue if you wanted to install any security sensitive apps, and there are ways around that if you really wanted to. But I don't think *most* people would have a need to do that.

The other thread is for MiA1, and at one point relocking the bootloader, holding vol up (or something like that) resulted in it locking and not wiping data. But I think they also found that it only temporarily delayed wiping, rebooting recovery at a later time would trigger the wipe.

Anyway, what's the situation now? Can you get it to boot? If you can, I'd suggest removing fingerprint, pin, swipe, and your gmail account. Because a fastboot oem lock is going to do a wipe no matters what.

If the device is just looping, hold the Vol Up and Power - at same time. Hold them until it starts to boot again, it can take a while. Do the above, then try to lock it again.

Cheers
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] waterfade:
Thanks for your super fast response!!!

yes, I got your point for android pay. but I still try to see possibilty 'IF' we can oem lock it after we have enable the camera2 api.

I put some work stuff on my phone. So just for feeling comfortable with it :)

My situation now is

I follow this thread method, My phone camera2 api is enable and things work perfectly.

then I try 'oem lock' in the fastboot and reboot. When It reboots, it gets stuck at AndroidOne looping ( the AndroidOne running color line ). I could not do anything here.

That means I can only go back to fastboot, repeat 'fastboot oem unlock'. Let the system wipe the data to default, then boot TWRP.img. Enable the api again.

Now I decide to stay with 'oem unlock' here. Till we made any progress.

I think the problem for me is 'boosting' after oem lock. As I manage to bypass all wiping (follow another thread method)

The wiping will cause camera2 api enable to be reset.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
"but I still try to see possibilty 'IF' we can oem lock it after we have enable the camera2 api."

Well the answer is No, you can't, it's not possible.

I've read the other threads where they found a way to do that with the A1, but as I said, they also found it was only temporary. And after a certain new revision, it didn't work at all.

If you read any of the A2 threads re locking / unlocking, they ALL say, it will wipe data, every time. The other thing it *sounds* like yer trying to do is have twrp permanently? that's probably why it's not booting re oem lock.

TWRP is a recovery app. We, when we didn't have dual slot phones, would flash it to a 'recovery' partition. Dual slot phones don't have a 'recovery' partition (the 'other' slot is now the recovery).

So to flash it and keep it (although I haven't done it), I'd assume you'd have to switch between active slots to use it and then switch to reboot. I'd recommend not doing that, it's probably why it won't reboot.

a boot image has the (appropriate) kernel for the OS, twrp does not have that, it's not a boot image, it's a recovery image.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] waterfade:
Thanks, that's clear to me now.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Fallen997:
Can anyone please try and see if this works on the pie beta?

..
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] verttl:
Yes, but you have to also do command:

setprop persist.vendor.camera.HAL3.enabled 1

If gcam is important to you I don't recommed to update to PIE, since almost every gcam port force closes when using back camera.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Fallen997:
I tried the exact same steps..but still don't have Camera 2 Api enabled
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Are you referring to getting it enabled in the Pie beta? Or Oreo?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Thanks for that information. I'll update the 'how to' when Pie becomes official and also add information about user experiences like you've mentioned.

Something certainly isn't working correctly at this point if the ports are force closing just using the back camera...
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] kishd:
setprop persist.camera.HAL3.enabled 1

setprop persist.vendor.camera.HAL3.enabled 1

I used the above commands in root terminal and used this gcam

https://xdaforums.com/showpost.php?p=77325586&postcount=1539

It works properly for me on pie beta.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Fallen997:
Did you boot into twrp and used those commands in adb shell?..anything extra you did apart from the tutorial?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] kishd:
I have a rooted phone so I did it in terminal with the system running and then rebooted. Did nothing else.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
I will add that command to the existing ones, in the guide, when a few more indicate it is needed for Pie and that it works.

As it is a setprop persist command, there's no reason it shouldn't work just as the others do, using adb shell.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Fallen997:
I had it enabled this way on oreo..but it doesn't work on pie..I have tried quite a few times..but nothing happens
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] verttl:
Wich recovery did you use?

I used newest PBR and did as said in OP and added vendor.camera.HAL3-line and it worked. For some reason I can't use adb anymore with TWRP and files are encrypted.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
What did the persist.vendor* etc setting do? First I've heard of this one...

Someone said they had that enabled on Oreo? What difference did it make? What functionality did it add?

Cheers
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Fallen997:
Are you on the pie beta?..For some weird reason it still doesn't work for me..I will try again when pie is widely available..Thanks a lot for the help.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] kishd:
I found this in the build.prop on pie

persist.vendor.camera.HAL3.enabled=0

So decided to change it to 1 via setprop in a root terminal and it worked my gcam loads and runs.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Thanks, after researching this setting, I'm not finding any worthwhile info as to what it does though.

So, are you saying that setting that alone, made a difference? In other words, without that setting, gcam

would NOT load and run?

If that's the case, then obviously it's going to be needed if you run PIe (and I'll update the Guide).

But, if people are setting it using Oreo, I'd like to hear what difference it made, not that "IT WORKED"... it worked

doing what? Just that you were able to set it? I'd bet I could set this.is.a.stupid.vendor.setting.that.does.nothing

to 1 also, and it would work! Except it would do nothing.

Would appreciate what the setting did for anyone, Thanks!

Cheers
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] kishd:
Did not use the setting on Oreo. It only made a difference on pie. Gcam did not run without it on pie.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
[MENTION=2129545]AsItLies[/MENTION], for PIE enabling of GCAM, user needs to change TWO lines in build.prop file, first one is from OREO (persist.camera.HAL3.enabled=0), and the second one is new one...that is the difference between oreo and pie.

persist.vendor.camera.HAL3.enabled=0

So, two lines in PIE build.prop.

We will see what needs to be done from twrp, what commands is going to be suffice fo gcam to work, because this is for changing build.prop and we do not want that, because of OTA update.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] kishd:
I did not change the lines in the build.prop file only used a root shell to run the two commands with setprop and it works even across a reboot.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
[MENTION=4313092]kishd[/MENTION], nice man, that settles it then, it works even for PIE, but with two commands.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Yes, I know, 2 commands.

I will update this guide and change the one for EIS (which is not needed) to the new one needed for Pie. I will indicate it's needed for Pie and on only.

If anyone knows of other changes that should be made, please feel free to chime in.

Cheers
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] lept_2014:
I assume that the modifications will be...

Modifying build.prop:

persist.camera.HAL3.enabled=1
persist.vendor.camera.HAL3.enabled=1

From adb shell:

setprop persist.camera.HAL3.enabled 1
setprop persist.vendor.camera.HAL3.enabled 1
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Modifying build.prop is not for this guide lept_2014, because modifying build.prop is for root (and those modifying the 'system' partition). As most know, if you do that, then no more OTA (unless you get into the complications of hiding it etc etc - not doing that in this guide).

The adb shell commands will be updated for booting twrp, (only modifies the Data partition - you still get OTA of course) by using the adb shell commands.

Nothing wrong with rooting, if that's what one wants to do. But if one only wants to enable cam2, this guide is simpler imho.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Fallen997:
Can anyone please verify if the guide stated in the OP works?..Thanks and Cheers.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Yes, it works. There's no doubt about it.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
[MENTION=8647446]Fallen997[/MENTION], do not be lazy, read the posts and pages before, you will see that they are allot statements that it work ;)
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] ki69:
After Oficial Pie Release, user inform that the update remove the Camera2Api. Is this guide tested on oficial Pie, because from what i read it works on beta releases.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Neel@1234:
[MENTION=451055]asl[/MENTION]tLies I've tried everything to try and enable camera2api in Android Pie Stable OTA update again . But I can't seem to get it to work.

EDIT : I didn't try disabling MTP from Twrp. Will update what happens after trying that.

I will also try PBRP. The steps to temporarily boot it would be the same as the Twrp mentioned in the guide?

---------- Post added at 05:26 PM ---------- Previous post was at 05:09 PM ----------

Wait. For some reason I can't use Wi-Fi anymore.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Thanks you guys, please document what you tried, and what the result was. I realize you're saying 'It didn't work'. I get that.

But, we need enough people indicating Yay or Nay for it to eliminate any possible 'user error'.

It would be quite the disappointment if Xiaomi is now inhibiting this from working... but they might be.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Neel@1234:
Any idea where I can find the stock boot image for Mi A2 in the latest pie update?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] LuizHenrique91:
How do you guys are testing if camera2api is enabled or not? Are you using some app like Manual Camera Test or you are checking if Google Camera works?

I ask because I'm on Pie beta and I managed to get camera2api enabled (I testes with Manual Camera Test), but gcam didn't work. So gcam is not a good indicator
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
I have more confidence in the camera2probe personally. The comments for manual camera indicate a lot of erroneous results.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Not sure if it's available yet, but if you can find the OTA file, there is some Python code that can pull out all images. May have to wait a bit before someone does that.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Neel@1234:
I somehow broke my WiFi an hotspot functions after using the temporary Twrp. Any workarounds you might know?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] ckpv5:
Latest pie update is the same images as beta release ..

https://xdaforums.com/showpost.php?p=78123549&postcount=462
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
There you go Neel, in case you didn't see it. Be sure to thank ckpv5, he makes these available for everyone after ea new update, pretty cool thing to do.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Sorry no, have never heard of that happening. Try a reboot?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Neel@1234:
Thanks a lot. Downloading now, hope it fixes the WiFi and hotspot not turning on issue.

---------- Post added at 06:42 PM ---------- Previous post was at 06:41 PM ----------

Tried. Doesn't work.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Jamesismo:
I've just tried the method, all of the fixes, different adb and fastboot versions, and none of those worked for me, it does recognise the commands in both adb and fastboot steps, but when checking with camera2 probe or installing the G-Cam it won't work, any hint you could give me so I can give it a try? Thanks in advance.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
At this point James, it's looking pretty certain that, for unknown reasons, using setprop isn't working with this new Pie update. You are probably the 3 or 4th person in this thread to indicate it not working, and other threads I've read are indicating the same thing.

Unless something or someone pops up with a solution within a few days, we may have to conclude this will no longer enable the cam2api.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
Yeah, it's not working with PIE, just tried 2 times, and it will not enable to lvl3.

There's go temporarily root option again...
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] lept_2014:
Not working with Pie because, these Custom Recoveries has problems with the encryption of Smartphone.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Is that it? Certainly sounds like a reasonable explanation. Maybe someone could remove their pin / lock code and finger prints and try it?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
Just tried that also, removed pin, and FP, and it does not work. :crying:
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Could you try this please? If you haven't already. After bringing up TWRP, go into Mount, and make sure that the data partition is mounted. Maybe there will be some kind of error message that will help us to understand what's going on.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
I enabled lvl3 with root (magisk) method, so now I cannot check if this will work...but, there is something in mount.

Data is checked by default, but there is also PERSIST partition, and that one was not checked.

But because I already enabled camera2, I cannot check what would happen if I did the commands, with that Persist partition checked (mounted).
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] lept_2014:
That's not enough.

By default, the firmware forces encrypt all memory (since Android 6).
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Neel@1234:
I will try to do the things you mentioned today. I cannot enable camera2api from adb shell without root anymore. I really want to avoid rooting at this point. And [MENTION=2129545]AsltLies[/MENTION], could you please update the guide with the temporary root method for Android pie?

And a really lame question - If I rooted with Magisk and then unrooted and flashed the stock boot images, would my warranty get void?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
If you need help with temporary root method, just ask... I can help, did it last night.

And now I have unrooted phone, stock boot, stock system, with lvl3 enabled, just like in Oreo.

Do not enable camera2 with magisk modules, because when you uninstall magisk, the changes that you did with magisk modules will also be uninstalled and reverted to stock.

You can of course do that if you do not mind having magisk installed on the phone.

Install magisk, root the phone, and then over adb shell, type those two commands to enable lvl3.

Uninstall magisk from the apk itself, and when phone reboots, go to fastboot, and flash stock boot.

That is all the fuss, not complicated.

Your warranty is void if you have unlocked bootloader as I know, but that is something that depends from country to country.

This is not something that should bother you as long as you have OTA updates, and as long as you can revert everything back to stock. :good:
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Neel@1234:
I will try this now and update what happens.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
Well of course, I did not write that you all need to flash patched_boot.img for magisk, and then when the phone starts, install magisk manager, and then do the adb shell commands...and all the rest like I wrote.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Neel@1234:
I knew how to install Magisk and the rest but when I did it before using build.prop editor, I lost camera2api support after unrooting the phone for some reason.

Now, after I rooted with Magisk, I ran adb shell, then su, and then the commands needed. Then I did a complete uninstall of Magisk from Magisk manager. Flashed the stock boot images on both partitions, now I have camera2api enabled without root.

Thanks a lot!

UPDATE : Even though camera2api is enabled, gcam does not work (Not even 5.3 versions). Crashes after 3 seconds.

Is there any gcam that works for you?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
Yeah, I'm on Arnova V8.3b1, I was using it in Oreo as well, best cam for me...front cam is not working, but when you switch to portrait mode, front is working. :good:

Arnova's v8.3b1: GCam-5.1.018-Pixel2Mod-Arnova8G2-V8.3b1.apk
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Neel@1234:
Rear Camera Works?!

---------- Post added at 01:36 PM ---------- Previous post was at 01:34 PM ----------

Well. This might be the only gcam that works in pie.

And I found another gcam that doesn't crash on 4k video with stabilization. Will update the link in a sec.

Here you go - https://www.celsoazevedo.com/files/android/google-camera/f/GCamera.apk

---------- Post added at 01:48 PM ---------- Previous post was at 01:36 PM ----------

Front camera works on this one.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
It is not always about functionality of gcams, I installed and try many of them, the version that I use have that "digital" look of the pictures, good colors and ok sharpness.

In oreo, there was also some gcams mods that had all working, front, back, stable as stock cam, but the colors where washed away, and hdr+ was not at all hdr+, so I always first look at the end results of pictures, not the functionality of the gcam mod itself.

I will check yours later today...
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Neel@1234:
I used the Arnova's version that you posted. The images are perfect. Great ratio of sharpness and noise reduction, Colors are good.

The version I posted has good Colors and sharpness, but the noise is much more than Arnova's. I'll stick to the one you posted. I don't click many selfies anyways.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Hey [MENTION=3382541]minnuss[/MENTION] and [MENTION=9013501]Neel@1234[/MENTION]

Sounds like using Magisk is the way to go now. Curious though, you are using 'setprop persist' commands? Not editing property file in System? I'm assuming you are doing setprop persist in adb, as you've indicated I think.

Because there are so many guides already Neel that explain using Magisk, it's not needed to add that to this. Until we figure out why twrp (and pbrp I'm assuming) cannot do setprop commands - Magisk is the way to go. Thanks for mentioning you were able to get it to work pretty easily, that should help those that haven't used it.

Cheers
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Sohailsamdani:
only one question after installing Magisk When Open Adb Command Window. When device On Or In Fastboot Mode? & In Adb shell Command is with setprop or without it? Please Explain This In Detail Thanks In advance

Sorry But I'm A Noob
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] ckpv5:
Here I list what I did to enable cam2 api, no need to worry about adb command (except when you flash patched_boot.img)

1. Already have Magisk installed

2. Download Terminal app from play store. Personally I use "Termux"

3. Open Terminal app then type

su

[enter]

4. Grant root access

5. Type

setprop persist.camera.HAL3.enabled 1

[enter]

6. Type

setprop persist.vendor.camera.HAL3 enabled 1

[enter]

7. Reboot

8. Check .. cam2 api should now enabled

9. Optional .. uninstall Terminal app you downloaded

10. Optional .. uninstall Magisk if you don't need root
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Sohailsamdani:
after uninstalling magisk Can I Flash Stock boot And keep ota with successful installation ?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] AsItLies:
Yes, you can. Remember, if you do 'setprop persist' commands, to enable cam2, you are not modifying anything that keeps OTA from happening.

So, if you remove magisk, flash the stock boot.img... Then yer right back to where you were with the only difference is cam2 is enabled.

Cheers