yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] mr 911:
Yeah gav is the man, he devoted alot of time to building it smart guy, I've hit quite a big issue since running Oreo 8 I've fully restored fine back to vipor os through twrp restore but I'm guessing somehow Oreo has done something to my twrp and I can't back up any more I hit error createTarFork() process ended with ERROR=255 every time I try and do a back up re flashing twrp gives the same error but firmware flashed fine,

Edit fixed*

Coming from Oreo created a file called addons.d in system, stopping me from making new backups in twrp after flashing my original vipor os backup

1 dirty flash os once your original backup restores (so you don't have to start a fresh)

2 flash gapps

3 reinstall busy box/magist .zip

4 backups work perfect.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
Most important thing here is that I'm not a dev. All I did was follow the build guide to the letter. After the initial 'breakfast lithium' stage, I copied this manifest into the .repo/local_manifests folder, ran 'repo sync' again, ran 'breakfast lithium' again then continued with the guide to the end.

Note, you'll need ~170GB of HDD space to build (unless you start trimming some packages). Build time for me with a 4690k at 4.4GHz/16GB RAM and on an SSD was still just over 3 hours.

The build isn't optimised (better toolchain, no removed packages to speed up build process etc) but it was pretty smooth. Not AICP smooth, but pretty close.

For installation I had to remove the device check because our working TWRP builds won't let it install (error 7). You'll need a recent firmware too. Another quirk is that if you try to install GApps immediately after flashing the ROM (for me at least) it complained that it was the incorrect Android version (once reported 7.1.2, then 6.0.0??), and it wouldn't boot properly. What you'll need to do is boot into the ROM and go through the usual setup then reboot and flash GApps and it'll work fine. For root, only Magisk 14.5 worked for me.

Calls, wi-fi, DT2W, sound etc all work.

Camera is broken. Vibrate only works partially (not on tap for example). Keyboard sometimes defaults to voice search for some reason. I didn't find any other issues except that I couldn't install apks from any other file manager than the Lineage one.

This was just a proof of concept. I was asking myself for months why the Mi Max (a bargain Mi Mix) and other Xiaomi devices have several Oreo ROMs (and with working cam), when we had nothing. It was either we were still waiting on some update/blobs etc **or** no-one had really tried. Turned out it was the latter.

EDIT: Moved to AICP from LOS since it's LOS-based and I much prefer it. Should be released very soon.

EDIT2 : https://xdaforums.com/mi-mix/development/rom-aicp-13-1-t3746648
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] camoway:
Which one is the latest firmware 8.1.4?
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
I posted a link to all the newest firmwares in my last comment.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] camoway:
That really helped thanks some much!
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] E50AK:
Mate can you shoot me a log dump of your rom? So that I can help you analyze and pinpoint the camera issue.

Also, fantastic work there mate!
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] mr 911:
Been testing for an hour so far just flash light not working, and camera, YouTube app no playback,plays fine through chrome.

Can't seem to find anything else broken
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
GREAT JOB!!!! :victory::victory::victory:

PLease, could you clarify?? You are saying you just synced LOS repo for lineage-15.1, then device trees (lithium and common) also from lineageos repo, blobs from TheMuppets, compiled, and it just worked and boots???

If it's like that it's great news. Means, among other things, that LOS sources for Oreo 8.1 are ready or almost almost and that if you update your worktree periodically you would be able to get a better rom just from source.

It also means that newbies like me trying for some days to build Oreo from other rom sources, AOSP ones, can still have hope :)

Thanks again and good job, man.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
Where would it be? The closest thing I could find was a build.trace file

---------- Post added at 16:12 ---------- Previous post was at 16:03 ----------

It really was just the build guide I linked to, except I changed 'repo init -u https://github.com/LineageOS/android.git -b cm-14.1' to 'repo init -u git://github.com/LineageOS/android.git -b staging/lineage-15.1'. The key was using the local manifest where I referenced specific repos/revisions (15.1 or staging/15.1, whichever was the latest). The first time I tried manually cloning those repos and literally copy pasting them into where they were meant to go, but clearly I made a mistake somewhere.

