yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Firstly, thanks to everyone who pitched in to get this thing solved. Here is part 2 of my adventure :D

It was getting late last night, so I wasn't as methodical as I should have been. This includes forgetting to set the C2Api line :rolleyes: Finished with a clean install of MIUI, so this morning I flashed LazyFlasher first, but not directly after flashing the ROM. The phone booted fine. Next I flashed the custom zip Mimi Mix provided. Stuck at bootup.

Next wiped everything on the phone (TWRP advanced wipe all boxes ticked), flashed MIUI and directly after, LazyFlasher, then reboot for the first time. Once the phone was up and running again, flashed the custom zip.

Stuck again at bootup. Just to clarify, I flashed the vendor zip in recovery mode. I noticed TWRP offers to install itself as a system app, then shows up in MIUI and wants to be updated. Once the update is done, it has the option to flash a file "directly" from the OS. I never tried this option, always booted into recovery and done all the flashing there.

Next I wiped the phone again, flashed the ROM and LF, installed Magisk, manually replaced the vendor files and enabled C2Api, rebooted and installed the UriKill's camera apk. Then... BINGO, finally a working camera, well, after a fashion.

I had to change the front camera mount angle line to have the front camera the right way up. The app crashes in portrait mode (unless switche cameras quickly) and when switching to camcorder mode for both, front and back. Interestingly camera.enable_pd and camera.enable_pd_blur are not showing under developer settings.

For me the photo quality if provides, the lack of shutter lag and other little things make it worthwhile keeping. If I ever need to record a video, I'll just use the default app.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] haarmatte:
Installed and everything is working fine without a problem. AEX latest Version.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
[MENTION=8790016]The_real_hati[/MENTION]

I have an issue in my zip installer since I'm flashing the files to the /vendor partition. Which does not exist in non-treble ROMs like miui. I need to look into making the installer figure out what to do. Sorry for the headaches.

I'm very curious to why you're still getting crashes in Portrait Mode. Can you get my a logcat of the crash?
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
I'm happy to announce SerJo87's latest google camera mod seems to be the first mod to fix HDR+ photo processing in our phone.

I really thank him for his job.

Here's the download link:

https://www.celsoazevedo.com/files/android/google-camera/f/GCam_5.1.018_by_SerJo87_1.6RC2_test4b.apk

I'm still testing it out myself. But it looks promising! If you wanna test it out I suggest turning on Use Hexagon DSP, Portrait ZSL mode and even Pixel 2017 faster zsl. You may switch from the Nexus 6P Base model under Tuning back cam if you find the photos too grainy (I personaly like the added level of detail).
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
It does exist. When I placed the edited files you made, I followed the directory structure in your zip to first find the files needing replacement and then to swap them with your edition.

Here you go:

Crash log from when switching from still camera to video seems to be the exact same, but here it is anyway:

By the way I am still using the cam app without the text file.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
Can you get me a full catlog of the actual crash? I'm curious to the warnings and errors the app is throwing out.

In the crashlog I can see the app is complaining about a non-negative value and I'm willing to bet it's a non initialized active array size. But the crashing function itself is inside code I can't decompile.

The text file isn't really necessary for the mod to work. But it does make the new Hexagon DSP toggle work in the newer google camera mods.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
I've updated the OP with a a few changes.

More importantly there's a new apk link to a nearly fully working google camera mod. Including HDR+ outside of portrait mode.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Sure, if you tell me how to. I just copied the error output the app wanted to send as a report after it crashed previously.

Re the new cam mod, would assume the existing one needs to be uninstalled first...
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
I tried both of the cam mods. Uninstalled the original, installed new apk and rebooted. Neither work for me on MIUI. Both crash on startup.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] tonnitte:
Tried this on EU rom and it keeps on with bootloop, on which rom is best to use this please?
[Xiaomi Mi Note 2  Themes, Apps, and Mods] vpimentel:
wowow...... great job....

tooons of thanks for you work.. is awesome the bokeh effect..

some weeks waiting for this..

