yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi 9 SE Guides, News, & Discussion] ale.giordano:
Same for me.

In this zip there are many patch for mi9 and they aren't compatible with mi9SE
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Care to try this one as a magisk module? I took all the files and configs from miui 10.2.9 EEA stable and tweaked a bit the overlay to enable auto brightness. It's based on the one from AndroPlus for MI9 but with the "correct" files for our phone.

Tested on my phone all day (I'm running floko) and both bt audio and calls work fine. Also auto brightness seems ok-ish... maybe needs some tweaks :)

Let me know if it works for you so maybe I can tweak it a bit more and put it on github for everyone :)
[Xiaomi Mi 9 SE Guides, News, & Discussion] ale.giordano:
Thank you!

Now I am on EU but this change my priority... Soon I will flash a GSI again!
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
I just flashed this module over Floko ROM and the auto brightness is very good for me.

Are you using the same values as stock firmware?

I didn't tested BT at the moment.

Is there any chance to fix the audio fx and the FOD issue?

:good:
[Xiaomi Mi 9 SE Guides, News, & Discussion] rzki03:
can you test the BT call to see if it's work? thanks!
[Xiaomi Mi 9 SE Guides, News, & Discussion] maciek90:
Havoc OS hangs at boot animation after installing this module, BUT I used audio_policy_configuration.xml file from your module and now BT sound works fine in call and while playing music.

Thanks for sharing this module.

I had auto brightness working before, so maybe there was some conflict with files from your module.

For anyone who has problems with flashing this module and wants to fix BT sound please follow this steps:

1. Comment the line

mount -o bind /mnt/phh/empty_dir /vendor/etc/audio || true

in /system/bin/rw-system.sh by adding # at the beginning.

2. Reboot

3. Replace /vendor/etc/audio/audio_policy_configuration.xml file with the one from pengus77 module.

4. Reboot
[Xiaomi Mi 9 SE Guides, News, & Discussion] Brainstorm85:
Have you already been able to fix the google pay problem?
[Xiaomi Mi 9 SE Guides, News, & Discussion] ggazza:
Yes, in the end, i flashed FlokoRom and NFC with GP (tweaked with ASSET method) work fine :D

pengus77 Thx for the magisk module.
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Hey there,

the auto brightness values are the ones from MI8SE, which is pretty much similar to the MI9SE. At the moment I find it a bit too sensitive and I'm tweaking a bit the values to make it more smooth.

About FOD, I'm not on the latest Floko, so my FOD works fine. As I heard on the newest releases it doesn't work, so yeah, I can diff the mods and check what happened. Maybe drop some code in the module and make it work again. No guarantees.

About AudioFX, care to explain what problems you're having?
[Xiaomi Mi 9 SE Guides, News, & Discussion] ggazza:
Сan I replace the green circle of fingerprint?
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
I'm running latest Floko ROM (061519) and FOD is working fine, bu only with screen on. I was wondering if there is any way to get it working with screen off or in AOD mode.

Auto brightness is working fine, I agree with you it is quite sensitive in mixed light conditions, but it works very well on low light and full light (i usually prefer darker screen while indoor).

AudioFX apk on my device starts but i get a blank screen. I didn't tested with audio, even if audio streamed from social media is ok.

Weird to say, your magisk module fixed also the battery stats details.
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Ok perfect then. I don't use AudioFX but I can check in the logs what's wrong with it.

About battery stats, yeah, forgot to mention that I also put in the correct power profile in the overlay :p
[Xiaomi Mi 9 SE Guides, News, & Discussion] Micha_Btz:
LOS GSI also, just for people who want to try.
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Yeah, consider this as a Floko-ONLY module for now. If you need the bt calls/audio to work look at This Post from @maciek90.
[Xiaomi Mi 9 SE Guides, News, & Discussion] bencik:
What camera app do you use on Floko (and other GSI)? Is it possible to get wide and zoom lens working? Or just the main camera?
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
I noticed that the module breaks the CtsProfile status in Magisk. Please could you double check?
[Xiaomi Mi 9 SE Guides, News, & Discussion] ggazza:
Pengus77, please could you double check if latest magisk module for auto brightness is breaking SafetyNet on magisk?

I can't pass CtsProfile using it

When disabled everything is fine
[Xiaomi Mi 9 SE Guides, News, & Discussion] sky104hk:
Foloko GSI don't have fingerprint option...I resent this capture again