The second time i used the cache (I assigned 30GB) but it only used ~4GB and the build time was only ~10 minutes quicker. I wanted to remove a bunch of packages but I was honestly afraid of removing something essential. I'm pretty sure I could remove all the darwin packages since they're only for Mac, e.g adding these into the custom manifest

<!-- Removals -->
<remove-project name="platform/prebuilts/clang/host/darwin-x86" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.8" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.9" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.9" />
<remove-project name="platform/prebuilts/python/darwin-x86/2.7.5" />
<remove-project name="platform/prebuilts/gdb/darwin-x86" />
<remove-project name="platform/prebuilts/go/darwin-x86" />

Could probably remove a bunch more to speed up the build but I'd need to be 100% sure they weren't needed.

We share the camera as several other devices too, but it's the Mi Max that I think might help us out the most given it's also Xiaomi. If someone with more knowledge could merge what they have for the cam (and so the flashlight too) then we might at least get the rear one working (I think they have a different front).
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] E50AK:
https://play.google.com/store/apps/details?id=rs.pedjaapps.alogcatroot.app

Use this app and select the share or save button from the options menu.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] mr 911:
Yh I keep seeing camera outlined in red
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] E50AK:
Okay, thanks. Are you guys available in telegram? It'd be more convenient for us to discuss over there. If yes, add me up - [MENTION=6985142]AKW[/MENTION]iro
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
Would you mind sharing which projects you put in your local manifest? A copy-paste of the content would be great :)

Also if you guys don't mind adding me to telegram... :) I've been in contact with E50AK for a while now working on several nougat builds...

By the way camera errors point to camera service manager... E50AK is much better than me at logs but that points at some basic piece of camera drivers missing... Will need much more in depth work though...

---------- Post added at 07:09 PM ---------- Previous post was at 06:45 PM ----------

As I said I am by no means an expert but for the camera I would personally start looking at what this line points:

E/android.hardware.camera.provider@2.4-service(15065): Could not get passthrough implementation for ...

Where do the hardware/camera repo comes from? Is it Lineage? Maybe you could try removing that one if it is lineage and syncing google's one... But I'm talking without real good knowledge...
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
This is the local manifest I used - https://raw.githubusercontent.com/gavin19/manifest/master/manifest.xml

The local_manifest folder only gets created after the first run of 'breakfast lithium', then I pasted it into that folder and ran 'repo sync' again to pull those down.

I went back to AICP so I can't even dump any logs from Oreo.

As for the camera, I tried looking at the Mi Max ROMs to see if their repos had any different camera-related entries. I found some like this, but whether they would make any difference is unknown. The thing is, I don't want to run blind 3-hour builds on the off chance that something might work or not. I need to figure out how to reduce build time (aside from the ccache which I've already implemented). Surely it shouldn't take ~3 hours?

On that topic, since my out folder is already populated with ~28GB of files, how would I go about cleaning that up for a new build. Should I just delete it or ...? Are there any other folders I should remove before trying further builds or any commands that i should run?
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
I'll look into the local folder and the rest you say. I've always had to create it manually as haven't built any supported devices from any rom source (what would be the point other than in a situation like we have with Mix and oreo?)

Although I know some guys around here will be much more helpful than myself with the logs and ideas to fix camera, I can see that what you share is just a camera package, that is, the app that uses the hardware. The problem in the rom is at the driver level, I think, and will probably be fixed changing some stuff in hardware or whereabouts...

As to building time and resources: if you didn't erase your working dir, after the first build compiling can take as little as 15 minutes, or up to say 30, depending on the amount of modifications to your sources. The big thing you already did and will not take so long until you make clobber before another one.

---------- Post added at 08:24 PM ---------- Previous post was at 07:55 PM ----------

