yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi Pad 5] Catmengi:
Hi everyone, does anybody know where the sound config lives in ubuntu? I will try to port debian, with @map220v kernel with some patches from @maverick_jia . Does sound config affect loudness, just i dont want to blow up my tablet's speakers or i need to change dts?. Very important question is xiaomi-nabu-firmwares.deb compamtible with @map220v kernel or it have different hierarchy? Or just i copy his github with firmwares but they arent all in it
[Xiaomi Mi Pad 5] Keyvannn:
Did anyone try to install VSCode on ubuntu? Is it a smooth experience?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I use VSCodium and it is a very nice experience!
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I essentially already answered this:

Clone https://github.com/map220v/ubuntu-xiaomi-nabu.git and have a look at nabu-Kernel_build.sh and nabu-rootfs_build.sh.

The repo comes with everything needed to build the 6.7 kernel and Ubuntu image incl. sound and firmware (the script builds respective .deb packages).

Since Ubuntu is based on Debian you can use the .deb packages also for Debian. There is not much left to do to build a Debian image instead of the Ubuntu image.
[Xiaomi Mi Pad 5] LesGaR:
Yes, this scrips work fine and can be adapt to compile jammy version. Now I have a test version in jammy lts with grub and kernel 6.1 and 6.7 but in btrfs system. If can't enable snapper rollback I recreate It ext4 filesystem. Only have one question, what do you think is best option?

mod firmware.deb to support both kernels or change in 6.1 kernel sources the firmware files location
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I assume that you like to offer the user to choose between different kernels for the same Linux image, right?

In .deb packages you can integrate pre- and post-install scripts and dependencies which should guarantee that the correct firmware is installed for the respective kernels.

Better do not mix two versions in one .deb file.
[Xiaomi Mi Pad 5] Catmengi:
Thank you for your answer. Well i only can start my work with adding charging and power delivery commits from @maverick_jia and adapting debian after 10d
[Xiaomi Mi Pad 5] Catmengi:
Sorry about to many questions before doing anything:) Does @maverick_jia 's ln8000 driver work well with standart charger? Or its working like @mal220v 's driver, which dont pass volt_qual with standart charger?
[Xiaomi Mi Pad 5] LesGaR:
Yes. For create my test image I follow this aproach:

I flashed edk2 uefi bootloader:

Now can select boot android, windows 11 or ubuntu.

I compiled both kernels 6.1 and 6.7 and install grub and grub-btrfs

In grub you can check if boot windows or ubuntu and your prerered kernel

And you can choice what version of ubuntu you prefer boot if 22.04 LTS, mantic or noble (testing).

