Device Request: Xiaomi Pocophone F1
I'm aware there have been attempts already:
- #560
- #672
Maybe this issue can be used to coordinate a bit, as I only recently learned about mobile nixos and I'm excited to use my Pocophone F1 with mainline Linux.
What I've tried so far:
OK: flashing examples/hello on the latest commit using kernel 6.4.0 boots up to stage 2 and hello-gui can be used via touch.
OK: Updated the firmware to the latest I could find on gitlab. Newer than #672.
NOT OK: Updated to kernel 6.11.0.
It boots to stage (hello-gui) and I can see that's running kernel 6.11 using the vol-up, vol-down pwr button.
It appears that the i2c NOVATEK nt36xxx_ts driver has been dropped between kernel 6.4.0 and kernel 6.11.0
I need help with this because based on the sdm845-xiaomi-beryllium-tianma.dts the nt36672a driver should be compatible. That's also what's enabled in the kernel config: CONFIG_DRM_PANEL_NOVATEK_NT36672A=y
Nice to see yet another person interested in NixOS on beryllium. I had issues with kernels above 6.4 too. Iirc a little bit higher worked for me with some ceveats but it has been a bit... I tried before issue 747 was created. (Well, for one app I need mic and headphones I need for several. On postmarketOS that has a newer kernel there just weren't issues so I was hoping the mentioned issues there would be gone on NixOS as well.)
In the meantime I put Android back on the device; only with postmarketOS on microSD card and I kinda was just sitting things a bit out. (There are also some uboot developments for SDM845 which might be nice to have but no idea how straight-forward installing Mobile NixOS is there then) but well... Also for quite a bit of time I just did not have the storage to backup some data (was also sitting it out until good 4 TB SSDs become cheaper again...) but I do have a bit of storage on HDD and on microSDs now so I could potentially backup stuff before messing with Mobile NixOS again (and I also have storage to build it again, heh). Will just take a bit (~few weeks?) cause I will also have to deal with requesting new auth codes for a different device for some companies (and I would use Waydroid in the postmarketOS installation for that; also need to confirm those apps work there.)
Well, I just added you as a collaborator at mobile-nixos-beryllium; I think that's enough to prevent having to create yet another PR (in case I'm a bit more away) for beryllium-specific commits.
It seems xiaomi-beryllium now has to use the nvt-ts driver that is in a different area of the Kernel config.
CONFIG_TOUCHSCREEN_NOVATEK_NVT_TS=y is what is needed to get touch input on linux 6.11.0 using sdm845-mainline.
relevant dmesg from Linux nixos 6.11.0 #1-mobile-nixos SMP Tue Jan 1 00:00:00 UTC 1980 aarch64 GNU/Linux
[ 0.750795] input: nvt-ts as /devices/platform/soc@0/ac0000.geniqup/a98000.i2c/i2c-14/14-0001/input/input3
Now the examples/hello has a working stage2 with touch screen.
I'm now up to that I have ssh working and wanted to transition into building phosh on the device itself, as I've read in a different issue here. I tried cross-compiling it but that didn't work at some point. (Not due to instantiate eval, I upped zRAM to 70GB and it went through.)
Is there some documentation to transition from running nix-build examples/hello --argstr device xiaomi-beryllium -A outputs.android-fastboot-images and building it outside the device (which is cumbersome) to using a regular configuration.nix on the device itself?
https://gist.github.com/schrmh/01c0271bed160033489d7389f1101025#file-project-structure-md That's what I wrote down — also mentioned in my PR. I initially built phosh on a Pi (since I had issues with cross-compiling as well) but well, if you got SSH and you can use nix on the device then it should work to just continue at "On phone:" ig...
Yes, thank you. I found that and got Phosh with Kernel 6.11 built. There are a lot of sensor crash messages in dmesg and something related to not being able to start a fb0 device with the xserver. So phosh (phoc) doesn't start up and it stays at a virtual terminal.
Because the LVGUI Ruby hello-gui works it can't be something generic framebuffer thing and it's also not an obvious permission issue, so I abandoned Kernel 6.11 for now. I will try to first reproduce being able to start phosh on 6.4.0 and if that is confirmed to work, I will try Kernel 6.13-dev and hope for the best.
If all my attempts fail, I can either learn LVGUI for my purpose or use it as a cheap aarch64 server. For the latter purpose I could enable zRAM with lz4 at 300% working. I haven't tried the device under memory pressure how it performs, but in general it activated fine.
I will keep a log for anyone interested and will write up my transitioning bit based on your notes in the gist.
Regarding 6.4 I'm pretty sure phosh worked for me when built on the device as well; would have likely noted it down if that wasn't the case. One of the reason I choose plasma in the config (and then stuck with that in a more extensive, private config I keep on codeberg) was that phosh was just... not running that well for me in general (and the more promising gnome mobile sadly run even worse. Imo sxmo is the best interface, especially cause it's the only one that supports multiple windows afaik, at least when ignoring some interfaces that don't really adjust for mobile device screens but getting sxmo to work with the nix ecosystem is not trivial — there are also some messages regarding that in the Matrix room — and I never got it to work myself). Also that way people get to try out the two major options when they follow the gist.