I found this line strange in your local manifest:

<project name="LineageOS/android_hardware_qcom_media" path="device/qcom/media" remote="github" revision="staging/lineage-15.1" />

Did it came like this after breakfast you say? Cause that is a hardware project that exists already in the manifest.xml and goes to hardware/qcom/media and here it goes to device/qcom... Curious...

Might be one of the things making it work...
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
The manifest file was added by me. The 'breakfast' command only generates the local_manifests folder, but it doesn't add anything to it. I just discovered that that was where custom manifests are supposed to go.

I copied that manifest from another Oreo project (can't remember which offhand) and just replaced the device names to lithium and the revisions to whichever were the latest for the corresponding repos. I wasn't sure about that line either since it didn't appear to be especially relevant. The only reason I made the manifest was to make sure the build process was pulling in all the lithium-related repos since I couldn't find reference to them elsewhere.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
Yeah that is the way it is when device is not supported by rom: breakfast doesn't pull anything. It does for lithium nougat but lineage 15.1 is not out, so not ready.

Well it is more than clear that you did perfect as it worked. That line puts a project in a path that's not intended for but either it doesn't conflict with anything or it somehow should be there.

Thanks for the info and replies.

Hope u keep working on it and we can help you each in its measure to make it a fully working rom!!
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] Hunter Mossberg:
Maybe you guys need to use sources, that share Psy? Also he said on TG group

"P E P S Y M A N:

That's not a secret. Changes are in lineage gerrit, picked from OSS camera Hal from qualcomm".
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] mr 911:
Yh i just saw he has compiled an Aosp ROM boom the mix has life again :)
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
I could probably cherry pick those HAL patches to fix the camera. I never used Nougat Lineage as it didn't have the better custom nav bar that AICP/RR. What does Lineage (my Oreo build) have that PE doesn't have? From using them both I didn't notice any differences. I'm heavily leaning towards trying AICP since that's what I use and I'll be much more motivated to work on it, and there are already 99% functional AICP Oreo ROMs out there for other devices, so it's clearly doable.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] usb7:
Great work gavin19!

The issues with media (YouTube, podcasts, local storage content not playing) may be an issue in LOS 15. I had the same issues with LOS 15 on a different device.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
You probably can just get AICP repo synced and work with that, although device tree from lineage 15.1 just like that probably won't work... But maybe it does or building errors can be solved...

Camera issues if they are fixed but not merged yeah, just get those commits and it should be good!

---------- Post added at 12:25 PM ---------- Previous post was at 12:22 PM ----------

I do not think his sources for device will work on lineage rom source just like that... They are for aosp. But they can be used to see how to fix issues of course or to compile another nice aosp rom other than PixelExp...

I am working on Cosmic and Firehound but as I know very little every problem is big and tough yo beat... Didn't get past bootloop yet :)
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
Figured out how to merge the camera patches (1/2). Whether they'll work or not is another matter.

I had to edit some files (names and content) to AICP-ify the Lineage device tree for Lithium so 'breakfast' would even recognise it, e.g lineage.mk becomes aicp.mk.

Building now. Seems to be going quicker too. Maybe AICP uses a different build config from Lineage.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
Good!

Well when device is not officially supported there is no need for breakfast and it actually doesn't do anything: when supported it pulls device and vendor trees I guess, and probably kernel. When not, you just need to manually create local_manifest and yeah, edit some files in device/manufacturer/model to make it recognised in the lunch/brunch menus.

Hope the build is successful!

I guess you're using PsyMan's sources??

I have a working CosmicOs Oreo I cooked a few hours ago, but PsyMan told me I was missing vendor modifications he hasn't uploaded to github yet. So you will probably get a working rom with some issues...

In my case, when flashed alone all looks and feels good and at least wifi, bluetooth and camera work. But when gapps are flashed on top, it gets extremely laggy and plastore doesn't even boot...