-> This part not work at the moment. Can make snapshots, but not boot it :-( (I' don't know what isn't working) I try in my laptop (obviusly is amd64) and work very fine, but when I try to reproduce same install in Nabu not work :-( maybe issues in initrafs creation or btrfs layouts or not implemented in arch64... I try all fix can research in google, but notihg work.

Now I try in your arch image and if working, I try to port it to ubuntu (because I never use arch).
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Wow, edk2 uefi bootloader can boot Android now as well!?! Great!
[Xiaomi Mi Pad 5] LesGaR:
Yes and not mandatory erase boot_dtbo to boot linux.

You can choice android or Linux. When boot android you can choice normal boot or TWRP

Only not support secure boot, but this isn't necessary if not planed boot windows
[Xiaomi Mi Pad 5] Catmengi:
Sorry for that question, but i will ask it because i cant test it now. Can i charge my table without any fast charge at all? Because i asked @map220v about fast charge, and it didnt support anything expect PD over typec, and i dont have that kind of charger. So will it charge and work on charging without losing power(of course in high load, eg compilng something) And does typec hubs with charge will work, and does PD will work on them?(Tablet charging). If anyone can test please answer my question
[Xiaomi Mi Pad 5] TheMagicMojoMan:
If you are interested in testing out new KDE Plasma 6 then you might want to have a look at my newest Arch Linux image. See Arch Linux thread here.

BTW, glmark2-wayland result is a lot better in Arch compared to Ubuntu e.g. ~226 FPS for the 'terrain' benchmark in Arch vs. ~80 FPS in Ubuntu.

(Arch Linux results were similar high with Plasma 5.27 and Mesa 23 drivers; so it is not due to the updates to Plasma 6 and Mesa 24).
[Xiaomi Mi Pad 5] MateusL13:
Now I'm really interested in using Arch, is it easy to enable zram? It's pretty useful for nabu, I have it enabled on Ubuntu 😁

Also, does Arch have good performance results while on Gnome?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Please ask questions about Arch Linux in the Arch Linux thread. Thanks!

(You will already find the answers there in post #33 on page 2 :))
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I have installed edk2 boot-nabu.img to boot_b (Android is on boot_a) and I can boot Ubuntu Linux and Arch Linux but Android does not show up.

Do I have to install the image to boot_a or do I have to do some additional steps to make Android show up in boot menu?

I guess that is the answer to my question, right?

Source: https://renegade-project.tech/en/config/bootmenu
[Xiaomi Mi Pad 5] Catmengi:
What about gpu perfomance in @map220v and @maverick_jia 's kernels? How many fps in something kinda like glmark2? Will this perfomance be enough for games like minecraft? Or even be enough to box64/86 to run games from steam, simple one like portal and HL2(or even cs2 🤔)?

Edit: i asking this because i cant test this in next 6days :) after this 6days i will try to build a debian image and kernel from @map220v with rtc,cover detect patches.
[Xiaomi Mi Pad 5] LesGaR:
You need old version of bootloader, when I stay in home I send it.

With news secure boot uefis, sometimes when reboot, I don't know why but tablet enter in fastboot mode.

Now I fix rollback. I make a backup of my dirty install and I make a clean base image 22.04 lts and maverick in another snap with both kernels 6.1 and 6.7

To fix snaps I need add dtb manual every time.

Do you know how to enable device tree in grub? Or FTD ... I try to search in Google but not find relevant info.

In 2 days can be unlock bootloader in my new mi pad6 and not have time to "develop" for nabu and maybe sell it.

Now we can see how work in my device in attached video.

With this approach, you can use android, windows and Ubuntu in both versions Lts and Maverick. Maybe in arch too.

You can use stable version for normal use and another snapshot to develop, when you like it.

The Linux image it's minium compressed ztd=1 and only need less than 2gb.
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Here are the results of youtuber LinuxDroidMaster running glmark2 in termux/termux-x11 on Android without (llvmpipe) and with hardware accelerated graphics (zink, turnip). He uses a Legion Y700 2022 model which has slightly better hardware than our tablet:

He did several videos about setup on Android which you can watch on youtube or have a look at https://github.com/LinuxDroidMaster/Termux-Desktops

And here is the result of glmark2-wayland running on my Arch Linux image using @maverick_jia 's 6.1.10 kernel (single run): 1949

So, I guess there is a huge potential for gaming as long as you get all the stuff working in our Linux. For Android there are one-click-solutions like Mobox or Winlator which install everything that is needed (linux, box86/box64, wine, dxvk, turnip). But you still have to tweak settings to get windows games running at all or as best as possible.

Happy tinkering!
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Now that you might sell your Nabu tablet:

Can you do us all a favor and tell us how to compile / configure the uefi bootloader to be able to boot Android. If I understand correctly, it is not about configuring simpleinit.static.uefi.cfg (of https://github.com/edk2-porting/edk2-msm)

the right way but we need to use a different source, right?

Finally, we need to be able to do it on our own and inform the people here in the forum how to do it. It would be a pity if you did all the hard work but nobody could benefit from it and if we have to invest our time into solving a problem that you already solved.

In the long run we cannot rely on a compiled bootloader from you that we cannot replicate to do further development.

Just my 2 cents ...
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Ubuntu + FEX-Emu + Steam + Proton + Wine → Windows Gaming on Linux for Nabu!

More infos and install guide tomorrow (need some sleep now).
[Xiaomi Mi Pad 5] dskw:
THIS, the only reason why I'm not engaging more with Linux on the pad yet. I need a PC-less way to switch between android and Linux before I consider this good for daily use.

Please @LesGaR give us a basic tutorial how to achieve your boot setup and repro it with source on our own. We'd all be very grateful.
[Xiaomi Mi Pad 5] TheMagicMojoMan:
About Windows gaming on Linux:

Sorry but install guide has to wait. I have realized that I have too many other projects that need more work.

Please see above result as a feasibility study: Yes, it is possible to run Windows games on Ubuntu 23.10!

Now, this might encourage you to start experimenting yourself.

It would be especially interesting to use box86/box64 instead of FEX-Emu because FEX eats up more memory than my tablet physically has and it takes ages for FEX to start up Steam/Games.

---

Edit:

I just found the following on box64's github page:

When playing around with FEX (yesterday) my system became unresponsive several times and I had to reboot. I then realized that it might be a problem of RAM and I subsequently increased zram (finally) up to 6GB which did the trick. With respect to above quote it seems that Steam is the problem not necessarily FEX. Anyway, startup times might be better with box64/box86.

Instead of using zram for swap we might also use disk based swap or a combination of both. We have to experiment to find the best solution ...

I have only invested yesterday afternoon/evening in this topic (i.e. installing FEX etc. and finding out how to make it work). There are many things I do not know myself, yet.
[Xiaomi Mi Pad 5] Tryanks:
It looks like FEX is a great attempt! I spent a considerable amount of time on box86/box64 about half a month ago and was nearly successful: the Steam process ran fine. However, SteamWebHelper still failed to work. After some digging, I discovered that box64 wasn't running properly on this device and would almost crash everything submitted to it by bin-fmt (interestingly, Docker also failed to run. After using wget -O install-docker.sh get.docker.com, the systemd process related to Docker kept crashing).

# Adding armhf architecture
sudo dpkg --add-architecture armhf
sudo apt update

# Steam dependencies (not available through the package manager)
wget http://ftp.debian.org/debian/pool/main/libi/libindicator/libindicator7_0.5.0-4_armhf.deb
wget http://ftp.debian.org/debian/pool/main/liba/libappindicator/libappindicator1_0.4.92-7_armhf.deb
sudo apt install ./lib* -y

# Solving libpng dependency (linking the latest version to the old version required by Steam)
sudo ln -s /usr/lib/arm-linux-gnueabihf/libpng16.so.16 /usr/lib/arm-linux-gnueabihf/libpng12.so.0

I hope this helps anyone facing similar challenges and perhaps could provide a nudge over the hurdle I'm currently stuck on.

EDIT: (Though it may be off-topic for this thread, and for that I apologize) I've noticed that you've recently released the latest Arch Linux rootfs, and I'm planning to migrate to it for another attempt at box86/64. Once I succeed, I'll be able to sum up my experiences and come back to Ubuntu. I will give it a try within this week.

EDIT2: Try configure box86/64 is not a good idea in arch linux :(

But I can try use bootstrap and chroot. I hope see you in this weekend...maybe next week? :'(
[Xiaomi Mi Pad 5] Catmengi:
@maverick_jia do you have any ideas why dsi suspend doesnt work properly on kernels starting from 6.2? @map220v said that this may be related to devlink, i even emailed greg kroah-hartman. @maverick_jia or anyone else do you have any ideas why this is happening?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I just wanted to say that I really appreciate the enthusiasm with which you approach this problem and that you are not even afraid to ask @map220v and Greg Kroah-Hartman for help! (y)
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Thanks for your reply and effort!

I really hope that you will succeed this time and I am looking forward to hearing from your 'journey into the deepest depths of the box'. Feels so good to be not alone working on a topic that might interest a lot of people here.
[Xiaomi Mi Pad 5] LesGaR:
I take some notes about how to install Ubuntu in uefi mode, not a full guide only adapt @map220v guide to enable uefi and recompiled latests kernels from @map220v and @maverick_jia.

Can I post here or can I update full image to test.

I don't know it's better some of us try in private and check if all working fine or post directly.

I test from 3 days and not have any problems

I have 2 images 6gb uncompressed with uefi:

Original image only with Ubuntu 22.04

Latest image with snapshots 22.04, 23.10 and 24.04.

In both images can choice boot android, Ubuntu or windows (if you installed previously) and kernels 6.1 and 6.7.

Kernel 6.7 not work suspend and resume and have issues in usf (only when use btrfs in intensive mode).
[Xiaomi Mi Pad 5] LesGaR:
I ask with map220v few months ago, but I'm not a kernel guy. I see this paches:

[1/3] dt-bindings: clock: qcom: Update SM8150 videocc bindings - Patchwork

Last month I apply this patch to kernel 6.7 and nabu can suspend and resume working, but USB, touchscreen and sound was broken.

[PATCH V2 0/4] Add runtime PM support for videocc on SM8150

Can I try it again, but I need some help how to apply this patches. I'm not a kernel guy, and this it's to technical for me
[Xiaomi Mi Pad 5] Catmengi:
When i come back to home(6days) i will check this patches, they are wery interesting🤔 :)
[Xiaomi Mi Pad 5] Catmengi:
Which au

Which author's kernel did you use? Mainline not patched or @map220v 's kernel?
[Xiaomi Mi Pad 5] LesGaR:
Map220v kernel.

Do you think is better try with mainline?

I have the old patches for apply in mainline

I only need few guidance to start in good way
[Xiaomi Mi Pad 5] Catmengi:
Mainline without patches probably will not work at all :) So now @maverick_jia kernel is the best variant, if you want newer kernel but broken screen suspend is not critical for you(it will crash kernel) choose sm8150-mainline from @map220v.
[Xiaomi Mi Pad 5] LesGaR:
I was used mainline kernel with some patches for Elish.

You can found here

build/patch/kernel/archive/sm8250-6.7 at main · armbian/build

Armbian Linux build framework generates custom Debian or Ubuntu image for x86, aarch64, riscv64 & armhf - armbian/build

github.com

And dts provided by @map220v

Can I fork mainline kernel, try to apply this patches and make some builds until you have time to check the sources.

If not use heavy ufs, map220v kernel work fine, but when I use intensively have some issues (for example when balance my btrfs filesystem)

But I don't know is my fault or it's a problem with kernel. If you check in this patch how map220v fix it.

clk: qcom: clk-regmap: Add udelay in clk_enable_regmap and clk_disabl… · map220v/sm8150-mainline@5eb4832

…e_regmap Attempt to fix 'clock stuck in off/on state' errors, should fix broken UFS on boot and broken DSI on suspend/resume.

github.com

If you can time in 6 days to check it. We can ask with map220v. But I don't have enough knowledge to understand it, and I don't like waste yours time with my noob questions.
[Xiaomi Mi Pad 5] Catmengi:
First i cant check the kernel builds and sources now, second i am kinda noob too, i dont have much knowledge about internals of Linux kernel. What about udelay, it only "fixes" ufs boot crash. I didnt know before, that elish kernel can work fine with nabu, does suspend then wakeup worked there? Which linux version is this kernel?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Windows gaming on Linux (currently only Ubuntu)

HOWTO on installing FEX-Emu/running Windows games is up here. Accompanying discussion thread is here.
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I have used my build of 6.7 kernel from mid January for quite a while and had the same issue. System sometimes gets unresponsive/crashes under heavy load e.g. compiling bigger source code packages.

That (and lack of sleep mode) is why I never published a kernel update for my Linux images, yet. 6.1.10 is still better.
[Xiaomi Mi Pad 5] Catmengi:
Hello, i got experimetal kernel build with UFS clock fix from upstream kernel, it should NOT crash on boot because of UFS(its a different patch), if someone can test it i will be pleasured. Its kernel for grub2. Have .img extension because of dumb xda file extension rule. Please give me screenshot of your results. It moslty crash, unless you have modules for 6.7. @map220v helped me alot
[Xiaomi Mi Pad 5] LesGaR:
Yesterday I test it, but not work for me.

I tested in my build, @TheMagicMojoMan (Ubuntu-V0.91) and @map220v buid.

Your kernel boot, but black screen, maybe firmware files issues?

What image are you use?
[Xiaomi Mi Pad 5] LesGaR:
I recompile bootloader and now you can select android or Linux-windows.

To keep near yours approaches I compiled like @maverick_jia posted here:

[ROM]Ubuntu on Xiaomi Pad 5 (nabu)

[UPDATE 1 Jan 2024] fast charge supported wakup and sleep works [UPDATE 22 Nov 2023] We finally updated this image！And this time not I but we. Yes, I have companies! Thank you to everyone who answers questions and even uploads images in this...

xdaforums.com

Only update to @map220v latest DSDT.aml ( I think isn't relevant here, only for windows)

sm8150: Nabu: Update ACPI · woa-msmnile/msmnilePkg@48e559c

Added Xiaomi Keyboard support Added Hall Sensor Other important fixes

github.com

ToDo:

Update dts, I don't now if the best option put dtb for kernel 6.1 (I think all it's working except mic ) or wait until can @Catmengi try to fix 6.7.

I tested in my nabu and work fine, please make BACKUPS before test and please comment if working or not.

IMPORTANT:

NOT FLASH boot-nabu.img

Use fastboot boot boot-nabu.img if you like test if reboot android option it's avaliable in your device.

If you like flash it, please reboot in recovery and SIDELOAD it.

adb sideload uefi-installer-nabu.zip

Zip Installer create a backup of your original bootimage, please store it in a safe place :)

Tested:

In my device with modded partition scheme -> Work

Stock scheme -> Work

Before share it with yours I was full flash (revert partition scheme to stock) and flash latest fastboot image (nabu_eea_global_images_V14.0.9.0.TKXEUXM_20240116.0000.00_13.0_eea_987fb84b9d.tgz) and BOOT with

boot-nabu.img and Reboot to android persist.

If you like put nabu in Usb Storage, to repartition and add uefi and linux partitons:

UEFI Boot Menu -> USB Attached SCSI (UAS) Storage.

If you are in Linux open partitionmanager and can be backup and flash images to Nabu.

IMPORTANT:

Double check if all partitions are UNMOUNTED before reset nabu.

I only have nabu with CSOT pannel, If any have Tianma pannel, please check if working screen.
[Xiaomi Mi Pad 5] Catmengi:
I with @map220v discovered that 6.8 should fix suspend. Waiting your for compile it and test. PLS post screenshots of boot!!!!

GitHub - map220v/sm8150-mainline: WIP Mainline kernel for Xiaomi Pad 5

WIP Mainline kernel for Xiaomi Pad 5. Contribute to map220v/sm8150-mainline development by creating an account on GitHub.

github.com

also you can use his ubuntu build script

GitHub - map220v/ubuntu-xiaomi-nabu

Contribute to map220v/ubuntu-xiaomi-nabu development by creating an account on GitHub.

github.com
[Xiaomi Mi Pad 5] LesGaR:
Ok. Now I have my nabu full stock I try to reparted without lose android data.

If kernel 6.8 work, bootloader can be boot in android, snapsots working (to have dev snap and production snap) only need a method to repartition flash without lose android data.

What do you thing?
[Xiaomi Mi Pad 5] Catmengi:
Parted can shrink partitions but i dunno will work this for android or not
[Xiaomi Mi Pad 5] Catmengi:
Did you try new kernel? Is it booting?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Thank you so much for posting your boot image!

Unfortunately, it does not work for me :( Here are my test results:

With edk2 bootloader that I have compiled (based on current github version):

Android boot entry is NOT shown

Arch Linux boots fine

Ubuntu boots fine

With edk2 2301 bootloader (downloaded .img / not compiled by me):

Android boot entry is NOT shown

Arch Linux boots but after kernel is loaded I only get a black screen

Ubuntu boots fine

With your bootloader (same behavior if flashed to boot_a, boot_b, both boot_a and boot_b or using fastboot flash boot boot-nabu.img):

Android boot entry is shown!

But it does not start Android, only reboots to bootloader.

Arch Linux boots but after kernel is loaded I only get a black screen

Ubuntu boots fine

Did you also test if Android boot entry worked before doing full flash of your tablet and reverting partition scheme to stock?

Did you compile 2310 version of edk2 boot loader? I ran into an error when I tried.
[Xiaomi Mi Pad 5] LesGaR:
I compiled same version @maverick_jia posted.

When you sideload it, you recover you dtbo partition? If dtbo are erased, you can't boot android.

Please NOT FLASH boot.img never works.

fastboot boot boot-nabu.img

If you like keep MIui recovery, or not like flash Twrp or Ofox, can you put your nabu in fastboot mode and BOOT Twrp/Ofox image:

fastboot BOOT Twrp-3.7.0_12-4-nabu.img -> Advanced -> ADB sideload and:

adb sideload uefi-installer-nabu.zip

You can keep your Miui recovery (and the rest of Miui partitions) in stock and repartion to ubuntu/windows

I used latest Twrp build by @Siddk to test it

https://sourceforge.net/projects/xiaomi-pad-5/files/TWRP/TWRP-3.7.0_12-4-nabu.img/download

Are you using arch v15?
[Xiaomi Mi Pad 5] LesGaR:
With your image have this issues.

With map220v 6.8 black screen
[Xiaomi Mi Pad 5] LesGaR:
Where are located 2310 version? If i found I try compile it
[Xiaomi Mi Pad 5] LesGaR:
Not for me. What uefi bootloader are you using? Can I test with same bootloader maybe my bootloader it's old :-(
[Xiaomi Mi Pad 5] Catmengi:
Well i didn't test it because of locked bootloader in table on 23march i can test it, but i will use android boot.img. Did you add devicetree in grub? Can you recompile bootloader with 6.8 device tree?
[Xiaomi Mi Pad 5] Catmengi:
First thing, did you install 6.8 modules? Second, if screen is black, can you ssh in? Third its possible bad bootloader, @TheMagicMojoMan said that he had same issue with arch linux and your boot
[Xiaomi Mi Pad 5] Catmengi:
@TheMagicMojoMan can you test new kernel? If blackscreen try to revert commit with name like this: "..... removed framebuffer ....." Script for ubuntu building is updated for 6.8. also you probably need to update your bootloader, rebuild it with new dtb
[Xiaomi Mi Pad 5] Catmengi:
Experimental fastboot kernel 6.8! Should boot from /dev/sda34 or Ubuntu partition. Pls post screenshots of your boot. Test it with fastboot boot
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Kernel 6.8 updates and images

If you have a github account and are logged in you can now download update packages and Ubuntu images directly from @map220v 's github page.

Head over to https://github.com/map220v/ubuntu-xiaomi-nabu, read the instructions and then click on the 'Actions' tab and 'Update kernel to v6.8.0'.

Use @LesGaR 's uefi boot loader he posted in post #426 or try @Catmengi 's fastboot loader he posted in #439.

Please report back if it is working. Thanks!

(I did not have time to test myself, yet).
[Xiaomi Mi Pad 5] Catmengi:
Fastboot is possible not working. I dont tested it because of tablet's locked bootloader. Please test my fastboot images and kernel when you will have enough time!!!