camera front and rear work good. portrait the same in both cameras..

video works.

no need more for this phone... magnific job.

thanks

tried V4 in AOSPExtended 21-4 build, with SerJo Gcam and perfect for mi

Enviado desde mi Mi Note 2 mediante Tapatalk
[Xiaomi Mi Note 2  Themes, Apps, and Mods] pasquale_kun:
Amazing job. Thanks.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Xiaby:
tried with lineage os official 30/04 .. works perfectly thank youu
[Xiaomi Mi Note 2  Themes, Apps, and Mods] empy16:
Weird. That does not seem to want to open at all. "Camera has stopped". Even though all your previous patches and cams by Urkill worked. Running latest RR.

I tried clearing data and cache, no go.

Edit: Actually, none of the two listed apps work for me now. Just Urkill's. I have flashed your latest patch.

Edit 2: Just tried it on Lineage, works perfectly fine with your latest patch and both cameras. Weird. Could it be a Treble issue?
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
Install CatLog from the playstore.

Open its menu (you need to press the hardware menu button somehow) and press Record.

Open the camera, crash it a few times.

Go back to CatLog and stop the recording.

It will save the log file inside /sdcard/catlog/

I was gonna tell you to send me a catlog of the crash but I won't annoy you to go back to RR on purpose now.

Both the issues with miui and the crashing in RR seem as though my mod isn't actually doing anything. So they might be getting their sensor info from some other file.

I need to look into it. Once I get the chance I'll flash both MIUI and RR on my Note 2 and see if I find anything.

Development will slow down a bit since I'm unfortunately sending my laptop for warranty tomorrow. I'll pick it up asap.

I'm really really happy with all the positive replies! I'm glad I actually managed to make it work for someone! Thanks for all the feedback.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] kam821:
I have the bootloop issue in my xiaomi.eu MIUI, but I tried to fix and.. some helps.

I decided to share what I did, maybe it helps you too.

0) Before install author's fix make backup of the original file /system/etc/public.libraries.txt to for example /sdcard, you can create additional directory in sdcard before and then copy this file them.

1) Use any Root Explorer eg. Total Commander and copy two files:

/vendor/lib/libadsprpc.so to /system/lib/libadsprpc.so

/vendor/lib64/libadsprpc.so to /system/lib64/libadsprpc.so

2) Set right properties of the copied files:

owner: root

group: root

Permission:

rw- r-- r--

OR

owner: read, write

group: read

other: read

3) Now you can go into recovery (TWRP) and install op fix.

4) Clean Dalvik and Cache.

5) Additional you can use the File Manager in TWRP and make sure, that copied files are in the right places.

6) Reboot

If you are still getting bootloop, just go into TWRP>Mount, select System, go back, then go Advanced>File Manager and copy backup version of public.libraries.txt (step 0) to directory /system/etc.

Reboot and poof, there's no bootloop :)

I don't know how it works, because after reboot copied libraries disappear, but system boots correct without deleting libadsprpc.so from public.libraries.txt
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Marcepo21:
So is everything working now on miui? All features in Google cam? Not force stopping?
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Long pressing the "Menu" button (left of the home button) to get the relevant menu.

First crash was (if memory serves well) was going into portrait mode, the second was the same but quick switch to front cam to keep it going, followed by rear cam side swipe to video mode and finally the front cam doing the same. Hope it helps.

When you say that your script/zip installer doesn't do anything, keep in mind that I manually placed those files in the right directories, except the text file.

Looking forward to you flashing MIUI. Link to the latest weekly I tested all this out: https://sourceforge.net/projects/xi...ms/files/xiaomi.eu/MIUI-WEEKLY-RELEASES/8.5.3

Thanks for taking the interest and time and doing this. :)

For now I went back to the stock MIUI camera, whatever that is, as the phone is my daily driver and I need the cam for work. But keen to continue with getting gcam working under MIUI.