So I personally will wait for PsyMan's vendor to come and build again... In the meantime I will probably sync some other rom and see if it gets compiled too :) And will review PsyMan's work and see differences with LOS sources for lithium... Curious as to what must be done to make this work...
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
Glad to see some proper movement towards Oreo (finally!).

As for the sources, I'm just using AICP with the proprietary blobs from TheMuppets repo. If the cam doesn't work (assuming it even boots) I'll try another build using his msm8996-common repo instead.

Honestly, I don't care which ROM I use (I find they're 99% similar anyway). The main reason I want AICP (or RR/Dirty Unicorns etc) is that they have an advanced navbar editor that others (Lineage/PE/PA/MIUI etc) don't have. They do have navbar customisation, but it's not close to AICP (that's not counting all the other nice tweaks like network speed in status bar, clock/date in status bar, navbar background colour matching the app's main colour etc etc).

I see Cosmic has no Lithium support either. Did you use the device tree from Lineage too or...?
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
None of them except for Lineage have support for Lithium, all nougat roms except for AICP are unofficial and even AICP hasn't pushed its sources for this device :) So yeah for building a new rom you need to put together rom source, device tree and vendor and make them work. I am no developer, so in my case it all depends on finding the best sources...

Cosmic Oreo I built using PsyMans' sources for Lithium and msm8996-common, and waiting for him to push vendor to github... So far those are the only oreo sources out there for lithium, at least for AOSP roms. You proved that LOS source can work too but is still missing some pieces so pure LOS or LOS based roms need more good work still to make them fully working for this device.

So you are using the same device tree and vendor for AICP as you used for LOS? That's going to be interesting to see if they work :) I haven't managed a single AOSP rom to even compile with LOS sources for lithium...
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
Yep, but it failed at 57%. There were some resources referenced that didn't exist. I switched to PsyMan's lithium/msm8996-common trees and started another build. Seems even quicker with the cache. Which kernel are you using?
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
The only one I know works for xiaomi msm8996 and oreo: floppy kernel source :)

I was in contact with Jonas Cardoso and he offered great help and advice. Also asked of course his permission yo use it and share when I had a proper build.

No surprise it didn't progress: lineageos device tree will always look for stuff it cannot find in aosp rom source.

By the way: be aware of PsyMan's github, I hope vendor for lithium will be up soon...
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
We know the Lineage kernel works too but the more the merrier. I really want the Psychedelic kernel for the overclock, but it's not a must.

Funny, I got resource errors (different ones) even after I switched to Psy's repos but at least I was able to bypass those.

I've forked some of Psy's (and other) repos so I can keep track of them locally and make changes.

Lithium vendor? You mean https://github.com/PsyMan47/lithium?
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
No. Vendor xiaomi.

For your Los rom you had it from TheMuppets :)
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
Ah, the proprietary stuff. I see now.

Build worked. Stock camera doesn't work but the modded GCam one does (as well as Open Camera). Haven't tried others yet. Front cam is upside down, as with PE (expected since i used his ources). YouTube works too (it didn't in the LOS build).

Manifest for reference was

<project name="PsyMan47/lithium" path="device/xiaomi/lithium" remote="github" revision="O-MR1" />
<project name="PsyMan47/msm8996-common" path="device/xiaomi/msm8996-common" remote="github" revision="AOSP-O-MR1" />
<project name="LineageOS/android_kernel_xiaomi_msm8996" path="kernel/xiaomi/msm8996" remote="github" revision="lineage-15.1" />
<!-- Vendor -->
<project name="TheMuppets/proprietary_vendor_xiaomi" path="vendor/xiaomi" remote="github" revision="lineage-15.1" />

I got one build error which I fixed after a two minute Google search, otherwise it was smooth. While the build was much quicker up front, it really dragged in the last third, so it ended up still ~3 hours.

I actually have a 95% functional Oreo build of AICP, with all its bells and whistles! I know the Lineage kernel is sound since it's working with AICP too, so I might flash Floppy just to see if it plays nice. Congrats on LEGEND btw.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
GREAT job man!!!

Whenever you have some time, you can try using PsyMan's sources for proprietary blobs, they are up:

https://github.com/PsyMan47/vendor_xiaomi/tree/LOS-15.1

Just repo sync --force-sync vendor/xiaomi and build again. It will regenerate only what's changed...

Maybe you can publish/share your AICP build? :)

