How to turn it on Camera2 API Xiaomi smartphones: a complete guide with proven methods

Mobile app developers and photography enthusiasts often face the limitations of the standard Camera. API on Xiaomi smartphones. Camera2 API Opens access to advanced camera features: manual shutter speed setting, ISO, RAW-shooting and supporting third-party applications like Google Camera (GCam), but by default this interface is disabled in the firmware MIUI HyperOS – the manufacturer blocks it for β€œstability".

In this article you will find the most relevant ways to activate Camera2 API on Xiaomi, Redmi and other devices POCO (including the 2023-2026 models on Snapdragon and Mediatek. ADB, Important: the procedure requires technical preparation - incorrect actions can lead to loss of warranty or "brick" of the device.

What is it? Camera2 API Why do you want to include it on Xiaomi?

Camera2 API β€” It is a modern software interface from Google, which replaces the outdated Camera1 API (The de facto standard on most Xiaomi smartphones is out of the box:

  • πŸ“Έ Manual control of shooting parameters: exposure up to 30 seconds, ISO 50 to 25600, white balance in Kelvin.
  • πŸ” Support RAW (DNG): saving raw data from the matrix for post-processing in Lightroom or Darktable.
  • πŸ€– GCam Compatibility: The ability to use ported versions of Google Camera with algorithms HDR+ Night Sight.
  • πŸŽ₯ Advanced video features: logarithmic profile, 10-bit color, external microphones.

Xiaomi. Camera2 API Default is disabled even on flagships like Xiaomi 14 Ultra or Redmi K70 The manufacturer is motivated by β€œoptimizing performance”, but the real reason is the desire to promote their own software (Mi Camera) and limit users to the ecosystem. MIUI.

⚠️ Attention: Activation Camera2 API This can cause a standard camera application to work in an unstable manner, POCO X5 Pro) after the interface is turned on, support is lost 4K@60fps stock-chamber.

Before you start, check if your device supports Camera2 API It's at the hardware level:

  1. Install the app AIDA64 or Camera2 Probe from Google Play.
  2. Open the Camera section and find the Hardware Support Level bar.
  3. If so, LEGACY β€” No hardware support (the methods from the article will not help). LIMITED or FULL β€” continue.
πŸ“Š Your Xiaomi model supports your Camera2 API hardware-level?
Yes, FULL
Yes, LIMITED
No, LEGACY
I don't know, I haven't.

Preparation of the device: unlocking the loader and ADB

Most activation methods Camera2 API Requires an unlocked bootloader and access to the ADB (Without it, you can only check the current status of the interface, but not change it.

Step 1: Unlock the bootloader

On Xiaomi devices, the bootloader is locked by default.

  1. Link your Mi Account to your device in Settings β†’ Xiaomi Account.
  2. Go to Settings β†’ About Phone β†’ MIUI version and tap 7 times on the line to activate Developer Mode.
  3. Return to Settings β†’ Additional β†’ For developers and enable OEM Unlock and USB Debugging.
  4. Download the official utility Mi Unlock (requires a Windows PC).
  5. Connect your phone in Fastboot mode (press Power + Volume down when the device is off) and follow the program instructions.

⚠️ Attention: Unlocking the bootloader resets the device to factory settings. Data backup is mandatory! on some models (e.g. Xiaomi) 13T) When the Widevine is unblocked, it stops working. L1 (descend L3), What is blocking viewing of Full HD Netflix and Disney+.

Step 2: Setup ADB

To work with ADB on PC:

  1. Download Google’s Platform Tools and unpack it to the root of the disk C:\ (The path should not contain gaps).
  2. Connect your phone to your PC, select File Transfer (MTP) mode.
  3. Open the command line (Win + R β†’ enter cmd) and do:
cd C:\platform-tools


adb devices

If the device is displayed in the list β€” ADB If not, install Xiaomi drivers manually through Device Manager.

Unlocked bootloader (bootloader)

USB debugging enabled

Installed Platform Tools on PC

The device is defined in ADB (team `adb devices`)

Data backup created-->

Method 1: Activation Camera2 API through ADB (rootless)

The safest way to turn on Camera2 API β€” use ADB-It works with most Xiaomi devices. MIUI 12-15 and HyperOS, but may reset after a firmware update.

Instructions:

  1. Connect your phone to your PC and make sure that ADB recognizes the device (the adb device command).
  2. Run a command to check the current status:
adb shell getprop persist.camera.HAL3.enabled

If answer 0, the interface is disabled. Type:

adb shell setprop persist.camera.HAL3.enabled 1


adb shell setprop persist.vendor.camera.HAL3.enabled 1

  1. Reset the device:
adb reboot

After the reboot, check the status again. If the command returns 1 β€” Camera2 API activated.

Challenges and solutions:

  • πŸ”„ Reset after update: Setprop commands are temporary. To fix changes, you need to edit the build.prop file).
  • 🚫 Read-only file system error: Some firmware (HyperOS 1.0) mounts the file system in read-only mode. The solution is to use Magisk to mount the system in read-only mode. RW.
  • πŸ“± Not working on Mediatek: On Mediatek chipsets (e.g. Redmi Note 12 Pro)+) You may need an additional patch through TWRP.

