Jump to content

Xiaomi POCO F1 (xiaomi-beryllium)

From postmarketOS Wiki
Note This page is about the dedicated port of this device. There is also an optional generic port available for this device - see Qualcomm SDM845 (qualcomm-sdm845).
Xiaomi Pocophone F1
POCO F1
File:Pocof1.jpg
Manufacturer Xiaomi
Name Pocophone F1
POCO F1
Codename xiaomi-beryllium
Released 2018
Type handset
Hardware
Chipset Qualcomm Snapdragon 845 (SDM845)
Display 1080x2246 (IPS LCD, 60 Hz, 6.18")
Storage 64/128/256 GB (UFS 2.1)
Memory 6/8 GB (LPDDR4X)
Architecture aarch64
Software
Original software
The software and version the device was shipped with.
Android (MIUI) 8.1 (MIUI 9.6) (Linux 4.9)
Extended version
The most recent supported version from the manufacturer.
Android (MIUI) 10 (MIUI 12)
postmarketOS
Category community
Pre-built images
Whether pre-built images are available from the postmarketOS Installation page.
yes
Mainline
Instead of a Linux kernel fork, it is possible to run (Close to) Mainline.
yes
Unixbench score
Unixbench Whetstone/Dhrystone score. See Unixbench.
6565.9
Optional Generic Port Qualcomm SDM845 (qualcomm-sdm845)
Device package device-xiaomi-beryllium
Kernel package linux-postmarketos-qcom-sdm845
Firmware package firmware-xiaomi-beryllium
Features
Flashing
Whether it is possible to flash the device with pmbootstrap flasher.
Works
USB Networking
After connecting the device with USB to your PC, you can connect to it via telnet (initramfs) or SSH (booted system).
Works
Internal storage
eMMC, SD cards, UFS...
Works
SD card
Also includes other external storage cards.
Works
Battery
Whether charging and battery level reporting work.
Partial
Screen
Whether the display works; ideally with sleep mode and brightness control.
Partial
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Audio playback, microphone, headset and buttons.
Works
Camera
Partial
Camera Flash
Works
IR TX
Untested
Connectivity
WiFi
Partial
Bluetooth
Works
GPS
Works
Modem
Calls
Partial
SMS
Partial
Mobile data
Partial
Miscellaneous
FDE
Full disk encryption and unlocking with unl0kr.
Works
USB OTG
USB On-The-Go or USB-C Role switching.
Broken
Fingerprint
Fingerprint reader.
Broken
Sensors
Accelerometer
Handles automatic screen rotation in many interfaces.
Works
Magnetometer
Sensor to measure the Earth's magnetism
Works
Ambient Light
Measures the light level; used for automatic screen dimming in many interfaces.
Works
Proximity
Works

How to enter flash mode

Press Power + Volume Down to enter the bootloader.

Know your touchscreen variant

There are two variants of the Xiaomi Pocophone F1/POCO F1 with different touchscreens:

Touchscreens
Panel Controller Cmdline
EBBG FocalTech FT8719 dsi_ebbg_fhd_ft8719_video_display
Tianma Novatek NT36672A dsi_tianma_fhd_nt36672a_video_display

To know your panel variant, get into a terminal with root access (you can use TWRP recovery's terminal as it has root access or rooted android ROM)

  1. Run su to make sure you have root access.
  2. Run cat /proc/cmdline. Output would be similar to:
    rcupdate.rcu_expedited=1 console=tty0 earlycon=msm_geni_serial,0xA84000 androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048 androidboot.configfs=true loop.max_part=7 androidboot.usbcontroller=a600000.dwc3 root=/dev/dm-0 dm="system none ro,0 1 android-verity /dev/sde48" androidboot.verifiedbootstate=orange androidboot.keymaster=1  androidboot.veritymode=enforcing androidboot.bootdevice=1d84000.ufshc androidboot.serialno=b79782d2 androidboot.baseband=sdm msm_drm.dsi_display0=dsi_tianma_fhd_nt36672a_video_display: androidboot.ramdump=disable androidboot.secureboot=1 androidboot.dp=0x0 androidboot.cpuid=0x205772eb androidboot.hwversion=4.19.0 androidboot.hwc=INDIA androidboot.cert=M1805E10A androidboot.hwlevel=MP
    
  3. Note the value of msm_drm.dsi_display0. In the example above, it's dsi_tianma_fhd_nt36672a_video_display, i.e Tianma panel variant. For EBBG panel variant, it would be dsi_ebbg_fhd_ft8719_video_display.

During pmbootstrap init, select the kernel variant by choosing either tianma or ebbg based on the output from above.

Installation

In order to install postmarketOS, the bootloader must be unlocked. Unlocking is done by following the official process provided by Xiaomi (read the FAQ for detailed instructions).

It is possible to either use a pre-built image as explained in the Installation article, or to use pmbootstrap to build your own image. It's highly recommended to update your bootloader; see below for more details.

  1. Run pmbootstrap init and select xiaomi as vendor and beryllium as device.
  2. Select the kernel variant based on the panel noted from #Know your panel variant.
  3. Follow the on-screen instructions and configure accordingly.
  4. Build the system with pmbootstrap install. Add --fde if you need full disk encryption (FDE); or --filesystem f2fs for an eMMC-friendly filesystem.
  5. Flash the kernel and rootfs:
$ pmbootstrap flasher flash_kernel
$ pmbootstrap flasher flash_rootfs --partition userdata
$ fastboot reboot
Warning WARNING: Do not reboot via the power button! This can result in corruption if data hasn't finished writing to internal storage. This often results in failing to boot and getting stuck on the postmarketOS logo.
Note Always use fastboot reboot after flashing.

Installation to SD card

You can take advantage of Poco F1's SD card slot to install postmarketOS for testing. To install to the SD card, run

$ pmbootstrap install --sdcard=/dev/mmcblk0

To boot from SD, with the device in fastboot mode (with device off, press Power + Volume Down until it enters fastboot mode), run

$ pmbootstrap flasher boot

This uses pmbootstrap from your computer to boot postmarketOS from the SD card without disturbing your bootloader or your system.

Installation using a prebuilt image (fastboot)

Download the -boot.img.xz and the main system's .img.xz (see above about picking the appropriate variant), then run the following commands (using the image filename at the time of writing as an example):

$ unxz -v 20230212-1217-postmarketOS-v22.12-plasma-mobile-3.9-xiaomi-beryllium-ebbg-boot.img.xz
$ fastboot flash boot 20230212-1217-postmarketOS-v22.12-plasma-mobile-3.9-xiaomi-beryllium-ebbg-boot.img
$ unxz -v 20230212-1217-postmarketOS-v22.12-plasma-mobile-3.9-xiaomi-beryllium-ebbg.img.xz
$ fastboot flash userdata 20230212-1217-postmarketOS-v22.12-plasma-mobile-3.9-xiaomi-beryllium-ebbg.img
$ fastboot reboot

Read the official pmbootstrap documentation for more info.

Updating the bootloader

This involves downloading MIUI and extracting bootloader images to flash. Refer to the LineageOS wiki for more info.

Mainline status

Warning WARNING:

Under recent Linux kernels (e.g. 7.1.0-rc1-sdm845), for about 80% of all boots, the boot hangs, which requires yet another reboot attempt. The suggested workaround makes screen init work only in some boots.

Sometimes it boots, but the modem isn't detected and Wi-Fi does not show up, requiring another reboot.

Display

The display is a MSM DRM based panel. The Tianma variant is already in mainline Linux.

The EBBG panel variant is available in the kernel fork and works, but it is not upstreamed yet.

If you're running Phosh and have no camera notch in the top panel (clock invisible), create a file ~/.phoshdebug with this content:

GMOBILE_DT_COMPATIBLES=xiaomi,beryllium
export GMOBILE_DT_COMPATIBLES

(#3458)

Then restart Phosh: sudo systemctl restart greetd or sudo service greetd restart on OpenRC

Brightness can be adjusted. The PMI8998 QCOM WLED driver from mainline is used for brightness adjustment.

Note If you are on Sxmo, with Tianma variant rename /usr/bin/sxmo_deviceprofile_xiaomi,beryllium.sh to /usr/bin/sxmo_deviceprofile_xiaomi,beryllium-tianma.sh to get correct display and scaling support.

Touchscreen

For the Tianma variant, there are patches available for the NT36XXX touchscreen over here: https://lwn.net/ml/linux-kernel/20201028221302.66583-1-kholk11@gmail.com/ It hasn't been accepted yet, but works with some fixes and it's included in the fork.

For the EBBG variant, Venji10 has written a downstream-based driver for the Focaltech touchscreen.

3D GPU Acceleration

Since the panels are MSM DRM based, 3D acceleration works using the mainline Freedreno driver. However, Firefox still has problems with hardware acceleration/GPU support.

Wi-Fi

The whole modem goes offline at irregular intervals (minutes to weeks after a fresh boot). One or more reboots are required to get the modem working again.
See #3486.

If you have issues connecting to Wi-Fi, check in dmesg for the following lines:

[  302.291007] wlan0: authenticate with c0:06:c3:b6:d0:f6
[  302.291066] wlan0: bad VHT capabilities, disabling VHT
[  302.291070] wlan0: 80 MHz not supported, disabling VHT

If they appear, the Wi-Fi width must be changed from 80 MHz to 20 MHz in the router's settings. This issue occurs when the regulatory region is selected as CN (China): read this article to change the region, making sure the extra packages iw,wireless-regdb were added during pmbootstrap init. Despite the errors, the device may still connect to the Wi-Fi after a few retries.

On routers which automatically select between 2.4 GHz and 5 GHz, Internet connection may be lost as soon as it switches to 5 GHz. The workaround is to check if both frequency bands are available with

$ nmcli -f in-use,ssid,freq,bssid dev wifi

and then set:

$ nmcli connection modify '$sssid' 802-11-wireless.band bg

where bg may also be gn or bgn.

Bluetooth

Works.

Audio

All audio devices work except for the top microphone. On some devices, headphone detection may not work. To mitigate this, plug the headphones in and reboot.

The userspace ALSA UCM confs are available in the SDM845 mainline repo.

Support for headphones and the phone internal microphone has been upstreamed, while the TAS2559 driver requires a rewrite and is only in the fork.

PipeWire has some serious issues with sound, you'll encounter the following issues:

  • Calls not working;
  • No microphone input;
  • Very low volume;
  • Distortion;
  • Softlocks. (rare)

For reliable audio, especially calls, switch from PipeWire to PulseAudio (don't mess with the configurations in pavucontrol before you do the switch!):

Note This section here might be outdated. As of 1 September 2025, PulseAudio is broken and only PipeWire works.
# apk add sxmo-utils-audio-pulseaudio
# apk del sxmo-utils-audio-pipewire
# apk del postmarketos-base-ui-audio-pipewire
# apk del pipewire

You may need to forcibly remove wireplumber on existing installations of postmarketOS edge:

# apk del --force-broken-world wireplumber
# apk del --force-broken-world pipewire
# apk upgrade -a

For more details, check this issue.

Battery

Casey and Joel wrote a pmi8998-charger driver with basic functionalities such as charge percentage, temperature, USB plug in and out detection; however, the driver requires a rework to make it generic and stable. It lacks on several issues, including no fast charging support and sometimes reports charging when it's not.

OTG

It would also be needed to enable USB OTG feature.

Casey started an approach with a USB-C driver and a new charging driver, see here. Sam figured out that this already works quite promising after disabling

usr/lib/NetworkManager/dispatcher.d/50-tethering.sh
usr/lib/NetworkManager/conf.d/50-tethering.conf

GPS

GPS works as expected and can be used for navigation! Carefully read Troubleshooting:GPS for more details on how to activate the GPS using ModemManager's CLI, enabling Geoclue and also on how to use GPS without a SIM card.

Warning WARNING: To use and test GPS functions, make sure a SIM card is inserted (if mmcli lower than v1.23.4), GPS is enabled in mmcli, geoclue is executed. Disable suspend, go outside for 15 minutes and wait until you get acfix.

Camera

With the latest 6.11 kernel and Phosh, the camera works out of the box!

For Sxmo, set a rule in

# touch /etc/udev/rules.d/90-camera.rules

containing

KERNEL=="udmabuf",GROUP="video",MODE="0660"

Grant access to the device:

# chmod 777 /dev/udmabuf
# chmod 777 /dev/urandom # not sure about this

After reboot, snapshot is working!

To get megapixels1.x working, we need this config file copied to /usr/share/megapixels/config/xiaomi,beryllium.ini For megapixels2.x, we need this config file, copied to the directory mentioned above, or, when self compiled, to /usr/local/share/megapixels/config/xiaomi,beryllium.conf.

Make sure to manually lower the shutter and iso values in megapixels. To dramatically increase image quality, install gmic (available on edge, not v24.12) and copy these postprocessing scripts to /usr/share/megapixels/postprocessor.d/. The postprocess_auto.sh is good for general color correction. Select it before hitting the shutter.

The Camera register configurations can be observed by enabling CAMSS debug in downstream android kernel and noting the logs for lines similar to

CAM-CCI: cam_cci_data_queue: 741: cmd_size 24 addr 0x136 data 0x18

The Poco F1 Camera Configuration noted so far:

GPIO Line Pin Regulator
Common config
CAM_IOVDD_EN tlmm, gpio50 S4A @ 1.8V
CAM_IOVDD_EN tlmm, gpio99
Front Cam 1 - Samsung S5K3T1 (20 MP)
CAM_F1_RSTN tlmm, gpio104
FRONT_CAM1_AVDD_EN tlmm, gpio29 BOB @ 2.8V
FRONT_CAM1_DVDD_EN pmi8998, gpio9 S3A @ 1.35V
Rear Cam 1 - Sony IMX363 (12 MP), I2C address 0x10
CAM_R1_RSTN tlmm, gpio80
REAR_CAM1_AVDD_EN tlmm, gpio40 BOB @ 2.8V
REAR_CAM1_DVDD_EN pmi8998, gpio11 S3A @ 1.35V
Front Cam 2 - OV7251 ??
CAM_F2_RSTN tlmm, gpio25
FRONT_CAM2_AVDD_EN tlmm, gpio91
FRONT_CAM2_DVDD_EN tlmm, gpio7
Rear Cam 2 - Samsung S5K5E8 (5 MP)
CAM_R2_RSTN tlmm, gpio28
REAR_CAM2_AVDD_EN tlmm, gpio79
REAR_CAM2_DVDD_EN tlmm, gpio92

Sensors

SDM845 devices use the SLPI for sensor connectivity. Initial support was added in pmaports!4050.

The following packages are required on the user-side to enable sensors:

  • hexagonrcpd
  • libssc
  • iio-sensor-proxy

See also pmaports!5099.

Setting polkit to access without root:

Copy this to /etc/polkit-1/rules.d/01-sensor-claim.rules

Proximity Sensor

Works after installing iio-sensor-proxy.

To test it, run:

$ monitor-sensor --proximity

To get it working for calls in sxmo, you might need a custom script.

LEDs

Torch and status led are accessible via kernel modules, e.g. enabling the status LED next to the USB port:

$ echo 255 > /sys/class/leds/white:status/brightness

Fingerprint

Read this.

Get a working driver here.

Vibrator

Works.

SD card

The SD card slot works and you can mount and use SD cards.

There might be SIM issues, see the Dual SIM section below.

Mobile data, calls and SMS

Calls and SMS work fine (until they don't anymore; see the Wi-Fi section above), but as there is no convenient way to enter a SIM PIN, you should remove the PIN from your SIM card when inserted in some Android phone.

Mobile data can be tricky. If mobile data does not work (an orange exclamation mark over the cellular icon might indicate this), make sure that you obey the following order:

  • Disable "Mobile Network" and enable Wi-Fi (unclear: Is Internet access needed?).
  • Turn on "Mobile Network" and "Mobile Data", enter your APN when asked and not appearing automatically.

Dual SIM

Although there is no dual SIM support yet, the second SIM slot can be activated as the primary SIM slot, which is necessary if we want to use the SD card. If you don't switch to the second SIM slot but have the SIM card in the second slot, you will not be able to unlock the SIM using its PIN code. If you can't unlock your SIM, check if the SIM is physically in the right slot that the modem thinks it should be.

Get the Application ID (AID) of the SIM:

# qmicli -d qrtr://0 --uim-get-card-status

Switch the SIM slot:

# qmicli -d qrtr://0 --uim-switch-slot=2

Provision the SIM slot:

# qmicli -d qrtr://0 --uim-change-provisioning-session="slot=1,activate=yes,session-type=primary-gw-provisioning,aid=[AID from previous step]"

In case you receive errors in the last step, reboot the phone and try the last step again.

Mobile data problems

libqmi has support for QRTR+IPA based modems for quite some time, as seen in the repo: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests?scope=all&search=qrtr&state=merged

ModemManager which uses libqmi to control the modem has added support for QRTR recently: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/470

Inspite of all this, some Poco F1 users have mobile data connection issues on some mobile networks. During mobile data connection, it fails with the following errors:

[2441]: <info>  [024233428.438170] [modem0/bearer1] couldn't start network: QMI protocol error (14): 'CallFailed'
[2441]: <info>  [024233428.438253] [modem0/bearer1] call end reason (3): generic-no-service

Once reported about it over here: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/235#note_893224. Still have to properly submit a bug report on this.

You can see an overview of what the modem manager sees as follows:

# mmcli -m 0 # Warning: output includes personal data
# mmcli -m 0 | grep -v -e imei -e Numbers -e equipment # excludes some personal data

Change kernel parameters

  1. sudo vim /etc/deviceinfo
  2. Change cmdline parameters to desired state
  3. sudo apk fix linux-postmarketos-qcom-sdm845

See also

External links

Community Info

Maintainers

Users owning this device

  • Abishek (Notes: daily driver running phosh)
  • Aelin (Notes: EBBG panel, pretty much unused mostly because USB is buggy)
  • Anjanmomi (Notes: daily driver running Sxmo)
  • Antonroots (Notes: SXMO dev)
  • Ash
  • AskorbinovayaKislota (Notes: ebbg, 6/64, unused, PostmarketOS)
  • Baonks81 (Notes: 6GB/128GB)
  • Brittle
  • CalcProgrammer1
  • Clamor (Notes: Tianma panel model)
  • Dferrg
  • Entrider (Notes: Running LineageOS. Daily driver.)
  • FerassElHafidi (Notes: Runs Sxmo, also see User:FerassElHafidi/Dogfooding:Pocophone_F1)
  • Fraolt (Notes: Daily driver User:Fraolt/Dogfooding:Pocophone_F1)
  • Hilledkinged (Notes: EBBG display type)
  • Hotonics (Notes: problems unlocking bootloader)
  • Illen (Notes: 6/64 GB. Runs LineageOS)
  • Iourine (Notes: with LineageOS)
  • Joel (Notes: Tianma-Panel)
  • Kotik (Notes: Tianma panel, 6/64. Running LineageOS 22, Android 15.)
  • KuroeHanako (Notes: 64GB, Tianma Panel)
  • Libertus
  • Link4Electronics (Notes: tianma, enjoying pmOS v25.12 plasma-mobile)
  • Linmob (Notes: Mobian (Phosh))
  • Lokenk (Notes: Android, daily driver 2 versions 128 and 64)
  • LongnoseRob (Notes: pmOS (edge), UI: phosh)
  • Lupo (Notes: 6/128GB, pmOS ebbg display)
  • NekoCWD (Notes: 6/64GB, EBBG, broken mobile antenna, postmarketOS lab rat)
  • Nima
  • PiotrZPL (Notes: Running AwakenOS and Ubuntu Touch as a secondary device.)
  • Powwu (Notes: Co-daily driver on Phosh)
  • R00t (Notes: begging xiaomi for unlock)
  • Retourmy (Notes: Tianma panel version, LineageOS, still in my backpack, just in case)
  • Retr0 (Notes: Hard bricked, dead battery)
  • Ridge (Notes: Testing pmOS with Plasma)
  • Roboe (Notes: (second hand) daily driver; 128GB, Tianma panel; running Lineage OS)
  • Rontti (Notes: notes on daily driving phosh on user page)
  • R
  • Schrmh (Notes: Runs Mobile NixOS)
  • SergDS
  • Seshpenguin
  • Shubhamvis98 (Notes: Running Kali NHPro)
  • Sohrabbehdani (Notes: EBBG panel, running Phosh)
  • Sulu (Notes: EBBG display)
  • Sulu (Notes: Tianma display)
  • Sven (Notes: Running edge with Phosh, EBBG panel and TIANMA panel)
  • The Arjdroid (Notes: (Daily Driver) not running postmarketOS on it but in general it has very good custom ROM and custom Kernel and custom Recovery support so wouldn't be surprised if things run very well.)
  • The DarkFire (Notes: secondary driver / personal phone, mainline)
  • TheBads (Notes: dead)
  • Toby (Notes: Phosh)
  • UnDevDeCatOS (Notes: goofy aliexpress screen, needs custom dts with tianma screen + ebbg touchscreen, daily driver)
  • Unicorncou (Notes: Works well, just need battery to not drain constantly)
  • Venji10
  • Wann (Notes: Unlocked - Running Gnome Mobile - Bootloop)
  • Weeweezzz (Notes: Wifi problem)
  • Wizzdom (Notes: Tianma-Panel, Tinkering with Sxmo)