https://drive.google.com/file/d/1u2mlsz2EyDuofzUDadF7BWX9Gjofd3AM/view

Alternatively can use Face-unlock instead!

Havoc GSI can use fingerprint flawlessly, test already!
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Hey there, just checked and you're right. Also AndroPlus module breaks the ctsProfile though and my module was based on that one.

Now, I repackaged it to be nicer and it works. Find it attached to this post.

Remember, this module is only for FLOKO, so don't use it on other GSIs. You've been warned :)
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Thanks a lot! I'm on Floko so no fuss for me. :fingers-crossed:

I will report in case of issues.
[Xiaomi Mi 9 SE Guides, News, & Discussion] maciek90:
Actually Havoc also boots with it. Later I will check if BT audio still works.
[Xiaomi Mi 9 SE Guides, News, & Discussion] PeterImmel:
What does this patch do?

Can I use it witv xiaomi.eu rom, too?
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Interesting, so the fix for the safetynet also made it compatible with other GSIs probably. Let me know if it fixes BT calls on Havoc please... also consider that it "overwrites" the values for auto brightness and for the battery profile, so let me know how it feels :)

It's useless on xiaomi.eu, this module attempts to fix the battery stats, auto brightness and BT calls / media on GSI roms. Xiaomi.eu roms already have those things working :)
[Xiaomi Mi 9 SE Guides, News, & Discussion] eagle*23*:
There is "lavender" , "montana" , "tulip" and so on. What i need for MI9 SE (grus) ?
[Xiaomi Mi 9 SE Guides, News, & Discussion] kagazushi:
I can confirm that autobrightness works on havoc, with Okitalkernel. Did not test BT calls yet.
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
That's good news, so the module doesn't kill other GSIs. Hope BT calls/media work fine (they should). Working at the moment on a way to fix VolTE (with my operator works on xiaomi.eu, doesn't on GSI).
[Xiaomi Mi 9 SE Guides, News, & Discussion] maciek90:
I confirm that BT still works fine on Havoc. Not sure about the other things as they were ok before flashing the module.
[Xiaomi Mi 9 SE Guides, News, & Discussion] jimmy16:
Our device is GRUS
[Xiaomi Mi 9 SE Guides, News, & Discussion] Micha_Btz:
in LOS the bt fix doesn't work. Tested with BT Headset. Can you take a look?
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Sorry to hear that, but I use the MI9SE as daily driver for work and I can't flash LOS...
[Xiaomi Mi 9 SE Guides, News, & Discussion] ggazza:
Another problem on Floko. If i enable VolTE in settings, phone does not receive sms.

How to solve this problem?(
[Xiaomi Mi 9 SE Guides, News, & Discussion] maciek90:
Have you tried to follow steps from post #229?

Now I'm not sure if this module fixes BT in Havoc or just doesn't break the changes I made earlier as I still have that line commented and audio policy configuration file copied to vendor path.
[Xiaomi Mi 9 SE Guides, News, & Discussion] decayed.cell:
Oh I had that on an older build. Try flashing a new one
[Xiaomi Mi 9 SE Guides, News, & Discussion] eagle*23*:
Can i use every Havoc build ? Because there is no special one for grus ?
[Xiaomi Mi 9 SE Guides, News, & Discussion] givemerobot:
I used ARM64-AB from this thread and it works fine.

---------- Post added at 03:25 AM ---------- Previous post was at 03:19 AM ----------

Guys, let's create new thread with all necessary links and information in OP post
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
You can share tour GSI flashing experience here: https://xdaforums.com/mi-9-se/how-to/guide-how-to-flash-twrp-gsi-roms-mi-9-se-t3939254

:laugh:
[Xiaomi Mi 9 SE Guides, News, & Discussion] eagle*23*:
Thanks

Did you or someone noticed better Batterie Life with Havoc compared to xiaomi.eu roms ?
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Of course it's better. MIUI has an insane amount of background services and, moreover, xiaomi.eu is based on a development rom. This means that the rom itself has debug enabled and the kernel too, leading to way more battery usage compared to a standard GSI (which is also compiled as userdebug) but has 1/10th of the background services and, if you flashed OkitaKernel, a kernel stripped of most of the debugging crap.

Edit: also in /vendor/overlay/ remove everything but BluetoothResCommon.apk. The phone will work just fine, VolTE will be magically enabled, network mode display will be fixed and you'll lower a bit the idle battery consumption. There is much crap left in there by xiaomi that is insane.
[Xiaomi Mi 9 SE Guides, News, & Discussion] eagle*23*:
Sounds nice,thank you.

Last question: Havoc or Foloko for daily use and which one is better updated ?
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
I'm just fine with floko. Battery life is ok, can be better but I'm not complaining. I use it for work, so about 1/2 sot and 2 hours calls, plus whatsapp web and some other apps. I manage to get home after 10 hours with 75/76 % left.
[Xiaomi Mi 9 SE Guides, News, & Discussion] maciek90:
I've just managed to get GPay working (at least configuring cards is ok, I will try to pay with it tomorrow).

I tried Magisk module that changes device fingerprint, but again I got stuck at boot animation.

Setting fingerprint manually by resetprop allowed OS to boot but ctsProfile was still false.

Finally I found another Magisk module called SafetyPatch by hackintosh5. CtsProfile passes check and Google Pay doesn't complain about rooted device.
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Please let me know if it is working. My Gpay does not give any feedback at all when tapping on a POS
[Xiaomi Mi 9 SE Guides, News, & Discussion] maciek90:
I've just paid with GPay. Everything went fine, just like on stock.

Now I wait only for FOD to work on AOD and all lenses available in GCam.

Actually FOD works on AOD when there is a notification. It stops working when there are only icons on AOD. Is it similar in Floko?
[Xiaomi Mi 9 SE Guides, News, & Discussion] champagne66601:
Which GSI are you using? I've been in Floko this week and FOD doesn't work with AOD notifications
[Xiaomi Mi 9 SE Guides, News, & Discussion] maciek90:
Havoc OS 2.6, but it works only when there is notification on AOD. So most time I have to use the power button to wake up the screen and then I can use FOD.
[Xiaomi Mi 9 SE Guides, News, & Discussion] danbrown162:
Could someone do a little video review of floko and havoc. Would be very interested to see how these function. Also, to see performance in certain apps like gpay , gcam, etc
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Are you using stock or custom kernel?
[Xiaomi Mi 9 SE Guides, News, & Discussion] maciek90:
I'm using Okitakernel 2.5
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Okita kernel should pass SafetyNet out of the box.

I will give a try to safety patch later on. I am on stock kernel and even if magisk is passing SafetyNet GPay is not working at all.
[Xiaomi Mi 9 SE Guides, News, & Discussion] Brainstorm85:
So I had the same problem! My personal solution was: I installed Okitakernel +magisk with the SafetyPatch module from hackintosh5. After this, I was able to use GPay again and also paying works fine!
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Flashed custom kernel but still no luck. I won't use safety patch because it is messing build.prop.

Before fixing it, does your GPay was reacting when trying a payment at a POS? My GPay doesn't turn on at all.
[Xiaomi Mi 9 SE Guides, News, & Discussion] maciek90:
I had no cards configured so I didn't try it. I flashed SafetyPatch only because ctsProfile check was failing and I couldn't configure cards in GPay.

I found that NFC antenna in our devices is in top half of the phone. It didn't work when I tried to put the phone exactly in the center.

I have two questions for Floko users.

Have you tried voice calls in Messenger, Skype or WhatsApp? It looks like my mic doesn't work at all. I tried several fixes but it works only in normal calls, Google assistant and while recording videos.

I only have front and back camera in GCam from BSG. I don't have wide or 48mpx lens. Do you have them available in GCam? I read somewhere that wide lens is working in GCam from BSG.
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
I always passed CTS profile on magisk since day 0. But no gpay working since I unlocked the bootloader. I tried tapping device from any possible angle, by the way. No NFC vibration at all.

I made several call with WhatsApp and mic work fine. 48mpx are a byproduct of pixel binning, so gcam read the real hardware sensor, that is 12mpx.

The wide angle works in portrait mode
[Xiaomi Mi 9 SE Guides, News, & Discussion] Brainstorm85:
Before I fixed it, I was not able to set up GPay at all. I always got the error that I have a rootet phone.

Oh and I forgot: After installing Okita, I also deleted the folder /data/data/com.google.android.gms in recovery mode. Also I cleared all data in the google play services.
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
I edited db file in com.google.android.gms only. Are you still getting updates and so on?
[Xiaomi Mi 9 SE Guides, News, & Discussion] GuilGon:
What camera app are you using? I'm on Floko and the rom is working pretty nice but I don't know how to take photos with Wide and Telephoto lenses. Thanks!

I solved it! I'm using gcam (just googled it) and configured settings to use both lenses.
[Xiaomi Mi 9 SE Guides, News, & Discussion] GuilGon:
Same here. I need NFC to read bus/subway cards not for Gpay and nothing's happening.
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
I'm conducting a test. Just repackaged miui 10.3.1.0 EEA by removing the system, boot, dtbo and vbmeta images. Slimmed the vendor overlay by removing everything related to china telecom and such. Flashed via TWRP over Floko and Okita kernel and the battery drain during calls seems a bit better now. I'll let you know if it's safe and working but I plan to push the package in cloud and share a link soon. If this works I'll make sure to publish updated flashable vendor/firmware packages to use with GSI roms. I'll keep you updated with the results....
[Xiaomi Mi 9 SE Guides, News, & Discussion] champagne66601:
That's nice! I will keep an eye on this
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
So, here we go. Here you can find the repackaged 10.3.1.0 vendor and firmware (including modem) twrp-flashable zip. At the moment the results are interesting, but I need a bit more feedback from users on different networks and in different environments.

Also, Here is the V3 Magisk Module that adds some more props overlays (of course the bt and auto brightness fixes are still there). Be warned that flashing this zip requires also installing ims.apk or the sim won't be recognized. You can find the app attached to this post and you can just "adb install ims.apk" or install it from an in-phone file manager as a normal app.

Please let me know how it goes for you guys. If all is fine I'll open a new thread to keep a list of the magisk module versions and of the different vendor packages.

Update: Reinstated the download link for the vendor/firmware image. All good now.
[Xiaomi Mi 9 SE Guides, News, & Discussion] ale.giordano:
HI! thank you for your great work!
[Xiaomi Mi 9 SE Guides, News, & Discussion] GuilGon:
NFC still not working, even with okitakernel. Any ideas?
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Does installing ims.apk is mandatory? After flashing the module my sim is still recognized.

Screen brightness sometimes goes to 0 and then turn back to its level.

I will flash the firmware package later on.
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Interesting. Here in Italy on Vodafone I had lots of problems without ims because the network auto configures volte. Had to install ims to get the sim working and then into network settings had to disable volte again (which btw works fine but drains oh-so-much-battery).

About the screen dimming, it's a side effect of the power decoupling and I think it's something that has to be dug into the display driver in kernel space. What I did in this module was to enable these

<bool name="config_powerDecoupleAutoSuspendModeFromDisplay">true</bool>
<bool name="config_powerDecoupleInteractiveModeFromDisplay">true</bool>

This is the suggested configuration for AoD capable devices because the first configuration instructs the system to doze without shutting down the screen, and the second (quoting the google comments in the aosp framework config)

So I think our driver doesn't support it or simply puts the panel in low power mode, but also lowers the brightness. Need to check this out with [MENTION=7190920]yuneharuka[/MENTION] but it's an important switch because it allows runtime pm for the display (for example when you're reading a web page and not scrolling nor touching anything for a while, the display should go into low power).

I can repackage V3 with that setting set to off if it's a issue. Let me know :)
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
In Ireland here, using TescoMobile, a MVNO on Three network (https://en.wikipedia.org/wiki/Tesco_Mobile).

My SIM is a 4G, I'm not sure if VoLTE is enabled.

I will check if network drain will be increasing, just in case. In the latest times it has been very low.

For the auto-brightness issue, if I understood the screen automatically dim if there are no touches.

If you believe that it won't affect screen dimming when it should do, please proceed, otherwise keep it as it is. :highfive:
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Got it. So your provider doesn't provision volte and that's ok. Have you checked in floko settings if volte icon is enabled? If it's not, enable it and see if it's provisioned.

Anyway for the brightness "issue" I'll check how it behaves here with and without runtime pm and keep you updated on the results :)

My issue was not the network stanby, but the huge drain during phone calls. Now I can talk for hours with very limited drain.
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Device itself is VoLTE enabled, network is offering 4G only. I just made a call (less than 10 minutes) and battery didn't drop at all :)
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
... and that's a good thing, right? :p

Anyway also screen on time should be a bit better with the runtime pm enabled.

Did you get to flash the firmware/vendor zip too? All good there? When you flash it you should also magically see the right settings appear in mobile network mode (lte, gsm, etc) instead of the f*cked up xml filenames :)
[Xiaomi Mi 9 SE Guides, News, & Discussion] kra1iz3c:
I can test it with Italian Iliad. All I have to do is to flash vendor and firmware, right? Can I dirty flash then?
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Not yet because I was waiting for some feedback more. I cannot use my home PC now and I'm a bit scared to screw my daily driver.
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Yeah sure, the firmware/vendor pack is safe to flash and just updates the firmware and vendor partitions. Doesn't touch system or data at all.

To check volte and such, also install the magisk module through magisk manager.

Ok, I'll wait 'till you feel safer :p
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
[MENTION=3783116]pengus77[/MENTION] I found a flashable zip for soundfx fix in GSI ROMs. Could you be able to add it to the magisk module?

Thank you! :good:

PS XDA app doesn't load file :silly: the file is available in the grus family telegram group.
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Link to the group? Nevermind, found it and the file. It's doable, tomorrow morning I'll add it to the module and test it. If it works I'll publish it.
[Xiaomi Mi 9 SE Guides, News, & Discussion] moorware:
Installed havoc 2.6 with EU 2.9.0, encountered the following bugs:

1. wrong pin code / password even if it is correct.

2. Mobile network does not work.

3. Some applications have crashes on certain pages.

As far as I understand, these bugs are just mine, how can I fix them?

UPD: used xiaomi.eu weekly as a base, all the bugs are gone
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Hey there, I repackaged the magisk module with the sound fix from the telegram group. All good so far, but AudioFX still errors out and dies. I think there are some assets missing that it's looking for:

07-05 12:39:31.888 975 1634 W AudioFlinger: createEffect() effect not found
07-05 12:39:31.888 8880 8880 E AudioEffect: set(): AudioFlinger could not create effect 0bed4300-ddd6-11db-8f34-0002a5d5c51b / ec7178ec-e5e1-4432-a3f4-4657e6795210, status: -22
07-05 12:39:31.888 8880 8880 E AudioEffects-JNI: AudioEffect initCheck failed -3
07-05 12:39:31.888 8880 8880 E AudioEffect-JAVA: Error code -3 when initializing AudioEffect.
07-05 12:39:31.889 8880 8880 E AudioFx-EffectSet: error creatingEffectSet (AndroidEffects) [ mSessionId: 0 mDeviceInfo: null mGlobalEnabled: false ], releasing and throwing!
07-05 12:39:31.889 8880 8880 E AudioFxService: Failed to initialize defaults!

There's not much I can do with Magisk here. Better to use Viper or something else for now. This is a ROM issue imho.

Find attached the V4 module for testing purposes :)
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Is the auto-brightness changed?
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Not at all
[Xiaomi Mi 9 SE Guides, News, & Discussion] Flounderist:
Did you changed runtime pm? :confused:
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
No to that too. This is just the audio fix from telegram merged with V3 for testing....
[Xiaomi Mi 9 SE Guides, News, & Discussion] moorware:
On Havoc GSI, I have a statusbar less in height than a cutout, can I make them equal?
[Xiaomi Mi 9 SE Guides, News, & Discussion] GuilGon:
Is it possible to add, by Magisk or in settings, a way to set the status bar height (in Floko for me, in Havoc for him/her)?
[Xiaomi Mi 9 SE Guides, News, & Discussion] pengus77:
Try installing my magisk module. It should fix notch, statusbar, etc at once by overlaying the right settings for grus.
[Xiaomi Mi 9 SE Guides, News, & Discussion] moorware:
gcam by fu24 working with havoc gsi

https://f.celsoazevedo.com/file/cfiles/gcm1/MGC_6.1.021_V2e-fu24_Aux3way_4Lens-04b-snapcam.apk

not working: night mode, slow motion

!! put these settings in BSG MOD settings > Fix:
[Xiaomi Mi 9 SE Guides, News, & Discussion] moorware:
solved the problem by installing havoc 20190612 on top of the global stable firmware. Thanks for the auto brightness, it works!
[Xiaomi Mi 9 SE Guides, News, & Discussion] Hijacks:
Did you managed to get havoc 20190625 installed. Version 20190612 work without problems, but on 0625 i get bootloop to twrp. To be clear I only want to know if someone got 0625 work. If it does work for others in common, i will ask for support on havoc gsi thread.