πŸ’‘

If, after activation, Camera2 API The standard camera app stopped running, clear its cache in Settings β†’ Annexes β†’ Camera. β†’ Warehouse β†’ Clear the cache.

Method 2: Edit build.prop (root required)

For continuous activation Camera2 API You need to edit the system file build.prop. This method requires root rights, which can be obtained through Magisk after unlocking the bootloader.

Step-by-step:

  1. Install Magisk and get root access (see XDA Developers for instructions for your model).
  2. Download any file manager with root support (such as Root Explorer or Mixplorer).
  3. Move to the /system/build.prop and find the lines:
persist.camera.HAL3.enabled=0


persist.vendor.camera.HAL3.enabled=0

  1. Replace 0 by 1 and save the file.
  2. Change the file access permissions to 644 (long press). β†’ Permissions).
  3. Reset the device.

If you don’t have strings, add them to the end of the build.prop file. For HyperOS devices, you may need to edit an additional file. /vendor/build.prop.

Risks and cautions:

  • πŸ’€ Device Brick: Incorrect editing build.prop can lead to a download cycle.Always back up the file!
  • πŸ”’ Loss of loss OTA-Updates: Changing system files will block the installation of updates "over the air." You will have to install firmware manually through Fastboot.
  • πŸ“‰ Performance issues: On weak devices (e.g. Redmi) 9A) Camera2 API It can cause lags when shooting in RAW.
How to restore build.prop after an error?
If after editing build.prop the phone does not boot, download to TWRP, Connect to the PC through ADB and do: adb pull /system/build.prop adb push build.prop.bak /system/build.prop adb shell chmod 644 /system/build.prop where build.prop.bak is your backup.

Method 3: Installation of a custom core or firmware

If the previous methods did not work, there remains a radical solution - installing a custom core or firmware with pre-activated Camera2 API. This method is suitable for experienced users and requires:

  • πŸ”“ Unlocked loader.
  • πŸ›  Installed TWRP ornamental.
  • ⚠️ Understanding the risks (possible loss of warranty, unstable operation of the camera module).
FirmwareSupport Camera2 APIRoot is required.Compatibility
Pixel ExperienceFULLNo.Most Xiaomi devices (official and unofficial builds)
LineageOSLIMITED/FULLNo.Limited list of models (check on the XDA)
crDroidFULLNo.Flagships and the Middle Segment (Xiaomi) 12T, POCO F5)
MIUI EU (unofficial)LIMITEDNo.All devices. Xiaomi/Redmi/POCO, but with the risk of account bans
KernelSU + patchesFULLYes.Any device with KernelSU support

Installation instructions:

  1. Download the right firmware for your model with XDA Developers or Telegram channels (e.g. Pixel Experience for Xiaomi 13).
  2. Reboot to TWRP (Put Power + Volume up when the phone is off).
  3. Make a backup of the current firmware (Backup) β†’ Select sections β†’ Swipe to Backup).
  4. Flip the firmware through Install β†’ Choose. ZIP β†’ Swipe to Confirm Flash.
  5. After installation, run the Wipe β†’ Format Data (required, otherwise the system will not boot!).

⚠️ Note: Unofficial firmware may contain vulnerabilities or spyware. download only from verified sources (official groups in Telegram, topics on the Internet). XDA On some models (Redmi Note 11 Pro)+) Custom firmware breaks the main camera – check reviews before installing.

Verification of work Camera2 API and GCam tuning

After activation Camera2 API You need to check its performance and configure third-party applications (for example, Google Camera).

Step 1: Checking through Camera2 Probe

Install the app Camera2 API Probe from Google Play and pay attention to the following options:

  • Hardware Support Level: Must be LIMITED or FULL.
  • RAW Support: YES (if you're planning to shoot in DNG).
  • Manual Sensor: YES (manually ISO/extraction).
  • Manual Lens: YES (manually focused).

If any parameters are marked as NO, Your device does not support them at the hardware level (even after activation). Camera2 API).

Step 2: Install and configure Google Camera