PS. The catlog is 2.8 Meg, can't upload it here. If you give me an email address or place to upload...
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Senpaivm:
I have followe your method, step by step, and it does not worked for me. I have had a bootloop, so I replaced the backed up txt file again to its place. The Note 2 booted prefectly, installed the suggested GCam Mod apk and the app crashed. I am using EU.8.5.3 and maybe I am missing something because you said "without deleting libadsprpc.so from public.libraries.txt" so, does it mean that I have to edit the txt file?

Anyway, thank you for sharing it with us :good:

Edit: I tested some different camera mods and Serjo didn't work for me only BSG, Amova8 and Urikill worked partially. No portrait mode (the app crash) and the front camera was flipped. Finally I deleted everything and made a clean install as the stock camera was flipped, too. Again with EU 8.5.2
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
I meant in the way that all your symptom are similiar to not flashing my installer at all. Miui might be getting the camera's sensor info from some other file.

Upload the file to https://www.file.io/ and PM me the link!
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
[MENTION=3817746]kam821[/MENTION]

I'd love to know this as well!

[MENTION=8907725]Senpaivm[/MENTION]

Don't go through any more headaches. I'll do my best to have it working on miui as well. The hardware's the same, there's no reason why it shouldn't. Give me a bit more time.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Fair enough.

Done.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
I found out I forgot one front camera file in my last version of the mod. I've uploaded a v5 with that fix. Can you give it a test and report if it still crashes?

I've also changed the path folder from /vendor to /system/vendor. I think this should make the installer work on both treble and non treble roms.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] mokryak:
Hey. I have no HDR icon in the main camera. It looks like it does not work. Everything is normal on the front camera.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] SuperStyle:
Thank you very much this is great !

The panorama mod is very dark like the lens blur mod
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
For some reason i haven't figured out yet, the toggle between No HDR, HDR+ and HDR enhanced isn't showing up on the back camera.

But it does work. It's defaulting to HDR+. You can see that yourself. Snap a photo and you'll have a notification of the HDR+ processing and the resulting picture will look much better.

I've noticed that! I think the issue might be the same as the lens blur. I'll look into it.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] tonnitte:
Does it mean the patch now works on MIUI and EU rom?
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
Probably not. But I can't test it at the moment.

The camera HALs are different and although I know where and why it crashes in our custom ROMs, I have no idea what's going on in MIUI yet.

It might work. But if you wanna test it, be ready to flash MIUI again. And don't forget that since you're messing with /system you always need to have a MIUI install where you flashed LazyFlasher right after flashing MIUI, otherwise it will bootloop.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Attempted to install v5 with the new apk. No errors showing in TWRP, but even with Lazyflasher it just sits at the boot animation. I don't have time to manually place the files right now, will try that later today or tomorrow. Also noted that the text file is only 1 k now, it was 300 odd before. Mentioning it "just in case".
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
I wonder if it's the public library file change that causes the bootloop. Can you post the contents of the MIUI's public.libraries.txt file here?

Also if you want to test flashing only the .so files use this installer

https://mega.nz/#!UexHDThY!O2CUQ1GVqG9CSAqfgMRXthKVq4vgPPq6-wbKflAGbio

The file is and was only 376 bytes. But shown as 1 KB. Maybe you mistakenly read it as 376 KB! It's just a few lines of text with file names.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Here you go:

This is before flashing your installer. I'll give the one you just linked to a go

JOY :D It worked a treat. One crash only when switching from the back cam to the front one, but it never repeated again after an app restart.

Thank you for the effort!!!
[Xiaomi Mi Note 2  Themes, Apps, and Mods] tonnitte:
What did you do? What did you flash? I can't wait to try it. Please explain
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Flashed the zip and installed the apk from the OP.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] tonnitte:
Now it works on MIUI. Thanks to all who made this possible
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
That's really great to know!!

So it really was the extra libraries my installer was adding and are not available to miui that was causing the bootloop. And miui doesn't even need that change since the reference to libadsprpc.so is already in there.