NICE!
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] Psy_Man:
Change the vendor branch, i deleted lineage-15.1. Use O-MR1 instead. Updated and matched latest lineage changes both in common and vendor.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
Cheers. You updated just after I finished the build. It already pretty much works (a touch sluggish but no big deal), bar the front cam. I don't use it anyway but still nice to have it working properly.

<project name="PsyMan47/lithium" path="device/xiaomi/lithium" remote="github" revision="O-MR1" />

<project name="PsyMan47/msm8996-common" path="device/xiaomi/msm8996-common" remote="github" revision="AOSP-O-MR1" />

<project name="LineageOS/android_kernel_xiaomi_msm8996" path="kernel/xiaomi/msm8996" remote="github" revision="lineage-15.1" />

<!-- Vendor -->

<project name="PsyMan47/vendor_xiaomi" path="vendor/xiaomi" remote="github" revision="O-MR1" />

Those correct now?

One question. Would you recommend another kernel. As you can see, I'm using LOS because it worked before, but is there something else better?
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] Psy_Man:
Nope. AICP is based on lineage and you are using aosp branches. I updated branches for lineage too, so use LOS-15.1 branch for both common and lithium tree. Do not use other kernels. The one from lineage is based on pure caf (qualcomm) and also in common tree caf hals are used as well for best compatibility.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
It works fine even though I used the AOSP branches. The vender_xiaomi tree only has LOS 15.0, so just leave that on AOSP and update the others, like

<project name="PsyMan47/lithium" path="device/xiaomi/lithium" remote="github" revision="LOS-15.1" />

<project name="PsyMan47/msm8996-common" path="device/xiaomi/msm8996-common" remote="github" revision="LOS-15.1" />

<project name="LineageOS/android_kernel_xiaomi_msm8996" path="kernel/xiaomi/msm8996" remote="github" revision="lineage-15.1" />

<!-- Vendor -->

<project name="PsyMan47/vendor_xiaomi" path="vendor/xiaomi" remote="github" revision="O-MR1" />

? Thanks.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] Psy_Man:
Yes, that's right now. There is no need to separate vendor for aosp or los.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
When I switch the branches to Lineage as you suggested it fails to build - https://pastebin.com/raw/5gdfptKu

Those errors are exactly what i got earlier when I used the branches directly from the LineageOS repos. That's why I switched to your AOSP ones and they worked fine except for one small error which I corrected easily.
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] Psy_Man:
Just delete the doze folder from common tree and remove those lines from msm8996-common.mk in common tree:

# Doze mode

PRODUCT_PACKAGES += \

XiaomiDoze

I forgot to do this ?
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] gavin19:
Fantastic. I finally have AICP Oreo thanks to your repos. Built without error and it works fine.

Only thing I've left to figure out is why the default/Google cams won't work (force close) but 3rd party ones (Open Camera, FV-5) do. I rarely use the cam anyway so it can wait.

I'm going to use it for another while yet to make sure there aren't any bugs I've missed then I'll probably release it (assuming permissions).
[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] albertoduqe:
Great!!!

You are better than I am, or luckier :)... My Cosmic Oreo gets all cranky with gapps, still no idea why or how to fix... And Cardinal Oreo compiled without major issues and then flashing gave me one of those error 7 so I had to modify updater script and then it's a black-lightly-flashing-screen bootloop... Who knows :(

I hope one day I'll be able to provide decent oreo builds for this device :)