For maximum quality of photos:

  1. Download the compatible version of GCam for your model (recommended builds:
  • πŸ“± Xiaomi 13/14 series: BSG GCam or Shamim GCam.
  • πŸ“± Redmi K60/K70: Wichaya GCam.
  • πŸ“± POCO F4/F5: Nikita GCam.
  1. Install. APK-file (permission to install from unknown sources may be required).
  2. Import. XML-Config for your model (download on Celso Azevedo or XDA).
  3. In the GCam settings, enable:
Activate Camera2 API (under "Developer Settings")


Insert HDR+ Enhanced




Select a processing model (e.g., "Pixel 7 Pro" for flagships)




Activate Night Sight for the front camera

On some devices (Redmi Note 12 Pro) GCam may not start due to conflict with the GCam. MIUI Camera.The solution is to disable the camera's stock app through ADB:

adb shell pm disable-user --user 0 com.miui.camera

πŸ’‘

Even after successful activation Camera2 API some functions of GCam (for example, 8K-Video or Astrophotography may not work due to chipset hardware limitations or drivers.

Frequent problems and their solutions

Activation Camera2 API Xiaomi is often accompanied by errors. Let's look at typical scenarios and ways to fix them.

Problem 1: The camera stopped working after turning on Camera2 API

Symptoms:

  • The camera's stock app gives an error "Can't connect to the camera."
  • When GCam is launched, a message appears: "Camera" API2 not supported".

Decisions:

  1. Clear the cache and data of the camera app in Settings β†’ Annexes.
  2. Reverse changes to build.prop (if you edited it).
  3. Install an alternative camera app (such as Open Camera or Footage).

Problem 2: RAW-shooting's down

Reasons:

  • Chipset does not support preservation RAW (For example, Snapdragon 6xx series).
  • No line in build.prop persist.camera.raw.enabled=1.
  • The camera app is not optimized for your model.

Decisions:

adb shell setprop persist.camera.raw.enabled 1


adb shell setprop persist.vendor.camera.raw.enabled 1

Restart the device and check for the option. RAW Open Camera or GCam.

Problem 3: After the update MIUI Camera2 API throw off

Firmware MIUI And HyperOS often resets custom build.prop settings after the upgrade:

  • Turn off automatic updates in Settings β†’ The phone. β†’ Updating the system.
  • Use Magisk to create a module that will apply patches after each reboot.
  • Install a custom Recovery (TWRP) and flash updates manually, pre-save build.prop.
How to Create a Magisk Module for Automatic Activation Camera2 API?
1. Download the module template from GitHub Magisk. 2. In the module folder, create a file service.sh linear: #!/system/bin/sh resetprop persist.camera.HAL3.enabled 1 resetprop persist.vendor.camera.HAL3.enabled 1 3. Pack the folder in. ZIP And you can run it through Magisk, which is the Modules section, and it will apply the settings every time you turn on your phone.

Can I include? Camera2 API on Xiaomi without unlocking the bootloader?
No, all working methods require either an unlocked bootloader or root rights. Without this, you can only check the current status of the interface through the Internet. Camera2 Probe, but not change it. The exception is some custom firmware (for example, Pixel Experience), which is installed on top of the stock. MIUI without unlocking, but it is risky and can lead to a "brick".
Why not after the switch on Camera2 API Zoom's gone in the stock chamber?
On some devices (Xiaomi 12 Pro, Redmi) K50 Ultra) activation Camera2 API disables the hardware processing of zoom, as the stock app Mi Camera optimized for Camera1 API. Solution: Use GCam with multi-camera support (e.g. builds from the BSG). Edit build.prop by adding the line persist.camera.zoom.enabled=1. Go back to Camera1 API, If the zoom is critical to you.
Will it work? Camera2 API Xiaomi with a Mediatek processor?
Yes, but with reservations: On Mediatek Dimensity chipsets (e.g. Redmi Note 12 Pro)+) Camera2 API It is activated by standard methods, but may not support RAW And manual focus. On budget Helio Gs (like Redmi). 10A) The interface will turn on, but most functions will be locked at the hardware level (Hardware Support Level: LEGACY). GCam requires a dedicated library (libarcore) to run on Mediatek, which must be stitched separately. Before activating, check the compatibility of your model on forums. XDA or in Telegram chats (for example, Mediatek GCam Development).
How to roll back changes and return Camera1 API?
To return everything as it was, do: For temporary changes (ADB): adb shell setprop persist.camera.HAL3.enabled 0 adb shell setprop persist.vendor.camera.HAL3.enabled 0 For permanent changes (build.prop): adb shell su mount -o rw,remount /system sed -i 's/persist.camera.HAL3.enabled=1/persist.camera.HAL3.enabled=0/g' /system/build.prop reboot If the stock camera doesn’t work after rollback, reset the app settings or reinstall the firmware via Fastboot.
Which Xiaomi models are best supported Camera2 API?
User reviews and tests on XDA, better Camera2 API (level FULL) Implemented on the following devices: Chipset Model Support Level Xiaomi Notes 13 Ultra Snapdragon 8 Gen 2 FULL Supports 8K RAW and dual-native ISO Xiaomi 12S Ultra Snapdragon 8+ Gen 1 FULL Best GCam compatibility among flagships POCO F5 Pro Snapdragon 8+ Gen 1 FULL Requires a patch for stable operation 4K@60fps Redmi K60 Pro Snapdragon 8+ Gen 1 FULL Problems with HDR+ in GCam on stock firmware Xiaomi 11T Pro Snapdragon 888 LIMITED No support. RAW10, only RAW12 On budget models (Redmi Note) 11, POCO M5) level of support usually LIMITED, a on devices with Snapdragon 4xx or Helio G35 β€” LEGACY.