I'll make the new version of the installer just add that line instead of replacing the whole file. Until then, we'll have different installer for miui!
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Umm not quite. The text file was causing the bootloop in MIUI. Using the installer that had only the lib files was causing no issues at all. Also, not sure how the latest apk linked in the OP compares to UriKill's version that I begun testing with.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
That's what I meant. I should've typed "the extra library references my installer is adding". Our custom rom's public.libraries.txt file has a ton more entries.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Ah, sorry, I'm looking at it from the layman's side while trying to keep track of what was installed and what effect it had :D
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Senpaivm:
Hell yeah!!! Working in MIUI EU 9.5.17 without problems when changing from back to front camera and back. I only have one problem and is that front camera is flipped (I only need to edit one file and change a value from 360º to 270º) but, right now, thats all.

Grat job man, really great job. :good::good::good:
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
And then again when you update to the next release of MIUI (or any other) ROM. I just installed 8.5.17 and had to edit buid.prop file (to enable HAL3 again) and the msm8996 file as you pointed out. I also reinstalled Mimi Mix's text file-less zip in case those files have been overwritten in the ROM update as well. Interestingly the camera apk did not need a reinstall, worked fine after the above mentioned edits/install.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] pauloglvz:
Hey guys I just got my new Mi Note 2 and have updated to MIUI 9.5. I back-read the thread but I'm not that familiar on technical stuff. Although I have been able to root, flash roms, etc. previously.

Would anyone be kind to provide instructions to make this work with MIUI 9.5? Would be much appreciated :)
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Well, you need to have root to change the entries. You need to add the HAL3 line to the build.prop file and change the orientation of the front sensor so it is not upside down. Instructions for these are here.

Once that is done, copy the installer Mimi Mix created (first post in this thread). If you run MIUI on your phone you need to use the installer created for it. While you copy stuff, get the camera apk (application file or executable in Windows terms) to install the camera software (also from the first post in this thread). Find that in your favourite file manger and tap it to install. It will probably ask you to allow non-play store installation.

Reboot after all this is done and you should be good to go.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] marinos339:
I can confirm that it works perfectly with AOSP Extended v5.5. Thank you for your great work!!
[Xiaomi Mi Note 2  Themes, Apps, and Mods] cekekli:
Thank you sir, it is working well with latest AEX
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Pantherx12:
Hello working with latest globe ROM, how ever taking a HDR takes a very long time, like maybe 200-259ms per photo at the default 8/10 setting this takes quite some time. Compared to snap camera, the stock camera and open camera that can take the same amount of exposures in half the time or less.

Is this typical behaviour or have I messed up somewhere?

I've changed recommended settings already and restarted app.

Many thanks for any guidance.

And thank you to OP, been waiting for something like this for ages. My geek level isnt quite high enough for coding.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
Just a heads up. I updated to the MIUI 8.5.24 ROM this morning. It successfully broke the camera :( I flashed the fixed sensor information file pack, re-added the HAL3 line and even reinstalled the camera apk. No go. Crashes every time now. I don't know if I can be bothered to install Logcat again and get a crash dump... I am contemplating to try an other ROM like Lineage or AOSP just can't bring myself to go through another 2 hours of setting everything I need to use from new again.

P.S. I have to say, looking at the stock camera app, that it is pretty good. Very fast autofocus, nice sharp image, probably Mimi Mix's files helped that along to a good degree.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Naxxÿ:
You are my hero!!! All works like a charm now[emoji4][emoji4]

Thank you, thank you and thank you[emoji847]
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Pantherx12:
Works fine for me so your issue probably lays elsewhere.

I did a dirty flash but wiped dalvic/cache so didn't reinstall anything asides from the fladhable zip found in the OP.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] The_real_hati:
I dirty flashed too, everything else works as well. The only thing that comes to mind is the TWRP backup. I noticed that some of the time restoring full backups need a reboot or two to get everything working. On occasion I had fingerprint scan not working at all, other times one of my sims (always the same in slot 1) show up as not installed. At the end everything will work again, except for now the Gcam mod :(
[Xiaomi Mi Note 2  Themes, Apps, and Mods] SuperStyle:
Flashed MIUI 8.5.24 after full wipe and the mod does not work
[Xiaomi Mi Note 2  Themes, Apps, and Mods] pasquale_kun:
Works with xiaomi.eu?
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Linuxghost:
Worked for me on MIUI 8.5.24 EU.

Fixed Open Camera.

Thanks!

Verstuurd vanaf mijn Mi Note 2 met Tapatalk
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Senpaivm:
I have been doing some test with new apks that have been available (Arnova v7.9.7 and Nokia Camera). I am using Miui 8.5.17 EU with all the patches applied. My results are mainly good. All the apps start up without any issue; the HDR toggle button is not shown in Serjo87 and Arnova app however, Nokia's camera app show it perfectly. I have not compared photo quality with each app so I cannot give information about it. One of the things that I have see is that new Arnova mod is very easy to configure and is recommended at Google camera MODs site. I also want to do the same tests updating the system to latest 8.5.24EU but I'm not sure as MIUI10 is "here". I hope that this info could help.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] ldmondini:
Hi Mini Mix, thanks for this wonderful job. This mod works very well on official LineageOS and it's not deleted by the rom OTA updates, but each update I have to manually modify the front camera values to 270 from 360 otherwise front camera is flipped, is it possible to fix this bug in the zip file? I tried to reflash your zip after an update but front camera remain flipped, at the moment the only solution I have found is to change manually the camera values each time.

Thanks
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
I'll try to update the installer to account for that. I haven't used a single rom that suffers from that issue. But it seems to be a thing in LineageOS and MIUI.

By automatic updates are you refering to OTA updates?

I get near instant shutter when I press the photo button. Which is waaaaay faster than OpenCamera, which takes almost three seconds.

A lot of apks don't really have working HDR though. Arnova's never did. Not even the latest 7.9.7.

Every developer uses different libraries and different hacks to improve compatibility with several devices, but Arnova's never work with the Mi Note 2.

If you take a look at the logcat after opening his camera app you'll find

[CAM_OnecameraSelector] Selected legacyJpeg OneCamera configuration.

which does not process HDR photos at all.

Most other google camera mods share the same issue.

BSG's mods, regardless of what camera model you choose in the settings, default to ZslYuvProcessing as the OneCamera configuration. Which does not process HDR either.

SerJo87's and arthur's seem to get it right somehow. Either it be the Nexus6 or Pixel2 config, the OneCameraSelector will chose that config and work. Even if the toggle is missing.

PS. My Laptop is still out for warranty. I can't get a lot of work done like this.​
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Mimi Mix:
I've updated the OP with a slight update to my recommendations:

Recommendations

If you don't mind losing Motion Photos on the Back Camera turn on the Use Hexagon DSP option for slightly better performance and stability

Change the HDR+ parameters to Pixel 2017 stable.

Turn on Portrait ZSL mode

Change Base model inside Tuning back cam to Nexus 6P. (More detailed photos plus better and faster autofocus)

SerJo87 Google Camera's default tuning settings are tweaked for another smartphone's camera sensor. As a personal recommendation go into Tuning back cam and disable the Tuning master switch for it to use the default Base Model values. I've spent hours tweaking and have found the default Nexus 6P values to be the best ones.

Change the Lens blur megapixels to 5MP. (Fixes the low exposure issue)
[Xiaomi Mi Note 2  Themes, Apps, and Mods] Pantherx12:
Turned out it was just low light causes the delay outside in the day light photos are indeed instantaneous :)

This is great stuff I've got some stunning photographs with this plus the gcam mod you recommended.
[Xiaomi Mi Note 2  Themes, Apps, and Mods] reekinbollix:
Amazing work, Mimi Mix! Instantaneous, high quality shots in mid-to-high lighting situations. Thank you very much :good:
[Xiaomi Mi Note 2  Themes, Apps, and Mods] mafury:
i got miui 8.5.3 and got bootloop... installed flashlazy too but don't work.

i got magisk and api module installed.